text:
package org.pjaygroup.restfulapp2.exceptions;

/**
 * @author Vijay Konduru
 *
 */
public class ResourceExistsException extends RuntimeException {

	private static final long serialVersionUID = 7058182342370221496L;

	public ResourceExistsException() {
		super();
	}

	public ResourceExistsException(String message) {
		super(message);
	}

}


text:
package com.sleepycat.je.serializecompatibility;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InvalidClassException;
import java.io.ObjectInputStream;

import junit.framework.TestCase;

import com.sleepycat.je.JEVersion;

/*
 * Test whether those serializable classes of prior versions can be read by
 * the latest one.
 *
 * This test is used in conjunction with SerializeWriteObjects, a main program
 * which is used to generate the serialized outputs of those serializable
 * classesfor in a version. When a new version is to be released,
 * run SerializedWriteObjects to generate serialized outputs, and then
 * add a test_x_y_z() method to this class.
 */
public class SerializeReadObjectsTest extends TestCase {

    /* Used to identify the two versions is compatible. */
    private boolean serializedSuccess = true;

    /* The directory where serialized files saved. */
    private File outputDir;

    /* The directory where outputDir saved. */
    private static final String parentDir =
        "test/com/sleepycat/je/serializecompatibility";

    /**
     * Test whether the latest version is compatible with 4.0.0.
     * @throws ClassNotFoundException when the test is enabled
     */
    public void test_4_0_0() throws ClassNotFoundException {
        //doTest(new JEVersion("4.0.0"));
    }

    /*
     * Read these serialized files and convert it.  If it's compatible, it
     * won't throw the InvalidClassException; if not, it would throw out the
     * exception, serializedSuccess is false.
     */
    public void doTest(JEVersion version)
        throws ClassNotFoundException, IOException {

        outputDir = new File(parentDir, version.getNumericVersionString());
        if (!outputDir.exists()) {
            System.out.println("No such directory, try it again");
            System.exit(1);
        }

        try {
            ObjectInputStream in;
            for (SerializeInfo s : SerializeUtils.getSerializedSet()) {

                /*
                 * Do the check when the latest version larger than the
                 * assigned version.
                 */
                if (JEVersion.CURRENT_VERSION.compareTo(version) >= 0) {
                    in = new ObjectInputStream
                        (new FileInputStream
                            (outputDir.getPath() +
                             System.getProperty("file.separator") +
                             s.getName() + ".out"));
                    /* Check that we can read the object successfully. */
                    in.readObject();
                    in.close();
                }
            }
        } catch (InvalidClassException e) {
            /* Reading serialized output failed.*/
            serializedSuccess = false;
        } catch (FileNotFoundException fnfe) {
            /* A class which doesn't exist in the former version. */
            serializedSuccess = false;
            System.out.println("The older version doesn't include this file.");
        }

        if (serializedSuccess) {
            System.out.println("Serialization is compatible");
        } else {
            System.out.println("Serialization is not compatible");
        }

        assertTrue(serializedSuccess);
    }
}

redpajama_set_name: RedPajamaGithub


text:
namespace child_process_logging {

namespace {

// exported in breakpad_win.cc/crashpad_win.cc:
//    void __declspec(dllexport) __cdecl SetCrashKeyValueImpl.
typedef void(__cdecl* SetCrashKeyValue)(const wchar_t*, const wchar_t*);

// exported in breakpad_win.cc/crashpad_win.cc:
//    void __declspec(dllexport) __cdecl ClearCrashKeyValueImpl.
typedef void(__cdecl* ClearCrashKeyValue)(const wchar_t*);

void SetCrashKeyValueTrampoline(const base::StringPiece& key,
                                const base::StringPiece& value) {
  static SetCrashKeyValue set_crash_key = [](){
    HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName);
    return reinterpret_cast<SetCrashKeyValue>(
        exe_module ? GetProcAddress(exe_module, "SetCrashKeyValueImpl")
                   : nullptr);
  }();
  if (set_crash_key) {
    (set_crash_key)(base::UTF8ToWide(key).data(),
                    base::UTF8ToWide(value).data());
  }
}

void ClearCrashKeyValueTrampoline(const base::StringPiece& key) {
  static ClearCrashKeyValue clear_crash_key = [](){
    HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName);
    return reinterpret_cast<ClearCrashKeyValue>(
        exe_module ? GetProcAddress(exe_module, "ClearCrashKeyValueImpl")
                   : nullptr);
  }();
  if (clear_crash_key)
    (clear_crash_key)(base::UTF8ToWide(key).data());
}

}  // namespace

void Init() {
  crash_keys::RegisterChromeCrashKeys();
  base::debug::SetCrashKeyReportingFunctions(&SetCrashKeyValueTrampoline,
                                             &ClearCrashKeyValueTrampoline);

  // This would be handled by BreakpadClient::SetCrashClientIdFromGUID(), but
  // because of the aforementioned issue, crash keys aren't ready yet at the
  // time of Breakpad initialization, load the client id backed up in Google
  // Update settings instead.
  scoped_ptr<metrics::ClientInfo> client_info =
      GoogleUpdateSettings::LoadMetricsClientInfo();
  if (client_info)
    crash_keys::SetMetricsClientIdFromGUID(client_info->client_id);
}

}  // namespace child_process_logging


text:
using System.Diagnostics.CodeAnalysis;
using System.Windows;
using System.Windows.Input;
using GalaSoft.MvvmLight.Messaging;
using Twice.Messages;

namespace Twice.Utilities.Ui
{
	[ExcludeFromCodeCoverage]
	internal class WaitMessageHandler
	{
		public WaitMessageHandler( IMessenger messenger )
		{
			messenger.Register<WaitMessage>( this, OnWaitMessage );
		}

		private void OnWaitMessage( WaitMessage msg )
		{
			if( msg.Start )
			{
				MainWindow = Application.Current.MainWindow;

				OldCursor = MainWindow.Cursor;
				MainWindow.Cursor = Cursors.Wait;
			}
			else
			{
				MainWindow.Cursor = OldCursor;
			}
		}

		private Window MainWindow;
		private Cursor OldCursor;
	}
}


text:
namespace NES.Contracts
{
    public interface IEventSerializer
    {
        string Serialize(object @event);
        object Deserialize(string data);
    }
}


text:
import logging
import re

from django.conf import settings
from elasticsearch import Elasticsearch
from elasticsearch_dsl import FacetedSearch, TermsFacet
from elasticsearch_dsl.faceted_search import NestedFacet
from elasticsearch_dsl.query import (
    Bool,
    FunctionScore,
    MultiMatch,
    Nested,
    SimpleQueryString,
    Term,
    Terms,
    Wildcard,
)

from readthedocs.search.documents import PageDocument, ProjectDocument

log = logging.getLogger(__name__)

ALL_FACETS = ['project', 'version', 'role_name', 'language']

class RTDFacetedSearch(FacetedSearch):

    """Custom wrapper around FacetedSearch."""

    # Search for both 'and' and 'or' operators.
    # The score of and should be higher as it satisfies both or and and.
    operators = ['and', 'or']

    # Sources to be excluded from results.
    excludes = []

    _highlight_options = {
        'encoder': 'html',
        'number_of_fragments': 1,
        'pre_tags': ['<span>'],
        'post_tags': ['</span>'],
    }

    def __init__(
            self,
            query=None,
            filters=None,
            projects=None,
            aggregate_results=True,
            use_advanced_query=True,
            **kwargs,
    ):
        """
        Custom wrapper around FacetedSearch.

        :param string query: Query to search for
        :param dict filters: Filters to be used with the query.
        :param projects: A dictionary of project slugs mapped to a `VersionData` object.
         Or a list of project slugs.
         Results are filter with these values.
        :param use_advanced_query: If `True` forces to always use
         `SimpleQueryString` for the text query object.
        :param bool aggregate_results: If results should be aggregated,
         this is returning the number of results within other facets.
        :param bool use_advanced_query: Always use SimpleQueryString.
         Set this to `False` to use the experimental fuzzy search.
        """
        self.use_advanced_query = use_advanced_query
        self.aggregate_results = aggregate_results
        self.projects = projects or {}

        # Hack a fix to our broken connection pooling
        # This creates a new connection on every request,
        # but actually works :)
        log.info('Hacking Elastic to fix search connection pooling')
        self.using = Elasticsearch(**settings.ELASTICSEARCH_DSL['default'])

        filters = filters or {}

        # We may recieve invalid filters
        valid_filters = {
            k: v
            for k, v in filters.items()
            if k in self.facets
        }
        super().__init__(query=query, filters=valid_filters, **kwargs)

    def _get_queries(self, *, query, fields):
        """
        Get a list of query objects according to the query.

        If the query is a single term we try to match partial words and substrings
        (available only with the DEFAULT_TO_FUZZY_SEARCH feature flag),
        otherwise we use the SimpleQueryString query.
        """
        get_queries_function = (
            self._get_single_term_queries
            if self._is_single_term(query)
            else self._get_text_queries
        )

        return get_queries_function(
            query=query,
            fields=fields,
        )

    def _get_text_queries(self, *, query, fields):
        """
        Returns a list of query objects according to the query.

        SimpleQueryString provides a syntax to let advanced users manipulate
        the results explicitly.

        We need to search for both "and" and "or" operators.
        The score of "and" should be higher as it satisfies both "or" and "and".

        For valid options, see:

        - https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html  # noqa
        """
        queries = []
        is_advanced_query = self.use_advanced_query or self._is_advanced_query(query)
        for operator in self.operators:
            if is_advanced_query:
                query_string = SimpleQueryString(
                    query=query,
                    fields=fields,
                    default_operator=operator,
                )
            else:
                query_string = self._get_fuzzy_query(
                    query=query,
                    fields=fields,
                    operator=operator,
                )
            queries.append(query_string)
        return queries

    def _get_single_term_queries(self, query, fields):
        """
        Returns a list of query objects for fuzzy and partial results.

        We need to search for both "and" and "or" operators.
        The score of "and" should be higher as it satisfies both "or" and "and".

        We use the Wildcard query with the query suffixed by ``*`` to match substrings.

        For valid options, see:

        - https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html  # noqa

        .. note::

           Doing a prefix **and** suffix search is slow on big indexes like ours.
        """
        query_string = self._get_fuzzy_query(
            query=query,
            fields=fields,
        )
        queries = [query_string]
        for field in fields:
            # Remove boosting from the field,
            field = re.sub(r'\^.*$', '', field)
            kwargs = {
                field: {'value': f'{query}*'},
            }
            queries.append(Wildcard(**kwargs))
        return queries

    def _get_fuzzy_query(self, *, query, fields, operator='or'):
        """
        Returns a query object used for fuzzy results.

        For valid options, see:

        - https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html
        """
        return MultiMatch(
            query=query,
            fields=fields,
            operator=operator,
            fuzziness="AUTO:4,6",
            prefix_length=1,
        )

    def _is_single_term(self, query):
        """
        Check if the query is a single term.

        A query is a single term if it is a single word,
        if it doesn't contain the syntax from a simple query string,
        and if `self.use_advanced_query` is False.
        """
        is_single_term = (
            not self.use_advanced_query and
            query and len(query.split()) <= 1 and
            not self._is_advanced_query(query)
        )
        return is_single_term

    def _is_advanced_query(self, query):
        """
        Check if query looks like to be using the syntax from a simple query string.

        .. note::

           We don't check if the syntax is valid.
           The tokens used aren't very common in a normal query, so checking if
           the query contains any of them should be enough to determinate if
           it's an advanced query.

        Simple query syntax:

        https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html#simple-query-string-syntax
        """
        tokens = {'+', '|', '-', '"', '*', '(', ')', '~'}
        query_tokens = set(query)
        return not tokens.isdisjoint(query_tokens)

    def aggregate(self, search):
        """Overriden to decide if we should aggregate or not."""
        if self.aggregate_results:
            super().aggregate(search)

class ProjectSearch(RTDFacetedSearch):
    facets = {'language': TermsFacet(field='language')}
    doc_types = [ProjectDocument]
    index = ProjectDocument._index._name
    fields = ('name^10', 'slug^5', 'description')
    excludes = ['users', 'language']

    def query(self, search, query):
        """
        Customize search results to support extra functionality.

        If `self.projects` was given, we use it to filter the documents.
        Only filtering by a list of slugs is supported.

        Also:

        * Adds SimpleQueryString with `self.operators` instead of default query.
        * Adds HTML encoding of results to avoid XSS issues.
        """
        search = search.highlight_options(**self._highlight_options)
        search = search.source(excludes=self.excludes)

        queries = self._get_queries(
            query=query,
            fields=self.fields,
        )

        # Run bool query with should, so it returns result where either of the query matches.
        bool_query = Bool(should=queries)

        # Filter by project slugs.
        if self.projects:
            if isinstance(self.projects, list):
                projects_query = Bool(filter=Terms(slug=self.projects))
                bool_query = Bool(must=[bool_query, projects_query])
            else:
                raise ValueError('projects must be a list!')

        search = search.query(bool_query)
        return search

class PageSearch(RTDFacetedSearch):
    facets = {
        'project': TermsFacet(field='project'),
        'version': TermsFacet(field='version'),
        'role_name': NestedFacet(
            'domains',
            TermsFacet(field='domains.role_name')
        ),
    }
    doc_types = [PageDocument]
    index = PageDocument._index._name

    # boosting for these fields need to be close enough
    # to be re-boosted by the page rank.
    _outer_fields = ['title^1.5']
    _section_fields = ['sections.title^2', 'sections.content']
    _domain_fields = [
        'domains.name^1.5',
        'domains.docstrings',
    ]
    fields = _outer_fields
    excludes = ['rank', 'sections', 'domains', 'commit', 'build']

    def _get_projects_query(self):
        """
        Get filter by projects query.

        If it's a dict, filter by project and version,
        if it's a list filter by project.
        """
        if not self.projects:
            return None

        if isinstance(self.projects, dict):
            versions_query = [
                Bool(filter=[Term(project=project), Term(version=version)])
                for project, version in self.projects.items()
            ]
            return Bool(should=versions_query)

        if isinstance(self.projects, list):
            return Bool(filter=Terms(project=self.projects))

        raise ValueError('projects must be a list or a dict!')

    def query(self, search, query):
        """
        Manipulates the query to support nested queries and a custom rank for pages.

        If `self.projects` was given, we use it to filter the documents that
        match the same project and version.
        """
        search = search.highlight_options(**self._highlight_options)
        search = search.source(excludes=self.excludes)

        queries = self._get_queries(
            query=query,
            fields=self.fields,
        )

        sections_nested_query = self._get_nested_query(
            query=query,
            path='sections',
            fields=self._section_fields,
        )

        domains_nested_query = self._get_nested_query(
            query=query,
            path='domains',
            fields=self._domain_fields,
        )

        queries.extend([sections_nested_query, domains_nested_query])
        bool_query = Bool(should=queries)

        projects_query = self._get_projects_query()
        if projects_query:
            bool_query = Bool(must=[bool_query, projects_query])

        final_query = FunctionScore(
            query=bool_query,
            script_score=self._get_script_score(),
        )
        search = search.query(final_query)
        return search

    def _get_nested_query(self, *, query, path, fields):
        """Generate a nested query with passed parameters."""
        queries = self._get_queries(
            query=query,
            fields=fields,
        )

        raw_fields = [
            # Remove boosting from the field
            re.sub(r'\^.*$', '', field)
            for field in fields
        ]

        highlight = dict(
            self._highlight_options,
            fields={
                field: {}
                for field in raw_fields
            },
        )

        return Nested(
            path=path,
            inner_hits={'highlight': highlight},
            query=Bool(should=queries),
        )

    def _get_script_score(self):
        """
        Gets an ES script to map the page rank to a valid score weight.

        ES expects the rank to be a number greater than 0,
        but users can set this between [-10, +10].
        We map that range to [0.01, 2] (21 possible values).

        The first lower rank (0.8) needs to bring the score from the highest boost (sections.title^2)
        close to the lowest boost (title^1.5), that way exact results take priority:

        - 2.0 * 0.8 = 1.6 (score close to 1.5, but not lower than it)
        - 1.5 * 0.8 = 1.2 (score lower than 1.5)

        The first higher rank (1.2) needs to bring the score from the lowest boost (title^1.5)
        close to the highest boost (sections.title^2), that way exact results take priority:

        - 2.0 * 1.3 = 2.6 (score higher thank 2.0)
        - 1.5 * 1.3 = 1.95 (score close to 2.0, but not higher than it)

        The next lower and higher ranks need to decrease/increase both scores.

        See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-script-score-query.html#field-value-factor  # noqa
        """
        ranking = [
            0.01,
            0.05,
            0.1,
            0.2,
            0.3,
            0.4,
            0.5,
            0.6,
            0.7,
            0.8,
            1,
            1.3,
            1.4,
            1.5,
            1.6,
            1.7,
            1.8,
            1.9,
            1.93,
            1.96,
            2,
        ]
        # Each rank maps to a element in the ranking list.
        # -10 will map to the first element (-10 + 10 = 0) and so on.
        source = """
            int rank = doc['rank'].size() == 0 ? 0 : (int) doc['rank'].value;
            return params.ranking[rank + 10] * _score;
        """
        return {
            "script": {
                "source": source,
                "params": {"ranking": ranking},
            },
        }


text:
Below you can find sufficient information for successful contribution into the project.

## Code style

`ionic-native-http-connection-backend` uses [prettier](https://github.com/prettier/prettier) on git hook to keep code consistent.

To enable git hooks run `npm install` before commiting.

## Commit messages

`ionic-native-http-connection-backend` uses [semantic-release](https://github.com/semantic-release/semantic-release) to release new versions automatically.

To simplify valid commit message creation you can use `npm run commit` instead of `git commit`.

*  Commits of type `fix` will trigger bugfix releases, think `0.0.1`
*  Commits of type `feat` will trigger feature releases, think `0.1.0`
*  Commits with `BREAKING CHANGE` in body or footer will trigger breaking releases, think `1.0.0`

All other commit types will trigger no new release.

## Unit testing

The project follows [test-first](http://www.extremeprogramming.org/rules/testfirst.html) approach. Please apply code changes alongside with unit tests.

Tests run with `npm test` command.

## Ionic 3

The project accepts only bugfixes for Ionic 3.

### Ionic 3 with ionic-native 4

For fixes on Ionic 3 with ionic-native 4 use `ionic3-native4` branch.

### Ionic 3 with ionic-native 5

For fixes on Ionic 3 with ionic-native 5 use `ionic3-native5` branch.


text:
{% include head.html %}

                 <hgroup>

{{site.title}}

{{ site.tagline }}

                 </hgroup>

                 <lh>
Recent News
</lh>
                  {% for post in site.posts | limit:3 %}

{{ post.title }}

<time datetime="{{ post.date | date_to_xmlschema }}" itemprop="datePublished">{{ post.date | date: "%B %d, %Y" }}</time>

{% if post.description %}{{ post.description  | strip_html | strip_newlines | truncate: 120 }}{% else %}{{ post.content | strip_html | strip_newlines | truncate: 120 }}{% endif %}

                  {% endfor %}

{% include footer-no-news.html %}


text:
namespace FDMC.Controllers
{
    using System.Linq;
    using Models;
    using Models.BindingModels;
    using SimpleMvc.Common;
    using SimpleMvc.Framework.Attributes.Methods;
    using SimpleMvc.Framework.Interfaces;

    public class UserController : BaseController
    {
        [HttpGet]
        public IActionResult Register()
            => this.User.IsAuthenticated ? this.RedirectToHome() : this.View();

        [HttpPost]
        public IActionResult Register(UserRegisterBindingModel model)
        {
            if (this.User.IsAuthenticated)
            {
                return this.RedirectToHome();
            }

            if (!this.IsValidModel(model))
            {
                this.BuildErrorView();
            }

            var passwordHash = PasswordUtilities.GetPasswordHash(model.Password);
            var user = new User
            {
                Username = model.Username,
                PasswordHash = passwordHash,
                Email = model.Email
            };

            using (this.Context)
            {
                this.Context.Users.Add(user);
                this.Context.SaveChanges();
            }

            this.SignIn(user.Username, user.Id);
            return this.RedirectToHome();
        }

        [HttpGet]
        public IActionResult Login()
            => this.User.IsAuthenticated ? this.RedirectToHome() : this.View();

        [HttpPost]
        public IActionResult Login(UserLoginBindingModel model)
        {
            if (this.User.IsAuthenticated)
            {
                return this.RedirectToHome();
            }

            if (!this.IsValidModel(model))
            {
                return this.BuildErrorView();
            }

            User user;
            using (this.Context)
            {
                user = this.Context
                    .Users
                    .FirstOrDefault(u => u.Username == model.Username);
            }

            var passwordHash = PasswordUtilities.GetPasswordHash(model.Password);

            if (passwordHash != user.PasswordHash)
            {
                return this.BuildErrorView();
            }

            this.SignIn(user.Username, user.Id);
            return this.RedirectToHome();
        }

        [HttpGet]
        public IActionResult Logout()
        {
            if (this.User.IsAuthenticated)
            {
                this.SignOut();
            }

            return this.RedirectToHome();
        }
    }
}


text:
from __future__ import unicode_literals

import datetime
from django.db import migrations, models

class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='File',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file', models.FileField(upload_to='cloud/uploads/%Y%m%d')),
                ('date', models.DateField(default=datetime.date.today)),
                ('password', models.CharField(blank=True, max_length=1000, null=True)),
            ],
        ),
    ]


text:
Rails.application.routes.draw do
  devise_for :users
  resources :questionnaires

  root 'questionnaires#index'
  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end


text:
__author__ = 'zaqwes'

from bs4 import BeautifulSoup

class HhruExtractor(object):
    def __init__(self):
        self.soup = None

    def get_company_info(self, filename):
        if not self.soup:
            self.soup = BeautifulSoup(open(filename))
        company_around = self.soup.body.find('div', attrs={'class':'companyname'})

        if not company_around:
            company_around = self.soup.body.find('div', attrs={'class':'hht-vacancy-company'})

        return str(company_around.prettify(encoding=self.soup.original_encoding))

    def get_job_title_html(self, filename):
        if not self.soup:
            self.soup = BeautifulSoup(open(filename))
        job_title_html = self.soup.body.find('h1', attrs={'class' : 'b-vacancy-title'})
        return str(job_title_html.prettify(encoding=self.soup.original_encoding))

    def get_job_details_html(self, filename):
        """ Ready html """
        if not self.soup:
            self.soup = BeautifulSoup(open(filename))

        job_details = self.soup.body.find('div', attrs={'class':'b-vacancy-desc'})
        return str(job_details.prettify(self.soup.original_encoding))


text:
package org.jpasecurity.persistence;

import static org.jpasecurity.util.Validate.notNull;

import java.util.Map;

import javax.persistence.Cache;
import javax.persistence.EntityGraph;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.PersistenceUnitUtil;
import javax.persistence.Query;
import javax.persistence.SynchronizationType;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.metamodel.Metamodel;

/**
 * @author Arne Limburg
 */
public class DelegatingEntityManagerFactory implements EntityManagerFactory {

    private EntityManagerFactory delegate;

    public DelegatingEntityManagerFactory(EntityManagerFactory delegate) {
        this.delegate = notNull(EntityManagerFactory.class, delegate);
    }

    public EntityManager createEntityManager() {
        return delegate.createEntityManager();
    }

    public EntityManager createEntityManager(@SuppressWarnings("rawtypes") Map map) {
        return delegate.createEntityManager(map);
    }

    public CriteriaBuilder getCriteriaBuilder() {
        return delegate.getCriteriaBuilder();
    }

    public Metamodel getMetamodel() {
        return delegate.getMetamodel();
    }

    public boolean isOpen() {
        return delegate.isOpen();
    }

    public void close() {
        delegate.close();
    }

    public Map<String, Object> getProperties() {
        return delegate.getProperties();
    }

    public Cache getCache() {
        return delegate.getCache();
    }

    public PersistenceUnitUtil getPersistenceUnitUtil() {
        return delegate.getPersistenceUnitUtil();
    }

    public <T> void addNamedEntityGraph(String name, EntityGraph<T> graph) {
        delegate.addNamedEntityGraph(name, graph);
    }

    public void addNamedQuery(String name, Query query) {
        delegate.addNamedQuery(name, query);
    }

    public EntityManager createEntityManager(SynchronizationType type, Map properties) {
        return delegate.createEntityManager(type, properties);
    }

    public EntityManager createEntityManager(SynchronizationType type) {
        return delegate.createEntityManager(type);
    }

    public <T> T unwrap(Class<T> type) {
        return delegate.unwrap(type);
    }

    protected EntityManagerFactory getDelegate() {
        return delegate;
    }
}


text:
package ru.job4j;

import java.math.BigInteger;

/**
 * Class Factorial, task "4.2. Создать программу вычисляющую факториал".
 *
 * @author apetrov
 * @version 1
 * @since 27.02.2017
 */
public class Factorial {

    /**
     * Calculating factorial of "n".
     *
     * @param number	original number
     * @return			factorial n.
     */
    public BigInteger calculateFactorial(int number) {
        BigInteger result;
        if (number < 0) {
            result = BigInteger.ZERO;
        } else {
            result = BigInteger.ONE;
            for (int i = 1; i <= number; ++i) {
                result = result.multiply(BigInteger.valueOf(i));
            }
        }
        return result;
    }
}


text:
=begin
# 1. Initial Solution
def mode (array)
  count = Hash.new 0
  array.each do |key|
    count[key] += 1
  end
            #returns an array,             #append this index
  max_val = count.max_by{|key,value| value} [1]
      # select = enumerable, iterates & selects k/v pairs
      # select |key,value| pair that meets the condition b==max_value                # do it by the keys
  count.select{|a,b| b == max_val}.keys
end
=end

# 3. Refactored Solution
def mode (array)
  count = array.each_with_object(Hash.new(0)) {|key,val| val[key] += 1 }
  max_val = count.max_by{|key,val| val} [1]
  #select from the k/v pair of count the val=max, by the keys
  count.select {|key,val| val == max_val}.keys
end

=begin
# 4. Reflection
(1) Which data structure did you and your pair decide to implement and why?

We chose a hash because in order to determine the most frequently occuring value in the array, we must create a key/value pair that counts the amount of times a key occurs

(2) Were you more successful breaking this problem down into implementable pseudocode than the last with a pair?

There was a general pseudocode that gave an idea, but given the process we went through to get to a solution, there were some gaps.

(3) What issues/successes did you run into when translating your pseudocode to code?

Not accounting for how to extract the mode with just the key and that there could be multiple keys to return.

(4) What methods did you use to iterate through the content? Did you find any good ones when you were refactoring? Were they difficult to implement?

Each new method learned took time to understand and break down what exactly it was doing.  These are the methods used:

.select
.each_by_object
.max_by
.keys

=end


text:
from lino.utils import Cycler

def splitter1(s):
    for ln in s.splitlines():
        ln = ln.strip()
        if len(ln) > 1 and ln[0] != '#':
            yield ln

LAST_NAMES_RUSSIA = u"""
A
Abezgauz
Aleksandrov
Altukhov
Alvang
Ankundinov
Arent
Arnold
Arshan
Arshun
Artemieva
Astafurov

B
Bardzecki
Bartoszewicz
Bashmakov
Baskov
Bek-Murzin
Belskaia
Berendt
Berndt
Bernt
Berthner
Bilinskii
Bleiwas
Bobrov
Bogaevskaia
Bogdanjwa
Bogdanovich
Bolokhovskis
Bondar
Borenstein
Borodinskii
Borovsky
Borowski
Botkina
Budberg
Budian
Budkovskiy
Budliavski
Burdzecki
Burundukov
Buryshkin
Burzeckaia

C
Chepelskii
Cheremisinova
Cherevin
Cherkesov
Cherlin
Cherlina
Chernikova
Cherstvennikov
Chirkoff
Chopiak
Chubinskii
Chuchin
Chuzhoi

D
Dauksza
Dikau
Dmitriev
Domashevich
Dombrovski
Dotsenko
Dvorkin
Dvorzhetskii
Dzhigit

E
Elout
Entin

F
Feldberg
Fialkovskii
Fiialkov
Flits
Frinovskii

G
Garder
Gaunshtein
Gavlik
Gavrikov
Gavronskii
Gelb
Gepfner
Gerasimova
Gerburt
Gershan
Gikalov
Gise
Giunter
Glazov
Glinka
Glubonin
Golender
Golovkin
Gontmakher
Gorchakov
Gorenshtein
Grabianko
Gundobin
Gunter
Gusarov
Gutelmakher
Gutemovskii
Gutenmakher
Guttenmakher

H
Holender

I
Ialovskaia
Ialovskii
Iavlenskaia
Ioksimovich
Ioselovich
Iskander
Istomin
Iunter
Iushkevich
Ivanov

K
Kalandarishvili
Kamarauskas
Kasianenko
Kenin
Khanina
Khavin
Kheifets
Khitrovo
Khmelnitskii
Khodkevich
Khripunov
Khripunova
Kintsel
Kiselow
Kitaev
Klopov
Koliabskaia
Kologrivov
Kologrivova
Komarnitskaia
Komarov
Komarovski
Komarovskii
Komerovskaia
Konchin
Konfer
Konkin
Konn
Konstantinov
Konstantinova
Korchagina
Korchinskaia
Kosmachevskaia
Kosovskaia
Kotko
Kovalevski
Kozerskaia
Kozerski
Kozlow
Kozyrskii
Kriukov
Kulikovskaia
Kunitskaia
Kupchenko
Kuzmin

L
Lebel
Lempitskaia
Lenevski
Leontiev
Lerche
Levanda
Levinson
Levitan
Levkov
Levkova
Likharev
Likhareva
Lipinskii
Lishin
Lisitskaia
Lisovskii
Lukowskaia

M
Magnovska
Mahkno
Maier
Makarova
Maklakov
Maksimov
Malakhovskii
Maletski
Maletskii
Malinovskii
Maliszewski
Maliszkewicz
Malitzka
Malitzkii
Malygin
Markevich
Masalsky
Maslov
Massalsky
Matsevich
Matsevichus
Matskevich
Mattel
Matulevich
Mayer
Medvedev
Medvedeva
Meier
Melnikov
Menshutkin
Menzhinskii
Mezentsov
Mezentsova
Mikhailov
Milaszewicz
Milaszewska
Milaszewski
Milkovich
Milodanovich
Milosz
Miloszinski
Mionchinskaia
Mirskii
Misostov
Miziukov
Molchanov
Molotkoff
Morozov
Mosalsky
Moskvin
Moszynski
Mozheika

N
Nazilevskii
Nebogatov
Negnevitskii
Nevelskoi
Nikonechnaia
Nisselovich

O
Oborskaia
Oborski
Okecka
Okkerman
Olendzskaia

P
Pankov
Panushkis
Parnes
Parolow
Paulson
Pavlovskii
Pechatnoff
Petrov
Petrovskaia
Petrovskii
Petrowa
Piotrovskii
Pletner
Plotnitskaia
Pogoretskaia
Pogorzelski
Polivanov
Polovinkin
Ponomarev
Popova
Popovtsev
Posiet
Potemkin
Pravdin
Priselkov
Prokofiev
Prokopchenko
Prokopovich
Pruszynski
Pumpianskii
Putilina

R
Rakhmelevich
Reikhman
Reznikov
Reznikova
Rodwalski
Rogusskii
Rokitskaia
Roschin
Rosenthal
Rowan
Rusakov
Rusakova

S
Saburova
Seidin
Semenov
Shalberov
Shchepetov
Shcherbatov
Shereshevski
Sheridan
Shikov
Shiritlokov
Shkarov
Shponarskaia
Shtadler
Shtein
Shubovich
Shuliakovskii
Shulkovskii
Shumakher
Shvarts
Siegel
Simonovich
Simson
Siniakov
Sipiagin
Sivortsova
Skipetroff
Skipetrova
Slavin
Slavina
Smolenskaia
Smolenskii
Sobeskaia
Sobetskaia
Sokolovskii
Solomon
Soloviev
Somov
Somova
Sotravits
Spektor
Speshiloff
Stanevich
Steinhauer
Steinheil
Stenghel
Stepunin
Sukhodolskaia
Sverzhenskii

T
Talkovskaia
Tamashevska
Tereshchenko
Tetiukov
Tokmakoff
Tomilin
Topczewski
Topezuvjw
Topezuvjwa
Trambetskaia
Treshchev
Trombetskaia
Trubachev
Trzemin
Trzheminska
Tsarev
Tselikova
Tsert
Tsitov
Turets
Turetskii

U
Ukhtomskii
Umanskii

V
Vans
Vargunin
Vasiliev
Veis
Veksler
Verbukh
Verden
Veretennikov
Vershvovski
Vikentieva
Vladimirskii
Volynski
Vorobiev

W
Weinstein
Werner
Wittenburg
Wolkowicz
Wolowitz
Worden

Y
Yakunun
Yunter

Z
Zalesskii
Zalicker
Zeif
Zelecker
Zelichonok
Zhalobovskaia
Zheldak
Zhelobovskaia
Zilberman
Zubkin
Zukov
Zukowskaia
Zukowski
"""

FEMALE_FIRST_NAMES_RUSSIA = u"""

Adla
Adleida
Adlesha
Adleta
Adviga
Afanasiia
Afanasiya
Afimia
Afonaseva
Agafia
Agafiia
Agafiya
Agafokliia
Agafonika
Agafya
Agapiia
Agasha
Agashka
Aglaia
Aglaida
Aglaya
Agna
Agnessa
Agnia
Agniia
Agrafena
Agrafina
Agramakova
Agripena
Agripina
Agrippa
Agrippina
Aitugan
Aizdiakova
Akillina
Akiulina
Aksana
Aksinya
Alasa
Albena
Albina
Aleksandra
Alena
Alenka
Alexandra
Alexcia
Alexia
Alexis
Alina
Alma
Alona
Alyssa
Alzbeta
Amelfa
Ampliia
Ana
Anastasia
Anastasiia
Anastasija
Anatassia
Andreea
Andreeva
Andreiana
Andrievicha
Anechka
Aneska
Anfiia
Anfoma
Anfusa
Angelika
Angelina
Angusta
Ania
Animaida
Animaisa
Anina
Anisia
Anisiia
Anisiya
Anisya
Anitchka
Anitsa
Anizka
Anja
Anje
Anjelica
Anjelika
Anka
Ann
Anna
Annastasija
Antonidka
Antonina
Anusia
Anya
Anzhela
Apfiia
Apolinaria
Apolinariia
Apoloniada
Apolosakifa
Ariadna
Arina
Arkhipa
Arkhippa
Artemeva
Artemiia
Asenka
Askitreia
Askitriia
Asya
Augusta
Avdeeva
Avdiushka
Avdotia
Avgusta
Avramova
Baialyn
Baibichia
Bakhteiarova
Balbara
Barbara
Bazhena
Bedche
Bela
Beleka
Belgukovna
Belka
Bella
Belukha
Benka
Bezruchka
Bezubaia
Bezui
Biana
Biata
Bibishkina
Biiata
Biriuta
Blanka
Blausa
Bogdana
Bogukhvala
Bogumezt
Bogumila
Boguslava
Bohdana
Bohumile
Boika
Bolce
Boldina
Bolemila
Boleslava
Bolgarina
Bolgarynia
Bona
Borisova
Boriuta
Bozena
Bozhana
Bozhitsa
Bragina
Branislava
Branizlawa
Bratomila
Bratromila
Bratrumila
Bruna
Budisla
Budizla
Budshka
Budska
Bukhval
Calina
Catarina
Caterina
Catherine
Catina
Catreen
Catrin
Catrina
Catrinia
Catriona
Catryn
Cecislava
Charlotta
Chebotova
Chekhina
Chekhyna
Cheliadina
Chemislava
Chenka
Chernavka
Chernislava
Chernka
Chesislava
Chimislava
Chiona
Chiudka
Chobotova
Chynica
Ciernislava
Clavdia
Cyzarine
Czarina
Czeimislawa
Dalida
Daliunda
Dama
Danilova
Daria
Darina
Daritsa
Darja
Daromila
Darya
Dasha
Datja
Davyd
Davyzha
Davyzheia
Debora
Deda
Dedenia
Dekava
Dekhova
Demidova
Denicha
Deretka
Derska
Derzhena
Derzhka
Desa
Desha
Despa
Dessa
Desta
Detana
Detava
Deva
Devka
Devochka
Devochkina
Devora
Dikana
Dima
Dimitra
Dimut
Dina
Dinah
Dinara
Dmitreeva
Dmitrieva
Dmitrovna
Dobegneva
Dobislava
Dobka
Dobra
Dobrava
Dobreva
Dobromila
Dobroslava
Dobrowest
Dobryna
Doda
Domaslava
Dominika
Domka
Domna
Domnika
Domnikiia
Domnina
Domona
Dorofeia
Doroteya
Dosya
Dounia
Dozene
Dozhene
Draginia
Dragomira
Dragoslawa
Dragushla
Draia
Drga
Drosida
Druzhinina
Dubrava
Dubravka
Duklida
Dunya
Dunyasha
Duscha
Dusha
Dusya
Dvora
Ecatarina
Ecatrinna
Eda
Edviga
Edviva
Efdokia
Effimia
Efimia
Efiopskaia
Efrasiia
Efrosenia
Efrossina
Ekatarina
Ekaterina
Ekatrinna
Ekzuperiia
Elacha
Eleena
Elen
Eleni
Elenya
Elga
Elgiva
Eliaksha
Elikonida
Elina
Elisava
Elisaveta
Elissa
Elizabeth
Elizarova
Elizaveta
Ella
Ellena
Ellina
Elonka
Elzbeta
Elzhbeta
Ennafa
Epestemiia
Epikhariia
Epistima
Eretiia
Ermolina
Erotiida
Ertugana
Esineeva
Euafina
Eufemia
Eugenia
Euprakseia
Eupraksiia
Eva
Evanova
Evdokeia
Evdokia
Evdokiia
Evdokiya
Evdokseia
Evdoksiia
Evelina
Evfaliia
Evfrasiia
Evfroseniia
Evfrosinya
Evgenia
Evgeniia
Evgeniya
Evgenya
Evginia
Evguenia
Evpraksi
Evpraksiia
Evrosena
Evseevskaia
Evsegniia
Evseveia
Evseviia
Evstoliia
Evtropiia
Faina
Fanaila
Fanya
Fatianova
Fausta
Favsta
Fayina
Fedia
Fedka
Fedkina
Fedora
Fedoritsa
Fedorka
Fedorova
Fedosia
Fedosiia
Fedosya
Fedotia
Fedotiia
Fedya
Feia
Feiniia
Fekla
Feklitsa
Fenia
Feodora
Feodosia
Feodosiia
Feoduliia
Feofana
Feoklita
Feoktista
Feona
Feonilla
Feopimta
Feopista
Feopistiia
Feozva
Ferfufiia
Ferufa
Fesalonikiia
Fetenia
Fetinia
Fetiniia
Fevronia
Filikitata
Filippiia
Filitsata
Filofei
Filofinaia
Filonilla
Fimochka
Fiva
Fiveia
Foimina
Fokina
Fomina
Fotina
Fotiniia
Fovro
Fovroneia
Frolova
Frosiniia
Gadina
Gaianiia
Gala
Galenka
Gali
Galina
Galina
Galine
Galochka
Galya
Galyna
Gamana
Gana
Gananiia
Gandaza
Ganna
Gasha
Gema
Genka
Georgieva
Gertruda
Ginechka
Giurgevaia
Gizheurann
Gizla
Glafira
Glasha
Glebovicha
Glikeriia
Glikeriya
Glukeriia
Glukheria
Godava
Golindukha
Goltiaeva
Golubitsa
Gordislava
Gorislava
Gorshedna
Gostena
Gostenia
Gostiata
Gostimira
Goulislava
Govdela
Gravriia
Grekina
Grekinia
Grekyna
Grifina
Grigoreva
Grigorevna
Grigorieva
Groza
Gruba
Grunya
Grusha
Halyna
Helen
Helena
Helenka
Helga
Hema
Henka
Hinezka
Hinica
Hodawa
Hora
Horina
Hosche
Hostena
Hruoza
Iadviga
Iakova
Iakovleva
Iakovlevskaia
Iakun
Iakunova
Iakunovaia
Ianevaia
Ianisha
Ianishe
Ianka
Iarche
Iarena
Iarina
Iarogned
Iaroia
Iarokhna
Iaroslava
Iarshek
Iasynia
Ieliaia
Iev
Ievlia
Ifrosenia
Ignateva
Ignatevskaia
Igoshkova
Iia
Ilariia
Ilia
Ilina
Ilya
Inessa
Inkena
Inna
Ioanna
Iona
Iosifova
Iovilla
Ira
Iraida
Irena
Irene
Irina
Irinia
Irinka
Irisa
Irodia
Irodiia
Isakova
Isidora
Ismagrad
Itka
Iudita
Iuliana
Iuliania
Iulianiia
Iuliia
Iulita
Iulitta
Iuniia
Iurevna
Iustina
Ivana
Ivanova
Ivanovskaia
Iveska
Ivonne
Iziaslava
Izmaragd
Janna
Jarena
Jarene
Jarohna
Jekaterina
Jelena
Jelena
Jelizaveta
Jenica
Jeremia
Jevdokija
Jitka
Julia
Kace
Kacha
Kache
Kachka
Kala
Kaleria
Kaleriia
Kalia
Kalisa
Kalisfena
Kalista
Kalitina
Kallisfeniia
Kallista
Kamenka
Kamle
Kandaza
Kapetolina
Kaptelina
Karen
Karina
Karine
Karinna
Karolina
Karpova
Karpovskaia
Karrine
Karyna
Kasha
Kashka
Kata
Katalena
Katareena
Katarina
Kateena
Katerina
Katerinka
Katherina
Katherine
Katia
Katina
Katinka
Katiya
Katja
Katlina
Katreen
Katreena
Katrene
Katria
Katrien
Katrina
Katrine
Katrusha
Katrya
Katryn
Katryna
Kattrina
Kattryna
Katunia
Katuscha
Katya
Katyenka
Katyushka
Katyuska
Kazdoia
Kerkira
Kharesa
Khariessa
Kharitaniia
Kharitina
Kharitona
Kharitonova
Kheoniia
Khioniia
Khlopyreva
Khovra
Khrana
Khrisiia
Khristeen
Khristen
Khristianova
Khristin
Khristina
Khristine
Khristyana
Khristyna
Khrstina
Khrystina
Khrystyn
Khrystyne
Khvalibud
Khynika
Kikiliia
Kilikeia
Kilikiia
Kiprilla
Kira
Kiraanna
Kiriakiia
Kiriena
Kirilla
Kirilovskaia
Kisa
Kiska
Kitsa
Kittiana
Kiuprila
Kiuriakiia
Kiza
Klasha
Klavdiia
Kleopatra
Klychikha
Knikki
Kogorshed
Koia
Koika
Kolomianka
Konchaka
Konchasha
Konkordiia
Konstantiia
Konstiantina
Konstiantinova
Kora
Koretskaia
Korina
Korotkaia
Korotkova
Korotsek
Korotskovaia
Kosa
Kosenila
Kostenka
Kostya
Kostyusha
Kotik
Kovan
Kovana
Kowan
Kozma
Kozmina
Krabava
Krasa
Krestiia
Kristina
Krivulinaia
Krunevichovna
Krushka
Ksafipa
Ksana
Ksanfippa
Ksanochka
Ksenia
Kseniia
Kseniya
Ksenya
Kshtovtovna
Ksnia
Ksniatintsa
Kudra
Kuna
Kunei
Kunka
Kunko
Kunku
Kuntse
Kuriana
Kuznetsova
Kvasena
Kvetava
Kzhna
Lacey
Lacey
Lada
Laikina
Lala
Lanassa
Lanka
Lara
Lari
Larina
Larisa
Larissa
Larissa
Larochka
Larra
Laryssa
Latskaia
Leia
Leka
Lelik
Lena
Lenina
Lenochka
Lenora
Lenusy
Lenusya
Leonilla
Leonteva
Lepa
Lera
Lerka
Leva
Liba
Libania
Libusa
Lida
Lidena
Lidia
Lidiia
Lidija
Lidiy
Lidiya
Lidka
Lidmila
Lidocha
Lidochka
Lieba
Lila
Lilac
Lilia
Liolya
Lipa
Lisa
Lisanka
Lisaveta
Liseetsa
Lishka
Lisil
Liska
Lisotianka
Liuba
Liubchanina
Liubka
Liubokhna
Liubone
Liubusha
Liudena
Liudmila
Liunharda
Liutarda
Liutsilla
Liza
Lizabeta
Lizanka
Lizette
Ljudmila
Ljudmilla
Lolya
Lotta
Luba
Lubachitsa
Lubmila
Lubmilla
Lubohna
Lubov
Lubusha
Luda
Ludiia
Ludmia
Ludmila
Ludmilla
Ludomia
Luka
Lukeria
Lukerina
Lukerya
Lukiia
Lukina
Lukiria
Lukoianova
Lvovicha
Lyalechka
Lyalya
Lybed
Lydia
Lyeta
Lyuba
Lyubochka
Lyubonka
Lyubov
Lyudmila
Lyudmilla
Lyuha
Lyutsiana

Machko
Machna
Magdalina
Magmeteva
Maiya
Makhna
Makrina
Maksimina
Maksimova
Malana
Malania
Maliusha
Maliuta
Malka
Malona
Malonia
Maluchka
Malusha
Mamelfa
Mamika
Mana
Manechka
Manka
Manya
Mara
Marana
Maremiana
Marfa
Marfutka
Margarita
Margo
Maria
Marian
Marianna
Marianne
Marianskaia
Maricha
Marichinich
Mariia
Marimiana
Marina
Marinka
Marinochka
Marinskaia
Marionilla
Marisha
Maritanna
Maritsa
Marjka
Marka
Markiana
Marnie
Marous
Marta
Martemianova
Marufa
Marulia
Marusya
Marya
Mascha
Masha
Mashenka
Matfeitsa
Matrena
Matrona
Matruna
Matryoshka
Mavra
Maya
Mazcho
Melania
Melaniia
Meletina
Melita
Melitina
Menshikova
Mergivana
Merkureva
Miesha
Mika
Mikhaila
Mikhailova
Mikitina
Mikula
Mikulina
Mila
Milakhna
Milana
Milata
Milava
Milehva
Milekha
Milena
Milenia
Milesa
Mileva
Miliia
Milika
Militsa
Milka
Milleise
Milohna
Milokhna
Miloslava
Miloushka
Miluska
Minodora
Mira
Mirena
Mironova
Miropiia
Miroslava
Mirozlava
Mirra
Misha
Mitrodora
Mizinovskaia
Mlada
Moiko
Morava
Morawa
Mounya
Mousia
Mozyr
Mstislava
Mstislavliaia
Mudri
Muniia
Mura
Muroniia
Muza
Myrra
Myshka
Myslna
Nadeek
Nadeekovaia
Nadejda
Nadenka
Nadia
Nadie
Nadine
Nadiya
Nadja
Nadjenka
Nadya
Nadyenka
Nadysha
Nadyuiska
Naglaya
Na'Kesha
Nakita
Narkissa
Nastasia
Nastasich
Nastasiia
Nastasja
Nastassia
Nastenka
Nastia
Nastiona
Nastionka
Nastiusha
Nastka
Natachia
Natacia
Natalia
Nataliia
Natalja
Natalka
Natalya
Natascha
Natasha
Natashenka
Natashia
Natasia
Natassia
Nathasha
Nazarova
Nebracha
Nebraga
Neda
Nedana
Nedelia
Nekrasa
Nekrasia
Neliuba
Nemilka
Nemka
Neonila
Nesdits
Nesha
Nessa
Nesy
Neta
Netka
Neva
Neza
Nezhatok
Nezhdakha
Nezhka
Nifantova
Nika
Niki
Nikiforova
Nikita
Nikitina
Nikkylia
Nikolena
Niksha
Nimfodora
Nina
Ninel
Ninockha
Ninotchka
Nitasha
Nitca
Nona
Nonna
Nostasia
Nunekhiia
Nyura
Nyusha
Obrezkova
Odigitriia
Odintsova
Ofce
Ofimia
Ogafia
Ogafitsa
Ogashka
Ografena
Ogrifina
Ogrofena
Ogrufena
Ogrufina
Okinfieva
Oksana
Oksana
Oksanochka
Okseniia
Oksinia
Oksiutka
Oktyabrina
Okulina
Olechka
Oleksandra
Olena
Olenitsa
Olenka
Olfereva
Olga
Olginitsa
Olgirdovna
Olgov
Olimpiada
Olisava
Olivera
Olkha
Olya
Olzhbeta
Omelfa
Ondreiana
Onoslava
Ontonia
Ontsiforova
Ontsyforova
Oprosiniia
Orenka
Oria
Orina
Orlenda
Orlitza
Orsha
Orshinaia
Ortemeva
Orya
Osipova
Osliabia
Ostafia
Ostankova
Ostashkova
Osyenya
Ovdeeva
Ovdiukha
Ovdokea
Ovdotia
Ovdotitsa
Ovtsa
Oxana
Paladia
Palasha
Panfilova
Pansemna
Pantislava
Pantyslawa
Panya
Paraaha
Paramona
Parasha
Parasia
Paraskova
Paraskovga
Paraskovgiia
Paraskovia
Paraskoviia
Paroskova
Pasha
Patrova
Paula
Paulina
Pauline
Pavel
Pavla
Pavlova
Pavloveia
Pavlusha
Pchuneia
Pechta
Pelaga
Pelageia
Pelageya
Pelagiia
Perchta
Peredeslava
Perkhta
Perkhte
Perpetuia
Petronila
Petrova
Petrovna
Petsa
Peza
Pheodora
Piama
Piina
Piminova
Pirueva
Plakida
Platonida
Pokinaria
Poladia
Polazhitsa
Polia
Polikseniia
Polinaria
Poliuzhaia
Poloneika
Polotsk
Polotska
Poloudnitsa
Polovinova
Pomnislavka
Pompliia
Ponaria
Popliia
Popova
Poroskova
Poved
Praskovja
Praskovya
Prebrana
Predslava
Predyslava
Preia
Preksedys
Premislava
Prepedigna
Presthlava
Priba
Pribyslava
Priia
Prikseda
Priskilla
Priskula
Proksha
Proniakina
Prosdoka
Proskudiia
Przhibislava
Przybyslawa
Pukhleriia
Pulkheriia
Puna
Puteshineia
Putok
Putokoveia
Rada
Radia
Radivilovna
Radka
Rado
Radok
Radokhna
Radokovaia
Radonia
Radosha
Radoslava
Radosta
Radoste
Radozte
Radslava
Ragneda
Ragosna
Rahil
Raina
Raisa
Raiza
Rajna
Rakhiel
Ratka
Ratslava
Raya
Rechkina
Reicza
Reshunda
Richca
Richica
Richika
Richikha
Richtca
Richza
Riksa
Rima
Ripsimia
Rislava
Rita
Rogned
Roksana
Romanovna
Roscislawa
Roslava
Rossitza
Rostislava
Roza
Rozalia
Rozgneda
Rozhneva
Rufina
Rulza

Rusa
Rusna
Ryska
Sabina
Sacha
Sahsha
Samarina
Sanya
Sapozhnika
Sascha
Sashah
Sashana
Sashenka
Sashenka
Sashia
Sashka
Sausha
Savastian
Savastianova
Sbyslava
Selianka
Selivankov
Selivankova
Semenova
Semenovskaia
Semislava
Senia
Senny
Serafima
Sevastianiia
Sevastiiana
Severina
Sfandra
Shasha
Shcastna
Shchastna
Shedra
Shelovlevaya
Shiriaeva
Shkonka
Shura
Shushanika
Shvakova
Sidorova
Sima
Sina
Sinklitikiia
Siny
Sira
Siuiunbek
Siuiunbeka
Siuiunbuka
Siunbek
Siunbeka
Skameikina
Skonka
Slava
Slavna
Smils
Smina
Smirenka
Snanduliia
Snigurka
Sobina
Sofeia
Sofia
Sofiia
Sofiya
Sonaya
Sonechka
Sonia
Sonia
Sonja
Sonya
Sonyuru
Sonyusha
Sonyushka
Sophi
Sophia
Soroka
Sosanna
Sosfena
Sosipatra
Spasenieva
Spera
Spitoslava
Spitsislava
Stana
Stanislava
Stanka
Starsha
Stasy
Stasya
Stefanida
Stefanidka
Stefanova
Stefanya
Stepanida
Stepanova
Stephania
Stepka
Stesha
Stolma
Stolpolcha
Stopolcha
Stranizlava
Stratka
Strezhena
Strezhislava
Strezislava
Sudehna
Sudekhna
Sudila
Sulislava
Sumorokova
Sunklitikiia
Susana
Svakhna
Svatata
Svatava
Svatochna
Svatohna
Sveisla
Sveta
Svetlana
Svetocha
Svetokhna
Sviatata
Sviatokhna
Sviatoslava
Svoda
Swachnina
Swatawa
Symislava
Syp
Sypovaia
Tacha
Tachia
Tachiana
Tachianna
Tahn
Tahna
Tahnia
Tahniya
Tahnya
Tahsha
Taidula
Taina
Taisha
Taishineia
Taisiia
Tamara
Tamary
Tamera
Tamra
Tamryn
Tana
Tanalia
Tanasha
Tanaya
Tandula
Tanea
Tanechka
Taneya
Tania
Tanija
Tanita
Taniya
Tanja
Tanka
Tanna
Tannia
Tannis
Tanniya
Tannya
Tanya
Tasenka
Tasha
Tashana
Tashia
Tashiana
Tashianna
Tashina
Tashira
Tashiya
Tassa
Tasya
Tata
Tatiana
Tatianka
Tatianna
Tatiiana
Tatjana
Tatsa
Tatyana
Taunia
Taunya
Tavlunbeka
Tawnia
Tayna
Tazia
Teha
Tekh
Tekha
Tekusa
Tesheia
Teshka
Tetka
Tevkel
Tferianka
Thais
Thasha
Tiaga
Tina
Tishka
Tishkina
Titania
Titka
Tiutcheva
Tomila
Tomislava
Tonasha
Tonaya
Tonechka
Tonia
Tonja
Tonniya
Tonnya
Tonya
Torokanova
Toshiana
Tretiakovskaia
Troika
Trpena
Trufena
Tsaritsa
Tsvetkova
Tulna
Tutana
Tvoislava
Tvoyzlava
Ualentina
Uirko
Ulana
Uleia
Ulen'ka
Ulia
Uliaanitsa
Uliana
Ulianiia
Ulianka
Ulianushka
Uliasha
Uliiana
Ulita
Ulyana
Unefiia
Unka
Upritsa
Urshila
Ursula
Ustenia
Ustiniia
Vakhneva
Vakhtina
Valenta
Valentina
Valya
Vania
Vanmra
Vanya
Varenka
Varka
Varsonofia
Vartsislava
Varushka
Varvara
Varya
Varyusha
Vasileva
Vasilevna
Vasilevskaia
Vasilida
Vasilievaia
Vasilii
Vasilina
Vasilisa
Vasilissa
Vasilista
Vasisa
Vassa
Vassillissa
Vasya
Vaviia
Velika
Velislava
Ventseslava
Vera
Verochka
Veronika
Veronikeia
Vershina
Veruschka
Vetenega
Veveia
Viachenega
Victoria
Vida
Vika
Vikashenka
Viktoria
Viktoriya
Vila
Vilena
Vilenina
Vilma
Vilna
Virineia
Vironikiia
Vishemila
Vitalya
Vitasa
Vitko
Vitla
Vitoslava
Vivka
Vlada
Vladaia
Vladilena
Vladilenaova
Vladimira
Vladisava
Vladka
Vladlena
Vlaikha
Vlastika
Vlcena
Vlschet
Vogna
Voina
Voislava
Volodimerna
Volotka
Volotkoveia
Volotok
Vonda
Voyzlava
Vrata
Vratislava
Vrkhuslava
Vrotsislava
Vrsanka
Vseslava
Vukosava
Vukoslava
Vyesna
Vysheslava
Vyshia
Wannon
Warvara
Wava
Welislawa
Wierga
Wissa
Witoslava
Wiwka
Wladyka
Woina
Wrata
Wratislava
Wrocislawa
Xenia
Yalena
Yalenchka
Yalens
Yekaterina
Yelena
Yeva
Yevdokiya
Yevfrosinya
Yevgenya
Yogenya
Yovanka
Yulenka
Yulia
Yulianiya
Yulika
Yuliy
Yuliya
Yulya
Yusmara
Zabela
Zakharia
Zakharieva
Zakharina
Zamiatina
Zaneta
Zaritsa
Zasha
Zavidovicha
Zavorokhina
Zbina
Zbinka
Zbiska
Zbynek
Zbynko
Zbyshka
Zdena
Zdeslava
Zdislava
Zdzislaba
Zena
Zenaida
Zenaide
Zenechka
Zenochka
Zeny
Zenya
Zhanna
Zhdana
Zhena
Zhenya
Zhirava
Zhivana
Zhona
Zhonka
Zima
Zina
Zinaida
Zinerva
Zinoviia
Znata
Zofeia
Zoia
Zoika
Zoya
Zoyenka
Ztrezena
Zvatata
Zvenislava

"""

MALE_FIRST_NAMES_RUSSIA = u"""
Adrik
Akim
Alek
Aleksandr
Aleksi
Aleksis
Alexei
Alik
Aloyoshenka
Aloysha
Anatolii
Andrei
Andrusha
Andrya
Anstice
Antinko
Anton
Antosha
Arman
Avel
Bogdashha
Bohdan
Bolodenka
Boris
Boris
Boris
Borya
Boryenka
Brends
Brody
Burian
Cheslav
Czar
Danya
Demyan
Dima
Dimitri
Edik
Eduard
Egor
Egor
Evgenii
Fabi
Faddei
Fadey
Fadeyka
Fedor
Fedya
Fedyenka
Feliks
Filip
Fjodor
Fjodor
Foma
Fredek
Fyodor
Ganya
Gav
Gavrel
Gavrie
Gavril
Gavril
Gavrilovich
Gennadi
Gregori
Grigor
Grigori
Grigorii
Grisha
Hedeon
Helge
Igor
Igoryok
Ilya
Ioakim
Iov
Ivan
Ivano
Jascha
Jasha
Jeirgif
Jermija
Jov
Jurg
Karolek
Kiril
Kirill
Kliment
Konstantin
Konstantine
Kostya
Laurente
Leonide
Lev
Levka
Luka
Lukyan
Maks
Maksim
Maksimillian
Marko
Markov
Matvey
Matysh
Maxim
Michail
Mikhail
Mikhail
Misha
Mishe
Moriz
Motka
Naum
Nicolai
Nikolai
Oleg
Oleg
Olezka
Ony
Oral
Orel
Orell
Oriel
Orrel
Osip
Pabiyan
Pavel
Pavel
PavIpv
Pavlik
Pavlo
Pavlusha
Pavlushka
Pavlya
Petenka
Petrov
Petya
Pyotr
Roman
Romochka
Rurik
Rurik
Sacha
Sacha
Sanya
Sasha
Semyon
Serge
Sergei
Serguei
Seriozha
Seriozhenka
Sevastian
Shashenka
Shura
Shurik
Shurochka
Slavik
Stanislov

Stefan
Stephan
Stepka
Tamryn
Tasha
Tolenka
Tolya
Tosya
Tusya
Uri
Uriah
Urie
Ustin
Vadim
Valerii
Valerik
Vanechka
Vanya
Vanyusha
Vas
Vasilii
Vasily
Vassi
Vassily
Vasya
Viktor
Vitaliy
Vitenka
Vladik
Vladilen
Vladilen
Vladislav
Vladmir
Vladmiri
Vladya
Volody
Vyacheslav
Yakov
Yaremka
Yasha
Yefrem
Yerik
Yevgeni
Yura
Yuri
Yurii
Yurik
Yurochka
Zhenechka
Zhenya
Zhorah
Ziven
Zivon
Zory
"""

LAST_NAMES_RUSSIA = Cycler(splitter1(LAST_NAMES_RUSSIA))
MALE_FIRST_NAMES_RUSSIA = Cycler(splitter1(MALE_FIRST_NAMES_RUSSIA))
FEMALE_FIRST_NAMES_RUSSIA = Cycler(splitter1(FEMALE_FIRST_NAMES_RUSSIA))


text:
PageEngine.setup do |config|
  # Layouts available to the psge
  # config.layouts = [:application]

  # Page parts that are created by default with a new page
  # config.page_parts = %w{ body left right header footer }

  # Extra page status options, added to defaults
  # config.statuses = []

  # Filters that can be applied to the page parts content
  # config.filters = %w{ none html textile markdown }

  # List of actions that should be included when getting the available routes
  # config.required_route_actions = %w{ index show new edit create update }

  # List of controllers that should be excluded when getting the available routes
  # config.excluded_route_controllers = []

  # To give more control over which controllers are returned
  # config.excluded_route_controllers_regex = /^admin.*/

  # If a page should only be vieawable by a specific role set the role class here
  # config.role_class = 'Role'

  # Author class for the created pages
  # config.author_class = 'User'

  # Set the helper method that will be used to get the current author
  # config.current_author_helper = 'current_user'

  # Set the helper method that will be used to get the current viewer
  # config.current_viewer_helper = 'current_user'
end


text:
<?php

namespace App\Repositories;

use App\Models\Operator;
use App\Repositories\Contracts\OperatorRepositoryInterface;

class OperatorRepository extends Repository implements OperatorRepositoryInterface
{
	/**
	 * Constructor.
	 *
	 * @param \App\Models\Operator $model
	 */
	public function __construct(Operator $model)
	{
		$this->model = $model;
	}

	/**
	 * Get list of active operators.
	 *
	 * @return Illuminate\Database\Eloquent\Collecton
	 */
	public function getOperatorList()
	{
		return $this->model->active()
						   ->get();
	}

	/**
	 * Get operator by its primary key with list of schedules.
	 *
	 * @param  string $id
	 * @return \App\Models\Operator
	 */
	public function getOperatorWithSchedules($id)
	{
        $operator = $this->find($id);

        $operator->load('schedules', 'schedules.departure_station', 'schedules.arrival_station', 'schedules.train');

        return $operator;
	}
}


text:
.class public final enum Lcom/android/internal/telephony/DriverCall$State;
.super Ljava/lang/Enum;
.source "DriverCall.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/internal/telephony/DriverCall;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x4019
    name = "State"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Enum",
        "<",
        "Lcom/android/internal/telephony/DriverCall$State;",
        ">;"
    }
.end annotation

# static fields
.field private static final synthetic $VALUES:[Lcom/android/internal/telephony/DriverCall$State;

.field public static final enum ACTIVE:Lcom/android/internal/telephony/DriverCall$State;

.field public static final enum ALERTING:Lcom/android/internal/telephony/DriverCall$State;

.field public static final enum DIALING:Lcom/android/internal/telephony/DriverCall$State;

.field public static final enum HOLDING:Lcom/android/internal/telephony/DriverCall$State;

.field public static final enum INCOMING:Lcom/android/internal/telephony/DriverCall$State;

.field public static final enum WAITING:Lcom/android/internal/telephony/DriverCall$State;

# direct methods
.method static constructor <clinit>()V
    .locals 8

    .prologue
    const/4 v7, 0x4

    const/4 v6, 0x3

    const/4 v5, 0x2

    const/4 v4, 0x1

    const/4 v3, 0x0

    .line 31
    new-instance v0, Lcom/android/internal/telephony/DriverCall$State;

    const-string v1, "ACTIVE"

    invoke-direct {v0, v1, v3}, Lcom/android/internal/telephony/DriverCall$State;-><init>(Ljava/lang/String;I)V

    sput-object v0, Lcom/android/internal/telephony/DriverCall$State;->ACTIVE:Lcom/android/internal/telephony/DriverCall$State;

    .line 32
    new-instance v0, Lcom/android/internal/telephony/DriverCall$State;

    const-string v1, "HOLDING"

    invoke-direct {v0, v1, v4}, Lcom/android/internal/telephony/DriverCall$State;-><init>(Ljava/lang/String;I)V

    sput-object v0, Lcom/android/internal/telephony/DriverCall$State;->HOLDING:Lcom/android/internal/telephony/DriverCall$State;

    .line 33
    new-instance v0, Lcom/android/internal/telephony/DriverCall$State;

    const-string v1, "DIALING"

    invoke-direct {v0, v1, v5}, Lcom/android/internal/telephony/DriverCall$State;-><init>(Ljava/lang/String;I)V

    sput-object v0, Lcom/android/internal/telephony/DriverCall$State;->DIALING:Lcom/android/internal/telephony/DriverCall$State;

    .line 34
    new-instance v0, Lcom/android/internal/telephony/DriverCall$State;

    const-string v1, "ALERTING"

    invoke-direct {v0, v1, v6}, Lcom/android/internal/telephony/DriverCall$State;-><init>(Ljava/lang/String;I)V

    sput-object v0, Lcom/android/internal/telephony/DriverCall$State;->ALERTING:Lcom/android/internal/telephony/DriverCall$State;

    .line 35
    new-instance v0, Lcom/android/internal/telephony/DriverCall$State;

    const-string v1, "INCOMING"

    invoke-direct {v0, v1, v7}, Lcom/android/internal/telephony/DriverCall$State;-><init>(Ljava/lang/String;I)V

    sput-object v0, Lcom/android/internal/telephony/DriverCall$State;->INCOMING:Lcom/android/internal/telephony/DriverCall$State;

    .line 36
    new-instance v0, Lcom/android/internal/telephony/DriverCall$State;

    const-string v1, "WAITING"

    const/4 v2, 0x5

    invoke-direct {v0, v1, v2}, Lcom/android/internal/telephony/DriverCall$State;-><init>(Ljava/lang/String;I)V

    sput-object v0, Lcom/android/internal/telephony/DriverCall$State;->WAITING:Lcom/android/internal/telephony/DriverCall$State;

    .line 30
    const/4 v0, 0x6

    new-array v0, v0, [Lcom/android/internal/telephony/DriverCall$State;

    sget-object v1, Lcom/android/internal/telephony/DriverCall$State;->ACTIVE:Lcom/android/internal/telephony/DriverCall$State;

    aput-object v1, v0, v3

    sget-object v1, Lcom/android/internal/telephony/DriverCall$State;->HOLDING:Lcom/android/internal/telephony/DriverCall$State;

    aput-object v1, v0, v4

    sget-object v1, Lcom/android/internal/telephony/DriverCall$State;->DIALING:Lcom/android/internal/telephony/DriverCall$State;

    aput-object v1, v0, v5

    sget-object v1, Lcom/android/internal/telephony/DriverCall$State;->ALERTING:Lcom/android/internal/telephony/DriverCall$State;

    aput-object v1, v0, v6

    sget-object v1, Lcom/android/internal/telephony/DriverCall$State;->INCOMING:Lcom/android/internal/telephony/DriverCall$State;

    aput-object v1, v0, v7

    const/4 v1, 0x5

    sget-object v2, Lcom/android/internal/telephony/DriverCall$State;->WAITING:Lcom/android/internal/telephony/DriverCall$State;

    aput-object v2, v0, v1

    sput-object v0, Lcom/android/internal/telephony/DriverCall$State;->$VALUES:[Lcom/android/internal/telephony/DriverCall$State;

    return-void
.end method

.method private constructor <init>(Ljava/lang/String;I)V
    .locals 0
    .parameter
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()V"
        }
    .end annotation

    .prologue
    .line 30
    invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V

    return-void
.end method

.method public static valueOf(Ljava/lang/String;)Lcom/android/internal/telephony/DriverCall$State;
    .locals 1
    .parameter "name"

    .prologue
    .line 30
    const-class v0, Lcom/android/internal/telephony/DriverCall$State;

    invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;

    move-result-object v0

    check-cast v0, Lcom/android/internal/telephony/DriverCall$State;

    return-object v0
.end method

.method public static values()[Lcom/android/internal/telephony/DriverCall$State;
    .locals 1

    .prologue
    .line 30
    sget-object v0, Lcom/android/internal/telephony/DriverCall$State;->$VALUES:[Lcom/android/internal/telephony/DriverCall$State;

    invoke-virtual {v0}, Ljava/lang/Object;->clone()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [Lcom/android/internal/telephony/DriverCall$State;

    return-object v0
.end method


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
in Aptroot, Lücking, Sipman, Umaña & Chaves, Biblthca Lichenol. 97: 37 (2008)

#### Original name
Architrypethelium hyalinum Aptroot

### Remarks
null


text:
using PaySharp.Unionpay.Domain;
using PaySharp.Unionpay.Response;

namespace PaySharp.Unionpay.Request
{
    public class WapPayRequest : BaseRequest<WapPayModel, WapPayResponse>
    {
        public WapPayRequest()
        {
            RequestUrl = "/gateway/api/frontTransReq.do";
        }
    }
}


text:
require 'oauth'
require 'yajl'

module StackMob
  class Client

    VALID_METHODS = [:get, :post, :put, :delete]

    class InvalidRequestMethod < ArgumentError; end # invalid HTTP Method/Verb is passed to the client
    class RequestError < RuntimeError; end # response with code other than 200 received
    class BadResponseBody < RuntimeError; end # Client receives response with invalid JSON

    attr_accessor :app_name, :app_vsn

    def initialize(base_url, app_name, app_vsn, oauth_key, oauth_secret)
      self.app_name = app_name
      self.app_vsn = app_vsn

      create_oauth_client(oauth_key, oauth_secret, base_url)
    end

    def request(method, service, path, params = {})
      request_path, request_body = generate_path_and_body(method, service, path, params)

      args = [method, request_path, request_body]
      args << {"Content-Type" => "application/json"} if [:post, :put].include?(method)
      response = @oauth_client.send(*args)

      rcode = response.code.to_i
      if rcode >= 200 && rcode <= 299
        parse_response(response) if method != :delete
      else
        raise RequestError.new("\nReq Method: #{method}\nReq. Path: #{request_path}\nReq. Body: #{request_body}\nResp. Code: #{rcode}, Resp Body: #{response.respond_to?(:body) ? response.body : 'unknown'}")
      end
    end

    def create_oauth_client(key, secret, url)
      @oauth_client = OAuth::AccessToken.new(OAuth::Consumer.new(key, secret, :site => url))
    end
    private :create_oauth_client

    def generate_path_and_body(method, service, path, params)
      intermediate_path = full_path(service, path)
      case method
      when :get, :delete
        [intermediate_path + "?" + params_to_qs(params), ""]
      when :post, :put
        [intermediate_path, Yajl::Encoder.encode(params)]
      else
        raise InvalidRequestMethod
      end
    end
    private :generate_path_and_body

    def params_to_qs(params)
      params.to_a.map { |pair| pair.join("=") }.join("&")
    end
    private :params_to_qs

    def parse_response(r)
      Yajl::Parser.parse(r.body)
    rescue Yajl::ParseError
      raise BadResponseBody.new("#{r.body} is not valid JSON")
    end
    private :parse_response

    def full_path(service, requested_path)
      "/#{service}/#{self.app_vsn}/#{self.app_name}/#{strip_prepending_slash(requested_path)}"
    end
    private :full_path

    def strip_prepending_slash(path)
      path.gsub(/^\//, "")
    end
    private :strip_prepending_slash

  end
end


text:
using System;

namespace Godot
{
    public partial class FuncRef
    {
        public void SetInstance(Object instance)
        {
            throw new NotImplementedException();
        }

        public void SetFunction(string name)
        {
            throw new NotImplementedException();
        }
    }
}


text:
@implementation BaseTabbarController

- (void)didReceiveMemoryWarning {
//    NSLog(@"BaseTabbarController didReceiveMemoryWarning");
}

@end


text:
""" Auto Encoder Example.
Using an auto encoder on MNIST handwritten digits.
References:
    Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. "Gradient-based
    learning applied to document recognition." Proceedings of the IEEE,
    86(11):2278-2324, November 1998.
Links:
    [MNIST Dataset] http://yann.lecun.com/exdb/mnist/
"""
from __future__ import division, print_function, absolute_import

import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data

# Parameters
learning_rate = 0.01
training_epochs = 20
batch_size = 256
display_step = 1
examples_to_show = 10

# Network Parameters
n_hidden_1 = 256 # 1st layer num features
n_hidden_2 = 128 # 2nd layer num features
n_input = 784 # MNIST data input (img shape: 28*28)

def load_data():
    # Import MNIST data
    mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
    return mnist

def inputs_placeholder():
    # tf Graph input (only pictures)
    X = tf.placeholder("float", [None, n_input])
    return X

# Building the encoder
def encoder(x, weights, biases):
    # Encoder Hidden layer with sigmoid activation #1
    layer_1 = tf.nn.sigmoid(tf.add(tf.matmul(x, weights['encoder_h1']),
                                   biases['encoder_b1']))
    # Decoder Hidden layer with sigmoid activation #2
    layer_2 = tf.nn.sigmoid(tf.add(tf.matmul(layer_1, weights['encoder_h2']),
                                   biases['encoder_b2']))
    return layer_2

# Building the decoder
def decoder(x, weights, biases):
    # Encoder Hidden layer with sigmoid activation #1
    layer_1 = tf.nn.sigmoid(tf.add(tf.matmul(x, weights['decoder_h1']),
                                   biases['decoder_b1']))
    # Decoder Hidden layer with sigmoid activation #2
    layer_2 = tf.nn.sigmoid(tf.add(tf.matmul(layer_1, weights['decoder_h2']),
                                   biases['decoder_b2']))
    return layer_2

def model(X):
    weights = {
        'encoder_h1': tf.Variable(tf.random_normal([n_input, n_hidden_1])),
        'encoder_h2': tf.Variable(tf.random_normal([n_hidden_1, n_hidden_2])),
        'decoder_h1': tf.Variable(tf.random_normal([n_hidden_2, n_hidden_1])),
        'decoder_h2': tf.Variable(tf.random_normal([n_hidden_1, n_input])),
    }
    biases = {
        'encoder_b1': tf.Variable(tf.random_normal([n_hidden_1])),
        'encoder_b2': tf.Variable(tf.random_normal([n_hidden_2])),
        'decoder_b1': tf.Variable(tf.random_normal([n_hidden_1])),
        'decoder_b2': tf.Variable(tf.random_normal([n_input])),
    }

    # Construct model
    encoder_op = encoder(X, weights, biases)
    decoder_op = decoder(encoder_op, weights, biases)

    # Prediction
    y_pred = decoder_op
    # Targets (Labels) are the input data.
    y_true = X

    # Define loss and optimizer, minimize the squared error
    cost = tf.reduce_mean(tf.pow(y_true - y_pred, 2))
    optimizer = tf.train.RMSPropOptimizer(learning_rate).minimize(cost)
    return [y_pred, cost, optimizer]

def train_test(sess, mnist, X, y_pred, cost, optimizer):
    total_batch = int(mnist.train.num_examples/batch_size)
    # Training cycle
    for epoch in range(training_epochs):
        # Loop over all batches
        for i in range(total_batch):
            batch_xs, batch_ys = mnist.train.next_batch(batch_size)
            # Run optimization op (backprop) and cost op (to get loss value)
            _, c = sess.run([optimizer, cost], feed_dict={X: batch_xs})
        # Display logs per epoch step
        if epoch % display_step == 0:
            print("Epoch:", '%04d' % (epoch+1),
                  "cost=", "{:.9f}".format(c))

    print("Optimization Finished!")

    # Applying encode and decode over test set
    encode_decode = sess.run(
        y_pred, feed_dict={X: mnist.test.images[:examples_to_show]})
    # Compare original images with their reconstructions
    f, a = plt.subplots(2, 10, figsize=(10, 2))
    for i in range(examples_to_show):
        a[0][i].imshow(np.reshape(mnist.test.images[i], (28, 28)))
        a[1][i].imshow(np.reshape(encode_decode[i], (28, 28)))
    f.show()
    plt.draw()
    plt.waitforbuttonpress()

if __name__ == '__main__':
    ''' '''
    # load data
    mnist = load_data()
    # define inputs
    X = inputs_placeholder()
    # model
    [y_pred, cost, optimizer] = model(X)
    # Launch the graph
    with tf.Session() as sess:
        # Initializing the variables
        init = tf.global_variables_initializer()
        sess.run(init)
        # train
        train_test(sess, mnist, X, y_pred, cost, optimizer)


text:
<?php
/**
 * Created by PhpStorm.
 * User: Hanson
 * Date: 2016/12/13
 * Time: 20:56.
 */

namespace Hanson\Vbot\Contact;

use Hanson\Vbot\Core\ApiExceptionHandler;

class Friends extends Contacts
{
    /**
     * 根据微信号获取联系人.
     *
     * @param $alias
     *
     * @return mixed
     */
    public function getContactByAlias($alias)
    {
        return $this->getObject($alias, 'Alias', true);
    }

    /**
     * 根据微信号获取联系username.
     *
     * @param $alias
     *
     * @return mixed
     */
    public function getUsernameByAlias($alias)
    {
        return $this->getUsername($alias, 'Alias');
    }

    /**
     * 设置备注.
     *
     * @param $username
     * @param $remarkName
     *
     * @return bool
     */
    public function setRemarkName($username, $remarkName)
    {
        $url = sprintf('%s/webwxoplog?lang=zh_CN&pass_ticket=%s', $this->vbot->config['server.uri.base'], $this->vbot->config['server.passTicket']);

        $result = $this->vbot->http->post($url, json_encode([
            'UserName'    => $username,
            'CmdId'       => 2,
            'RemarkName'  => $remarkName,
            'BaseRequest' => $this->vbot->config['server.baseRequest'],
        ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES), true);

        return $result['BaseResponse']['Ret'] == 0;
    }

    /**
     * 设置是否置顶.
     *
     * @param $username
     * @param bool $isStick
     *
     * @return bool
     */
    public function setStick($username, $isStick = true)
    {
        $url = sprintf('%s/webwxoplog?lang=zh_CN&pass_ticket=%s', $this->vbot->config['server.uri.base'], $this->vbot->config['server.passTicket']);

        $result = $this->vbot->http->json($url, [
            'UserName'    => $username,
            'CmdId'       => 3,
            'OP'          => (int) $isStick,
            'BaseRequest' => $this->vbot->config['server.baseRequest'],
        ], true);

        return $result['BaseResponse']['Ret'] == 0;
    }

    /**
     * 主动添加好友.
     *
     * @param $username
     * @param null $content
     */
    public function add($username, $content = null)
    {
        $this->verifyUser(2, [
            'Value'            => $username,
            'VerifyUserTicket' => '',
        ], $content);
    }

    /**
     * 通过好友申请.
     *
     * @param $message
     */
    public function approve($message)
    {
        $this->verifyUser(3, [
            'Value'            => $message['info']['UserName'],
            'VerifyUserTicket' => $message['info']['Ticket'],
        ]);
    }

    /**
     * 验证通过好友.
     *
     * @param $code
     * @param $userList
     * @param null $content
     *
     * @return bool
     */
    public function verifyUser($code, $userList, $content = null)
    {
        $url = sprintf($this->vbot->config['server.uri.base'].'/webwxverifyuser?lang=zh_CN&r=%s&pass_ticket=%s', time() * 1000, $this->vbot->config['server.passTicket']);
        $data = [
            'BaseRequest'        => $this->vbot->config['server.baseRequest'],
            'Opcode'             => $code,
            'VerifyUserListSize' => 1,
            'VerifyUserList'     => [$userList],
            'VerifyContent'      => $content,
            'SceneListCount'     => 1,
            'SceneList'          => [33],
            'skey'               => $this->vbot->config['server.skey'],
        ];

        $result = $this->vbot->http->post($url, json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES), true);

        return ApiExceptionHandler::handle($result);
    }

    /**
     * 更新群组.
     *
     * @param $username
     * @param null $list
     *
     * @return array
     */
    public function update($username, $list = null): array
    {
        $username = is_array($username) ?: [$username];

        return parent::update($username, $this->makeUsernameList($username));
    }

    /**
     * 生成username list 格式.
     *
     * @param $username
     *
     * @return array
     */
    public function makeUsernameList($username)
    {
        $usernameList = [];

        foreach ($username as $item) {
            $usernameList[] = ['UserName' => $item, 'EncryChatRoomId' => ''];
        }

        return $usernameList;
    }
}


text:
.observation_field { border-bottom: 1px solid #eee; padding-bottom:10px;}
.observation_field {padding-left: 210px; position: relative; padding-right: 50px;}
.observation_field .removelink { position: absolute; right: 0; }
.observation_field .labeldesc {width: 200px; position:absolute; left: 0; top: 0;}
.observation_field.disabled {opacity: 0.5;}
#morefields .buttonrow .button, #morefields .buttonrow label, #morefields .buttonrow .inter { padding-top: 4px; padding-bottom:3px;vertical-align:top;}
#morefields {margin-bottom:20px;}


text:
from __future__ import absolute_import

from django.utils.translation import ugettext as _
from django.utils import timezone
from django.http import HttpResponse, HttpRequest

from zilencer.models import Deployment, RemotePushDeviceToken, RemoteZulipServer

from zerver.decorator import has_request_variables, REQ
from zerver.lib.error_notify import do_report_error
from zerver.lib.push_notifications import send_android_push_notification, \
    send_apple_push_notification
from zerver.lib.request import JsonableError
from zerver.lib.response import json_error, json_success
from zerver.lib.validator import check_dict, check_int
from zerver.models import UserProfile, PushDeviceToken, Realm
from zerver.views.push_notifications import validate_token

from typing import Any, Dict, Optional, Union, Text, cast

def validate_entity(entity):
    # type: (Union[UserProfile, RemoteZulipServer]) -> None
    if not isinstance(entity, RemoteZulipServer):
        raise JsonableError(_("Must validate with valid Zulip server API key"))

def validate_bouncer_token_request(entity, token, kind):
    # type: (Union[UserProfile, RemoteZulipServer], bytes, int) -> None
    if kind not in [RemotePushDeviceToken.APNS, RemotePushDeviceToken.GCM]:
        raise JsonableError(_("Invalid token type"))
    validate_entity(entity)
    validate_token(token, kind)

@has_request_variables
def report_error(request, deployment, type=REQ(), report=REQ(validator=check_dict([]))):
    # type: (HttpRequest, Deployment, Text, Dict[str, Any]) -> HttpResponse
    return do_report_error(deployment.name, type, report)

@has_request_variables
def remote_server_register_push(request, entity, user_id=REQ(),
                                token=REQ(), token_kind=REQ(validator=check_int), ios_app_id=None):
    # type: (HttpRequest, Union[UserProfile, RemoteZulipServer], int, bytes, int, Optional[Text]) -> HttpResponse
    validate_bouncer_token_request(entity, token, token_kind)
    server = cast(RemoteZulipServer, entity)

    # If a user logged out on a device and failed to unregister,
    # we should delete any other user associations for this token
    # & RemoteServer pair
    RemotePushDeviceToken.objects.filter(
        token=token, kind=token_kind, server=server).exclude(user_id=user_id).delete()

    # Save or update
    remote_token, created = RemotePushDeviceToken.objects.update_or_create(
        user_id=user_id,
        server=server,
        kind=token_kind,
        token=token,
        defaults=dict(
            ios_app_id=ios_app_id,
            last_updated=timezone.now()))

    return json_success()

@has_request_variables
def remote_server_unregister_push(request, entity, token=REQ(),
                                  token_kind=REQ(validator=check_int), ios_app_id=None):
    # type: (HttpRequest, Union[UserProfile, RemoteZulipServer], bytes, int, Optional[Text]) -> HttpResponse
    validate_bouncer_token_request(entity, token, token_kind)
    server = cast(RemoteZulipServer, entity)
    deleted = RemotePushDeviceToken.objects.filter(token=token,
                                                   kind=token_kind,
                                                   server=server).delete()
    if deleted[0] == 0:
        return json_error(_("Token does not exist"))

    return json_success()

@has_request_variables
def remote_server_notify_push(request,  # type: HttpRequest
                              entity,  # type: Union[UserProfile, RemoteZulipServer]
                              payload=REQ(argument_type='body')  # type: Dict[str, Any]
                              ):
    # type: (...) -> HttpResponse
    validate_entity(entity)
    server = cast(RemoteZulipServer, entity)

    user_id = payload['user_id']
    gcm_payload = payload['gcm_payload']
    apns_payload = payload['apns_payload']

    android_devices = list(RemotePushDeviceToken.objects.filter(
        user_id=user_id,
        kind=RemotePushDeviceToken.GCM,
        server=server
    ))

    apple_devices = list(RemotePushDeviceToken.objects.filter(
        user_id=user_id,
        kind=RemotePushDeviceToken.APNS,
        server=server
    ))

    if android_devices:
        send_android_push_notification(android_devices, gcm_payload, remote=True)

    # TODO: set badge count in a better way
    if apple_devices:
        send_apple_push_notification(user_id, apple_devices,
                                     badge=1, zulip=apns_payload)

    return json_success()


text:
/* -------------------------------------------------------------------------
// WINX: a C++ template GUI library - MOST SIMPLE BUT EFFECTIVE
//
// This file is a part of the WINX Library.
// The use and distribution terms for this software are covered by the
// Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
// which can be found in the file CPL.txt at this distribution. By using
// this software in any fashion, you are agreeing to be bound by the terms
// of this license. You must not remove this notice, or any other, from
// this software.
//
// Module: stdext/Digest.h
// Creator: xushiwei
// Email: xushiweizh@gmail.com
// Date: 2006-8-18 18:48:49
//
// $Id: Digest.h,v 1.3 2007/01/10 09:35:16 xushiwei Exp $
// -----------------------------------------------------------------------*/
#ifndef STDEXT_DIGEST_H
#define STDEXT_DIGEST_H

#ifndef STDEXT_DIGEST_MD4_H
#include "digest/MD4.h"
#endif

#ifndef STDEXT_DIGEST_MD5_H
#include "digest/MD5.h"
#endif

#ifndef STDEXT_DIGEST_SHA1_H
#include "digest/SHA1.h"
#endif

#ifndef STDEXT_TEXT_BINARY_H
#include "text/Binary.h"
#endif

NS_STDEXT_BEGIN

// -------------------------------------------------------------------------
// md5str, md4str, sha1str

inline const char* winx_call md5str(char digest[33], const void* buf, size_t bytes)
{
	BYTE v[16];
	md5(buf, bytes, v);
	bin2hex(digest, v, 16);
	digest[32] = '\0';
	return digest;
}

inline const char* winx_call md4str(char digest[33], const void* buf, size_t bytes)
{
	BYTE v[16];
	md4(buf, bytes, v);
	bin2hex(digest, v, 16);
	digest[32] = '\0';
	return digest;
}

inline const char* winx_call sha1str(char digest[41], const void* buf, size_t bytes)
{
	BYTE v[20];
	sha1(buf, bytes, v);
	bin2hex(digest, v, 20);
	digest[40] = '\0';
	return digest;
}

// -------------------------------------------------------------------------

NS_STDEXT_END

#endif /* STDEXT_DIGEST_H */


text:
/*
 *    pata_netcell.c - Netcell PATA driver
 *
 *	(c) 2006 Red Hat  <alan@redhat.com>
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <scsi/scsi_host.h>
#include <linux/libata.h>
#include <linux/ata.h>

#define DRV_NAME	"pata_netcell"
#define DRV_VERSION	"0.1.7"

/* No PIO or DMA methods needed for this device */

static struct scsi_host_template netcell_sht = {
	.module			= THIS_MODULE,
	.name			= DRV_NAME,
	.ioctl			= ata_scsi_ioctl,
	.queuecommand		= ata_scsi_queuecmd,
	.can_queue		= ATA_DEF_QUEUE,
	.this_id		= ATA_SHT_THIS_ID,
	.sg_tablesize		= LIBATA_MAX_PRD,
	.cmd_per_lun		= ATA_SHT_CMD_PER_LUN,
	.emulated		= ATA_SHT_EMULATED,
	.use_clustering		= ATA_SHT_USE_CLUSTERING,
	.proc_name		= DRV_NAME,
	.dma_boundary		= ATA_DMA_BOUNDARY,
	.slave_configure	= ata_scsi_slave_config,
	.slave_destroy		= ata_scsi_slave_destroy,
	/* Use standard CHS mapping rules */
	.bios_param		= ata_std_bios_param,
};

static const struct ata_port_operations netcell_ops = {
	.port_disable		= ata_port_disable,

	/* Task file is PCI ATA format, use helpers */
	.tf_load		= ata_tf_load,
	.tf_read		= ata_tf_read,
	.check_status		= ata_check_status,
	.exec_command		= ata_exec_command,
	.dev_select		= ata_std_dev_select,

	.freeze			= ata_bmdma_freeze,
	.thaw			= ata_bmdma_thaw,
	.error_handler		= ata_bmdma_error_handler,
	.post_internal_cmd	= ata_bmdma_post_internal_cmd,
	.cable_detect		= ata_cable_80wire,

	/* BMDMA handling is PCI ATA format, use helpers */
	.bmdma_setup		= ata_bmdma_setup,
	.bmdma_start		= ata_bmdma_start,
	.bmdma_stop		= ata_bmdma_stop,
	.bmdma_status		= ata_bmdma_status,
	.qc_prep		= ata_qc_prep,
	.qc_issue		= ata_qc_issue_prot,
	.data_xfer		= ata_data_xfer,

	/* IRQ-related hooks */
	.irq_handler		= ata_interrupt,
	.irq_clear		= ata_bmdma_irq_clear,
	.irq_on			= ata_irq_on,
	.irq_ack		= ata_irq_ack,

	/* Generic PATA PCI ATA helpers */
	.port_start		= ata_port_start,
};

/**
 *	netcell_init_one - Register Netcell ATA PCI device with kernel services
 *	@pdev: PCI device to register
 *	@ent: Entry in netcell_pci_tbl matching with @pdev
 *
 *	Called from kernel PCI layer.
 *
 *	LOCKING:
 *	Inherited from PCI layer (may sleep).
 *
 *	RETURNS:
 *	Zero on success, or -ERRNO value.
 */

static int netcell_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{
	static int printed_version;
	static const struct ata_port_info info = {
		.sht		= &netcell_sht,
		.flags		= ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
		/* Actually we don't really care about these as the
		   firmware deals with it */
		.pio_mask	= 0x1f,	/* pio0-4 */
		.mwdma_mask	= 0x07, /* mwdma0-2 */
		.udma_mask 	= 0x3f, /* UDMA 133 */
		.port_ops	= &netcell_ops,
	};
	const struct ata_port_info *port_info[] = { &info, NULL };

	if (!printed_version++)
		dev_printk(KERN_DEBUG, &pdev->dev,
			   "version " DRV_VERSION "\n");

	/* Any chip specific setup/optimisation/messages here */
	ata_pci_clear_simplex(pdev);

	/* And let the library code do the work */
	return ata_pci_init_one(pdev, port_info);
}

static const struct pci_device_id netcell_pci_tbl[] = {
	{ PCI_VDEVICE(NETCELL, PCI_DEVICE_ID_REVOLUTION), },

	{ }	/* terminate list */
};

static struct pci_driver netcell_pci_driver = {
	.name			= DRV_NAME,
	.id_table		= netcell_pci_tbl,
	.probe			= netcell_init_one,
	.remove			= ata_pci_remove_one,
#ifdef CONFIG_PM
	.suspend		= ata_pci_device_suspend,
	.resume			= ata_pci_device_resume,
#endif
};

static int __init netcell_init(void)
{
	return pci_register_driver(&netcell_pci_driver);
}

static void __exit netcell_exit(void)
{
	pci_unregister_driver(&netcell_pci_driver);
}

module_init(netcell_init);
module_exit(netcell_exit);

MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("SCSI low-level driver for Netcell PATA RAID");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, netcell_pci_tbl);
MODULE_VERSION(DRV_VERSION);


text:
__author__ = "Sergio Orlandini"

import os
import unittest

from utils import dev_null, make_suite

from file import File

def suite():
    list_tests = [test_make_suite, test_dev_null]
    return make_suite(list_tests)

class test_make_suite(unittest.TestCase):

    def test_make_suite(self):
        s = suite()

class test_dev_null(unittest.TestCase):

    def test_dev_null(self):

        @dev_null
        def print_hello():
           print "Hello world!"

        print_hello()

if __name__ == '__main__':
    unittest.main()


text:
#ifndef __GLIB_GOBJECT_H__
#define __GLIB_GOBJECT_H__

#define __GLIB_GOBJECT_H_INSIDE__

/* topmost include file for GObject header files */
#include <gobject/gbinding.h>
#include <gobject/gboxed.h>
#include <gobject/genums.h>
#include <gobject/gobject.h>
#include <gobject/gparam.h>
#include <gobject/gparamspecs.h>
#include <gobject/gsignal.h>
#include <gobject/gsourceclosure.h>
#include <gobject/gtype.h>
#include <gobject/gtypemodule.h>
#include <gobject/gtypeplugin.h>
#include <gobject/gvalue.h>
#include <gobject/gvaluearray.h>
#include <gobject/gvaluetypes.h>

#undef __GLIB_GOBJECT_H_INSIDE__

#endif /* __GLIB_GOBJECT_H__ */


text:
//this source code was auto-generated by tolua#, do not modify it
using System;
using LuaInterface;

public class GUtilWrap
{
	public static void Register(LuaState L)
	{
		L.BeginStaticLibs("GUtil");
		L.RegFunction("TestLuaCallByString", TestLuaCallByString);
		L.RegFunction("GetFileData", GetFileData);
		L.RegFunction("HandleFileData", HandleFileData);
		L.RegFunction("TestLuaCallByLuaDicTable", TestLuaCallByLuaDicTable);
		L.RegFunction("TestLuaCallByLuaArrayTable", TestLuaCallByLuaArrayTable);
		L.RegFunction("CreateIntoCSharpParam", CreateIntoCSharpParam);
		L.RegFunction("TestLuaCallByClass", TestLuaCallByClass);
		L.RegFunction("CreatePacket", CreatePacket);
		L.RegFunction("HanldeProtoBuf", HanldeProtoBuf);
		L.EndStaticLibs();
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int TestLuaCallByString(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 1);
			string arg0 = ToLua.CheckString(L, 1);
			string o = GUtil.TestLuaCallByString(arg0);
			LuaDLL.lua_pushstring(L, o);
			return 1;
		}
		catch (Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int GetFileData(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 1);
			string arg0 = ToLua.CheckString(L, 1);
			byte[] o = GUtil.GetFileData(arg0);
			ToLua.Push(L, o);
			return 1;
		}
		catch (Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int HandleFileData(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 1);
			byte[] arg0 = ToLua.CheckByteBuffer(L, 1);
			GUtil.HandleFileData(arg0);
			return 0;
		}
		catch (Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int TestLuaCallByLuaDicTable(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 1);
			LuaTable arg0 = ToLua.CheckLuaTable(L, 1);
			LuaInterface.LuaTable o = GUtil.TestLuaCallByLuaDicTable(arg0);
			ToLua.Push(L, o);
			return 1;
		}
		catch (Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int TestLuaCallByLuaArrayTable(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 1);
			LuaTable arg0 = ToLua.CheckLuaTable(L, 1);
			LuaInterface.LuaTable o = GUtil.TestLuaCallByLuaArrayTable(arg0);
			ToLua.Push(L, o);
			return 1;
		}
		catch (Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int CreateIntoCSharpParam(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 0);
			IntoCSharpParam o = GUtil.CreateIntoCSharpParam();
			ToLua.PushObject(L, o);
			return 1;
		}
		catch (Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int TestLuaCallByClass(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 1);
			IntoCSharpParam arg0 = (IntoCSharpParam)ToLua.CheckObject<IntoCSharpParam>(L, 1);
			OutCSharpParam o = GUtil.TestLuaCallByClass(arg0);
			ToLua.PushObject(L, o);
			return 1;
		}
		catch (Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int CreatePacket(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 0);
			Packet o = GUtil.CreatePacket();
			ToLua.PushObject(L, o);
			return 1;
		}
		catch (Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int HanldeProtoBuf(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 1);
			Packet arg0 = (Packet)ToLua.CheckObject<Packet>(L, 1);
			Packet o = GUtil.HanldeProtoBuf(arg0);
			ToLua.PushObject(L, o);
			return 1;
		}
		catch (Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}
}


text:
package org.apache.spark.mllib.tree.model

import org.apache.spark.annotation.{DeveloperApi, Since}

/**
 * :: DeveloperApi ::
 * Predicted value for a node
 * @param predict predicted value
 * @param prob probability of the label (classification only)
 */
@Since("1.2.0")
@DeveloperApi
class Predict @Since("1.2.0") (
    @Since("1.2.0") val predict: Double,
    @Since("1.2.0") val prob: Double = 0.0) extends Serializable {

  override def toString: String = s"$predict (prob = $prob)"

  override def equals(other: Any): Boolean = {
    other match {
      case p: Predict => predict == p.predict && prob == p.prob
      case _ => false
    }
  }

  override def hashCode: Int = {
    com.google.common.base.Objects.hashCode(predict: java.lang.Double, prob: java.lang.Double)
  }
}


text:
We will assume you use JetBrains IDE (phpstorm or webstorm), to setup composer and install apps:

1. Hop under Tools -> Composer -> Init Composer...
2. Click Download Composer
3. Select the root directory of your app
4. Click OK
5. And you are done...

And if you are not using an IDE, just go to getcomposer.org and play with bash.

To install sendgrid on JetBrains IDE:

1. Under Tools -> Composer -> Add Dependencies
2. Search for `sendgrid/sendgrid`
3. Click Add
4. And you are done :)

You need to install php for any of this to work, here is a link to a proper guide: http://php.net/manual/en/install.php


text:
import asyncio
import filecmp
import logging
import os
import pickle
import tempfile
import warnings
import re
from asyncio import AbstractEventLoop
from pathlib import Path
from typing import (
    Text,
    Any,
    Union,
    List,
    Type,
    Callable,
    TYPE_CHECKING,
    Pattern,
)
from typing_extensions import Protocol

import rasa.shared.constants
import rasa.shared.utils.io

if TYPE_CHECKING:
    from prompt_toolkit.validation import Validator

class WriteRow(Protocol):
    """Describes a csv writer supporting a `writerow` method (workaround for typing)."""

    def writerow(self, row: List[Text]) -> None:
        """Write the given row.

        Args:
            row: the entries of a row as a list of strings
        """
        ...

def configure_colored_logging(loglevel: Text) -> None:
    """Configures coloredlogs library for specified loglevel.

    Args:
        loglevel: The loglevel to configure the library for
    """
    import coloredlogs

    loglevel = loglevel or os.environ.get(
        rasa.shared.constants.ENV_LOG_LEVEL, rasa.shared.constants.DEFAULT_LOG_LEVEL
    )

    field_styles = coloredlogs.DEFAULT_FIELD_STYLES.copy()
    field_styles["asctime"] = {}
    level_styles = coloredlogs.DEFAULT_LEVEL_STYLES.copy()
    level_styles["debug"] = {}
    coloredlogs.install(
        level=loglevel,
        use_chroot=False,
        fmt="%(asctime)s %(levelname)-8s %(name)s  - %(message)s",
        level_styles=level_styles,
        field_styles=field_styles,
    )

def enable_async_loop_debugging(
    event_loop: AbstractEventLoop, slow_callback_duration: float = 0.1
) -> AbstractEventLoop:
    """Enables debugging on an event loop.

    Args:
        event_loop: The event loop to enable debugging on
        slow_callback_duration: The threshold at which a callback should be
                                alerted as slow.
    """
    logging.info(
        "Enabling coroutine debugging. Loop id {}.".format(id(asyncio.get_event_loop()))
    )

    # Enable debugging
    event_loop.set_debug(True)

    # Make the threshold for "slow" tasks very very small for
    # illustration. The default is 0.1 (= 100 milliseconds).
    event_loop.slow_callback_duration = slow_callback_duration

    # Report all mistakes managing asynchronous resources.
    warnings.simplefilter("always", ResourceWarning)
    return event_loop

def pickle_dump(filename: Union[Text, Path], obj: Any) -> None:
    """Saves object to file.

    Args:
        filename: the filename to save the object to
        obj: the object to store
    """
    with open(filename, "wb") as f:
        pickle.dump(obj, f)

def pickle_load(filename: Union[Text, Path]) -> Any:
    """Loads an object from a file.

    Args:
        filename: the filename to load the object from

    Returns: the loaded object
    """
    with open(filename, "rb") as f:
        return pickle.load(f)

def create_temporary_file(data: Any, suffix: Text = "", mode: Text = "w+") -> Text:
    """Creates a tempfile.NamedTemporaryFile object for data."""
    encoding = None if "b" in mode else rasa.shared.utils.io.DEFAULT_ENCODING
    f = tempfile.NamedTemporaryFile(
        mode=mode, suffix=suffix, delete=False, encoding=encoding
    )
    f.write(data)

    f.close()
    return f.name

def create_temporary_directory() -> Text:
    """Creates a tempfile.TemporaryDirectory."""
    f = tempfile.TemporaryDirectory()
    return f.name

def create_path(file_path: Text) -> None:
    """Makes sure all directories in the 'file_path' exists."""

    parent_dir = os.path.dirname(os.path.abspath(file_path))
    if not os.path.exists(parent_dir):
        os.makedirs(parent_dir)

def file_type_validator(
    valid_file_types: List[Text], error_message: Text
) -> Type["Validator"]:
    """Creates a `Validator` class which can be used with `questionary` to validate
    file paths.
    """

    def is_valid(path: Text) -> bool:
        return path is not None and any(
            [path.endswith(file_type) for file_type in valid_file_types]
        )

    return create_validator(is_valid, error_message)

def not_empty_validator(error_message: Text) -> Type["Validator"]:
    """Creates a `Validator` class which can be used with `questionary` to validate
    that the user entered something other than whitespace.
    """

    def is_valid(input: Text) -> bool:
        return input is not None and input.strip() != ""

    return create_validator(is_valid, error_message)

def create_validator(
    function: Callable[[Text], bool], error_message: Text
) -> Type["Validator"]:
    """Helper method to create `Validator` classes from callable functions. Should be
    removed when questionary supports `Validator` objects."""

    from prompt_toolkit.validation import Validator, ValidationError
    from prompt_toolkit.document import Document

    class FunctionValidator(Validator):
        @staticmethod
        def validate(document: Document) -> None:
            is_valid = function(document.text)
            if not is_valid:
                raise ValidationError(message=error_message)

    return FunctionValidator

def json_unpickle(
    file_name: Union[Text, Path], encode_non_string_keys: bool = False
) -> Any:
    """Unpickle an object from file using json.

    Args:
        file_name: the file to load the object from
        encode_non_string_keys: If set to `True` then jsonpickle will encode non-string
          dictionary keys instead of coercing them into strings via `repr()`.

    Returns: the object
    """
    import jsonpickle.ext.numpy as jsonpickle_numpy
    import jsonpickle

    jsonpickle_numpy.register_handlers()

    file_content = rasa.shared.utils.io.read_file(file_name)
    return jsonpickle.loads(file_content, keys=encode_non_string_keys)

def json_pickle(
    file_name: Union[Text, Path], obj: Any, encode_non_string_keys: bool = False
) -> None:
    """Pickle an object to a file using json.

    Args:
        file_name: the file to store the object to
        obj: the object to store
        encode_non_string_keys: If set to `True` then jsonpickle will encode non-string
          dictionary keys instead of coercing them into strings via `repr()`.
    """
    import jsonpickle.ext.numpy as jsonpickle_numpy
    import jsonpickle

    jsonpickle_numpy.register_handlers()

    rasa.shared.utils.io.write_text_file(
        jsonpickle.dumps(obj, keys=encode_non_string_keys), file_name
    )

def get_emoji_regex() -> Pattern:
    """Returns regex to identify emojis."""
    return re.compile(
        "["
        "\U0001F600-\U0001F64F"  # emoticons
        "\U0001F300-\U0001F5FF"  # symbols & pictographs
        "\U0001F680-\U0001F6FF"  # transport & map symbols
        "\U0001F1E0-\U0001F1FF"  # flags (iOS)
        "\U00002702-\U000027B0"
        "\U000024C2-\U0001F251"
        "\u200d"  # zero width joiner
        "\u200c"  # zero width non-joiner
        "]+",
        flags=re.UNICODE,
    )

def are_directories_equal(dir1: Path, dir2: Path) -> bool:
    """Compares two directories recursively.

    Files in each directory are
    assumed to be equal if their names and contents are equal.

    Args:
        dir1: The first directory.
        dir2: The second directory.

    Returns:
        `True` if they are equal, `False` otherwise.
    """
    dirs_cmp = filecmp.dircmp(dir1, dir2)
    if dirs_cmp.left_only or dirs_cmp.right_only:
        return False

    (_, mismatches, errors) = filecmp.cmpfiles(
        dir1, dir2, dirs_cmp.common_files, shallow=False
    )

    if mismatches or errors:
        return False

    for common_dir in dirs_cmp.common_dirs:
        new_dir1 = Path(dir1, common_dir)
        new_dir2 = Path(dir2, common_dir)

        is_equal = are_directories_equal(new_dir1, new_dir2)
        if not is_equal:
            return False

    return True


text:
package org.javaswift.joss.information;

import org.javaswift.joss.headers.account.AccountBytesUsed;
import org.javaswift.joss.headers.account.AccountContainerCount;
import org.javaswift.joss.headers.account.AccountObjectCount;
import org.javaswift.joss.headers.account.ServerDate;

public class AccountInformation extends AbstractInformation {

    private AccountContainerCount containerCount;

    private AccountObjectCount objectCount;

    private AccountBytesUsed bytesUsed;

    private ServerDate serverDate;

    public int getContainerCount() {
        return Integer.parseInt(containerCount.getHeaderValue());
    }

    public void setContainerCount(AccountContainerCount containerCount) {
        this.containerCount = containerCount;
    }

    public long getBytesUsed() {
        return Long.parseLong(bytesUsed.getHeaderValue());
    }

    public void setBytesUsed(AccountBytesUsed bytesUsed) {
        this.bytesUsed = bytesUsed;
    }

    public int getObjectCount() {
        return Integer.parseInt(objectCount.getHeaderValue());
    }

    public void setObjectCount(AccountObjectCount objectCount) {
        this.objectCount = objectCount;
    }

    public long getServerDate() {
        return Long.parseLong(serverDate.getHeaderValue());
    }

    public void setServerDate(ServerDate serverDate) {
        this.serverDate = serverDate;
    }

}