text:
"""The powerwall integration models."""
from __future__ import annotations

from dataclasses import dataclass
from typing import TypedDict

from requests import Session
from tesla_powerwall import (
    DeviceType,
    GridStatus,
    MetersAggregates,
    PowerwallStatus,
    SiteInfo,
    SiteMaster,
)

from homeassistant.helpers.update_coordinator import DataUpdateCoordinator

@dataclass
class PowerwallBaseInfo:
    """Base information for the powerwall integration."""

    gateway_din: None | str
    site_info: SiteInfo
    status: PowerwallStatus
    device_type: DeviceType
    serial_numbers: list[str]
    url: str

@dataclass
class PowerwallData:
    """Point in time data for the powerwall integration."""

    charge: float
    site_master: SiteMaster
    meters: MetersAggregates
    grid_services_active: bool
    grid_status: GridStatus
    backup_reserve: float | None

class PowerwallRuntimeData(TypedDict):
    """Run time data for the powerwall."""

    coordinator: DataUpdateCoordinator | None
    base_info: PowerwallBaseInfo
    api_changed: bool
    http_session: Session


text:
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gphoto="http://schemas.google.com/photos/2007" xmlns:exif="http://schemas.google.com/photos/exif/2007" xmlns:media="http://search.yahoo.com/mrss/">
  <id>https://picasaweb.google.com/data/feed/api/user/default/albumid/1000000455272364</id>
  <updated>2016-01-09T22:01:34.792Z</updated>
  <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/photos/2007#album"/>
  <title type="text">Automatikus biztonsági mentés</title>
  <subtitle type="text"/>
  <rights type="text">protected</rights>
  <icon>https://lh3.googleusercontent.com/REDACTED_2R15TUlo/VpGCJUrRxaE/AAAAAAABrmU/1N_fHYjOHLk/s160-c/20160109.jpg</icon>
  <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="https://picasaweb.google.com/data/feed/api/user/99999999999999999/albumid/1000000455272364"/>
  <link rel="alternate" type="text/html" href="https://picasaweb.google.com/99999999999999999/20160109?authkey=AUTHKEY"/>
  <link rel="alternate" type="text/html" href="https://picasaweb.google.com/99999999999999999?alabel=small_instant_upload"/>
  <link rel="self" type="application/atom+xml" href="https://picasaweb.google.com/data/feed/api/user/99999999999999999/albumid/1000000455272364?start-index=1001&max-results=1000&imgmax=d"/>
  <link rel="previous" type="application/atom+xml" href="https://picasaweb.google.com/data/feed/api/user/99999999999999999/albumid/1000000455272364?start-index=1&max-results=1000&imgmax=d"/>
  <author>
    <name>Tamás Gulácsi</name>
    <uri>https://picasaweb.google.com/99999999999999999</uri>
  </author>
  <generator version="1.00" uri="http://picasaweb.google.com/">Picasaweb</generator>
  <openSearch:totalResults>1000</openSearch:totalResults>
  <openSearch:startIndex>1001</openSearch:startIndex>
  <openSearch:itemsPerPage>1000</openSearch:itemsPerPage>
  <gphoto:id>1000000455272364</gphoto:id>
  <gphoto:name>InstantUpload</gphoto:name>
  <gphoto:access>private</gphoto:access>
  <gphoto:timestamp>1452335333000</gphoto:timestamp>
  <gphoto:numphotos>2729</gphoto:numphotos>
  <gphoto:user>99999999999999999</gphoto:user>
  <gphoto:nickname>Tamás Gulácsi</gphoto:nickname>
  <gphoto:albumType>InstantUpload</gphoto:albumType>
  <gphoto:allowPrints>true</gphoto:allowPrints>
  <gphoto:allowDownloads>true</gphoto:allowDownloads>
</feed>

redpajama_set_name: RedPajamaGithub


text:
Konfiguracja bloku

Zarówno nagłówek jak i stopka mogą zawierać kod PHP. Musi on jednak zostać zawarty pomiędzy znaczniki <?php oraz ?>.

Konfiguracja bloku

Nagłówek

Stopka

Style CSS

<?= Form::open('adm/Block/Submit/' . @$block_id, array('method' => 'post')); ?>

		<fieldset class="mf">
			<legend>Konfiguracja bloku</legend>

					Nazwa bloku
					<?= Form::input('name', $input->post('name', @$block_name)); ?>

<?= $filter->formatMessages('name'); ?>

					Region
					<?= Form::select('region', Form::option($regions, $input->post('region', @$block_region))); ?>

<?= $filter->formatMessages('region'); ?>

					Wtyczka
					<?= Form::select('plugin', Form::option($plugins, $input->post('plugin', @$block_plugin))); ?>

<?= $filter->formatMessages('plugin'); ?>

					Element wtyczki
					<?= Form::select('item', Form::option(array(0 => ''), 0)); ?>

					Trigger
					<?= Form::select('trigger', Form::option($triggers, $input->post('trigger', @$block_trigger))); ?>
<?= $filter->formatMessages('trigger'); ?>

					Cachowanie
					<?= Form::select('cache', Form::option($caches, @$block_cache)); ?>

					Opcje wyświetlania

					<fieldset>

								<?= Form::radio('scope', Block::SHOW, @$block_scope == Block::SHOW); ?> Wyświetlaj na wszystkich stronach poza wymienionymi

								<?= Form::radio('scope', Block::HIDE, @$block_scope == Block::HIDE); ?> Wyświetlaj tylko na wymienionych stronach

								<?= Form::textarea('pages', $input->post('pages', @$block_pages), array('cols' => 60, 'rows' => 10)); ?>

								Adresy mogą zawierać znak *, który oznacza jakąkolwiek wartość. Można również uzywać nazw metod routingu - np. @foo

					</fieldset>

					Wyświetlaj dla grup
					<fieldset>

							<?php foreach ($groups as $groupId => $name) : ?>

<?= Form::checkbox('groups[]', $groupId, in_array($groupId, $blockGroups)); ?> <?= $name; ?>

							<?php endforeach; ?>

								Jeżeli żadna grupa nie zostanie zaznaczona, blok nie będzie wyświetlany.

					</fieldset>

					Uprawnienie
					<?= Form::select('auth', Form::option($auth, $input->post('auth', @$block_auth))); ?>

					<?= Form::submit('', 'Zapisz zmiany'); ?>

		</fieldset>

		<fieldset class="mf">

					Nagłówek
					<?= Form::textarea('header', $input->post('header', @$block_header), array('id' => 'ta-header', 'rows' => 30, 'cols' => 100, 'style' => 'width: 98%')); ?>

<?= $filter->formatMessages('header'); ?>

					<?= Form::submit('', 'Zapisz zmiany'); ?>

		</fieldset>

		<fieldset class="mf">

					Stopka
					<?= Form::textarea('footer', $input->post('footer', @$block_footer), array('rows' => 30, 'cols' => 100, 'id' => 'ta-footer', 'style' => 'width: 98%')); ?>

<?= $filter->formatMessages('footer'); ?>

					<?= Form::submit('', 'Zapisz zmiany'); ?>

		</fieldset>

		<fieldset class="mf">

					Kod CSS
					<?= Form::textarea('style', $input->post('style', @$block_style), array('id' => 'ta-style', 'cols' => 100, 'rows' => 30, 'style' => 'width: 98%; height: 500px')); ?>

					<?= Form::submit('', 'Zapisz zmiany'); ?>

		</fieldset>

</form>


text:
from aquilon.exceptions_ import ArgumentError
from aquilon.aqdb.model import ResourceGroup, ServiceAddress
from aquilon.worker.broker import BrokerCommand, validate_basic
from aquilon.worker.dbwrappers.resources import (del_resource,
                                                 get_resource_holder)

class CommandDelResourceGroup(BrokerCommand):

    required_parameters = ["resourcegroup"]

    def render(self, session, logger, resourcegroup, hostname, cluster,
               **arguments):

        validate_basic("resourcegroup", resourcegroup)
        holder = get_resource_holder(session, hostname, cluster, compel=True)
        dbrg = ResourceGroup.get_unique(session, name=resourcegroup,
                                        holder=holder, compel=True)

        # Deleting service addresses can't be done with just cascading
        if dbrg.resholder:
            for res in dbrg.resholder.resources:
                if isinstance(res, ServiceAddress):
                    raise ArgumentError("{0} contains {1:l}, please delete "
                                        "it first.".format(dbrg, res))

        del_resource(session, logger, dbrg)
        return


text:
<ion-view hide-nav-bar="false" view-title="Select Logs">
    <ion-nav-bar class="bar-orange orange-light main-bar" align-title="left">
        <ion-nav-buttons side="left" >
            <button ui-sref="app.sharing" class="button button-clear header-item">

            </button>
        </ion-nav-buttons>
        <ion-nav-buttons side="right" >
            <button class="button buttons button-clear" ng-click="sharing_accept.accept(acceptForm)">
                Done
            </button>
        </ion-nav-buttons>
    </ion-nav-bar>
    <ion-content class="light-bg">
        <ion-refresher pulling-text="Pull to refresh" on-refresh="sharing_accept.update(true)">
        </ion-refresher>

            <form class="orange-logs item item-text-wrap" name="acceptForm">

                            <avatar patient="log" with-check="true"></avatar>

{{ log.first_name }}
{{ log.last_name }}

            </form>

        <ion-infinite-scroll ng-if="sharing_accept.hasMore()" distance="{{ settings.defaultScrollDistance }}" on-infinite="sharing_accept.loadMore()">
        </ion-infinite-scroll>
    </ion-content>
</ion-view>


text:
module HashHelper

    def flatten_hash(hash)
      hash.each_with_object({}) do |(key, value), global_hash|
        if value.is_a? Hash
          flatten_hash(value).map do |h_k, h_v|
            # Concatenate parent/child key together to ensure uniqueness
            global_hash["#{key}.#{h_k}"] = h_v
          end

        else
          global_hash[key] = value
        end

      end
    end
  end


text:
"use strict";

/* Object Literals */
var cat = {
  name: "fluffy",
  color: "white",
  speak: function() {
    console.log("Meoowww");
  }
};
cat.age = 3;
cat.speak();

//

/* Constructor Function */
function Cat(name, color) {
  this.name = name;
  this.color = color;
}

var cat = new Cat("Fluffy", "White");
console.log(cat);

//

/* Using 'Object.create()' */
var cat = Object.create(Object.prototype, {
  name: {
    value: "Fluffy",
    enumerable: true,
    writable: true,
    configurable: true
  },
  color: {
    value: "White",
    enumerable: true,
    writable: true,
    configurable: true
  }
});
console.log(cat);

//

/* Using es6 class syntax */
class Cat {
  constructor(name, color) {
    this.name = name;
    this.color = color;
  }

  speak() {
    console.log("Meow");
  }
}

var cat = new Cat("Fluffy", "White");
console.log(cat);
cat.speak();


text:
'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	Schema = mongoose.Schema;

/**
 * Product Schema
 */
var objectReprintSchema = {

	createdDate: {
		type: Date,
		default: Date.now
	},
	name: {
		type: String,
		default: '',
		trim: true
	},
	email: {
		type: String,
		default:''
	},
	productTitle: {
		type: String,
		default:''
	},
	productSlug: {
		type: String,
		default:''
	}
};
var ReprintSchema = new Schema(objectReprintSchema);
exports.getReprintSchema = function(){
	return objectReprintSchema;
};
mongoose.model('Reprint', ReprintSchema,'reprint');


text:
"""
TLS ciphers.
"""

class CipherError(Exception):
    """
    Raised when .decrypt() or .auth_decrypt() fails.
    """
    pass

# We have to keep these imports below CipherError definition
# in order to avoid circular dependencies.
from scapy.layers.tls.crypto.cipher_aead import _tls_aead_cipher_algs
from scapy.layers.tls.crypto.cipher_block import _tls_block_cipher_algs
from scapy.layers.tls.crypto.cipher_stream import _tls_stream_cipher_algs

_tls_cipher_algs = {}
_tls_cipher_algs.update(_tls_block_cipher_algs)
_tls_cipher_algs.update(_tls_stream_cipher_algs)
_tls_cipher_algs.update(_tls_aead_cipher_algs)


text:
import hashlib
import json
import logging
import os
import re
import shutil
import subprocess
import sys
import tempfile
import unittest

BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(BASE_DIR)
sys.path.insert(0, ROOT_DIR)

import isolate
import trace_test_cases

class IsolateTestCases(unittest.TestCase):
  def setUp(self):
    self.tempdir = None

    self.initial_cwd = ROOT_DIR
    if sys.platform == 'win32':
      # Windows has no kernel mode concept of current working directory.
      self.initial_cwd = None

    # There's 2 kinds of references to python, self.executable,
    # self.real_executable. It depends how python was started and on which OS.
    self.executable = unicode(sys.executable)
    if sys.platform == 'darwin':
      # /usr/bin/python is a thunk executable that decides which version of
      # python gets executed.
      suffix = '.'.join(map(str, sys.version_info[0:2]))
      if os.access(self.executable + suffix, os.X_OK):
        # So it'll look like /usr/bin/python2.7
        self.executable += suffix

    self.real_executable = isolate.trace_inputs.get_native_path_case(
        self.executable)
    # Make sure there's no environment variable that could cause side effects.
    os.environ.pop('GTEST_SHARD_INDEX', '')
    os.environ.pop('GTEST_TOTAL_SHARDS', '')

  def tearDown(self):
    if self.tempdir:
      if VERBOSE:
        # If -v is used, this means the user wants to do further analisys on
        # the data.
        print('Leaking %s' % self.tempdir)
      else:
        shutil.rmtree(self.tempdir)

  def _copy(self, *relpath):
    relpath = os.path.join(*relpath)
    shutil.copy(
        os.path.join(ROOT_DIR, relpath),
        os.path.join(self.tempdir, relpath))

  def test_simple(self):
    # Create a directory and re-use tests/gtest_fake/gtest_fake_pass.isolate.
    # Warning: we need to copy the files around, since the original .isolate
    # file is modified.
    gtest_fake_base_py = os.path.join(
        'tests', 'gtest_fake', 'gtest_fake_base.py')
    gtest_fake_pass_py = os.path.join(
        'tests', 'gtest_fake', 'gtest_fake_pass.py')
    gtest_fake_pass_isolate = os.path.join(
        'tests', 'isolate_test_cases', 'gtest_fake_pass.isolate')

    self.tempdir = tempfile.mkdtemp(prefix='isolate_test_cases_test')
    os.mkdir(os.path.join(self.tempdir, 'isolated'))
    os.mkdir(os.path.join(self.tempdir, 'tests'))
    os.mkdir(os.path.join(self.tempdir, 'tests', 'gtest_fake'))
    os.mkdir(os.path.join(self.tempdir, 'tests', 'isolate_test_cases'))
    self._copy('isolate.py')
    self._copy(gtest_fake_base_py)
    self._copy(gtest_fake_pass_isolate)
    self._copy(gtest_fake_pass_py)

    basename = os.path.join(self.tempdir, 'isolated', 'gtest_fake_pass')
    isolated = basename + '.isolated'

    # Create a proper .isolated file.
    cmd = [
      sys.executable, 'isolate.py',
      'check',
      '--variable', 'FLAG', 'run',
      '--isolate', os.path.join(self.tempdir, gtest_fake_pass_isolate),
      '--isolated', isolated,
    ]
    if VERBOSE:
      cmd.extend(['-v'] * 3)
    subprocess.check_call(cmd, cwd=ROOT_DIR)

    # Assert the content of the .isolated file.
    with open(isolated) as f:
      actual_isolated = json.load(f)
    root_dir_gtest_fake_pass_py = os.path.join(ROOT_DIR, gtest_fake_pass_py)
    rel_gtest_fake_pass_py = os.path.join(u'gtest_fake', 'gtest_fake_pass.py')
    expected_isolated = {
      u'command': [u'../gtest_fake/gtest_fake_pass.py'],
      u'files': {
        rel_gtest_fake_pass_py: {
          u'm': 488,
          u'h': unicode(hashlib.sha1(
              open(root_dir_gtest_fake_pass_py, 'rb').read()).hexdigest()),
          u's': os.stat(root_dir_gtest_fake_pass_py).st_size,
        },
      },
      u'os': unicode(isolate.get_flavor()),
      u'relative_cwd': u'isolate_test_cases',
    }
    self.assertTrue(
        actual_isolated['files'][rel_gtest_fake_pass_py].pop('t'))
    if sys.platform == 'win32':
      expected_isolated['files'][rel_gtest_fake_pass_py].pop('m')
    self.assertEquals(expected_isolated, actual_isolated)

    cmd = [
        sys.executable,
        os.path.join(ROOT_DIR, 'isolate_test_cases.py'),
        # Forces 4 parallel jobs.
        '--jobs', '4',
        '--isolated', isolated,
    ]
    if VERBOSE:
      cmd.extend(['-v'] * 3)
    logging.debug(' '.join(cmd))
    proc = subprocess.Popen(
        cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    out, err = proc.communicate() or ('', '')  # pylint is confused.
    logging.info(err)
    self.assertEqual(0, proc.returncode, (out, err))
    lines = out.splitlines()
    expected_out_re = [
      r'\[1/3\]   \d+\.\d\ds .+',
      r'\[2/3\]   \d+\.\d\ds .+',
      r'\[3/3\]   \d+\.\d\ds .+',
    ]
    self.assertEqual(len(expected_out_re), len(lines), (out, err))
    for index in range(len(expected_out_re)):
      self.assertTrue(
          re.match('^%s$' % expected_out_re[index], lines[index]),
          '%d\n%r\n%r\n%r' % (
            index, expected_out_re[index], lines[index], out))
    # Junk is printed on win32.
    if sys.platform != 'win32' and not VERBOSE:
      self.assertEqual('', err)

    test_cases = (
      'Foo.Bar1',
      'Foo.Bar2',
      'Foo.Bar/3',
    )
    expected = {
      'conditions': [
        ['OS=="%s"' % isolate.get_flavor(), {
          'variables': {
            'isolate_dependency_untracked': [
              '../gtest_fake/',
            ],
          },
        }],
      ],
    }
    for test_case in test_cases:
      tracename = trace_test_cases.sanitize_test_case_name(test_case)
      with open(basename + '.' + tracename + '.isolate', 'r') as f:
        result = eval(f.read(), {'__builtins__': None}, None)
        self.assertEqual(expected, result)

    # Now verify the .isolate file was updated! (That's the magical part where
    # you say wow!)
    with open(os.path.join(self.tempdir, gtest_fake_pass_isolate)) as f:
      actual = eval(f.read(), {'__builtins__': None}, None)
    expected = {
      'variables': {
        'command': ['../gtest_fake/gtest_fake_pass.py'],
      },
      'conditions': [
        ['OS=="%s"' % isolate.get_flavor(), {
          'variables': {
            'isolate_dependency_untracked': [
              '../gtest_fake/',
            ],
          },
        }, {
         'variables': {
           'isolate_dependency_tracked': [
             '../gtest_fake/gtest_fake_pass.py',
             ],
           },
        }],
      ],
    }
    self.assertEqual(expected, actual)

if __name__ == '__main__':
  VERBOSE = '-v' in sys.argv
  logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR)
  unittest.main()


text:
<?php

  class ht_product_title {
    var $code = 'ht_product_title';
    var $group = 'header_tags';
    var $title;
    var $description;
    var $sort_order;
    var $enabled = false;

    function ht_product_title() {
      $this->title = MODULE_HEADER_TAGS_PRODUCT_TITLE_TITLE;
      $this->description = MODULE_HEADER_TAGS_PRODUCT_TITLE_DESCRIPTION;

      if ( defined('MODULE_HEADER_TAGS_PRODUCT_TITLE_STATUS') ) {
        $this->sort_order = MODULE_HEADER_TAGS_PRODUCT_TITLE_SORT_ORDER;
        $this->enabled = (MODULE_HEADER_TAGS_PRODUCT_TITLE_STATUS == 'True');
      }
    }

    function execute() {
      global $PHP_SELF, $oscTemplate, $HTTP_GET_VARS, $languages_id, $product_check;

      if (basename($PHP_SELF) == FILENAME_PRODUCT_INFO) {
        if (isset($HTTP_GET_VARS['products_id'])) {
          if ($product_check['total'] > 0) {
            $product_info_query = tep_db_query("select pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
            $product_info = tep_db_fetch_array($product_info_query);

            $oscTemplate->setTitle($product_info['products_name'] . ', ' . $oscTemplate->getTitle());
          }
        }
      }
    }

    function isEnabled() {
      return $this->enabled;
    }

    function check() {
      return defined('MODULE_HEADER_TAGS_PRODUCT_TITLE_STATUS');
    }

    function install() {
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Product Title Module', 'MODULE_HEADER_TAGS_PRODUCT_TITLE_STATUS', 'True', 'Do you want to allow product titles to be added to the page title?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_HEADER_TAGS_PRODUCT_TITLE_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
    }

    function remove() {
      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    }

    function keys() {
      return array('MODULE_HEADER_TAGS_PRODUCT_TITLE_STATUS', 'MODULE_HEADER_TAGS_PRODUCT_TITLE_SORT_ORDER');
    }
  }
?>


text:
title: Paupers
is_name: false

---

Paupers


text:
import { close, open } from 'testcafe-browser-tools';
import { spawn } from 'child_process';

const MAX_JOB_RESTART_COUNT = 3;

//Job
export default class Job {
    constructor (options, browser, testServer) {
        this.options = options;

        this.options.timeout *= 1e3;

        this.id = browser.browserName;

        this.browserInfo = browser.browserInfo;
        this.testServer  = testServer;

        this.status         = Job.STATUSES.INITIALIZED;
        this.restartCount   = 0;
        this.startTestsTime = null;
    }

    static STATUSES = {
        INIT_BROWSER: 'init browser',
        INITIALIZED:  'initialized',
        IN_PROGRESS:  'in progress',
        COMPLETED:    'completed',
        FAILED:       'failed'
    };

    async _getTestResult () {
        return new Promise(resolve => {
            this.testServer.on('taskDone', async results => {
                if (results.id === this.sessionID)
                    resolve(results);
            });
        });
    }

    async _getJobResult () {
        this.status = Job.STATUSES.IN_PROGRESS;

        this.startTestsTime = new Date();

        var testResult = await this._getTestResult();

        this.status = Job.STATUSES.COMPLETED;

        return {
            platform: this.id,
            result:   testResult,
            job_id:   this.sessionID
        };
    }

    _reportError (error) {
        console.log(`The task (${this.id}) failed: ${error}`);
    }

    async _runWorker () {
        try {
            await open(this.browserInfo, `${this.options.startUrl[0]}?browserName=${encodeURIComponent(this.id)}`);

            return new Promise(resolve => {
                this.testServer.on('startedWorker', (browserName, id) => {
                    if (this.id === browserName)
                        this.sessionID = id;

                    resolve();
                });
            });
        }

        catch (e) {
            console.log(e);
        }
    }

    async run () {
        var jobResult = null;
        var jobFailed = false;

        this.status = Job.STATUSES.INIT_BROWSER;

        try {
            await this._runWorker();
        }
        catch (error) {
            this._reportError(`An error occurred while the browser was being initialized: ${error}`);
            jobFailed = true;
        }

        if (!jobFailed) {
            try {
                jobResult = await this._getJobResult();
            }
            catch (error) {
                this._reportError(error);
                jobFailed = true;
            }

            try {
                await close(`QUnitReport#${this.sessionID}`);
            }
            catch (error) {
                this._reportError(`An error occurred while the browser was being closed: ${error}`);
            }
        }

        if (jobFailed) {
            if (++this.restartCount < MAX_JOB_RESTART_COUNT) {
                console.log(`Attempt ${this.restartCount} to restart the task(${this.id})`);

                jobResult = await this.run();
            }

            else {
                jobResult = {
                    platform: this.id,
                    job_id:   this.sessionID
                };

                this.status = Job.STATUSES.FAILED;
            }
        }

        return jobResult;
    }

    getStatus () {
        return this.status;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="150dp"
    android:layout_height="match_parent">
<LinearLayout
    android:layout_width="150dp"
    android:layout_height="match_parent"
    android:clickable="true"
    android:orientation="vertical"
    android:id="@+id/play_slides_drawer_main_layout"
    android:background="@drawable/repeat_bg_crabon">

       <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="0dp"
         android:layout_weight="1"
         android:gravity="center_horizontal|center_vertical"
         android:orientation="vertical">
       <Button
         android:id="@+id/play_slides_drawer_back_btn"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:background="@drawable/sliding_drawer_back_button_selector" />

        <TextView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="5dp"
         android:textColor="@android:color/white"
         android:text="返回"
         android:shadowColor="@android:color/white"
         android:shadowDx="0"
         android:shadowDy="1"
         android:shadowRadius="1"
         android:textSize="13sp" />
       </LinearLayout>

        <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="0dp"
         android:layout_weight="1"
         android:gravity="center_horizontal|center_vertical"
         android:orientation="vertical">
       <Button
         android:id="@+id/play_slides_page_picker_btn"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:background="@drawable/sliding_drawer_page_button_selector" />

        <TextView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="5dp"
         android:textColor="@android:color/white"
         android:text="页码跳转"
         android:shadowColor="@android:color/white"
         android:shadowDx="0"
         android:shadowDy="1"
         android:shadowRadius="1"
         android:textSize="13sp" />
       </LinearLayout>

    <!-- 下面的布局仅仅为了布局对称作占位之用 -->
        <LinearLayout
         android:visibility="invisible"
         android:layout_width="match_parent"
         android:layout_height="0dp"
         android:layout_weight="1"
         android:gravity="center_horizontal|center_vertical"
         android:orientation="vertical">
     	<Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/sliding_drawer_clean_button_selector" />

		<TextView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="5dp"
         android:textColor="@android:color/white"
         android:text="清理笔迹"
         android:shadowColor="@android:color/white"
         android:shadowDx="0"
         android:shadowDy="1"
         android:shadowRadius="1"
         android:textSize="13sp"/>
        </LinearLayout>

        <LinearLayout
         android:visibility="invisible"
         android:layout_width="match_parent"
         android:layout_height="0dp"
         android:layout_weight="1"
         android:gravity="center_horizontal|center_vertical"
         android:orientation="vertical">

		 <CheckBox
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:button="@null"
         android:background="@drawable/sliding_drawer_draw_check_box_selector"/>

         <TextView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="5dp"
         android:textColor="@android:color/white"
         android:textSize="13sp"
         android:shadowColor="@android:color/white"
         android:shadowDx="0"
         android:shadowDy="1"
         android:shadowRadius="1"
         android:text="涂鸦笔" />

       </LinearLayout>

</LinearLayout>
</FrameLayout>


text:
package com.zkjd.ehua.system.conf.entity;

import org.hibernate.validator.constraints.Length;

import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * 访问地址Entity
 * @author yangsong
 * @version 2017-03-03
 */
public class VisitAddress extends DataEntity<VisitAddress> {

	private static final long serialVersionUID = 1L;
	private String visitAddr;		// 访问地址
	private String reverseAgncAddr;		// 反向代理地址
	private String grpgName;		// 分组名称
	private String isRelease;		// 是否发布
	private String isSign ;		// 是否验签
	private String isAuth;		// 是否鉴权
	private String isDefVer;		// 是否默认版本
	private String verInfo;		// 版本
	private String isAddUser;		// 是否添加用户信息
	private String isAddVer;
	private String isLogger;
	private String logLevel;
	private String isInner;
	private String realAddress;
	private String testAddress;
	private String comAddress;
	private String author;
	private String isDegrade;
	private String addressType;
	private String degradeContext;
	private String accessLimitType;
	private String accessLimitValue;
	private String httpType;

	public VisitAddress() {
		super();
	}

	public VisitAddress(String id){
		super(id);
	}

	@Length(min=1, max=200, message="访问地址长度必须介于 1 和 200 之间")
	public String getVisitAddr() {
		return visitAddr;
	}

	public void setVisitAddr(String visitAddr) {
		this.visitAddr = visitAddr;
	}

	@Length(min=1, max=200, message="反向代理地址长度必须介于 1 和 200 之间")
	public String getReverseAgncAddr() {
		return reverseAgncAddr;
	}

	public void setReverseAgncAddr(String reverseAgncAddr) {
		this.reverseAgncAddr = reverseAgncAddr;
	}

	@Length(min=1, max=200, message="分组名称长度必须介于 1 和 200 之间")
	public String getGrpgName() {
		return grpgName;
	}

	public void setGrpgName(String grpgName) {
		this.grpgName = grpgName;
	}

	@Length(min=1, max=11, message="是否发布长度必须介于 1 和 11 之间")
	public String getIsRelease() {
		return isRelease;
	}

	public void setIsRelease(String isRelease) {
		this.isRelease = isRelease;
	}

	@Length(min=0, max=2, message="是否验签长度必须介于 0 和 2 之间")
	public String getIsSign() {
		return isSign;
	}

	public void setIsSign(String isSign) {
		this.isSign = isSign;
	}

	@Length(min=0, max=2, message="是否鉴权长度必须介于 0 和 2 之间")
	public String getIsAuth() {
		return isAuth;
	}

	public void setIsAuth(String isAuth) {
		this.isAuth = isAuth;
	}

	@Length(min=0, max=2, message="是否默认版本长度必须介于 0 和 2 之间")
	public String getIsDefVer() {
		return isDefVer;
	}

	public void setIsDefVer(String isDefVer) {
		this.isDefVer = isDefVer;
	}

	@Length(min=0, max=255, message="版本长度必须介于 0 和 255 之间")
	public String getVerInfo() {
		return verInfo;
	}

	public void setVerInfo(String verInfo) {
		this.verInfo = verInfo;
	}

	@Length(min=0, max=2, message="是否添加用户信息长度必须介于 0 和 2 之间")
	public String getIsAddUser() {
		return isAddUser;
	}

	public void setIsAddUser(String isAddUser) {
		this.isAddUser = isAddUser;
	}

	public String getIsLogger() {
		return isLogger;
	}

	public void setIsLogger(String isLogger) {
		this.isLogger = isLogger;
	}

	public String getIsInner() {
		return isInner;
	}

	public void setIsInner(String isInner) {
		this.isInner = isInner;
	}

	public String getRealAddress() {
		return realAddress;
	}

	public void setRealAddress(String realAddress) {
		this.realAddress = realAddress;
	}

	public String getTestAddress() {
		return testAddress;
	}

	public void setTestAddress(String testAddress) {
		this.testAddress = testAddress;
	}

	public String getComAddress() {
		return comAddress;
	}

	public void setComAddress(String comAddress) {
		this.comAddress = comAddress;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getIsDegrade() {
		return isDegrade;
	}

	public void setIsDegrade(String isDegrade) {
		this.isDegrade = isDegrade;
	}

	public String getAddressType() {
		return addressType;
	}

	public void setAddressType(String addressType) {
		this.addressType = addressType;
	}

	public String getDegradeContext() {
		return degradeContext;
	}

	public void setDegradeContext(String degradeContext) {
		this.degradeContext = degradeContext;
	}

	public String getLogLevel() {
		return logLevel;
	}

	public void setLogLevel(String logLevel) {
		this.logLevel = logLevel;
	}

	public String getAccessLimitType() {
		return accessLimitType;
	}

	public void setAccessLimitType(String accessLimitType) {
		this.accessLimitType = accessLimitType;
	}

	public String getAccessLimitValue() {
		return accessLimitValue;
	}

	public void setAccessLimitValue(String accessLimitValue) {
		this.accessLimitValue = accessLimitValue;
	}

	public String getIsAddVer() {
		return isAddVer;
	}

	public void setIsAddVer(String isAddVer) {
		this.isAddVer = isAddVer;
	}

	public String getHttpType() {
		return httpType;
	}

	public void setHttpType(String httpType) {
		this.httpType = httpType;
	}

}


text:
package org.immutables.fixture.encoding;

import java.util.Date;
import org.immutables.fixture.encoding.defs.CompactDateEnabled;
import org.immutables.value.Value;

@CompactDateEnabled
public abstract class UseCompactDate {
  public abstract static class Base {
    @Value.Default
    public Date getFirstSeen() {
      return new Date();
    }

    @Value.Default
    public Date lastSeen() {
      return getFirstSeen();
    }
  }

  @Value.Immutable
  public abstract static class SomeSubclass extends Base {
    public abstract String name();
  }
}


text:
from master.boostrap.db_client import SingleDBClient
from master.persistence.env_store import EnvStore
from master.util import get_optional_email

from master.logger.file_logger import logger
from pymongo import ASCENDING

class UserStore:
    """
    IMPORTANT: mongod (server) needs to be running to use this class
    Example:
    user_t = UserStore()
    print(user_t.get_hashpw(1)) # 1: admin's id
    user_t.close()
    """

    def __init__(self):
        self.client = SingleDBClient().get_client()
        self.db = self.client.users
        self.db.users_col.ensure_index('uid', ASCENDING, unique=True)
        # self.db.add_son_manipulator(UserTransform())

    def get_hashpw(self, user_id):
        """
        get hashed bcrypt password
        :param user_id: integer (for now)
        :return: string hash pw
        """
        one_record = self.db.users_col.find_one({"uid": user_id})
        if one_record is not None:
            return one_record['hash_pw']
        else:
            logger().warn('Unable to find record of user_id:' + user_id)
        return None

    def insert_new_user(self, user):
        """
        Insert a new record into DB store
        :param user: json object {id:, first:, last:, hashpw:}
        :return: post id
        """
        return self.db.users_col.insert(user.to_json())

    def get_all_users(self):
        all_users = []
        for user in self.db.users_col.find():
            all_users.append({'id': user['uid'], 'first': user['first'], 'last': user['last'], 'email': get_optional_email(user, True)})

        return all_users

    def get_user_by_id(self, uid):
        return self.db.users_col.find_one({'uid': uid})

    def update_user_by_id(self, user):
        email = get_optional_email(user)
        self.db.users_col.update({"uid": user.uid}, {"$set": {"first": user.first, "last": user.last, "email": email}})

    def update_user_with_hash(self, uid, hash_pw):
        self.db.users_col.update({"uid": uid}, {"$set": {"hash_pw": hash_pw}})

    def delete_user_by_id(self, user_uid):
        self.db.users_col.remove({"uid": user_uid})
        all_env_by_owner = EnvStore().get_all_env_by_owner(user_uid)
        if all_env_by_owner:
            for env in all_env_by_owner:
                EnvStore().delete_env_by_owner(env, user_uid)

    def get_total_users(self):
        return self.db.users_col.count()

    def close(self):
        self.client.close()

    def drop_users(self):
        self.client.drop_database("users")

    def get_user_collection(self):
        """
        Only used by bootstrap
        :return: mongodb collection
        """
        return self.db.users_col


text:
BIN_DIR=`dirname $_`/bin
GEN_DOC_JS=$BIN_DIR/gen_api_doc.js
ROOT_DIR=`dirname $BIN_DIR`

node $GEN_DOC_JS $ROOT_DIR/arduinode.js > $ROOT_DIR/doc/API.md


text:
package com.trademarkea.ndamis.ipms.ws;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for getMarketSaleResponse complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="getMarketSaleResponse">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="return" type="{http://ws.ipms.ndamis.trademarkea.com/}marketSalesResponse" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "getMarketSaleResponse", propOrder = {
    "_return"
})
public class GetMarketSaleResponse {

    @XmlElement(name = "return")
    protected MarketSalesResponse _return;

    /**
     * Gets the value of the return property.
     *
     * @return
     *     possible object is
     *     {@link MarketSalesResponse }
     *
     */
    public MarketSalesResponse getReturn() {
        return _return;
    }

    /**
     * Sets the value of the return property.
     *
     * @param value
     *     allowed object is
     *     {@link MarketSalesResponse }
     *
     */
    public void setReturn(MarketSalesResponse value) {
        this._return = value;
    }

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Package org.pitest.functional (pitest 1.0.1-SNAPSHOT API)</title>
<meta name="date" content="2015-09-29">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Package
org.pitest.functional

Packages that use org.pitest.functional

Package
Description

org.pitest.classinfo

org.pitest.classpath

org.pitest.coverage

org.pitest.coverage.codeassist

org.pitest.coverage.execute

org.pitest.dependency

org.pitest.execute

org.pitest.execute.containers

org.pitest.extension.common

org.pitest.functional

org.pitest.functional.predicate

org.pitest.functional.prelude

org.pitest.junit

org.pitest.junit.adapter

org.pitest.mutationtest

org.pitest.mutationtest.config

org.pitest.mutationtest.engine.gregor

org.pitest.mutationtest.execute

org.pitest.mutationtest.incremental

org.pitest.mutationtest.tooling

org.pitest.process

org.pitest.reflection

org.pitest.testapi

org.pitest.testapi.foreignclassloader

org.pitest.testng

org.pitest.util

Classes in org.pitest.functional used by org.pitest.classinfo

Class and Description

F

Option

Classes in org.pitest.functional used by org.pitest.classpath

Class and Description

Option

Classes in org.pitest.functional used by org.pitest.coverage

Class and Description

F

Option

Classes in org.pitest.functional used by org.pitest.coverage.codeassist

Class and Description

F5

Classes in org.pitest.functional used by org.pitest.coverage.execute

Class and Description

SideEffect1

Classes in org.pitest.functional used by org.pitest.dependency

Class and Description

F

Classes in org.pitest.functional used by org.pitest.execute

Class and Description

SideEffect1

Classes in org.pitest.functional used by org.pitest.execute.containers

Class and Description

Option

Classes in org.pitest.functional used by org.pitest.extension.common

Class and Description

F

Classes in org.pitest.functional used by org.pitest.functional

Class and Description

F

F2

FunctionalCollection

FunctionalIterable

FunctionalList

Option

Option.None

SideEffect1

Classes in org.pitest.functional used by org.pitest.functional.predicate

Class and Description

F

Classes in org.pitest.functional used by org.pitest.functional.prelude

Class and Description

F

SideEffect1

Classes in org.pitest.functional used by org.pitest.junit

Class and Description

F

Option

Classes in org.pitest.functional used by org.pitest.junit.adapter

Class and Description

Option

Classes in org.pitest.functional used by org.pitest.mutationtest

Class and Description

Option

Classes in org.pitest.functional used by org.pitest.mutationtest.config

Class and Description

F

Option

Classes in org.pitest.functional used by org.pitest.mutationtest.engine.gregor

Class and Description

FunctionalList

Classes in org.pitest.functional used by org.pitest.mutationtest.execute

Class and Description

F3

Option

SideEffect

Classes in org.pitest.functional used by org.pitest.mutationtest.incremental

Class and Description

Option

Classes in org.pitest.functional used by org.pitest.mutationtest.tooling

Class and Description

Option

Classes in org.pitest.functional used by org.pitest.process

Class and Description

Option

SideEffect1

Classes in org.pitest.functional used by org.pitest.reflection

Class and Description

F

Classes in org.pitest.functional used by org.pitest.testapi

Class and Description

F

Option

Classes in org.pitest.functional used by org.pitest.testapi.foreignclassloader

Class and Description

SideEffect2

Classes in org.pitest.functional used by org.pitest.testng

Class and Description

Option

Classes in org.pitest.functional used by org.pitest.util

Class and Description

F

FunctionalIterable

FunctionalList

Option

SideEffect1

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2015 org.pitest. All Rights Reserved.


text:
import React, { Component, Fragment } from 'react';
import { Input } from 'antd';
import { func, any, bool } from 'prop-types';

import CellStyled from './Cell.styles';
import { MODES } from '../../constants';

type Props = {
	children: any,
	onChange: func,
	mode?: string,
	editable?: boolean,
	shouldAutoFocus?: boolean,
};

type State = {
	value: any,
};
class NumberCell extends Component<Props, State> {
	state = {
		value: this.props.children,
	};

	// $FlowFixMe
	handleChange = e => {
		const {
			target: { value: nextValue },
		} = e;
		this.setState(({ value }) => {
			// eslint-disable-next-line
			if (!isNaN(nextValue)) {
				return { value: nextValue };
			}
			return { value };
		});
	};

	saveChange = () => {
		const { onChange } = this.props;
		const { value } = this.state;
		let nextValue = value;
		if (value === '' || value === '-') {
			nextValue = 0;
			this.setState({ value: nextValue });
		}

		onChange(Number(nextValue));
	};

	render() {
		const { children, mode, editable, shouldAutoFocus } = this.props;
		const { value } = this.state;
		return (
			<Fragment>
				{editable || mode === MODES.EDIT ? (
					<Input
						tabIndex="0"
						role="Gridcell"
						value={value}
						onChange={this.handleChange}
						css={{
							height: '100% important',
							width: '100% !important',
							border: `${
								shouldAutoFocus ? 'none' : 'auto'
							} !important`,
						}}
						onBlur={this.saveChange}
					/>
				) : (
					<CellStyled>{children}</CellStyled>
				)}
			</Fragment>
		);
	}
}

NumberCell.propTypes = {
	onChange: func.isRequired,
	children: any,
	shouldAutoFocus: bool,
};

export default NumberCell;


text:
require 'test/unit'

begin
  require 'redgreen'
rescue LoadError
end

$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
require 'hub'
require 'hub/standalone'

# We're looking for `open` in the tests.
ENV['BROWSER'] = 'open'

# Setup path with fake executables in case a test hits them
fakebin_dir = File.expand_path('../fakebin', __FILE__)
ENV['PATH'] = "#{fakebin_dir}:#{ENV['PATH']}"

class Test::Unit::TestCase
  # Shortcut for creating a `Hub` instance. Pass it what you would
  # normally pass `hub` on the command line, e.g.
  #
  # shell: hub clone rtomayko/tilt
  #  test: Hub("clone rtomayko/tilt")
  def Hub(args)
    Hub::Runner.new(*args.split(' '))
  end

  # Shortcut for running the `hub` command in a subprocess. Returns
  # STDOUT as a string. Pass it what you would normally pass `hub` on
  # the command line, e.g.
  #
  # shell: hub clone rtomayko/tilt
  #  test: hub("clone rtomayko/tilt")
  #
  # If a block is given it will be run in the child process before
  # execution begins. You can use this to monkeypatch or fudge the
  # environment before running hub.
  def hub(args, input = nil)
    parent_read, child_write = IO.pipe
    child_read, parent_write = IO.pipe if input

    fork do
      yield if block_given?
      $stdin.reopen(child_read) if input
      $stdout.reopen(child_write)
      $stderr.reopen(child_write)
      Hub(args).execute
    end

    if input
      parent_write.write input
      parent_write.close
    end
    child_write.close
    parent_read.read
  end

  # Asserts that `hub` will run a specific git command based on
  # certain input.
  #
  # e.g.
  #  assert_command "clone git/hub", "git clone git://github.com/git/hub.git"
  #
  # Here we are saying that this:
  #   $ hub clone git/hub
  # Should in turn execute this:
  #   $ git clone git://github.com/git/hub.git
  def assert_command(input, expected)
    assert_equal expected, Hub(input).command, "$ git #{input}"
  end

  def assert_commands(*expected)
    input = expected.pop
    assert_equal expected, Hub(input).commands
  end

  # Asserts that the command will be forwarded to git without changes
  def assert_forwarded(input)
    cmd = Hub(input)
    assert !cmd.args.changed?, "arguments were not supposed to change: #{cmd.args.inspect}"
  end

  # Asserts that `hub` will show a specific alias command for a
  # specific shell.
  #
  # e.g.
  #  assert_alias_command "sh", "alias git=hub"
  #
  # Here we are saying that this:
  #   $ hub alias sh
  # Should display this:
  #   Run this in your shell to start using `hub` as `git`:
  #     alias git=hub
  def assert_alias_command(shell, command)
    expected = "Run this in your shell to start using `hub` as `git`:\n  %s\n"
    assert_equal(expected % command, hub("alias #{shell}"))
  end

  # Asserts that `haystack` includes `needle`.
  def assert_includes(needle, haystack)
    assert haystack.include?(needle),
      "expected #{needle.inspect} in #{haystack.inspect}"
  end

  # Asserts that `haystack` does not include `needle`.
  def assert_not_includes(needle, haystack)
    assert !haystack.include?(needle),
      "didn't expect #{needle.inspect} in #{haystack.inspect}"
  end
end


text:
      <button class="btn btn-success">

      </button>

      <button class="btn btn-info">

      </button>

      <button class="btn btn-warning">

      </button>

      <button class="btn btn-danger">

      </button>

<a href="<?php echo Uri::to('system/dashboard', false); ?>">
          {{ Lang::get('backend.dashboard') }}

    <?php if(\Auth::admin()->check()): ?>
        <?php if(\Session::has('backend.' . \Auth::admin()->get()->username)): ?>
            <?php
                $priviledges = json_decode(\Session::get('backend.' . \Auth::admin()->get()->username), true);
            ?>
            <?php foreach($priviledges as $_priviledge):?>

                    <i class="menu-icon fa fa-<?php echo $_priviledge['icon']; ?>">
                    <?php echo $_priviledge['name']; ?>

                <?php if(array_key_exists('children', $_priviledge) && is_array($_priviledge['children'])): ?>

                        <?php foreach($_priviledge['children'] as $_resource): ?>
                            <?php if($_resource['type'] == 'menu' && $_resource['is_menu']):?>

								                <a href="<?php echo Uri::to($_resource['pattern'], false); ?>">

									              <?php echo $_resource['name']?>

							              <?php endif; ?>
							          <?php endforeach; ?>

                <?php endif; ?>

            <?php endforeach; ?>
        <?php endif; ?>
    <?php endif; ?>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>org.gradle.api.execution (Gradle API 2.1)</title>
<meta name="date" content="2014-09-08">
<link rel="stylesheet" type="text/css" href="../../../../javadoc.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package org.gradle.api.execution

Classes for managing and monitoring build execution.

See: Description

Interface Summary

Interface
Description

TaskActionListener

A TaskWorkListener is notified of the actions that a task performs.

TaskExecutionGraph

A TaskExecutionGraph is responsible for managing the execution of the Task instances which
 are part of the build.

TaskExecutionGraphListener

A TaskExecutionGraphListener is notified when the TaskExecutionGraph has been populated.

TaskExecutionListener

A TaskExecutionListener is notified of the execution of the tasks in a build.

Class Summary

Class
Description

TaskExecutionAdapter

A TaskExecutionListener adapter class for receiving task execution events.

Package org.gradle.api.execution Description

Classes for managing and monitoring build execution.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes


text:
'use strict';

var path = require('path');

var dirname = module.exports = function (base) {
  return path.join.bind(path, base);
};


text:
package org.apache.flink.runtime.security.token;

import org.apache.hadoop.security.Credentials;

/**
 * Manager for delegation tokens in a Flink cluster.
 *
 * <p>When delegation token renewal is enabled, this manager will make sure long-running apps can
 * run without interruption while accessing secured services. It must contact all the configured
 * secure services to obtain delegation tokens to be distributed to the rest of the application.
 */
public interface DelegationTokenManager {

    /**
     * Obtains new tokens in a one-time fashion and leaves it up to the caller to distribute them.
     */
    void obtainDelegationTokens(Credentials credentials) throws Exception;

    /**
     * Creates a re-occurring task which obtains new tokens and automatically distributes them to
     * task managers.
     */
    void start(DelegationTokenListener delegationTokenListener) throws Exception;

    /** Stops re-occurring token obtain task. */
    void stop();
}


text:
desc "Run CI checks"

TESTS = ["spec", "rubocop", "yardoc", "linkinator", "build"]

flag :only
TESTS.each do |name|
  flag "include_#{name}".to_sym, "--[no-]include-#{name}"
end

include :exec, result_callback: :handle_result
include :terminal

def handle_result result
  if result.success?
    puts "** #{result.name} passed\n\n", :green, :bold
  else
    puts "** CI terminated: #{result.name} failed!", :red, :bold
    exit 1
  end
end

def run
  ::Dir.chdir context_directory
  TESTS.each do |name|
    setting = get "include_#{name}".to_sym
    setting = !only if setting.nil?
    exec ["toys", name], name: name.capitalize if setting
  end
end


text:
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using NLog;
using SharpFlame.Core;
using OpenTK.Graphics.OpenGL;
using PixelFormat = OpenTK.Graphics.OpenGL.PixelFormat;

namespace SharpFlame.Bitmaps
{
    public sealed class BitmapUtil
    {
        private static readonly Logger logger = LogManager.GetCurrentClassLogger();

        public static SimpleResult LoadBitmap(string path, ref Bitmap resultBitmap)
        {
            var returnResult = new SimpleResult();
            returnResult.Problem = "";
            returnResult.Success = false;

            if (!File.Exists(path)) {
                returnResult.Problem = string.Format("File \"{0}\" does not exists.", path);
                resultBitmap = null;
                return returnResult;
            }

            Bitmap bitmap;
            try
            {
                bitmap = new Bitmap(path);
            }
            catch ( Exception ex )
            {
                returnResult.Problem = ex.Message;
                resultBitmap = null;
                return returnResult;
            }

            resultBitmap = new Bitmap(bitmap); //copying the bitmap is needed so it doesn't lock access to the file
            bitmap.Dispose();

            returnResult.Success = true;
            return returnResult;
        }

        public static SimpleResult SaveBitmap(string path, bool overwrite, Bitmap bitmapToSave)
        {
            var returnResult = new SimpleResult();
            returnResult.Problem = "";
            returnResult.Success = false;

            try
            {
                if ( File.Exists(path) )
                {
                    if ( overwrite )
                    {
                        File.Delete(path);
                    }
                    else
                    {
                        returnResult.Problem = "File already exists.";
                        return returnResult;
                    }
                }
                bitmapToSave.Save(path);
            }
            catch ( Exception ex )
            {
                returnResult.Problem = ex.Message;
                return returnResult;
            }

            returnResult.Success = true;
            return returnResult;
        }

        public static Result BitmapIsGlCompatible(Bitmap bitmapToCheck)
        {
            var returnResult = new Result("Compatibility check", false);
            logger.Debug("Compatibility check");

            if ( !App.SizeIsPowerOf2(bitmapToCheck.Width) )
            {
                returnResult.WarningAdd("Image width is not a power of 2.");
            }
            if ( !App.SizeIsPowerOf2(bitmapToCheck.Height) )
            {
                returnResult.WarningAdd("Image height is not a power of 2.");
            }
            if ( bitmapToCheck.Width != bitmapToCheck.Height )
            {
                returnResult.WarningAdd("Image is not square.");
            }

            return returnResult;
        }

        public static int CreateGLTexture(Bitmap texture, int mipMapLevel, int inTextureNum = 0,
                                 TextureMagFilter magFilter = TextureMagFilter.Nearest,
                                 TextureMinFilter minFilter = TextureMinFilter.Nearest)
        {
            var bitmapData = texture.LockBits(new Rectangle(0, 0, texture.Width, texture.Height),
                                              ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb );
            int textureNum;
            if (mipMapLevel == 0)
            {
                GL.GenTextures (1, out textureNum);
            } else
            {
                textureNum = inTextureNum;
            }

            GL.BindTexture(TextureTarget.Texture2D, textureNum);

            GL.TexImage2D(TextureTarget.Texture2D, mipMapLevel, PixelInternalFormat.Rgba, bitmapData.Width, bitmapData.Height, 0,
                          PixelFormat.Bgra, PixelType.UnsignedByte, bitmapData.Scan0);

            if ( mipMapLevel == 0 )
            {
                GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureWrapMode.ClampToEdge);
                GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureWrapMode.ClampToEdge);
                GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)magFilter);
                GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)minFilter);
            }

            texture.UnlockBits(bitmapData);

            return textureNum;
        }
    }
}


text:
<link rel="import" href="../../../vaadin-lumo-styles/color.html">
<link rel="import" href="../../../vaadin-lumo-styles/spacing.html">
<dom-module id="lumo-grid-tree-toggle" theme-for="vaadin-grid-tree-toggle">
  <template>
    <style>
      :host {
        --vaadin-grid-tree-toggle-level-offset: 2em;
        align-items: center;
        vertical-align: middle;
        margin-left: calc(var(--lumo-space-s) * -1);
        -webkit-tap-highlight-color: transparent;
      }

      :host(:not([leaf])) {
        cursor: default;
      }

      [part="toggle"] {
        display: inline-block;
        font-size: 1.5em;
        line-height: 1;
        width: 1em;
        height: 1em;
        text-align: center;
        color: var(--lumo-contrast-50pct);
        /* Increase touch target area */
        padding: calc(1em / 3);
        margin: calc(1em / -3);
      }

      :host(:not([dir="rtl"])) [part="toggle"] {
        margin-right: 0;
      }

      @media (hover: hover) {
        :host(:hover) [part="toggle"] {
          color: var(--lumo-contrast-80pct);
        }
      }

      [part="toggle"]::before {
        font-family: "lumo-icons";
        display: inline-block;
        height: 100%;
      }

      :host(:not([expanded])) [part="toggle"]::before {
        content: var(--lumo-icons-angle-right);
      }

      :host([expanded]) [part="toggle"]::before {
        content: var(--lumo-icons-angle-right);
        transform: rotate(90deg);
      }

      /* Experimental support for hierarchy connectors, using an unsupported selector */
      :host([theme~="connectors"]) #level-spacer {
        position: relative;
        z-index: -1;
        font-size: 1em;
        height: 1.5em;
      }

      :host([theme~="connectors"]) #level-spacer::before {
        display: block;
        content: "";
        margin-top: calc(var(--lumo-space-m) * -1);
        height: calc(var(--lumo-space-m) + 3em);
        background-image: linear-gradient(to right, transparent calc(var(--vaadin-grid-tree-toggle-level-offset) - 1px), var(--lumo-contrast-10pct) calc(var(--vaadin-grid-tree-toggle-level-offset) - 1px));
        background-size: var(--vaadin-grid-tree-toggle-level-offset) var(--vaadin-grid-tree-toggle-level-offset);
        background-position: calc(var(--vaadin-grid-tree-toggle-level-offset) / 2 - 2px) 0;
      }

      /* RTL specific styles */

      :host([dir="rtl"]) {
        margin-left: 0;
        margin-right: calc(var(--lumo-space-s) * -1);
      }

      :host([dir="rtl"]) [part="toggle"] {
        margin-left: 0;
      }

      :host([dir="rtl"][expanded]) [part="toggle"]::before {
        transform: rotate(-90deg);
      }

      :host([dir="rtl"][theme~="connectors"]) #level-spacer::before {
        background-image: linear-gradient(to left, transparent calc(var(--vaadin-grid-tree-toggle-level-offset) - 1px), var(--lumo-contrast-10pct) calc(var(--vaadin-grid-tree-toggle-level-offset) - 1px));
        background-position: calc(100% - (var(--vaadin-grid-tree-toggle-level-offset) / 2 - 2px)) 0;
      }

      :host([dir="rtl"]:not([expanded])) [part="toggle"]::before,
      :host([dir="rtl"][expanded]) [part="toggle"]::before {
        content: var(--lumo-icons-angle-left);
      }
    </style>
  </template>
</dom-module>


text:
<?xml version="1.0" encoding="utf-8"?>

<!-- $Revision: 335444 $ -->
<refentry xml:id="mongocommandcursor.current" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>MongoCommandCursor::current</refname>
  <refpurpose>Returns the current element</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>public</modifier> <type>array</type><methodname>MongoCommandCursor::current</methodname>
   <void/>
  </methodsynopsis>
  <para>
   This returns &null; until <function>MongoCommandCursor::rewind</function> is called.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  &no.function.parameters;
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   The current result document as an associative array. &null; will be returned
   if there is no result.
  </para>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <simplelist>
   <member><methodname>Iterator::current</methodname></member>
  </simplelist>
 </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


text:
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
 * @unrestricted
 */
UI.ActionRegistry = class {
  constructor() {
    /** @type {!Map.<string, !UI.Action>} */
    this._actionsById = new Map();
    this._registerActions();
  }

  _registerActions() {
    self.runtime.extensions(UI.ActionDelegate).forEach(registerExtension, this);

    /**
     * @param {!Runtime.Extension} extension
     * @this {UI.ActionRegistry}
     */
    function registerExtension(extension) {
      var actionId = extension.descriptor()['actionId'];
      console.assert(actionId);
      console.assert(!this._actionsById.get(actionId));
      this._actionsById.set(actionId, new UI.Action(extension));
    }
  }

  /**
   * @return {!Array.<!UI.Action>}
   */
  availableActions() {
    return this.applicableActions(this._actionsById.keysArray(), UI.context);
  }

  /**
   * @param {!Array.<string>} actionIds
   * @param {!UI.Context} context
   * @return {!Array.<!UI.Action>}
   */
  applicableActions(actionIds, context) {
    var extensions = [];
    actionIds.forEach(function(actionId) {
      var action = this._actionsById.get(actionId);
      if (action)
        extensions.push(action._extension);
    }, this);
    return context.applicableExtensions(extensions).valuesArray().map(extensionToAction.bind(this));

    /**
     * @param {!Runtime.Extension} extension
     * @return {!UI.Action}
     * @this {UI.ActionRegistry}
     */
    function extensionToAction(extension) {
      return /** @type {!UI.Action} */ (this.action(extension.descriptor()['actionId']));
    }
  }

  /**
   * @param {string} actionId
   * @return {?UI.Action}
   */
  action(actionId) {
    return this._actionsById.get(actionId) || null;
  }
};

/**
 * @unrestricted
 */
UI.Action = class extends Common.Object {
  /**
   * @param {!Runtime.Extension} extension
   */
  constructor(extension) {
    super();
    this._extension = extension;
    this._enabled = true;
    this._toggled = false;
  }

  /**
   * @return {string}
   */
  id() {
    return this._extension.descriptor()['actionId'];
  }

  /**
   * @return {!Promise.<boolean>}
   */
  execute() {
    return this._extension.instance().then(handleAction.bind(this));

    /**
     * @param {!Object} actionDelegate
     * @return {boolean}
     * @this {UI.Action}
     */
    function handleAction(actionDelegate) {
      var actionId = this._extension.descriptor()['actionId'];
      var delegate = /** @type {!UI.ActionDelegate} */ (actionDelegate);
      return delegate.handleAction(UI.context, actionId);
    }
  }

  /**
   * @return {string}
   */
  icon() {
    return this._extension.descriptor()['iconClass'] || '';
  }

  /**
   * @return {string}
   */
  toggledIcon() {
    return this._extension.descriptor()['toggledIconClass'] || '';
  }

  /**
   * @return {boolean}
   */
  toggleWithRedColor() {
    return !!this._extension.descriptor()['toggleWithRedColor'];
  }

  /**
   * @param {boolean} enabled
   */
  setEnabled(enabled) {
    if (this._enabled === enabled)
      return;

    this._enabled = enabled;
    this.dispatchEventToListeners(UI.Action.Events.Enabled, enabled);
  }

  /**
   * @return {boolean}
   */
  enabled() {
    return this._enabled;
  }

  /**
   * @return {string}
   */
  category() {
    return this._extension.descriptor()['category'] || '';
  }

  /**
   * @return {string}
   */
  tags() {
    return this._extension.descriptor()['tags'] || '';
  }

  /**
   * @return {string}
   */
  title() {
    var title = this._extension.title();
    var options = this._extension.descriptor()['options'];
    if (options) {
      for (var pair of options) {
        if (pair['value'] !== this._toggled)
          title = pair['title'];
      }
    }
    return title;
  }

  /**
   * @return {boolean}
   */
  toggled() {
    return this._toggled;
  }

  /**
   * @param {boolean} toggled
   */
  setToggled(toggled) {
    if (this._toggled === toggled)
      return;

    this._toggled = toggled;
    this.dispatchEventToListeners(UI.Action.Events.Toggled, toggled);
  }
};

/** @enum {symbol} */
UI.Action.Events = {
  Enabled: Symbol('Enabled'),
  Toggled: Symbol('Toggled')
};

/**
 * @interface
 */
UI.ActionDelegate = function() {};

UI.ActionDelegate.prototype = {
  /**
   * @param {!UI.Context} context
   * @param {string} actionId
   * @return {boolean}
   */
  handleAction(context, actionId) {}
};

/** @type {!UI.ActionRegistry} */
UI.actionRegistry;


text:
package ukvm

import (
	"github.com/solo-io/unik/pkg/types"
)

func (p *UkvmProvider) ListVolumes() ([]*types.Volume, error) {
	volumes := []*types.Volume{}
	for _, volume := range p.state.GetVolumes() {
		volumes = append(volumes, volume)
	}
	return volumes, nil
}


text:
module Lockdown
  module View
    module Core
      def links(*lis)
        rvalue = []
        lis.each{|link| rvalue << link if link.length > 0 }
        rvalue.join(" | ")
      end
    end # Core

    module Merb
      include Lockdown::View::Core
      def self.included(base)
        base.send :alias_method, :link_to_open,  :link_to
        base.send :alias_method, :link_to,  :link_to_secured
      end

      def link_to_secured(name, url = '', options = {})
        if authorized? url
          return link_to_open(name, url, options)
        end
        return ""
      end

      def link_to_or_show(name, url = '', options = {})
        lnk = link_to(name, url , options)
        lnk.length == 0  ? name : lnk
      end
    end # Merb

    module Rails
      include Lockdown::View::Core
      def self.included(base)
        base.send :alias_method, :link_to_open,  :link_to
        base.send :alias_method, :link_to,  :link_to_secured

        base.send :alias_method, :button_to_open,  :button_to
        base.send :alias_method, :button_to,  :button_to_secured
      end

      def link_to_secured(name, options = {}, html_options = nil)
        # Don't want to go through the url_for twice
        url = url_for(options)
        if authorized? test_path(url, html_options)
          return link_to_open(name, url, html_options)
        end
        return ""
      end

      def link_to_or_show(name, options = {}, html_options = nil)
        lnk = link_to(name, options, html_options)
        lnk.length == 0 ? name : lnk
      end

      def button_to_secured(name, options = {}, html_options = nil)
        url = url_for(options)
        if authorized? test_path(url, html_options)
          return button_to_open(name, url, html_options)
        end
        return ""
      end

      private

      def test_path(url, html_options)
        if html_options.is_a?(Hash) && html_options[:method] == :delete
          url += "/destroy"
        elsif url.split("/").last =~ /\A\d+\z/
          url += "/show"
        end
        url
      end
    end # Rails
  end # View
end # Lockdown

if Object.const_defined?("Merb") && Merb.const_defined?("AssetsMixin")
  Merb::AssetsMixin.send :include, Lockdown::View::Merb
elsif Object.const_defined?("ActionView")
  ActionView::Base.send :include, Lockdown::View::Rails
else
  raise NotImplementedError, "Application helper unknown to Lockdown."
end


text:
tests = {
	'protojazz version': $.protojazzVersion,

	'old $ unharmed': test.frontend.name == 'html' ?
	                    function () { return $.old$ } :
	                    // not testable on node
	                    function () { return true },

	'$.extend': {
		'with object' : function () {
			var a = {};
			$.extend(a, { testValue : 'test1' });
			return a.testValue === 'test1';
		},

		'with function' : function () {
			var a = {};
			$.extend(a, function () {
				this.testValue = 'test1';
		    });
			return a.testValue === 'test1';
		}
	},

	'$.getP': function () {
		return $.getP(function(){}) === Function.prototype;
	},

	'$.proto': {
		'create Basic constructor': function () {
			this.protoTest = $.proto({
				testAttribute: 'this is a test',
			    initialized: false,
			    inheritanceTest: 'test',

			    init: function () {
			        this.initialized = true
			    },

			    supertest: function () {
			    	return true;
			    },

			    self: {
			        Static: 'example',
			        inherited: function () {
			    		this.inheritest = true;
			    	}
			    }
			});
			return typeof this.protoTest == 'function'
		},

		'self attribute': function () {
			return this.protoTest.Static == 'example'
		},

		instanciation: function () {
			this.testObj1 = new this.protoTest ();
			return this.testObj1 instanceof this.protoTest;
		},

		'access attributes': function () {
			return this.testObj1.testAttribute === 'this is a test';
		},

		'initialized?': function () {
			return this.testObj1.initialized
		},

		inheritance: {
			'create inherited constructor': function () {
				this.protoTest2 = $.proto(this.protoTest, {
					inheritanceTest: 'test2',

				    init: function (value) {
				    	this.Super('init');
				        this.initialized2 = value
				    },

				    supertest: function () {
				    	return false;
				    }
				});
				return typeof this.protoTest2 == 'function'
			},

			instantiation: function () {
				this.testObj2 = new this.protoTest2 (true);
				return this.testObj2 instanceof this.protoTest2;
			},

			'initialized?': function () {
				return this.testObj2.initialized2
			},

			'super initialized?': function () {
				return this.testObj2.initialized
			},

			'attributes shadowed': function () {
				return this.testObj2.inheritanceTest === 'test2';
			},

			'inherited attribute': function () {
				return this.protoTest.inheritest;
			},

			globals: {
				'isA': function () {
					return this.testObj2.isA(this.protoTest2) &&
					       this.testObj2.isA(this.protoTest);
				},

				'Super()': function () {
					return this.testObj2.Super() == this.protoTest.prototype;
				},

				'Super(key)': function () {
					return this.testObj2.Super('inheritanceTest') === 'test';
				},

				'Super(method)': function () {
					return this.testObj2.Super('supertest');
				}
			},

			'instantiate without "new"': function () {
				this.testObj3 = this.protoTest2(true);
				return this.testObj3.initialized2;
			},

			'$.noInit': function () {
				this.testObj4 = new this.protoTest2($.noInit);
				return !this.testObj4.initialized && !this.testObj4.initialized2;
			},

			'$.noInit without new': function () {
				this.testObj5 = this.protoTest2($.noInit);
				return !this.testObj5.initialized && !this.testObj5.initialized2;
			}
		}
	}
}


text:
namespace AppliedAlgebra.WaveletCodesTools.Encoding.MultilevelEncoderDependencies.WaveletCoefficientsGenerator
{
    using System;
    using System.Linq;
    using GfAlgorithms.Matrices;
    using GfPolynoms;
    using GfPolynoms.Extensions;

    /// <summary>
    /// Implementation of a wavelet coefficients vectors generator for codes that sequentially
    /// transforms parts of an information word
    /// </summary>
    public class CanonicalGenerator: IWaveletCoefficientsGenerator
    {
        /// <inheritdoc/>
        public FieldElementsMatrix GetInitialApproximationVector(FieldElement[] informationWord, int vectorLength)
        {
            if (informationWord == null)
                throw new ArgumentNullException(nameof(informationWord));
            if (vectorLength <= 0)
                throw new ArgumentException($"{nameof(vectorLength)} must be positive");
            if (informationWord.Length < vectorLength)
                throw new ArgumentException($"{nameof(informationWord)} is too short");

            return FieldElementsMatrix.ColumnVector(informationWord.Take(vectorLength).ToArray());
        }

        /// <inheritdoc/>
        public DetailsVectorGenerationResult GetDetailsVector(FieldElement[] informationWord, int levelNumber, FieldElementsMatrix approximationVector)
        {
            if (informationWord == null)
                throw new ArgumentNullException(nameof(informationWord));
            if (approximationVector == null)
                throw new ArgumentNullException(nameof(approximationVector));
            if (approximationVector.ColumnsCount != 1)
                throw new ArgumentException($"{nameof(approximationVector)} must be a column vector");

            var field = approximationVector.Field;
            var approximationVectorLength = approximationVector.RowsCount;

            var informationSymbols = informationWord.Skip(approximationVectorLength).Take(approximationVectorLength).ToArray();
            var correctableComponentsCount = approximationVectorLength - informationSymbols.Length;
            return new DetailsVectorGenerationResult(
                FieldElementsMatrix.ColumnVector(
                    informationSymbols.Concat(Enumerable.Repeat(field.Zero(), correctableComponentsCount)).ToArray()
                ),
                correctableComponentsCount
            );
        }
    }
}


text:
from future import standard_library
standard_library.install_aliases()
from builtins import object
import sys
try:
    import configparser
except ImportError:
    import ConfigParser as configparser

class BambouConfig(object):
    """ Bambou configuration

    """

    _should_raise_bambou_http_error = True
    _default_attribute_values_configuration_file_path = None
    _config_parser = None
    _id_remote_name = "ID"
    _id_type = str

    @classmethod
    def set_id_remote_name(cls, remote_name):
        """ Sets the remote name of the ID attribute.

            Args:
                remote_name (string): the ID remote name
        """
        cls._id_remote_name = remote_name

    @classmethod
    def get_id_remote_name(cls):
        """ Returns the remote name of the ID attribute.

            Returns:
                string: the remote name to use of ID
        """
        return cls._id_remote_name

    @classmethod
    def set_id_type(cls, typ):
        """ Sets the type ID attribute.

            Args:
                typ (type): the ID type
        """
        cls._id_type = typ

    @classmethod
    def get_id_type(cls):
        """ Returns the ID type

            Returns:
                type: the type of the ID
        """
        return cls._id_type

    @classmethod
    def set_should_raise_bambou_http_error(cls, should_raise):
        """ Set if bambou should raise BambouHTTPError when
            a request fails

            Args:
                should_raise (bool): a boolean. Default is True.

        """
        cls._should_raise_bambou_http_error = should_raise

    @classmethod
    def set_default_values_config_file(cls, file_path):
        """ Set the name for an alternative default value configuration file

            Args:
                file_path (string): path of the config file

        """
        cls._default_attribute_values_configuration_file_path = file_path
        cls._read_config()

    @classmethod
    def _read_config(cls):
        """ Reads the configuration file if any
        """

        cls._config_parser = configparser.ConfigParser()
        cls._config_parser.read(cls._default_attribute_values_configuration_file_path)

    @classmethod
    def get_default_attribute_value(cls, object_class, property_name, attr_type=str):
        """ Gets the default value of a given property for a given object.

            These properties can be set in a config INI file looking like

            .. code-block:: ini

                [NUEntity]
                default_behavior = THIS
                speed = 1000

                [NUOtherEntity]
                attribute_name = a value

            This will be used when creating a :class:`bambou.NURESTObject` when no parameter or data is provided
        """

        if not cls._default_attribute_values_configuration_file_path:
            return None

        if not cls._config_parser:
            cls._read_config()

        class_name = object_class.__name__

        if not cls._config_parser.has_section(class_name):
            return None

        if not cls._config_parser.has_option(class_name, property_name):
            return None

        if sys.version_info < (3,):
            integer_types = (int, long,)
        else:
            integer_types = (int,)

        if isinstance(attr_type, integer_types):
            return cls._config_parser.getint(class_name, property_name)
        elif attr_type is bool:
            return cls._config_parser.getboolean(class_name, property_name)
        else:
            return cls._config_parser.get(class_name, property_name)


text:
package psidev.psi.mi.jami.utils.comparator.participant;

import psidev.psi.mi.jami.model.Complex;
import psidev.psi.mi.jami.model.ExperimentalEntity;
import psidev.psi.mi.jami.model.FeatureEvidence;
import psidev.psi.mi.jami.model.Interactor;
import psidev.psi.mi.jami.utils.comparator.feature.DefaultFeatureEvidenceComparator;

import java.util.*;

/**
 * Default experimental entity comparator.
 * It will compare the basic properties of a experimental entity using DefaultEntityBaseComparator.
 *
 * This comparator will ignore all the other properties of an experimental entity.
 *
 * @author Marine Dumousseau (marine@ebi.ac.uk)
 * @version $Id$
 * @since
13/02/13

 */
public class DefaultExperimentalEntityComparator {

    /**
     * Use DefaultExperimentalEntityComparator to know if two experimental entities are equals.
     *
     * @param participant1 a {@link psidev.psi.mi.jami.model.ExperimentalEntity} object.
     * @param participant2 a {@link psidev.psi.mi.jami.model.ExperimentalEntity} object.
     * @return true if the two experimental entities are equal
     * @param checkComplexesAsInteractors a boolean.
     */
    public static boolean areEquals(ExperimentalEntity participant1, ExperimentalEntity participant2, boolean checkComplexesAsInteractors){
        Map<Complex, Set<Interactor>> processedComplexes = new IdentityHashMap<Complex, Set<Interactor>>();

        if (participant1 == participant2){
            return true;
        }
        else if (participant1 == null || participant2 == null){
            return false;
        }
        else {
            boolean ignoreInteractors = false;
            if (!checkComplexesAsInteractors){
                if (checkIfComplexAlreadyProcessed(participant1, participant2, processedComplexes)
                        || checkIfComplexAlreadyProcessed(participant2, participant1, processedComplexes)){
                    ignoreInteractors = true;
                }
            }

            if (!DefaultEntityBaseComparator.areEquals(participant1, participant2, ignoreInteractors)){
                return false;
            }

            // then compares the features
            Collection<FeatureEvidence> features1 = participant1.getFeatures();
            Collection<FeatureEvidence> features2 = participant2.getFeatures();

            if (features1.size() != features2.size()){
                 return false;
            }
            else {
                Iterator<FeatureEvidence> f1Iterator = new ArrayList<FeatureEvidence>(features1).iterator();
                Collection<FeatureEvidence> f2List = new ArrayList<FeatureEvidence>(features2);

                while (f1Iterator.hasNext()){
                    FeatureEvidence f1 = f1Iterator.next();
                    FeatureEvidence f2ToRemove = null;
                    for (FeatureEvidence f2 : f2List){
                        if (DefaultFeatureEvidenceComparator.areEquals(f1, f2)){
                            f2ToRemove = f2;
                            break;
                        }
                    }
                    if (f2ToRemove != null){
                        f2List.remove(f2ToRemove);
                        f1Iterator.remove();
                    }
                    else {
                        return false;
                    }
                }

                if (f1Iterator.hasNext() || !f2List.isEmpty()){
                    return false;
                }
                else{
                    return true;
                }
            }
        }
    }

    private static boolean checkIfComplexAlreadyProcessed(ExperimentalEntity bioParticipant1, ExperimentalEntity bioParticipant2, Map<Complex, Set<Interactor>> processedComplexes) {
        Complex complex = null;
        if (bioParticipant1.getInteractor() instanceof Complex){
            complex = (Complex) bioParticipant1.getInteractor();
        }

        // we already processed complex1 as first interactor
        if (complex != null && processedComplexes.containsKey(complex)){
            Set<Interactor> interactorSet = processedComplexes.get(complex);
            // already processed this pair
            if (interactorSet.contains(bioParticipant2.getInteractor())){
                return true;
            }
            else{
                interactorSet.add(bioParticipant2.getInteractor());
            }
        }

        return false;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<serializer>
    <class name="FOS\UserBundle\Model\User" exclusion-policy="all" xml-root-name="user">
        <property xml-attribute-map="true" name="username" type="string" expose="true" groups="user_list,user_view"/>
        <property xml-attribute-map="true" name="email" type="string" expose="true" groups="user_list,user_view"/>
    </class>
</serializer>