text:
<?php

namespace Tests\Queue;

use Codeages\Biz\Framework\Queue\Worker;
use Codeages\Biz\Framework\Queue\JobFailer;
use Codeages\Biz\Framework\Queue\Driver\DatabaseQueue;
use Tests\Fixtures\QueueJob\ExampleFinishedJob;
use Tests\Fixtures\QueueJob\ExampleFailedJob;
use Tests\Fixtures\QueueJob\ExampleFailedRetryJob;

class WorkerTest extends QueueBaseTestCase
{
    public function testRun_FinishedJob()
    {
        $queueOptions = $this->getQueueOptions();
        $queue = new DatabaseQueue(self::TEST_QUEUE, $this->biz, $queueOptions);
        $body = array('name' => 'example job');
        $job = new ExampleFinishedJob($body);
        $queue->push($job);

        $failer = new JobFailer($this->biz->dao('Queue:FailedJobDao'));

        $options = array(
            'once' => true,
        );

        $worker = new Worker($queue, $failer, $this->createLock(), $this->biz['logger'], $options);
        $worker->runNextJob();

        $this->assertTrue($this->biz['logger.test_handler']->hasInfo('ExampleFinishedJob executed.'));
        $this->assertCount(0, $this->fetchAllFromDatabase($queueOptions['table'], array('queue' => self::TEST_QUEUE)));
    }

    public function testRun_FailedJob()
    {
        $queueOptions = $this->getQueueOptions();
        $queue = new DatabaseQueue(self::TEST_QUEUE, $this->biz, $queueOptions);
        $body = array('name' => 'example job');
        $job = new ExampleFailedJob($body);
        $queue->push($job);

        $failer = new JobFailer($this->biz->dao('Queue:FailedJobDao'));

        $options = array(
            'once' => true,
        );

        $worker = new Worker($queue, $failer, $this->createLock(), $this->biz['logger'], $options);
        $worker->runNextJob();

        $this->assertTrue($this->biz['logger.test_handler']->hasInfo('ExampleFailedJob executed.'));

        $this->assertCount(0, $this->fetchAllFromDatabase($queueOptions['table'], array('queue' => self::TEST_QUEUE)));
        $this->assertCount(1, $this->fetchAllFromDatabase('biz_queue_failed_job', array(
            'queue' => self::TEST_QUEUE,
            'reason' => 'ExampleFailedJob execute failed.',
        )));
    }

    public function testRun_FailedRetryJob()
    {
        $queueOptions = $this->getQueueOptions();
        $queue = new DatabaseQueue(self::TEST_QUEUE, $this->biz, $queueOptions);
        $body = array('name' => 'example job');
        $job = new ExampleFailedRetryJob($body);
        $queue->push($job);

        $failer = new JobFailer($this->biz->dao('Queue:FailedJobDao'));

        $options = array(
            'once' => true,
        );

        $worker = new Worker($queue, $failer, $this->createLock(), $this->biz['logger'], $options);
        $worker->runNextJob();

        $this->assertTrue($this->biz['logger.test_handler']->hasInfo('ExampleFailedRetryJob executed.'));

        $this->assertCount(0, $this->fetchAllFromDatabase($queueOptions['table'], array(
            'queue' => self::TEST_QUEUE,
            'executions' => 1,
            'reserved_time' => 0,
            'expired_time' => 0,
        )));
    }
}


text:
package com.facebook.litho.widget;

import android.view.View;
import androidx.annotation.Nullable;

/**
 * A controller that can be passed as {@link com.facebook.litho.annotations.Prop} to a {@link
 * VerticalScrollSpec} to trigger events from outside the component hierarchy.
 */
public class VerticalScrollEventsController {

  @Nullable private LithoScrollView mScrollView;

  public void setScrollView(@Nullable LithoScrollView scrollView) {
    mScrollView = scrollView;
  }

  public void scrollTo(int y) {
    if (mScrollView != null) {
      mScrollView.scrollTo(mScrollView.getScrollX(), y);
    }
  }

  public void smoothScrollTo(int y) {
    if (mScrollView != null) {
      mScrollView.smoothScrollTo(mScrollView.getScrollX(), y);
    }
  }

  public void scrollToTop() {
    if (mScrollView != null) {
      mScrollView.fullScroll(View.FOCUS_UP);
    }
  }

  public void scrollToBottom() {
    if (mScrollView != null) {
      mScrollView.fullScroll(View.FOCUS_DOWN);
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
require 'net/http'
require 'rexml/document'

# spec data
url = 'https://raw.github.com/Matroska-Org/foundation-source/master/spectool/specdata.xml'

# get the XML data as a string
xml_data = Net::HTTP.get_response(URI.parse(url)).body

# parse it as XML
doc = REXML::Document.new(xml_data)

puts <<'EOF'
#!/usr/bin/ruby

#
# Distributed under the MIT license
# see the file COPYING for details
# or visit http://www.opensource.org/licenses/mit-license.php
#
# \$Id\$
#
# Classes for the "Matroska EBML doc type". Generated with
# gen_classes_from_xml.rb.
#
# Written by Moritz Bunkus <moritz@bunkus.org>.
#

# This file is generated automatically by the
# gen_classes_from_xml.rb script and should not be
# modified manually!

require "ebml"

module Matroska
EOF

classnames = {
  'master' => 'Ebml::Master',
  'uinteger' => 'Ebml::UInteger',
  'integer' => 'Ebml::SInteger',
  'string' => 'Ebml::String',
  'utf-8' => 'Ebml::UnicodeString',
  'binary' => 'Ebml::Binary',
  'float' => 'Ebml::Float',
  'date' => 'Ebml::Date'
}

# extract each element and convert to a class definition
doc.elements.each('table/element') do |ele|
  name = ele.attributes['name'].sub('-', '_')
  type = ele.attributes['type']
  parent = classnames[type]
  id = Integer(ele.attributes['id'])
  length = case when id<=0xFF then 1 when id<=0xFFFF then 2 when id<=0xFFFFFF then 3 else 4 end
  puts <<"EOF"
  class #{name} < #{parent}
    def #{name}.global_id
      @@id ||= Ebml::Id.new(0x#{id.to_s(16)}, #{length})
      return @@id
    end
  end

EOF
end

puts "end"


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

    Copyright (c) 2012 to original author or authors
    All rights reserved. This program and the accompanying materials
    are made available under the terms of the Eclipse Public License v1.0
    which accompanies this distribution, and is available at
    http://www.eclipse.org/legal/epl-v10.html

-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>no_group_id_given</groupId>
  <artifactId>gemfile_with_jars_lock</artifactId>
  <version>0.0.0</version>
  <name>gemfile_with_jars_lock</name>
  <properties>
    <project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
    <jruby.plugins.version>2.0.1</jruby.plugins.version>
    <mavengem.wagon.version>1.0.3</mavengem.wagon.version>
  </properties>
  <repositories>
    <repository>
      <id>mavengems</id>
      <url>mavengem:https://rubygems.org</url>
    </repository>
  </repositories>
  <build>
    <extensions>
      <extension>
        <groupId>org.torquebox.mojo</groupId>
        <artifactId>mavengem-wagon</artifactId>
        <version>${mavengem.wagon.version}</version>
      </extension>
    </extensions>
    <directory>${basedir}/pkg</directory>
    <plugins>
      <plugin>
        <groupId>de.saumya.mojo</groupId>
        <artifactId>gem-maven-plugin</artifactId>
        <version>${jruby.plugins.version}</version>
        <executions>
          <execution>
            <id>install gems</id>
            <goals>
              <goal>initialize</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>Jars.lock</id>
      <activation>
        <file>
          <exists>Jars.lock</exists>
        </file>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.bouncycastle</groupId>
          <artifactId>bcpkix-jdk15on</artifactId>
          <version>1.50</version>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>org.bouncycastle</groupId>
          <artifactId>bcprov-jdk15on</artifactId>
          <version>1.50</version>
          <scope>compile</scope>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
</project>


text:
import           Spec       (spec)
import           Test.Hspec (hspec)

import           Universum

main :: IO ()
main = hspec spec


text:
import { Contracts, TelemetryClient } from 'applicationinsights';
import * as assert from 'assert';
import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppender';

class AppInsightsMock extends TelemetryClient {
	public override config: any;
	public override channel: any;
	public events: Contracts.EventTelemetry[] = [];
	public IsTrackingPageView: boolean = false;
	public exceptions: any[] = [];

	constructor() {
		super('testKey');
	}

	public override trackEvent(event: any) {
		this.events.push(event);
	}

	public override flush(options: any): void {
		// called on dispose
	}
}

suite('AIAdapter', () => {
	let appInsightsMock: AppInsightsMock;
	let adapter: AppInsightsAppender;
	let prefix = 'prefix';

	setup(() => {
		appInsightsMock = new AppInsightsMock();
		adapter = new AppInsightsAppender(prefix, undefined!, () => appInsightsMock);
	});

	teardown(() => {
		adapter.flush();
	});

	test('Simple event', () => {
		adapter.log('testEvent');

		assert.strictEqual(appInsightsMock.events.length, 1);
		assert.strictEqual(appInsightsMock.events[0].name, `${prefix}/testEvent`);
	});

	test('addional data', () => {
		adapter = new AppInsightsAppender(prefix, { first: '1st', second: 2, third: true }, () => appInsightsMock);
		adapter.log('testEvent');

		assert.strictEqual(appInsightsMock.events.length, 1);
		let [first] = appInsightsMock.events;
		assert.strictEqual(first.name, `${prefix}/testEvent`);
		assert.strictEqual(first.properties!['first'], '1st');
		assert.strictEqual(first.measurements!['second'], 2);
		assert.strictEqual(first.measurements!['third'], 1);
	});

	test('property limits', () => {
		let reallyLongPropertyName = 'abcdefghijklmnopqrstuvwxyz';
		for (let i = 0; i < 6; i++) {
			reallyLongPropertyName += 'abcdefghijklmnopqrstuvwxyz';
		}
		assert(reallyLongPropertyName.length > 150);

		let reallyLongPropertyValue = 'abcdefghijklmnopqrstuvwxyz012345678901234567890123';
		for (let i = 0; i < 21; i++) {
			reallyLongPropertyValue += 'abcdefghijklmnopqrstuvwxyz012345678901234567890123';
		}
		assert(reallyLongPropertyValue.length > 1024);

		let data = Object.create(null);
		data[reallyLongPropertyName] = '1234';
		data['reallyLongPropertyValue'] = reallyLongPropertyValue;
		adapter.log('testEvent', data);

		assert.strictEqual(appInsightsMock.events.length, 1);

		for (let prop in appInsightsMock.events[0].properties!) {
			assert(prop.length < 150);
			assert(appInsightsMock.events[0].properties![prop].length < 1024);
		}
	});

	test('Different data types', () => {
		let date = new Date();
		adapter.log('testEvent', { favoriteDate: date, likeRed: false, likeBlue: true, favoriteNumber: 1, favoriteColor: 'blue', favoriteCars: ['bmw', 'audi', 'ford'] });

		assert.strictEqual(appInsightsMock.events.length, 1);
		assert.strictEqual(appInsightsMock.events[0].name, `${prefix}/testEvent`);
		assert.strictEqual(appInsightsMock.events[0].properties!['favoriteColor'], 'blue');
		assert.strictEqual(appInsightsMock.events[0].measurements!['likeRed'], 0);
		assert.strictEqual(appInsightsMock.events[0].measurements!['likeBlue'], 1);
		assert.strictEqual(appInsightsMock.events[0].properties!['favoriteDate'], date.toISOString());
		assert.strictEqual(appInsightsMock.events[0].properties!['favoriteCars'], JSON.stringify(['bmw', 'audi', 'ford']));
		assert.strictEqual(appInsightsMock.events[0].measurements!['favoriteNumber'], 1);
	});

	test('Nested data', () => {
		adapter.log('testEvent', {
			window: {
				title: 'some title',
				measurements: {
					width: 100,
					height: 200
				}
			},
			nestedObj: {
				nestedObj2: {
					nestedObj3: {
						testProperty: 'test',
					}
				},
				testMeasurement: 1
			}
		});

		assert.strictEqual(appInsightsMock.events.length, 1);
		assert.strictEqual(appInsightsMock.events[0].name, `${prefix}/testEvent`);

		assert.strictEqual(appInsightsMock.events[0].properties!['window.title'], 'some title');
		assert.strictEqual(appInsightsMock.events[0].measurements!['window.measurements.width'], 100);
		assert.strictEqual(appInsightsMock.events[0].measurements!['window.measurements.height'], 200);

		assert.strictEqual(appInsightsMock.events[0].properties!['nestedObj.nestedObj2.nestedObj3'], JSON.stringify({ 'testProperty': 'test' }));
		assert.strictEqual(appInsightsMock.events[0].measurements!['nestedObj.testMeasurement'], 1);
	});

});


text:
import reqAnimationFrame from './request-animation-frame';

/**
 * Create a function which will be called at the next requestAnimationFrame
 * cycle
 *
 * @param {function} func The function to call
 *
 * @return {func} The function wrapped within a requestAnimationFrame
 */
export default function frame(func) {
    return (...args) => reqAnimationFrame(() => func(...args));
}


text:
set -eu

if [[ -z "${NCPU+x}" ]]; then
  # Mac doesn't have nproc. Run the equivalent.
  if [[ "$OSTYPE" == "darwin"* ]]; then
    NCPU=$(sysctl -n hw.physicalcpu)
  else
    NCPU=$(nproc)
  fi
  export NCPU
fi

if [[ -z "${PROJECT_ROOT+x}" ]]; then
  PROJECT_ROOT="$(cd "$(dirname "$0")/../../.."; pwd)"
  readonly PROJECT_ROOT
fi

echo "================================================================"
echo "Change working directory to project root $(date)."
cd "${PROJECT_ROOT}"

echo "================================================================"
echo "Building with ${NCPU} cores $(date) on ${PWD}."

if [[ -n "${PROJECT_ID:-}" ]]; then
  DOCKER_IMAGE_PREFIX="gcr.io/${PROJECT_ID}/gapic-generator"
else
  # We want a prefix that works when running interactively, so it must be a
  # (syntactically) valid project id, this works.
  DOCKER_IMAGE_PREFIX="gcr.io/cloud-cpp-reserved/gapic-generator"
fi
readonly DOCKER_IMAGE_PREFIX

# First build the Docker image
readonly IMAGE="${DOCKER_IMAGE_PREFIX}/e2e-ubuntu-18.04"

build_flags=(
  "-t" "${IMAGE}"
  "--build-arg" "NCPU=${NCPU}"
  "-f" "${PROJECT_ROOT}/ci/kokoro/docker/e2e/Dockerfile"
)

echo "================================================================"
echo "Building a Docker image $(date)."

docker build "${build_flags[@]}" .

if [[ -n "${GOOGLE_APPLICATION_CREDENTIALS:-}" \
  && -n "${GOOGLE_CLOUD_PROJECT:-}" ]]; then
  echo "================================================================"
  echo "Executing the binary $(date)."
  # Run the binary
  docker run --rm \
    -v "${GOOGLE_APPLICATION_CREDENTIALS}:/credentials.json" \
    -e "GOOGLE_APPLICATION_CREDENTIALS=/credentials.json" \
    -e "GOOGLE_CLOUD_PROJECT=${GOOGLE_CLOUD_PROJECT}" \
    "${IMAGE}" \
    bash -c "cd /build/gapic-generator-cpp/ci/kokoro/docker/e2e && cmake-out/gapic-generator-e2e"
else
  echo "================================================================"
  echo -n "Set GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_CLOUD_PROJECT"
  echo " environment variables to run the binary."
  echo "Skip executing binary $(date)."
fi


text:
//
// Copyright 2022 Google LLC
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
//

using Google.Solutions.LicenseTracker.Adapters;
using Google.Solutions.LicenseTracker.Data.History;
using Google.Solutions.LicenseTracker.Data.Locator;
using Google.Solutions.LicenseTracker.Data.Services.Adapters;
using Google.Solutions.LicenseTracker.Services;
using Google.Solutions.LicenseTracker.Util;
using Microsoft.Extensions.Logging.Abstractions;
using Moq;
using NUnit.Framework;

namespace Google.Solutions.LicenseTracker.Test.Services
{
    [TestFixture]
    public class TestInstanceHistoryService
    {
        //---------------------------------------------------------------------
        // BuildInstanceSetHistoryAsync.
        //---------------------------------------------------------------------

        [Test]
        public async Task WhenProjectInaccessible_ThenProjectIsIgnored()
        {
            var computeEngineAdapter = new Mock<IComputeEngineAdapter>();
            computeEngineAdapter
                .Setup(a => a.ListNodesAsync(
                    It.IsAny<ProjectLocator>(),
                    It.IsAny<CancellationToken>()))
                .ThrowsAsync(new ResourceAccessDeniedException("test", new Exception()));

            var auditLogAdapter = new Mock<IAuditLogAdapter>();

            var service = new InstanceHistoryService(
                auditLogAdapter.Object,
                computeEngineAdapter.Object,
                new NullLogger<InstanceHistoryService>());

            await service.BuildInstanceSetHistoryAsync(
                new[] { new ProjectLocator("project-1") },
                DateTime.UtcNow,
                30,
                CancellationToken.None);

            auditLogAdapter.Verify(
                a => a.ProcessInstanceEventsAsync(
                    It.Is<IEnumerable<ProjectLocator>>(loc => loc.Any()),
                    It.IsAny<DateTime>(),
                    It.IsAny<IEventProcessor>(),
                    It.IsAny<CancellationToken>()), Times.Once);
        }
    }
}


text:
package com.github.elazarl.multireducers.example;

import com.github.elazarl.multireducers.MultiJob;
import com.github.elazarl.multireducers.MultiOutputFormat;
import com.google.common.collect.ImmutableSet;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.FileContext;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

/**
 * ExampleRunner runs both examples on a sample input file.
 */
public class ExampleRunner extends Configured implements Tool {

    public static class IntWritableInRange extends IntWritable {
        private ImmutableSet<Integer> s = ImmutableSet.of(120
                ,130
                ,180
                ,190
                ,130);
        @Override
        public void readFields(DataInput in) throws IOException {
            super.readFields(in);
            verify();
        }

        private void verify() {
            if (!s.contains(get())) throw new RuntimeException("Illegal number: " + get());
        }

        @Override
        public void write(DataOutput out) throws IOException {
            verify();
            super.write(out);
        }
    }

    @Override
    public int run(String[] args) throws Exception {
        Job job = new Job(getConf(), "ExampleMultiRunner");
        int numReduceTasks = job.getNumReduceTasks();
        String outputBaseDir = args[1];
        MultiJob.createWithId("first").
                withMapper(SelectFirstField.class, Text.class, IntWritable.class).
                withReducer(CountFirstField.class, numReduceTasks).
                withCombiner(CountFirstField.class).
                withOutputFormat(TextOutputFormat.class, Text.class, IntWritable.class,
                        MultiOutputFormat.outputPath(outputBaseDir + "/first")).
                addTo(job);
        MultiJob.create().withMapper(SelectFirstFieldWithPrefix.class, Text.class, IntWritable.class).
                redirectReducerTo("first").
                addTo(job);
        MultiJob.create().
                withMapper(SelectSecondField.class, IntWritableInRange.class, IntWritable.class).
                withReducer(CountSecondField.class, numReduceTasks).
                withCombiner(CountSecondField.class).
                withOutputFormat(TextOutputFormat.class, Text.class, IntWritable.class,
                        MultiOutputFormat.outputPath(outputBaseDir + "/second")).
                addTo(job);
        job.setInputFormatClass(TextInputFormat.class);
        FileInputFormat.addInputPath(job, new Path(args[0]));
        FileContext fc = FileContext.getFileContext(getConf());
        fc.mkdir(new Path(outputBaseDir), FsPermission.getDefault(), true);
        return job.waitForCompletion(true) ? 0 : 1;
    }

    public static void main(String[] args) throws Exception {
        int exitCode = ToolRunner.run(new ExampleRunner(), args);
        System.exit(exitCode);
    }
}


text:
import copy

import pytest

import numpy as np

from astropy.constants import Constant
from astropy.units import Quantity as Q

def test_c():

    from astropy.constants.codata2010 import c

    # c is an exactly defined constant, so it shouldn't be changing
    assert c.value == 2.99792458e8  # default is S.I.
    assert c.si.value == 2.99792458e8
    assert c.cgs.value == 2.99792458e10

    # make sure it has the necessary attributes and they're not blank
    assert c.uncertainty == 0  # c is a *defined* quantity
    assert c.name
    assert c.reference
    assert c.unit

def test_h():

    from astropy.constants import h as h_current
    from astropy.constants.codata2010 import h

    # check that the value is the CODATA2010 value
    assert abs(h.value - 6.62606957e-34) < 1e-43
    assert abs(h.si.value - 6.62606957e-34) < 1e-43
    assert abs(h.cgs.value - 6.62606957e-27) < 1e-36

    # Check it is different than the current value
    assert abs(h.value - h_current.value) > 4e-42

    # make sure it has the necessary attributes and they're not blank
    assert h.uncertainty
    assert h.name
    assert h.reference
    assert h.unit

def test_e():

    from astropy.constants.astropyconst13 import e as e_13

    # A test quantity
    E = Q(100.00000348276221, 'V/m')

    # e.cgs is too ambiguous and should not work at all
    with pytest.raises(TypeError):
        e_13.cgs * E

    assert isinstance(e_13.si, Q)
    assert isinstance(e_13.gauss, Q)
    assert isinstance(e_13.esu, Q)

    assert e_13.gauss * E == Q(e_13.gauss.value * E.value, 'Fr V/m')
    assert e_13.esu * E == Q(e_13.esu.value * E.value, 'Fr V/m')

def test_g0():
    """Tests for #1263 demonstrating how g0 constant should behave."""
    from astropy.constants.astropyconst13 import g0

    # g0 is an exactly defined constant, so it shouldn't be changing
    assert g0.value == 9.80665  # default is S.I.
    assert g0.si.value == 9.80665
    assert g0.cgs.value == 9.80665e2

    # make sure it has the necessary attributes and they're not blank
    assert g0.uncertainty == 0  # g0 is a *defined* quantity
    assert g0.name
    assert g0.reference
    assert g0.unit

    # Check that its unit have the correct physical type
    assert g0.unit.physical_type == 'acceleration'

def test_b_wien():
    """b_wien should give the correct peak wavelength for
    given blackbody temperature. The Sun is used in this test.

    """
    from astropy import units as u
    from astropy.constants.astropyconst13 import b_wien
    t = 5778 * u.K
    w = (b_wien / t).to(u.nm)
    assert round(w.value) == 502

def test_pc():
    """Parsec is defined to use small-angle limit per IAU 2015 Resolution B 2.
    iau2012 version still uses tan(parallax).
    """
    from astropy import units as u
    from astropy.constants import iau2012
    plx = np.radians(1 / 3600)
    assert np.allclose(u.pc.to('m') / iau2012.pc.si.value, np.tan(plx) / plx, rtol=1.e-14, atol=0)

def test_masses():
    """Ensure mass values are set up correctly.
    https://github.com/astropy/astropy/issues/8920
    """
    from astropy.constants import astropyconst13, astropyconst20, astropyconst40

    ref_text = "Allen's Astrophysical Quantities 4th Ed."
    assert (astropyconst13.M_sun.reference == ref_text and
            astropyconst13.M_jup.reference == ref_text and
            astropyconst13.M_earth.reference == ref_text)

    ref_text = "IAU 2015 Resolution B 3 + CODATA 2014"
    assert (astropyconst20.M_sun.reference == ref_text and
            astropyconst20.M_jup.reference == ref_text and
            astropyconst20.M_earth.reference == ref_text)

    ref_text = "IAU 2015 Resolution B 3 + CODATA 2018"
    assert (astropyconst40.M_sun.reference == ref_text and
            astropyconst40.M_jup.reference == ref_text and
            astropyconst40.M_earth.reference == ref_text)

def test_unit():

    from astropy import units as u
    from astropy.constants import astropyconst13 as const

    for key, val in vars(const).items():
        if isinstance(val, Constant):
            # Getting the unit forces the unit parser to run.  Confirm
            # that none of the constants defined in astropy have
            # invalid unit.
            assert not isinstance(val.unit, u.UnrecognizedUnit)

def test_copy():
    from astropy import constants as const
    cc = copy.deepcopy(const.c)
    assert cc == const.c

    cc = copy.copy(const.c)
    assert cc == const.c

def test_view():
    """Check that Constant and Quantity views can be taken (#3537, #3538)."""
    from astropy.constants import c
    c2 = c.view(Constant)
    assert c2 == c
    assert c2.value == c.value
    # make sure it has the necessary attributes and they're not blank
    assert c2.uncertainty == 0  # c is a *defined* quantity
    assert c2.name == c.name
    assert c2.reference == c.reference
    assert c2.unit == c.unit

    q1 = c.view(Q)
    assert q1 == c
    assert q1.value == c.value
    assert type(q1) is Q
    assert not hasattr(q1, 'reference')

    q2 = Q(c)
    assert q2 == c
    assert q2.value == c.value
    assert type(q2) is Q
    assert not hasattr(q2, 'reference')

    c3 = Q(c, subok=True)
    assert c3 == c
    assert c3.value == c.value
    # make sure it has the necessary attributes and they're not blank
    assert c3.uncertainty == 0  # c is a *defined* quantity
    assert c3.name == c.name
    assert c3.reference == c.reference
    assert c3.unit == c.unit

    c4 = Q(c, subok=True, copy=False)
    assert c4 is c


text:
/*	$NetBSD: citrus_esdb.h,v 1.1 2003/06/25 09:51:32 tshiozak Exp $	*/

/*-
 * Copyright (c)2003 Citrus Project,
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#ifndef _CITRUS_ESDB_H_
#define _CITRUS_ESDB_H_

struct _citrus_esdb_charset {
	_citrus_csid_t			ec_csid;
	char				*ec_csname;
};

struct _citrus_esdb {
	char				*db_encname;
	void				*db_variable;
	size_t				db_len_variable;
	int				db_num_charsets;
	struct	_citrus_esdb_charset	*db_charsets;
	int				db_use_invalid;
	_citrus_wc_t			db_invalid;
};

__BEGIN_DECLS
const char	*_citrus_esdb_alias(const char *, char *, size_t);
int		_citrus_esdb_open(struct _citrus_esdb *, const char *);
void		_citrus_esdb_close(struct _citrus_esdb *);
void		_citrus_esdb_free_list(char **, size_t);
int		_citrus_esdb_get_list(char ***, size_t *);
__END_DECLS

#endif


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.fax4j.spi.http (fax4j 0.45.0 API)</title>
<meta name="date" content="2020-05-15">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

org.fax4j.spi.http

Interfaces

FaxJob2HTTPRequestConverter

HTTPClient

HTTPClientConfiguration

HTTPResponseHandler

Classes

AbstractFaxJob2HTTPRequestConverter

AbstractHTTPClient

AbstractHTTPResponseHandler

AbstractMappingHTTPResponseHandler

AbstractMultiPart2JSONHTTPFaxClientSpi

ApacheHTTPClient

CommonHTTPClientConfiguration

EmptyHTTPResponseHandler

HTTPFaxClientSpi

HTTPRequest

HTTPRequest.ContentPart

HTTPResponse

JSONHTTPResponseHandler

MultiPartFaxJob2HTTPRequestConverter

TemplateFaxJob2HTTPRequestConverter

XMLHTTPResponseHandler

Enums

CommonHTTPClientConfiguration.HTTPClientConfigurationConstants

HTTPClient.HTTPMethod

HTTPFaxClientSpi.FaxClientSpiConfigurationConstants

HTTPRequest.ContentPartType

HTTPRequest.ContentType

JSONHTTPResponseHandler.JSONHTTPResponseHandlerConfigurationConstants

MultiPartFaxJob2HTTPRequestConverter.FaxJob2HTTPRequestConverterConfigurationConstants

TemplateFaxJob2HTTPRequestConverter.FaxJob2HTTPRequestConverterConfigurationConstants

XMLHTTPResponseHandler.XMLHTTPResponseHandlerConfigurationConstants


text:
package com.zhuohua.teacher.service;

import com.zhuohua.teacher.model.CommentsTeacherToStudent;

public interface CommentsTeacherToStudentService {

	public boolean save(CommentsTeacherToStudent commentsTeacherToStudent);
}


text:
//
//  GTLGmailMessagePartBody.m
//

// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
//   Gmail API (gmail/v1)
// Description:
//   The Gmail REST API.
// Documentation:
//   https://developers.google.com/gmail/api/
// Classes:
//   GTLGmailMessagePartBody (0 custom class methods, 3 custom properties)

#import "GTLGmailMessagePartBody.h"

// ----------------------------------------------------------------------------
//
//   GTLGmailMessagePartBody
//

@implementation GTLGmailMessagePartBody
@dynamic attachmentId, data, size;
@end


text:
import './global_init';
import assert from 'assert';

describe('tests', () => {
  it('asserts a thing', () => {
    assert.ok(true);
  });
});


text:
import sys

from sdcclient import SdcClient

#
# Parse arguments
#
if len(sys.argv) != 4:
    print(('usage: %s <sysdig-token> team-prefix user-name' % sys.argv[0]))
    print('You can find your token at https://app.sysdigcloud.com/#/settings/user')
    sys.exit(1)

sdc_token = sys.argv[1]

#
# Instantiate the SDC client
#
sdclient = SdcClient(sdc_token, sdc_url='https://app.sysdigcloud.com')

team_prefix = sys.argv[2]

user_email_parts = sys.argv[3].split('@')
user_email_prefix = user_email_parts[0]
user_email_domain = user_email_parts[1]

#
# Create test users
#
# All users initially are part of default team.
#

admin = user_email_prefix + '+team_mgmt-admin' + '@' + user_email_domain
userA = user_email_prefix + '+team_mgmt-a' + '@' + user_email_domain
userB = user_email_prefix + '+team_mgmt-b' + '@' + user_email_domain

teamA = team_prefix + 'A'
teamB = team_prefix + 'B'

print('Creating test users...')

try:
    ok, res = sdclient.create_user_invite(admin, first_name='TestUser', last_name='Admin', system_role='ROLE_CUSTOMER')
    if not ok:
        print(('-- User creation failed:', res, '. Exiting.'))
        sys.exit(1)
    else:
        print(('-- User \'', admin, '\' created successfully.'))

    ok, res = sdclient.create_user_invite(userA, first_name='TestUser', last_name='Alpha')
    if not ok:
        print(('-- User creation failed:', res, '. Exiting.'))
        sys.exit(1)
    else:
        print(('-- User \'', userA, '\' created successfully.'))

    ok, res = sdclient.create_user_invite(userB, first_name='TestUser', last_name='Beta')
    if not ok:
        print(('-- User creation failed:', res, '. Exiting.'))
        sys.exit(1)
    else:
        print(('-- User \'', userB, '\' created successfully.'))

    #
    # Create test teams
    #
    # Possible failures on Team creation might include having reached the
    # max limit on Teams for this customer account or if the Team by that
    # name already exists. Since a previous successful run of this test
    # would have deleted the Team by the same name, and we need to be able
    # to configure Teams for this test to pass, we'll treat both types of
    # error as a genuine fail of the test.
    #

    print('Creating test teams...')

    ok, res = sdclient.create_team(teamA)
    if not ok:
        print(('-- Team creation failed:', res, '. Exiting.'))
        sys.exit(1)
    else:
        print(('-- Team \'', teamA, '\' created successfully.'))

    ok, res = sdclient.create_team(teamB)
    if not ok:
        print(('-- Team creation failed:', res, '. Exiting.'))
        sys.exit(1)
    else:
        print(('-- Team \'', teamB, '\' created successfully.'))

    #
    # Membership manipulation
    #
    # Admins are part of all teams and their membership cannot be edited.
    #

    print('Membership manipulation...')

    ok, res = sdclient.list_memberships(teamA)
    if not ok:
        print(('-- Unable to fetch team memberships:', res, '. Exiting.'))
        sys.exit(1)
    elif admin not in list(res.keys()):
        print(('-- Admin should  be part of all teams!', 'Exiting.'))
        sys.exit(1)
    elif userA in list(res.keys()) or userB in list(res.keys()):
        print(('-- Users ', userA, ' and ', userB, ' should not be part of team ', teamA, '!', 'Exiting.'))
        sys.exit(1)

    ok, res = sdclient.list_memberships(teamB)
    if not ok:
        print(('-- Unable to fetch team memberships:', res, '. Exiting.'))
        sys.exit(1)
    elif admin not in list(res.keys()):
        print(('-- Admin should  be part of all teams!', 'Exiting.'))
        sys.exit(1)
    elif userA in list(res.keys()) or userB in list(res.keys()):
        print(('-- Users ', userA, ' and ', userB, ' should not be part of team ', teamB, '!', 'Exiting.'))
        sys.exit(1)

    #
    # Create team memberships
    #

    print('-- Create team memberships')

    # Manipulate with teamA

    ok, res = sdclient.save_memberships(teamA, {userA: 'ROLE_TEAM_EDIT'})
    if not ok:
        print(('-- Unable to add ', userA, ' to ', teamA, ' due to: ', res, '. Exiting.'))
        sys.exit(1)

    ok, res = sdclient.list_memberships(teamA)
    if not ok:
        print(('-- Unable to fetch team memberships:', res, '. Exiting.'))
        sys.exit(1)
    elif userA not in list(res.keys()) or admin not in list(res.keys()):
        print(('-- Users ', userA, ' and ', admin, ' should be part of team ', teamA, '!', 'Exiting.'))
        sys.exit(1)

    # Manipulate with teamB

    ok, res = sdclient.save_memberships(teamB, {userA: 'ROLE_TEAM_MANAGER', userB: 'ROLE_TEAM_READ'})
    if not ok:
        print(('-- Unable to add ', userA, ' and ', userB, ' to ', teamB, ' due to: ', res, '. Exiting.'))
        sys.exit(1)

    ok, res = sdclient.list_memberships(teamB)
    if not ok:
        print(('-- Unable to fetch team memberships:', res, '. Exiting.'))
        sys.exit(1)
    elif userA not in list(res.keys()) or userB not in list(res.keys()) or admin not in list(res.keys()):
        print(('-- Users ', userA, ', ', userB, ' and ', admin, ' should be part of team ', teamB, '!', 'Exiting.'))
        sys.exit(1)

    # Update team memberships

    print('-- Update team memberships')

    # Add new or update existing memberships
    ok, res = sdclient.save_memberships(teamA, {userA: 'ROLE_TEAM_READ', userB: 'ROLE_TEAM_EDIT'})
    if not ok:
        print(('-- Unable to modify membership for ', userA, ' and to add ', userB, ' to ', teamA, ' due to: ', res,
               '. Exiting.'))
        sys.exit(1)

    ok, res = sdclient.list_memberships(teamA)
    if not ok:
        print(('-- Unable to fetch team memberships:', res, '. Exiting.'))
        sys.exit(1)
    elif userA not in list(res.keys()) or userB not in list(res.keys()) or admin not in list(res.keys()):
        print(('-- Users ', userA, ', ', userB, ' and ', admin, ' should be part of team ', teamA, '!', 'Exiting.'))
        sys.exit(1)
    elif res[userA] != 'ROLE_TEAM_READ' or res[userB] != 'ROLE_TEAM_EDIT':
        print(('-- Users ', userA, ' and ', userB, ' should have appropriate roles assigned for team ', teamA, '!',
               'Exiting.'))
        sys.exit(1)

    # Remove team memberships

    print('-- Remove team memberships')

    ok, res = sdclient.remove_memberships(teamA, [userB])
    if not ok:
        print(('-- Unable to remove membership for ', userB, ' from team', teamA, ' due to: ', res, '. Exiting.'))
        sys.exit(1)

    ok, res = sdclient.list_memberships(teamA)
    if not ok:
        print(('-- Unable to fetch team memberships:', res, '. Exiting.'))
        sys.exit(1)
    elif userB in list(res.keys()):
        print(('-- User ', userB, ' should not be part of team ', teamA, '!', 'Exiting.'))
        sys.exit(1)

    # Admin user cannot be removed from any team
    ok, res = sdclient.remove_memberships(teamB, [admin, userA])
    if not ok:
        print(('-- Unable to remove membership for ', userB, ' from team', teamA, ' due to: ', res, '. Exiting.'))
        sys.exit(1)

    ok, res = sdclient.list_memberships(teamB)
    if not ok:
        print(('-- Unable to fetch team memberships:', res, '. Exiting.'))
        sys.exit(1)
    elif userA in list(res.keys()):
        print(('-- User ', userA, ' should not be part of team ', teamB, '!', 'Exiting.'))
        sys.exit(1)
    elif admin not in list(res.keys()):
        print(('-- User ', admin, ' should be always part of all teams!', 'Exiting.'))
        sys.exit(1)

finally:
    #
    # Clean-up
    #
    print('Cleaning up...')

    print('-- Deleting test teams.')

    try:
        ok, res = sdclient.delete_team(teamA)
        if not ok:
            print(('-- Team \'', teamA, '\' deletion failed: ', res))
    except Exception as exception:
        print(('-- Team \'', teamA, '\' deletion failed: ', exception))

    try:
        ok, res = sdclient.delete_team(teamB)
        if not ok:
            print(('-- Team \'', teamB, '\' deletion failed: ', res))
    except Exception as exception:
        print(('-- Team \'', teamB, '\' deletion failed: ', exception))

    print('-- Deleting test users.')

    try:
        ok, res = sdclient.delete_user(admin)
        if not ok:
            print(('-- User \'', admin, '\' deletion failed: ', res))
    except Exception as exception:
        print(('-- User \'', admin, '\' deletion failed: ', exception))

    try:
        ok, res = sdclient.delete_user(userA)
        if not ok:
            print(('-- User \'', userA, '\' deletion failed: ', res))
    except Exception as exception:
        print(('-- User \'', userA, '\' deletion failed: ', exception))

    try:
        ok, res = sdclient.delete_user(userB)
        if not ok:
            print(('-- User \'', userB, '\' deletion failed: ', res))
    except Exception as exception:
        print(('-- User \'', userB, '\' deletion failed: ', exception))

print('All done successfully!!!')

sys.exit(0)


text:
package Thoughtful;

/**
 * A POJO containing a line (String) and a few formatting flags (booleans).
 * @author Owen Jow
 */
public class TextBundle {
    String text;
    boolean centered, scroll;

    /**
     * Constructs a TextBundle, acting under the assumption
     * that there are no special formatting options to be set.
     */
    public TextBundle(String text) {
        this.text = text;
    }

    public TextBundle(String text, boolean centered, boolean scroll) {
        this.text = text;
        this.centered = centered;
        this.scroll = scroll;
    }
}


text:
'use strict';

const os = require('os'),
    Promise = require('bluebird'),
    fs = Promise.promisifyAll(require('fs-extra'));

class FileSystem {

    /**
     * @returns {Promise}
     */
    static isDirectory(path) {
        return fs.statAsync(path)
            .then(stat => new Promise(fulfill => {
                if (stat.isDirectory()) fulfill(stat);
            }));
    }

    /**
     * @returns {Promise}
     */
    static isFile(path) {
        return fs.statAsync(path)
            .then(stat => new Promise(fulfill => {
                if (stat.isFile()) fulfill(stat);
            }));
    }

    /**
     * @returns {Promise}
     */
    static copy(src, dest) {
        return fs.copyAsync(src, dest);
    }

    static readSync(file) {
        return fs.readFileSync(file, 'utf8');
    }

    static tmpdir() {
        return os.tmpdir();
    }
}

module.exports = FileSystem;


text:
package org.opencb.opencga.storage.mongodb.variant;

import org.apache.log4j.Level;
import org.opencb.commons.datastore.core.ObjectMap;
import org.opencb.commons.datastore.core.QueryOptions;
import org.opencb.commons.datastore.mongodb.MongoDataStoreManager;
import org.opencb.opencga.core.auth.IllegalOpenCGACredentialsException;
import org.opencb.opencga.core.common.MemoryUsageMonitor;
import org.opencb.opencga.storage.core.StorageETL;
import org.opencb.opencga.storage.core.StorageETLResult;
import org.opencb.opencga.storage.core.config.DatabaseCredentials;
import org.opencb.opencga.storage.core.exceptions.StorageETLException;
import org.opencb.opencga.storage.core.exceptions.StorageManagerException;
import org.opencb.opencga.storage.core.variant.FileStudyConfigurationManager;
import org.opencb.opencga.storage.core.variant.StudyConfigurationManager;
import org.opencb.opencga.storage.core.variant.VariantStorageManager;
import org.opencb.opencga.storage.mongodb.utils.MongoCredentials;

import java.net.URI;
import java.net.UnknownHostException;
import java.util.*;

import static org.opencb.opencga.storage.mongodb.variant.MongoDBVariantStorageManager.MongoDBVariantOptions.*;

/**
 * Created by imedina on 13/08/14.
 */
public class MongoDBVariantStorageManager extends VariantStorageManager {

    /*
     * This field defaultValue must be the same that the one at storage-configuration.yml
     */
    public static final String STORAGE_ENGINE_ID = "mongodb";

    // Connection to MongoDB.
    private MongoDataStoreManager mongoDataStoreManager = null;

    public enum MongoDBVariantOptions {
        COLLECTION_VARIANTS("collection.variants", "variants"),
        COLLECTION_FILES("collection.files", "files"),
        COLLECTION_STUDIES("collection.studies",  "studies"),
        COLLECTION_STAGE("collection.stage",  "stage"),
        BULK_SIZE("bulkSize",  100),
        DEFAULT_GENOTYPE("defaultGenotype", Arrays.asList("0/0", "0|0")),
        ALREADY_LOADED_VARIANTS("alreadyLoadedVariants", 0),
        STAGE("stage", false),
        STAGE_RESUME("stage.resume", false),
        MERGE("merge", false),
        MERGE_SKIP("merge.skip", false), // Internal use only
        MERGE_RESUME("merge.resume", false);

        private final String key;
        private final Object value;

        MongoDBVariantOptions(String key, Object value) {
            this.key = key;
            this.value = value;
        }

        public String key() {
            return key;
        }

        @SuppressWarnings("unchecked")
        public <T> T defaultValue() {
            return (T) value;
        }
    }

    public MongoDBVariantStorageManager() {
        //Disable MongoDB useless logging
        org.apache.log4j.Logger.getLogger("org.mongodb.driver.cluster").setLevel(Level.WARN);
        org.apache.log4j.Logger.getLogger("org.mongodb.driver.connection").setLevel(Level.WARN);
    }

    @Override
    public void testConnection() throws StorageManagerException {
        ObjectMap options = configuration.getStorageEngine(STORAGE_ENGINE_ID).getVariant().getOptions();
        String dbName = options.getString(VariantStorageManager.Options.DB_NAME.key());
        MongoCredentials credentials = getMongoCredentials(dbName);

        if (!credentials.check()) {
            logger.error("Connection to database '{}' failed", dbName);
            throw new StorageManagerException("Database connection test failed");
        }
    }

    @Override
    public MongoDBVariantStorageETL newStorageETL(boolean connected) throws StorageManagerException {
        VariantMongoDBAdaptor dbAdaptor = connected ? getDBAdaptor(null) : null;
        return new MongoDBVariantStorageETL(configuration, STORAGE_ENGINE_ID, dbAdaptor);
    }

    @Override
    public void dropFile(String study, int fileId) throws StorageManagerException {
        ObjectMap options = new ObjectMap(configuration.getStorageEngine(STORAGE_ENGINE_ID).getVariant().getOptions());
        getDBAdaptor().deleteFile(study, Integer.toString(fileId), new QueryOptions(options));
    }

    @Override
    public void dropStudy(String studyName) throws StorageManagerException {
        ObjectMap options = new ObjectMap(configuration.getStorageEngine(STORAGE_ENGINE_ID).getVariant().getOptions());
        getDBAdaptor().deleteStudy(studyName, new QueryOptions(options));
    }

    @Override
    public VariantMongoDBAdaptor getDBAdaptor() throws StorageManagerException {
        return getDBAdaptor(null);
    }

    @Override
    public List<StorageETLResult> index(List<URI> inputFiles, URI outdirUri, boolean doExtract, boolean doTransform, boolean doLoad)
            throws StorageManagerException {

        Map<URI, MongoDBVariantStorageETL> storageETLMap = new LinkedHashMap<>();
        Map<URI, StorageETLResult> resultsMap = new LinkedHashMap<>();
        LinkedList<StorageETLResult> results = new LinkedList<>();

        MemoryUsageMonitor monitor = new MemoryUsageMonitor();
        monitor.setDelay(5000);
//        monitor.start();
        try {
            for (URI inputFile : inputFiles) {
                StorageETLResult storageETLResult = new StorageETLResult(inputFile);
                MongoDBVariantStorageETL storageETL = newStorageETL(doLoad);
                storageETL.getOptions().append(VariantStorageManager.Options.ISOLATE_FILE_FROM_STUDY_CONFIGURATION.key(), true);
                storageETLMap.put(inputFile, storageETL);
                resultsMap.put(inputFile, storageETLResult);
                results.add(storageETLResult);
            }

            if (doExtract) {
                for (Map.Entry<URI, MongoDBVariantStorageETL> entry : storageETLMap.entrySet()) {
                    URI uri = entry.getValue().extract(entry.getKey(), outdirUri);
                    resultsMap.get(entry.getKey()).setExtractResult(uri);
                }
            }

            if (doTransform) {
                for (Map.Entry<URI, MongoDBVariantStorageETL> entry : storageETLMap.entrySet()) {
                    StorageETLResult etlResult = resultsMap.get(entry.getKey());
                    URI input = etlResult.getExtractResult() == null ? entry.getKey() : etlResult.getExtractResult();
                    transformFile(entry.getValue(), etlResult, results, input, outdirUri);
                }
            }

            boolean doStage = getOptions().getBoolean(STAGE.key());
            boolean doMerge = getOptions().getBoolean(MERGE.key());
            if (!doStage && !doMerge) {
                doStage = true;
                doMerge = true;
            }

            if (doLoad) {
                int batchLoad = getOptions().getInt(Options.MERGE_BATCH_SIZE.key(), Options.MERGE_BATCH_SIZE.defaultValue());
                // Files to merge
                List<Integer> filesToMerge = new ArrayList<>(batchLoad);
                List<StorageETLResult> resultsToMerge = new ArrayList<>(batchLoad);

                Iterator<Map.Entry<URI, MongoDBVariantStorageETL>> iterator = storageETLMap.entrySet().iterator();
                while (iterator.hasNext()) {
                    Map.Entry<URI, MongoDBVariantStorageETL> entry = iterator.next();
                    StorageETLResult etlResult = resultsMap.get(entry.getKey());
                    URI input = etlResult.getPostTransformResult() == null ? entry.getKey() : etlResult.getPostTransformResult();
                    MongoDBVariantStorageETL storageETL = entry.getValue();

                    if (doStage) {
                        storageETL.getOptions().put(STAGE.key(), true);
                        storageETL.getOptions().put(MERGE.key(), false);
                        loadFile(storageETL, etlResult, results, input, outdirUri);
                        etlResult.setLoadExecuted(false);
                        etlResult.getLoadStats().put(STAGE.key(), true);
                    }

                    if (doMerge) {
                        filesToMerge.add(storageETL.getOptions().getInt(Options.FILE_ID.key()));
                        resultsToMerge.add(etlResult);
                        if (filesToMerge.size() == batchLoad || !iterator.hasNext()) {
                            long millis = System.currentTimeMillis();
                            try {
                                storageETL.getOptions().put(MERGE.key(), true);
                                storageETL.getOptions().put(Options.FILE_ID.key(), new ArrayList<>(filesToMerge));
                                storageETL.merge(filesToMerge);
                                storageETL.postLoad(input, outdirUri);
                            } catch (Exception e) {
                                for (StorageETLResult storageETLResult : resultsToMerge) {
                                    storageETLResult.setLoadError(e);
                                }
                                throw new StorageETLException("Exception executing merge.", e, results);
                            } finally {
                                long mergeTime = System.currentTimeMillis() - millis;
                                for (StorageETLResult storageETLResult : resultsToMerge) {
                                    storageETLResult.setLoadTimeMillis(storageETLResult.getLoadTimeMillis() + mergeTime);
                                    for (Map.Entry<String, Object> statsEntry : storageETL.getLoadStats().entrySet()) {
                                        storageETLResult.getLoadStats().putIfAbsent(statsEntry.getKey(), statsEntry.getValue());
                                    }
                                    storageETLResult.setLoadExecuted(true);
                                }
                                filesToMerge.clear();
                                resultsToMerge.clear();
                            }
                        }
                    }
                }
            }

        } finally {
//            monitor.interrupt();
            for (StorageETL storageETL : storageETLMap.values()) {
                storageETL.close();
            }
        }

        return results;
    }

    @Override
    public VariantMongoDBAdaptor getDBAdaptor(String dbName) throws StorageManagerException {
        MongoCredentials credentials = getMongoCredentials(dbName);
        VariantMongoDBAdaptor variantMongoDBAdaptor;
        ObjectMap options = new ObjectMap(configuration.getStorageEngine(STORAGE_ENGINE_ID).getVariant().getOptions());
        if (dbName != null && !dbName.isEmpty()) {
            options.append(VariantStorageManager.Options.DB_NAME.key(), dbName);
        }

        String variantsCollection = options.getString(COLLECTION_VARIANTS.key(), COLLECTION_VARIANTS.defaultValue());
        String filesCollection = options.getString(COLLECTION_FILES.key(), COLLECTION_FILES.defaultValue());
        MongoDataStoreManager mongoDataStoreManager = getMongoDataStoreManager();
        try {
            StudyConfigurationManager studyConfigurationManager = getStudyConfigurationManager(options);
            variantMongoDBAdaptor = new VariantMongoDBAdaptor(mongoDataStoreManager, credentials, variantsCollection, filesCollection,
                    studyConfigurationManager, configuration);
        } catch (UnknownHostException e) {
            e.printStackTrace();
            return null;
        }

        logger.debug("getting DBAdaptor to db: {}", credentials.getMongoDbName());
        return variantMongoDBAdaptor;
    }

    MongoCredentials getMongoCredentials(String dbName) {
        ObjectMap options = configuration.getStorageEngine(STORAGE_ENGINE_ID).getVariant().getOptions();

        // If no database name is provided, read from the configuration file
        if (dbName == null || dbName.isEmpty()) {
            dbName = options.getString(VariantStorageManager.Options.DB_NAME.key(), VariantStorageManager.Options.DB_NAME.defaultValue());
        }

        DatabaseCredentials database = configuration.getStorageEngine(STORAGE_ENGINE_ID).getVariant().getDatabase();

        try {
            return new MongoCredentials(database, dbName);
        } catch (IllegalOpenCGACredentialsException e) {
            e.printStackTrace();
            return null;
        }
    }

    @Override
    protected StudyConfigurationManager buildStudyConfigurationManager(ObjectMap options) throws StorageManagerException {
        if (options != null && !options.getString(FileStudyConfigurationManager.STUDY_CONFIGURATION_PATH, "").isEmpty()) {
            return super.buildStudyConfigurationManager(options);
        } else {
            String dbName = options == null ? null : options.getString(VariantStorageManager.Options.DB_NAME.key());
            String collectionName = options == null ? null : options.getString(COLLECTION_STUDIES.key(), COLLECTION_STUDIES.defaultValue());
            try {
                return new MongoDBStudyConfigurationManager(getMongoDataStoreManager(), getMongoCredentials(dbName), collectionName);
//                return getDBAdaptor(dbName).getStudyConfigurationManager();
            } catch (UnknownHostException e) {
                throw new StorageManagerException("Unable to build MongoStorageConfigurationManager", e);
            }
        }
    }

    private synchronized MongoDataStoreManager getMongoDataStoreManager() {
        if (mongoDataStoreManager == null) {
            mongoDataStoreManager = new MongoDataStoreManager(getMongoCredentials(null).getDataStoreServerAddresses());
        }
        return mongoDataStoreManager;
    }

}


text:
<?php

use common\components\XMigration;

class m160122_102009_screening_entry extends XMigration
{
    /* ************************************************************************************** */

    public function init()
    {
       $this->tableName = '{{%screening_entry}}';
       return parent::init();
    }

    /* ************************************************************************************** */
    public function up()
    {
        $this->init();
        $this->createTable(
                $this->tableName,
                [
                    'id'=>$this->primaryKey(),
                    'screening_form_id' => $this->integer()->notNull(),
                    'subject_id'=> $this->integer()->notNull(),
                    'researcher_id'=>$this->integer()->notNull(),
                    'project_id'=>$this->integer()->notNull(),
                    'resource_id'=>$this->integer()->notNull(),
                    'progress_id'=>$this->integer()->notNull(),
                    'contraindication_id'=>$this->integer()->notNull(),
                    'hash'=>$this->string(255)->notNull(),
                    'screening_form_title'=>$this->string(4096)->notNull(),
                    'screening_form_description'=>$this->string(4096),
                    'resource_title'=>$this->string(4096)->notNull()->defaultValue('The scanner'),
                    'subject_signature'=>$this->text(),
                    'researcher_signature'=>$this->text(),
                    'time_in'=>$this->integer(),
                    'time_out'=>$this->integer(),
                    'sort_order' => $this->integer()->notNull()->defaultValue(100),
                    'status_id'=>$this->integer()->notNull()->defaultValue(2),
                    'created_at' => $this->integer()->notNull(),
                    'updated_at' => $this->integer(),
                    'created_by' => $this->integer()->notNull(),
                    'updated_by' => $this->integer(),
                ],
                $this->mysqlOptions
            );

        $this->addForeignKey('fk_screening_entry_screening_form_id' , $this->tableName,  'screening_form_id' , 'screening_form' , 'id' , 'NO ACTION' , 'NO ACTION');
        $this->addForeignKey('fk_screening_entry_subject_id' , $this->tableName,  'subject_id' , 'subject' , 'id' , 'NO ACTION' , 'NO ACTION');
        $this->addForeignKey('fk_screening_entry_project_id' , $this->tableName,  'project_id' , 'project' , 'id' , 'NO ACTION' , 'NO ACTION');
        $this->addForeignKey('fk_screening_entry_researcher_id' , $this->tableName,  'researcher_id' , 'user' , 'id' , 'NO ACTION' , 'NO ACTION');
        $this->addForeignKey('fk_screening_entry_progress_id' , $this->tableName,  'progress_id' , 'ref_progress' , 'id' , 'NO ACTION' , 'NO ACTION');

         $this->addForeignKey('fk_screening_entry_resource_id' , $this->tableName,  'resource_id' , 'resource' , 'id' , 'NO ACTION' , 'NO ACTION');

        $this->addForeignKey('fk_screening_entry_contraindication_id' , $this->tableName,  'contraindication_id' , 'ref_boolean' , 'id' , 'NO ACTION' , 'NO ACTION');
        $this->addForeignKey('fk_screening_entry_status_id' , $this->tableName,  'status_id' , 'ref_status' , 'id' , 'NO ACTION' , 'NO ACTION');

    }
    /* ************************************************************************************** */

    public function down()
    {

        $this->init();
        $this->dropForeignKey('fk_screening_entry_screening_form_id',$this->tableName);
        $this->dropForeignKey('fk_screening_entry_subject_id',$this->tableName);
        $this->dropForeignKey('fk_screening_entry_project_id',$this->tableName);
        $this->dropForeignKey('fk_screening_entry_researcher_id',$this->tableName);
        $this->dropForeignKey('fk_screening_entry_progress_id',$this->tableName);
        $this->dropForeignKey('fk_screening_entry_resource_id',$this->tableName);
        $this->dropForeignKey('fk_screening_entry_contraindication_id',$this->tableName);
        $this->dropForeignKey('fk_screening_entry_status_id',$this->tableName);
        $this->dropTable($this->tableName);
        return true;

    }
    /* ************************************************************************************** */

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}


text:
<!doctype html>
<!--
    @license
    Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
    This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
    The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
    The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
    Code distributed by Google as part of the polymer project is also
    subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
  <head>
    <title>parser Test</title>
    <script src="../../../src/HTMLImports/HTMLImports.js"></script>
    <script src="../../../../web-component-tester/browser.js"></script>

    <meta http-equiv='Content-Security-Policy' content="script-src 'self';">
    <link rel="import" href="imports/csp-import-1.html">
  </head>
  <body>
    <script src="csp.js"></script>
  </body>
</html>


text:
https://reactfaq.site

This guide aims to pull together quality content about React core concepts into a central location for quick reference.

Remember we're all learning.  Read, Try, Mess Up (it's okay).

## Notes
This site is built with [gatsbyjs](https://github.com/gatsbyjs/gatsby) & deploys using [Netlify](https://www.netlify.com/).

## Contribute
If you would like to see content added ping me on twitter [@timarney](https://twitter.com/timarney) or checkout the [pages](https://github.com/timarney/react-faq/tree/master/pages) directory + send a pull request.


text:
FILE(REMOVE_RECURSE
  "CMakeFiles/CmdLine.dir/src/CmdLine.cpp.o"
  "../../../lib/libCmdLine.pdb"
  "../../../lib/libCmdLine.so"
)

# Per-language clean rules from dependency scanning.
FOREACH(lang CXX)
  INCLUDE(CMakeFiles/CmdLine.dir/cmake_clean_${lang}.cmake OPTIONAL)
ENDFOREACH(lang)


text:
package com.teamclay.MagnticTech;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;

public class Ore implements IWorldGenerator{

	@Override
	public void generate(Random random, int chunkX, int chunkZ, World world,
			IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
		Gen(random, chunkZ, chunkZ, world, chunkProvider, chunkProvider, MagneticTech.Boron_Ore, 25);
		Gen(random, chunkZ, chunkZ, world, chunkProvider, chunkProvider, MagneticTech.Neodymium_ore, 35);
		Gen(random, chunkZ, chunkZ, world, chunkProvider, chunkProvider, MagneticTech.Septum_Magnet, 55);
		Gen(random, chunkZ, chunkZ, world, chunkProvider, chunkProvider, MagneticTech.Magnetite_N, 55);
		Gen(random, chunkZ, chunkZ, world, chunkProvider, chunkProvider, MagneticTech.Magnetite_S, 55);
	}
	public void Gen(Random random, int i, int j, World world,
			IChunkProvider chunkGenerator, IChunkProvider chunkProvider,Block block,int hight){
		int firstBlockXCoord = i + random.nextInt(16);
		int firstBlockYCoord = random.nextInt(hight);
		int firstBlockZCoord = j + random.nextInt(16);

		(new WorldGenMinable(block, 9)).generate(world, random, firstBlockXCoord, firstBlockYCoord, firstBlockZCoord);
	}
}


text:
@extends('hive::layouts.main')
@section('title', 'Editar · Minha empresa')
@section('content')

<!-- Header -->
@include('hive::components.title', ['page_title' => 'Editar minha empresa'])

<!-- Breadcrumbs -->
@include('hive::components.breadcrumbs', ['breadcrumb' => Breadcrumbs::render('hello-empresa-edit', $empresa)])

{!! Form::model($empresa, ['url' => $empresa->path(), 'method' => 'PUT', 'class' => 'hello-form']) !!}
	@include('hive::empresa.partials.form', ['submit_button_text' => 'Editar minha empresa'])
{!! Form::close() !!}

@endsection


text:
package net.sf.mmm.code.api.type;

import net.sf.mmm.code.api.copy.CodeNodeItemCopyable;
import net.sf.mmm.code.api.element.CodeElementWithTypeVariables;
import net.sf.mmm.code.api.member.CodeOperation;
import net.sf.mmm.code.api.merge.CodeSimpleMergeableItem;
import net.sf.mmm.code.api.node.CodeNodeItemContainerFlatWithName;

/**
 * {@link CodeGenericTypeParameters} containing the {@link CodeTypeVariable}s of a {@link CodeType} or
 * {@link CodeOperation}.
 *
 * @see Class#getTypeParameters()
 * @see java.lang.reflect.Executable#getTypeParameters()
 * @see CodeGenericType#getTypeParameters()
 * @see CodeOperation#getTypeParameters()
 * @see CodeTypeParameters
 * @see CodeTypeVariable
 *
 * @author Joerg Hohwiller (hohwille at users.sourceforge.net)
 * @since 1.0.0
 */
public interface CodeTypeVariables extends CodeGenericTypeParameters<CodeTypeVariable>, CodeNodeItemContainerFlatWithName<CodeTypeVariable>,
    CodeSimpleMergeableItem<CodeTypeVariables>, CodeNodeItemCopyable<CodeElementWithTypeVariables, CodeTypeVariables> {

  @Override
  CodeElementWithTypeVariables getParent();

  /**
   * @param name the {@link CodeTypeVariable#getName() name} of the requested {@link CodeTypeVariable}.
   * @param includeParents - {@code true} if the search should recurse into {@link #getParent() parents}
   *        ({@link CodeOperation#getDeclaringType() declaring type} of {@link CodeOperation} or
   *        {@link CodeType#getDeclaringType() declaring types} of {@link CodeType#isNested() nested} {@link CodeType}s)
   *        if non-{@link net.sf.mmm.code.api.modifier.CodeModifiers#isStatic() static}, {@code false} otherwise
   * @return the requested {@link CodeTypeVariable} or {@code null} if not found.
   * @see #get(String)
   */
  CodeTypeVariable get(String name, boolean includeParents);

  @Override
  CodeTypeVariables copy();

}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     此代码由工具生成。
//     运行时版本:4.0.30319.42000
//
//     对此文件的更改可能会导致不正确的行为,并且如果
//     重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------

namespace NorthwindDemo.Properties {

    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {

        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

        public static Settings Default {
            get {
                return defaultInstance;
            }
        }

        [global::System.Configuration.ApplicationScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=NOTEBOOK\\SQLEXPRESS;Integrated Security=True")]
        public string NorthwindConnectionString {
            get {
                return ((string)(this["NorthwindConnectionString"]));
            }
        }

        [global::System.Configuration.ApplicationScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
        [global::System.Configuration.DefaultSettingValueAttribute("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Northwind.mdb;Persist Security In" +
            "fo=True")]
        public string NorthwindConnectionString1 {
            get {
                return ((string)(this["NorthwindConnectionString1"]));
            }
        }

        [global::System.Configuration.ApplicationScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=PC3;Initial Catalog=Northwind;Integrated Security=True")]
        public string NorthwindConnectionString2 {
            get {
                return ((string)(this["NorthwindConnectionString2"]));
            }
        }

        [global::System.Configuration.ApplicationScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
        [global::System.Configuration.DefaultSettingValueAttribute("DATA SOURCE=vpc1;PERSIST SECURITY INFO=True;USER ID=NORTHWIND")]
        public string DataSourceConnectionString {
            get {
                return ((string)(this["DataSourceConnectionString"]));
            }
        }

        [global::System.Configuration.ApplicationScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=VPC1\\SQLEXPRESS;Initial Catalog=Northwind;User ID=sa;Password=test")]
        public string NorthwindConnectionString3 {
            get {
                return ((string)(this["NorthwindConnectionString3"]));
            }
        }

        [global::System.Configuration.ApplicationScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
        [global::System.Configuration.DefaultSettingValueAttribute("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Northwind.mdb")]
        public string NorthwindConnectionString4 {
            get {
                return ((string)(this["NorthwindConnectionString4"]));
            }
        }

        [global::System.Configuration.ApplicationScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=VPC1\\SQLEXPRESS;Initial Catalog=Northwind;Persist Security Info=True;" +
            "User ID=sa;Password=test")]
        public string NorthwindConnectionString5 {
            get {
                return ((string)(this["NorthwindConnectionString5"]));
            }
        }
    }
}


text:
title: Un été pour changer
link: https://gouvernement-et-citoyens.consultation.etalab.gouv.fr/project/un-ete-pour-changer/questionnaire/questionnaire
opendata:
description: Préfecture de Loire-Atlantique (44)
organisateur: Préfecture de Loire-Atlantique (44)
outil:
- Cap Collectif
methodes:
- Les consultations en ligne
screenshot: ddtm34.png
date: 2019-06-01 09:29:08 +0000
in_progress: true
note-citoyenne: 5
note-decidee: 4
---

Organisé par la Préfecture de Loire-atlantique. Type de consultation : Questionnaire.
Date de fin : 14 juillet 2019

Mesdames, Messieurs,
Chers collègues,
Pour assurer la charge de l'administration de l'Etat dans le département, je peux compter sur votre engagement indéfectible et votre sens du service public.

Je sais à quel point des services publics efficaces et de qualité sont indispensables à la cohésion sociale, à l'égalité républicaine, au développement économique et à la conduite de la transition écologique.

Je sais que vous vous êtes par le passé déjà mobilisés sur des actions de modernisation. Il me semble que nous devons franchir une nouvelle étape. Je souhaitais donc vous présenter ce qu'il nous faut conduire pour améliorer encore notre fonctionnement et notre qualité de service.

Nous portons l'ambition d'un service public efficace et exemplaire dans son accueil, agile dans son organisation, et plus accessible sur notre territoire.

Ensemble, nous mènerons une réflexion sur notre organisation, nos missions, nos conditions de travail et nos modes de fonctionnement autour des thématiques suivantes : préfectures et sous-préfectures, directions départementales interministérielles, directions régionales et secrétariat général pour l'administration régionale.

Cette réflexion, pour laquelle je m'impliquerai personnellement à vos côtés, et qui engage toute l'équipe qui m'entoure, prendra notamment la forme d'une consultation en ligne qui se déroulera tout au long du mois de juin. J'ai confié le soin à cette équipe projet de recueillir vos avis et vos contributions en faisant appel à votre expérience, vos idées et vos propositions de solutions et suggestions d'expérimentations.

Jusqu'au 13 juillet, participez à la consultation #DéfiUnEtéPourChanger

Je compte sur votre mobilisation et votre engagement pour les valeurs de notre service public.

Claude d'Harcourt


text:
import DS from 'ember-data';
import BackboneElement from 'ember-fhir/models/backbone-element';

const { attr, belongsTo } = DS;

export default BackboneElement.extend({
  identifier: attr('string'),
  code: attr('string'),
  details: belongsTo('reference', { async: false })
});


text:
""" Main class from dcclient. Manages XML interaction, as well as switch and
creates the actual networks
"""

import rpc
from xml_manager.manager import ManagedXml

from neutron.openstack.common import log as logger
from oslo.config import cfg

LOG = logger.getLogger(__name__)

class Manager:
    def __init__(self):
         self.rpc = rpc.RPC(cfg.CONF.ml2_datacom.dm_username,
                         cfg.CONF.ml2_datacom.dm_password,
                         cfg.CONF.ml2_datacom.dm_host,
                         cfg.CONF.ml2_datacom.dm_method)

         self.xml = ManagedXml()

    def _update(self):
        self.rpc.send_xml(self.xml.xml.as_xml_text())

    def create_network(self, vlan):
        """ Creates a new network on the switch, if it does not exist already.
        """
        try:
            self.xml.addVlan(vlan)
            self._update()
        except:
            LOG.info("Trying to create already existing network %d:", vlan)


text:
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Component } from "@angular/core";
var BlueDynamicComponent = (function () {
    function BlueDynamicComponent() {
    }
    return BlueDynamicComponent;
}());
BlueDynamicComponent = __decorate([
    Component({
        selector: 'dynamic-component',
        template: '<div class="img-rounded" style="background-color: lightskyblue;margin: 5px"> Blue Dynamic Component! </div>',
    })
], BlueDynamicComponent);
export { BlueDynamicComponent };
//# sourceMappingURL=blue-dynamic.component.js.map


text:
/*
  +------------------------------------------------------------------------+
  |  Validation Kit Framework                                              |
  +------------------------------------------------------------------------+
  +------------------------------------------------------------------------+
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"
#include "php_phalcon.h"
#include "validationkit.h"

#include "Zend/zend_operators.h"
#include "Zend/zend_exceptions.h"
#include "Zend/zend_interfaces.h"
#include "ext/spl/spl_exceptions.h"

#include "kernel/main.h"
#include "kernel/memory.h"

#include "kernel/exception.h"
#include "kernel/object.h"
#include "kernel/fcall.h"
#include "kernel/array.h"
#include "kernel/concat.h"
#include "kernel/operators.h"

PHP_METHOD(Phalcon_ValidationKit_StringValidator, __construct)
{

        zval *options = NULL, *messages = NULL;

        PHALCON_MM_GROW();

        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|zz", &options, &messages) == FAILURE) {
            PHALCON_MM_RESTORE();
            RETURN_NULL();
        }

        if (!options) {
            PHALCON_THROW_EXCEPTION_STR(spl_ce_InvalidArgumentException, "validate options is required.");
            goto mm_restore_return;
        }
        if (!messages) {
            PHALCON_INIT_VAR(messages);
            array_init(messages);
        }

        zval *new_options = NULL;
        PHALCON_INIT_VAR(new_options);
        array_init(new_options);

        if (Z_TYPE_P(options) == IS_STRING) {

            phalcon_array_update_string(&new_options, SL("is"), &options, PH_COPY TSRMLS_CC);

        }else if (Z_TYPE_P(options) == IS_ARRAY || Z_TYPE_P(options) == IS_OBJECT) {

            zval *count = NULL;
            PHALCON_INIT_VAR(count);
            phalcon_fast_count(count, options);

            if (Z_LVAL_P(count) == 0) {
                PHALCON_THROW_EXCEPTION_STR(spl_ce_InvalidArgumentException, "validate options is required.");
                goto mm_restore_return;
            }

            PHALCON_CPY_WRT(new_options, options);

        }else {
            goto mm_restore_return;
        }

        zval *def_options = NULL, *final_options = NULL;
        zval *null_value = NULL, *false_value = NULL;

        PHALCON_INIT_VAR(def_options);
        PHALCON_INIT_VAR(final_options);
        PHALCON_INIT_VAR(null_value);
        PHALCON_INIT_VAR(false_value);
        array_init(def_options);
        array_init(final_options);
        ZVAL_BOOL(false_value, 0);

        phalcon_array_update_string(&def_options, SL("starts_with"), &null_value, PH_COPY TSRMLS_CC);
        phalcon_array_update_string(&def_options, SL("end_with"), &null_value, PH_COPY TSRMLS_CC);
        phalcon_array_update_string(&def_options, SL("contains"), &null_value, PH_COPY TSRMLS_CC);
        phalcon_array_update_string(&def_options, SL("except"), &null_value, PH_COPY TSRMLS_CC);
        phalcon_array_update_string(&def_options, SL("is"), &null_value, PH_COPY TSRMLS_CC);
        phalcon_array_update_string(&def_options, SL("ignore_case"), &false_value, PH_COPY TSRMLS_CC);

        PHALCON_CALL_FUNC_PARAMS_2(final_options, "array_merge", def_options, new_options);

        PHALCON_CALL_PARENT_PARAMS_2_NORETURN(this_ptr, "ValidationKit\\StringValidator", "__construct", final_options, messages);

        mm_restore_return:
        PHALCON_MM_RESTORE();

}

PHP_METHOD(Phalcon_ValidationKit_StringValidator, validate){

        zval *value = NULL;

        PHALCON_MM_GROW();

        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
            PHALCON_MM_RESTORE();
            RETURN_NULL();
        }

        zval *key = NULL, *option = NULL;
        zval *error = NULL;
        int ignore_case = 0;
        zval *ivalue = NULL, *ioption = NULL;
        zval *eval_return = NULL;

        // process ignore_case
        PHALCON_INIT_VAR(option);
        PHALCON_INIT_VAR(key);

        ZVAL_STRING(key, "ignore_case", 1);
        PHALCON_CALL_METHOD_PARAMS_1(option, this_ptr, "getOption", key, PH_NO_CHECK);

        if (Z_TYPE_P(option) != IS_NULL) {
            if (PHALCON_IS_TRUE(option)) ignore_case = 1;
        }

        // convert to lower
        if (ignore_case) {
            PHALCON_INIT_VAR(ivalue);
            PHALCON_CALL_FUNC_PARAMS_1(ivalue, "strtolower", value);
        }

        // process is
        PHALCON_INIT_VAR(option);
        PHALCON_INIT_VAR(key);
        PHALCON_INIT_VAR(error);

        ZVAL_STRING(key, "is", 1);
        PHALCON_CALL_METHOD_PARAMS_1(option, this_ptr, "getOption", key, PH_NO_CHECK);

        if (Z_TYPE_P(option) != IS_NULL) {
            if (ignore_case) {
                PHALCON_INIT_VAR(ioption);
                PHALCON_CALL_FUNC_PARAMS_1(ioption, "strtolower", option);

                PHALCON_INIT_VAR(eval_return);
                phalcon_fast_strpos(eval_return, ivalue, ioption TSRMLS_CC);

                if (Z_STRLEN_P(option) != Z_STRLEN_P(value) || (PHALCON_IS_FALSE(eval_return)) || Z_LVAL_P(eval_return) != 0) {
                    ZVAL_STRING(error, "is_error", 1);
                    PHALCON_CALL_METHOD_PARAMS_1(return_value, this_ptr, "invalid", error, PH_NO_CHECK);
                    goto mm_restore_return;
                }

            } else {
                PHALCON_INIT_VAR(eval_return);
                phalcon_fast_strpos(eval_return, value, option TSRMLS_CC);

                if (Z_STRLEN_P(option) != Z_STRLEN_P(value) || (PHALCON_IS_FALSE(eval_return)) || Z_LVAL_P(eval_return) != 0) {
                    ZVAL_STRING(error, "is_error", 1);
                    PHALCON_CALL_METHOD_PARAMS_1(return_value, this_ptr, "invalid", error, PH_NO_CHECK);
                    goto mm_restore_return;
                }
            }

        }

        // process starts_with
        PHALCON_INIT_VAR(option);
        PHALCON_INIT_VAR(key);
        PHALCON_INIT_VAR(error);

        ZVAL_STRING(key, "starts_with", 1);
        PHALCON_CALL_METHOD_PARAMS_1(option, this_ptr, "getOption", key, PH_NO_CHECK);

        if (Z_TYPE_P(option) != IS_NULL) {
            if (ignore_case) {
                PHALCON_INIT_VAR(ioption);
                PHALCON_CALL_FUNC_PARAMS_1(ioption, "strtolower", option);

                PHALCON_INIT_VAR(eval_return);
                phalcon_fast_strpos(eval_return, ivalue, ioption TSRMLS_CC);

                if ( (PHALCON_IS_FALSE(eval_return)) || Z_LVAL_P(eval_return) != 0) {
                    ZVAL_STRING(error, "starts_with_error", 1);
                    PHALCON_CALL_METHOD_PARAMS_1(return_value, this_ptr, "invalid", error, PH_NO_CHECK);
                    goto mm_restore_return;
                }

            } else {
                PHALCON_INIT_VAR(eval_return);
                phalcon_fast_strpos(eval_return, value, option TSRMLS_CC);

                if ( (PHALCON_IS_FALSE(eval_return)) || Z_LVAL_P(eval_return) != 0) {
                    ZVAL_STRING(error, "starts_error", 1);
                    PHALCON_CALL_METHOD_PARAMS_1(return_value, this_ptr, "invalid", error, PH_NO_CHECK);
                    goto mm_restore_return;
                }
            }

        }

        // process ends_with
        PHALCON_INIT_VAR(option);
        PHALCON_INIT_VAR(key);
        PHALCON_INIT_VAR(error);

        ZVAL_STRING(key, "ends_with", 1);
        PHALCON_CALL_METHOD_PARAMS_1(option, this_ptr, "getOption", key, PH_NO_CHECK);

        if (Z_TYPE_P(option) != IS_NULL) {

            int pos = Z_STRLEN_P(value) - Z_STRLEN_P(option);

            if (pos <0) {
                ZVAL_STRING(error, "starts_with_error", 1);
                PHALCON_CALL_METHOD_PARAMS_1(return_value, this_ptr, "invalid", error, PH_NO_CHECK);
                goto mm_restore_return;
            }

            if (ignore_case) {
                PHALCON_INIT_VAR(ioption);
                PHALCON_CALL_FUNC_PARAMS_1(ioption, "strtolower", option);

                zval *sub_value = NULL;
                PHALCON_INIT_VAR(sub_value);
                ZVAL_STRINGL(sub_value, (Z_STRVAL_P(ivalue)+pos), Z_STRLEN_P(option), 1);

                PHALCON_INIT_VAR(eval_return);
                phalcon_fast_strpos(eval_return, sub_value, ioption TSRMLS_CC);

                if (Z_LVAL_P(eval_return) != 0) {
                    ZVAL_STRING(error, "ends_with_error", 1);
                    PHALCON_CALL_METHOD_PARAMS_1(return_value, this_ptr, "invalid", error, PH_NO_CHECK);
                    goto mm_restore_return;
                }

            } else {

                zval *sub_value = NULL;
                PHALCON_INIT_VAR(sub_value);
                ZVAL_STRINGL(sub_value, (Z_STRVAL_P(value)+pos), Z_STRLEN_P(option), 1);

                PHALCON_INIT_VAR(eval_return);
                phalcon_fast_strpos(eval_return, sub_value, option TSRMLS_CC);

                if (Z_LVAL_P(eval_return) != 0) {
                    ZVAL_STRING(error, "ends_error", 1);
                    PHALCON_CALL_METHOD_PARAMS_1(return_value, this_ptr, "invalid", error, PH_NO_CHECK);
                    goto mm_restore_return;
                }
            }

        }

        // process contains
        PHALCON_INIT_VAR(option);
        PHALCON_INIT_VAR(key);
        PHALCON_INIT_VAR(error);

        ZVAL_STRING(key, "contains", 1);
        PHALCON_CALL_METHOD_PARAMS_1(option, this_ptr, "getOption", key, PH_NO_CHECK);

        if (Z_TYPE_P(option) != IS_NULL) {

            if (ignore_case) {
                PHALCON_INIT_VAR(ioption);
                PHALCON_CALL_FUNC_PARAMS_1(ioption, "strtolower", option);

                PHALCON_INIT_VAR(eval_return);
                phalcon_fast_strpos(eval_return, ivalue, ioption TSRMLS_CC);

                if (PHALCON_IS_FALSE(eval_return)) {
                    ZVAL_STRING(error, "contains_error", 1);
                    PHALCON_CALL_METHOD_PARAMS_1(return_value, this_ptr, "invalid", error, PH_NO_CHECK);
                    goto mm_restore_return;
                }

            } else {

                PHALCON_INIT_VAR(eval_return);
                phalcon_fast_strpos(eval_return, value, option TSRMLS_CC);

                if (PHALCON_IS_FALSE(eval_return)) {
                    ZVAL_STRING(error, "contains_error", 1);
                    PHALCON_CALL_METHOD_PARAMS_1(return_value, this_ptr, "invalid", error, PH_NO_CHECK);
                    goto mm_restore_return;
                }
            }

        }

        // process except
        PHALCON_INIT_VAR(option);
        PHALCON_INIT_VAR(key);
        PHALCON_INIT_VAR(error);

        ZVAL_STRING(key, "except", 1);
        PHALCON_CALL_METHOD_PARAMS_1(option, this_ptr, "getOption", key, PH_NO_CHECK);

        if (Z_TYPE_P(option) != IS_NULL) {

            if (ignore_case) {
                PHALCON_INIT_VAR(ioption);
                PHALCON_CALL_FUNC_PARAMS_1(ioption, "strtolower", option);

                PHALCON_INIT_VAR(eval_return);
                phalcon_fast_strpos(eval_return, ivalue, ioption TSRMLS_CC);

                if (PHALCON_IS_NOT_FALSE(eval_return)) {
                    ZVAL_STRING(error, "except_error", 1);
                    PHALCON_CALL_METHOD_PARAMS_1(return_value, this_ptr, "invalid", error, PH_NO_CHECK);
                    goto mm_restore_return;
                }

            } else {

                PHALCON_INIT_VAR(eval_return);
                phalcon_fast_strpos(eval_return, value, option TSRMLS_CC);

                if (PHALCON_IS_NOT_FALSE(eval_return)) {
                    ZVAL_STRING(error, "except_error", 1);
                    PHALCON_CALL_METHOD_PARAMS_1(return_value, this_ptr, "invalid", error, PH_NO_CHECK);
                    goto mm_restore_return;
                }
            }

        }

        PHALCON_CALL_METHOD(return_value, this_ptr, "valid", PH_NO_CHECK);

        mm_restore_return:
        PHALCON_MM_RESTORE();
}


text:
BBOX=$1
GPX_DATA_DIR=$2
# TODO step 1: download GPX from OSM
python osm_gpx_fetcher.py -b $BBOX $GPX_DATA_DIR
# step 2: complement the downloaded GPX with elevations from SRTM dataset
./gpx_elev_enhancer.sh $GPX_DATA_DIR
# step 3: generate summary info for each GPX
./gpxinfo_collector.sh $GPX_DATA_DIR
# step 4: reduce summaries into well-structured CSV format
python gpx_summary_reducer.py -c ./reducer_conf.json $GPX_DATA_DIR/summary
# step 5: combine CSV files into one
./combine_gpx_csv_info.sh $GPX_DATA_DIR/summary/csv $GPX_DATA_DIR/munich_track_segment_info.csv
# step 6: reduce the segment summary for each track
python reduce_track_info.py -i $GPX_DATA_DIR/munich_track_segment_info.csv -o $GPX_DATA_DIR/munich_track_info.csv


text:
/* This file was generated by upbc (the upb compiler) from the input
 * file:
 *
 *     envoy/config/trace/v3/trace.proto
 *
 * Do not edit -- your changes will be discarded when the file is
 * regenerated. */

#include <stddef.h>
#include "upb/msg_internal.h"
#include "envoy/config/trace/v3/trace.upb.h"
#include "envoy/config/trace/v3/datadog.upb.h"
#include "envoy/config/trace/v3/dynamic_ot.upb.h"
#include "envoy/config/trace/v3/http_tracer.upb.h"
#include "envoy/config/trace/v3/lightstep.upb.h"
#include "envoy/config/trace/v3/opencensus.upb.h"
#include "envoy/config/trace/v3/service.upb.h"
#include "envoy/config/trace/v3/zipkin.upb.h"

#include "upb/port_def.inc"

const upb_MiniTable_File envoy_config_trace_v3_trace_proto_upb_file_layout = {
  NULL,
  NULL,
  NULL,
  0,
  0,
  0,
};

#include "upb/port_undef.inc"


text:
@class MPSession;

#pragma mark - MPResponseEvents
@interface MPResponseEvents : NSObject

+ (void)parseConfiguration:(nonnull NSDictionary *)configuration;

@end


text:
Te permite visualizar y bloquear sitios web invisibles que
      hacen seguimiento en busquedas e historial del usuario.

Cambia tu dirección IP con la de 4 lugares en todo el mundo. Zenmate te proteje
      contra hackers, espías y ladrones de datos que pueden aprovecharse de
      conexiones inseguras.

Lightbeam es un complemento de Firefox que te permite ver todos los sitios que
      interactuan contigo. Permite ver todos los sitios de terceros que se conectan a los
      sitios que visitas.


text:
<?php

namespace Sise\Bundle\CoreBundle\Form\nomenclature;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class NomenclatureCirconscriptionregionalType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('codecircregi','text',array('label' => 'Code','translation_domain' => 'SiseCoreBundle'))
            ->add('libecircregiar','text',array('label' => 'Libear','translation_domain' => 'SiseCoreBundle'))
            ->add('libecircregifr','text',array('label' => 'Libefr','translation_domain' => 'SiseCoreBundle'))
            ->add('codegouv', 'entity', array(
                'class' => 'Sise\Bundle\CoreBundle\Entity\NomenclatureGouvernorat',
                'property' => 'libegouvar',
                'label' => 'codegouv',
                'translation_domain' => 'SiseCoreBundle',
                'expanded' => false,
                'multiple' => false,
                'required' => true,
            ))
            ->add('ordraffi','integer',array('label' => 'ordraffi','translation_domain' => 'SiseCoreBundle'))
            ->add('acti','checkbox',array('label' => 'acti','translation_domain' => 'SiseCoreBundle'))
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Sise\Bundle\CoreBundle\Entity\NomenclatureCirconscriptionregional'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'nomenclature_sise';
    }
}


text:
local utils = require 'utils'

validArgs = validArgs or utils.invert({
 'help',
 'unit',
 'verbose',
 'amount',
})
local args = utils.processArgs({...}, validArgs)

if args.unit and tonumber(args.unit) then
 unit = df.unit.find(tonumber(args.unit))
else
 print('No unit declared')
 return
end

if args.amount then
 amount = tonumber(args.amount)
else
 amount = 1
end

verbose = false
if args.verbose then verbose = true end

dfhack.script_environment('functions/class').changeLevel(unit,amount,verbose)


text:
package eaa.chapter14.templateview;

import java.io.Serializable;

import eaa.chapter14.pagecontroller.domain.Bookmark;
import eaa.chapter14.pagecontroller.domain.Person;

public class PersonHelper implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	private Person person;

	public PersonHelper( Person person ) {
		this.person = person;
	}

	public String getBookmarksHTML() {
		StringBuffer out = new StringBuffer();

		out.append("
");

		for( Bookmark bookmark : person.getBookmarks() ) {
			out.append("
");
			out.append("" );
			out.append( bookmark.getUrl() );
			out.append("");
			out.append("
");
		}

		out.append("
");

		return out.toString();
	}

}


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

<TITLE>
io
</TITLE>

<META NAME="date" CONTENT="2013-05-03">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">

io

Interfaces

IReadable

Classes

FileManager

GSemSearchReader

ProgressMonitorReader

Reader_Graph

Reader_GraphML

Reader_NET


text:
package com.nelson.umbrellaalarm.Models;

import java.util.ArrayList;

public class Weather {

    private final WeatherLocation mWeatherLocation;
    private final ArrayList<Forecast> mForecasts;

    public Weather(WeatherLocation weatherLocation, ArrayList<Forecast> forecasts) {
        mWeatherLocation = weatherLocation;
        mForecasts = forecasts;
    }

    public WeatherLocation getWeatherLocation() {
        return mWeatherLocation;
    }

    public ArrayList<Forecast> getForecasts() {
        return mForecasts;
    }
}