text:
/**
 * @author Trilogis Srl
 * @author Gustavo German Soria
 *
 * Database Module
 */

/**
 * PostgreSQL client for node.js module import.
 * @type {exports}
 */
var pg = require('pg');

/**
 * Username for the database connection
 * @type {string}
 */
var username = "<username>";

/**
 * Password for the database connection
 * @type {string}
 */
var password = "<password>";

/**
 * Name of the database
 * @type {string}
 */
var database = "<database>";

/**
 * Address of the database
 * @type {string}
 */
var address = "<address>";

/**
 * Connection string for the database
 * @type {string}
 */
var connString = "postgres://"+username+":"+password+"@"+address+"/"+database;

/**
 * The method executes on the database the given query with the given parameters. The result is then
 * enclosed in the callback object, which contains also the method to call after the database querying.
 * @param query the query to execute
 * @param params the parameters for the query
 * @param callback the object which contains the information about the current process and the next methods calls
 */
var executeQuery = function(query, params, callback){
    /*
     database connection
     */
    pg.connect(connString, function(err, client, done) {
        if(err) {
            return console.error('error fetching client from pool', err);
        }
        /*
         execute the query
         */
        client.query(query, params, function(err, result) {
            /*
             release to client
             */
            done();
            if(err) {
                if (callback && callback.onError){
                    callback.onError(callback);
                } else {
                    console.error('error running query\n'+query+"\n"+params+"\n", err);
                }
            } else {
                /*
                 If no errors have been detected, then the list of the result is enclosed in
                 the callback.
                 The call for the next method is retrieved from the database object
                 */
                if (callback) {
                    var _next = callback.list.pop();
                    if (_next) {
                        callback.rows = result.rows;

                        _next(callback);
                    }
                }

            }
        });
    });
}

module.exports.execute = executeQuery;
module.exports.conString = connString;


text:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
   http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
	version="2.0">

	<persistence-unit name="openchpl-test" transaction-type="RESOURCE_LOCAL">
	<provider>org.hibernate.ejb.HibernatePersistence</provider>
		<class>gov.healthit.chpl.auth.entity.UserEntity</class>
		<class>gov.healthit.chpl.auth.entity.UserContactEntity</class>
		<class>gov.healthit.chpl.auth.entity.UserPermissionEntity</class>
		<class>gov.healthit.chpl.auth.entity.UserPermissionUserMappingEntity</class>
		<class>gov.healthit.chpl.entity.CertificationBodyEntity</class>
		<class>gov.healthit.chpl.entity.TestingLabEntity</class>
		<class>gov.healthit.chpl.entity.AddressEntity</class>
		<class>gov.healthit.chpl.entity.ContactEntity</class>
		<class>gov.healthit.chpl.entity.DeveloperEntity</class>
		<class>gov.healthit.chpl.entity.DeveloperACBMapEntity</class>
		<class>gov.healthit.chpl.entity.ProductEntity</class>
		<class>gov.healthit.chpl.entity.ProductVersionEntity</class>
		<class>gov.healthit.chpl.entity.QmsStandardEntity</class>
		<class>gov.healthit.chpl.entity.CertifiedProductEntity</class>
		<class>gov.healthit.chpl.entity.CertifiedProductQmsStandardEntity</class>
		<class>gov.healthit.chpl.entity.CertifiedProductTargetedUserEntity</class>
		<class>gov.healthit.chpl.entity.CertifiedProductDetailsEntity</class>
		<class>gov.healthit.chpl.entity.CertificationResultDetailsEntity</class>
		<class>gov.healthit.chpl.entity.CertificationResultAdditionalSoftwareEntity</class>
		<class>gov.healthit.chpl.entity.CertificationResultTestDataEntity</class>
		<class>gov.healthit.chpl.entity.CertificationResultTestProcedureEntity</class>
		<class>gov.healthit.chpl.entity.CertificationResultTestFunctionalityEntity</class>
		<class>gov.healthit.chpl.entity.CertificationResultTestStandardEntity</class>
		<class>gov.healthit.chpl.entity.CertificationResultTestToolEntity</class>
		<class>gov.healthit.chpl.entity.CertificationResultUcdProcessEntity</class>

		<class>gov.healthit.chpl.entity.CQMResultDetailsEntity</class>
		<class>gov.healthit.chpl.entity.CQMResultCriteriaEntity</class>
		<class>gov.healthit.chpl.entity.CertificationEditionEntity</class>
		<class>gov.healthit.chpl.entity.CQMCriterionEntity</class>
		<class>gov.healthit.chpl.entity.CQMVersionEntity</class>
		<class>gov.healthit.chpl.entity.CertificationEventEntity</class>
		<class>gov.healthit.chpl.entity.EventTypeEntity</class>
		<class>gov.healthit.chpl.entity.CertificationCriterionEntity</class>
		<class>gov.healthit.chpl.entity.PendingCertifiedProductEntity</class>
		<class>gov.healthit.chpl.entity.PendingCertifiedProductQmsStandardEntity</class>
		<class>gov.healthit.chpl.entity.PendingCqmCriterionEntity</class>
		<class>gov.healthit.chpl.entity.PendingCertificationResultEntity</class>
		<class>gov.healthit.chpl.entity.PendingCertificationResultAdditionalSoftwareEntity</class>
		<class>gov.healthit.chpl.entity.PendingCertificationResultTestDataEntity</class>
		<class>gov.healthit.chpl.entity.PendingCertificationResultTestProcedureEntity</class>
		<class>gov.healthit.chpl.entity.PendingCertificationResultTestStandardEntity</class>
		<class>gov.healthit.chpl.entity.PendingCertificationResultTestToolEntity</class>
		<class>gov.healthit.chpl.entity.PendingCertificationResultTestFunctionalityEntity</class>
		<class>gov.healthit.chpl.entity.PendingCertificationResultUcdProcessEntity</class>

		<class>gov.healthit.chpl.entity.ActivityEntity</class>
		<class>gov.healthit.chpl.entity.CorrectiveActionPlanEntity</class>
		<class>gov.healthit.chpl.entity.CorrectiveActionPlanCertificationEntity</class>
		<class>gov.healthit.chpl.entity.CorrectiveActionPlanDocumentationEntity</class>
		<class>gov.healthit.chpl.entity.ApiKeyEntity</class>
		<class>gov.healthit.chpl.entity.ApiKeyActivityEntity</class>
		<class>gov.healthit.chpl.entity.TargetedUserEntity</class>
		<class>gov.healthit.chpl.entity.TestProcedureEntity</class>
		<class>gov.healthit.chpl.entity.TestStandardEntity</class>
		<class>gov.healthit.chpl.entity.TestToolEntity</class>
		<class>gov.healthit.chpl.entity.TestFunctionalityEntity</class>
		<class>gov.healthit.chpl.entity.UcdProcessEntity</class>

		<properties>
			<property name="hibernate.show_sql" value="true" />
			<property name="hibernate.format_sql" value="true" />
			<property name="hibernate.driver_class" value="org.postgresql.Driver" />
			<property name="hibernate.connection.datasource" value="java:comp/env/jdbc/openchpl"/>
			<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
			<property name="hibernate.flush_before_completion" value="true" />
			<property name="hibernate.c3p0.min_size" value="5" />
			<property name="hibernate.c3p0.max_size" value="20" />
			<property name="hibernate.c3p0.timeout" value="300" />
			<property name="hibernate.c3p0.max_statements" value="50" />
			<property name="hibernate.c3p0.idle_test_period" value="3000" />
		</properties>
	</persistence-unit>

</persistence>

redpajama_set_name: RedPajamaGithub


text:
/**
 * Given a binary tree, determine if it is height-balanced.
 *
 * For this problem, a height-balanced binary tree is defined as a binary
 * tree in which the depth of the two subtrees of every node never differ by more than 1.
 *
 */

/**
 * Definition for a binary tree node.
 * public class TreeNode {
 *     int val;
 *     TreeNode left;
 *     TreeNode right;
 *     TreeNode(int x) { val = x; }
 * }
 */
public class Solution {
    public boolean isBalanced(TreeNode root) {
        int[] results = checkBalanceAndDepth(root);

        return (results[0] == 1);
    }

    private int[] checkBalanceAndDepth(TreeNode root) {
        int[] results = {1, 0};
        if (root == null) {
            return results;
        }
        int depth = 0;
        int balanced = 0;
        int[] left = checkBalanceAndDepth(root.left);
        int[] right = checkBalanceAndDepth(root.right);
        if (left[0] == 0 || right[0] == 0) {
            results[0] = 0;
        } else {
            if (left[1] > right[1]) {
                results[0] = (left[1] - right[1] <= 1) ? 1 : 0;
            } else {
                results[0] = (right[1] - left[1] <= 1) ? 1 : 0;
            }
        }
        results[1] = ((left[1] > right[1]) ? left[1] : right[1]) + 1;
        return results;
    }
}


text:
package org.wso2.developerstudio.eclipse.artifact.analytics.execution_plan.model;

import java.io.File;

import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.wso2.developerstudio.eclipse.artifact.analytics.execution_plan.Activator;
import org.wso2.developerstudio.eclipse.artifact.analytics.execution_plan.utils.ExecutionPlanConstants;
import org.wso2.developerstudio.eclipse.artifact.analytics.utils.AnalyticsConstants;
import org.wso2.developerstudio.eclipse.artifact.analytics.utils.AnalyticsProjectUtils;
import org.wso2.developerstudio.eclipse.logging.core.IDeveloperStudioLog;
import org.wso2.developerstudio.eclipse.logging.core.Logger;
import org.wso2.developerstudio.eclipse.platform.core.exception.ObserverFailedException;
import org.wso2.developerstudio.eclipse.platform.core.project.model.ProjectDataModel;

public class Execution_planModel extends ProjectDataModel {

	private static IDeveloperStudioLog log=Logger.getLog(Activator.PLUGIN_ID);
	private IContainer execution_planSaveLocation;

	public Object getModelPropertyValue(String key) {
		Object modelPropertyValue = super.getModelPropertyValue(key);
		if (modelPropertyValue == null) {
			if (key.equals(ExecutionPlanConstants.WIZARD_OPTION_EXECUTIONPLAN_SAVE_LOCATION)) {
				IContainer container= getExecution_planSaveLocation();
				if(container != null && container instanceof IFolder){
					IFolder execution_planFolder = container.getProject().getFolder("src").getFolder("main").getFolder(AnalyticsConstants.ANALYTICS_EXECUTION_PLAN_DIR);
					modelPropertyValue = execution_planFolder;
				}else{
					modelPropertyValue = container;
				}
			}
		}
		return modelPropertyValue;
	}

	public boolean setModelPropertyValue(String key, Object data) throws ObserverFailedException {
		boolean returnResult = super.setModelPropertyValue(key, data);

		if(key.equals(ExecutionPlanConstants.WIZARD_OPTION_NEW_EXECUTIONPLAN_PROJECT)){
			setProjectName(data.toString());
		}
		else if (key.equals(ExecutionPlanConstants.WIZARD_OPTION_IMPORT_EXECUTIONPLAN_PROJECT)) {
			setImportFile((File) data);
		} else if (key.equals(ExecutionPlanConstants.WIZARD_OPTION_EXECUTIONPLAN_SAVE_LOCATION)) {
			IContainer container=(IContainer) data;
			if(container != null && container instanceof IFolder){
				IFolder execution_planFolder = container.getProject().getFolder("src").getFolder("main").getFolder(AnalyticsConstants.ANALYTICS_EXECUTION_PLAN_DIR);
				setExecution_planSaveLocation(execution_planFolder);
			}else{
				setExecution_planSaveLocation(container);
			}
		} else if (key.equals(ExecutionPlanConstants.WIZARD_OPTION_CREATE_ANALYTICS_PROJECT)) {
			Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
			IProject analyticsProject = AnalyticsProjectUtils.createAnalyticsProject(shell,getLocation());
			if(analyticsProject!=null){
				setExecution_planSaveLocation(analyticsProject);
			}
		}
		return returnResult;
	}

	public void setLocation(File location) {
		super.setLocation(location);
		File absolutionPath = getLocation();
		if (getExecution_planSaveLocation() == null && absolutionPath != null) {
			IContainer newExecution_planSaveLocation =
			        getContainer(absolutionPath,AnalyticsConstants.ANALYTICS_PROJECT_NATURE);
			setExecution_planSaveLocation(newExecution_planSaveLocation);
		}
	}

	public static IContainer getContainer(File absolutionPath, String projectNature) {
		IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
		int length = 0;
		IProject currentSelection = null;
		for (IProject project : projects) {
			try {
				if (project.isOpen() && project.hasNature(projectNature)) {
					File projectLocation = project.getLocation().toFile();
					int projectLocationLength = projectLocation.toString().length();
					if (projectLocationLength > length &&
					    projectLocationLength <= absolutionPath.toString().length()) {
						if (absolutionPath.toString().startsWith(projectLocation.toString())) {
							length = projectLocationLength;
							currentSelection = project;
						}
					}
				}
			} catch (CoreException e) {
				log.error("An unexpected error has occurred", e);
			}
		}
		IContainer newExecution_planSaveLocation = null;
		if (currentSelection != null) {
			String path =
			        absolutionPath.toString().substring(
			                                            currentSelection.getLocation().toFile()
			                                                    .toString().length());

			if (path.equals("")) {
				newExecution_planSaveLocation = currentSelection;
			} else {
				newExecution_planSaveLocation = currentSelection.getFolder(path);
			}
		}
		return newExecution_planSaveLocation;
	}

	public void setExecution_planSaveLocation(IContainer execution_planSaveLocation) {
		this.execution_planSaveLocation = execution_planSaveLocation;
	}

	public IContainer getExecution_planSaveLocation() {
		return execution_planSaveLocation;
	}

}


text:
class Cntlm < Formula
  desc "NTLM authentication proxy with tunneling"
  homepage "http://cntlm.sourceforge.net/"
  url "https://downloads.sourceforge.net/project/cntlm/cntlm/cntlm%200.92.3/cntlm-0.92.3.tar.bz2"
  sha256 "7b603d6200ab0b26034e9e200fab949cc0a8e5fdd4df2c80b8fc5b1c37e7b930"

  def install
    system "./configure"
    system "make", "CC=#{ENV.cc}", "SYSCONFDIR=#{etc}"
    # install target fails - @adamv
    bin.install "cntlm"
    man1.install "doc/cntlm.1"
    etc.install "doc/cntlm.conf"
  end

  def caveats
    "Edit #{etc}/cntlm.conf to configure Cntlm"
  end

  plist_options :startup => true

  def plist; <<-EOS.undent
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
      <dict>
        <key>Label</key>
        <string>#{plist_name}</string>
        <key>ProgramArguments</key>
        <array>
          <string>#{opt_bin}/cntlm</string>
        </array>
        <key>KeepAlive</key>
        <false/>
        <key>RunAtLoad</key>
        <true/>
        <key>StandardErrorPath</key>
        <string>/dev/null</string>
        <key>StandardOutPath</key>
        <string>/dev/null</string>
      </dict>
    </plist>
    EOS
  end
end


text:
package org.bridje.web.srcgen.uisuite;

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

/**
 * This class defines an attribute field of a control.
 */
@XmlAccessorType(XmlAccessType.FIELD)
public class AttrField extends BaseDataField
{
    @Override
    public String getJavaType()
    {
        return getType();
    }

    @Override
    public String getFieldType()
    {
        return "attribute";
    }

    @Override
    public boolean getIsInput()
    {
        return false;
    }

    @Override
    public boolean getIsInputFile()
    {
        return false;
    }
}


text:
<?php
namespace ChrisAndChris\Common\RowMapperBundle\Services\Mapper;

use Symfony\Component\EventDispatcher\Event;

/**
 * @name NewMapperEvent
 * @version    1.0.0
 * @since      v2.1.0
 * @package    RowMapperBundle
 * @author     ChrisAndChris
 * @link       http://www.klit.ch
 */
class NewMapperEvent extends Event {

    /** @var [] */
    private $encryptionAbilities = [];

    /**
     * Add a new encryption ability
     */
    public function addEncryptionAbility() {
        $this->encryptionAbilities = [];
    }

    /**
     * Get all added encryption abilities
     *
     * @return array
     */
    public function getEncryptionAbilities() {
        return $this->encryptionAbilities;
    }
}


text:
MODULES+=		go
MODULE_SUFFIX_go=	go

MODULE_SUMMARY_go=	Go module for NGINX Unit

MODULE_VERSION_go=	$(VERSION)
MODULE_RELEASE_go=	1

MODULE_CONFARGS_go=	go --go-path=%{gopath}
MODULE_MAKEARGS_go=	go
MODULE_INSTARGS_go=	go-install-src

MODULE_SOURCES_go=	unit.example-go-app \
			unit.example-go-config

ifeq ($(OSVER), centos6)
BUILD_DEPENDS_go=	epel-release golang
else
BUILD_DEPENDS_go=	golang
endif

BUILD_DEPENDS+=		$(BUILD_DEPENDS_go)

define MODULE_DEFINITIONS_go
BuildArch: noarch
Requires: unit-devel == $(VERSION)-$(RELEASE)%{?dist}.ngx
BuildRequires: $(BUILD_DEPENDS_go)
endef
export MODULE_DEFINITIONS_go

define MODULE_PREINSTALL_go
QA_SKIP_BUILD_ROOT=1
export QA_SKIP_BUILD_ROOT

%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-go/examples/go-app
%{__install} -m 644 -p %{SOURCE100} \
    %{buildroot}%{_datadir}/doc/unit-go/examples/go-app/let-my-people.go
%{__install} -m 644 -p %{SOURCE101} \
    %{buildroot}%{_datadir}/doc/unit-go/examples/unit.config
endef
export MODULE_PREINSTALL_go

define MODULE_FILES_go
%dir %{gopath}/src/unit.nginx.org/go
%{gopath}/src/unit.nginx.org/go/*
endef
export MODULE_FILES_go

define MODULE_POST_go
cat <<BANNER
----------------------------------------------------------------------

The $(MODULE_SUMMARY_go) has been installed.

To check the sample app, run these commands:

 GOPATH=%{gopath} GO111MODULE=auto go build -o /tmp/go-app /usr/share/doc/unit-go/examples/go-app/let-my-people.go
 sudo service unit start
 cd /usr/share/doc/%{name}/examples
 sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/unit/control.sock http://localhost/config
 curl http://localhost:8500/

Online documentation is available at https://unit.nginx.org

----------------------------------------------------------------------
BANNER
endef
export MODULE_POST_go


text:
'''
Local Settings for a heroku_ebooks account. #fill in the name of the account you're tweeting from here.
'''

#configuration
MY_CONSUMER_KEY = 'klla90LUQikptTUZWApxg2oDg'
MY_CONSUMER_SECRET = 'xnuUsYOFqHHXDMARoyGKT4xJIxXJf1QVNl2MBJ1MUTbt1kKHbW'
MY_ACCESS_TOKEN_KEY = '706461719594475520-t0sWT6KuGzqnIqnBUMj8hVZRm4CSXmB'
MY_ACCESS_TOKEN_SECRET = '8UBipyh4B3pvFRp453HSL13lZMD4JN6hIG56hWOeBLdN4'

SOURCE_ACCOUNTS = ["jonbradyphoto"] #A list of comma-separated, quote-enclosed Twitter handles of account that you'll generate tweets based on. It should look like ["account1", "account2"]. If you want just one account, no comma needed.
ODDS = 6 #How often do you want this to run? 1/8 times?
ORDER = 2 #how closely do you want this to hew to sensical? 1 is low and 3 is high.
DEBUG = False #Set this to False to start Tweeting live
STATIC_TEST = False #Set this to True if you want to test Markov generation from a static file instead of the API.
TEST_SOURCE = "tweets.txt" #The name of a text file of a string-ified list for testing. To avoid unnecessarily hitting Twitter API.
TWEET_ACCOUNT = "jgibson_ebooks" #The name of the account you're tweeting to.


text:
'''
Created on Jun 26, 2015

@author: hijungshin
'''
import sys
import cv2
from video import Video
import util
import processframe as pf

def write_scroll_coord(video, panorama):
    outfile = video.videoname + "_scroll.txt"
    scrolltxt = open(outfile, "w")
    cap = cv2.VideoCapture(video.filepath)
    prev_coord = (0,0)
    while(cap.isOpened()):
        ret, frame = cap.read()
        if (frame == None):
            break
        topleft = pf.find_object_exact_inside(panorama, frame, threshold=0)
        if topleft is None:
            topleft = prev_coord
        else:
            prev_coord = topleft
        scrolltxt.write("%i\t%i\n"%(topleft[0], topleft[1]))

    scrolltxt.close()

def read_scroll_coord(txt):
    list_of_coords = util.list_of_vecs_from_txt(txt)
    coords = []
    for xy in list_of_coords:
        coords.append((int(xy[0]), int(xy[1])))
    return coords

def scroll_ids(video, scroll_coords):
    outfile2 = video.videoname + "_scroll_ids.txt"
    scrollid_txt = open(outfile2, "w")

    prev = None
    fid = 0
    for coord in scroll_coords:
        if (prev is not None):
            dx = coord[0] - prev[0]
            dy = coord[1] - prev[1]
            if (dx != 0 or dy != 0):
                scrollid_txt.write("%i\n"%fid)
        fid += 1
        prev = coord

    scrollid_txt.close()

if __name__ == "__main__":
    video = Video(sys.argv[1])
    panorama = cv2.imread(sys.argv[2])
    write_scroll_coord(video, panorama)


text:
package com.percolate.sdk.api.request.license;

import com.percolate.sdk.enums.LicenseStatus;

import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * Parameters for LicenseV5 request.
 */
public class LicenseV5Params {
    private Map<String, Object> params = new HashMap<>();

    public LicenseV5Params(String tenantId) {
        params.put("tenant_id", tenantId);
    }

    public LicenseV5Params(String[] licenseIds) {
        params.put("ids", StringUtils.join(licenseIds, ","));
    }

    public LicenseV5Params limit(int limit) {
        params.put("limit", limit);
        return this;
    }

    public LicenseV5Params offset(int offset) {
        params.put("offset", offset);
        return this;
    }

    public LicenseV5Params statuses(LicenseStatus status) {
        params.put("statuses", status.toString().toLowerCase());
        return this;
    }

    public Map<String, Object> getParams() {
        return params;
    }
}


text:
package net.authorize.data;

/**
 * Permissions that are associated with accounts.
 */
public enum PermissionType {
	API_MERCHANT_BASIC_REPORTING("API_Merchant_BasicReporting"),
	MOBILE_ADMIN("Mobile_Admin"),
	SUBMIT_CHARGE("Submit_Charge"),
	SUBMIT_REFUND("Submit_Refund"),
	SUBMIT_UPDATE("Submit_Update");

	final private String value;

	private PermissionType(String value) {
		this.value = value;
	}

	/**
	 * @return the value
	 */
	public String getValue() {
		return value;
	}

	/**
	 * Lookup a permission by it's value.
	 *
	 * @param value
	 * @return PermissionType
	 */
	public static PermissionType findByValue(String value) {
		for(PermissionType permission : values()) {
			if(permission.value.equals(value)) {
				return permission;
			}
		}

		return null; // unknown
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<set
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="#ff000000"
    android:shareInterpolator="false"
    android:fillBefore="false"
    android:fillAfter="true"
    android:zAdjustment="normal"
    android:fillEnabled="true">
    <alpha
        android:interpolator="@anim/decelerate_quint"
        android:duration="@integer/activity_anim_duration"
        android:fromAlpha="1.0"
        android:toAlpha="0.2" />
    <scale
        android:interpolator="@anim/decelerate_quint"
        android:duration="@integer/activity_anim_duration"
        android:pivotX="50.0%p"
        android:pivotY="50.0%p"
        android:fromXScale="1.0"
        android:toXScale="0.9"
        android:fromYScale="1.0"
        android:toYScale="0.9" />
</set>


text:
import { faChartPie } from '@fortawesome/free-solid-svg-icons/faChartPie';
import { faTrash } from '@fortawesome/free-solid-svg-icons/faTrash';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import type { JSONSchema7 as JSONSchema } from 'json-schema';
import cloneDeep from 'lodash/cloneDeep';
import * as React from 'react';
import styled from 'styled-components';
import { stopEvent } from '../../utils';
import { FilterRenderMode, FiltersView } from '.';
import { Box } from '../Box';
import { Button } from '../Button';
import { DropDownButton, DropDownButtonProps } from '../DropDownButton';
import FilterDescription from './FilterDescription';
import { Flex } from '../Flex';
import theme from '../../theme';

const PlainPanel = styled.div`
	border-radius: 2px;
	background-color: #ffffff;
	box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.1);
	border: solid 1px #9b9b9b;
`;

const Preview = styled(PlainPanel)`
	display: none;
	position: absolute;
	right: 230px;
	width: 300px;
	right: 100%;
	margin-right: 3px;
	top: 2px;
	padding: 15px 15px 5px;
`;

const ViewsMenu = ({
	views,
	renderMode,
	compact,
	deleteView,
	setFilters,
	disabled,
	dark,
	buttonProps,
}: ViewsMenuProps) => {
	const loadView = (view: FiltersView) => {
		const filters = cloneDeep(view.filters);
		setFilters(filters);
	};

	const hasViews = views.length > 0;

	const memoizedItems = React.useMemo(
		() =>
			!hasViews
				? [[{ content: "You haven't created any views yet" }]]
				: [
						views.map((view, index) => ({
							content: (
								<Flex
									flexDirection="row"
									justifyContent="space-between"
									alignItems="center"
									key={index}
									style={{ overflow: 'auto' }}
								>
									<Flex flexDirection="column" mr={3}>
										<Flex flexDirection="column">{view.name}</Flex>
										<Flex flexDirection="row" color={theme.colors.gray}>
											{view.filters.length} filter
											{view.filters.length > 1 && 's'}
										</Flex>
									</Flex>
									<Flex flexDirection="column">
										<Button
											plain
											onClick={(
												e: React.MouseEvent<HTMLElement, MouseEvent>,
											) => {
												deleteView(view);
												stopEvent(e);
											}}
										>
											<FontAwesomeIcon icon={faTrash} />
										</Button>
									</Flex>
									<Preview>
										{view.filters.map((filter) => (
											<Box mb={10} key={filter.$id}>
												<FilterDescription filter={filter} />
											</Box>
										))}
									</Preview>
								</Flex>
							),
							onClick: () => loadView(view),
						})),
				  ],
		[views, deleteView],
	);

	return (
		<DropDownButton
			mx={typeof renderMode === 'string' || renderMode?.length === 1 ? 0 : 1}
			disabled={disabled}
			quartenary
			light={dark}
			outline
			joined
			alignRight={typeof renderMode === 'string' || renderMode?.length === 1}
			noListFormat
			icon={<FontAwesomeIcon icon={faChartPie} />}
			label="Views"
			compact={compact}
			{...buttonProps}
			items={memoizedItems}
		/>
	);
};

export interface ViewsMenuProps {
	buttonProps?: DropDownButtonProps;
	disabled?: boolean;
	dark?: boolean;
	views: FiltersView[];
	schema: JSONSchema;
	setFilters: (filters: JSONSchema[]) => void;
	deleteView: (view: FiltersView) => any;
	renderMode?: FilterRenderMode | FilterRenderMode[];
	compact?: boolean[];
}

export default ViewsMenu;


text:
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>placetracking</application>
    <version>2</version>
    <threadsafe>true</threadsafe>
    <system-properties>
        <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
    </system-properties>
</appengine-web-app>


text:
Success!!!

                        Success!!! Return to the previous screen after 3 seconds.


text:
var gulp = require('gulp');

gulp.task('test', function() {
  console.log('Hello Gulp');
});

// The default task (called when you run `gulp` from cli)
gulp.task('default', ['test']);


text:
"""Arithmetic Operations that don't fit into math_ops due to dependencies.

To avoid circular dependencies, some math_ops should go here.  Documentation
callouts, e.g. "@@my_op" should go in math_ops.  To the user, these are just
normal math_ops.
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import re

from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import check_ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops

# TODO(b/27419586) Change docstring for required dtype of x once int allowed
def lbeta(x, name='lbeta'):
  r"""Computes `ln(|Beta(x)|)`, reducing along the last dimension.

  Given one-dimensional `z = [z_0,...,z_{K-1}]`, we define

  ```Beta(z) = \prod_j Gamma(z_j) / Gamma(\sum_j z_j)```

  And for `n + 1` dimensional `x` with shape `[N1, ..., Nn, K]`, we define
  `lbeta(x)[i1, ..., in] = Log(|Beta(x[i1, ..., in, :])|)`.  In other words,
  the last dimension is treated as the `z` vector.

  Note that if `z = [u, v]`, then
  `Beta(z) = int_0^1 t^{u-1} (1 - t)^{v-1} dt`, which defines the traditional
  bivariate beta function.

  Args:
    x: A rank `n + 1` `Tensor` with type `float`, or `double`.
    name: A name for the operation (optional).

  Returns:
    The logarithm of `|Beta(x)|` reducing along the last dimension.

  Raises:
    ValueError:  If `x` is empty with rank one or less.
  """
  with ops.name_scope(name, values=[x]):
    x = ops.convert_to_tensor(x, name='x')
    x = control_flow_ops.with_dependencies(
        [check_ops.assert_rank_at_least(x, 1)], x)

    is_empty = math_ops.equal(0, array_ops.size(x))

    def nonempty_lbeta():
      log_prod_gamma_x = math_ops.reduce_sum(
          math_ops.lgamma(x), reduction_indices=[-1])
      sum_x = math_ops.reduce_sum(x, reduction_indices=[-1])
      log_gamma_sum_x = math_ops.lgamma(sum_x)
      result = log_prod_gamma_x - log_gamma_sum_x
      return result

    def empty_lbeta():
      # If x is empty, return version with one less dimension.
      # Can only do this if rank >= 2.
      assertion = check_ops.assert_rank_at_least(x, 2)
      with ops.control_dependencies([assertion]):
        return array_ops.squeeze(x, squeeze_dims=[0])

    static_size = x.get_shape().num_elements()
    if static_size is not None:
      if static_size > 0:
        return nonempty_lbeta()
      else:
        return empty_lbeta()
    else:
      return control_flow_ops.cond(is_empty, empty_lbeta, nonempty_lbeta)

def einsum(axes, *inputs):
  """
  A generalized contraction between tensors of arbitrary dimension.

  Like `numpy.einsum`, but does not support:
  * Ellipses (subscripts like `ij...,jk...->ik...`)
  * Subscripts where an axis appears more than once for a single input (e.g. `ijj,jk->ik`).

  Args:
    axes: a `str` describing the contraction, in the same format as `numpy.einsum`.
    inputs: the inputs to contract (each one a `Tensor`), whose shapes should be consistent with `axes`.

  Returns:
    The contracted `Tensor`, with shape determined by `axes`.

  Raises:
    ValueError: If the format of `axes` is incorrect,
                or the number of inputs implied by `axes` does not match `len(inputs)`,
                or an axis appears in the output subscripts but not in any of the inputs,
                or the number of dimensions of an input differs from the number of indices in its subscript,
                or the input shapes are inconsistent along a particular axis.
  """
  if '...' in axes:
    raise ValueError("Subscripts with ellipses are not yet supported.")

  match = re.match('([a-z,]+)(->[a-z]*)?', axes)
  if not match:
    raise ValueError(
      "Indices have incorrect format: %s" % axes
    )

  inputs = list(inputs)
  idx_in = match.group(1).split(',')
  idx_all = set(''.join(idx_in))
  indices = ''.join(sorted(idx_all))

  if match.group(2):
    idx_out = match.group(2)[2:]

  else:
    # infer the output subscripts if not given, assume alphabetical order
    counts = {ax: 0 for ax in indices}
    for axes_ in idx_in:
      for ax in axes_:
        counts[ax] += 1

    idx_out = ''.join(sorted(
      ax for ax in indices
      if counts[ax] == 1
    ))

  if len(idx_in) != len(inputs):
    raise ValueError(
      "Expected %d inputs but got %d" % (len(idx_in), len(inputs))
    )

  missing_idx = set(idx_out).difference(idx_all)
  if missing_idx:
    raise ValueError(
      "Unknown ouput axes: %s" % missing_idx
    )

  axis_order = {}
  for ax in indices:
    if ax not in idx_out:
      axis_order[ax] = len(axis_order)
  for ax in idx_out:
    axis_order[ax] = len(axis_order)

  # transpose inputs so axes are in order
  for i, (input_, axes_) in enumerate(zip(inputs, idx_in)):
    if input_.get_shape().ndims != len(axes_):
      raise ValueError(
        "Input %d with axes %s has incorrect" \
        " number of dimensions (expected %d, got %d)" % (
          i, axes_, len(axes_), input_.get_shape().ndims
        )
      )

    sorted_idx = sorted(axes_, key=axis_order.get)

    if len(set(axes_)) != len(axes_):
      raise ValueError(
        "Subscript not supported: an axis appears more than once: %s" % axes_
      )

    if list(axes_) != sorted_idx:
      permuted = [axes_.find(ax) for ax in sorted_idx]
      inputs[i] = array_ops.transpose(input_, permuted)
      idx_in[i] = sorted_idx

  reduction_idx = []
  shapes = [[dim if dim else -1
             for dim in tensor.get_shape().as_list()]
            for tensor in inputs]

  # validate shapes for broadcasting
  for j, ax in enumerate(sorted(idx_all, key=axis_order.get)):
    dims = []
    for i, idx in enumerate(idx_in):
      if ax not in idx:
        shapes[i].insert(j, 1)
      else:
        dim = shapes[i][j]
        if isinstance(dim, int) and dim > 1:
          dims.append(dim)

    if len(set(dims)) > 1:
      raise ValueError(
        "Dimension mismatch on axis: %s" % ax
      )

    if ax not in idx_out:
      reduction_idx.append(j)

  # reshape, multiply
  expanded_inputs = [array_ops.reshape(input_, shape)
                     for input_, shape in zip(inputs, shapes)]
  expanded_output = 1
  for input_ in expanded_inputs:
    expanded_output *= input_

  # contract
  return math_ops.reduce_sum(expanded_output, reduction_idx)


text:
namespace MailChimp.Api.Net.Enum
{
  public enum SendType
  {
    plain_text,
    html
  }
}


text:
package org.apache.camel.component.zookeeper;

import java.util.List;

import org.apache.camel.Consumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.ServiceStatus;
import org.apache.camel.api.management.ManagedAttribute;
import org.apache.camel.api.management.ManagedOperation;
import org.apache.camel.api.management.ManagedResource;
import org.apache.camel.impl.DefaultEndpoint;
import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.spi.UriParam;

/**
 * ZooKeeperEndpoint
 */
@ManagedResource(description = "ZooKeeper Endpoint")
@UriEndpoint(scheme = "zookeeper", title = "ZooKeeper", syntax = "zookeeper:serverUrls/path", consumerClass = ZooKeeperConsumer.class, label = "clustering")
public class ZooKeeperEndpoint extends DefaultEndpoint {
    @UriParam
    private ZooKeeperConfiguration configuration;
    private ZooKeeperConnectionManager connectionManager;

    public ZooKeeperEndpoint(String uri, ZooKeeperComponent component, ZooKeeperConfiguration configuration) {
        super(uri, component);
        this.configuration = configuration;
        this.connectionManager = new ZooKeeperConnectionManager(this);
    }

    public Producer createProducer() throws Exception {
        return new ZookeeperProducer(this);
    }

    public Consumer createConsumer(Processor processor) throws Exception {
        ZooKeeperConsumer answer = new ZooKeeperConsumer(this, processor);
        configureConsumer(answer);
        return answer;
    }

    public boolean isSingleton() {
        return true;
    }

    public void setConfiguration(ZooKeeperConfiguration configuration) {
        this.configuration = configuration;
    }

    public ZooKeeperConfiguration getConfiguration() {
        return configuration;
    }

    ZooKeeperConnectionManager getConnectionManager() {
        return connectionManager;
    }

    @ManagedAttribute(description = "Camel ID")
    public String getCamelId() {
        return getCamelContext().getName();
    }

    @ManagedAttribute(description = "Camel ManagementName")
    public String getCamelManagementName() {
        return getCamelContext().getManagementName();
    }

    @ManagedAttribute(description = "Endpoint Uri", mask = true)
    @Override
    public String getEndpointUri() {
        return super.getEndpointUri();
    }

    @ManagedAttribute(description = "Service State")
    public String getState() {
        ServiceStatus status = this.getStatus();
        // if no status exists then its stopped
        if (status == null) {
            status = ServiceStatus.Stopped;
        }
        return status.name();
    }

    @ManagedAttribute
    public void setPath(String path) {
        getConfiguration().setPath(path);
    }

    @ManagedAttribute
    public String getPath() {
        return getConfiguration().getPath();
    }

    @ManagedAttribute
    public int getTimeout() {
        return getConfiguration().getTimeout();
    }

    @ManagedAttribute
    public void setTimeout(int timeout) {
        getConfiguration().setTimeout(timeout);
    }

    @ManagedAttribute
    public boolean getRepeat() {
        return getConfiguration().isRepeat();
    }

    @ManagedAttribute
    public void setRepeat(boolean shouldRepeat) {
        getConfiguration().setRepeat(shouldRepeat);
    }

    @ManagedAttribute
    public List<String> getServers() {
        return getConfiguration().getServers();
    }

    @ManagedAttribute
    public void setServers(List<String> servers) {
        getConfiguration().setServers(servers);
    }

    @ManagedAttribute
    public boolean isListChildren() {
        return getConfiguration().isListChildren();
    }

    @ManagedAttribute
    public void setListChildren(boolean listChildren) {
        getConfiguration().setListChildren(listChildren);
    }

    @ManagedAttribute
    public boolean getCreate() {
        return getConfiguration().isCreate();
    }

    @ManagedAttribute
    public void setCreate(boolean shouldCreate) {
        getConfiguration().setCreate(shouldCreate);
    }

    @ManagedAttribute
    public long getBackoff() {
        return getConfiguration().getBackoff();
    }

    @ManagedAttribute
    public void setBackoff(long backoff) {
        getConfiguration().setBackoff(backoff);
    }

    /**
     * @deprecated The usage of this property has no effect at all.
     */
    @Deprecated
    @ManagedAttribute
    public boolean getAwaitExistence() {
        return getConfiguration().shouldAwaitExistence();
    }

    /**
     * @deprecated The usage of this property has no effect at all.
     */
    @Deprecated
    @ManagedAttribute
    public void setAwaitExistence(boolean awaitExistence) {
        getConfiguration().setAwaitExistence(awaitExistence);
    }

    @ManagedOperation
    public void addServer(String server) {
        getConfiguration().addZookeeperServer(server);
    }

    @ManagedOperation
    public void clearServers() {
        getConfiguration().getServers().clear();
    }

    public Object getManagedObject(ZooKeeperEndpoint arg0) {
        return this;
    }

    @ManagedAttribute
    public boolean isSendEmptyMessageOnDelete() {
        return getConfiguration().isSendEmptyMessageOnDelete();
    }

    @ManagedAttribute
    public void setSendEmptyMessageOnDelete(boolean sendEmptyMessageOnDelete) {
        getConfiguration().setSendEmptyMessageOnDelete(sendEmptyMessageOnDelete);
    }

    @Override
    protected void doStop() throws Exception {
        if (connectionManager != null) {
            // It releases the zookeeper connection when calling the shutdown method
            connectionManager.shutdown();
        }
    }

}


text:
import { CommandNames } from "../Names/CommandNames";
import { BlockEndCommand } from "./BlockEndCommand";
import { CommandMetadata } from "./Metadata/CommandMetadata";

/**
 * Ends a block to be executed if a string can be converted to a double.
 */
export class IfStringToDoubleEndCommand extends BlockEndCommand {
    /**
     * Metadata on the command.
     */
    private static metadata: CommandMetadata = new CommandMetadata(CommandNames.IfStringToDoubleEnd)
        .withDescription("Ends a block to be executed if a string can be converted to a double")
        .withIndentation([-1]);

    /**
     * @returns Metadata on the command.
     */
    public getMetadata(): CommandMetadata {
        return IfStringToDoubleEndCommand.metadata;
    }
}


text:
import headerImage from '../../assets/images/blog/2017-01-17-1.jpg';
import image1 from '../../assets/images/blog/2017-01-17-2.jpg';

const Blog20170117 = {
  id: 20170117,
  title: 'Program Nights at Turning Point!',
  type: 'text',
  publishDate: '2017-01-17',
  headerImage,
  summary:
    "Hi guys! My name is Emily Ma and I am a volunteer leader and the Director of Finance and Administration. This is my first time writing a blog post but I'm so excited to write about my amazing experiences at our location in SW Portland.",
  body: [
    {
      type: 'lead',
      text:
        "Hi guys! My name is Emily Ma and I am a volunteer leader and the Director of Finance and Administration. This is my first time writing a blog post but I'm so excited to write about my amazing experiences at our location in SW Portland."
    },
    {
      type: 'paragraph',
      text:
        'For the past two years, I have been involved at Turning Point, which is a transitional housing organization for families with kids. The STEM programs I have led there include making mini-catapults, stimulating an egg drop activity, and making candy cars. Because most of the kids there are toddlers, I sometimes divert my focus on science related activities and instead hold fun activities such as finger painting, creating holiday cards, and making clay sculptures. We also have had guest speakers come in to talk with the kids. Recently, three Lincoln High School students presented on the topic of culture and language for their CAS project.'
    },
    {
      type: 'image',
      image: image1
    },
    {
      type: 'paragraph',
      text:
        'One of my favorite activities that I did with the kids was when we made mini-catapults. It was a thrill to see them shoot pom poms everywhere trying to be the first to get one into a paper bag to get a prize.'
    },
    {
      type: 'paragraph',
      text:
        'If anyone is interested in participation at Turning Point or would like to lead an activity there, feel free to contact me. My email is (emilycatma@gmail.com). You can also sign up for shifts at Turning Point anytime. We will be making balloon rockets this Thursday!'
    }
  ]
};

export default Blog20170117;


text:
package org.assertj.db.type;

import org.assertj.db.common.AbstractTest;
import org.junit.Test;

import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.UUID;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * Test on the type got from {@code getType} method from {@code ValueType} enum.
 *
 * @author Régis Pouiller
 *
 */
public class ValueType_GetType_Test extends AbstractTest {

  /**
   * This method tests the result of {@code getType} method from {@code ValueType} enum.
   */
  @Test
  public void test_result_when_getting_type() throws Exception {
    assertThat(getValue(null, new byte[] { 1 }).getValueType()).isEqualTo(ValueType.BYTES);
    assertThat(getValue(null, true).getValueType()).isEqualTo(ValueType.BOOLEAN);
    assertThat(getValue(null, "").getValueType()).isEqualTo(ValueType.TEXT);
    assertThat(getValue(null, new Date(10)).getValueType()).isEqualTo(ValueType.DATE);
    assertThat(getValue(null, new Time(10)).getValueType()).isEqualTo(ValueType.TIME);
    assertThat(getValue(null, new Timestamp(10)).getValueType()).isEqualTo(ValueType.DATE_TIME);
    assertThat(getValue(null, (short) 10).getValueType()).isEqualTo(ValueType.NUMBER);
    assertThat(getValue(null, 10).getValueType()).isEqualTo(ValueType.NUMBER);
    assertThat(getValue(null, (long) 10).getValueType()).isEqualTo(ValueType.NUMBER);
    assertThat(getValue(null, 10.5d).getValueType()).isEqualTo(ValueType.NUMBER);
    assertThat(getValue(null, 10.5f).getValueType()).isEqualTo(ValueType.NUMBER);
    assertThat(getValue(null, new BigDecimal(10.5f)).getValueType()).isEqualTo(ValueType.NUMBER);
    assertThat(getValue(null, UUID.randomUUID()).getValueType()).isEqualTo(ValueType.UUID);
    assertThat(getValue(null, null).getValueType()).isEqualTo(ValueType.NOT_IDENTIFIED);
  }
}


text:
package team1.myFinance.web.model;

public class Credentials {
    public String username;
    public String hash;
}


text:
package buildsfakes

import (
	"sync"

	"github.com/concourse/atc/builds"
)

type FakeBuildTracker struct {
	TrackStub        func()
	trackMutex       sync.RWMutex
	trackArgsForCall []struct{}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeBuildTracker) Track() {
	fake.trackMutex.Lock()
	fake.trackArgsForCall = append(fake.trackArgsForCall, struct{}{})
	fake.recordInvocation("Track", []interface{}{})
	fake.trackMutex.Unlock()
	if fake.TrackStub != nil {
		fake.TrackStub()
	}
}

func (fake *FakeBuildTracker) TrackCallCount() int {
	fake.trackMutex.RLock()
	defer fake.trackMutex.RUnlock()
	return len(fake.trackArgsForCall)
}

func (fake *FakeBuildTracker) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.trackMutex.RLock()
	defer fake.trackMutex.RUnlock()
	return fake.invocations
}

func (fake *FakeBuildTracker) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ builds.BuildTracker = new(FakeBuildTracker)


text:
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured

REQUIRED_APPS = (
    'django.contrib.markup',
    'django.contrib.webdesign',
    'linguo',
)

if __name__ in settings.INSTALLED_APPS:
    for application_name in REQUIRED_APPS:
        if not application_name in settings.INSTALLED_APPS:
            raise ImproperlyConfigured("%s application requires %s. "
            "Please ensure this is included in your INSTALLED_APPS." % (
                __name__,
                application_name,
            ))

    try:
        import markdown
    except ImportError:
        raise ImproperlyConfigured("%s application requires markdown. "
        "Please install it in your path (for example, as ../lib/markdown.py)" % (
            __name__,
        ))


text:
'use strict';

// MODULES //

var constantFunction = require( '@stdlib/utils/constant-function' );
var betainc = require( '@stdlib/math/base/special/betainc' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var floor = require( '@stdlib/math/base/special/floor' );
var PINF = require( '@stdlib/constants/float64/pinf' );

// MAIN //

/**
* Returns a function for evaluating the cumulative distribution function (CDF) for a negative binomial distribution with number of successes until experiment is stopped `r` and success probability `p`.
*
* @param {PositiveNumber} r - number of successes until experiment is stopped
* @param {Probability} p - success probability
* @returns {Function} CDF
*
* @example
* var cdf = factory( 10, 0.5 );
* var y = cdf( 3.0 );
* // returns ~0.046
*
* y = cdf( 11.0 );
* // returns ~0.668
*/
function factory( r, p ) {
	if (
		isnan( r ) ||
		isnan( p ) ||
		r <= 0.0 ||
		p < 0.0 ||
		p > 1.0
	) {
		return constantFunction( NaN );
	}
	return cdf;

	/**
	* Evaluates the cumulative distribution function (CDF) for a negative binomial distribution.
	*
	* @private
	* @param {number} x - input value
	* @returns {Probability} evaluated CDF
	*/
	function cdf( x ) {
		var xint;
		if ( isnan( x ) ) {
			return NaN;
		}
		if ( x < 0.0 ) {
			return 0.0;
		}
		if ( x === PINF ) {
			return 1.0;
		}
		// Ensure left-continuity:
		xint = floor( x + 1e-7 );
		return betainc( p, r, xint + 1.0 );
	}
}

// EXPORTS //

module.exports = factory;


text:
/**
  @module ember-data
*/

require("ember-data/system/model/model");
require("ember-data/system/model/states");
require("ember-data/system/model/attributes");


text:
class Solution {
public:
    int titleToNumber(std::string s)
    {
        int number = 0;
        int currentfactor = 1;
        for (auto iter = s.crbegin(); iter != s.crend(); iter++)
        {
            number += (*iter - 'A' + 1) * currentfactor;
            currentfactor *= 26;
        }
        return number;
    }
};


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: diplomacy_tensorflow/stream_executor/logging.proto

#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fstream_5fexecutor_2flogging_2eproto
#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fstream_5fexecutor_2flogging_2eproto

#include <string>

#include <google/protobuf/stubs/common.h>

#if GOOGLE_PROTOBUF_VERSION < 3006001
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers.  Please update
#error your headers.
#endif
#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers.  Please
#error regenerate this file with a newer version of protoc.
#endif

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/inlined_string_field.h>
#include <google/protobuf/metadata.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
#include <google/protobuf/extension_set.h>  // IWYU pragma: export
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fstream_5fexecutor_2flogging_2eproto

namespace protobuf_diplomacy_5ftensorflow_2fstream_5fexecutor_2flogging_2eproto {
// Internal implementation detail -- do not use these members.
struct TableStruct {
  static const ::google::protobuf::internal::ParseTableField entries[];
  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
  static const ::google::protobuf::internal::ParseTable schema[3];
  static const ::google::protobuf::internal::FieldMetadata field_metadata[];
  static const ::google::protobuf::internal::SerializationTable serialization_table[];
  static const ::google::protobuf::uint32 offsets[];
};
void AddDescriptors();
}  // namespace protobuf_diplomacy_5ftensorflow_2fstream_5fexecutor_2flogging_2eproto
namespace stream_executor {
class ComputeCapability;
class ComputeCapabilityDefaultTypeInternal;
extern ComputeCapabilityDefaultTypeInternal _ComputeCapability_default_instance_;
class CudaInfo;
class CudaInfoDefaultTypeInternal;
extern CudaInfoDefaultTypeInternal _CudaInfo_default_instance_;
class CudnnVersion;
class CudnnVersionDefaultTypeInternal;
extern CudnnVersionDefaultTypeInternal _CudnnVersion_default_instance_;
}  // namespace stream_executor
namespace google {
namespace protobuf {
template<> ::stream_executor::ComputeCapability* Arena::CreateMaybeMessage<::stream_executor::ComputeCapability>(Arena*);
template<> ::stream_executor::CudaInfo* Arena::CreateMaybeMessage<::stream_executor::CudaInfo>(Arena*);
template<> ::stream_executor::CudnnVersion* Arena::CreateMaybeMessage<::stream_executor::CudnnVersion>(Arena*);
}  // namespace protobuf
}  // namespace google
namespace stream_executor {

// ===================================================================

class CudnnVersion : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:stream_executor.CudnnVersion) */ {
 public:
  CudnnVersion();
  virtual ~CudnnVersion();

  CudnnVersion(const CudnnVersion& from);

  inline CudnnVersion& operator=(const CudnnVersion& from) {
    CopyFrom(from);
    return *this;
  }
  #if LANG_CXX11
  CudnnVersion(CudnnVersion&& from) noexcept
    : CudnnVersion() {
    *this = ::std::move(from);
  }

  inline CudnnVersion& operator=(CudnnVersion&& from) noexcept {
    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
      if (this != &from) InternalSwap(&from);
    } else {
      CopyFrom(from);
    }
    return *this;
  }
  #endif
  static const ::google::protobuf::Descriptor* descriptor();
  static const CudnnVersion& default_instance();

  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
  static inline const CudnnVersion* internal_default_instance() {
    return reinterpret_cast<const CudnnVersion*>(
               &_CudnnVersion_default_instance_);
  }
  static constexpr int kIndexInFileMessages =
    0;

  void Swap(CudnnVersion* other);
  friend void swap(CudnnVersion& a, CudnnVersion& b) {
    a.Swap(&b);
  }

  // implements Message ----------------------------------------------

  inline CudnnVersion* New() const final {
    return CreateMaybeMessage<CudnnVersion>(NULL);
  }

  CudnnVersion* New(::google::protobuf::Arena* arena) const final {
    return CreateMaybeMessage<CudnnVersion>(arena);
  }
  void CopyFrom(const ::google::protobuf::Message& from) final;
  void MergeFrom(const ::google::protobuf::Message& from) final;
  void CopyFrom(const CudnnVersion& from);
  void MergeFrom(const CudnnVersion& from);
  void Clear() final;
  bool IsInitialized() const final;

  size_t ByteSizeLong() const final;
  bool MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) final;
  void SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const final;
  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
      bool deterministic, ::google::protobuf::uint8* target) const final;
  int GetCachedSize() const final { return _cached_size_.Get(); }

  private:
  void SharedCtor();
  void SharedDtor();
  void SetCachedSize(int size) const final;
  void InternalSwap(CudnnVersion* other);
  private:
  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
    return NULL;
  }
  inline void* MaybeArenaPtr() const {
    return NULL;
  }
  public:

  ::google::protobuf::Metadata GetMetadata() const final;

  // nested types ----------------------------------------------------

  // accessors -------------------------------------------------------

  // int32 major = 1;
  void clear_major();
  static const int kMajorFieldNumber = 1;
  ::google::protobuf::int32 major() const;
  void set_major(::google::protobuf::int32 value);

  // int32 minor = 2;
  void clear_minor();
  static const int kMinorFieldNumber = 2;
  ::google::protobuf::int32 minor() const;
  void set_minor(::google::protobuf::int32 value);

  // int32 patch = 3;
  void clear_patch();
  static const int kPatchFieldNumber = 3;
  ::google::protobuf::int32 patch() const;
  void set_patch(::google::protobuf::int32 value);

  // @@protoc_insertion_point(class_scope:stream_executor.CudnnVersion)
 private:

  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  ::google::protobuf::int32 major_;
  ::google::protobuf::int32 minor_;
  ::google::protobuf::int32 patch_;
  mutable ::google::protobuf::internal::CachedSize _cached_size_;
  friend struct ::protobuf_diplomacy_5ftensorflow_2fstream_5fexecutor_2flogging_2eproto::TableStruct;
};
// -------------------------------------------------------------------

class ComputeCapability : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:stream_executor.ComputeCapability) */ {
 public:
  ComputeCapability();
  virtual ~ComputeCapability();

  ComputeCapability(const ComputeCapability& from);

  inline ComputeCapability& operator=(const ComputeCapability& from) {
    CopyFrom(from);
    return *this;
  }
  #if LANG_CXX11
  ComputeCapability(ComputeCapability&& from) noexcept
    : ComputeCapability() {
    *this = ::std::move(from);
  }

  inline ComputeCapability& operator=(ComputeCapability&& from) noexcept {
    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
      if (this != &from) InternalSwap(&from);
    } else {
      CopyFrom(from);
    }
    return *this;
  }
  #endif
  static const ::google::protobuf::Descriptor* descriptor();
  static const ComputeCapability& default_instance();

  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
  static inline const ComputeCapability* internal_default_instance() {
    return reinterpret_cast<const ComputeCapability*>(
               &_ComputeCapability_default_instance_);
  }
  static constexpr int kIndexInFileMessages =
    1;

  void Swap(ComputeCapability* other);
  friend void swap(ComputeCapability& a, ComputeCapability& b) {
    a.Swap(&b);
  }

  // implements Message ----------------------------------------------

  inline ComputeCapability* New() const final {
    return CreateMaybeMessage<ComputeCapability>(NULL);
  }

  ComputeCapability* New(::google::protobuf::Arena* arena) const final {
    return CreateMaybeMessage<ComputeCapability>(arena);
  }
  void CopyFrom(const ::google::protobuf::Message& from) final;
  void MergeFrom(const ::google::protobuf::Message& from) final;
  void CopyFrom(const ComputeCapability& from);
  void MergeFrom(const ComputeCapability& from);
  void Clear() final;
  bool IsInitialized() const final;

  size_t ByteSizeLong() const final;
  bool MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) final;
  void SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const final;
  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
      bool deterministic, ::google::protobuf::uint8* target) const final;
  int GetCachedSize() const final { return _cached_size_.Get(); }

  private:
  void SharedCtor();
  void SharedDtor();
  void SetCachedSize(int size) const final;
  void InternalSwap(ComputeCapability* other);
  private:
  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
    return NULL;
  }
  inline void* MaybeArenaPtr() const {
    return NULL;
  }
  public:

  ::google::protobuf::Metadata GetMetadata() const final;

  // nested types ----------------------------------------------------

  // accessors -------------------------------------------------------

  // int32 major = 1;
  void clear_major();
  static const int kMajorFieldNumber = 1;
  ::google::protobuf::int32 major() const;
  void set_major(::google::protobuf::int32 value);

  // int32 minor = 2;
  void clear_minor();
  static const int kMinorFieldNumber = 2;
  ::google::protobuf::int32 minor() const;
  void set_minor(::google::protobuf::int32 value);

  // @@protoc_insertion_point(class_scope:stream_executor.ComputeCapability)
 private:

  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  ::google::protobuf::int32 major_;
  ::google::protobuf::int32 minor_;
  mutable ::google::protobuf::internal::CachedSize _cached_size_;
  friend struct ::protobuf_diplomacy_5ftensorflow_2fstream_5fexecutor_2flogging_2eproto::TableStruct;
};
// -------------------------------------------------------------------

class CudaInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:stream_executor.CudaInfo) */ {
 public:
  CudaInfo();
  virtual ~CudaInfo();

  CudaInfo(const CudaInfo& from);

  inline CudaInfo& operator=(const CudaInfo& from) {
    CopyFrom(from);
    return *this;
  }
  #if LANG_CXX11
  CudaInfo(CudaInfo&& from) noexcept
    : CudaInfo() {
    *this = ::std::move(from);
  }

  inline CudaInfo& operator=(CudaInfo&& from) noexcept {
    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
      if (this != &from) InternalSwap(&from);
    } else {
      CopyFrom(from);
    }
    return *this;
  }
  #endif
  static const ::google::protobuf::Descriptor* descriptor();
  static const CudaInfo& default_instance();

  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
  static inline const CudaInfo* internal_default_instance() {
    return reinterpret_cast<const CudaInfo*>(
               &_CudaInfo_default_instance_);
  }
  static constexpr int kIndexInFileMessages =
    2;

  void Swap(CudaInfo* other);
  friend void swap(CudaInfo& a, CudaInfo& b) {
    a.Swap(&b);
  }

  // implements Message ----------------------------------------------

  inline CudaInfo* New() const final {
    return CreateMaybeMessage<CudaInfo>(NULL);
  }

  CudaInfo* New(::google::protobuf::Arena* arena) const final {
    return CreateMaybeMessage<CudaInfo>(arena);
  }
  void CopyFrom(const ::google::protobuf::Message& from) final;
  void MergeFrom(const ::google::protobuf::Message& from) final;
  void CopyFrom(const CudaInfo& from);
  void MergeFrom(const CudaInfo& from);
  void Clear() final;
  bool IsInitialized() const final;

  size_t ByteSizeLong() const final;
  bool MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) final;
  void SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const final;
  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
      bool deterministic, ::google::protobuf::uint8* target) const final;
  int GetCachedSize() const final { return _cached_size_.Get(); }

  private:
  void SharedCtor();
  void SharedDtor();
  void SetCachedSize(int size) const final;
  void InternalSwap(CudaInfo* other);
  private:
  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
    return NULL;
  }
  inline void* MaybeArenaPtr() const {
    return NULL;
  }
  public:

  ::google::protobuf::Metadata GetMetadata() const final;

  // nested types ----------------------------------------------------

  // accessors -------------------------------------------------------

  // .stream_executor.CudnnVersion cudnn_version = 1;
  bool has_cudnn_version() const;
  void clear_cudnn_version();
  static const int kCudnnVersionFieldNumber = 1;
  private:
  const ::stream_executor::CudnnVersion& _internal_cudnn_version() const;
  public:
  const ::stream_executor::CudnnVersion& cudnn_version() const;
  ::stream_executor::CudnnVersion* release_cudnn_version();
  ::stream_executor::CudnnVersion* mutable_cudnn_version();
  void set_allocated_cudnn_version(::stream_executor::CudnnVersion* cudnn_version);

  // .stream_executor.ComputeCapability compute_capability = 2;
  bool has_compute_capability() const;
  void clear_compute_capability();
  static const int kComputeCapabilityFieldNumber = 2;
  private:
  const ::stream_executor::ComputeCapability& _internal_compute_capability() const;
  public:
  const ::stream_executor::ComputeCapability& compute_capability() const;
  ::stream_executor::ComputeCapability* release_compute_capability();
  ::stream_executor::ComputeCapability* mutable_compute_capability();
  void set_allocated_compute_capability(::stream_executor::ComputeCapability* compute_capability);

  // @@protoc_insertion_point(class_scope:stream_executor.CudaInfo)
 private:

  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  ::stream_executor::CudnnVersion* cudnn_version_;
  ::stream_executor::ComputeCapability* compute_capability_;
  mutable ::google::protobuf::internal::CachedSize _cached_size_;
  friend struct ::protobuf_diplomacy_5ftensorflow_2fstream_5fexecutor_2flogging_2eproto::TableStruct;
};
// ===================================================================

// ===================================================================

#ifdef __GNUC__
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif  // __GNUC__
// CudnnVersion

// int32 major = 1;
inline void CudnnVersion::clear_major() {
  major_ = 0;
}
inline ::google::protobuf::int32 CudnnVersion::major() const {
  // @@protoc_insertion_point(field_get:stream_executor.CudnnVersion.major)
  return major_;
}
inline void CudnnVersion::set_major(::google::protobuf::int32 value) {

  major_ = value;
  // @@protoc_insertion_point(field_set:stream_executor.CudnnVersion.major)
}

// int32 minor = 2;
inline void CudnnVersion::clear_minor() {
  minor_ = 0;
}
inline ::google::protobuf::int32 CudnnVersion::minor() const {
  // @@protoc_insertion_point(field_get:stream_executor.CudnnVersion.minor)
  return minor_;
}
inline void CudnnVersion::set_minor(::google::protobuf::int32 value) {

  minor_ = value;
  // @@protoc_insertion_point(field_set:stream_executor.CudnnVersion.minor)
}

// int32 patch = 3;
inline void CudnnVersion::clear_patch() {
  patch_ = 0;
}
inline ::google::protobuf::int32 CudnnVersion::patch() const {
  // @@protoc_insertion_point(field_get:stream_executor.CudnnVersion.patch)
  return patch_;
}
inline void CudnnVersion::set_patch(::google::protobuf::int32 value) {

  patch_ = value;
  // @@protoc_insertion_point(field_set:stream_executor.CudnnVersion.patch)
}

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

// ComputeCapability

// int32 major = 1;
inline void ComputeCapability::clear_major() {
  major_ = 0;
}
inline ::google::protobuf::int32 ComputeCapability::major() const {
  // @@protoc_insertion_point(field_get:stream_executor.ComputeCapability.major)
  return major_;
}
inline void ComputeCapability::set_major(::google::protobuf::int32 value) {

  major_ = value;
  // @@protoc_insertion_point(field_set:stream_executor.ComputeCapability.major)
}

// int32 minor = 2;
inline void ComputeCapability::clear_minor() {
  minor_ = 0;
}
inline ::google::protobuf::int32 ComputeCapability::minor() const {
  // @@protoc_insertion_point(field_get:stream_executor.ComputeCapability.minor)
  return minor_;
}
inline void ComputeCapability::set_minor(::google::protobuf::int32 value) {

  minor_ = value;
  // @@protoc_insertion_point(field_set:stream_executor.ComputeCapability.minor)
}

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

// CudaInfo

// .stream_executor.CudnnVersion cudnn_version = 1;
inline bool CudaInfo::has_cudnn_version() const {
  return this != internal_default_instance() && cudnn_version_ != NULL;
}
inline void CudaInfo::clear_cudnn_version() {
  if (GetArenaNoVirtual() == NULL && cudnn_version_ != NULL) {
    delete cudnn_version_;
  }
  cudnn_version_ = NULL;
}
inline const ::stream_executor::CudnnVersion& CudaInfo::_internal_cudnn_version() const {
  return *cudnn_version_;
}
inline const ::stream_executor::CudnnVersion& CudaInfo::cudnn_version() const {
  const ::stream_executor::CudnnVersion* p = cudnn_version_;
  // @@protoc_insertion_point(field_get:stream_executor.CudaInfo.cudnn_version)
  return p != NULL ? *p : *reinterpret_cast<const ::stream_executor::CudnnVersion*>(
      &::stream_executor::_CudnnVersion_default_instance_);
}
inline ::stream_executor::CudnnVersion* CudaInfo::release_cudnn_version() {
  // @@protoc_insertion_point(field_release:stream_executor.CudaInfo.cudnn_version)

  ::stream_executor::CudnnVersion* temp = cudnn_version_;
  cudnn_version_ = NULL;
  return temp;
}
inline ::stream_executor::CudnnVersion* CudaInfo::mutable_cudnn_version() {

  if (cudnn_version_ == NULL) {
    auto* p = CreateMaybeMessage<::stream_executor::CudnnVersion>(GetArenaNoVirtual());
    cudnn_version_ = p;
  }
  // @@protoc_insertion_point(field_mutable:stream_executor.CudaInfo.cudnn_version)
  return cudnn_version_;
}
inline void CudaInfo::set_allocated_cudnn_version(::stream_executor::CudnnVersion* cudnn_version) {
  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  if (message_arena == NULL) {
    delete cudnn_version_;
  }
  if (cudnn_version) {
    ::google::protobuf::Arena* submessage_arena = NULL;
    if (message_arena != submessage_arena) {
      cudnn_version = ::google::protobuf::internal::GetOwnedMessage(
          message_arena, cudnn_version, submessage_arena);
    }

  } else {

  }
  cudnn_version_ = cudnn_version;
  // @@protoc_insertion_point(field_set_allocated:stream_executor.CudaInfo.cudnn_version)
}

// .stream_executor.ComputeCapability compute_capability = 2;
inline bool CudaInfo::has_compute_capability() const {
  return this != internal_default_instance() && compute_capability_ != NULL;
}
inline void CudaInfo::clear_compute_capability() {
  if (GetArenaNoVirtual() == NULL && compute_capability_ != NULL) {
    delete compute_capability_;
  }
  compute_capability_ = NULL;
}
inline const ::stream_executor::ComputeCapability& CudaInfo::_internal_compute_capability() const {
  return *compute_capability_;
}
inline const ::stream_executor::ComputeCapability& CudaInfo::compute_capability() const {
  const ::stream_executor::ComputeCapability* p = compute_capability_;
  // @@protoc_insertion_point(field_get:stream_executor.CudaInfo.compute_capability)
  return p != NULL ? *p : *reinterpret_cast<const ::stream_executor::ComputeCapability*>(
      &::stream_executor::_ComputeCapability_default_instance_);
}
inline ::stream_executor::ComputeCapability* CudaInfo::release_compute_capability() {
  // @@protoc_insertion_point(field_release:stream_executor.CudaInfo.compute_capability)

  ::stream_executor::ComputeCapability* temp = compute_capability_;
  compute_capability_ = NULL;
  return temp;
}
inline ::stream_executor::ComputeCapability* CudaInfo::mutable_compute_capability() {

  if (compute_capability_ == NULL) {
    auto* p = CreateMaybeMessage<::stream_executor::ComputeCapability>(GetArenaNoVirtual());
    compute_capability_ = p;
  }
  // @@protoc_insertion_point(field_mutable:stream_executor.CudaInfo.compute_capability)
  return compute_capability_;
}
inline void CudaInfo::set_allocated_compute_capability(::stream_executor::ComputeCapability* compute_capability) {
  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  if (message_arena == NULL) {
    delete compute_capability_;
  }
  if (compute_capability) {
    ::google::protobuf::Arena* submessage_arena = NULL;
    if (message_arena != submessage_arena) {
      compute_capability = ::google::protobuf::internal::GetOwnedMessage(
          message_arena, compute_capability, submessage_arena);
    }

  } else {

  }
  compute_capability_ = compute_capability;
  // @@protoc_insertion_point(field_set_allocated:stream_executor.CudaInfo.compute_capability)
}

#ifdef __GNUC__
  #pragma GCC diagnostic pop
#endif  // __GNUC__
// -------------------------------------------------------------------

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

// @@protoc_insertion_point(namespace_scope)

}  // namespace stream_executor

// @@protoc_insertion_point(global_scope)

#endif  // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fstream_5fexecutor_2flogging_2eproto


text:
namespace media {

const int kVp9MaxProfile = 4;
const int kVp9NumRefFramesLog2 = 3;
const size_t kVp9NumRefFrames = 1 << kVp9NumRefFramesLog2;
const uint8_t kVp9MaxProb = 255;
const size_t kVp9NumRefsPerFrame = 3;
const size_t kVp9NumFrameContextsLog2 = 2;
const size_t kVp9NumFrameContexts = 1 << kVp9NumFrameContextsLog2;

using Vp9Prob = uint8_t;

enum class Vp9ColorSpace {
  UNKNOWN = 0,
  BT_601 = 1,
  BT_709 = 2,
  SMPTE_170 = 3,
  SMPTE_240 = 4,
  BT_2020 = 5,
  RESERVED = 6,
  SRGB = 7,
};

enum Vp9InterpolationFilter {
  EIGHTTAP = 0,
  EIGHTTAP_SMOOTH = 1,
  EIGHTTAP_SHARP = 2,
  BILINEAR = 3,
  SWITCHABLE = 4,
};

enum Vp9RefType {
  VP9_FRAME_INTRA = 0,
  VP9_FRAME_LAST = 1,
  VP9_FRAME_GOLDEN = 2,
  VP9_FRAME_ALTREF = 3,
  VP9_FRAME_MAX = 4,
};

enum Vp9ReferenceMode {
  SINGLE_REFERENCE = 0,
  COMPOUND_REFERENCE = 1,
  REFERENCE_MODE_SELECT = 2,
};

struct MEDIA_EXPORT Vp9SegmentationParams {
  static const size_t kNumSegments = 8;
  static const size_t kNumTreeProbs = kNumSegments - 1;
  static const size_t kNumPredictionProbs = 3;
  enum SegmentLevelFeature {
    SEG_LVL_ALT_Q = 0,
    SEG_LVL_ALT_LF = 1,
    SEG_LVL_REF_FRAME = 2,
    SEG_LVL_SKIP = 3,
    SEG_LVL_MAX
  };

  bool enabled;

  bool update_map;
  uint8_t tree_probs[kNumTreeProbs];
  bool temporal_update;
  uint8_t pred_probs[kNumPredictionProbs];

  bool update_data;
  bool abs_or_delta_update;
  bool feature_enabled[kNumSegments][SEG_LVL_MAX];
  int16_t feature_data[kNumSegments][SEG_LVL_MAX];

  int16_t y_dequant[kNumSegments][2];
  int16_t uv_dequant[kNumSegments][2];

  bool FeatureEnabled(size_t seg_id, SegmentLevelFeature feature) const {
    return feature_enabled[seg_id][feature];
  }

  int16_t FeatureData(size_t seg_id, SegmentLevelFeature feature) const {
    return feature_data[seg_id][feature];
  }
};

struct MEDIA_EXPORT Vp9LoopFilterParams {
  static const size_t kNumModeDeltas = 2;

  uint8_t level;
  uint8_t sharpness;

  bool delta_enabled;
  bool delta_update;
  bool update_ref_deltas[VP9_FRAME_MAX];
  int8_t ref_deltas[VP9_FRAME_MAX];
  bool update_mode_deltas[kNumModeDeltas];
  int8_t mode_deltas[kNumModeDeltas];

  // Calculated from above fields.
  uint8_t lvl[Vp9SegmentationParams::kNumSegments][VP9_FRAME_MAX]
             [kNumModeDeltas];
};

// Members of Vp9FrameHeader will be 0-initialized by Vp9Parser::ParseNextFrame.
struct MEDIA_EXPORT Vp9QuantizationParams {
  bool IsLossless() const {
    return base_q_idx == 0 && delta_q_y_dc == 0 && delta_q_uv_dc == 0 &&
           delta_q_uv_ac == 0;
  }

  uint8_t base_q_idx;
  int8_t delta_q_y_dc;
  int8_t delta_q_uv_dc;
  int8_t delta_q_uv_ac;
};

// Entropy context for frame parsing
struct MEDIA_EXPORT Vp9FrameContext {
  bool IsValid() const;

  Vp9Prob tx_probs_8x8[2][1];
  Vp9Prob tx_probs_16x16[2][2];
  Vp9Prob tx_probs_32x32[2][3];

  Vp9Prob coef_probs[4][2][2][6][6][3];
  Vp9Prob skip_prob[3];
  Vp9Prob inter_mode_probs[7][3];
  Vp9Prob interp_filter_probs[4][2];
  Vp9Prob is_inter_prob[4];

  Vp9Prob comp_mode_prob[5];
  Vp9Prob single_ref_prob[5][2];
  Vp9Prob comp_ref_prob[5];

  Vp9Prob y_mode_probs[4][9];
  Vp9Prob uv_mode_probs[10][9];
  Vp9Prob partition_probs[16][3];

  Vp9Prob mv_joint_probs[3];
  Vp9Prob mv_sign_prob[2];
  Vp9Prob mv_class_probs[2][10];
  Vp9Prob mv_class0_bit_prob[2];
  Vp9Prob mv_bits_prob[2][10];
  Vp9Prob mv_class0_fr_probs[2][2][3];
  Vp9Prob mv_fr_probs[2][3];
  Vp9Prob mv_class0_hp_prob[2];
  Vp9Prob mv_hp_prob[2];
};

struct MEDIA_EXPORT Vp9CompressedHeader {
  enum Vp9TxMode {
    ONLY_4X4 = 0,
    ALLOW_8X8 = 1,
    ALLOW_16X16 = 2,
    ALLOW_32X32 = 3,
    TX_MODE_SELECT = 4,
    TX_MODES = 5,
  };

  Vp9TxMode tx_mode;
  Vp9ReferenceMode reference_mode;
};

// VP9 frame header.
struct MEDIA_EXPORT Vp9FrameHeader {
  enum FrameType {
    KEYFRAME = 0,
    INTERFRAME = 1,
  };

  bool IsKeyframe() const;
  bool IsIntra() const;
  bool RefreshFlag(size_t i) const {
    return !!(refresh_frame_flags & (1u << i));
  }

  uint8_t profile;

  bool show_existing_frame;
  uint8_t frame_to_show_map_idx;

  FrameType frame_type;

  bool show_frame;
  bool error_resilient_mode;

  uint8_t bit_depth;
  Vp9ColorSpace color_space;
  bool color_range;
  uint8_t subsampling_x;
  uint8_t subsampling_y;

  // The range of frame_width and frame_height is 1..2^16.
  uint32_t frame_width;
  uint32_t frame_height;
  uint32_t render_width;
  uint32_t render_height;

  bool intra_only;
  uint8_t reset_frame_context;
  uint8_t refresh_frame_flags;
  uint8_t ref_frame_idx[kVp9NumRefsPerFrame];
  bool ref_frame_sign_bias[Vp9RefType::VP9_FRAME_MAX];
  bool allow_high_precision_mv;
  Vp9InterpolationFilter interpolation_filter;

  bool refresh_frame_context;
  bool frame_parallel_decoding_mode;
  uint8_t frame_context_idx;
  // |frame_context_idx_to_save_probs| is to be used by save_probs() only, and
  // |frame_context_idx| otherwise.
  uint8_t frame_context_idx_to_save_probs;

  Vp9QuantizationParams quant_params;

  uint8_t tile_cols_log2;
  uint8_t tile_rows_log2;

  // Pointer to the beginning of frame data. It is a responsibility of the
  // client of the Vp9Parser to maintain validity of this data while it is
  // being used outside of that class.
  const uint8_t* data;

  // Size of |data| in bytes.
  size_t frame_size;

  // Size of compressed header in bytes.
  size_t header_size_in_bytes;

  // Size of uncompressed header in bytes.
  size_t uncompressed_header_size;

  Vp9CompressedHeader compressed_header;
  // Initial frame entropy context after load_probs2(frame_context_idx).
  Vp9FrameContext initial_frame_context;
  // Current frame entropy context after header parsing.
  Vp9FrameContext frame_context;
};

// A parser for VP9 bitstream.
class MEDIA_EXPORT Vp9Parser {
 public:
  // If context update is needed after decoding a frame, the client must
  // execute this callback, passing the updated context state.
  using ContextRefreshCallback = base::Callback<void(const Vp9FrameContext&)>;

  // ParseNextFrame() return values. See documentation for ParseNextFrame().
  enum Result {
    kOk,
    kInvalidStream,
    kEOStream,
    kAwaitingRefresh,
  };

  // The parsing context to keep track of references.
  struct ReferenceSlot {
    bool initialized;
    uint32_t frame_width;
    uint32_t frame_height;
    uint8_t subsampling_x;
    uint8_t subsampling_y;
    uint8_t bit_depth;

    // More fields for consistency checking.
    uint8_t profile;
    Vp9ColorSpace color_space;
  };

  // The parsing context that persists across frames.
  class Context {
   public:
    class Vp9FrameContextManager {
     public:
      Vp9FrameContextManager();
      ~Vp9FrameContextManager();
      bool initialized() const { return initialized_; }
      bool needs_client_update() const { return needs_client_update_; }
      const Vp9FrameContext& frame_context() const;

      // Resets to uninitialized state.
      void Reset();

      // Marks this context as requiring an update from parser's client.
      void SetNeedsClientUpdate();

      // Updates frame context.
      void Update(const Vp9FrameContext& frame_context);

      // Returns a callback to update frame context at a later time with.
      ContextRefreshCallback GetUpdateCb();

     private:
      // Updates frame context from parser's client.
      void UpdateFromClient(const Vp9FrameContext& frame_context);

      bool initialized_ = false;
      bool needs_client_update_ = false;
      Vp9FrameContext frame_context_;

      base::WeakPtrFactory<Vp9FrameContextManager> weak_ptr_factory_;
    };

    void Reset();

    // Mark |frame_context_idx| as requiring update from the client.
    void MarkFrameContextForUpdate(size_t frame_context_idx);

    // Update frame context at |frame_context_idx| with the contents of
    // |frame_context|.
    void UpdateFrameContext(size_t frame_context_idx,
                            const Vp9FrameContext& frame_context);

    // Return ReferenceSlot for frame at |ref_idx|.
    const ReferenceSlot& GetRefSlot(size_t ref_idx) const;

    // Update contents of ReferenceSlot at |ref_idx| with the contents of
    // |ref_slot|.
    void UpdateRefSlot(size_t ref_idx, const ReferenceSlot& ref_slot);

    const Vp9SegmentationParams& segmentation() const { return segmentation_; }

    const Vp9LoopFilterParams& loop_filter() const { return loop_filter_; }

   private:
    friend class Vp9UncompressedHeaderParser;
    friend class Vp9Parser;

    // Segmentation and loop filter state.
    Vp9SegmentationParams segmentation_;
    Vp9LoopFilterParams loop_filter_;

    // Frame references.
    ReferenceSlot ref_slots_[kVp9NumRefFrames];

    Vp9FrameContextManager frame_context_managers_[kVp9NumFrameContexts];
  };

  // The constructor. See ParseNextFrame() for comments for
  // |parsing_compressed_header|.
  explicit Vp9Parser(bool parsing_compressed_header);
  ~Vp9Parser();

  // Set a new stream buffer to read from, starting at |stream| and of size
  // |stream_size| in bytes. |stream| must point to the beginning of a single
  // frame or a single superframe, is owned by caller and must remain valid
  // until the next call to SetStream().
  void SetStream(const uint8_t* stream, off_t stream_size);

  // Parse the next frame in the current stream buffer, filling |fhdr| with
  // the parsed frame header and updating current segmentation and loop filter
  // state.
  // Return kOk if a frame has successfully been parsed,
  //        kEOStream if there is no more data in the current stream buffer,
  //        kAwaitingRefresh if this frame awaiting frame context update, or
  //        kInvalidStream on error.
  Result ParseNextFrame(Vp9FrameHeader* fhdr);

  // Return current parsing context.
  const Context& context() const { return context_; }

  // Return a ContextRefreshCallback, which, if not null, has to be called with
  // the new context state after the frame associated with |frame_context_idx|
  // is decoded.
  ContextRefreshCallback GetContextRefreshCb(size_t frame_context_idx);

  // Clear parser state and return to an initialized state.
  void Reset();

 private:
  // Stores start pointer and size of each frame within the current superframe.
  struct FrameInfo {
    FrameInfo() = default;
    FrameInfo(const uint8_t* ptr, off_t size);
    bool IsValid() const { return ptr != nullptr; }
    void Reset() { ptr = nullptr; }

    // Starting address of the frame.
    const uint8_t* ptr = nullptr;

    // Size of the frame in bytes.
    off_t size = 0;
  };

  std::deque<FrameInfo> ParseSuperframe();

  size_t GetQIndex(const Vp9QuantizationParams& quant, size_t segid) const;
  void SetupSegmentationDequant();
  void SetupLoopFilter();
  void UpdateSlots();

  // Current address in the bitstream buffer.
  const uint8_t* stream_;

  // Remaining bytes in stream_.
  off_t bytes_left_;

  bool parsing_compressed_header_;

  // FrameInfo for the remaining frames in the current superframe to be parsed.
  std::deque<FrameInfo> frames_;

  Context context_;

  FrameInfo curr_frame_info_;
  Vp9FrameHeader curr_frame_header_;

  DISALLOW_COPY_AND_ASSIGN(Vp9Parser);
};

}  // namespace media

#endif  // MEDIA_FILTERS_VP9_PARSER_H_


text:
namespace Google.Cloud.AIPlatform.V1.Snippets
{
    // [START aiplatform_v1_generated_VizierService_ListOptimalTrials_async_flattened_resourceNames]
    using Google.Cloud.AIPlatform.V1;
    using System.Threading.Tasks;

    public sealed partial class GeneratedVizierServiceClientSnippets
    {
        /// <summary>Snippet for ListOptimalTrialsAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task ListOptimalTrialsResourceNamesAsync()
        {
            // Create client
            VizierServiceClient vizierServiceClient = await VizierServiceClient.CreateAsync();
            // Initialize request argument(s)
            StudyName parent = StudyName.FromProjectLocationStudy("[PROJECT]", "[LOCATION]", "[STUDY]");
            // Make the request
            ListOptimalTrialsResponse response = await vizierServiceClient.ListOptimalTrialsAsync(parent);
        }
    }
    // [END aiplatform_v1_generated_VizierService_ListOptimalTrials_async_flattened_resourceNames]
}


text:
'use strict';

import React, {
  Component,
  TabBarIOS
} from 'react-native';
var TimelinePage = require('./timeline/timelinePage');
var LeaderboardPage = require('./leaderboard/leaderboardPage');
var MonthlySummaryPage = require('./monthlySummary/monthlySummaryPage');

export default class MainPage extends Component {
  constructor(props) {
    super(props);
    this.state = {
      selectedTab: 'leaderboard'
    };
  }

  render() {
    return (
      <TabBarIOS tintColor="black">
        <TabBarIOS.Item
          title="Timeline"
          icon={ require('../img/timeline.png') }
          selected={this.state.selectedTab === 'timeline'}
          onPress={() => this.setState({selectedTab: 'timeline'})}
          >
          <TimelinePage />
        </TabBarIOS.Item>
        <TabBarIOS.Item
          title="Leaderboard"
          icon={ require('../img/leaderboard.png') }
          selected={this.state.selectedTab === 'leaderboard'}
          onPress={() => this.setState({selectedTab: 'leaderboard'})}
          >
          <LeaderboardPage
            navigator={this.props.navigator}
            />
        </TabBarIOS.Item>
        <TabBarIOS.Item
          title="Me"
          icon={ require('../img/me.png') }
          selected={this.state.selectedTab === 'me'}
          onPress={() => this.setState({selectedTab: 'me'})}
          >
          <MonthlySummaryPage
            user={this.props.currentUser}
            showBackButton={false}
            />
        </TabBarIOS.Item>
      </TabBarIOS>
    );
  }
}


text:
package zapcore

import (
	"bytes"
	"errors"
	"testing"

	"io"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
	"go.uber.org/zap/zaptest"
)

type writeSyncSpy struct {
	io.Writer
	zaptest.Syncer
}

func requireWriteWorks(t testing.TB, ws WriteSyncer) {
	n, err := ws.Write([]byte("foo"))
	require.NoError(t, err, "Unexpected error writing to WriteSyncer.")
	require.Equal(t, 3, n, "Wrote an unexpected number of bytes.")
}

func TestAddSyncWriteSyncer(t *testing.T) {
	buf := &bytes.Buffer{}
	concrete := &writeSyncSpy{Writer: buf}
	ws := AddSync(concrete)
	requireWriteWorks(t, ws)

	require.NoError(t, ws.Sync(), "Unexpected error syncing a WriteSyncer.")
	require.True(t, concrete.Called(), "Expected to dispatch to concrete type's Sync method.")

	concrete.SetError(errors.New("fail"))
	assert.Error(t, ws.Sync(), "Expected to propagate errors from concrete type's Sync method.")
}

func TestAddSyncWriter(t *testing.T) {
	// If we pass a plain io.Writer, make sure that we still get a WriteSyncer
	// with a no-op Sync.
	buf := &bytes.Buffer{}
	ws := AddSync(buf)
	requireWriteWorks(t, ws)
	assert.NoError(t, ws.Sync(), "Unexpected error calling a no-op Sync method.")
}

func TestNewMultiWriteSyncerWorksForSingleWriter(t *testing.T) {
	w := &zaptest.Buffer{}

	ws := NewMultiWriteSyncer(w)
	assert.Equal(t, w, ws, "Expected NewMultiWriteSyncer to return the same WriteSyncer object for a single argument.")

	ws.Sync()
	assert.True(t, w.Called(), "Expected Sync to be called on the created WriteSyncer")
}

func TestMultiWriteSyncerWritesBoth(t *testing.T) {
	first := &bytes.Buffer{}
	second := &bytes.Buffer{}
	ws := NewMultiWriteSyncer(AddSync(first), AddSync(second))

	msg := []byte("dumbledore")
	n, err := ws.Write(msg)
	require.NoError(t, err, "Expected successful buffer write")
	assert.Equal(t, len(msg), n)

	assert.Equal(t, msg, first.Bytes())
	assert.Equal(t, msg, second.Bytes())
}

func TestMultiWriteSyncerFailsWrite(t *testing.T) {
	ws := NewMultiWriteSyncer(AddSync(&zaptest.FailWriter{}))
	_, err := ws.Write([]byte("test"))
	assert.Error(t, err, "Write error should propagate")
}

func TestMultiWriteSyncerFailsShortWrite(t *testing.T) {
	ws := NewMultiWriteSyncer(AddSync(&zaptest.ShortWriter{}))
	n, err := ws.Write([]byte("test"))
	assert.NoError(t, err, "Expected fake-success from short write")
	assert.Equal(t, 3, n, "Expected byte count to return from underlying writer")
}

func TestWritestoAllSyncs_EvenIfFirstErrors(t *testing.T) {
	failer := &zaptest.FailWriter{}
	second := &bytes.Buffer{}
	ws := NewMultiWriteSyncer(AddSync(failer), AddSync(second))

	_, err := ws.Write([]byte("fail"))
	assert.Error(t, err, "Expected error from call to a writer that failed")
	assert.Equal(t, []byte("fail"), second.Bytes(), "Expected second sink to be written after first error")
}

func TestMultiWriteSyncerSync_PropagatesErrors(t *testing.T) {
	badsink := &zaptest.Buffer{}
	badsink.SetError(errors.New("sink is full"))
	ws := NewMultiWriteSyncer(&zaptest.Discarder{}, badsink)

	assert.Error(t, ws.Sync(), "Expected sync error to propagate")
}

func TestMultiWriteSyncerSync_NoErrorsOnDiscard(t *testing.T) {
	ws := NewMultiWriteSyncer(&zaptest.Discarder{})
	assert.NoError(t, ws.Sync(), "Expected error-free sync to /dev/null")
}

func TestMultiWriteSyncerSync_AllCalled(t *testing.T) {
	failed, second := &zaptest.Buffer{}, &zaptest.Buffer{}

	failed.SetError(errors.New("disposal broken"))
	ws := NewMultiWriteSyncer(failed, second)

	assert.Error(t, ws.Sync(), "Expected first sink to fail")
	assert.True(t, failed.Called(), "Expected first sink to have Sync method called.")
	assert.True(t, second.Called(), "Expected call to Sync even with first failure.")
}


text:
@class DBRoute;

NS_ASSUME_NONNULL_BEGIN

///
/// Stone route objects for the TeamLog namespace. Each route in the TeamLog
/// namespace has its own static object, which contains information about the
/// route.
///
@interface DBTEAMLOGRouteObjects : NSObject

/// Accessor method for the getEvents route object.
+ (DBRoute *)DBTEAMLOGGetEvents;

/// Accessor method for the getEventsContinue route object.
+ (DBRoute *)DBTEAMLOGGetEventsContinue;

@end

NS_ASSUME_NONNULL_END


text:
[![Build Status](http://img.shields.io/travis/jramoyo/flowee.svg?style=flat)](https://travis-ci.org/jramoyo/flowee)
[![Issues](http://img.shields.io/github/issues/jramoyo/flowee.svg?style=flat)](https://github.com/jramoyo/flowee/issues?state=open)
[![Gittip](http://img.shields.io/gittip/jramoyo.svg?style=flat)](https://www.gittip.com/jramoyo/)

Flowee is a framework for building Java services backed by one or more workflows. Its primary purpose is to provide groundwork for rule-driven workflow selection and execution. Developers can focus the majority of their efforts on building the tasks which hold the actual business requirements.

Workflows built on Flowee will run without the need for "containers" or "engines". The framework is lightweight and integrates seamlessly with any application.

Details are found in this three part blog series: [part 1](http://www.jramoyo.com/2013/05/introducing-flowee-framework-for.html), [part 2](http://www.jramoyo.com/2013/05/flowee-sample-application.html), part 3.

## Downloads
  * [1.0](https://drive.google.com/folderview?id=0BxIYRgMtzry_N3Z6UjlvbHhTeEE&usp=sharing 1.0)

## Maven
```xml
<dependency>
  <groupId>com.jramoyo.flowee</groupId>
  <artifactId>flowee-core</artifactId>
  <version>1.0</version>
</dependency>
```
Also include when integrating with Spring:
```xml
<dependency>
  <groupId>com.jramoyo.flowee</groupId>
  <artifactId>flowee-spring</artifactId>
  <version>1.0</version>
</dependency>
```


text:
// Adapted for use thru MobileSiteOS. This works without worrying about load order because
// 'jquery.ui.js' includes ui core, widget, mouse, position, draggable, effect.core already bundled.

// msos: start
msos.provide("jquery.effects.explode");

jquery.effects.explode.version = new msos.set_version(14, 2, 23);

// Directly below is the std. jquery.effects plugin
(function( $, undefined ) {

$.effects.effect.explode = function( o, done ) {

	var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,
		cells = rows,
		el = $( this ),
		mode = $.effects.setMode( el, o.mode || "hide" ),
		show = mode === "show",

		// show and then visibility:hidden the element before calculating offset
		offset = el.show().css( "visibility", "hidden" ).offset(),

		// width and height of a piece
		width = Math.ceil( el.outerWidth() / cells ),
		height = Math.ceil( el.outerHeight() / rows ),
		pieces = [],

		// loop
		i, j, left, top, mx, my;

	// children animate complete:
	function childComplete() {
		pieces.push( this );
		if ( pieces.length === rows * cells ) {
			animComplete();
		}
	}

	// clone the element for each row and cell.
	for( i = 0; i < rows ; i++ ) { // ===>
		top = offset.top + i * height;
		my = i - ( rows - 1 ) / 2 ;

		for( j = 0; j < cells ; j++ ) { // |||
			left = offset.left + j * width;
			mx = j - ( cells - 1 ) / 2 ;

			// Create a clone of the now hidden main element that will be absolute positioned
			// within a wrapper div off the -left and -top equal to size of our pieces
			el
				.clone()
				.appendTo( "body" )
				.wrap( "

" )
				.css({
					position: "absolute",
					visibility: "visible",
					left: -j * width,
					top: -i * height
				})

			// select the wrapper - make it overflow: hidden and absolute positioned based on
			// where the original was located +left and +top equal to the size of pieces
				.parent()
				.addClass( "ui-effects-explode" )
				.css({
					position: "absolute",
					overflow: "hidden",
					width: width,
					height: height,
					left: left + ( show ? mx * width : 0 ),
					top: top + ( show ? my * height : 0 ),
					opacity: show ? 0 : 1
				}).animate({
					left: left + ( show ? 0 : mx * width ),
					top: top + ( show ? 0 : my * height ),
					opacity: show ? 1 : 0
				}, o.duration || 500, o.easing, childComplete );
		}
	}

	function animComplete() {
		el.css({
			visibility: "visible"
		});
		$( pieces ).remove();
		if ( !show ) {
			el.hide();
		}
		done();
	}
};

})(jQuery);


text:
from oslo_config import cfg

from neutron._i18n import _

QUOTA_DB_DIRECTORY = 'neutron.db.quota.'
QUOTA_DB_DRIVER_LEGACY = QUOTA_DB_DIRECTORY + 'driver.DbQuotaDriver'
QUOTA_DB_DRIVER_NO_LOCK = (QUOTA_DB_DIRECTORY +
                           'driver_nolock.DbQuotaNoLockDriver')
QUOTA_DB_DRIVER_NULL = QUOTA_DB_DIRECTORY + 'driver_null.DbQuotaDriverNull'

QUOTA_DB_DRIVER = QUOTA_DB_DRIVER_NO_LOCK
QUOTAS_CFG_GROUP = 'QUOTAS'

DEFAULT_QUOTA = -1
DEFAULT_QUOTA_NETWORK = 100
DEFAULT_QUOTA_SUBNET = 100
DEFAULT_QUOTA_PORT = 500
DEFAULT_QUOTA_SG = 10
DEFAULT_QUOTA_SG_RULE = 100
DEFAULT_QUOTA_ROUTER = 10
DEFAULT_QUOTA_FIP = 50
DEFAULT_QUOTA_RBAC = 10

# quota_opts from neutron/quota/__init__.py
# renamed quota_opts to core_quota_opts
core_quota_opts = [
    cfg.IntOpt('default_quota',
               default=DEFAULT_QUOTA,
               help=_('Default number of resource allowed per tenant. '
                      'A negative value means unlimited.')),
    cfg.IntOpt('quota_network',
               default=DEFAULT_QUOTA_NETWORK,
               help=_('Number of networks allowed per tenant. '
                      'A negative value means unlimited.')),
    cfg.IntOpt('quota_subnet',
               default=DEFAULT_QUOTA_SUBNET,
               help=_('Number of subnets allowed per tenant, '
                      'A negative value means unlimited.')),
    cfg.IntOpt('quota_port',
               default=DEFAULT_QUOTA_PORT,
               help=_('Number of ports allowed per tenant. '
                      'A negative value means unlimited.')),
    cfg.StrOpt('quota_driver',
               default=QUOTA_DB_DRIVER,
               help=_('Default driver to use for quota checks.')),
    cfg.BoolOpt('track_quota_usage',
                default=True,
                help=_('Keep in track in the database of current resource '
                       'quota usage. Plugins which do not leverage the '
                       'neutron database should set this flag to False.')),
]

# security_group_quota_opts from neutron/extensions/securitygroup.py
security_group_quota_opts = [
    cfg.IntOpt('quota_security_group',
               default=DEFAULT_QUOTA_SG,
               help=_('Number of security groups allowed per tenant. '
                      'A negative value means unlimited.')),
    cfg.IntOpt('quota_security_group_rule',
               default=DEFAULT_QUOTA_SG_RULE,
               help=_('Number of security rules allowed per tenant. '
                      'A negative value means unlimited.')),
]

# l3_quota_opts from neutron/extensions/l3.py
l3_quota_opts = [
    cfg.IntOpt('quota_router',
               default=DEFAULT_QUOTA_ROUTER,
               help=_('Number of routers allowed per tenant. '
                      'A negative value means unlimited.')),
    cfg.IntOpt('quota_floatingip',
               default=DEFAULT_QUOTA_FIP,
               help=_('Number of floating IPs allowed per tenant. '
                      'A negative value means unlimited.')),
]

# rbac_quota_opts from neutron/extensions/rbac.py
rbac_quota_opts = [
    cfg.IntOpt('quota_rbac_policy', default=DEFAULT_QUOTA_RBAC,
               deprecated_name='quota_rbac_entry',
               help=_('Default number of RBAC entries allowed per tenant. '
                      'A negative value means unlimited.'))
]

def register_quota_opts(opts, cfg=cfg.CONF):
    cfg.register_opts(opts, QUOTAS_CFG_GROUP)