text:
package com.lorandszakacs.sg.exporter

import java.nio.file.{Path, Paths}

import com.lorandszakacs.sg.model.{M, Name}
import com.lorandszakacs.util.files.FileUtils
import com.lorandszakacs.util.effects._

/**
  *
  * @author Lorand Szakacs, lsz@lorandszakacs.com
  * @since 17 Jul 2016
  *
  */
trait SGExporter {
  def prettyPrint(name: Name): IO[String]

  /**
    * Only exports the given [[Name]]s. with the data
    * that is available in the system
    *
    * It will recreate the:
    * ./[[ExporterSettings.favoritesRootFolderPath]]/index.html
    * ./[[ExporterSettings.allMsRootFolderPath]]/index.html
    * Taking into consideration *all* Ms, and *all favorites*, not just the
    * ones specified.
    *
    * But *all* corresponding M specific folders as specified by the M names,
    * will be created.
    *
    * @return
    */
  def exportHTMLOfOnlyGivenSubsetOfMs(ms: List[Name])(implicit ws: ExporterSettings): IO[Unit]

  /**
    * Only exports the given [[M]]s.
    *
    * It will recreate the:
    * ./[[ExporterSettings.favoritesRootFolderPath]]/index.html
    * ./[[ExporterSettings.allMsRootFolderPath]]/index.html
    * Taking into consideration *all* Ms, and *all favorites*, not just the
    * ones specified.
    *
    * But *all* corresponding M specific folders as specified by the M names,
    * will be created.
    *
    * @return
    */
  def exportDeltaHTMLOfMs(ms: List[M])(implicit ws: ExporterSettings): IO[Unit]

  /**
    * Create a navigable HTML webpage at [[ExporterSettings.favoritesRootFolderPath]]
    *
    */
  def exportHTMLIndexOfFavorites(implicit ws: ExporterSettings): IO[Unit]

  /**
    * Create a navigable HTML webpage at [[ExporterSettings.allMsRootFolderPath]]
    */
  def exportHTMLIndexOfAllMs(implicit ws: ExporterSettings): IO[Unit]

  /**
    * Creates and HTML webpage at [[ExporterSettings.newestRootFolderPath]] containing
    * the newest sets, grouped per days, for the past ``nrOfDays``.
    */
  def exportLatestForDays(
    nrOfDays:    Int,
    favorites:   Set[Name],
  )(implicit ws: ExporterSettings): IO[Unit]

  /**
    * Same as [[exportLatestForDays]] but adds in to the already existing Ms
    * the delta passed as parameter
    */
  def exportLatestForDaysWithDelta(
    nrOfDays:  Int,
    delta:     List[M],
    favorites: Set[Name],
  )(
    implicit ws: ExporterSettings,
  ): IO[Unit]

}

object ExporterSettings {

  def apply(
    favoritesRootFolderPath: String,
    allMsRootFolderPath:     String,
    newestRootFolderPath:    String,
    rewriteEverything:       Boolean,
  ): ExporterSettings = {
    new ExporterSettings(
      favoritesRootFolderPath = Paths.get(FileUtils.normalizeHomePath(favoritesRootFolderPath)).toAbsolutePath,
      allMsRootFolderPath     = Paths.get(FileUtils.normalizeHomePath(allMsRootFolderPath)).toAbsolutePath,
      newestRootFolderPath    = Paths.get(FileUtils.normalizeHomePath(newestRootFolderPath)).toAbsolutePath,
      rewriteEverything       = rewriteEverything,
    )
  }
}

/**
  *
  * @param favoritesRootFolderPath
  * this folder has to exist!
  * @param rewriteEverything
  * if true, then everything in the rootFolderPath will be deleted,
  * then rewritten. if false, then the rootFolderPath has to be empty
  */
final class ExporterSettings private (
  val favoritesRootFolderPath: Path,
  val allMsRootFolderPath:     Path,
  val newestRootFolderPath:    Path,
  val rewriteEverything:       Boolean,
)


text:
package com.vmware.vim25;

/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/

@SuppressWarnings("all")
public class StorageIORMInfo extends DynamicData {
  public boolean enabled;
  public String congestionThresholdMode;
  public int congestionThreshold;
  public Integer percentOfPeakThroughput;
  public Boolean statsCollectionEnabled;
  public Boolean statsAggregationDisabled;

  public boolean isEnabled() {
    return this.enabled;
  }

  public String getCongestionThresholdMode() {
    return this.congestionThresholdMode;
  }

  public int getCongestionThreshold() {
    return this.congestionThreshold;
  }

  public Integer getPercentOfPeakThroughput() {
    return this.percentOfPeakThroughput;
  }

  public Boolean getStatsCollectionEnabled() {
    return this.statsCollectionEnabled;
  }

  public Boolean getStatsAggregationDisabled() {
    return this.statsAggregationDisabled;
  }

  public void setEnabled(boolean enabled) {
    this.enabled=enabled;
  }

  public void setCongestionThresholdMode(String congestionThresholdMode) {
    this.congestionThresholdMode=congestionThresholdMode;
  }

  public void setCongestionThreshold(int congestionThreshold) {
    this.congestionThreshold=congestionThreshold;
  }

  public void setPercentOfPeakThroughput(Integer percentOfPeakThroughput) {
    this.percentOfPeakThroughput=percentOfPeakThroughput;
  }

  public void setStatsCollectionEnabled(Boolean statsCollectionEnabled) {
    this.statsCollectionEnabled=statsCollectionEnabled;
  }

  public void setStatsAggregationDisabled(Boolean statsAggregationDisabled) {
    this.statsAggregationDisabled=statsAggregationDisabled;
  }
}

redpajama_set_name: RedPajamaGithub


text:
<head>
    <title>TechChapsPortal-Portal</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">
    <link rel="shortcut icon" href="/images/logo.svg">
</head>
<template name="basic">
    {{> meteorisFlash}}
    <div class="meteoris-content">
        <!--{{>yield region="templateBasicHeader"}}-->
        {{> stickyNav}}
        {{> templateBasicHeader}}
        {{> status}}
        {{>yield}}
    </div>
    <!--{{>yield region="templateBasicFooter"}}-->
    {{> templateBasicFooter}}
</template>


text:
This is a fortune-telling watchface for the Pebble watch which operates
similarly to the famous Magic 8 Ball toy. The current time and date is
displayed until the wrist is flicked after which the answer to a yes/no
question is displayed for 10 seconds.

## Screenshots

![Outlook not so good](screenshots/pebble-screenshot_2013-11-18_14-34-47.png)

![Signs point to yes](screenshots/pebble-screenshot_2013-11-18_14-33-10.png)

![Time and date](screenshots/pebble-screenshot_2013-11-18_14-32-56.png)


text:
package org.jug.brainmaster.ejb;

import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;

import org.hibernate.Hibernate;
import org.jug.brainmaster.model.GrandPrizeCandidate;
import org.jug.brainmaster.model.PrizeList;
import org.jug.brainmaster.model.Registrant;
import org.jug.brainmaster.model.Winners;

@Stateless
@LocalBean
public class GrandPrizeCandidateServiceBean {

  private static final String SELECT_CANDIDATE_WITH_MAIL =
      "from GrandPrizeCandidate candidate where candidate.emailAddress = :emailAddress";

  private static final String SELECT_CURRENT_CANDIDATE_WITH_MAIL =
      SELECT_CANDIDATE_WITH_MAIL + " and candidate.current = true";

  @PersistenceContext
  private EntityManager em;

  @Inject
  private Logger log;

  @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
  public boolean claimPrize(String emailAddress) {
    GrandPrizeCandidate grandPrizeWinner = null;
    long start = System.nanoTime();
    try {
      grandPrizeWinner =
          em.createQuery(SELECT_CURRENT_CANDIDATE_WITH_MAIL, GrandPrizeCandidate.class)
          .setParameter("emailAddress", emailAddress).getSingleResult();
    } catch (NoResultException e) {
      log.log(Level.FINER, "select NO_RESULT candidate with mail : " + emailAddress + ", for "
          + (System.nanoTime() - start) / 1000000 + " millis");
      return false;
    }
    if (grandPrizeWinner == null) {
      log.log(Level.FINER, "select NULL candidate with mail : " + emailAddress + ", for "
          + (System.nanoTime() - start) / 1000000 + " millis");
      return false;
    }
    try {
      log.log(Level.FINE,
          "email address : " + emailAddress + " is valid try to save it as claimed");
      Hibernate.initialize(grandPrizeWinner.getPrizeList());
      Hibernate.initialize(grandPrizeWinner.getRegistrant());
      Winners winner = new Winners();
      winner.setPrize(grandPrizeWinner.getPrizeList());
      winner.setRegistrant(grandPrizeWinner.getRegistrant());
      em.persist(winner);

      grandPrizeWinner.setClaimed(true);
      grandPrizeWinner.setCurrent(false);
      saveOrUpdate(grandPrizeWinner);
      log.log(Level.FINE, "select VALID candidate with mail : " + emailAddress + ", for "
          + (System.nanoTime() - start) / 1000000 + " millis");
    } catch (Exception e) {
      log.log(Level.WARNING,
          "something wrong when claim process try to update value for email address : "
              + emailAddress,
              e);
      log.log(Level.SEVERE, "show stack trace to analyze error", e);
    }
    return true;
  }

  @TransactionAttribute(TransactionAttributeType.REQUIRED)
  public void clearCurrent() {
    List<GrandPrizeCandidate> candidates =
        em.createQuery("from GrandPrizeCandidate", GrandPrizeCandidate.class).getResultList();
    for (GrandPrizeCandidate grandPrizeCandidate : candidates) {
      grandPrizeCandidate.setCurrent(false);
      em.persist(grandPrizeCandidate);
    }
    em.flush();
  }

  @TransactionAttribute(TransactionAttributeType.REQUIRED)
  public int countAllCandidate() {
    return em.createQuery("select count(candidate.id) from GrandPrizeCandidate candidate")
        .getFirstResult();
  }

  @TransactionAttribute(TransactionAttributeType.REQUIRED)
  public void delete(GrandPrizeCandidate candidate) {
    GrandPrizeCandidate existingCandidate = findById(candidate.getId());
    if (existingCandidate != null) {
      em.remove(existingCandidate);
      em.flush();
    }
  }

  @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
  public GrandPrizeCandidate findByEmailAddress(String emailAddress) {
    GrandPrizeCandidate existingCandidate =
        em.createQuery(SELECT_CANDIDATE_WITH_MAIL, GrandPrizeCandidate.class)
        .setParameter("emailAddress", emailAddress).getSingleResult();
    // GrandPrizeCandidate resultCandidate = new GrandPrizeCandidate();
    if (existingCandidate != null) {
      Hibernate.initialize(existingCandidate.getRegistrant());
      Hibernate.initialize(existingCandidate.getPrizeList());
      // resultCandidate.setClaimed(existingCandidate.isClaimed());
      // resultCandidate.setCurrent(existingCandidate.isCurrent());
      // resultCandidate.setEmailAddress(existingCandidate.getEmailAddress());
      // resultCandidate.setId(existingCandidate.getId());
      // resultCandidate.setPrizeList(existingCandidate.getPrizeList());
      // resultCandidate.setRegistrant(existingCandidate.getRegistrant());
      // } else {
      // return null;
    }
    // return resultCandidate;
    return existingCandidate;
  }

  @TransactionAttribute(TransactionAttributeType.REQUIRED)
  public GrandPrizeCandidate findById(Long id) {
    GrandPrizeCandidate candidate = em.find(GrandPrizeCandidate.class, id);
    if (candidate != null) {
      Hibernate.initialize(candidate.getPrizeList());
      Hibernate.initialize(candidate.getRegistrant());
    }
    return candidate;
  }

  @TransactionAttribute(TransactionAttributeType.REQUIRED)
  public List<GrandPrizeCandidate> getAllCandidateWithPagination(int rowSize, int pageNumber) {
    List<GrandPrizeCandidate> candidates = new ArrayList<GrandPrizeCandidate>();
    int startPosition = (pageNumber - 1) * rowSize;
    candidates = em
        .createQuery("from GrandPrizeCandidate candidate ORDER BY candidate.id",
            GrandPrizeCandidate.class)
        .setFirstResult(startPosition).setMaxResults(rowSize).getResultList();
    return candidates;
  }

  public List<GrandPrizeCandidate> getCandidateForGrandPrize(PrizeList prizeList) {
    PrizeList existingPrizeList = em.find(PrizeList.class, prizeList.getId());
    return em.createQuery(
        "from GrandPrizeCandidate candidate where candidate.prizeList = :prizeList  ORDER BY candidate.id",
        GrandPrizeCandidate.class).setParameter("prizeList", existingPrizeList).getResultList();
  }

  @TransactionAttribute(TransactionAttributeType.REQUIRED)
  public void putCurrent(GrandPrizeCandidate candidate) {
    GrandPrizeCandidate existingCandidate = findById(candidate.getId());
    if (existingCandidate != null) {
      existingCandidate.setCurrent(true);
      em.persist(existingCandidate);
      em.flush();
    }
  }

  @TransactionAttribute(TransactionAttributeType.REQUIRED)
  public void saveOrUpdate(GrandPrizeCandidate candidate) throws Exception {
    if (candidate.getId() != null && candidate.getRegistrant() != null
        && candidate.getPrizeList() != null) {
      GrandPrizeCandidate existingCandidate = em.find(GrandPrizeCandidate.class, candidate.getId());
      Registrant registrant =
          em.getReference(Registrant.class, candidate.getRegistrant().getVoucherCode());
      existingCandidate.setRegistrant(registrant);
      PrizeList prizeList = em.getReference(PrizeList.class, candidate.getPrizeList().getId());
      existingCandidate.setPrizeList(prizeList);
      existingCandidate.setCurrent(candidate.isCurrent());
      existingCandidate.setClaimed(candidate.isClaimed());
      existingCandidate.setEmailAddress(candidate.getEmailAddress());
      candidate = existingCandidate;
    }
    em.persist(candidate);
  }

}


text:
"""Configuration file for Sphinx."""
#
# (C) Pywikibot team, 2015-2016
#
# Distributed under the terms of the MIT license.
#
# Pywikibot documentation build configuration file, created by
# sphinx-quickstart on Wed Nov  5 15:50:05 2014.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
from __future__ import absolute_import, unicode_literals

import os
import sys

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))

# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#  needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc',
              'sphinx_epytext',
              'sphinx.ext.todo',
              'sphinx.ext.coverage',
              'sphinx.ext.viewcode']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix of source filenames.
source_suffix = '.rst'

# The encoding of source files.
#  source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'Pywikibot'
copyright = '2016, Pywikibot team'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '2.0'
# The full version, including alpha/beta/rc tags.
release = '2.0rc1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#  language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#  today = ''
# Else, today_fmt is used as the format for a strftime call.
#  today_fmt = '%B %d, %Y'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']

# The reST default role (used for this markup: `text`) to use for all documents.
#  default_role = None

# If true, '()' will be appended to :func: etc. cross-reference text.
#  add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#  add_module_names = True

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#  show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# A list of ignored prefixes for module index sorting.
#  modindex_common_prefix = []

# -- Options for HTML output ---------------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
html_theme = 'alabaster'

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
#  html_theme_options = {}

# Add any paths that contain custom themes here, relative to this directory.
#  html_theme_path = []

# The name for this set of Sphinx documents.  If None, it defaults to
# "<project> v<release> documentation".
#  html_title = None

# A shorter title for the navigation bar.  Default is the same as html_title.
#  html_short_title = None

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#  html_logo = None

# The name of an image file (within the static path) to use as favicon of the
# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#  html_favicon = None

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#  html_static_path = ['_static']

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#  html_last_updated_fmt = '%b %d, %Y'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#  html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
#  html_sidebars = {}

# Additional templates that should be rendered to pages, maps page names to
# template names.
#  html_additional_pages = {}

# If false, no module index is generated.
#  html_domain_indices = True

# If false, no index is generated.
#  html_use_index = True

# If true, the index is split into individual pages for each letter.
#  html_split_index = False

# If true, links to the reST sources are added to the pages.
#  html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#  html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#  html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it.  The value of this option must be the
# base URL from which the finished HTML is served.
#  html_use_opensearch = ''

# This is the file name suffix for HTML files (e.g. ".xhtml").
#  html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'Pywikibotdoc'

# -- Options for LaTeX output --------------------------------------------------

latex_elements = {}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
    ('index', 'Pywikibot.tex', u'Pywikibot Documentation',
     u'Pywikibot team', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
#  latex_logo = None

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#  latex_use_parts = False

# If true, show page references after internal links.
#  latex_show_pagerefs = False

# If true, show URL addresses after external links.
#  latex_show_urls = False

# Documents to append as an appendix to all manuals.
#  latex_appendices = []

# If false, no module index is generated.
#  latex_domain_indices = True

# -- Options for manual page output --------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
    ('index', 'pywikibot', u'Pywikibot Documentation',
     [u'Pywikibot team'], 1)
]

# If true, show URL addresses after external links.
#  man_show_urls = False

# -- Options for Texinfo output ------------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
#  dir menu entry, description, category)
texinfo_documents = [
    ('index', 'Pywikibot', u'Pywikibot Documentation',
     u'Pywikibot team', 'Pywikibot', 'One line description of project.',
     'Miscellaneous'),
]

# Documents to append as an appendix to all manuals.
#  texinfo_appendices = []

# If false, no module index is generated.
#  texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#  texinfo_show_urls = 'footnote'

def pywikibot_env():
    """Allow pywikibot modules to be imported without a user-config.py."""
    os.environ['PYWIKIBOT2_NO_USER_CONFIG'] = '1'

def pywikibot_script_docstring_fixups(
        app, what, name, obj, options, lines):
    """Pywikibot specific conversions."""
    if what != "module":
        return

    if os.path.sep + "scripts" + os.path.sep not in obj.__file__:
        return
    for index, line in enumerate(lines):
        if line in ('&params;', '&pagegenerators_help;'):
            lines[index] = ('This script supports use of '
                            ':py:mod:`pywikibot.pagegenerators` arguments.')
        elif line == '&fixes-help;':
            lines[index] = ('                  The available fixes are listed '
                            'in :py:mod:`pywikibot.fixes`.')
        elif (line.endswith(':') and not line.strip().startswith(':') and
                'Traceback (most recent call last)' not in line):
            lines[index] = line + ':'
        elif line.startswith('-'):
            # Indent options
            lines[index] = ' ' + line
        elif line.startswith('                '):
            # Indent description of options (as options are indented)
            lines[index] = line.replace('                ', '                 ')
        elif line.strip().startswith('python'):
            # Indent commands
            lines[index] = '  ' + line.strip()

def setup(app):
    """Implicit Sphinx extension hook."""
    app.connect('autodoc-process-docstring', pywikibot_script_docstring_fixups)

pywikibot_env()


text:
package com.google.cloud.networkconnectivity.v1alpha1.samples;

// [START networkconnectivity_v1alpha1_generated_HubService_GetSpoke_String_sync]
import com.google.cloud.networkconnectivity.v1alpha1.HubServiceClient;
import com.google.cloud.networkconnectivity.v1alpha1.Spoke;
import com.google.cloud.networkconnectivity.v1alpha1.SpokeName;

public class SyncGetSpokeString {

  public static void main(String[] args) throws Exception {
    syncGetSpokeString();
  }

  public static void syncGetSpokeString() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
      String name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
      Spoke response = hubServiceClient.getSpoke(name);
    }
  }
}
// [END networkconnectivity_v1alpha1_generated_HubService_GetSpoke_String_sync]


text:
package ca.carleton.gcrc.utils;

import java.io.StringReader;
import java.io.StringWriter;
import java.util.Properties;

import junit.framework.TestCase;
import ca.carleton.gcrc.utils.comparator.PropertiesComparator;

public class PropertiesWriterTest extends TestCase {

	public void testWrite() throws Exception {
		// Create a test properties
		Properties props = new Properties();
		props.setProperty("abc", "def");
		props.setProperty("123", "456");

		// Save properties
		StringWriter sw  = new StringWriter();
		PropertiesWriter propWriter = new PropertiesWriter(sw);
		propWriter.write(props);

		// Read back in properties
		StringReader sr = new StringReader(sw.toString());
		Properties propCopy = new Properties();
		propCopy.load(sr);

		// Compare both
		PropertiesComparator comp = new PropertiesComparator();
		if( 0 != comp.compare(props, propCopy) ) {
			fail("Properties not saved correctly");
		}
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<PRONOM-Report xmlns="http://pronom.nationalarchives.gov.uk">
  <report_format_detail>
    <FileFormat>
      <FormatID>1742</FormatID>
      <FormatName>Adobe Air</FormatName>
      <FormatVersion>1.0</FormatVersion>
      <FormatAliases>
      </FormatAliases>
      <FormatFamilies>
      </FormatFamilies>
      <FormatTypes>
      </FormatTypes>
      <FormatDisclosure>
      </FormatDisclosure>
      <FormatDescription>Adobe Air, formerly codenamed Apollo, is a cross-platform runtime system developed by Adobe Systems for building desktop applications and mobile applications, programmed using Adobe Flash, ActionScript and optionally Apache Flex.</FormatDescription>
      <BinaryFileFormat>
      </BinaryFileFormat>
      <ByteOrders>
      </ByteOrders>
      <ReleaseDate>
      </ReleaseDate>
      <WithdrawnDate>
      </WithdrawnDate>
      <ProvenanceSourceID>214</ProvenanceSourceID>
      <ProvenanceName>Archives New Zealand / Archives New Zealand</ProvenanceName>
      <ProvenanceSourceDate>13 Jul 2016</ProvenanceSourceDate>
      <ProvenanceDescription>This format can be identified via a container signature in DROID version 6 or later. The PRONOM database cannot currently represent container signatures.</ProvenanceDescription>
      <LastUpdatedDate>13 Jul 2016</LastUpdatedDate>
      <FormatNote>
      </FormatNote>
      <FormatRisk>
      </FormatRisk>
      <TechnicalEnvironment>
      </TechnicalEnvironment>
      <FileFormatIdentifier>
        <Identifier>application/vnd.adobe.air-application-installer-package+zip</Identifier>
        <IdentifierType>MIME</IdentifierType>
      </FileFormatIdentifier>
      <FileFormatIdentifier>
        <Identifier>fmt/937</Identifier>
        <IdentifierType>PUID</IdentifierType>
      </FileFormatIdentifier>
      <Developers>
        <DeveloperID>7</DeveloperID>
        <DeveloperName>
        </DeveloperName>
        <OrganisationName>Adobe Systems Incorporated</OrganisationName>
        <DeveloperCompoundName>Adobe Systems Incorporated</DeveloperCompoundName>
      </Developers>
      <Support>
        <SupportID>7</SupportID>
        <SupportName>
        </SupportName>
        <OrganisationName>Adobe Systems Incorporated</OrganisationName>
        <SupportCompoundName>Adobe Systems Incorporated</SupportCompoundName>
      </Support>
      <ExternalSignature>
        <ExternalSignatureID>1893</ExternalSignatureID>
        <Signature>air</Signature>
        <SignatureType>File extension</SignatureType>
      </ExternalSignature>
    </FileFormat>
    <SearchCriteria>Criteria</SearchCriteria>
  </report_format_detail>
</PRONOM-Report>


text:
package org.async.rmi.modules;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.EventLoopGroup;
import org.async.rmi.config.Configuration;
import org.async.rmi.OneWay;
import org.async.rmi.Trace;
import org.async.rmi.client.RemoteRef;
import org.async.rmi.messages.InvokeRequest;
import org.async.rmi.messages.Response;

import java.io.Closeable;
import java.net.UnknownHostException;
import java.rmi.Remote;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CompletableFuture;

/**
 * Created by Barak Bar Orion
 * 12/10/14.
 */
public interface Transport extends Closeable {

    RemoteRef export(Remote impl, Class[] remoteInterfaces, Configuration configuration, Map<Long, OneWay> oneWayMap,
                     Set<Long> resultSetSet, Map<Long, Trace> traceMap, long objectId) throws UnknownHostException,
            InterruptedException;

    void addResponseFuture(InvokeRequest invokeRequest, CompletableFuture<Response> responseFuture, Trace trace);

    void handleResponse(Response response, ChannelHandlerContext ctx);

    EventLoopGroup getClientEventLoopGroup();

    void listen(ClassLoader cl) throws InterruptedException, UnknownHostException;

    void startClassLoaderServer(ClassLoader cl);

    EventLoopGroup getAcceptGroup();

    EventLoopGroup getWorkerGroup();
}


text:
"""
Cisco Zone Driver is responsible to manage access control using FC zoning
for Cisco FC fabrics.
This is a concrete implementation of FCZoneDriver interface implementing
add_connection and delete_connection interfaces.

**Related Flags**

:zone_activate: Used by: class: 'FCZoneDriver'. Defaults to True
:zone_name_prefix: Used by: class: 'FCZoneDriver'. Defaults to 'openstack'
"""

from oslo_concurrency import lockutils
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import importutils
import six
import string

from cinder import exception
from cinder.i18n import _
from cinder import interface
from cinder.zonemanager.drivers.cisco import cisco_fabric_opts as fabric_opts
from cinder.zonemanager.drivers.cisco import fc_zone_constants as ZoneConstant
from cinder.zonemanager.drivers import driver_utils
from cinder.zonemanager.drivers import fc_zone_driver
from cinder.zonemanager import utils as zm_utils

LOG = logging.getLogger(__name__)

SUPPORTED_CHARS = string.ascii_letters + string.digits + '$' + '-' + '^' + '_'
cisco_opts = [
    cfg.StrOpt('cisco_sb_connector',
               default='cinder.zonemanager.drivers.cisco'
               '.cisco_fc_zone_client_cli.CiscoFCZoneClientCLI',
               help='Southbound connector for zoning operation'),
]

CONF = cfg.CONF
CONF.register_opts(cisco_opts, group='fc-zone-manager')

@interface.fczmdriver
class CiscoFCZoneDriver(fc_zone_driver.FCZoneDriver):
    """Cisco FC zone driver implementation.

    OpenStack Fibre Channel zone driver to manage FC zoning in
    Cisco SAN fabrics.

    Version history:
        1.0 - Initial Cisco FC zone driver
        1.1 - Added friendly zone name support
    """

    VERSION = "1.1.0"

    # ThirdPartySystems wiki name
    CI_WIKI_NAME = "Cisco_ZM_CI"

    def __init__(self, **kwargs):
        super(CiscoFCZoneDriver, self).__init__(**kwargs)
        self.configuration = kwargs.get('configuration', None)
        if self.configuration:
            self.configuration.append_config_values(cisco_opts)

            # Adding a hack to handle parameters from super classes
            # in case configured with multi backends.
            fabric_names = self.configuration.safe_get('fc_fabric_names')
            activate = self.configuration.safe_get('cisco_zone_activate')
            prefix = self.configuration.safe_get('cisco_zone_name_prefix')
            base_san_opts = []
            if not fabric_names:
                base_san_opts.append(
                    cfg.StrOpt('fc_fabric_names',
                               help='Comma separated list of fibre channel '
                               'fabric names. This list of names is used to'
                               ' retrieve other SAN credentials for connecting'
                               ' to each SAN fabric'
                               ))
            if not activate:
                base_san_opts.append(
                    cfg.BoolOpt('cisco_zone_activate',
                                default=True,
                                help='Indicates whether zone should '
                                'be activated or not'))
            if not prefix:
                base_san_opts.append(
                    cfg.StrOpt('cisco_zone_name_prefix',
                               default="openstack",
                               help="A prefix to be used when naming zone"))
            if len(base_san_opts) > 0:
                CONF.register_opts(base_san_opts)
                self.configuration.append_config_values(base_san_opts)
            fabric_names = [x.strip() for x in self.
                            configuration.fc_fabric_names.split(',')]

            # There can be more than one SAN in the network and we need to
            # get credentials for each SAN.
            if fabric_names:
                self.fabric_configs = fabric_opts.load_fabric_configurations(
                    fabric_names)

    @lockutils.synchronized('cisco', 'fcfabric-', True)
    def add_connection(self, fabric, initiator_target_map, host_name=None,
                       storage_system=None):
        """Concrete implementation of add_connection.

        Based on zoning policy and state of each I-T pair, list of zone
        members are created and pushed to the fabric to add zones. The
        new zones created or zones updated are activated based on isActivate
        flag set in cinder.conf returned by volume driver after attach
        operation.

        :param fabric: Fabric name from cinder.conf file
        :param initiator_target_map: Mapping of initiator to list of targets
        """

        LOG.debug("Add connection for Fabric: %s", fabric)
        LOG.info("CiscoFCZoneDriver - Add connection "
                 "for I-T map: %s", initiator_target_map)
        fabric_ip = self.fabric_configs[fabric].safe_get(
            'cisco_fc_fabric_address')
        fabric_user = self.fabric_configs[fabric].safe_get(
            'cisco_fc_fabric_user')
        fabric_pwd = self.fabric_configs[fabric].safe_get(
            'cisco_fc_fabric_password')
        fabric_port = self.fabric_configs[fabric].safe_get(
            'cisco_fc_fabric_port')
        zoning_policy = self.configuration.zoning_policy
        zoning_policy_fab = self.fabric_configs[fabric].safe_get(
            'cisco_zoning_policy')
        if zoning_policy_fab:
            zoning_policy = zoning_policy_fab

        zoning_vsan = self.fabric_configs[fabric].safe_get('cisco_zoning_vsan')

        LOG.info("Zoning policy for Fabric %s", zoning_policy)

        statusmap_from_fabric = self.get_zoning_status(
            fabric_ip, fabric_user, fabric_pwd, fabric_port, zoning_vsan)

        if statusmap_from_fabric.get('session') == 'none':

            cfgmap_from_fabric = self.get_active_zone_set(
                fabric_ip, fabric_user, fabric_pwd, fabric_port, zoning_vsan)
            zone_names = []
            if cfgmap_from_fabric.get('zones'):
                zone_names = cfgmap_from_fabric['zones'].keys()
            # based on zoning policy, create zone member list and
            # push changes to fabric.
            for initiator_key in initiator_target_map.keys():
                zone_map = {}
                zone_update_map = {}
                initiator = initiator_key.lower()
                t_list = initiator_target_map[initiator_key]
                if zoning_policy == 'initiator-target':
                    for t in t_list:
                        target = t.lower()
                        zone_members = [
                            zm_utils.get_formatted_wwn(initiator),
                            zm_utils.get_formatted_wwn(target)]
                        zone_name = (
                            driver_utils.get_friendly_zone_name(
                                zoning_policy,
                                initiator,
                                target,
                                host_name,
                                storage_system,
                                self.configuration.cisco_zone_name_prefix,
                                SUPPORTED_CHARS))
                        if (len(cfgmap_from_fabric) == 0 or (
                                zone_name not in zone_names)):
                            zone_map[zone_name] = zone_members
                        else:
                            # This is I-T zoning, skip if zone exists.
                            LOG.info("Zone exists in I-T mode. "
                                     "Skipping zone creation %s",
                                     zone_name)
                elif zoning_policy == 'initiator':
                    zone_members = [
                        zm_utils.get_formatted_wwn(initiator)]
                    for t in t_list:
                        target = t.lower()
                        zone_members.append(
                            zm_utils.get_formatted_wwn(target))
                    zone_name = (
                        driver_utils.get_friendly_zone_name(
                            zoning_policy,
                            initiator,
                            target,
                            host_name,
                            storage_system,
                            self.configuration.cisco_zone_name_prefix,
                            SUPPORTED_CHARS))

                    # If zone exists, then perform an update_zone and add
                    # new members into existing zone.
                    if zone_name and (zone_name in zone_names):
                        zone_members = filter(
                            lambda x: x not in
                            cfgmap_from_fabric['zones'][zone_name],
                            zone_members)
                        if zone_members:
                            zone_update_map[zone_name] = zone_members
                    else:
                        zone_map[zone_name] = zone_members
                else:
                    msg = _("Zoning Policy: %s, not"
                            " recognized") % zoning_policy
                    LOG.error(msg)
                    raise exception.FCZoneDriverException(msg)

            LOG.info("Zone map to add: %(zone_map)s",
                     {'zone_map': zone_map})
            LOG.info("Zone map to update add: %(zone_update_map)s",
                     {'zone_update_map': zone_update_map})
            if zone_map or zone_update_map:
                conn = None
                try:
                    conn = importutils.import_object(
                        self.configuration.cisco_sb_connector,
                        ipaddress=fabric_ip,
                        username=fabric_user,
                        password=fabric_pwd,
                        port=fabric_port,
                        vsan=zoning_vsan)
                    if zone_map:
                        conn.add_zones(
                            zone_map,
                            self.configuration.cisco_zone_activate,
                            zoning_vsan, cfgmap_from_fabric,
                            statusmap_from_fabric)
                    if zone_update_map:
                        conn.update_zones(
                            zone_update_map,
                            self.configuration.cisco_zone_activate,
                            zoning_vsan, ZoneConstant.ZONE_ADD,
                            cfgmap_from_fabric,
                            statusmap_from_fabric)
                    conn.cleanup()
                except exception.CiscoZoningCliException as cisco_ex:
                    msg = _("Exception: %s") % six.text_type(cisco_ex)
                    raise exception.FCZoneDriverException(msg)
                except Exception:
                    msg = _("Failed to add zoning configuration.")
                    LOG.exception(msg)
                    raise exception.FCZoneDriverException(msg)
                LOG.debug("Zones added successfully: %s", zone_map)
            else:
                LOG.debug("Zones already exist - Initiator Target Map: %s",
                          initiator_target_map)
        else:
            LOG.debug("Zoning session exists VSAN: %s", zoning_vsan)

    @lockutils.synchronized('cisco', 'fcfabric-', True)
    def delete_connection(self, fabric, initiator_target_map, host_name=None,
                          storage_system=None):
        """Concrete implementation of delete_connection.

        Based on zoning policy and state of each I-T pair, list of zones
        are created for deletion. The zones are either updated deleted based
        on the policy and attach/detach state of each I-T pair.

        :param fabric: Fabric name from cinder.conf file
        :param initiator_target_map: Mapping of initiator to list of targets
        """
        LOG.debug("Delete connection for fabric: %s", fabric)
        LOG.info("CiscoFCZoneDriver - Delete connection for I-T map: %s",
                 initiator_target_map)
        fabric_ip = self.fabric_configs[fabric].safe_get(
            'cisco_fc_fabric_address')
        fabric_user = self.fabric_configs[fabric].safe_get(
            'cisco_fc_fabric_user')
        fabric_pwd = self.fabric_configs[fabric].safe_get(
            'cisco_fc_fabric_password')
        fabric_port = self.fabric_configs[fabric].safe_get(
            'cisco_fc_fabric_port')
        zoning_policy = self.configuration.zoning_policy
        zoning_policy_fab = self.fabric_configs[fabric].safe_get(
            'cisco_zoning_policy')

        if zoning_policy_fab:
            zoning_policy = zoning_policy_fab

        zoning_vsan = self.fabric_configs[fabric].safe_get('cisco_zoning_vsan')

        LOG.info("Zoning policy for fabric %s", zoning_policy)

        statusmap_from_fabric = self.get_zoning_status(
            fabric_ip, fabric_user, fabric_pwd, fabric_port, zoning_vsan)

        if statusmap_from_fabric.get('session') == 'none':
            cfgmap_from_fabric = self.get_active_zone_set(
                fabric_ip, fabric_user, fabric_pwd, fabric_port, zoning_vsan)

            zone_names = []
            if cfgmap_from_fabric.get('zones'):
                zone_names = cfgmap_from_fabric['zones'].keys()

            # Based on zoning policy, get zone member list and push
            # changes to fabric. This operation could result in an update
            # for zone config with new member list or deleting zones from
            # active cfg.

            LOG.debug("zone config from Fabric: %s", cfgmap_from_fabric)
            for initiator_key in initiator_target_map.keys():
                initiator = initiator_key.lower()
                formatted_initiator = zm_utils.get_formatted_wwn(initiator)
                zone_update_map = {}
                zones_to_delete = []
                t_list = initiator_target_map[initiator_key]
                if zoning_policy == 'initiator-target':
                    # In this case, zone needs to be deleted.
                    for t in t_list:
                        target = t.lower()
                        zone_name = (
                            driver_utils.get_friendly_zone_name(
                                zoning_policy,
                                initiator,
                                target,
                                host_name,
                                storage_system,
                                self.configuration.cisco_zone_name_prefix,
                                SUPPORTED_CHARS))
                        LOG.debug("Zone name to del: %s", zone_name)
                        if (len(zone_names) > 0 and (zone_name in zone_names)):
                            # delete zone.
                            LOG.debug("Added zone to delete to list: %s",
                                      zone_name)
                            zones_to_delete.append(zone_name)

                elif zoning_policy == 'initiator':
                    zone_members = [formatted_initiator]
                    for t in t_list:
                        target = t.lower()
                        zone_members.append(
                            zm_utils.get_formatted_wwn(target))

                    zone_name = driver_utils.get_friendly_zone_name(
                        zoning_policy,
                        initiator,
                        target,
                        host_name,
                        storage_system,
                        self.configuration.cisco_zone_name_prefix,
                        SUPPORTED_CHARS)
                    # Check if there are zone members leftover after removal
                    if (zone_names and (zone_name in zone_names)):
                        filtered_members = filter(
                            lambda x: x not in zone_members,
                            cfgmap_from_fabric['zones'][zone_name])

                        # The assumption here is that initiator is always
                        # there in the zone as it is 'initiator' policy.
                        # If filtered list is empty, we remove that zone.
                        # If there are other members leftover, then perform
                        # update_zone to remove targets
                        LOG.debug("Zone delete - I mode: filtered targets: %s",
                                  filtered_members)
                        if filtered_members:
                            remove_members = filter(
                                lambda x: x in
                                cfgmap_from_fabric['zones'][zone_name],
                                zone_members)
                            if remove_members:
                                # Do not want to remove the initiator
                                remove_members.remove(formatted_initiator)
                                LOG.debug("Zone members to remove: %s",
                                          remove_members)
                                zone_update_map[zone_name] = remove_members
                                LOG.debug("Filtered zone Map to update: %s",
                                          zone_update_map)
                        else:
                            zones_to_delete.append(zone_name)
                else:
                    LOG.info("Zoning Policy: %s, not recognized",
                             zoning_policy)
                LOG.debug("Zone map to remove update: %s", zone_update_map)
                LOG.debug("Final Zone list to delete: %s", zones_to_delete)
                conn = None
                try:
                    conn = importutils.import_object(
                        self.configuration.cisco_sb_connector,
                        ipaddress=fabric_ip,
                        username=fabric_user,
                        password=fabric_pwd,
                        port=fabric_port,
                        vsan=zoning_vsan)
                    # Update zone membership.
                    if zone_update_map:
                        conn.update_zones(
                            zone_update_map,
                            self.configuration.cisco_zone_activate,
                            zoning_vsan, ZoneConstant.ZONE_REMOVE,
                            cfgmap_from_fabric, statusmap_from_fabric)
                    # Delete zones ~sk.
                    if zones_to_delete:
                        zone_name_string = ''
                        num_zones = len(zones_to_delete)
                        for i in range(0, num_zones):
                            if i == 0:
                                zone_name_string = ('%s%s' % (
                                                    zone_name_string,
                                                    zones_to_delete[i]))
                            else:
                                zone_name_string = ('%s%s%s' % (
                                                    zone_name_string, ';',
                                                    zones_to_delete[i]))

                        conn.delete_zones(zone_name_string,
                                          self.configuration.
                                          cisco_zone_activate,
                                          zoning_vsan, cfgmap_from_fabric,
                                          statusmap_from_fabric)
                    conn.cleanup()
                except Exception:
                    msg = _("Failed to update or delete zoning configuration")
                    LOG.exception(msg)
                    raise exception.FCZoneDriverException(msg)
                LOG.debug("Zones deleted successfully: %s", zone_update_map)
            else:
                LOG.debug("Zoning session exists VSAN: %s", zoning_vsan)

    def get_san_context(self, target_wwn_list):
        """Lookup SAN context for visible end devices.

        Look up each SAN configured and return a map of SAN (fabric IP) to
        list of target WWNs visible to the fabric.
        """
        formatted_target_list = []
        fabric_map = {}
        fabrics = [x.strip() for x in self.
                   configuration.fc_fabric_names.split(',')]
        LOG.debug("Fabric List: %s", fabrics)
        LOG.debug("Target wwn List: %s", target_wwn_list)
        if len(fabrics) > 0:
            for t in target_wwn_list:
                formatted_target_list.append(
                    zm_utils.get_formatted_wwn(t.lower()))
            LOG.debug("Formatted Target wwn List: %s", formatted_target_list)
            for fabric_name in fabrics:
                fabric_ip = self.fabric_configs[fabric_name].safe_get(
                    'cisco_fc_fabric_address')
                fabric_user = self.fabric_configs[fabric_name].safe_get(
                    'cisco_fc_fabric_user')
                fabric_pwd = self.fabric_configs[fabric_name].safe_get(
                    'cisco_fc_fabric_password')
                fabric_port = self.fabric_configs[fabric_name].safe_get(
                    'cisco_fc_fabric_port')
                zoning_vsan = self.fabric_configs[fabric_name].safe_get(
                    'cisco_zoning_vsan')

                # Get name server data from fabric and get the targets
                # logged in.
                nsinfo = None
                try:
                    conn = importutils.import_object(
                        self.configuration.cisco_sb_connector,
                        ipaddress=fabric_ip,
                        username=fabric_user,
                        password=fabric_pwd, port=fabric_port,
                        vsan=zoning_vsan)
                    nsinfo = conn.get_nameserver_info()
                    LOG.debug("show fcns database info from fabric: %s",
                              nsinfo)
                    conn.cleanup()
                except exception.CiscoZoningCliException:
                    with excutils.save_and_reraise_exception():
                        LOG.exception("Error getting show fcns database info.")
                except Exception:
                    msg = _("Failed to get show fcns database info.")
                    LOG.exception(msg)
                    raise exception.FCZoneDriverException(msg)
                visible_targets = filter(
                    lambda x: x in formatted_target_list, nsinfo)

                if visible_targets:
                    LOG.info("Filtered targets for SAN is: %s",
                             {fabric_name: visible_targets})
                    # getting rid of the ':' before returning
                    for idx, elem in enumerate(visible_targets):
                        visible_targets[idx] = six.text_type(
                            visible_targets[idx]).replace(':', '')
                    fabric_map[fabric_name] = visible_targets
                else:
                    LOG.debug("No targets are in the fcns info for SAN %s",
                              fabric_name)
        LOG.debug("Return SAN context output: %s", fabric_map)
        return fabric_map

    def get_active_zone_set(self, fabric_ip,
                            fabric_user, fabric_pwd, fabric_port,
                            zoning_vsan):
        """Gets active zoneset config for vsan."""
        cfgmap = {}
        conn = None
        try:
            LOG.debug("Southbound connector: %s",
                      self.configuration.cisco_sb_connector)
            conn = importutils.import_object(
                self.configuration.cisco_sb_connector,
                ipaddress=fabric_ip, username=fabric_user,
                password=fabric_pwd, port=fabric_port, vsan=zoning_vsan)
            cfgmap = conn.get_active_zone_set()
            conn.cleanup()
        except Exception:
            msg = _("Failed to access active zoning configuration.")
            LOG.exception(msg)
            raise exception.FCZoneDriverException(msg)
        LOG.debug("Active zone set from fabric: %s", cfgmap)
        return cfgmap

    def get_zoning_status(self, fabric_ip, fabric_user, fabric_pwd,
                          fabric_port, zoning_vsan):
        """Gets zoneset status and mode."""
        statusmap = {}
        conn = None
        try:
            LOG.debug("Southbound connector: %s",
                      self.configuration.cisco_sb_connector)
            conn = importutils.import_object(
                self.configuration.cisco_sb_connector,
                ipaddress=fabric_ip, username=fabric_user,
                password=fabric_pwd, port=fabric_port, vsan=zoning_vsan)
            statusmap = conn.get_zoning_status()
            conn.cleanup()
        except Exception:
            msg = _("Failed to access zoneset status:%s")
            LOG.exception(msg)
            raise exception.FCZoneDriverException(msg)
        LOG.debug("Zoneset status from fabric: %s", statusmap)
        return statusmap


text:
package org.cagrid.gridgrouper.service.exception;

import org.cagrid.core.common.FaultException;
import org.cagrid.gridgrouper.types.GrantPrivilegeFault;

public class GrantPrivilegeException extends Exception implements FaultException<GrantPrivilegeFault> {

    private final GrantPrivilegeFault fault;

	public GrantPrivilegeException(GrantPrivilegeFault fault, String message) {
		super(message);
		this.fault = fault;
	}

	@Override
	public GrantPrivilegeFault getFault() {
		return fault;
	}
}


text:
""" Loads the fixtures for testing """

from lib.load_fixtures import load_fixtures

if __name__ == "__main__":
    print("Loading fixtures")
    load_fixtures()


text:
<!doctype html>
<html <?php language_attributes(); ?> class="no-js">

		<meta charset="<?php bloginfo('charset'); ?>">
		<title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title>

		<link href="//www.google-analytics.com" rel="dns-prefetch">
        <link href="<?php echo get_template_directory_uri(); ?>/img/icons/favicon.png" rel="shortcut icon">
        <link href="<?php echo get_template_directory_uri(); ?>/img/icons/favicon.png" rel="apple-touch-icon-precomposed">

		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

		<?php wp_head(); ?>

	<body <?php body_class(); ?>>

                    <?php dynamic_sidebar('top-r'); ?>

						<a href="<?php echo home_url(); ?>">

							<img src="<?php echo get_template_directory_uri(); ?>/img/logo.png" alt="Logo" class="logo-img">

                        <?php  add_custom_nav_menu('menu-1'); ?>

					 <?php dynamic_sidebar('social'); ?>


text:
Setup Your Environment
======================

MAC OS X:
---------
	* Open your web browser and visit: http://www.python.org/download
	* Download the Python 3 distribution (version 3.4.3 at time of this writing)
	* Install the file you just downloaded.
	* Open your Finder, then click on Applications, then click on Utlities, then 'Terminal'.  This should open a white window with black text.
	* Type in: python3
	* then hit enter
	* You should see something like this:
Python 3.4.3 (default, Apr  7 2015, 08:05:21)

[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>>

	* The important part is the >>> It's called a 'prompt' It's asking you to type in python!
	* If you don't see the >>> then get my attention please!

Windows 7+:
-----------
	* Open your web browser and visit: http://www.python.org/download
	* Download the Python 3 distribution (version 3.4.3 at time of this writing)
	* Install the file you just downloaded.
	* Run PowerShell from the Start menu. Search for it and you can just press Enter to run it. You should get a blue window with white text.
	* type in: python
	* then hit enter
	* You should see something like this:
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC c.1600 32 bit (intel)] on win32

Type "help", "copyright", "credits" or "license" for more information.

>>>

	* If you get something in red that says "the term 'python' is not recognized...
	* then type this in to powershell:

    [Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python34", "User")

	* then restart Powershell (or maybe the entire computer).
	* The important part is the >>> It's called a 'prompt' It's asking you to type in python!
	* If you don't see the >>> then get my attention please!

Windows XP (untested at this point):
------------------------------------
	* download and install powershell for Windows XP
	* URL for the download: http://www.microsoft.com/en-us/download/details.aspx?id=7217
	* then follow the instructions for Windows 7+ above.

Linux:
------
	* Every linux is a little bit different so I don't have magical type this instructions, sorry.
	* I assume you know how to install programs.  Install python3, make it so you can start a terminal and type: python3 and get the python >>> prompt.
	* The important part is the >>> It's called a 'prompt' It's asking you to type in python!
	* If you don't see the >>> then get my attention please!

Python Shell Environment:
-------------------------

Don't worry if all of this below doesn't make sense, we will cover more about what these things are later on.

Command line recall:  If you press the up arrow,  it will go "up" in your history, and let you see previous python instructions and save them. The down arrow does the opposite, if you are already in history.

Help: there is built-in help, that can be useful, it's a "function". to use it, type in help(object) where object is the thing you want help on. up and down arrows should work, and press q to quit help. for instance:

>>> help(help)

There is also a function called :class:`python:dir` dir, that will give you a list of attributes on an object, call it with dir(object) where object is the thing you want to know more about.

>>> dir(5)

to exit the >>> prompt press CTRL + D at the same time, or type in exit()

>>> exit()

Very basic help about the "terminal" is available here: http://learnpythonthehardway.org/book/appendixa.html


text:
package com.iksgmbh.sql.pojomemodb.dataobjects.interfaces.statistics;

import java.sql.SQLDataException;
import java.util.List;

/**
 * List for getter methods available from outside that defines
 * which information of a table can be accessed from outside the DB.
 *
 * @author Reik Oberrath
 */
public interface TableStatistics {

	String getTableName();

	int getNumberOfRows();

	int getNumberOfColumns();

	/**
	 * Column names are sorted by the internal order.
	 * @param tableName
	 * @return sorted list of column names
	 * @throws SQLDataException
	 */
	List<String> getNamesOfColumns();

	String getTypeOfColumn(String columnName) throws SQLDataException;

	boolean isColumnNullable(String columnName) throws SQLDataException;

}


text:
package com.vinsol.spree.models;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.vinsol.spree.utils.Log;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * Created by vaibhav on 9/29/15.
 */
public class Product implements Serializable {
    private static final long serialVersionUID = 1L;

    @SerializedName("id")
    @Expose
    private Integer id;

    @SerializedName("name")
    @Expose
    private String name;

    @SerializedName("description")
    @Expose
    private String description;

    @SerializedName("price")
    @Expose
    private String price;

    @SerializedName("display_price")
    @Expose
    private String displayPrice;

    @SerializedName("reviews_count")
    @Expose
    private String ratingsCount;

    @SerializedName("avg_rating")
    @Expose
    private String averageRating;

    @SerializedName("reviews_with_content_count")
    @Expose
    private Integer reviewsCount;

    @SerializedName("available_on")
    @Expose
    private String availableOn;

    @SerializedName("slug")
    @Expose
    private String slug;

    @SerializedName("meta_description")
    @Expose
    private String metaDescription;

    @SerializedName("meta_keywords")
    @Expose
    private String metaKeywords;

    @SerializedName("shipping_category_id")
    @Expose
    private Integer shippingCategoryId;

    @SerializedName("taxon_ids")
    @Expose
    private List<Integer> taxonIds = new ArrayList<Integer>();

    @SerializedName("total_on_hand")
    @Expose
    private Integer totalOnHand;

    @SerializedName("has_variants")
    @Expose
    private Boolean hasVariants;

    @SerializedName("images")
    @Expose
    private ArrayList<Image> images = new ArrayList<>();

    @SerializedName("variants_including_master")
    @Expose
    private ArrayList<Variant> variants = new ArrayList<Variant>();

    @SerializedName("product_properties")
    @Expose
    private List<ProductProperty> productProperties = new ArrayList<ProductProperty>();

    @SerializedName("available_options")
    @Expose
    private ArrayList<AvailableOption> availableOptions = new ArrayList<AvailableOption>();

    public Product(){}

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getDisplayPrice() {
        return displayPrice;
    }

    public void setDisplayPrice(String displayPrice) {
        this.displayPrice = displayPrice;
    }

    public String getAvailableOn() {
        return availableOn;
    }

    public void setAvailableOn(String availableOn) {
        this.availableOn = availableOn;
    }

    public String getSlug() {
        return slug;
    }

    public void setSlug(String slug) {
        this.slug = slug;
    }

    public String getMetaDescription() {
        return metaDescription;
    }

    public void setMetaDescription(String metaDescription) {
        this.metaDescription = metaDescription;
    }

    public String getMetaKeywords() {
        return metaKeywords;
    }

    public void setMetaKeywords(String metaKeywords) {
        this.metaKeywords = metaKeywords;
    }

    public Integer getShippingCategoryId() {
        return shippingCategoryId;
    }

    public void setShippingCategoryId(Integer shippingCategoryId) {
        this.shippingCategoryId = shippingCategoryId;
    }

    public List<Integer> getTaxonIds() {
        return taxonIds;
    }

    public void setTaxonIds(List<Integer> taxonIds) {
        this.taxonIds = taxonIds;
    }

    public Integer getTotalOnHand() {
        return totalOnHand;
    }

    public void setTotalOnHand(Integer totalOnHand) {
        this.totalOnHand = totalOnHand;
    }

    public Boolean getHasVariants() {
        return hasVariants;
    }

    public void setHasVariants(Boolean hasVariants) {
        this.hasVariants = hasVariants;
    }

    public ArrayList<Image> getImages() {
        return images;
    }

    public void setImages(ArrayList<Image> images) {
        this.images = images;
    }

    public int getRatingsCount() {
        int ratingsCountInt = 0;
        try {
            ratingsCountInt = Integer.parseInt(ratingsCount);
        } catch (Exception e) {
            ratingsCountInt = 0;
            Log.d("Error in parsing rating count");
        }

        return ratingsCountInt;
    }

    public void setRatingsCount(String ratingsCount) {
        this.ratingsCount = ratingsCount;
    }

    public float getAverageRating() {
        if(averageRating == null) {
            return 0;
        }

        try {
            return Float.parseFloat(averageRating);
        } catch (NumberFormatException nfe) {
            return 0;
        }
    }

    public void setAverageRating(String averageRating) {
        this.averageRating = averageRating;
    }

    public Integer getReviewsCount() {
        return reviewsCount;
    }

    public void setReviewsCount(Integer reviewsCount) {
        this.reviewsCount = reviewsCount;
    }

    public ArrayList<AvailableOption> getAvailableOptions() {
        return availableOptions != null ? availableOptions : new ArrayList<AvailableOption>();
    }

    public void setAvailableOptions(ArrayList<AvailableOption> availableOptions) {
        this.availableOptions = availableOptions;
    }

    public List<ProductProperty> getProductProperties() {
        return productProperties;
    }

    public HashMap<String, ArrayList<ProductProperty>> getGroupedProductProperties() {
        HashMap<String, ArrayList<ProductProperty>> groupedProductProperties = new HashMap<>();
        if(productProperties != null && productProperties.size() > 0) {
            for(ProductProperty productProperty : productProperties) {
                if(groupedProductProperties.containsKey(productProperty.getTypeName())) {
                    groupedProductProperties.get(productProperty.getTypeName()).add(productProperty);
                } else {
                    groupedProductProperties.put(productProperty.getTypeName(), new ArrayList<ProductProperty>());
                    groupedProductProperties.get(productProperty.getTypeName()).add(productProperty);
                }
            }
        }
        return groupedProductProperties;
    }

    public void setProductProperties(List<ProductProperty> productProperties) {
        this.productProperties = productProperties;
    }

    public ArrayList<Variant> getVariants() {
        return variants == null ? new ArrayList<Variant>() : variants;
    }

    public void setVariants(ArrayList<Variant> variants) {
        this.variants = variants;
    }

    public AvailableOption getAvailableOptionsAccordingToSelectedOption(AvailableOption selectedOption, String selectedOptionValue, AvailableOption optionToBeFiltered) {
        ArrayList<Variant> variants = getVariantsWithOptionValue(selectedOption, selectedOptionValue);

        AvailableOption availableOption = new AvailableOption();
        availableOption.setType(optionToBeFiltered.getType());

        ArrayList<String> options = new ArrayList<>();
        for(Variant variant : variants) {
            boolean isVariantOfSelectedValue = variant.isOfOption(selectedOption, selectedOptionValue);
            if(isVariantOfSelectedValue) {
                String valueOfOptionToBeFiltered = variant.getValueOfOption(optionToBeFiltered);
                if(options.contains(valueOfOptionToBeFiltered)) {
                    // do nothing
                } else {
                    options.add(valueOfOptionToBeFiltered);
                }
            }
        }

        availableOption.setValues(options);

        return availableOption;
    }

    public Variant getVariantsWithSelectedOptions(HashMap<String, String> selectedOptions) {
        for(Variant variant : variants) {
            if(variant.isOfOptions(selectedOptions)) {
                 return variant;
            }
        }

        return null;
    }

    private ArrayList<Variant> getVariantsWithOptionValue(AvailableOption option, String optionValue) {
        ArrayList<Variant> variants = getVariants();

        for(Variant variant : variants) {
            variant.getOptionsText();
        }

        return variants;
    }
}