text:
namespace DocumentSystem
{
    public class PDFDocument : BinaryDocument, IEncryptable
    {
        private int? pages;
        private bool isEncrypted;

        public PDFDocument()
            : base()
        {
        }

        public PDFDocument(string name, string content = null, ulong? size = null, int? pages = null, bool isEncrypted = false)
            : base(name, content, size)
        {
            this.Pages = pages;
            this.isEncrypted = isEncrypted;
        }

        public int? Pages
        {
            get
            {
                return this.pages;
            }

            protected set
            {
                this.pages = value;
            }
        }

        public bool IsEncrypted
        {
            get
            {
                return this.isEncrypted;
            }

            protected set
            {
                this.isEncrypted = value;
            }
        }

        public void Encrypt()
        {
            this.isEncrypted = true;
        }

        public void Decrypt()
        {
            this.isEncrypted = false;
        }
    }
}


text:
CREATE ROLE db_config_authenticator LOGIN NOINHERIT;

-- reloadable config options
ALTER ROLE db_config_authenticator SET pgrst.jwt_aud = 'https://example.org';
ALTER ROLE db_config_authenticator SET pgrst.openapi_server_proxy_uri = 'https://example.org/api';
ALTER ROLE db_config_authenticator SET pgrst.raw_media_types = 'application/vnd.pgrst.db-config';
ALTER ROLE db_config_authenticator SET pgrst.jwt_secret = 'REALLY=REALLY=REALLY=REALLY=VERY=SAFE';
ALTER ROLE db_config_authenticator SET pgrst.jwt_secret_is_base64 = 'false';
ALTER ROLE db_config_authenticator SET pgrst.jwt_role_claim_key = '."a"."role"';
ALTER ROLE db_config_authenticator SET pgrst.db_anon_role = 'anonymous';
ALTER ROLE db_config_authenticator SET pgrst.db_tx_end = 'commit-allow-override';
ALTER ROLE db_config_authenticator SET pgrst.db_schemas = 'test, tenant1, tenant2';
ALTER ROLE db_config_authenticator SET pgrst.db_root_spec = 'root';
ALTER ROLE db_config_authenticator SET pgrst.db_plan_enabled = 'true';
ALTER ROLE db_config_authenticator SET pgrst.db_prepared_statements = 'false';
ALTER ROLE db_config_authenticator SET pgrst.db_pre_request = 'test.custom_headers';
ALTER ROLE db_config_authenticator SET pgrst.db_max_rows = '1000';
ALTER ROLE db_config_authenticator SET pgrst.db_extra_search_path = 'public, extensions';
ALTER ROLE db_config_authenticator SET pgrst.not_existing = 'should be ignored';

-- override with database specific setting
ALTER ROLE db_config_authenticator IN DATABASE :DBNAME SET pgrst.jwt_secret = 'OVERRIDE=REALLY=REALLY=REALLY=REALLY=VERY=SAFE';
ALTER ROLE db_config_authenticator IN DATABASE :DBNAME SET pgrst.db_extra_search_path = 'public, extensions, private';
ALTER ROLE db_config_authenticator IN DATABASE :DBNAME SET pgrst.not_existing = 'should be ignored';

-- other database settings that should be ignored
CREATE DATABASE other;
ALTER ROLE db_config_authenticator IN DATABASE other SET pgrst.db_max_rows = '1111';

-- non-reloadable configs
ALTER ROLE db_config_authenticator SET pgrst.server_host = 'ignored';
ALTER ROLE db_config_authenticator SET pgrst.server_port = 'ignored';
ALTER ROLE db_config_authenticator SET pgrst.server_unix_socket = 'ignored';
ALTER ROLE db_config_authenticator SET pgrst.server_unix_socket_mode = 'ignored';
ALTER ROLE db_config_authenticator SET pgrst.admin_server_port = 'ignored';
ALTER ROLE db_config_authenticator SET pgrst.log_level = 'ignored';
ALTER ROLE db_config_authenticator SET pgrst.db_uri = 'postgresql://ignored';
ALTER ROLE db_config_authenticator SET pgrst.db_channel_enabled = 'ignored';
ALTER ROLE db_config_authenticator SET pgrst.db_channel = 'ignored';
ALTER ROLE db_config_authenticator SET pgrst.db_pool = 'ignored';
ALTER ROLE db_config_authenticator SET pgrst.db_pool_timeout = 'ignored';
ALTER ROLE db_config_authenticator SET pgrst.db_config = 'ignored';

-- other authenticator reloadable config options
CREATE ROLE other_authenticator LOGIN NOINHERIT;
ALTER ROLE other_authenticator SET pgrst.jwt_aud = 'https://otherexample.org';
ALTER ROLE other_authenticator SET pgrst.openapi_server_proxy_uri = 'https://otherexample.org/api';
ALTER ROLE other_authenticator SET pgrst.raw_media_types = 'application/vnd.pgrst.other-db-config';
ALTER ROLE other_authenticator SET pgrst.jwt_secret = 'ODERREALLYREALLYREALLYREALLYVERYSAFE';
ALTER ROLE other_authenticator SET pgrst.jwt_secret_is_base64 = 'true';
ALTER ROLE other_authenticator SET pgrst.jwt_role_claim_key = '."other"."role"';
ALTER ROLE other_authenticator SET pgrst.db_anon_role = 'other';
ALTER ROLE other_authenticator SET pgrst.db_tx_end = 'rollback-allow-override';
ALTER ROLE other_authenticator SET pgrst.db_schemas = 'test, other_tenant1, other_tenant2';
ALTER ROLE other_authenticator SET pgrst.db_root_spec = 'other_root';
ALTER ROLE other_authenticator SET pgrst.db_plan_enabled = 'true';
ALTER ROLE other_authenticator SET pgrst.db_prepared_statements = 'false';
ALTER ROLE other_authenticator SET pgrst.db_pre_request = 'test.other_custom_headers';
ALTER ROLE other_authenticator SET pgrst.db_max_rows = '100';
ALTER ROLE other_authenticator SET pgrst.db_extra_search_path = 'public, extensions, other';
ALTER ROLE other_authenticator SET pgrst.openapi_mode = 'disabled';
ALTER ROLE other_authenticator SET pgrst.openapi_security_active = 'false';

-- authenticator used for tests that manipulate statement timeout
CREATE ROLE timeout_authenticator LOGIN NOINHERIT;

create function set_statement_timeout(role text, milliseconds int) returns void as $_$
begin
  execute format($$
    alter role %I set statement_timeout to %L;
  $$, role, milliseconds);
end $_$ volatile security definer language plpgsql;

-- authenticator used for test-independent database manipulation
CREATE ROLE meta_authenticator LOGIN NOINHERIT;

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#595f72" >

    <TextView
        android:id="@+id/real_time_temp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="12dp"
        android:layout_marginTop="12dp"
        android:text=""
        android:textColor="#fff"
        android:textSize="60sp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="18dp"
        android:layout_toRightOf="@id/real_time_temp"
        android:text="°C"
        android:textColor="#fff"
        android:textSize="40sp" />

    <TextView
        android:id="@+id/temp_range"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/real_time_temp"
        android:layout_marginStart="12dp"
        android:text=""
        android:textColor="#fff"
        android:textSize="14sp" />

    <TextView
        android:id="@+id/temp_desc"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/temp_range"
        android:layout_marginStart="11dp"
        android:text=""
        android:textColor="#fff"
        android:textSize="16sp" />
	<TextView
	    android:id="@+id/wind_desc"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/temp_desc"
        android:layout_marginStart="10dp"
        android:layout_alignBaseline="@id/temp_desc"
        android:text="南风"
        android:textColor="#fff"
        android:textSize="16sp"
	    />
	<TextView
	    android:id="@+id/air"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
         android:layout_below="@+id/temp_desc"
        android:layout_marginStart="11dp"
        android:text="空气优"
        android:textColor="#fff"
        android:textSize="15sp"
	    />
	<TextView
	    android:id="@+id/pm2_5"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/air"
        android:layout_marginStart="10dp"
        android:layout_alignBaseline="@id/air"
        android:text="PM2.5 33"
        android:textColor="#fff"
        android:textSize="15sp"
	    />
    <TextView
        android:id="@+id/week_today"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/air"
        android:layout_marginStart="11dp"
        android:text=""
        android:textColor="#fff"
        android:textSize="12sp" />

    <TextView
        android:id="@+id/more_click"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/week_today"
        android:layout_marginStart="11dp"
        android:text="更多详情"
        android:textColor="#fff"
        android:textSize="10sp" />

    <TextView
        android:id="@+id/update_time"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_marginRight="12dp"
        android:layout_marginTop="30dp"
        android:text=""
        android:textColor="#fff"
        android:textSize="12sp" />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_below="@+id/update_time"
        android:layout_marginRight="12dp"
        android:text="Weather.com.cn"
        android:textColor="#fff"
        android:textSize="13sp" />

    <LinearLayout
        android:id="@+id/ll_operation"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:layout_alignParentBottom="true"
        android:background="#484e61"
        android:orientation="horizontal" >
    </LinearLayout>

    <LinearLayout
        android:id="@+id/ll_show_day"
        android:layout_width="match_parent"
        android:layout_height="120dp"
        android:layout_above="@id/ll_operation"
        android:background="#55484e61"
        android:orientation="horizontal" >

        <LinearLayout
            android:id="@+id/ll_today_show"
            android:layout_width="0px"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/today"
                android:layout_width="match_parent"
                android:layout_height="0px"
                android:layout_weight="1"
                android:gravity="center"
                android:text=""
                android:textColor="#fff"
                android:textSize="15sp" />

            <TextView
                android:id="@+id/today_date"
                android:layout_width="match_parent"
                android:layout_height="0px"
                android:layout_weight="1"
                android:gravity="center"
                android:text=""
                android:textColor="#fff"
                android:textSize="15sp" />

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="0px"
                android:layout_weight="2" >

                <ImageView
                    android:id="@+id/img_today1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                     />

                <ImageView
                    android:id="@+id/img_today2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="50dp"
                     />
            </RelativeLayout>

            <TextView
                android:id="@+id/temp"
                android:layout_width="match_parent"
                android:layout_height="0px"
                android:layout_weight="1"
                android:gravity="center"
                android:text=""
                android:textColor="#fff"
                android:textSize="12sp" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/ll_tomorrow_show"
            android:layout_width="0px"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/tomorrow"
                android:layout_width="match_parent"
                android:layout_height="0px"
                android:layout_weight="1"
                android:gravity="center"
                android:text=""
                android:textColor="#fff"
                android:textSize="15sp" />

            <TextView
                android:id="@+id/tomorrow_date"
                android:layout_width="match_parent"
                android:layout_height="0px"
                android:layout_weight="1"
                android:gravity="center"
                android:text=""
                android:textColor="#fff"
                android:textSize="15sp" />

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="0px"
                android:layout_weight="2" >

                <ImageView
                    android:id="@+id/img_tomorrow1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                     />

                <ImageView
                    android:id="@+id/img_tomorrow2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="50dp"
                     />
            </RelativeLayout>

            <TextView
                android:id="@+id/tomorrow_temp"
                android:layout_width="match_parent"
                android:layout_height="0px"
                android:layout_weight="1"
                android:gravity="center"
                android:text=""
                android:textColor="#fff"
                android:textSize="12sp" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/ll_after_tomorrow_show"
            android:layout_width="0px"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/after_tomorrow"
                android:layout_width="match_parent"
                android:layout_height="0px"
                android:layout_weight="1"
                android:gravity="center"
                android:text=""
                android:textColor="#fff"
                android:textSize="15sp" />

            <TextView
                android:id="@+id/after_tomorrow_date"
                android:layout_width="match_parent"
                android:layout_height="0px"
                android:layout_weight="1"
                android:gravity="center"
                android:text=""
                android:textColor="#fff"
                android:textSize="15sp" />

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="0px"
                android:layout_weight="2" >

                <ImageView
                    android:id="@+id/img_after_tomorrow1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                     />

                <ImageView
                    android:id="@+id/img_after_tomorrow2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="50dp"
                     />
            </RelativeLayout>

            <TextView
                android:id="@+id/after_tomorrow_temp"
                android:layout_width="match_parent"
                android:layout_height="0px"
                android:layout_weight="1"
                android:gravity="center"
                android:text=""
                android:textColor="#fff"
                android:textSize="12sp" />
        </LinearLayout>
    </LinearLayout>

    <TextView
        android:id="@+id/address"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@id/ll_show_day"
        android:layout_marginBottom="10dp"
        android:gravity="center"
        android:text=""
        android:textColor="#fff"
        android:textSize="30sp" />

</RelativeLayout>


text:
package org.apache.wss4j.policy.tests;

import org.apache.neethi.*;
import org.apache.wss4j.policy.SP12Constants;
import org.apache.wss4j.policy.model.InitiatorToken;
import org.junit.jupiter.api.Test;

import java.util.Iterator;
import java.util.List;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class InitiatorTokenTest extends AbstractTestBase {

    @Test
    public void testInitiatorToken() throws Exception {
        String fileName = "InitiatorToken.xml";
        String policyFile = loadPolicyFile("policy/model/sp12/" + fileName);
        String serializedPolicyReferenceFile = loadPolicyFile("policy/model/sp12/serialized/" + fileName);
        String normalizedPolicyReferenceFile = loadPolicyFile("policy/model/sp12/normalized/" + fileName);
        Policy policy = loadPolicy(policyFile);
        String serializedPolicy = serializePolicy(policy);
        assertXMLisEqual(serializedPolicy, serializedPolicyReferenceFile);

        Iterator<List<Assertion>> alternativeIterator = policy.getAlternatives();
        int count = 0;
        while (alternativeIterator.hasNext()) {
            List<Assertion> alternative = alternativeIterator.next();
            assertEquals(1, alternative.size());
            assertTrue(alternative.get(0) instanceof InitiatorToken);
            InitiatorToken initiatorToken = (InitiatorToken) alternative.get(0);
            assertFalse(initiatorToken.isNormalized());
            assertTrue(initiatorToken.isIgnorable());
            assertTrue(initiatorToken.isOptional());
            assertEquals(Constants.TYPE_ASSERTION, initiatorToken.getType());
            assertEquals(SP12Constants.INITIATOR_TOKEN, initiatorToken.getName());
            assertNotNull(initiatorToken.getToken());
            assertEquals(SP12Constants.X509_TOKEN, initiatorToken.getToken().getName());
            count++;
        }
        assertEquals(1, count);

        policy = policy.normalize(true);
        serializedPolicy = serializePolicy(policy);
        assertXMLisEqual(serializedPolicy, normalizedPolicyReferenceFile);

        alternativeIterator = policy.getAlternatives();
        List<Assertion> alternative = alternativeIterator.next();
        assertEquals(0, alternative.size());

        List<PolicyComponent> policyComponents = policy.getPolicyComponents();
        assertEquals(1, policyComponents.size());
        PolicyOperator policyOperator = (PolicyOperator) policyComponents.get(0);
        policyComponents = policyOperator.getPolicyComponents();
        assertEquals(2, policyComponents.size());
        All all = (All) policyComponents.get(0);
        List<PolicyComponent> policyComponentsAll = all.getAssertions();
        assertEquals(0, policyComponentsAll.size());

        all = (All) policyComponents.get(1);
        policyComponentsAll = all.getAssertions();
        assertEquals(1, policyComponentsAll.size());

        Iterator<PolicyComponent> policyComponentIterator = policyComponentsAll.iterator();
        InitiatorToken initiatorToken = (InitiatorToken) policyComponentIterator.next();
        assertTrue(initiatorToken.isNormalized());
        assertTrue(initiatorToken.isIgnorable());
        assertFalse(initiatorToken.isOptional());
        assertEquals(Constants.TYPE_ASSERTION, initiatorToken.getType());
        assertEquals(SP12Constants.INITIATOR_TOKEN, initiatorToken.getName());
        assertNotNull(initiatorToken.getToken());
        assertEquals(SP12Constants.X509_TOKEN, initiatorToken.getToken().getName());
    }
}


text:
Transform /^the tree node "([^"]*)"$/ do |path|
  Capybara.current_session.execute_script <<-JS
    // get the ExtJS internal tree node id
    var node = Rwiki.treePanel.findNodeByPath('#{path}');
    // get the corresponding div id
    return node.ui.elNode.id;
  JS
end

When /^I expand the parent for the tree node "([^"]*)"$/ do |path|
  # TODO Here be dragons, refactor this part of the code
  path.gsub!(/^\//, '')
  parts = path.split('/')
  parts[0] = "/" + parts[0]

  parts.each_index do |i|
    partial_path = parts[0..i].join('/')
    When %{I expand the tree node "#{partial_path}"}
  end
end

When /^I expand (the tree node "(?:[^"]*)")$/ do |el_node_id|
  ec_selector = "div##{el_node_id} img.x-tree-ec-icon.x-tree-elbow-plus"
  ec_last_selector = "div##{el_node_id} img.x-tree-ec-icon.x-tree-elbow-end-plus"

  expand_node_icon = (page.all(ec_selector) | page.all(ec_last_selector)).first
  expand_node_icon.click if expand_node_icon
end

When /^I open the page "([^"]*)"$/ do |path|
  When %{I expand the parent for the tree node "#{path}"}
  And %{I click the tree node "#{path}"}
  Then %{I should see the page "#{path}"}
end

Then /^I should see the page "([^"]*)"$/ do |path|
  Then %{I should see a content for the page "#{path}"}
  And %{I should see the application title "Rwiki #{path}"}

  And %{I should see enabled "Edit page" toolbar button}
  And %{I should see enabled "Print page" toolbar button}
end

Then /^I should see the page titled "([^"]*)"$/ do |title|
  Then %{I should see "#{title}" within "div#tree"}
end

Then /^I should not see the tree node titled "([^"]*)"$/ do |title|
  Then %{I should not see "#{title}" within "div#tree"}
end

When /^I click (the tree node "(?:[^"]*)")$/ do |el_node_id|
  page.find("div##{el_node_id}").click
  And %{I wait for load the page}
end

When /^I right click (the tree node "([^"]*)")$/ do |el_node_id, path|
  element = page.find("div##{el_node_id}")
  location = element.native.location

  Capybara.current_session.execute_script <<-JS
    var node = Rwiki.treePanel.findNodeByPath('#{path}')
    var eventStub = { getXY: function() { return [#{location.x}, #{location.y}] } };
    Rwiki.treePanel.fireEvent('contextmenu', node, eventStub);
  JS
end

Then /^(the tree node "(?:[^"]*)") should be selected$/ do |el_node_id|
  page.has_css? "div##{el_node_id}.x-tree-selected"
end

Then /^(the tree node "(?:[^"]*)") should not be selected$/ do |el_node_id|
  page.has_no_css? "div##{el_node_id}.x-tree-selected"
end

When /^I move (the tree node "(?:[^"]*)") to (the tree node "(?:[^"]*)")$/ do |node_id, target_node_id|
  browser = Capybara.current_session.driver.browser

  # find the corresponding elements
  node_element = browser.find_element(:xpath, "//div[@id='#{node_id}']")
  target_node_element = browser.find_element(:xpath, "//div[@id='#{target_node_id}']")

  # perform node drag and drop
  browser.mouse.down(node_element)
  browser.mouse.move_to(target_node_element)
  browser.mouse.up
end

Then /^for (the tree node "(?:[^"]*)") I should see following nodes:$/ do |el_node_id, table|
  sleep 0.5 # wait for node the expanding animation finish
  actual_table = table(tableish("div##{el_node_id} + ul.x-tree-node-ct a", "span"))
  table.diff!(actual_table)
end

When /^I fill in the tree filter with "([^"]*)"$/ do |text|
  input_selector = 'td.x-toolbar-left input'

  field = find(input_selector)
  field.set(text)
end


text:
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { DashboardPage } from './dashboard';

@NgModule({
  declarations: [
    DashboardPage,
  ],
  imports: [
    IonicPageModule.forChild(DashboardPage),
  ],
  exports: [
    DashboardPage
  ]
})
export class DashboardPageModule {}


text:
/**
 * protocols
 * Returns the protocols of an input url.
 *
 * @name protocols
 * @function
 * @param {String} input The input url.
 * @param {Boolean|Number} first If `true`, the first protocol will be returned. If number, it will represent the zero-based index of the protocols array.
 * @return {Array|String} The array of protocols or the specified protocol.
 */
module.exports = function protocols(input, first) {

    if (first === true) {
        first = 0;
    }

    var index = input.indexOf("://")
      , splits = input.substring(0, index).split("+").filter(Boolean)
      ;

    if (typeof first === "number") {
        return splits[first];
    }

    return splits;
};


text:
from __future__ import division, unicode_literals

import logging

from fractions import Fraction

from pymatgen.analysis.bond_valence import BVAnalyzer
from pymatgen.analysis.ewald import EwaldSummation, EwaldMinimizer
from pymatgen.analysis.elasticity.strain import Deformation
from pymatgen.core.composition import Composition
from pymatgen.core.operations import SymmOp
from pymatgen.core.periodic_table import get_el_sp
from pymatgen.core.structure import Structure
from pymatgen.transformations.site_transformations import \
    PartialRemoveSitesTransformation
from pymatgen.transformations.transformation_abc import AbstractTransformation

"""
This module defines standard transformations which transforms a structure into
another structure. Standard transformations operate in a structure-wide manner,
rather than site-specific manner.
All transformations should inherit the AbstractTransformation ABC.
"""

__author__ = "Shyue Ping Ong, Will Richards"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "1.2"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyuep@gmail.com"
__date__ = "Sep 23, 2011"

logger = logging.getLogger(__name__)

class RotationTransformation(AbstractTransformation):
    """
    The RotationTransformation applies a rotation to a structure.

    Args:
        axis (3x1 array): Axis of rotation, e.g., [1, 0, 0]
        angle (float): Angle to rotate
        angle_in_radians (bool): Set to True if angle is supplied in radians.
            Else degrees are assumed.
    """

    def __init__(self, axis, angle, angle_in_radians=False):
        """

        """
        self.axis = axis
        self.angle = angle
        self.angle_in_radians = angle_in_radians
        self._symmop = SymmOp.from_axis_angle_and_translation(
            self.axis, self.angle, self.angle_in_radians)

    def apply_transformation(self, structure):
        s = structure.copy()
        s.apply_operation(self._symmop)
        return s

    def __str__(self):
        return "Rotation Transformation about axis " + \
               "{} with angle = {:.4f} {}".format(
                   self.axis, self.angle,
                   "radians" if self.angle_in_radians else "degrees")

    def __repr__(self):
        return self.__str__()

    @property
    def inverse(self):
        return RotationTransformation(self.axis, -self.angle,
                                      self.angle_in_radians)

    @property
    def is_one_to_many(self):
        return False

class OxidationStateDecorationTransformation(AbstractTransformation):
    """
    This transformation decorates a structure with oxidation states.

    Args:
        oxidation_states (dict): Oxidation states supplied as a dict,
        e.g., {"Li":1, "O":-2}
    """

    def __init__(self, oxidation_states):
        self.oxidation_states = oxidation_states

    def apply_transformation(self, structure):
        s = structure.copy()
        s.add_oxidation_state_by_element(self.oxidation_states)
        return s

    @property
    def inverse(self):
        return None

    @property
    def is_one_to_many(self):
        return False

class AutoOxiStateDecorationTransformation(AbstractTransformation):
    """
    This transformation automatically decorates a structure with oxidation
    states using a bond valence approach.

    Args:
        symm_tol (float): Symmetry tolerance used to determine which sites are
            symmetrically equivalent. Set to 0 to turn off symmetry.
        max_radius (float): Maximum radius in Angstrom used to find nearest
            neighbors.
        max_permutations (int): Maximum number of permutations of oxidation
            states to test.
        distance_scale_factor (float): A scale factor to be applied. This is
            useful for scaling distances, esp in the case of
            calculation-relaxed structures, which may tend to under (GGA) or
            over bind (LDA). The default of 1.015 works for GGA. For
            experimental structure, set this to 1.
    """

    def __init__(self, symm_tol=0.1, max_radius=4, max_permutations=100000,
                 distance_scale_factor=1.015):
        self.symm_tol = symm_tol
        self.max_radius = max_radius
        self.max_permutations = max_permutations
        self.distance_scale_factor = distance_scale_factor
        self.analyzer = BVAnalyzer(symm_tol, max_radius, max_permutations,
                                   distance_scale_factor)

    def apply_transformation(self, structure):
        return self.analyzer.get_oxi_state_decorated_structure(structure)

    @property
    def inverse(self):
        return None

    @property
    def is_one_to_many(self):
        return False

class OxidationStateRemovalTransformation(AbstractTransformation):
    """
    This transformation removes oxidation states from a structure.
    """
    def __init__(self):
        pass

    def apply_transformation(self, structure):
        s = structure.copy()
        s.remove_oxidation_states()
        return s

    @property
    def inverse(self):
        return None

    @property
    def is_one_to_many(self):
        return False

class SupercellTransformation(AbstractTransformation):
    """
    The RotationTransformation applies a rotation to a structure.

    Args:
        scaling_matrix: A matrix of transforming the lattice vectors.
            Defaults to the identity matrix. Has to be all integers. e.g.,
            [[2,1,0],[0,3,0],[0,0,1]] generates a new structure with
            lattice vectors a" = 2a + b, b" = 3b, c" = c where a, b, and c
            are the lattice vectors of the original structure.
    """

    def __init__(self, scaling_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1))):
        self.scaling_matrix = scaling_matrix

    @staticmethod
    def from_scaling_factors(scale_a=1, scale_b=1, scale_c=1):
        """
        Convenience method to get a SupercellTransformation from a simple
        series of three numbers for scaling each lattice vector. Equivalent to
        calling the normal with [[scale_a, 0, 0], [0, scale_b, 0],
        [0, 0, scale_c]]

        Args:
            scale_a: Scaling factor for lattice direction a. Defaults to 1.
            scale_b: Scaling factor for lattice direction b. Defaults to 1.
            scale_c: Scaling factor for lattice direction c. Defaults to 1.

        Returns:
            SupercellTransformation.
        """
        return SupercellTransformation([[scale_a, 0, 0], [0, scale_b, 0],
                                        [0, 0, scale_c]])

    def apply_transformation(self, structure):
        return structure * self.scaling_matrix

    def __str__(self):
        return "Supercell Transformation with scaling matrix " + \
            "{}".format(self.scaling_matrix)

    def __repr__(self):
        return self.__str__()

    @property
    def inverse(self):
        raise NotImplementedError()

    @property
    def is_one_to_many(self):
        return False

class SubstitutionTransformation(AbstractTransformation):
    """
    This transformation substitutes species for one another.

    Args:
        species_map: A dict or list of tuples containing the species mapping in
            string-string pairs. E.g., {"Li":"Na"} or [("Fe2+","Mn2+")].
            Multiple substitutions can be done. Overloaded to accept
            sp_and_occu dictionary E.g. {"Si: {"Ge":0.75, "C":0.25}},
            which substitutes a single species with multiple species to
            generate a disordered structure.
    """
    def __init__(self, species_map):
        self.species_map = species_map
        self._species_map = dict(species_map)
        for k, v in self._species_map.items():
            if isinstance(v, (tuple, list)):
                self._species_map[k] = dict(v)

    def apply_transformation(self, structure):
        species_map = {}
        for k, v in self._species_map.items():
            if isinstance(v, dict):
                value = {get_el_sp(x): y for x, y in v.items()}
            else:
                value = get_el_sp(v)
            species_map[get_el_sp(k)] = value
        s = structure.copy()
        s.replace_species(species_map)
        return s

    def __str__(self):
        return "Substitution Transformation :" + \
            ", ".join([str(k) + "->" + str(v)
                       for k, v in self._species_map.items()])

    def __repr__(self):
        return self.__str__()

    @property
    def inverse(self):
        inverse_map = {v: k for k, v in self._species_map.items()}
        return SubstitutionTransformation(inverse_map)

    @property
    def is_one_to_many(self):
        return False

class RemoveSpeciesTransformation(AbstractTransformation):
    """
    Remove all occurrences of some species from a structure.

    Args:
        species_to_remove: List of species to remove. E.g., ["Li", "Mn"]
    """
    def __init__(self, species_to_remove):
        self.species_to_remove = species_to_remove

    def apply_transformation(self, structure):
        s = structure.copy()
        for sp in self.species_to_remove:
            s.remove_species([get_el_sp(sp)])
        return s

    def __str__(self):
        return "Remove Species Transformation :" + \
            ", ".join(self.species_to_remove)

    def __repr__(self):
        return self.__str__()

    @property
    def inverse(self):
        return None

    @property
    def is_one_to_many(self):
        return False

class PartialRemoveSpecieTransformation(AbstractTransformation):
    """
    Remove fraction of specie from a structure.

    Requires an oxidation state decorated structure for ewald sum to be
    computed.

    Given that the solution to selecting the right removals is NP-hard, there
    are several algorithms provided with varying degrees of accuracy and speed.
    Please see
    :class:`pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation`.

    Args:
        specie_to_remove: Specie to remove. Must have oxidation state E.g.,
            "Li+"
        fraction_to_remove: Fraction of specie to remove. E.g., 0.5
        algo: This parameter allows you to choose the algorithm to perform
            ordering. Use one of PartialRemoveSpecieTransformation.ALGO_*
            variables to set the algo.
    """

    ALGO_FAST = 0
    ALGO_COMPLETE = 1
    ALGO_BEST_FIRST = 2
    ALGO_ENUMERATE = 3

    def __init__(self, specie_to_remove, fraction_to_remove, algo=ALGO_FAST):
        """

        """
        self.specie_to_remove = specie_to_remove
        self.fraction_to_remove = fraction_to_remove
        self.algo = algo

    def apply_transformation(self, structure, return_ranked_list=False):
        """
        Apply the transformation.

        Args:
            structure: input structure
            return_ranked_list (bool/int): Boolean stating whether or not
                multiple structures are returned. If return_ranked_list is
                an int, that number of structures is returned.

        Returns:
            Depending on returned_ranked list, either a transformed structure
            or a list of dictionaries, where each dictionary is of the form
            {"structure" = .... , "other_arguments"}
            the key "transformation" is reserved for the transformation that
            was actually applied to the structure.
            This transformation is parsed by the alchemy classes for generating
            a more specific transformation history. Any other information will
            be stored in the transformation_parameters dictionary in the
            transmuted structure class.
        """
        sp = get_el_sp(self.specie_to_remove)
        specie_indices = [i for i in range(len(structure))
                          if structure[i].species_and_occu ==
                          Composition({sp: 1})]
        trans = PartialRemoveSitesTransformation([specie_indices],
                                                 [self.fraction_to_remove],
                                                 algo=self.algo)
        return trans.apply_transformation(structure, return_ranked_list)

    @property
    def is_one_to_many(self):
        return True

    def __str__(self):
        spec_str = ["Species = {}".format(self.specie_to_remove),
                    "Fraction to remove = {}".format(self.fraction_to_remove),
                    "ALGO = {}".format(self.algo)]
        return "PartialRemoveSpecieTransformation : " + ", ".join(spec_str)

    def __repr__(self):
        return self.__str__()

    @property
    def inverse(self):
        return None

class OrderDisorderedStructureTransformation(AbstractTransformation):
    """
    Order a disordered structure. The disordered structure must be oxidation
    state decorated for ewald sum to be computed. No attempt is made to perform
    symmetry determination to reduce the number of combinations.

    Hence, attempting to performing ordering on a large number of disordered
    sites may be extremely expensive. The time scales approximately with the
    number of possible combinations. The algorithm can currently compute
    approximately 5,000,000 permutations per minute.

    Also, simple rounding of the occupancies are performed, with no attempt
    made to achieve a target composition.  This is usually not a problem for
    most ordering problems, but there can be times where rounding errors may
    result in structures that do not have the desired composition.
    This second step will be implemented in the next iteration of the code.

    If multiple fractions for a single species are found for different sites,
    these will be treated separately if the difference is above a threshold
    tolerance. currently this is .1

    For example, if a fraction of .25 Li is on sites 0,1,2,3  and .5 on sites
    4, 5, 6, 7 then 1 site from [0,1,2,3] will be filled and 2 sites from [4,5,6,7]
    will be filled, even though a lower energy combination might be found by
    putting all lithium in sites [4,5,6,7].

    USE WITH CARE.

    Args:
        algo (int): Algorithm to use.
        symmetrized_structures (bool): Whether the input structures are
            instances of SymmetrizedStructure, and that their symmetry
            should be used for the grouping of sites.
    """

    ALGO_FAST = 0
    ALGO_COMPLETE = 1
    ALGO_BEST_FIRST = 2

    def __init__(self, algo=ALGO_FAST, symmetrized_structures=False):
        self.algo = algo
        self._all_structures = []
        self.symmetrized_structures = symmetrized_structures

    def apply_transformation(self, structure, return_ranked_list=False):
        """
        For this transformation, the apply_transformation method will return
        only the ordered structure with the lowest Ewald energy, to be
        consistent with the method signature of the other transformations.
        However, all structures are stored in the  all_structures attribute in
        the transformation object for easy access.

        Args:
            structure: Oxidation state decorated disordered structure to order
            return_ranked_list (bool): Whether or not multiple structures are
                returned. If return_ranked_list is a number, that number of
                structures is returned.

        Returns:
            Depending on returned_ranked list, either a transformed structure
            or a list of dictionaries, where each dictionary is of the form
            {"structure" = .... , "other_arguments"}
            the key "transformation" is reserved for the transformation that
            was actually applied to the structure.
            This transformation is parsed by the alchemy classes for generating
            a more specific transformation history. Any other information will
            be stored in the transformation_parameters dictionary in the
            transmuted structure class.
        """

        try:
            num_to_return = int(return_ranked_list)
        except ValueError:
            num_to_return = 1

        num_to_return = max(1, num_to_return)

        equivalent_sites = []
        exemplars = []
        # generate list of equivalent sites to order
        # equivalency is determined by sp_and_occu and symmetry
        # if symmetrized structure is true
        for i, site in enumerate(structure):
            if site.is_ordered:
                continue
            for j, ex in enumerate(exemplars):
                sp = ex.species_and_occu
                if not site.species_and_occu.almost_equals(sp):
                    continue
                if self.symmetrized_structures:
                    sym_equiv = structure.find_equivalent_sites(ex)
                    sym_test = site in sym_equiv
                else:
                    sym_test = True
                if sym_test:
                    equivalent_sites[j].append(i)
                    break
            else:
                equivalent_sites.append([i])
                exemplars.append(site)

        # generate the list of manipulations and input structure
        s = Structure.from_sites(structure)
        m_list = []
        for g in equivalent_sites:
            total_occupancy = sum([structure[i].species_and_occu for i in g],
                                  Composition())
            total_occupancy = dict(total_occupancy.items())
            # round total occupancy to possible values
            for k, v in total_occupancy.items():
                if abs(v - round(v)) > 0.25:
                    raise ValueError("Occupancy fractions not consistent "
                                     "with size of unit cell")
                total_occupancy[k] = int(round(v))
            # start with an ordered structure
            initial_sp = max(total_occupancy.keys(),
                             key=lambda x: abs(x.oxi_state))
            for i in g:
                s[i] = initial_sp
            # determine the manipulations
            for k, v in total_occupancy.items():
                if k == initial_sp:
                    continue
                m = [k.oxi_state / initial_sp.oxi_state if initial_sp.oxi_state
                     else 0, v, list(g), k]
                m_list.append(m)
            # determine the number of empty sites
            empty = len(g) - sum(total_occupancy.values())
            if empty > 0.5:
                m_list.append([0, empty, list(g), None])

        matrix = EwaldSummation(s).total_energy_matrix
        ewald_m = EwaldMinimizer(matrix, m_list, num_to_return, self.algo)

        self._all_structures = []

        lowest_energy = ewald_m.output_lists[0][0]
        num_atoms = sum(structure.composition.values())

        for output in ewald_m.output_lists:
            s_copy = s.copy()
            # do deletions afterwards because they screw up the indices of the
            # structure
            del_indices = []
            for manipulation in output[1]:
                if manipulation[1] is None:
                    del_indices.append(manipulation[0])
                else:
                    s_copy[manipulation[0]] = manipulation[1]
            s_copy.remove_sites(del_indices)
            self._all_structures.append(
                {"energy": output[0],
                 "energy_above_minimum":
                 (output[0] - lowest_energy) / num_atoms,
                 "structure": s_copy.get_sorted_structure()})

        if return_ranked_list:
            return self._all_structures
        else:
            return self._all_structures[0]["structure"]

    def __str__(self):
        return "Order disordered structure transformation"

    def __repr__(self):
        return self.__str__()

    @property
    def inverse(self):
        return None

    @property
    def is_one_to_many(self):
        return True

    @property
    def lowest_energy_structure(self):
        return self._all_structures[0]["structure"]

class PrimitiveCellTransformation(AbstractTransformation):
    """
    This class finds the primitive cell of the input structure.
    It returns a structure that is not necessarily orthogonalized
    Author: Will Richards

    Args:
        tolerance (float): Tolerance for each coordinate of a particular
            site. For example, [0.5, 0, 0.5] in cartesian coordinates will be
            considered to be on the same coordinates as [0, 0, 0] for a
            tolerance of 0.5. Defaults to 0.5.

    """
    def __init__(self, tolerance=0.5):
        self.tolerance = tolerance

    def apply_transformation(self, structure):
        """
        Returns most primitive cell for structure.

        Args:
            structure: A structure

        Returns:
            The most primitive structure found. The returned structure is
            guaranteed to have len(new structure) <= len(structure).
        """
        return structure.get_primitive_structure(tolerance=self.tolerance)

    def __str__(self):
        return "Primitive cell transformation"

    def __repr__(self):
        return self.__str__()

    @property
    def inverse(self):
        return None

    @property
    def is_one_to_many(self):
        return False

class PerturbStructureTransformation(AbstractTransformation):
    """
    This transformation perturbs a structure by a specified distance in random
    directions. Used for breaking symmetries.

    Args:
        amplitude (float): Amplitude of perturbation in angstroms. All sites
            will be perturbed by exactly that amplitude in a random direction.
    """

    def __init__(self, amplitude=0.01):

        self.amplitude = amplitude

    def apply_transformation(self, structure):
        s = structure.copy()
        s.perturb(self.amplitude)
        return s

    def __str__(self):
        return "PerturbStructureTransformation : " + \
            "Amplitude = {}".format(self.amplitude)

    def __repr__(self):
        return self.__str__()

    @property
    def inverse(self):
        return None

    @property
    def is_one_to_many(self):
        return False

class DeformStructureTransformation(AbstractTransformation):
    """
    This transformation deforms a structure by a deformation gradient matrix

    Args:
        deformation (array): deformation gradient for the transformation
    """

    def __init__(self, deformation):
        self.deformation = Deformation(deformation)

    def apply_transformation(self, structure):
        return self.deformation.apply_to_structure(structure)

    def __str__(self):
        return "DeformStructureTransformation : " + \
            "Deformation = {}".format(str(self.deformation.tolist()))

    def __repr__(self):
        return self.__str__()

    @property
    def inverse(self):
        return DeformStructureTransformation(self.deformation.inv())

    @property
    def is_one_to_many(self):
        return False

class DiscretizeOccupanciesTransformation(AbstractTransformation):
    """
    Discretizes the site occupancies in a disordered structure; useful for
    grouping similar structures or as a pre-processing step for order-disorder
    transformations.

    Args:
        max_denominator:
            An integer maximum denominator for discretization. A higher
            denominator allows for finer resolution in the site occupancies.
        tol:
            A float that sets the maximum difference between the original and
            discretized occupancies before throwing an error. The maximum
            allowed difference is calculated as 1/max_denominator * 0.5 * tol.
            A tol of 1.0 indicates to try to accept all discretizations.
    """

    def __init__(self, max_denominator=5, tol=0.25):
        self.max_denominator = max_denominator
        self.tol = tol

    def apply_transformation(self, structure):
        """
        Discretizes the site occupancies in the structure.

        Args:
            structure: disordered Structure to discretize occupancies

        Returns:
            A new disordered Structure with occupancies discretized
        """
        if structure.is_ordered:
            return structure

        species = [dict(sp) for sp in structure.species_and_occu]

        for sp in species:
            for k, v in sp.items():
                old_occ = sp[k]
                new_occ = float(
                    Fraction(old_occ).limit_denominator(self.max_denominator))
                if round(abs(old_occ - new_occ), 6) > (
                        1 / self.max_denominator / 2) * self.tol:
                    raise RuntimeError(
                        "Cannot discretize structure within tolerance!")
                sp[k] = new_occ

        return Structure(structure.lattice, species, structure.frac_coords)

    def __str__(self):
        return "DiscretizeOccupanciesTransformation"

    def __repr__(self):
        return self.__str__()

    @property
    def inverse(self):
        return None

    @property
    def is_one_to_many(self):
        return False


text:
<!DOCTYPE html>

    <title>
        Pop PHP Framework : Documentation
    </title>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="author" content="Pop PHP Framework" />
    <meta name="keywords" content="pop php framework, php, php framework, php library, documentation" />
    <meta name="description" content="This is the Pop PHP Framework documentation." />
    <meta name="robots" content="all" />

    <link rel="stylesheet" type="text/css" href="http://www.popphp.org/css/docs.css" />

Pop PHP Framework

Documentation : Crypt

            Home

            La composante Crypt offre la possibilité de créer des hashs et vérifier les valeurs par rapport à ces valeurs de hachage. La classe Mcrypt supporte le cryptage à double sens. Les types de crypte pris en charge sont:

Crypt

Bcrypt (via the crypt function)

Mcrypt (via the mcrypt extension)

Md5 (via the crypt function)

Sha (via the crypt function)

use Pop\Crypt\Bcrypt;

$bc = new Bcrypt();
$hash = $bc->create('12password34');

echo $hash;

if ($bc->verify('12password34', $hash)) {
    echo 'Verified!';
} else {
    echo 'NOT Verified!';
}

            © 2009-2014 Moc 10 Media, LLC. All Rights Reserved.


text:
import React from 'react';
import { assert } from 'chai';
import { createMount, describeConformance, getClasses } from '@material-ui/core/test-utils';
import FormControl from '../FormControl';
import Input from '../Input';
import OutlinedInput from '../OutlinedInput';
import TextField from './TextField';

describe('<TextField />', () => {
  let classes;
  let mount;

  before(() => {
    classes = getClasses(<TextField />);
    mount = createMount({ strict: true });
  });

  after(() => {
    mount.cleanUp();
  });

  describeConformance(<TextField />, () => ({
    classes,
    inheritComponent: FormControl,
    mount,
    refInstanceof: window.HTMLDivElement,
    skip: ['componentProp'],
  }));

  describe('mount', () => {
    let wrapper;

    beforeEach(() => {
      wrapper = mount(<TextField />);
    });

    describe('structure', () => {
      it('should have an input as the only child', () => {
        assert.strictEqual(wrapper.find(Input).length, 1);
      });

      it('should forward the multiline prop to Input', () => {
        wrapper = mount(<TextField multiline />);
        assert.strictEqual(wrapper.find(Input).props().multiline, true);
      });

      it('should forward the fullWidth prop to Input', () => {
        wrapper = mount(<TextField fullWidth />);
        assert.strictEqual(wrapper.find(Input).props().fullWidth, true);
      });
    });

    describe('with a label', () => {
      beforeEach(() => {
        wrapper.setProps({ id: 'label-test', label: 'Foo bar' });
      });

      it('label the input', () => {
        const input = wrapper.find('input#label-test');
        const label = wrapper.find('label[htmlFor="label-test"]');

        assert.strictEqual(input.exists(), true);
        assert.strictEqual(label.exists(), true);
        assert.strictEqual(label.text(), 'Foo bar');
      });

      it('should apply the className to the label', () => {
        wrapper.setProps({ InputLabelProps: { className: 'foo' } });
        assert.strictEqual(wrapper.find('label').hasClass('foo'), true);
      });
    });

    describe('with a helper text', () => {
      let helperTextId;
      /**
       * @return {ReactWrapper} holding the DOM node with the helper text
       */
      function findHelperTextWrapper() {
        return wrapper.find(`#${helperTextId}`).hostNodes();
      }

      beforeEach(() => {
        wrapper.setProps({ id: 'aria-test', helperText: 'Foo bar' });
        helperTextId = wrapper.find('input').props()['aria-describedby'];
      });

      it('should apply the className to the FormHelperText', () => {
        wrapper.setProps({ FormHelperTextProps: { className: 'foo' } });
        assert.strictEqual(findHelperTextWrapper().hasClass('foo'), true);
      });

      it('should add accessibility labels to the input', () => {
        assert.strictEqual(helperTextId.length > 0, true);
        assert.strictEqual(findHelperTextWrapper().text(), 'Foo bar');
      });
    });

    describe('with an outline', () => {
      it('should set outline props', () => {
        wrapper = mount(<TextField variant="outlined" />);
        assert.strictEqual(wrapper.find(OutlinedInput).props().labelWidth, 0);
      });

      it('should set shrink prop on outline from label', () => {
        wrapper = mount(
          <TextField variant="outlined" InputLabelProps={{ shrink: true }} classes={{}} />,
        );
        assert.strictEqual(wrapper.find(OutlinedInput).props().notched, true);
      });
    });

    describe('prop: InputProps', () => {
      it('should apply additional properties to the Input component', () => {
        wrapper.setProps({ InputProps: { inputclassname: 'fullWidth' } });
        assert.strictEqual(wrapper.find(Input).props().inputclassname, 'fullWidth');
      });
    });
  });

  describe('prop: InputProps', () => {
    it('should apply additional properties to the Input component', () => {
      const wrapper = mount(<TextField InputProps={{ readOnly: true }} />);
      assert.strictEqual(wrapper.find('input').props().readOnly, true);
    });
  });

  describe('prop: select', () => {
    it('should be able to render a select as expected', () => {
      const currencies = [{ value: 'USD', label: '$' }, { value: 'BTC', label: '฿' }];

      const wrapper = mount(
        <TextField select SelectProps={{ native: true }}>
          {currencies.map(option => (
            <option key={option.value} value={option.value}>
              {option.label}
            </option>
          ))}
        </TextField>,
      );

      const select = wrapper.find('select');

      assert.strictEqual(select.exists(), true);
      assert.strictEqual(select.children().every('option'), true);
    });
  });
});


text:
CKEDITOR.plugins.setLang( 'scayt', 'fi', {
	about: 'Tietoja oikoluvusta kirjoitetaessa',
	aboutTab: 'Tietoa',
	addWord: 'Lisää sana',
	allCaps: 'Ohita sanat, jotka on kirjoitettu kokonaan isoilla kirjaimilla',
	dic_create: 'Luo',
	dic_delete: 'Poista',
	dic_field_name: 'Sanakirjan nimi',
	dic_info: 'Oletuksena sanakirjat tallennetaan evästeeseen, mutta evästeiden koko on kuitenkin rajallinen. Sanakirjan kasvaessa niin suureksi, ettei se enää mahdu evästeeseen, sanakirja täytyy tallentaa palvelimellemme. Tallentaaksesi sanakirjasi palvelimellemme tulee sinun antaa sille nimi. Jos olet jo tallentanut sanakirjan, anna sen nimi ja klikkaa Palauta-painiketta',
	dic_rename: 'Nimeä uudelleen',
	dic_restore: 'Palauta',
	dictionariesTab: 'Sanakirjat',
	disable: 'Poista käytöstä oikoluku kirjoitetaessa',
	emptyDic: 'Sanakirjan nimi on annettava.',
	enable: 'Ota käyttöön oikoluku kirjoitettaessa',
	ignore: 'Ohita',
	ignoreAll: 'Ohita kaikki',
	ignoreDomainNames: 'Ohita verkkotunnukset',
	langs: 'Kielet',
	languagesTab: 'Kielet',
	mixedCase: 'Ohita sanat, joissa on sekoitettu isoja ja pieniä kirjaimia',
	mixedWithDigits: 'Ohita sanat, joissa on numeroita',
	moreSuggestions: 'Lisää ehdotuksia',
	opera_title: 'Opera ei tue tätä ominaisuutta',
	options: 'Asetukset',
	optionsTab: 'Asetukset',
	title: 'Oikolue kirjoitettaessa',
	toggle: 'Vaihda oikoluku kirjoittaessa tilaa',
	noSuggestions: 'No suggestion'
});


text:
import datetime
import os
import uuid

import iso8601
import mock

from gnocchi.tests import base as tests_base
from gnocchi import utils

class TestUtils(tests_base.TestCase):
    def _do_test_datetime_to_unix_timezone_change(self, expected, dt):
        self.assertEqual(expected, utils.datetime_to_unix(dt))
        with mock.patch.dict(os.environ, {'TZ': 'UTC'}):
            self.assertEqual(expected, utils.datetime_to_unix(dt))
        with mock.patch.dict(os.environ, {'TZ': 'Europe/Paris'}):
            self.assertEqual(expected, utils.datetime_to_unix(dt))
        with mock.patch.dict(os.environ, {'TZ': 'US/Eastern'}):
            self.assertEqual(expected, utils.datetime_to_unix(dt))

    def test_datetime_to_unix_timezone_change_utc(self):
        dt = datetime.datetime(2015, 1, 1, 10, 0, tzinfo=iso8601.iso8601.UTC)
        self._do_test_datetime_to_unix_timezone_change(1420106400.0, dt)

    def test_datetime_to_unix_timezone_change_offset(self):
        dt = datetime.datetime(2015, 1, 1, 15, 0,
                               tzinfo=iso8601.iso8601.FixedOffset(5, 0, '+5h'))
        self._do_test_datetime_to_unix_timezone_change(1420106400.0, dt)

    def test_to_timestamp_empty(self):
        self.assertEqual([], utils.to_timestamps([]))

    def test_to_timestamps_epoch(self):
        self.assertEqual(
            utils.to_datetime("1425652440"),
            datetime.datetime(2015, 3, 6, 14, 34,
                              tzinfo=iso8601.iso8601.UTC))
        self.assertEqual(
            utils.to_datetime("1425652440.4"),
            datetime.datetime(2015, 3, 6, 14, 34, 0, 400000,
                              tzinfo=iso8601.iso8601.UTC))
        self.assertEqual(
            utils.to_datetime(1425652440),
            datetime.datetime(2015, 3, 6, 14, 34,
                              tzinfo=iso8601.iso8601.UTC))
        self.assertEqual(
            utils.to_datetime(utils.to_timestamp(1425652440.4)),
            datetime.datetime(2015, 3, 6, 14, 34, 0, 400000,
                              tzinfo=iso8601.iso8601.UTC))

    def test_to_timestamps_relative(self):
        with mock.patch('gnocchi.utils.utcnow') as utcnow:
            utcnow.return_value = datetime.datetime(
                2015, 3, 6, 14, 34, tzinfo=iso8601.iso8601.UTC)
            self.assertEqual(
                utils.to_datetime("-10 minutes"),
                datetime.datetime(2015, 3, 6, 14, 24,
                                  tzinfo=iso8601.iso8601.UTC))

class TestResourceUUID(tests_base.TestCase):
    def test_conversion(self):
        self.assertEqual(
            uuid.UUID('ba571521-1de6-5aff-b183-1535fd6eb5d0'),
            utils.ResourceUUID(
                uuid.UUID('ba571521-1de6-5aff-b183-1535fd6eb5d0'),
                "bar"))
        self.assertEqual(
            uuid.UUID('ba571521-1de6-5aff-b183-1535fd6eb5d0'),
            utils.ResourceUUID("foo", "bar"))
        self.assertEqual(
            uuid.UUID('4efb21f6-3d19-5fe3-910b-be8f0f727846'),
            utils.ResourceUUID("foo", None))
        self.assertEqual(
            uuid.UUID('853e5c64-f45e-58b2-999c-96df856fbe3d'),
            utils.ResourceUUID("foo", ""))

class StopWatchTest(tests_base.TestCase):
    def test_no_states(self):
        watch = utils.StopWatch()
        self.assertRaises(RuntimeError, watch.stop)

    def test_start_stop(self):
        watch = utils.StopWatch()
        watch.start()
        watch.stop()

    def test_no_elapsed(self):
        watch = utils.StopWatch()
        self.assertRaises(RuntimeError, watch.elapsed)

    def test_elapsed(self):
        watch = utils.StopWatch()
        watch.start()
        watch.stop()
        elapsed = watch.elapsed()
        self.assertAlmostEqual(elapsed, watch.elapsed())

    def test_context_manager(self):
        with utils.StopWatch() as watch:
            pass
        self.assertGreater(watch.elapsed(), 0)


text: This procedure starts a WebSphere instance or an application server using startServer.sh.


text:
const errors = require("../errors");
const utils = require("../utils");

class AgentService {
  constructor(consul) {
    this.consul = consul;
  }

  /**
   * Returns the services local agent is managing
   */
  async list(opts) {
    opts = utils.normalizeKeys(opts);
    opts = utils.defaults(opts, this.consul._defaults);

    const req = {
      name: "agent.service.list",
      path: "/agent/services",
    };

    utils.options(req, opts);

    return await this.consul._get(req, utils.body);
  }

  /**
   * Registers a new local service
   */
  async register(opts) {
    if (typeof opts === "string") {
      opts = { name: opts };
    }

    opts = utils.normalizeKeys(opts);
    opts = utils.defaults(opts, this.consul._defaults);

    const req = {
      name: "agent.service.register",
      path: "/agent/service/register",
      type: "json",
      body: {},
    };

    if (!opts.name) {
      throw this.consul._err(errors.Validation("name required"), req);
    }

    try {
      req.body = utils.createService(opts);
    } catch (err) {
      throw this.consul._err(errors.Validation(err.message), req);
    }

    utils.options(req, opts);

    return await this.consul._put(req, utils.empty);
  }

  /**
   * Deregister a local service
   */
  async deregister(opts) {
    if (typeof opts === "string") {
      opts = { id: opts };
    }

    opts = utils.normalizeKeys(opts);
    opts = utils.defaults(opts, this.consul._defaults);

    const req = {
      name: "agent.service.deregister",
      path: "/agent/service/deregister/{id}",
      params: { id: opts.id },
    };

    if (!opts.id) {
      throw this.consul._err(errors.Validation("id required"), req);
    }

    utils.options(req, opts);

    return await this.consul._put(req, utils.empty);
  }

  /**
   * Manages node maintenance mode
   */
  async maintenance(opts) {
    opts = utils.normalizeKeys(opts);
    opts = utils.defaults(opts, this.consul._defaults);

    const req = {
      name: "agent.service.maintenance",
      path: "/agent/service/maintenance/{id}",
      params: { id: opts.id },
      query: { enable: opts.enable },
    };

    if (!opts.id) {
      throw this.consul._err(errors.Validation("id required"), req);
    }
    if (typeof opts.enable !== "boolean") {
      throw this.consul._err(errors.Validation("enable required"), req);
    }
    if (opts.reason) req.query.reason = opts.reason;

    utils.options(req, opts);

    return await this.consul._put(req, utils.empty);
  }
}

exports.AgentService = AgentService;


text:
package org.hammerlab.bam.check.full.error

import hammerlab.bool._
import hammerlab.print._
import hammerlab.show._
import shapeless.labelled.FieldType

case class Counts(tooFewFixedBlockBytes       : Long,
                  negativeReadIdx             : Long,
                  tooLargeReadIdx             : Long,
                  negativeReadPos             : Long,
                  tooLargeReadPos             : Long,
                  negativeNextReadIdx         : Long,
                  tooLargeNextReadIdx         : Long,
                  negativeNextReadPos         : Long,
                  tooLargeNextReadPos         : Long,
                  tooFewBytesForReadName      : Long,
                  nonNullTerminatedReadName   : Long,
                  nonASCIIReadName            : Long,
                  noReadName                  : Long,
                  emptyReadName               : Long,
                  tooFewBytesForCigarOps      : Long,
                  invalidCigarOp              : Long,
                  emptyMappedCigar            : Long,
                  emptyMappedSeq              : Long,
                  tooFewRemainingBytesImplied : Long,
                  readsBeforeError            : Map[Int, Long]
                 )
  extends Error[Long] {
  def lines(wrapFields: Boolean = false,
            includeZeros: Boolean = true,
            hideTooFewFixedBlockBytes: Boolean = false)(
      implicit indent: Indent
  ): Lines =
    Counts.makeLines(
      wrapFields,
      includeZeros,
      hideTooFewFixedBlockBytes
    ).apply(
      this
    )
}

object Counts {

  import shapeless._
  import shapeless.record._
  import ops.record._

  /** Can't instantiate these inside the [[CountsWrapper]] [[AnyVal]] below. */
  val lg = LabelledGeneric[Counts]
  val gen = Generic[Counts]

  object longFields extends FieldPoly {
    implicit def longCase[K](implicit witness: Witness.Aux[K]): Case.Aux[FieldType[K, Long], FieldType[K, Long]] =
      atField(witness)(x ⇒ x)
  }

  implicit class CountsWrapper(val counts: Counts)
    extends AnyVal {

    /**
     * Convert an [[Counts]] to a values-descending array of (key,value) pairs
     */
    def descCounts: List[(String, Long)] =
      lg
        .to(counts)
        .collect(longFields)
        .fields
        .toList[(Symbol, Long)]
        .map {
          case (k, v) ⇒
            k.name → v
        }
        .sortBy(-_._2)
  }

  /**
   * Pretty-print an [[Counts]]
   */
  implicit def makeLines(wrapFields: Boolean = false,
                         includeZeros: Boolean = true,
                         hideTooFewFixedBlockBytes: Boolean = false)(
      implicit _indent: Indent
  ): ToLines[Counts] =
    (t: Counts) ⇒ {
      val dc = t.descCounts

      val stringPairs =
        (
          for {
            (k, v) ← dc
            if (v > 0 || includeZeros) && (k != "tooFewFixedBlockBytes" || !hideTooFewFixedBlockBytes)
          } yield
            k → v.toString
        ) ++
        (
          t
            .readsBeforeError
            .toVector
            .sorted match {
              case Vector() ⇒ Nil
              case readsBeforeError ⇒
                List(
                  "readsBeforeError" →
                    readsBeforeError
                      .map {
                        case (reads, num) ⇒
                          s"${reads}ⅹ$num"
                      }
                      .mkString(" ")
                )
            }
        )

      val maxKeySize = stringPairs.map(_._1.length).max
      val maxValSize = stringPairs.map(_._2.length).max

      Lines(
        wrapFields | "Errors(",
        indent {
          stringPairs map {
            case (k, v) ⇒
              s"${" " * (maxKeySize - k.length)}$k:\t${" " * (maxValSize - v.toString.length)}$v"
          }
        },
        wrapFields | ")"
      )
  }
}


text:
using System;
namespace com.google.zxing.common.reedsolomon
{

	///
Implements Reed-Solomon enbcoding, as the name implies.

	///
	///
	/// <author>  Sean Owen
	/// </author>
	/// <author>  William Rucklidge
	/// </author>
	/// <author>www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source
	/// </author>
	internal sealed class ReedSolomonEncoder
	{

		//UPGRADE_NOTE: Final was removed from the declaration of 'field '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"
		private GF256 field;
		//UPGRADE_NOTE: Final was removed from the declaration of 'cachedGenerators '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"
		private System.Collections.ArrayList cachedGenerators;

		internal ReedSolomonEncoder(GF256 field)
		{
			if (!GF256.QR_CODE_FIELD.Equals(field))
			{
				throw new System.ArgumentException("Only QR Code is supported at this time");
			}
			this.field = field;
			this.cachedGenerators = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
			cachedGenerators.Add(new GF256Poly(field, new int[]{1}));
		}

		private GF256Poly buildGenerator(int degree)
		{
			if (degree >= cachedGenerators.Count)
			{
				GF256Poly lastGenerator = (GF256Poly) cachedGenerators[cachedGenerators.Count - 1];
				for (int d = cachedGenerators.Count; d <= degree; d++)
				{
					GF256Poly nextGenerator = lastGenerator.multiply(new GF256Poly(field, new int[]{1, field.exp(d - 1)}));
					cachedGenerators.Add(nextGenerator);
					lastGenerator = nextGenerator;
				}
			}
			return (GF256Poly) cachedGenerators[degree];
		}

		internal void  encode(int[] toEncode, int ecBytes)
		{
			if (ecBytes == 0)
			{
				throw new System.ArgumentException("No error correction bytes");
			}
			int dataBytes = toEncode.Length - ecBytes;
			if (dataBytes <= 0)
			{
				throw new System.ArgumentException("No data bytes provided");
			}
			GF256Poly generator = buildGenerator(ecBytes);
			int[] infoCoefficients = new int[dataBytes];
			Array.Copy(toEncode, 0, infoCoefficients, 0, dataBytes);
			GF256Poly info = new GF256Poly(field, infoCoefficients);
			info = info.multiplyByMonomial(ecBytes, 1);
			GF256Poly remainder = info.divide(generator)[1];
			int[] coefficients = remainder.Coefficients;
			int numZeroCoefficients = ecBytes - coefficients.Length;
			for (int i = 0; i < numZeroCoefficients; i++)
			{
				toEncode[dataBytes + i] = 0;
			}
			Array.Copy(coefficients, 0, toEncode, dataBytes + numZeroCoefficients, coefficients.Length);
		}
	}
}


text:
(function (enyo, scope) {

	var selfClosing = {img: 1, hr: 1, br: 1, area: 1, base: 1, basefont: 1, input: 1, link: 1,
		meta: 1, command: 1, embed: 1, keygen: 1, wbr: 1, param: 1, source: 1, track: 1, col: 1};

	/**
	* This is the default render delegate used by {@link enyo.Control}. It
	* generates the HTML [string]{@glossary String} content and correctly inserts
	* it into the DOM. A string-concatenation technique is used to perform DOM
	* insertion in batches.
	*
	* @name enyo.HTMLStringDelegate
	* @type Object
	* @public
	*/
	enyo.HTMLStringDelegate = {

		/**
		* @private
		*/
		invalidate: function (control, item) {
			switch (item) {
			case 'content':
				this.renderContent(control);
				break;
			default:
				control.tagsValid = false;
				break;
			}
		},

		/**
		* @private
		*/
		render: function (control) {
			if (control.parent) {
				control.parent.beforeChildRender(control);

				if (!control.parent.generated) return;
				if (control.tag === null) return control.parent.render();
			}

			if (!control.hasNode()) this.renderNode(control);
			if (control.hasNode()) {
				this.renderDom(control);
				if (control.generated) control.rendered();
			}
		},

		/**
		* @private
		*/
		renderInto: function (control, parentNode) {
			parentNode.innerHTML = this.generateHtml(control);

			if (control.generated) control.rendered();
		},

		/**
		* @private
		*/
		renderNode: function (control) {
			this.teardownRender(control);
			control.node = document.createElement(control.tag);
			control.addNodeToParent();
			control.set('generated', true);
		},

		/**
		* @private
		*/
		renderDom: function (control) {
			this.renderAttributes(control);
			this.renderStyles(control);
			this.renderContent(control);
		},

		/**
		* @private
		*/
		renderStyles: function (control) {
			var style = control.style;

			// we can safely do this knowing it will synchronize properly without a double
			// set in the DOM because we're flagging the internal property
			if (control.hasNode()) {
				control.node.style.cssText = style;
				// retrieve the parsed value for synchronization
				control.cssText = style = control.node.style.cssText;
				// now we set it knowing they will be synchronized and everybody that is listening
				// will also be updated to know about the change
				control.set('style', style);
			}
		},

		/**
		* @private
		*/
		renderAttributes: function (control) {
			var attrs = control.attributes,
				node = control.hasNode(),
				key,
				val;

			if (node) {
				for (key in attrs) {
					val = attrs[key];
					if (val === null || val === false || val === "") {
						node.removeAttribute(key);
					} else {
						node.setAttribute(key, val);
					}
				}
			}
		},

		/**
		* @private
		*/
		renderContent: function (control) {
			if (control.generated) this.teardownChildren(control);
			if (control.hasNode()) control.node.innerHTML = this.generateInnerHtml(control);
		},

		/**
		* @private
		*/
		generateHtml: function (control) {
			var content,
				html;

			if (control.canGenerate === false) {
				return '';
			}
			// do this first in case content generation affects outer html (styles or attributes)
			content = this.generateInnerHtml(control);
			// generate tag, styles, attributes
			html = this.generateOuterHtml(control, content);
			// NOTE: 'generated' is used to gate access to findNodeById in
			// hasNode, because findNodeById is expensive.
			// NOTE: we typically use 'generated' to mean 'created in DOM'
			// but that has not actually happened at this point.
			// We set 'generated = true' here anyway to avoid having to walk the
			// control tree a second time (to set it later).
			// The contract is that insertion in DOM will happen synchronously
			// to generateHtml() and before anybody should be calling hasNode().
			control.set('generated', true);
			return html;
		},

		/**
		* @private
		*/
		generateOuterHtml: function (control, content) {
			if (!control.tag) return content;
			if (!control.tagsValid) this.prepareTags(control);
			return control._openTag + content + control._closeTag;
		},

		/**
		* @private
		*/
		generateInnerHtml: function (control) {
			var allowHtml = control.allowHtml,
				content;

			// flow can alter the way that html content is rendered inside
			// the container regardless of whether there are children.
			control.flow();
			if (control.children.length) return this.generateChildHtml(control);
			else {
				content = control.get('content');
				return allowHtml ? content : enyo.dom.escape(content);
			}
		},

		/**
		* @private
		*/
		generateChildHtml: function (control) {
			var child,
				html = '',
				i = 0,
				delegate;

			for (; (child = control.children[i]); ++i) {
				delegate = child.renderDelegate || this;
				html += delegate.generateHtml(child);
			}

			return html;
		},

		/**
		* @private
		*/
		prepareTags: function (control) {
			var html = '';

			// open tag
			html += '<' + control.tag + (control.style ? ' style="' + control.style + '"' : '');
			html += this.attributesToHtml(control.attributes);
			if (selfClosing[control.tag]) {
				control._openTag = html + '/>';
				control._closeTag = '';
			} else {
				control._openTag = html + '>';
				control._closeTag = '</' + control.tag + '>';
			}

			control.tagsValid = true;
		},

		/**
		* @private
		*/
		attributesToHtml: function(attrs) {
			var key,
				val,
				html = '';

			for (key in attrs) {
				val = attrs[key];
				if (val != null && val !== false && val !== '') {
					html += ' ' + key + '="' + this.escapeAttribute(val) + '"';
				}
			}

			return html;
		},

		/**
		* @private
		*/
		escapeAttribute: function (text) {
			if (typeof text != 'string') return text;

			return String(text).replace(/&/g, '&').replace(/\"/g, '"');
		},

		/**
		* @private
		*/
		teardownRender: function (control) {
			if (control.generated) this.teardownChildren(control);
			control.node = null;
			control.set('generated', false);
		},

		/**
		* @private
		*/
		teardownChildren: function (control) {
			var child,
				i = 0;

			for (; (child = control.children[i]); ++i) {
				child.teardownRender();
			}
		}
	};

})(enyo, this);


text:
namespace Figlut.Server.Toolkit.Mmc.Forms
{
    /// <summary>
    /// Form container for a ListView control
    /// </summary>
    partial class SettingsControl
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.lstvSettings = new System.Windows.Forms.ListView();
            this.SuspendLayout();
            //
            // lstvSettings
            //
            this.lstvSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.lstvSettings.FullRowSelect = true;
            this.lstvSettings.GridLines = true;
            this.lstvSettings.Location = new System.Drawing.Point(15, 17);
            this.lstvSettings.Name = "lstvSettings";
            this.lstvSettings.Size = new System.Drawing.Size(121, 115);
            this.lstvSettings.TabIndex = 0;
            this.lstvSettings.UseCompatibleStateImageBehavior = false;
            this.lstvSettings.View = System.Windows.Forms.View.Details;
            this.lstvSettings.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lstvSettings_MouseClick);
            this.lstvSettings.SelectedIndexChanged += new System.EventHandler(this.lstvSettings_SelectedIndexChanged);
            //
            // SelectionControl
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.lstvSettings);
            this.Name = "SelectionControl";
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.ListView lstvSettings;
    }
}


text:
import { Credentials } from "google-auth-library";
import { analytics_v3 } from "googleapis";
import * as Hub from "../../../../hub";
import { Logger } from "../../common/logger";
import { GoogleAnalyticsDataImportAction } from "../data_import";
interface GAUserState {
    tokens: Credentials;
    redirect: string;
    lastUsedFormParams: any;
}
export declare class GoogleAnalyticsActionWorker {
    readonly hubRequest: Hub.ActionRequest;
    readonly actionInstance: GoogleAnalyticsDataImportAction;
    readonly log: Logger;
    static fromHubRequest(hubRequest: Hub.ActionRequest, actionInstance: GoogleAnalyticsDataImportAction, logger: Logger): Promise<GoogleAnalyticsActionWorker>;
    gaClient: analytics_v3.Analytics;
    userState: GAUserState;
    formParams: any;
    newUploadId?: string;
    constructor(hubRequest: Hub.ActionRequest, actionInstance: GoogleAnalyticsDataImportAction, log: Logger);
    makeGAClient(): analytics_v3.Analytics;
    get redirect(): string;
    get tokens(): Credentials;
    get dataSourceCompositeId(): any;
    get dataSourceSchema(): any;
    get isDeleteOtherFiles(): boolean;
    get lastUsedFormParams(): any;
    getEntityIds(): any;
    setLastUsedFormParams(): void;
    uploadData(): Promise<void>;
    deleteOtherFiles(): Promise<import("gaxios").GaxiosResponse<void> | undefined>;
    makeForm(): Promise<Hub.ActionForm>;
    getDataSetSelectOptions(accountSummaries: analytics_v3.Schema$AccountSummary[]): Promise<{
        name: string;
        label: string;
    }[]>;
}
export {};


text:
images-as-text
==============

HackMIT 2013 Project, precursor to Project Naptha


text:
<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     <style type="text/css">

        body
        {
            font-family:Verdana, Arial, '微软雅黑';
            font-size:12px;
        }

        table.dataintable {
            margin-top:10px;
            border-collapse:collapse;
            border:1px solid #aaa;
            width:100%;
        }

        table.dataintable th {
            vertical-align:baseline;
            padding:5px 15px 5px 6px;
            background-color:#d5d5d5;
            border:1px solid #aaa;
            text-align:left;
        }

        table.dataintable td {
            vertical-align:text-top;
            padding:6px 15px 6px 6px;
            background-color:#efefef;
            border:1px solid #aaa;
        }

        table.dataintable pre {
            width:auto;
            margin:0;
            padding:0;
            border:0;
            background-color:transparent;
        }

        table.dataintable p {margin:0 0 2px 0;}

        div#maincontent table.dataintable ul, div#maincontent table.dataintable li {
            list-style-type:none;
            margin:0;
            padding:0;
        }

        table.dataintable td em
        {
            color:#0000ff;
            font-weight:normal;
        }

        table.dataintable .table_value {color:#0F93D2;}

        .no_wrap {white-space:nowrap;}

    </style>

</head>
<body>

<div>


text:
@implementation NSString (URLEncoder)

- (NSString *)stringForHTTPRequest
{
    NSString *result = CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
                                                                                (CFStringRef)self,
                                                                                (CFStringRef)@" ",
                                                                                (CFStringRef)@":/?@!$&'()*+,;=",
                                                                                kCFStringEncodingUTF8));
    return [result stringByReplacingOccurrencesOfString:@" " withString:@"+"];
}

@end


text:
SYNONYM

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

#### Published in
Predominantly holocarpic and eucarpic simple biflagellate Phycomycetes (Vaduz), 2nd Edn 30 (1981)

#### Original name
Pseudolpidium deformans Serbinow, 1907

### Remarks
null


text:
layout: post
title: Hello, World!
permalink: /hello-world/
tags: [hello]
category:
author_id: onefootball
---

On the surface, [Onefootball](https://www.onefootball.com) is an awesome app for football fans to get their daily dose of news and scores wherever they are. But if you dig a bit deeper, you'll find that [Onefootball](http://www.onefootball.com/careers.html) is also a team of professionals solving challenges in many domains. One of those domains is software engineering and that's what this blog is about.

In our daily work, we make extensive use of the public code shared on the Internet and we produce our own to resolve new issues as well. In an effort to both present our more technical work and give back to the community, we decided to open that tech blog. We'll publish here announcements about our open-source projects, overviews of our tech stack, summaries of the conferences we attend, quick development tips and more in-depth articles concerning our processes.

We hope you'll enjoy reading our posts, feel free to contact us through the usual channels for feedback.

![_config.yml]({{ site.baseurl }}/images/2015-07/22-intro.jpg)


text:
"""gcc compiler configuration for release
"""
from parts.config import ConfigValues, configuration

def map_default_version(env):
    return env['GCC_VERSION']

config = configuration(map_default_version)

config.VersionRange(
    "3-*",
    append=ConfigValues(
        CCFLAGS=[
            '',
            # second level optimization
            '-O2',
            # treat warnings as errors
            '-Werror',
            # enable all warnings
            '-Wall',
            # extra warnings
            '-Wextra',
            # pedantic warnings
            # '-Wpedantic',
            # disable warnings due to gcc 4.8.5 issues
            '-Wno-missing-braces',
            '-Wno-missing-field-initializers',
            '-Wno-unknown-pragmas',
            '-Wno-unused-function',
            # do not assume strict aliasing
            '-fno-strict-aliasing',
            # do not warn about unused but set variables
            '-Wno-unused-but-set-variable',
            # do not warn about multiline comments
            '-Wno-comment',
            '-Wformat',
            '-Wformat-security',
            '-fstack-protector',
        ],
        CPPDEFINES=[
            'NDEBUG',
            '_FORTIFY_SOURCE=2',
            '__int64=long long',
        ],
        LINKFLAGS=[
            '-fstack-protector',
        ], ))


text:
package org.endeavourhealth.reference;

import org.endeavourhealth.core.database.dal.DalProvider;
import org.endeavourhealth.core.database.dal.informationmodel.VisionClinicalCodesIMUpdaterDalI;
import org.endeavourhealth.core.database.dal.publisherCommon.VisionCodeDalI;
import org.endeavourhealth.core.database.dal.publisherCommon.models.VisionClinicalCodeForIMUpdate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

public class VisionClinicalCodesIMUpdater {

    private static final Logger LOG = LoggerFactory.getLogger(VisionClinicalCodesIMUpdater.class);

    public static void updateVisionClinicalCodes(String[] args) throws Exception {
        if (args.length != 1) {
            LOG.error("Incorrect number of parameters");
            LOG.error("Usage: vision_clinical_codes");
        }

        LOG.info("Vision Clinical Codes IM Update Starting.");

        updateIMVisionClinicalCodes();

        LOG.info("Finished Vision Clinical Codes IM Update.");
    }

    private static void updateIMVisionClinicalCodes() throws Exception {

        VisionCodeDalI visionCodeDal = DalProvider.factoryVisionCodeDal();

        VisionClinicalCodesIMUpdaterDalI visionClinicalCodesIMUpdaterDal = DalProvider.factoryVisionClinicalCodesIMUpdaterDal();

        List<VisionClinicalCodeForIMUpdate> codeList = visionCodeDal.getClinicalCodesForIMUpdate();

        visionClinicalCodesIMUpdaterDal.updateIMForVisionClinicalCodes(codeList);
    }

}


text:
<?php

/**
 * Add a primary WordPress menu.
 */
add_action('after_setup_theme', function () {
    register_nav_menu('primary-menu', __('Primary Menu', 'boilerplate'));
});


text:
{-# LANGUAGE CPP, ScopedTypeVariables, TypeOperators #-}

module BMP where

import Data.Array.Accelerate as Acc
import Data.Array.Accelerate.Array.BlockCopy
import Control.Monad
import Codec.BMP
import System.IO
#ifdef HAS_CUDA
import Data.Array.Accelerate.CUDA as Backend
#else
import Data.Array.Accelerate.Interpreter as Backend
#endif

-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- Image I/O
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-- | Convert bitmap value to 3D accelerate array.
--
bmpToArray :: FilePath -> IO (Array DIM3 Word8)
bmpToArray bmpFile = do
  bmp  <- liftM (either (error . show) id) $ readBMP bmpFile
  let (w, h) = bmpDimensions bmp
      dim    = (Z :. h :. w :. 4)
  byteStringsToArray dim ((), unpackBMPToRGBA32 bmp)

-- | Convert 3D accelerate array to a bitmap value.
--
arrayToBmp :: FilePath -> Array DIM3 Word8 -> IO ()
arrayToBmp bmpFile arr = do
  ((), bs) <- arrayToByteStrings arr
  let bmp = packRGBA32ToBMP w h bs
  handle <- openFile bmpFile WriteMode
  hPutBMP handle bmp
  hClose handle
  where
    (Z :. h :. w :. _) = arrayShape arr

runEffectJob :: (Array DIM3 Word8 -> Acc (Array DIM3 Word8)) -> (String, String) -> IO ()
runEffectJob job (imageInBmp, imageOutBmp) = do
  arrIn  <- bmpToArray imageInBmp
  let arrOut = Backend.run $ job $ arrIn
  arrayToBmp imageOutBmp arrOut


text:
/********************************************************
File: LF3Dfull.hh
Abstract:  An implementation of a 3D level function.
Created: 11/21/2000 from a number of previous attempts
Author: Chris L. Wyatt

Last Revision ($Revision$) by $Author$ on $Date$
*********************************************************/

//prevent recursive includes

#ifndef _LF3Dfull_hh
#define _LF3Dfull_hh 1

#include <slist>

#include "Volume.hh"
#include "Vector.hh"

/** LF3Dfull Class.

A class implementing the storage of 3D level function
using the full matrix approach.

@author Chris L. Wyatt <cwyatt@wfubmc.edu>
@version  $Revision$
*/

class LF3Dfull: public IMTK::Volume<float>
{
	typedef std::slist< IMTK::Subscript<3> >::iterator tubeIterator;

private:
	// inner and outer tube diameters
	float innerR, outerR;

	// current tagged inner points
	std::slist< IMTK::Subscript<3> > inner;

	// current tagged outer points (land mines)
	std::slist< IMTK::Subscript<3> > outer;

public:

	/// Constructor
	LF3Dfull(): IMTK::Volume<float>(){
		innerR = 2.5;
		outerR = 5.0;
	};

	/// Custom Constructor
	LF3Dfull(IMTK::Subscript<3> bounds): IMTK::Volume<float>(bounds){
		innerR = 2.5;
		outerR = 5.0;
	};

	/// Copy Constructor
	LF3Dfull(const LF3Dfull & LF): IMTK::Volume<float>(LF){
		innerR = LF.innerR;
		outerR = LF.outerR;
	};

	/// Destructor
	~LF3Dfull(){};

	/// inner iterator begin
	tubeIterator innerBegin(){
		return inner.begin();
	};

	/// inner iterator end
	tubeIterator innerEnd(){
		return inner.end();
	};

	/**
	 * set inner tube radius
	 *
	 * @param theR the radius
	 */
	void setInnerR(float theR){

		innerR = theR;
	};

	/**
	 * get inner tube radius
	 *
	 * @return the radius
	 */
	float getInnerR(void) const{

		return innerR;
	};

	/**
	 * get number of inner tube points
	 *
	 * @return the number of points
	 */
	int getNumInner(void) const{

		return inner.size();
	};

	/**
	 * add voxel to inner tube list
	 *
	 * @param x
	 * @param y
	 * @parma z
	 */
	void addInner(int x, int y, int z){

		IMTK::Subscript<3> loc;

		loc[0] = x; loc[1] = y; loc[2] = z;

		inner.push_front(loc);
	};

	/**
	 * clear the inner tube list
	 *
	 */
	void clearInner(void){

		inner.clear();
	};

	/// outer iterator begin
	tubeIterator outerBegin(){
		return outer.begin();
	};

	/// outer iterator end
	tubeIterator outerEnd(){
		return outer.end();
	};

	/**
	 * set outer tube radius
	 *
	 * @param theR the radius
	 */
	void setOuterR(float theR){

		outerR = theR;
	};

	/**
	 * get outer tube radius
	 *
	 * @return the radius
	 */
	float getOuterR(void) const{

		return outerR;
	};

	/**
	 * get number of outer tube points
	 *
	 * @return the number of points
	 */
	int getNumOuter(void) const{

		return outer.size();
	};

	/**
	 * add voxel to outer tube list
	 *
	 * @param x
	 * @param y
	 * @parma z
	 */
	void addOuter(int x, int y, int z){

		IMTK::Subscript<3> loc;

		loc[0] = x; loc[1] = y; loc[2] = z;

		outer.push_front(loc);
	};

	/**
	 * clear the inner tube list
	 *
	 */
	void clearOuter(void){

		outer.clear();
	};
};

#endif


text:
AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include('shared.lua')

function ENT:Initialize()
	self.Entity:SetMoveType(MOVETYPE_NONE)
	self.Entity:SetSolid(SOLID_NONE)
	self:DrawShadow(false);
	//self:SetModel("models/props_wasteland/cargo_container01.mdl");
end


text:
<?php

namespace TNK\Bundle\GlobalBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class TNKGlobalBundle extends Bundle
{
}


text:
package com.thoughtworks.go.domain;

/**
 * @understands loading job plan for job
 */
public interface JobPlanLoader {
    JobPlan loadOriginalJobPlan(JobIdentifier jobId);
}


text:
package extracells.api;

public class ECApi {

	public static ExtraCellsApi instance() {
		if (instance == null) {
			try {
				instance = (ExtraCellsApi) Class
						.forName("extracells.ExtraCellsApiInstance")
						.getField("instance").get(null);
			} catch (Exception e) {}
		}
		return instance;
	}

	private static ExtraCellsApi instance = null;

}