text:
namespace Microsoft.Azure.CognitiveServices.Search.VisualSearch.Models
{
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// A key-value object consisting of filters that may be specified to limit
    /// the results returned by the API. Current available filters: site.
    /// </summary>
    public partial class Filters
    {
        /// <summary>
        /// Initializes a new instance of the Filters class.
        /// </summary>
        public Filters()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the Filters class.
        /// </summary>
        /// <param name="site">The URL of the site to return similar images and
        /// similar products from. (e.g., "www.bing.com", "bing.com").</param>
        public Filters(string site = default(string))
        {
            Site = site;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets the URL of the site to return similar images and similar
        /// products from. (e.g., "www.bing.com", "bing.com").
        /// </summary>
        [JsonProperty(PropertyName = "site")]
        public string Site { get; private set; }

    }
}

redpajama_set_name: RedPajamaGithub


text:
package beta

import (
	"github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
)

func DCLFirewallPolicySchema() *dcl.Schema {
	return &dcl.Schema{
		Info: &dcl.Info{
			Title:       "Compute/FirewallPolicy",
			Description: "The Compute FirewallPolicy resource",
			StructName:  "FirewallPolicy",
		},
		Paths: &dcl.Paths{
			Get: &dcl.Path{
				Description: "The function used to get information about a FirewallPolicy",
				Parameters: []dcl.PathParameters{
					dcl.PathParameters{
						Name:        "firewallPolicy",
						Required:    true,
						Description: "A full instance of a FirewallPolicy",
					},
				},
			},
			Apply: &dcl.Path{
				Description: "The function used to apply information about a FirewallPolicy",
				Parameters: []dcl.PathParameters{
					dcl.PathParameters{
						Name:        "firewallPolicy",
						Required:    true,
						Description: "A full instance of a FirewallPolicy",
					},
				},
			},
			Delete: &dcl.Path{
				Description: "The function used to delete a FirewallPolicy",
				Parameters: []dcl.PathParameters{
					dcl.PathParameters{
						Name:        "firewallPolicy",
						Required:    true,
						Description: "A full instance of a FirewallPolicy",
					},
				},
			},
			DeleteAll: &dcl.Path{
				Description: "The function used to delete all FirewallPolicy",
				Parameters: []dcl.PathParameters{
					dcl.PathParameters{
						Name:     "parent",
						Required: true,
						Schema: &dcl.PathParametersSchema{
							Type: "string",
						},
					},
				},
			},
			List: &dcl.Path{
				Description: "The function used to list information about many FirewallPolicy",
				Parameters: []dcl.PathParameters{
					dcl.PathParameters{
						Name:     "parent",
						Required: true,
						Schema: &dcl.PathParametersSchema{
							Type: "string",
						},
					},
				},
			},
		},
		Components: &dcl.Components{
			Schemas: map[string]*dcl.Component{
				"FirewallPolicy": &dcl.Component{
					Title: "FirewallPolicy",
					ID:    "locations/global/firewallPolicies/{{name}}",
					Locations: []string{
						"global",
					},
					HasCreate: true,
					SchemaProperty: dcl.Property{
						Type: "object",
						Required: []string{
							"shortName",
							"parent",
						},
						Properties: map[string]*dcl.Property{
							"creationTimestamp": &dcl.Property{
								Type:        "string",
								GoName:      "CreationTimestamp",
								ReadOnly:    true,
								Description: "Creation timestamp in RFC3339 text format.",
								Immutable:   true,
							},
							"description": &dcl.Property{
								Type:        "string",
								GoName:      "Description",
								Description: "An optional description of this resource. Provide this property when you create the resource.",
							},
							"fingerprint": &dcl.Property{
								Type:        "string",
								GoName:      "Fingerprint",
								ReadOnly:    true,
								Description: "Fingerprint of the resource. This field is used internally during updates of this resource.",
								Immutable:   true,
							},
							"id": &dcl.Property{
								Type:        "string",
								GoName:      "Id",
								ReadOnly:    true,
								Description: "The unique identifier for the resource. This identifier is defined by the server.",
								Immutable:   true,
							},
							"name": &dcl.Property{
								Type:                     "string",
								GoName:                   "Name",
								Description:              "Name of the resource. It is a numeric ID allocated by GCP which uniquely identifies the Firewall Policy.",
								Immutable:                true,
								ServerGeneratedParameter: true,
							},
							"parent": &dcl.Property{
								Type:                "string",
								GoName:              "Parent",
								Description:         "The parent of the firewall policy.",
								Immutable:           true,
								ForwardSlashAllowed: true,
								ResourceReferences: []*dcl.PropertyResourceReference{
									&dcl.PropertyResourceReference{
										Resource: "Cloudresourcemanager/Folder",
										Field:    "name",
										Parent:   true,
									},
									&dcl.PropertyResourceReference{
										Resource: "Cloudresourcemanager/Organization",
										Field:    "name",
										Parent:   true,
									},
								},
							},
							"ruleTupleCount": &dcl.Property{
								Type:        "integer",
								Format:      "int64",
								GoName:      "RuleTupleCount",
								ReadOnly:    true,
								Description: "Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.",
								Immutable:   true,
							},
							"selfLink": &dcl.Property{
								Type:        "string",
								GoName:      "SelfLink",
								ReadOnly:    true,
								Description: "Server-defined URL for the resource.",
								Immutable:   true,
							},
							"selfLinkWithId": &dcl.Property{
								Type:        "string",
								GoName:      "SelfLinkWithId",
								ReadOnly:    true,
								Description: "Server-defined URL for this resource with the resource id.",
								Immutable:   true,
							},
							"shortName": &dcl.Property{
								Type:        "string",
								GoName:      "ShortName",
								Description: "User-provided name of the Organization firewall policy. The name should be unique in the organization in which the firewall policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
								Immutable:   true,
							},
						},
					},
				},
			},
		},
	}
}


text:
var expect = require("chai").expect;

module.exports = function (helpers) {
  var component = helpers.mount(require.resolve("./index"), {});

  var helloEl = component.getEl("hello");
  expect(helloEl.innerHTML).to.equal("Hello Joe!");

  component.el.style.border = "1px solid red";
  component.el.className = "foo";

  component.el.querySelector("a").href = "http://www.foo.com/";

  component.getEl("hello2").removeAttribute("class");

  component.setState("name", "Frank");
  component.update();

  expect(helloEl.innerHTML).to.equal("Hello Frank!");
  expect(component.getEl("hello2").getAttribute("class")).to.equal(null);

  // Make sure the preserved attributes did not change
  expect(component.el.style.border).to.equal("1px solid red");
  expect(component.el.className).to.equal("foo");
  expect(component.el.querySelector("a").href).to.equal("http://www.foo.com/");
};


text:
package org.openfact.ubl;

import org.apache.commons.validator.routines.EmailValidator;
import org.openfact.email.*;
import org.openfact.models.*;
import org.openfact.models.types.DestinyType;
import org.openfact.models.types.SendEventStatus;
import org.openfact.report.ExportFormat;
import org.openfact.report.ReportException;
import org.openfact.report.ReportTemplateConfiguration;
import org.openfact.report.ReportTemplateProvider;

import javax.ejb.Stateless;
import javax.inject.Inject;
import java.util.Arrays;

@Stateless
public class DefaultUBLEmailSender implements UBLEmailSender {

    @Inject
    private EmailTemplateProvider emailTemplateProvider;

    @Inject
    private FileProvider fileProvider;

    @Inject
    private ReportTemplateProvider reportTemplateProvider;

    @Override
    public SendEventModel send(OrganizationModel organization, DocumentModel document, String email, DestinyType destinyType) throws ModelInsuficientData, SendEventException {
        if (email == null || !EmailValidator.getInstance().isValid(email)) {
            throw new ModelInsuficientData("Invalid Email");
        }
        if (organization.getSmtpConfig().size() == 0 && !organization.isMasterMail()) {
            throw new ModelInsuficientData("Could not find a valid smtp configuration on organization");
        }

        // User where the email will be send
        EmailUserModel emailUserDestiny = new EmailUserModel(email);

        try {
            // Attatchments
            FileModel xmlFileModel = document.getXmlAsFile();
            EmailFileModel xmlFile = new EmailFileModel(xmlFileModel.getFile(), document.getDocumentId() + ".xml", "application/xml");

            ReportTemplateConfiguration reportConfig = new ReportTemplateConfiguration(organization);
            byte[] bytes = reportTemplateProvider.getReport(reportConfig, document, ExportFormat.PDF);
            EmailFileModel pdfFile = new EmailFileModel(bytes, document.getDocumentId() + ".pdf", "application/pdf");

            // Send Email
            EmailTemplateConfiguration emailConfig = new EmailTemplateConfiguration(organization, emailUserDestiny).setAttachments(Arrays.asList(xmlFile, pdfFile));
            emailTemplateProvider.sendDocument(emailConfig, document);

            // Write event to the database
            SendEventModel sendEvent = document.addSendEvent(destinyType);
            sendEvent.setDescription("Document successfully sended");
            sendEvent.setResult(SendEventStatus.SUCCESS);

            return sendEvent;
        } catch (ReportException e) {
            throw new SendEventException("Could not generate pdf report to attach file", e);
        } catch (EmailException e) {
            throw new SendEventException("Could not send email", e);
        }
    }

}


text:
package com.structurizr.analysis.reflections.supportingTypes.myapp.util;

public class RowMapperHelper {
}


text:
title: About
permalink: "/about/"
subtitle:
image-cover: "/uploads/Screen%20Shot%202017-12-27%20at%208.28.31%20PM.png"
title-text: About Me
storys:
- text:
  image: "/uploads/About%20Me_Collage.jpg"
- text:
  image:
- text:
  image:
- text:
  image:
layout: about
---

Born and raised in New Delhi, Varun Chopra graduated from LMU School of Film and Television in LA where he focused on stories of common people with aspects of social justice. He was the recipient of the SFTV Dean's Scholarship. At 23, He became the youngest Indian national to screen at Cannes. His films have screened at various International film festivals and screenings. He was recently featured in LA Times among a team of diverse filmmakers on a discussion on diversity in Hollywood. Varun works in LA as a freelance director and is currently editing a TV Show streaming on Netflix. He is one of the seven fellows of Visual Communication's Armed with a Camera fellowship for 2017-18. He was recently selected as a Sundance Ignite Fellow 2018.

# Press & Interviews

![51_Outlook.png](/uploads/outlook1.png)
![la-times-logo-transparent.png](/uploads/LATIMES1.png)
![TOI.png](/uploads/TOI1.png)
![LMU_LA_logo.png](/uploads/LMULA1.png)
![yahoo.png](/uploads/yahoo1.png)
![Film school shorst.png](/uploads/FSS1.png)
![bs_logo-7678fa077215de67e462cca4764c2d5b4ced5773f878ab7c60391c9e3435c39a.png](/uploads/BS1.png)
![pioneer.png](/uploads/pioneer1.png)
![ani.png](/uploads/ani1.png)

# Contact

Shoot me an [email](mailto:varun0693@gmail.com) and say hi!


text:
{% extends "base.html" %}
{% block content %}

How many courses do you need to schedule?

    <form action="/how_many" method="POST">
        <input type="text" name="course_amount" value="6">

        <input type="submit" name="amount-form" value="Send">
    </form>
{% endblock %}


text:
bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package --genrule_strategy=standalone --spawn_strategy=standalone --verbose_failures || exit 1
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

source /data-local/wchan/tensorflow_env/bin/activate
pip install --upgrade /tmp/tensorflow_pkg/*


text:
ShareYourWay
============

A website about sharing stories


text:
<?xml version="1.0"?>
<project name="MXUnit Framework Build" default="package" basedir=".">
	<description>
		Build file for moving all files into a directory structure easily zippable and deployable
	</description>

	<target name="init">
		<tstamp>
			<format pattern="MM_dd_yyyy" property="nightlystamp" />
			<format pattern="MM/dd/yyyy" property="nightlydate" />
		</tstamp>

		<property name="dist" location="dist" />
		<property name="nightlyfile" location="dist/mxunit-nightly-${nightlystamp}.zip" />
		<property name="unames.file" value="buildprops/unames.properties" />
		<property name="version.file" value="buildprops/version.properties" />
		<property name="version.nightlyfile" value="buildprops/nightlyversion.properties" />
		<property name="readme.file" value="README.txt" />
		<property name="readme.nightlyfile" value="README.nightly" />
		<property name="antrunner.file" value="buildprops/antrunner.properties" />
		<property name="testmailmessage.file" value="buildprops/testresultsmail.html" />

		<property file="${unames.file}" />

		<property file="${antrunner.file}" />

		<property name="mxunit.jar" value="ant/lib/mxunit-ant.jar" />
		<property name="junit.out.dir.xml" value="tests/testresults/${server}_${port}" />
		<property name="junit.out.dir.html" value="${junit.out.dir.xml}/html" />
		<property name="output.dir" value="${junit.out.dir.xml}/tmp" />
		<property name="style.dir" value="ant/xsl/" />

		<path id="project.classpath">
			<fileset dir="lib">
				<include name="*.jar" />
			</fileset>
		</path>
		<taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpath="${mxunit.jar}" />
		<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="project.classpath" />
	</target>

	<target name="clean" depends="init">
		<mkdir dir="${dist}" />

		<delete failonerror="false">
			<fileset dir="${dist}" includes="*.zip" />
		</delete>

		<delete failonerror="false">
			<fileset dir="framework/generated" includes="*.*" />
		</delete>
	</target>

	<target name="publish" depends="runTests,incrementVersion,package,upload,updatewebsite,publishTestResults" description="--> packages into a zip and uploads to google code" />

	<target name="publishGitRelease" depends="runTests,incrementVersion,package">
		<gitPushBuildChanges remoteName="upstream" branchName="master"/>
		<gitTag remoteName="upstream" tagName="v${build.version}" message="Version ${build.version}" />
	</target>

	<target name="publishNightly" depends="runTests,updateNightlyFiles,packageNightly" description="--> publishes the nightly build to github">
		<gitPushBuildChanges remoteName="upstream" branchName="develop"/>
		<gitTag remoteName="upstream" tagName="nightly_latest_stable_build"/>
	</target>

	<target name="package" depends="clean,getVersion,genApiDocs" description="--> packages the appropriate files into the deployment-ready zip file. use this for testing; otherwise, use publish">
		<echo message="building ${zipfile}. basedir is  ${basedir}" />
		<zip destfile="${zipfile}" casesensitive="false">
			<zipfileset dir="${basedir}" includes="*.*,ant/,buildprops/,eclipse/,doc/,framework/,generator/,images/,PluginDemoTests/,resources/,runner/,samples/,tests/,lib/ant-contrib**,utils/" excludes=".settings/,.git/,.gitignore,MXUnitInstallTest.cfc,**/testresults/,**/stats/,**/junithtml/,.project,.deployment,**/unames.properties,tests/tmp/,ftp.listing,**/*.db,**/copysnippets.properties,**/copydictionary**,**/*.bak,buildprops/nightlyversion.properties,buildprops/testresultsmail.html,settings.xml,README.html,README.textile,README-toc.xml,**/.gitignore" prefix="mxunit" casesensitive="false" />
		</zip>
	</target>

	<target name="packageNightly" depends="package" description="--> packages the appropriate files into the deployment-ready nightly build zip file. Use this for testing; otherwise, use publishNightly">
		<move file="${zipfile}" tofile="${nightlyfile}"/>
	</target>

	<target name="runTests" depends="init">

		<delete dir="${junit.out.dir.html}" />
		<delete dir="${output.dir}" />

		<mkdir dir="${junit.out.dir.html}" />
		<mkdir dir="${output.dir}" />

		<property name="context" value="" />

		<mxunittask server="${server}" port="${port}" defaultrunner="${context}/mxunit/runner/HttpAntRunner.cfc" outputdir="${output.dir}" verbose="true" testResultsSummary="my.summary" failureproperty="testsfailed">
			<directory remoteMethod="run" path="${webroot}/mxunit/tests/framework/" packageName="mxunit.tests.framework" componentPath="mxunit.tests.framework" recurse="false" includes="*.cfc" excludes="" />
			<directory remoteMethod="run" path="${webroot}/mxunit/tests/mightymock/" packageName="mxunit.tests.mightymock" componentPath="mxunit.tests.mightymock" recurse="false" includes="*.cfc" excludes="" />
			<directory remoteMethod="run" path="${webroot}/mxunit/tests/runner" packageName="mxunit.tests.runner" componentPath="mxunit.tests.runner" recurse="false" includes="*.cfc" excludes="" />
		</mxunittask>

		<fail if="testsfailed" message="Failing the build because tests failed" />
	</target>

	<target name="incrementVersion" depends="init">
		<propertyfile file="${version.file}" comment="Build version info">
			<entry key="build.date" type="date" value="now" pattern="MM/dd/yyyy" />
			<entry key="build.major" type="int" operation="=" value="2" />
			<entry key="build.minor" type="int" operation="=" value="1" />
			<entry key="build.notation" operation="=" value="" />
			<entry key="build.versiondescription" operation="=" value="Release" />

			<entry key="build.buildnum" type="int" operation="+" value="1" />
		</propertyfile>
		<property file="${version.file}" />

		<echoproperties prefix="build" />
	</target>

	<target name="getVersion" depends="init">
		<property file="${version.file}" />

		<property name="build.version" value="${build.major}.${build.minor}.${build.buildnum}${build.notation}" />
		<property name="zipfile" location="${dist}${file.separator}mxunit-${build.version}.zip" />

		<echo message="build.version is ${build.version} -- zipfile is ${zipfile}" />

	</target>

	<target name="upload" depends="getVersion">
		<input message="Please add a summary for this version" addproperty="build.summary" defaultvalue="MXUnit Unit Test Framework version ${build.version}" />

		<taskdef classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask" classpathref="project.classpath" name="gcupload" />

		<gcupload username="${gc.username}" password="${gc.password}" projectname="mxunit" filename="${zipfile}" targetfilename="mxunit-${build.version}.zip" summary="${build.summary}" />
	</target>

	<target name="updatewebsite" depends="getVersion">

		<ftp server="${ftp.site}" userid="${ftp.username}" password="${ftp.password}" remotedir="">
			<fileset dir="buildprops">
				<include name="version.properties" />
			</fileset>
		</ftp>

		<loadresource property="homepage">

			<url url="http://mxunit.org/index.cfm?reinit=true" />
		</loadresource>
	</target>

	<target name="genApiDocs" depends="init">

		<delete dir="doc/api" failonerror="false"/>
		<mkdir dir="doc/api" />


text:
"""
config tests.
"""

import os
import pickle
import platform
import sys
from unittest import mock

import git
import numpy as np
import pytest
import wandb
from wandb import env
from wandb import wandb_sdk
from wandb.errors import MultiprocessError, UsageError
from wandb.proto.wandb_internal_pb2 import RunPreemptingRecord

def test_run_step_property(fake_run):
    run = fake_run()
    run.log(dict(this=1))
    run.log(dict(that=2))

    assert run.step == 2

def test_deprecated_run_log_sync(fake_run, capsys):
    run = fake_run()
    run.log(dict(this=1), sync=True)
    _, stderr = capsys.readouterr()
    assert (
        "`sync` argument is deprecated and does not affect the behaviour of `wandb.log`"
        in stderr
    )

def test_run_log_mp_warn(fake_run, capsys):
    run = fake_run()
    _init_pid = run._init_pid
    run._init_pid = _init_pid + 1
    run.log(dict(this=1))
    _, stderr = capsys.readouterr()
    assert (
        f"`log` ignored (called from pid={os.getpid()}, `init` called from pid={run._init_pid})"
        in stderr
    )
    run._init_pid = _init_pid

@pytest.mark.skipif(
    os.environ.get("WANDB_REQUIRE_SERVICE"), reason="different behavior with service"
)
def test_run_log_mp_error(test_settings):
    test_settings.update({"strict": True})
    run = wandb.init(settings=test_settings)
    _init_pid = run._init_pid
    run._init_pid = _init_pid + 1
    with pytest.raises(MultiprocessError) as excinfo:
        run.log(dict(this=1))
        assert "`log` does not support multiprocessing" in str(excinfo.value)
    run._init_pid = _init_pid
    run.finish()

def test_run_basic():
    s = wandb.Settings()
    c = dict(param1=2, param2=4)
    run = wandb_sdk.wandb_run.Run(settings=s, config=c)
    assert dict(run.config) == dict(param1=2, param2=4)

def test_run_sweep():
    s = wandb.Settings()
    c = dict(param1=2, param2=4)
    sw = dict(param3=9)
    run = wandb_sdk.wandb_run.Run(settings=s, config=c, sweep_config=sw)
    assert dict(run.config) == dict(param1=2, param2=4, param3=9)

def test_run_sweep_overlap():
    s = wandb.Settings()
    c = dict(param1=2, param2=4)
    sw = dict(param2=8, param3=9)
    run = wandb_sdk.wandb_run.Run(settings=s, config=c, sweep_config=sw)
    assert dict(run.config) == dict(param1=2, param2=8, param3=9)

def test_run_pub_config(fake_run, record_q, records_util):
    run = fake_run()
    run.config.t = 1
    run.config.t2 = 2

    r = records_util(record_q)
    assert len(r.records) == 2
    assert len(r.summary) == 0
    configs = r.configs
    assert len(configs) == 2
    # TODO(jhr): check config vals

def test_run_pub_history(fake_run, record_q, records_util):
    run = fake_run()
    run.log(dict(this=1))
    run.log(dict(that=2))

    r = records_util(record_q)
    assert len(r.records) == 2
    assert len(r.summary) == 0
    history = r.history or r.partial_history
    assert len(history) == 2
    # TODO(jhr): check history vals

@pytest.mark.skipif(
    platform.system() == "Windows",
    reason="numpy.float128 does not exist on windows",
)
@pytest.mark.skipif(
    platform.system() == "Darwin" and platform.machine() == "arm64",
    reason="numpy.float128 does not exist on Macs with the Apple M1 chip",
)
def test_numpy_high_precision_float_downcasting(fake_run, record_q, records_util):
    # CLI: GH2255
    run = fake_run()
    run.log(dict(this=np.float128(0.0)))
    r = records_util(record_q)
    assert len(r.records) == 1
    assert len(r.summary) == 0
    history = r.history or r.partial_history
    assert len(history) == 1

    found = False
    for item in history[0].item:
        if item.key == "this":
            assert item.value_json == "0.0"
            found = True
    assert found

def test_log_code_settings(live_mock_server, test_settings):
    with open("test.py", "w") as f:
        f.write('print("test")')
    test_settings.update(
        save_code=True, code_dir=".", source=wandb.sdk.wandb_settings.Source.INIT
    )
    run = wandb.init(settings=test_settings)
    run.finish()
    ctx = live_mock_server.get_ctx()
    artifact_name = list(ctx["artifacts"].keys())[0]
    assert artifact_name == wandb.util.make_artifact_name_safe(
        f"source-{run._project}-{run._settings.program_relpath}"
    )

@pytest.mark.parametrize("save_code", [True, False])
def test_log_code_env(live_mock_server, test_settings, save_code):
    # test for WB-7468
    with mock.patch.dict("os.environ", WANDB_SAVE_CODE=str(save_code).lower()):
        with open("test.py", "w") as f:
            f.write('print("test")')

        # simulate user turning on code saving in UI
        live_mock_server.set_ctx({"code_saving_enabled": True})
        test_settings.update(
            save_code=None,
            source=wandb.sdk.wandb_settings.Source.BASE,
        )
        test_settings.update(
            code_dir=".", source=wandb.sdk.wandb_settings.Source.SETTINGS
        )
        run = wandb.init(settings=test_settings)
        assert run._settings.save_code is save_code
        run.finish()

        ctx = live_mock_server.get_ctx()
        artifact_names = list(ctx["artifacts"].keys())
        if save_code:
            assert artifact_names[0] == wandb.util.make_artifact_name_safe(
                f"source-{run._project}-{run._settings.program_relpath}"
            )
        else:
            assert len(artifact_names) == 0

def test_log_code(test_settings):
    run = wandb.init(mode="offline", settings=test_settings)
    with open("test.py", "w") as f:
        f.write('print("test")')
    with open("big_file.h5", "w") as f:
        f.write("Not that big")
    art = run.log_code()
    assert sorted(art.manifest.entries.keys()) == ["test.py"]
    run.finish()

def test_log_code_include(test_settings):
    run = wandb.init(mode="offline", settings=test_settings)
    with open("test.py", "w") as f:
        f.write('print("test")')
    with open("test.cc", "w") as f:
        f.write("Not that big")
    art = run.log_code(include_fn=lambda p: p.endswith(".py") or p.endswith(".cc"))
    assert sorted(art.manifest.entries.keys()) == ["test.cc", "test.py"]
    run.finish()

def test_log_code_custom_root(test_settings):
    with open("test.py", "w") as f:
        f.write('print("test")')
    os.mkdir("custom")
    os.chdir("custom")
    with open("test.py", "w") as f:
        f.write('print("test")')
    run = wandb.init(mode="offline", settings=test_settings)
    art = run.log_code(root="../")
    assert sorted(art.manifest.entries.keys()) == ["custom/test.py", "test.py"]
    run.finish()

def test_display(test_settings):
    run = wandb.init(mode="offline", settings=test_settings)
    assert run.display() is False
    run.finish()

def test_mark_preempting(fake_run, record_q, records_util):
    run = fake_run()
    run.log(dict(this=1))
    run.log(dict(that=2))
    run.mark_preempting()

    r = records_util(record_q)
    assert len(r.records) == 3
    assert type(r.records[-1]) == RunPreemptingRecord

def test_except_hook(test_settings):
    # Test to make sure we respect excepthooks by 3rd parties like pdb
    errs = []
    hook = lambda etype, val, tb: errs.append(str(val))
    sys.excepthook = hook

    # We cant use raise statement in pytest context
    raise_ = lambda exc: sys.excepthook(type(exc), exc, None)

    raise_(Exception("Before wandb.init()"))

    run = wandb.init(mode="offline", settings=test_settings)

    old_stderr_write = sys.stderr.write
    stderr = []
    sys.stderr.write = stderr.append

    raise_(Exception("After wandb.init()"))

    assert errs == ["Before wandb.init()", "After wandb.init()"]

    # make sure wandb prints the traceback
    assert "".join(stderr) == "Exception: After wandb.init()\n"

    sys.stderr.write = old_stderr_write
    run.finish()

def assertion(run_id, found, stderr):
    msg = (
        "`resume` will be ignored since W&B syncing is set to `offline`. "
        f"Starting a new run with run id {run_id}"
    )
    return msg in stderr if found else msg not in stderr

@pytest.mark.parametrize(
    "resume, found",
    [
        ("auto", True),
        ("allow", True),
        ("never", True),
        ("must", True),
        ("", False),
        (0, False),
        (True, True),
        (None, False),
    ],
)
def test_offline_resume(test_settings, capsys, resume, found):
    run = wandb.init(mode="offline", resume=resume, settings=test_settings)
    captured = capsys.readouterr()
    assert assertion(run.id, found, captured.err)
    run.finish()

@pytest.mark.parametrize("empty_query", [True, False])
@pytest.mark.parametrize("local_none", [True, False])
@pytest.mark.parametrize("outdated", [True, False])
def test_local_warning(
    live_mock_server, test_settings, capsys, outdated, empty_query, local_none
):
    live_mock_server.set_ctx(
        {"out_of_date": outdated, "empty_query": empty_query, "local_none": local_none}
    )
    run = wandb.init(settings=test_settings)
    run.finish()
    captured = capsys.readouterr().err

    msg = "version of W&B Local to get the latest features"

    if empty_query:
        assert msg in captured
    elif local_none:
        assert msg not in captured
    else:
        assert msg in captured if outdated else msg not in captured

@pytest.mark.parametrize("project_name", ["test:?", "test" * 33])
def test_invalid_project_name(live_mock_server, project_name):
    with pytest.raises(UsageError) as e:
        wandb.init(project=project_name)
        assert 'Invalid project name "{project_name}"' in str(e.value)

def test_use_artifact_offline(live_mock_server, test_settings):
    run = wandb.init(mode="offline")
    with pytest.raises(Exception) as e_info:
        run.use_artifact("boom-data")
        assert str(e_info.value) == "Cannot use artifact when in offline mode."
    run.finish()

@pytest.mark.skip(
    reason=(
        "mock server enforces entity=mock_server_entity and project=test,"
        "this should only work on a live server, or mock_server would need customization."
    )
)
def test_run_urls(live_mock_server, test_settings):
    base_url = "https://my.cool.site.com"
    entity = "me"
    project = "lol"
    test_settings.update(base_url=base_url, entity=entity, project=project)
    run = wandb.init(settings=test_settings)
    assert run.get_project_url() == f"{base_url}/{entity}/{project}"
    assert run.get_url() == f"{base_url}/{entity}/{project}/runs/{run.id}"
    run.finish()

def test_use_artifact(live_mock_server, test_settings):
    run = wandb.init(settings=test_settings)
    artifact = wandb.Artifact("arti", type="dataset")
    run.use_artifact(artifact)
    artifact.wait()
    assert artifact.digest == "abc123"
    run.finish()

def test_artifacts_in_config(live_mock_server, test_settings, parse_ctx):
    run = wandb.init(settings=test_settings)

    artifact = run.use_artifact("boom-data")
    logged_artifact = wandb.Artifact("my-arti", type="dataset")
    run.log_artifact(logged_artifact)
    logged_artifact.wait()
    run.config.dataset = artifact
    run.config.logged_artifact = logged_artifact
    run.config.update({"myarti": artifact})
    with pytest.raises(ValueError) as e_info:
        run.config.nested_dataset = {"nested": artifact}
        assert (
            str(e_info.value)
            == "Instances of wandb.Artifact and wandb.apis.public.Artifact can only be top level keys in wandb.config"
        )

    with pytest.raises(ValueError) as e_info:
        run.config.dict_nested = {"one_nest": {"two_nest": artifact}}
        assert (
            str(e_info.value)
            == "Instances of wandb.Artifact and wandb.apis.public.Artifact can only be top level keys in wandb.config"
        )

    with pytest.raises(ValueError) as e_info:
        run.config.update({"one_nest": {"two_nest": artifact}})
        assert (
            str(e_info.value)
            == "Instances of wandb.Artifact and wandb.apis.public.Artifact can only be top level keys in wandb.config"
        )
    run.finish()
    ctx = parse_ctx(live_mock_server.get_ctx())
    assert ctx.config_user["dataset"] == {
        "_type": "artifactVersion",
        "_version": "v0",
        "id": artifact.id,
        "version": "v0",
        "sequenceName": artifact._sequence_name,
        "usedAs": "dataset",
    }

    assert ctx.config_user["myarti"] == {
        "_type": "artifactVersion",
        "_version": "v0",
        "id": artifact.id,
        "version": "v0",
        "sequenceName": artifact._sequence_name,
        "usedAs": "myarti",
    }

    assert ctx.config_user["logged_artifact"] == {
        "_type": "artifactVersion",
        "_version": "v0",
        "id": logged_artifact.id,
        "version": "v0",
        "sequenceName": logged_artifact.name.split(":")[0],
        "usedAs": "logged_artifact",
    }

def test_unlogged_artifact_in_config(live_mock_server, test_settings):
    run = wandb.init(settings=test_settings)
    artifact = wandb.Artifact("my-arti", type="dataset")
    with pytest.raises(Exception) as e_info:
        run.config.dataset = artifact
        assert (
            str(e_info.value)
            == "Cannot json encode artifact before it has been logged or in offline mode."
        )
    run.finish()

def test_artifact_string_run_config_init(live_mock_server, test_settings, parse_ctx):
    config = {"dataset": "wandb-artifact://entity/project/boom-data"}
    run = wandb.init(settings=test_settings, config=config)
    run.finish()
    ctx = parse_ctx(live_mock_server.get_ctx())

    assert ctx.config_user["dataset"] == {
        "_type": "artifactVersion",
        "_version": "v0",
        "id": run.config.dataset.id,
        "version": "v0",
        "sequenceName": run.config.dataset._sequence_name,
        "usedAs": "dataset",
    }

def test_artifact_string_run_config_set_item(
    runner, live_mock_server, test_settings, parse_ctx
):
    run = wandb.init(settings=test_settings)
    run.config.dataset = (
        f"wandb-artifact://{test_settings.base_url}/entity/project/boom-data"
    )
    run.finish()
    ctx = parse_ctx(live_mock_server.get_ctx())
    assert ctx.config_user["dataset"] == {
        "_type": "artifactVersion",
        "_version": "v0",
        "id": run.config.dataset.id,
        "version": "v0",
        "sequenceName": run.config.dataset._sequence_name,
        "usedAs": "dataset",
    }

def test_artifact_string_digest_run_config_update(
    runner, live_mock_server, test_settings, parse_ctx
):
    run = wandb.init(settings=test_settings)
    run.config.update({"dataset": "wandb-artifact://_id/abc123"})
    run.finish()
    ctx = parse_ctx(live_mock_server.get_ctx())
    assert ctx.config_user["dataset"] == {
        "_type": "artifactVersion",
        "_version": "v0",
        "id": run.config.dataset.id,
        "version": "v0",
        "sequenceName": run.config.dataset._sequence_name,
        "usedAs": "dataset",
    }

def test_artifact_string_digest_run_config_init(
    live_mock_server, test_settings, parse_ctx
):
    config = {"dataset": "wandb-artifact://_id/abc123"}
    run = wandb.init(settings=test_settings, config=config)
    run.finish()
    ctx = parse_ctx(live_mock_server.get_ctx())

    assert ctx.config_user["dataset"] == {
        "_type": "artifactVersion",
        "_version": "v0",
        "id": run.config.dataset.id,
        "version": "v0",
        "sequenceName": run.config.dataset._sequence_name,
        "usedAs": "dataset",
    }

def test_artifact_string_digest_run_config_set_item(
    runner, live_mock_server, test_settings, parse_ctx
):
    run = wandb.init(settings=test_settings)
    run.config.dataset = f"wandb-artifact://{test_settings.base_url}/_id/abc123"
    run.finish()
    ctx = parse_ctx(live_mock_server.get_ctx())
    assert ctx.config_user["dataset"] == {
        "_type": "artifactVersion",
        "_version": "v0",
        "id": run.config.dataset.id,
        "version": "v0",
        "sequenceName": run.config.dataset._sequence_name,
        "usedAs": "dataset",
    }

def test_artifact_string_run_config_update(
    runner, live_mock_server, test_settings, parse_ctx
):
    run = wandb.init(settings=test_settings)
    run.config.update({"dataset": "wandb-artifact://entity/project/boom-data"})
    run.finish()
    ctx = parse_ctx(live_mock_server.get_ctx())
    assert ctx.config_user["dataset"] == {
        "_type": "artifactVersion",
        "_version": "v0",
        "id": run.config.dataset.id,
        "version": "v0",
        "sequenceName": run.config.dataset._sequence_name,
        "usedAs": "dataset",
    }

def test_public_artifact_run_config_init(
    live_mock_server, test_settings, api, parse_ctx
):
    art = api.artifact("entity/project/mnist:v0", type="dataset")
    config = {"dataset": art}
    run = wandb.init(settings=test_settings, config=config)
    assert run.config.dataset == art
    run.finish()
    ctx = parse_ctx(live_mock_server.get_ctx())
    assert ctx.config_user["dataset"] == {
        "_type": "artifactVersion",
        "_version": "v0",
        "id": art.id,
        "version": "v0",
        "sequenceName": art._sequence_name,
        "usedAs": "dataset",
    }

def test_public_artifact_run_config_set_item(
    live_mock_server, test_settings, api, parse_ctx
):
    art = api.artifact("entity/project/mnist:v0", type="dataset")
    run = wandb.init(settings=test_settings)
    run.config.dataset = art
    assert run.config.dataset == art
    run.finish()
    ctx = parse_ctx(live_mock_server.get_ctx())
    assert ctx.config_user["dataset"] == {
        "_type": "artifactVersion",
        "_version": "v0",
        "id": art.id,
        "version": "v0",
        "sequenceName": art._sequence_name,
        "usedAs": "dataset",
    }

def test_public_artifact_run_config_update(
    live_mock_server, test_settings, api, parse_ctx
):
    art = api.artifact("entity/project/mnist:v0", type="dataset")
    config = {"dataset": art}
    run = wandb.init(settings=test_settings)
    run.config.update(config)
    assert run.config.dataset == art
    run.finish()
    ctx = parse_ctx(live_mock_server.get_ctx())
    assert ctx.config_user["dataset"] == {
        "_type": "artifactVersion",
        "_version": "v0",
        "id": art.id,
        "version": "v0",
        "sequenceName": art._sequence_name,
        "usedAs": "dataset",
    }

def test_wandb_artifact_init_config(runner, live_mock_server, test_settings, parse_ctx):
    with runner.isolated_filesystem():
        open("file1.txt", "w").write("hello")
        artifact = wandb.Artifact("test_reference_download", "dataset")
        artifact.add_file("file1.txt")
        artifact.add_reference(
            "https://wandb-artifacts-refs-public-test.s3-us-west-2.amazonaws.com/StarWars3.wav"
        )
        config = {"test_reference_download": artifact}
        run = wandb.init(settings=test_settings, config=config)
        assert run.config.test_reference_download == artifact
        run.finish()
        ctx = parse_ctx(live_mock_server.get_ctx())
        assert ctx.config_user["test_reference_download"] == {
            "_type": "artifactVersion",
            "_version": "v0",
            "id": artifact.id,
            "version": "v0",
            "sequenceName": artifact.name.split(":")[0],
            "usedAs": "test_reference_download",
        }

def test_wandb_artifact_config_set_item(
    runner, live_mock_server, test_settings, parse_ctx
):
    with runner.isolated_filesystem():
        open("file1.txt", "w").write("hello")
        artifact = wandb.Artifact("test_reference_download", "dataset")
        artifact.add_file("file1.txt")
        artifact.add_reference(
            "https://wandb-artifacts-refs-public-test.s3-us-west-2.amazonaws.com/StarWars3.wav"
        )
        run = wandb.init(settings=test_settings)
        run.config.test_reference_download = artifact
        assert run.config.test_reference_download == artifact
        run.finish()
        ctx = parse_ctx(live_mock_server.get_ctx())
        assert ctx.config_user["test_reference_download"] == {
            "_type": "artifactVersion",
            "_version": "v0",
            "id": artifact.id,
            "version": "v0",
            "sequenceName": artifact.name.split(":")[0],
            "usedAs": "test_reference_download",
        }

def test_wandb_artifact_config_update(
    runner, live_mock_server, test_settings, parse_ctx
):
    with runner.isolated_filesystem():
        open("file1.txt", "w").write("hello")
        artifact = wandb.Artifact("test_reference_download", "dataset")
        artifact.add_file("file1.txt")
        artifact.add_reference(
            "https://wandb-artifacts-refs-public-test.s3-us-west-2.amazonaws.com/StarWars3.wav"
        )
        with wandb.init(settings=test_settings) as run:
            run.config.update({"test_reference_download": artifact})

            assert run.config.test_reference_download == artifact

        ctx = parse_ctx(live_mock_server.get_ctx())
        config_art = {
            "_type": "artifactVersion",
            "_version": "v0",
            "id": artifact.id,
            "version": "v0",
            "sequenceName": artifact.name.split(":")[0],
            "usedAs": "test_reference_download",
        }
        assert ctx.config_user["test_reference_download"] == config_art

        with wandb.init(settings=test_settings) as run:
            run.config.update({"test_reference_download": config_art})
            assert run.config.test_reference_download.id == artifact.id

def test_media_in_config(runner, live_mock_server, test_settings, parse_ctx):
    with runner.isolated_filesystem():
        run = wandb.init(settings=test_settings)
        with pytest.raises(ValueError):
            run.config["image"] = wandb.Image(np.random.randint(0, 255, (100, 100, 3)))

def test_deprecated_feature_telemetry(live_mock_server, test_settings, parse_ctx):
    run = wandb.init(
        config_include_keys=("lol",),
        settings=test_settings,
    )
    # use deprecated features
    deprecated_features = [
        run.mode,
        run.save(),
        run.join(),
    ]
    ctx_util = parse_ctx(live_mock_server.get_ctx())
    telemetry = ctx_util.telemetry
    # TelemetryRecord field 10 is Deprecated,
    # whose fields 2-4 correspond to deprecated wandb.run features
    # fields 7 & 8 are deprecated wandb.init kwargs
    telemetry_deprecated = telemetry.get("10", [])
    assert (
        (2 in telemetry_deprecated)
        and (3 in telemetry_deprecated)
        and (4 in telemetry_deprecated)
        and (7 in telemetry_deprecated)
    )

# test that information about validation errors in wandb.Settings is included in telemetry
def test_settings_validation_telemetry(
    live_mock_server, test_settings, parse_ctx, capsys
):
    test_settings.update(api_key=123)
    captured = capsys.readouterr().err
    msg = "Invalid value for property api_key: 123"
    assert msg in captured
    run = wandb.init(settings=test_settings)
    ctx_util = parse_ctx(live_mock_server.get_ctx())
    telemetry = ctx_util.telemetry
    # TelemetryRecord field 11 is Issues,
    # whose field 1 corresponds to validation warnings in Settings
    telemetry_issues = telemetry.get("11", [])
    assert 1 in telemetry_issues
    run.finish()

# test that information about validation errors in wandb.Settings is included in telemetry
def test_settings_preprocessing_telemetry(
    live_mock_server, test_settings, parse_ctx, capsys
):
    with mock.patch.dict("os.environ", WANDB_QUIET="cat"):
        run = wandb.init(settings=test_settings)
        captured = capsys.readouterr().err
        msg = "Unable to preprocess value for property quiet: cat"
        assert msg in captured and "This will raise an error in the future" in captured
        ctx_util = parse_ctx(live_mock_server.get_ctx())
        telemetry = ctx_util.telemetry
        # TelemetryRecord field 11 is Issues,
        # whose field 3 corresponds to preprocessing warnings in Settings
        telemetry_issues = telemetry.get("11", [])
        assert 3 in telemetry_issues
        run.finish()

def test_settings_unexpected_args_telemetry(
    runner, live_mock_server, parse_ctx, capsys
):
    with runner.isolated_filesystem():
        run = wandb.init(settings=wandb.Settings(blah=3))
        captured = capsys.readouterr().err
        msg = "Ignoring unexpected arguments: ['blah']"
        assert msg in captured
        ctx_util = parse_ctx(live_mock_server.get_ctx())
        telemetry = ctx_util.telemetry
        # TelemetryRecord field 11 is Issues,
        # whose field 2 corresponds to unexpected arguments in Settings
        telemetry_issues = telemetry.get("11", [])
        assert 2 in telemetry_issues
        run.finish()

def test_attach_same_process(test_settings):
    with mock.patch.dict("os.environ", WANDB_REQUIRE_SERVICE="True"):
        with pytest.raises(RuntimeError) as excinfo:
            run = wandb.init(settings=test_settings)
            new_run = pickle.loads(pickle.dumps(run))
            new_run.log({"a": 2})
    assert "attach in the same process is not supported" in str(excinfo.value)

def test_init_with_settings(live_mock_server, test_settings):
    # test that when calling `wandb.init(settings=wandb.Settings(...))`,
    # the settings are passed with Source.INIT as the source
    test_settings.update(_disable_stats=True)
    run = wandb.init(settings=test_settings)
    assert run.settings._disable_stats
    assert (
        run.settings.__dict__["_disable_stats"].source
        == wandb_sdk.wandb_settings.Source.INIT
    )
    run.finish()

def test_repo_job_creation(live_mock_server, test_settings, git_repo_fn):
    _ = git_repo_fn(commit_msg="initial commit")
    test_settings.update(
        {"enable_job_creation": True, "program_relpath": "./blah/test_program.py"}
    )
    run = wandb.init(settings=test_settings)
    run.finish()
    ctx = live_mock_server.get_ctx()
    artifact_name = list(ctx["artifacts"].keys())[0]
    assert artifact_name == wandb.util.make_artifact_name_safe(
        f"job-{run._settings.git_remote_url}_{run._settings.program_relpath}"
    )

def test_artifact_job_creation(live_mock_server, test_settings, runner):
    with runner.isolated_filesystem():
        with open("test.py", "w") as f:
            f.write('print("test")')
        test_settings.update(
            {
                "enable_job_creation": True,
                "disable_git": True,
                "program_relpath": "./blah/test_program.py",
            }
        )
        run = wandb.init(settings=test_settings)
        run.log_code()
        run.finish()
        ctx = live_mock_server.get_ctx()
        code_artifact_name = list(ctx["artifacts"].keys())[0]
        job_artifact_name = list(ctx["artifacts"].keys())[1]
        assert job_artifact_name == f"job-{code_artifact_name}"

def test_container_job_creation(live_mock_server, test_settings):
    test_settings.update({"enable_job_creation": True, "disable_git": True})
    with mock.patch.dict("os.environ", WANDB_DOCKER="dummy-container:v0"):
        run = wandb.init(settings=test_settings)
        run.finish()
        ctx = live_mock_server.get_ctx()
        artifact_name = list(ctx["artifacts"].keys())[0]
        assert artifact_name == "job-dummy-container_v0"

def test_manual_git_run_metadata_from_settings(live_mock_server, test_settings):
    remote_url = "git@github.com:me/my-repo.git"
    commit = "29c15e893e36efad84001f4484b4813fbacd55a0"
    test_settings.update(
        {
            "git_remote_url": remote_url,
            "git_commit": commit,
        }
    )
    run = wandb.init(settings=test_settings)
    run.finish()
    ctx = live_mock_server.get_ctx()
    assert ctx["git"]["remote"] == remote_url
    assert ctx["git"]["commit"] == commit

def test_manual_git_run_metadata_from_environ(live_mock_server, test_settings):
    remote_url = "git@github.com:me/my-repo.git"
    commit = "29c15e893e36efad84001f4484b4813fbacd55a0"
    with mock.patch.dict(
        os.environ,
        {
            env.GIT_REMOTE_URL: remote_url,
            env.GIT_COMMIT: commit,
        },
    ):
        run = wandb.init(settings=test_settings)
        run.finish()

    ctx = live_mock_server.get_ctx()
    assert ctx["git"]["remote"] == remote_url
    assert ctx["git"]["commit"] == commit

def test_git_root(runner, live_mock_server, test_settings):
    path = "./foo"
    remote_url = "https://foo:@github.com/FooTest/Foo.git"
    with runner.isolated_filesystem():
        with git.Repo.init(path) as repo:
            repo.create_remote("origin", remote_url)
            repo.index.commit("initial commit")
        with mock.patch.dict(os.environ, {env.GIT_ROOT: path}):
            run = wandb.init(settings=test_settings)
            run.finish()
        ctx = live_mock_server.get_ctx()
        assert ctx["git"]["remote"] == repo.remote().url
        assert ctx["git"]["commit"] == repo.head.commit.hexsha


text:
module FlexCP
  class Loader

    def initialize
      db = Mongo::Connection.new.db('flexcp')
      @projects = db['projects']
      @trajectories = db['trajectories']
    end

    def help
      puts 'Usage: flexcp load <project> <height> <file>'
    end

    def load(project_name, height, filename)
      project = get_project(project_name)

      if project
        if !project['trajectories'].include?(height)
          @projects.update({'_id' => project['_id']}, {'$push' => {"trajectories" => height}})
        end

        @trajectories.remove("_height" => height)
        file = File.new(filename, 'r')
        file.each_line do |row|
          if file.lineno > 1
            columns = row.split("\t")
            content = {
              "_project_id" => project["_id"],
              "_height" => height,
              "toid" => columns.shift.strip,
              "foid" => columns.shift.strip,
              "start_year" => columns.shift.strip,
              "start_month" => columns.shift.strip,
              "start_date" => columns.shift.strip,
              "start_hour" => columns.shift.strip,
              "minute" => columns.shift.strip,
              "fhour" => columns.shift.strip,
              "age_hour" => columns.shift.strip,
              "latitude" => columns.shift.strip,
              "longitude" => columns.shift.strip,
              "height" => columns.shift.strip,
              "press" => columns.shift.strip
            }
            @trajectories.insert(content)
          end
        end
      else
        puts "project '#{project_name}' not found"
      end
    end

    private

    def get_project(project_name)
      @projects.find("name" => project_name).first
    end
  end
end


text:
/*jslint nomen:true, eqeq:true*/
/*global define*/
define([
    'underscore',
    'chaplin',
    'orosync/js/sync',
    'oroui/js/mediator',
    'oroui/js/messenger',
    'orotranslation/js/translator'
], function (_, Chaplin, sync, mediator, messenger, __) {
    'use strict';

    /**
     * Content Management
     *
     * component:
     *  - provides API of page content caching;
     *  - stores content tags for pages;
     *  - listing sever messages for content update;
     *  - shows notification for outdated content;
     *
     * @export oronavigation/js/content-manager
     * @name   oronavigation.contentManager
     * @type {Object}
     */
    var contentManager,

        /**
         * Hash object with relation page URL -> its content
         * @type {Object.<string, Object>}
         */
        pagesCache = {},

        /**
         * Information about current page (URL and tags for current page)
         * @type {Object}
         * {
         *    tags: {Array},
         *    path: {string},
         *    query: {string},
         *    page: {Object.<string, *>}, // object with page content
         *    state: {Object.<string, *>} // each page component can cache own state
         * }
         */
        current = {
            // collect tags and state, even if the page is not initialized
            tags: [],
            state: {}
        },

        /**
         * User ID needed to check whenever update person is the same user
         * @type {String}
         */
        currentUser = null,

        /**
         * Notifier object
         * @type {{close: function()}}
         */
        notifier,

        /**
         * Pages that has been out dated
         * @type {Array}
         */
        outdatedPageHandlers = {};

    /**
     * On URL changes clean up tags collection and set a new URL as current
     *
     * @param {string} path
     * @param {string} query
     */
    function changeUrl(path, query) {
        var item;

        item = pagesCache[path] || {};

        _.extend(item, {
            path: path,
            query: query,
            tags: []
        });

        // define default page and state
        _.defaults(item, {
            page: null,
            state: {}
        });

        // there's no previous page, then collected tags and state belong to current page
        if (current.path == null) {
            _.extend(item.state, current.state);
            item.tags = current.tags;
        }

        current = item;
    }

    /**
     * Default callback on content outdated
     *
     * shows notification of outdated content
     *
     * @param {string} path
     */
    function defaultCallback(path) {
        var page = contentManager.get(path),
            title = page ? '<b>' + page.titleShort + '</b>' : 'the';
        if (notifier) {
            notifier.close();
        }
        notifier = messenger.notificationMessage(
            'warning',
            __("navigation.message.content.outdated", {title: title})
        );
    }

    /**
     * Tags come from server in following structure
     * [
     *  { tagname: TAG, username: AUTHOR},
     *  ...
     *  { tagname: TAG2, username: AUTHOR},
     *  ...
     * ]
     *
     * @param {string} tags
     * @return []
     */
    function prepareTags(tags) {
        tags = _.reject(JSON.parse(tags), function (tag) {
            return (tag.username || null) === currentUser;
        });
        return _.pluck(tags, 'tagname');
    }

    /**
     * Page refresh handler, check whenever
     *
     * @param {string} path
     * @param {Array} callbacks
     */
    function refreshHandler(path, callbacks) {
        if (path === current.path) {
            _.each(callbacks, function (callback) {
                callback(path);
            });
        }
    }

    /**
     * Handler of content update message from server
     *
     * @param {string} tags
     */
    function onUpdate(tags) {
        var pages;
        tags = prepareTags(tags);

        pages = [current].concat(_.values(pagesCache));

        _.each(pages, function (page) {
            var handler, items, path, callbacks;

            callbacks = [];
            items = page.tags;
            path = page.path;

            // collect callbacks for outdated contents
            _.each(items, function (options) {
                if (_.intersection(options.tags, tags).length) {
                    callbacks.push(options.callback || defaultCallback);
                }
            });
            if (!callbacks.length) {
                return false;
            }

            // filter only unique callbacks to protects notification duplication
            callbacks = _.uniq(callbacks);
            if (path === current.path) {
                // current page is outdated - execute all callbacks
                _.each(callbacks, function (callback) {
                    callback(path);
                });
            } else {
                if (!outdatedPageHandlers[path]) {
                    handler = _.partial(refreshHandler, path, callbacks);
                    outdatedPageHandlers[path] = handler;
                    mediator.on('page:update', handler);
                }
            }
            mediator.trigger('content-manager:content-outdated', {
                path: path,
                isCurrentPage: path === current.path
            });
        });
    }

    // handles page request
    mediator.on('page:request', function (args) {
        var path, query;
        path = args.route.path != null ? args.route.path : current.path;
        query = args.route.query != null ? args.route.query : current.query;
        changeUrl(path, query);
        if (notifier) {
            notifier.close();
        }
    });

    // handles page update
    mediator.on('page:update', function (page, args) {
        var options;
        current.page = page;
        options = args.options;
        // if it's forced page reload and page was in a cache, update it
        if (options.cache === true || (options.force === true && contentManager.get())) {
            contentManager.add();
        }
    });

    // subscribes to data update channel
    sync.subscribe('oro/data/update', onUpdate);

    /**
     * Takes url, picks out path and trims root part
     *
     * @param {string} url
     * @returns {*}
     */
    function fetchPath(url) {
        var _ref;
        // it's anchor address inside current page
        if (url[0] === '#') {
            url = current.path;
        }
        _ref = url.split('#')[0].split('?');
        return mediator.execute('retrievePath', _ref[0]);
    }

    contentManager = {
        /**
         * Setups content management component, sets initial URL
         *
         * @param {string} path
         * @param {string} query
         * @param {string} userName
         */
        init: function (path, query, userName) {
            changeUrl(path, query);
            currentUser = userName;
        },

        /**
         * Stores content related tags for current page
         *
         * @param {Array.<string>} tags list of tags
         * @param {function(string)=} callback is optional,
         *      handler which will be executed on content by the tags gets outdated
         */
        tagContent: function (tags, callback) {
            var obj = {
                tags: _.isArray(tags) ? tags : [tags]
            };
            if (callback) {
                obj.callback = callback;
            }

            current.tags.push(obj);
            mediator.trigger('content-manager:content-tagged', { current: current.tags, added: obj });
        },

        /**
         * Clear cached data, by default for current url
         *
         * @param {string=} path part of URL
         */
        remove: function (path) {
            if (_.isUndefined(path)) {
                path = current.path;
            } else {
                path = fetchPath(path);
            }
            delete pagesCache[path];

            if (outdatedPageHandlers[path]) {
                mediator.off('page:update', outdatedPageHandlers[path]);
                delete outdatedPageHandlers[path];
            }
        },

        /**
         * Add current page to permanent cache
         */
        add: function () {
            var path;
            if (current.path[0] !== '/') {
                current.path = '/' + current.path;
            }
            path = current.path;
            pagesCache[path] = current;
        },

        /**
         * Fetches cache data for url, by default for current url
         *
         * @param {string=} path part of URL
         * @return {Object|boolean}
         */
        get: function (path) {
            path = _.isUndefined(path) ? current.path : fetchPath(path);
            return pagesCache[path] || undefined;
        },

        /**
         * Saves state of a page component in a cache
         *
         * @param {string} key
         * @param {*} value
         * @param {string=} hash
         */
        saveState: function (key, value, hash) {
            if (value !== null) {
                current.state[key] = value;
            } else {
                delete current.state[key];
            }

            if (_.isUndefined(hash)) {
                // hash is not defined, there's nothing else to do
                return;
            }

            this.changeUrlParam(key, hash);
            mediator.trigger('pagestate:change');
        },

        /**
         * Changes url for current page
         *
         * @param {string} url
         * @param {Object} options
         */
        changeUrl: function (url, options) {
            var route, _ref;
            options = options || {};
            _ref = url.split('?');
            current.path = _ref[0];
            current.query = _ref[1] || '';
            route = _.pick(current, ['path', 'query']);
            mediator.execute('changeRoute', route, options);
        },

        /**
         * Updates URL parameter for current page
         *
         * @param {string} param
         * @param {string} value
         */
        changeUrlParam: function (param, value) {
            var route, query;

            query = Chaplin.utils.queryParams.parse(current.query);
            if (query[param] === value || (query[param] == null && value == null)) {
                // there's nothing to change in query, skip query update and redirect
                return;
            }

            if (value !== null) {
                // if there's new value, update query
                query[param] = value;
            } else {
                // if there's no new value, delete query part
                delete query[param];
            }

            query = Chaplin.utils.queryParams.stringify(query);
            current.query = query;

            route = _.pick(current, ['path', 'query']);
            mediator.execute('changeRoute', route, {replace: true});
        },

        /**
         * Fetches state of a page component from cached page
         *
         * @param {string} key
         * @return {*}
         */
        fetchState: function (key) {
            return current.state[key];
        },

        /**
         * Check if state's GET parameter (pair key and hash) reflects current URL
         *
         * @param {string} key
         * @param {string} hash
         */
        checkState: function (key, hash) {
            var query;
            query = Chaplin.utils.queryParams.parse(current.query);
            return query[key] == hash;
        },

        /**
         * Retrieve meaningful part of path from url and compares it with reference path
         * (assumes that URL contains only path and query)
         *
         * @param {string} url
         * @param {string=} refPath
         * @returns {boolean}
         */
        compareUrl: function (url, refPath) {
            if (refPath == null) {
                refPath = current.path;
            }

            return fetchPath(refPath) === fetchPath(url);
        },

        /**
         * Combines route URL for current page
         *
         * @returns {script}
         */
        currentUrl: function () {
            var url;
            url = mediator.execute('combineRouteUrl', current);
            return url;
        },

        /**
         * Prevents storing current page in cache
         */
        cacheIgnore: function () {
            mediator.once('page:beforeChange', function (oldRoute) {
                contentManager.remove(oldRoute.path);
            });
        }
    };

    return contentManager;
});


text:
<?php
/*
Plugin Name: WP-EMail Widget
Plugin URI: http://lesterchan.net/portfolio/programming/php/
Description: Adds a EMail Widget to display most emailed posts and/or pages on your sidebar. You will need to activate WP-EMail first.
Version: 2.40
Author: Lester 'GaMerZ' Chan
Author URI: http://lesterchan.net
*/

/*
	Copyright 2008  Lester Chan  (email : lesterchan@gmail.com)

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

### Function: Init WP-EMail Widget
function widget_email_init() {
	if (!function_exists('register_sidebar_widget')) {
		return;
	}

	### Function: WP-EMail Most EMailed Widget
	function widget_email_most_emailed($args) {
		extract($args);
		$options = get_option('widget_email_most_emailed');
		$title = htmlspecialchars(stripslashes($options['title']));
		if (function_exists('get_mostemailed')) {
			echo $before_widget.$before_title.$title.$after_title;
			echo '
'."\n";
			get_mostemailed($options['mode'], $options['limit'], $options['chars']);
			echo '
'."\n";
			echo $after_widget;
		}
	}

	### Function: WP-EMail Most EMailed Widget Options
	function widget_email_most_emailed_options() {
		$options = get_option('widget_email_most_emailed');
		if (!is_array($options)) {
			$options = array('title' => __('Most Emailed', 'wp-email'), 'mode' => 'post', 'limit' => 10, 'chars' => 200);
		}
		if ($_POST['most_emailed-submit']) {
			$options['title'] = strip_tags($_POST['most_emailed-title']);
			$options['mode'] = strip_tags($_POST['most_emailed-mode']);
			$options['limit'] = intval($_POST['most_emailed-limit']);
			$options['chars'] = intval($_POST['most_emailed-chars']);
			update_option('widget_email_most_emailed', $options);
		}
		echo '
';
		_e('Title', 'wp-email');
		echo ': <input type="text" id="most_emailed-title" name="most_emailed-title" value="'.htmlspecialchars(stripslashes($options['title'])).'" />
'."\n";
		echo '
';
		_e('Show Views For: ', 'wp-email');
		echo ' '."\n";
		echo '<select id="most_emailed-mode" name="most_emailed-mode" size="1">'."\n";
		echo '<option value="both"';
		selected('both', $options['mode']);
		echo '>';
		_e('Posts & Pages', 'wp-email');
		echo '</option>'."\n";
		echo '<option value="post"';
		selected('post', $options['mode']);
		echo '>';
		_e('Posts', 'wp-email');
		echo '</option>'."\n";
		echo '<option value="page"';
		selected('page', $options['mode']);
		echo '>';
		_e('Pages', 'wp-email');
		echo '</option>'."\n";
		echo '</select>  ';
		_e('Only', 'wp-email');
		echo '
'."\n";
		echo '
';
		_e('Limit', 'wp-email');
		echo ': <input type="text" id="most_emailed-limit" name="most_emailed-limit" value="'.intval($options['limit']).'" size="3" />
'."\n";
		echo '
';
		_e('Post Title Length (Characters)', 'wp-email');
		echo ': <input type="text" id="most_emailed-chars" name="most_emailed-chars" value="'.intval($options['chars']).'" size="5" />  '."\n";
		_e('(0 to disable)', 'wp-email');
		echo '
'."\n";
		echo '<input type="hidden" id="most_emailed-submit" name="most_emailed-submit" value="1" />'."\n";
	}
	// Register Widgets
	register_sidebar_widget(array('Most Emailed', 'wp-email'), 'widget_email_most_emailed');
	register_widget_control(array('Most Emailed', 'wp-email'), 'widget_email_most_emailed_options', 400, 200);
}

### Function: Load The WP-EMail Widget
add_action('plugins_loaded', 'widget_email_init')
?>


text:
namespace VEngine
{
    namespace Renderer
    {
        namespace Internal
        {
            VulkanCommandBuffer::VulkanCommandBuffer(VulkanDevice * device, VkCommandBufferLevel level)
                : device(device)
            {
                VkCommandBufferAllocateInfo allocInfo = {};
                allocInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO;
                allocInfo.commandPool = device->getCommandPool();
                allocInfo.level = level;
                allocInfo.commandBufferCount = 1;

                vkAllocateCommandBuffers(device->getDevice(), &allocInfo, &handle);
            }

            VulkanCommandBuffer::~VulkanCommandBuffer()
            {
                // no idea how to destroy command buffer
            }

            void VulkanCommandBuffer::begin(VkCommandBufferUsageFlags flags)
            {
                VkCommandBufferBeginInfo beginInfo = {};
                beginInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
                beginInfo.flags = VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT | flags;

                vkBeginCommandBuffer(handle, &beginInfo);
            }

            void VulkanCommandBuffer::end()
            {
                vkEndCommandBuffer(handle);
            }

            VkCommandBuffer VulkanCommandBuffer::getHandle()
            {
                return handle;
            }
        }
    }
}


text:
module.exports = task

var modernizr = require('modernizr')
  , fs = require('fs')
  , path = require('path')
  , join = path.join

function task(pliers) {

  pliers('buildModernizr', function (done) {
    fs.readFile(join(pliers.cwd, 'modernizr.json'), function(err, config) {
      if (err) return done(err)

      modernizr.build(JSON.parse(config), function(result) {
        var script = 'Modernizr.js'
          , js = result.min
        fs.writeFile(join(pliers.cwd, 'assets', 'js', 'lib', 'vendor', script), js, 'utf-8', function (err) {
          if (err) return done(err)
          done()
        })

      })
    })
  })

}


text:
(function() {
  'use strict';

  angular.module('character-tracker.charactersheet')
  .controller('CharacterSheetController', CharacterSheetController);

  CharacterSheetController.$inject = ['CharacterSheetService'];

  function CharacterSheetController(CharacterSheetService) {
    var vm = this;

    init();

    vm.showStats = function() {
      return CharacterSheetService.showStats();
    }

    vm.showGear = function() {
      return CharacterSheetService.showGear();
    }

    vm.showBox = function() {
      return CharacterSheetService.showBox();
    }

    function init() {
      $.material.init();

    }

  }
}());


text:
function ft_uilayout(h, varargin)

% FT_UILAYOUT is a helper function to facilitate the layout of multiple
% usercontrol elements

% Copyright (C) 2009, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip
% for the documentation and details.
%
%    FieldTrip is free software: you can redistribute it and/or modify
%    it under the terms of the GNU General Public License as published by
%    the Free Software Foundation, either version 3 of the License, or
%    (at your option) any later version.
%
%    FieldTrip is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%
%    You should have received a copy of the GNU General Public License
%    along with FieldTrip. If not, see <http://www.gnu.org/licenses/>.
%
% $Id: ft_uilayout.m 7123 2012-12-06 21:21:38Z roboos $

% these are used to make a selection of uicontrol elements
tag    = ft_getopt(varargin, 'tag');
style  = ft_getopt(varargin, 'style');

% determine all children
if ~isempty(tag) && ~isempty(style)
  c = findall(h, 'tag', tag, 'style', style);
elseif ~isempty(tag)
  c = findall(h, 'tag', tag);
elseif ~isempty(style)
  c = findall(h, 'style', style);
else
  c = findall(h);
end
c = flipud(c);
% fprintf('selected %d elements\n', numel(c));

% these are the normal features of an uicontrol
BackgroundColor         = ft_getopt(varargin, 'BackgroundColor');
CallBack                = ft_getopt(varargin, 'CallBack');
Clipping                = ft_getopt(varargin, 'Clipping');
Enable                  = ft_getopt(varargin, 'Enable');
FontAngle               = ft_getopt(varargin, 'FontAngle');
FontName                = ft_getopt(varargin, 'FontName');
FontSize                = ft_getopt(varargin, 'FontSize');
FontUnits               = ft_getopt(varargin, 'FontUnits');
FontWeight              = ft_getopt(varargin, 'FontWeight');
ForegroundColor         = ft_getopt(varargin, 'ForegroundColor');
HorizontalAlignment     = ft_getopt(varargin, 'HorizontalAlignment');
Max                     = ft_getopt(varargin, 'Max');
Min                     = ft_getopt(varargin, 'Min');
Position                = ft_getopt(varargin, 'Position');
Selected                = ft_getopt(varargin, 'Selected');
String                  = ft_getopt(varargin, 'String');
Units                   = ft_getopt(varargin, 'Units');
Value                   = ft_getopt(varargin, 'Value');
Visible                 = ft_getopt(varargin, 'Visible');
Tag                     = ft_getopt(varargin, 'retag');   % this is to change the tag on the selected items
Style                   = ft_getopt(varargin, 'restyle'); % this is to change the style on the selected items

feature = {
  'BackgroundColor'
  'CallBack'
  'Clipping'
  'Enable'
  'FontAngle'
  'FontName'
  'FontSize'
  'FontUnits'
  'FontWeight'
  'ForegroundColor'
  'HorizontalAlignment'
  'Max'
  'Min'
  'Position'
  'Selected'
  'String'
  'Units'
  'Value'
  'Visible'
  'Tag'
  'Style'
  };

for i=1:length(feature)
  val = eval(feature{i});
  if ~isempty(val)
    % fprintf('setting %s\n', feature{i});
    for j=1:length(c)
      set(c(j), feature{i}, val)
    end
  end
end

% these are special features to help with the positioning of the elements
hpos   = ft_getopt(varargin, 'hpos');
vpos   = ft_getopt(varargin, 'vpos');
width  = ft_getopt(varargin, 'width');
height = ft_getopt(varargin, 'height');

if isempty(hpos) && isempty(vpos) && isempty(width) && isempty(height)
  % re-positioning of the elements is not needed
  return
end

pos = zeros(length(c), 4);
for i=1:length(c)
  pos(i,:) = get(c(i), 'position');
end

if ~isempty(width)
  pos(:,3) = width;
end
width = pos(:,3);

if ~isempty(height)
  pos(:,4) = height;
end
height = pos(:,4);

if ~isempty(hpos)
  if isequal(hpos, 'auto')
    scale = (1 - 0.01 - 0.01*length(c)) / sum(width);
    if scale>0 && scale<1
      % fprintf('adjusting width with %f\n', scale);
      width = width*scale;
      pos(:,3) = width;
    end
    hpos = cumsum([0.01; width+0.01]);
    hpos = hpos(1:end-1);
  elseif isequal(hpos, 'align')
    hpos = pos(1,2); % the position of the first element
  elseif isequal(hpos, 'distribute')
    minpos = min(pos(:,1));
    maxpos = max(pos(:,1));
    hpos = linspace(minpos, maxpos, length(c));
  end
  pos(:,1) = hpos;
  pos(:,3) = width;
end % hpos

if ~isempty(vpos)
  if isequal(vpos, 'auto')
    scale = (1 - 0.01 - 0.01*length(c)) / sum(height);
    if scale>0 && scale<1
      % fprintf('adjusting height with %f\n', scale);
      height = height*scale;
      pos(:,4) = height;
    end
    vpos = cumsum([0.01; width]);
    vpos = vpos(1:end-1);
  elseif isequal(vpos, 'align')
    vpos = pos(1,2); % the position of the first element
  elseif isequal(vpos, 'distribute')
    minpos = min(pos(:,2));
    maxpos = max(pos(:,2));
    vpos = linspace(minpos, maxpos, length(c));
  end
  pos(:,2) = vpos;
end % vpos

% assign the new/automatic position to each of the elements
for i=1:length(c)
  set(c(i), 'position', pos(i,:));
end


text:
API
---

.. currentmodule:: dask.array

Top level user functions:

.. autosummary::
   all
   angle
   any
   arange
   arccos
   arccosh
   arcsin
   arcsinh
   arctan
   arctan2
   arctanh
   argmax
   argmin
   around
   array
   bincount
   broadcast_to
   coarsen
   ceil
   choose
   clip
   compress
   concatenate
   conj
   copysign
   corrcoef
   cos
   cosh
   cov
   cumprod
   cumsum
   deg2rad
   degrees
   diag
   digitize
   dot
   dstack
   empty
   exp
   expm1
   eye
   fabs
   fix
   floor
   fmax
   fmin
   fmod
   frexp
   fromfunction
   full
   histogram
   hstack
   hypot
   imag
   indices
   insert
   isclose
   iscomplex
   isfinite
   isinf
   isnan
   isnull
   isreal
   ldexp
   linspace
   log
   log10
   log1p
   log2
   logaddexp
   logaddexp2
   logical_and
   logical_not
   logical_or
   logical_xor
   max
   maximum
   mean
   min
   minimum
   modf
   moment
   nanargmax
   nanargmin
   nancumprod
   nancumsum
   nanmax
   nanmean
   nanmin
   nanprod
   nanstd
   nansum
   nanvar
   nextafter
   notnull
   ones
   percentile
   prod
   rad2deg
   radians
   ravel
   real
   rechunk
   repeat
   reshape
   rint
   roll
   round
   sign
   signbit
   sin
   sinh
   sqrt
   square
   squeeze
   stack
   std
   sum
   take
   tan
   tanh
   tensordot
   tile
   topk
   transpose
   tril
   triu
   trunc
   unique
   var
   vnorm
   vstack
   where
   zeros

Fast Fourier Transforms
~~~~~~~~~~~~~~~~~~~~~~~

.. autosummary::
   fft.fft_wrap
   fft.fft
   fft.fft2
   fft.fftn
   fft.ifft
   fft.ifft2
   fft.ifftn
   fft.rfft
   fft.rfft2
   fft.rfftn
   fft.irfft
   fft.irfft2
   fft.irfftn
   fft.hfft
   fft.ihfft
   fft.fftfreq
   fft.rfftfreq
   fft.fftshift
   fft.ifftshift

Linear Algebra
~~~~~~~~~~~~~~

.. autosummary::
   linalg.cholesky
   linalg.inv
   linalg.lstsq
   linalg.lu
   linalg.qr
   linalg.solve
   linalg.solve_triangular
   linalg.svd
   linalg.svd_compressed
   linalg.tsqr

Random
~~~~~~

.. autosummary::
   random.beta
   random.binomial
   random.chisquare
   random.different_seeds
   random.exponential
   random.f
   random.gamma
   random.geometric
   random.gumbel
   random.hypergeometric
   random.laplace
   random.logistic
   random.lognormal
   random.logseries
   random.negative_binomial
   random.noncentral_chisquare
   random.noncentral_f
   random.normal
   random.pareto
   random.poisson
   random.power
   random.random
   random.random_sample
   random.rayleigh
   random.standard_cauchy
   random.standard_exponential
   random.standard_gamma
   random.standard_normal
   random.standard_t
   random.triangular
   random.uniform
   random.vonmises
   random.wald
   random.weibull
   random.zipf

Stats
~~~~~

.. autosummary::
   stats.ttest_ind
   stats.ttest_1samp
   stats.ttest_rel
   stats.chisquare
   stats.power_divergence
   stats.skew
   stats.skewtest
   stats.kurtosis
   stats.kurtosistest
   stats.normaltest
   stats.f_oneway
   stats.moment

Image Support
~~~~~~~~~~~~~

.. autosummary::
   image.imread

Slightly Overlapping Ghost Computations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autosummary::
   ghost.ghost
   ghost.map_overlap

Create and Store Arrays
~~~~~~~~~~~~~~~~~~~~~~~

.. autosummary::
   from_array
   from_delayed
   from_npy_stack
   store
   to_hdf5
   to_npy_stack

Internal functions
~~~~~~~~~~~~~~~~~~

.. currentmodule:: dask.array.core

.. autosummary::
   map_blocks
   atop
   top

Other functions
~~~~~~~~~~~~~~~

.. currentmodule:: dask.array

.. autofunction:: from_array
.. autofunction:: from_delayed
.. autofunction:: store
.. autofunction:: topk
.. autofunction:: coarsen
.. autofunction:: stack
.. autofunction:: concatenate

.. autofunction:: all
.. autofunction:: angle
.. autofunction:: any
.. autofunction:: arange
.. autofunction:: arccos
.. autofunction:: arccosh
.. autofunction:: arcsin
.. autofunction:: arcsinh
.. autofunction:: arctan
.. autofunction:: arctan2
.. autofunction:: arctanh
.. autofunction:: argmax
.. autofunction:: argmin
.. autofunction:: around
.. autofunction:: array
.. autofunction:: bincount
.. autofunction:: broadcast_to
.. autofunction:: coarsen
.. autofunction:: ceil
.. autofunction:: choose
.. autofunction:: clip
.. autofunction:: compress
.. autofunction:: concatenate
.. autofunction:: conj
.. autofunction:: copysign
.. autofunction:: corrcoef
.. autofunction:: cos
.. autofunction:: cosh
.. autofunction:: cov
.. autofunction:: cumprod
.. autofunction:: cumsum
.. autofunction:: deg2rad
.. autofunction:: degrees
.. autofunction:: diag
.. autofunction:: digitize
.. autofunction:: dot
.. autofunction:: dstack
.. autofunction:: empty
.. autofunction:: exp
.. autofunction:: expm1
.. autofunction:: eye
.. autofunction:: fabs
.. autofunction:: fix
.. autofunction:: floor
.. autofunction:: fmax
.. autofunction:: fmin
.. autofunction:: fmod
.. autofunction:: frexp
.. autofunction:: fromfunction
.. autofunction:: full
.. autofunction:: histogram
.. autofunction:: hstack
.. autofunction:: hypot
.. autofunction:: imag
.. autofunction:: indices
.. autofunction:: insert
.. autofunction:: isclose
.. autofunction:: iscomplex
.. autofunction:: isfinite
.. autofunction:: isinf
.. autofunction:: isnan
.. autofunction:: isnull
.. autofunction:: isreal
.. autofunction:: ldexp
.. autofunction:: linspace
.. autofunction:: log
.. autofunction:: log10
.. autofunction:: log1p
.. autofunction:: log2
.. autofunction:: logaddexp
.. autofunction:: logaddexp2
.. autofunction:: logical_and
.. autofunction:: logical_not
.. autofunction:: logical_or
.. autofunction:: logical_xor
.. autofunction:: max
.. autofunction:: maximum
.. autofunction:: mean
.. autofunction:: min
.. autofunction:: minimum
.. autofunction:: modf
.. autofunction:: moment
.. autofunction:: nanargmax
.. autofunction:: nanargmin
.. autofunction:: nancumprod
.. autofunction:: nancumsum
.. autofunction:: nanmax
.. autofunction:: nanmean
.. autofunction:: nanmin
.. autofunction:: nanprod
.. autofunction:: nanstd
.. autofunction:: nansum
.. autofunction:: nanvar
.. autofunction:: nextafter
.. autofunction:: notnull
.. autofunction:: ones
.. autofunction:: percentile
.. autofunction:: prod
.. autofunction:: rad2deg
.. autofunction:: radians
.. autofunction:: ravel
.. autofunction:: real
.. autofunction:: rechunk
.. autofunction:: repeat
.. autofunction:: reshape
.. autofunction:: rint
.. autofunction:: roll
.. autofunction:: round
.. autofunction:: sign
.. autofunction:: signbit
.. autofunction:: sin
.. autofunction:: sinh
.. autofunction:: sqrt
.. autofunction:: square
.. autofunction:: squeeze
.. autofunction:: stack
.. autofunction:: std
.. autofunction:: sum
.. autofunction:: take
.. autofunction:: tan
.. autofunction:: tanh
.. autofunction:: tensordot
.. autofunction:: tile
.. autofunction:: topk
.. autofunction:: transpose
.. autofunction:: tril
.. autofunction:: triu
.. autofunction:: trunc
.. autofunction:: unique
.. autofunction:: var
.. autofunction:: vnorm
.. autofunction:: vstack
.. autofunction:: where
.. autofunction:: zeros

.. currentmodule:: dask.array.linalg

.. autofunction:: cholesky
.. autofunction:: inv
.. autofunction:: lstsq
.. autofunction:: lu
.. autofunction:: qr
.. autofunction:: solve
.. autofunction:: solve_triangular
.. autofunction:: svd
.. autofunction:: svd_compressed
.. autofunction:: tsqr

.. currentmodule:: dask.array.ghost

.. autofunction:: ghost
.. autofunction:: map_overlap

.. currentmodule:: dask.array

.. autofunction:: from_array
.. autofunction:: from_delayed
.. autofunction:: from_npy_stack
.. autofunction:: store
.. autofunction:: to_hdf5
.. autofunction:: to_npy_stack

.. currentmodule:: dask.array.fft

.. autofunction:: fft_wrap
.. autofunction:: fft
.. autofunction:: fft2
.. autofunction:: fftn
.. autofunction:: ifft
.. autofunction:: ifft2
.. autofunction:: ifftn
.. autofunction:: rfft
.. autofunction:: rfft2
.. autofunction:: rfftn
.. autofunction:: irfft
.. autofunction:: irfft2
.. autofunction:: irfftn
.. autofunction:: hfft
.. autofunction:: ihfft
.. autofunction:: fftfreq
.. autofunction:: rfftfreq
.. autofunction:: fftshift
.. autofunction:: ifftshift

.. currentmodule:: dask.array.random

.. autofunction:: beta
.. autofunction:: binomial
.. autofunction:: chisquare
.. autofunction:: exponential
.. autofunction:: f
.. autofunction:: gamma
.. autofunction:: geometric
.. autofunction:: gumbel
.. autofunction:: hypergeometric
.. autofunction:: laplace
.. autofunction:: logistic
.. autofunction:: lognormal
.. autofunction:: logseries
.. autofunction:: negative_binomial
.. autofunction:: noncentral_chisquare
.. autofunction:: noncentral_f
.. autofunction:: normal
.. autofunction:: pareto
.. autofunction:: poisson
.. autofunction:: power
.. autofunction:: random
.. autofunction:: random_sample
.. autofunction:: rayleigh
.. autofunction:: standard_cauchy
.. autofunction:: standard_exponential
.. autofunction:: standard_gamma
.. autofunction:: standard_normal
.. autofunction:: standard_t
.. autofunction:: triangular
.. autofunction:: uniform
.. autofunction:: vonmises
.. autofunction:: wald
.. autofunction:: weibull
.. autofunction:: zipf

.. currentmodule:: dask.array.stats

.. autofunction:: ttest_ind
.. autofunction:: ttest_1samp
.. autofunction:: ttest_rel
.. autofunction:: chisquare
.. autofunction:: power_divergence
.. autofunction:: skew
.. autofunction:: skewtest
.. autofunction:: kurtosis
.. autofunction:: kurtosistest
.. autofunction:: normaltest
.. autofunction:: f_oneway
.. autofunction:: moment

.. currentmodule:: dask.array.image

.. autofunction:: imread

.. currentmodule:: dask.array.core

.. autofunction:: map_blocks
.. autofunction:: atop
.. autofunction:: top

.. currentmodule:: dask.array

Array Methods
~~~~~~~~~~~~~

.. autoclass:: Array
   :members:


text:
<?php
/**
 * Theme settings
 */

function theme_content(&$a){
	if(!local_user())
		return;

	$font_size = get_pconfig(local_user(), 'diabook', 'font_size' );
	$line_height = get_pconfig(local_user(), 'diabook', 'line_height' );
	$resolution = get_pconfig(local_user(), 'diabook', 'resolution' );
	$color = get_pconfig(local_user(), 'diabook', 'color' );
	$TSearchTerm = get_pconfig(local_user(), 'diabook', 'TSearchTerm' );
	$ELZoom = get_pconfig(local_user(), 'diabook', 'ELZoom' );
	$ELPosX = get_pconfig(local_user(), 'diabook', 'ELPosX' );
	$ELPosY = get_pconfig(local_user(), 'diabook', 'ELPosY' );
	$close_pages = get_pconfig(local_user(), 'diabook', 'close_pages' );
	$close_mapquery = get_pconfig(local_user(), 'diabook', 'close_mapquery' );
	$close_profiles = get_pconfig(local_user(), 'diabook', 'close_profiles' );
	$close_helpers = get_pconfig(local_user(), 'diabook', 'close_helpers' );
	$close_services = get_pconfig(local_user(), 'diabook', 'close_services' );
	$close_friends = get_pconfig(local_user(), 'diabook', 'close_friends' );
	$close_twitter = get_pconfig(local_user(), 'diabook', 'close_twitter' );
	$close_lastusers = get_pconfig(local_user(), 'diabook', 'close_lastusers' );
	$close_lastphotos = get_pconfig(local_user(), 'diabook', 'close_lastphotos' );
	$close_lastlikes = get_pconfig(local_user(), 'diabook', 'close_lastlikes' );

	return diabook_form($a,$font_size, $line_height, $resolution, $color, $TSearchTerm, $ELZoom, $ELPosX, $ELPosY, $close_pages, $close_mapquery, $close_profiles, $close_helpers, $close_services, $close_friends, $close_twitter, $close_lastusers, $close_lastphotos, $close_lastlikes);
}

function theme_post(&$a){
	if(! local_user())
		return;

	if (isset($_POST['diabook-settings-submit'])){
		set_pconfig(local_user(), 'diabook', 'font_size', $_POST['diabook_font_size']);
		set_pconfig(local_user(), 'diabook', 'line_height', $_POST['diabook_line_height']);
		set_pconfig(local_user(), 'diabook', 'resolution', $_POST['diabook_resolution']);
		set_pconfig(local_user(), 'diabook', 'color', $_POST['diabook_color']);
		set_pconfig(local_user(), 'diabook', 'TSearchTerm', $_POST['diabook_TSearchTerm']);
		set_pconfig(local_user(), 'diabook', 'ELZoom', $_POST['diabook_ELZoom']);
		set_pconfig(local_user(), 'diabook', 'ELPosX', $_POST['diabook_ELPosX']);
		set_pconfig(local_user(), 'diabook', 'ELPosY', $_POST['diabook_ELPosY']);
		set_pconfig(local_user(), 'diabook', 'ELPosY', $_POST['diabook_ELPosY']);
		set_pconfig(local_user(), 'diabook', 'close_pages', $_POST['diabook_close_pages']);
		set_pconfig(local_user(), 'diabook', 'close_mapquery', $_POST['diabook_close_mapquery']);
		set_pconfig(local_user(), 'diabook', 'close_profiles', $_POST['diabook_close_profiles']);
		set_pconfig(local_user(), 'diabook', 'close_helpers', $_POST['diabook_close_helpers']);
		set_pconfig(local_user(), 'diabook', 'close_services', $_POST['diabook_close_services']);
		set_pconfig(local_user(), 'diabook', 'close_friends', $_POST['diabook_close_friends']);
		set_pconfig(local_user(), 'diabook', 'close_twitter', $_POST['diabook_close_twitter']);
		set_pconfig(local_user(), 'diabook', 'close_lastusers', $_POST['diabook_close_lastusers']);
		set_pconfig(local_user(), 'diabook', 'close_lastphotos', $_POST['diabook_close_lastphotos']);
		set_pconfig(local_user(), 'diabook', 'close_lastlikes', $_POST['diabook_close_lastlikes']);

	}
}

function theme_admin(&$a){
	$font_size = get_config('diabook', 'font_size' );
	$line_height = get_config('diabook', 'line_height' );
	$resolution = get_config('diabook', 'resolution' );
	$color = get_config('diabook', 'color' );
	$TSearchTerm = get_config('diabook', 'TSearchTerm' );
	$ELZoom = get_config('diabook', 'ELZoom' );
	$ELPosX = get_config('diabook', 'ELPosX' );
	$ELPosY = get_config('diabook', 'ELPosY' );
	$close_pages = get_config('diabook', 'close_pages' );
	$close_mapquery = get_config('diabook', 'close_mapquery' );
	$close_profiles = get_config('diabook', 'close_profiles' );
	$close_helpers = get_config('diabook', 'close_helpers' );
	$close_services = get_config('diabook', 'close_services' );
	$close_friends = get_config('diabook', 'close_friends' );
	$close_twitter = get_config('diabook', 'close_twitter' );
	$close_lastusers = get_config('diabook', 'close_lastusers' );
	$close_lastphotos = get_config('diabook', 'close_lastphotos' );
	$close_lastlikes = get_config('diabook', 'close_lastlikes' );

	return diabook_form($a,$font_size, $line_height, $resolution, $color, $TSearchTerm, $ELZoom, $ELPosX, $ELPosY, $close_pages, $close_mapquery, $close_profiles, $close_helpers, $close_services, $close_friends, $close_twitter, $close_lastusers, $close_lastphotos, $close_lastlikes);
}

function theme_admin_post(&$a){
	if (isset($_POST['diabook-settings-submit'])){
		set_config('diabook', 'font_size', $_POST['diabook_font_size']);
		set_config('diabook', 'line_height', $_POST['diabook_line_height']);
		set_config('diabook', 'resolution', $_POST['diabook_resolution']);
		set_config('diabook', 'color', $_POST['diabook_color']);
		set_config('diabook', 'TSearchTerm', $_POST['diabook_TSearchTerm']);
		set_config('diabook', 'ELZoom', $_POST['diabook_ELZoom']);
		set_config('diabook', 'ELPosX', $_POST['diabook_ELPosX']);
		set_config('diabook', 'close_pages', $_POST['diabook_close_pages']);
		set_config('diabook', 'close_mapquery', $_POST['diabook_close_mapquery']);
		set_config('diabook', 'close_profiles', $_POST['diabook_close_profiles']);
		set_config('diabook', 'close_helpers', $_POST['diabook_close_helpers']);
		set_config('diabook', 'close_services', $_POST['diabook_close_services']);
		set_config('diabook', 'close_friends', $_POST['diabook_close_friends']);
		set_config('diabook', 'close_twitter', $_POST['diabook_close_twitter']);
		set_config('diabook', 'close_lastusers', $_POST['diabook_close_lastusers']);
		set_config('diabook', 'close_lastphotos', $_POST['diabook_close_lastphotos']);
		set_config('diabook', 'close_lastlikes', $_POST['diabook_close_lastlikes']);

	}
}

function diabook_form(&$a, $font_size, $line_height, $resolution, $color, $TSearchTerm, $ELZoom, $ELPosX, $ELPosY, $close_pages, $close_mapquery, $close_profiles, $close_helpers, $close_services, $close_friends, $close_twitter, $close_lastusers, $close_lastphotos, $close_lastlikes){
	$line_heights = array(
		"1.3"=>"1.3",
		"---"=>"---",
		"1.6"=>"1.6",
		"1.5"=>"1.5",
		"1.4"=>"1.4",
		"1.2"=>"1.2",
		"1.1"=>"1.1",
	);

	$font_sizes = array(
		'14'=>'14',
		"---"=>"---",
		"16"=>"16",
		"15"=>"15",
		'13.5'=>'13.5',
		'13'=>'13',
		'12.5'=>'12.5',
		'12'=>'12',
		);
	$resolutions = array(
		'normal'=>'normal',
		'wide'=>'wide',
		);
	$colors = array(
		'diabook'=>'diabook',
		'aerith'=>'aerith',
		'blue'=>'blue',
		'green'=>'green',
		'pink'=>'pink',
		'red'=>'red',
		'dark'=>'dark',
		);

	$close_or_not = array('1'=>t("don't show"),	'0'=>t("show"),);

	$t = get_markup_template("theme_settings.tpl" );
	$o .= replace_macros($t, array(
		'$submit' => t('Submit'),
		'$baseurl' => $a->get_baseurl(),
		'$title' => t("Theme settings"),
		'$font_size' => array('diabook_font_size', t('Set font-size for posts and comments'), $font_size, '', $font_sizes),
		'$line_height' => array('diabook_line_height', t('Set line-height for posts and comments'), $line_height, '', $line_heights),
		'$resolution' => array('diabook_resolution', t('Set resolution for middle column'), $resolution, '', $resolutions),
		'$color' => array('diabook_color', t('Set color scheme'), $color, '', $colors),
		'$TSearchTerm' => array('diabook_TSearchTerm', t('Set twitter search term'), $TSearchTerm, '', $TSearchTerm),
		'$ELZoom' => array('diabook_ELZoom', t('Set zoomfactor for Earth Layer'), $ELZoom, '', $ELZoom),
		'$ELPosX' => array('diabook_ELPosX', t('Set longitude (X) for Earth Layers'), $ELPosX, '', $ELPosX),
		'$ELPosY' => array('diabook_ELPosY', t('Set latitude (Y) for Earth Layers'), $ELPosY, '', $ELPosY),
		'$close_pages' => array('diabook_close_pages', t('Community Pages'), $close_pages, '', $close_or_not),
		'$close_mapquery' => array('diabook_close_mapquery', t('Earth Layers'), $close_mapquery, '', $close_or_not),
		'$close_profiles' => array('diabook_close_profiles', t('Community Profiles'), $close_profiles, '', $close_or_not),
		'$close_helpers' => array('diabook_close_helpers', t('Help or @NewHere ?'), $close_helpers, '', $close_or_not),
		'$close_services' => array('diabook_close_services', t('Connect Services'), $close_services, '', $close_or_not),
		'$close_friends' => array('diabook_close_friends', t('Find Friends'), $close_friends, '', $close_or_not),
		'$close_twitter' => array('diabook_close_twitter', t('Last tweets'), $close_twitter, '', $close_or_not),
		'$close_lastusers' => array('diabook_close_lastusers', t('Last users'), $close_lastusers, '', $close_or_not),
		'$close_lastphotos' => array('diabook_close_lastphotos', t('Last photos'), $close_lastphotos, '', $close_or_not),
		'$close_lastlikes' => array('diabook_close_lastlikes', t('Last likes'), $close_lastlikes, '', $close_or_not),
	));
	return $o;
}


text:
from __future__ import absolute_import
from datetime import date, datetime  # noqa: F401

from typing import List, Dict  # noqa: F401

from tapi_server.models.base_model_ import Model
from tapi_server import util

class TapiOduOduNcmPac(Model):
    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

    Do not edit the class manually.
    """

    def __init__(self, tcm_fields_in_use=None):  # noqa: E501
        """TapiOduOduNcmPac - a model defined in OpenAPI

        :param tcm_fields_in_use: The tcm_fields_in_use of this TapiOduOduNcmPac.  # noqa: E501
        :type tcm_fields_in_use: List[int]
        """
        self.openapi_types = {
            'tcm_fields_in_use': List[int]
        }

        self.attribute_map = {
            'tcm_fields_in_use': 'tcm-fields-in-use'
        }

        self._tcm_fields_in_use = tcm_fields_in_use

    @classmethod
    def from_dict(cls, dikt) -> 'TapiOduOduNcmPac':
        """Returns the dict as a model

        :param dikt: A dict.
        :type: dict
        :return: The tapi.odu.OduNcmPac of this TapiOduOduNcmPac.  # noqa: E501
        :rtype: TapiOduOduNcmPac
        """
        return util.deserialize_model(dikt, cls)

    @property
    def tcm_fields_in_use(self):
        """Gets the tcm_fields_in_use of this TapiOduOduNcmPac.

        This attribute indicates the used TCM fields of the ODU OH.  # noqa: E501

        :return: The tcm_fields_in_use of this TapiOduOduNcmPac.
        :rtype: List[int]
        """
        return self._tcm_fields_in_use

    @tcm_fields_in_use.setter
    def tcm_fields_in_use(self, tcm_fields_in_use):
        """Sets the tcm_fields_in_use of this TapiOduOduNcmPac.

        This attribute indicates the used TCM fields of the ODU OH.  # noqa: E501

        :param tcm_fields_in_use: The tcm_fields_in_use of this TapiOduOduNcmPac.
        :type tcm_fields_in_use: List[int]
        """

        self._tcm_fields_in_use = tcm_fields_in_use