text:
package play.test;

import org.junit.Test;
import play.i18n.MessagesApi;

import static org.junit.Assert.assertNotNull;

/**
 * Tests WithApplication functionality.
 */
public class WithApplicationTest extends WithApplication {

    @Test
    public void shouldHaveAnAppInstantiated() {
        assertNotNull(app);
    }

    @Test
    public void shouldHaveAMaterializerInstantiated() {
        assertNotNull(mat);
    }

    @Test
    public void withInstanceOf() {
        MessagesApi messagesApi = instanceOf(MessagesApi.class);
        assertNotNull(messagesApi);
    }
}


text:
package org.apache.camel.processor;

import java.util.List;

import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.spi.RouteStartupOrder;
import org.junit.Test;

public class RouteStartupOrderDirectTest extends ContextTestSupport {

    @Test
    public void testRouteStartupOrder() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);

        template.sendBody("direct:bar", "Hello World");

        assertMockEndpointsSatisfied();

        // assert correct order
        DefaultCamelContext dcc = (DefaultCamelContext) context;
        List<RouteStartupOrder> order = dcc.getRouteStartupOrder();

        assertEquals(2, order.size());
        assertEquals("direct://bar", order.get(0).getRoute().getEndpoint().getEndpointUri());
        assertEquals("direct://foo", order.get(1).getRoute().getEndpoint().getEndpointUri());
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:foo").startupOrder(2).routeId("foo").to("mock:result");

                from("direct:bar").startupOrder(1).routeId("bar").to("direct:foo");
            }
        };
    }
}

redpajama_set_name: RedPajamaGithub


text:
package route53domains

import (
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/defaults"
	"github.com/aws/aws-sdk-go/aws/service"
	"github.com/aws/aws-sdk-go/internal/protocol/jsonrpc"
	"github.com/aws/aws-sdk-go/internal/signer/v4"
)

// Route53Domains is a client for Amazon Route 53 Domains.
type Route53Domains struct {
	*service.Service
}

// Used for custom service initialization logic
var initService func(*service.Service)

// Used for custom request initialization logic
var initRequest func(*service.Request)

// New returns a new Route53Domains client.
func New(config *aws.Config) *Route53Domains {
	service := &service.Service{
		Config:       defaults.DefaultConfig.Merge(config),
		ServiceName:  "route53domains",
		APIVersion:   "2014-05-15",
		JSONVersion:  "1.1",
		TargetPrefix: "Route53Domains_v20140515",
	}
	service.Initialize()

	// Handlers
	service.Handlers.Sign.PushBack(v4.Sign)
	service.Handlers.Build.PushBack(jsonrpc.Build)
	service.Handlers.Unmarshal.PushBack(jsonrpc.Unmarshal)
	service.Handlers.UnmarshalMeta.PushBack(jsonrpc.UnmarshalMeta)
	service.Handlers.UnmarshalError.PushBack(jsonrpc.UnmarshalError)

	// Run custom service initialization if present
	if initService != nil {
		initService(service)
	}

	return &Route53Domains{service}
}

// newRequest creates a new request for a Route53Domains operation and runs any
// custom request initialization.
func (c *Route53Domains) newRequest(op *service.Operation, params, data interface{}) *service.Request {
	req := service.NewRequest(c.Service, op, params, data)

	// Run custom request initialization if present
	if initRequest != nil {
		initRequest(req)
	}

	return req
}


text:
from up.providers.base_rx_provider import BaseRXProvider

from arduino_cog.modules.arduino_module import ArduinoModule

class ArduinoRXProvider(BaseRXProvider):
    LOAD_ORDER = ArduinoModule.LOAD_ORDER + 1

    RUD_KEY = 'rudder'
    THR_KEY = 'throttle'
    ELE_KEY = 'elevator'
    AIL_KEY = 'ailerons'

    def __init__(self):
        super().__init__()
        self.__arduino_module = None
        self.__channels = {self.AIL_KEY: 1500, self.ELE_KEY: 1500, self.THR_KEY: 1000, self.RUD_KEY: 1500}

    def _execute_initialization(self):
        super()._execute_initialization()

    def _execute_start(self):
        self.__arduino_module = self.up.get_module(ArduinoModule)
        if self.__arduino_module is None:
            self.logger.critical("Arduino Module not found")
            raise ValueError("Arduino Module not found")
        return self.__arduino_module.started

    def _execute_stop(self):
        super()._execute_stop()

    def get_channels(self):
        return self.__channels

    def set_channels(self, values):
        self.__channels = values

    def create_channels_values(self, ail, ele, thr, rud):
        return {self.AIL_KEY: ail, self.ELE_KEY: ele, self.THR_KEY: thr, self.RUD_KEY: rud}

    def load(self):
        return True


text:
[![Build Status](https://travis-ci.org/mikeerickson/gulp-messenger.svg?branch=master)](https://travis-ci.org/mikeerickson/gulp-messenger) [![Dependency Status](https://gemnasium.com/mikeerickson/gulp-messenger.svg)](https://gemnasium.com/mikeerickson/gulp-messenger) [![npm](https://img.shields.io/npm/dm/localeval.svg)]() [![npm](https://img.shields.io/badge/mocha-passed-green.svg)]()

## Changelog

- 0.6.2
    - Added `dir` routine (calls `dump` internally)
    - Fixed issues related to passing object data in addition to messages (regression)
- 0.5.0
    - Lots of fixes internally before be pushed to public consumption
      - Added `chalk` instance ( msg.chalk... )
      - Added `chalkline` instance ( msg.chalkline... )
      - Added `dump` method ( msg.dump )
      - Updated `line` method

- 0.2.0
    - Fixed issues with properly display object literals
    - Added `version` method (returns current package version)

- 0.1.0
    - Added support for passing standard data as parameters 2..n
    - Added support for using `console.` instead of `msg` etc.
    - Enhanced package to support all `console` methods (eg console.log, console.error, etc)

- 0.0.43 Added new `header` entry point
    - Added msg.header method
      Displays message default text underline (doesn't have its own color)

- 0.0.42 Added new `log` entry point
    - Added msg.log method

- 0.0.41 Bug Fixes
    - Fixed issue with line printing feature (was not actually use line)
    - Refreshed all plugin dependencies

- 0.0.40 Regression Fixes
    - Fixed regression issue introduced in 0.0.30 causing logs with ojbect as message parameter

- 0.0.35 Bug Fixes

- 0.0.34
    - Internal (development level) additions
      * Todo and Test tasks support option of opening report file when completed

- 0.0.33
    - Workflow Refinements
      * gulpfile, tasks, etc

- 0.0.32
    - exposed msg.line method
      msg.line({character, numChars});
       * character (default =)
       * numChars  (default 80)

- 0.0.31
    - Fixed results when using msg.Time/time.  It was not echoing current time as it should

- 0.0.30 Logging To File
    - Fixed issue when logging to `logger` file instance

- 0.0.28 Bug Fixes
    - Fixed issue with `timestamp` option not properlly including timestamp

- 0.0.27 Bug Fix
    - Fixed a regression issue when using messenger commands in gulp pipeline

- 0.0.24 Small Fixes
    - fixed issue when supplied message is an 'object' causing an error when parsing tokens

- 0.0.22 Test Refactoring
    - Refactored tests

- 0.0.21 Added options
    - Added option `boldVariables` to set display of merged variables
    - Added option `logToConsole` to control if messages are sent to console
    - Added option `logToFile` to control is messages are sent to log
    - Added option `rotateLog` to control log files to have current date appended to filename

- 0.0.20 Added .debug command
    - Added msg.debug (msg.Debug) and supported text color


text:
function x=jacobi_theta3(z,q,tol)
% x=jacobi_theta3(z,q,tol)
% See Section 20.2 of "NIST Digital Library of Mathematical
% Functions", http://dlmf.nist.gov/, edited by F. W. J. Olver, et al.

% Calculate at least three terms for improved accuracy. If an argument
% is close to a zero of cos or sin, the argument is "further" from the
% zero for later terms.

% Copyright (C) 2019 Robert G. Jenssen
%
% Permission is hereby granted, free of charge, to any person
% obtaining a copy of this software and associated documentation
% files (the "Software"), to deal in the Software without restriction,
% including without limitation the rights to use, copy, modify, merge,
% publish, distribute, sublicense, and/or sell copies of the Software,
% and to permit persons to whom the Software is furnished to do so,
% subject to the following conditions: The above copyright notice and
% this permission notice shall be included in all copies or substantial
% portions of the Software.
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
% MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
% IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
% CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
% TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
% SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

  if (nargin~=2 && nargin~=3) || nargout>1
    print_usage("x=jacobi_theta3(z,q,tol)");
  endif
  if nargin==2
    tol=eps;
  endif

  if length(size(z))>2
    error("length(size(z))>2");
  endif
  if ~isscalar(q)
    error("Expect q scalar!");
  endif
  if abs(imag(q))>tol
    error("Expect q real!");
  endif
  q=real(q);
  if q<0 || q>=1
    error("Expect 0<=q<1 !");
  endif

  x=ones(size(z));
  qe=1;
  maxiter=100;
  n=1;
  nn=2;
  while 1
    dx=2*(q^qe)*cos(nn*z);
    x=x+dx;
    if all(all(abs(dx)<tol)) && n>2
      break;
    endif
    qe=qe+(2*n)+1;
    nn=nn+2;
    n=n+1;
    if n>=maxiter
      error("n>=maxiter");
    endif
  endwhile

endfunction


text:
package parsers;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.events.Attribute;
import javax.xml.stream.events.EndElement;
import javax.xml.stream.events.StartElement;
import javax.xml.stream.events.XMLEvent;

import optimization.OptimizedReaction;
import readers.ExperimentalDatabaseInput;
import readers.ReactorSetupInput;
import util.Licenses;
import util.Paths;

public class XMLInputParser {
	static final String CONCENTRATIONS  = "concentrations";
	static final String INPUT = "input";
	static final String JAR_DIR = "jar_location";
	static final String CHEMKIN_DIR = "chemkin_dir";
	static final String NO_LICENSES = "no_licenses";
	static final String CHEMISTRY_INPUT = "chemistry_input";
	static final String TOTAL_NUMBER_OF_EXPERIMENTS = "total_number_of_experiments";
	static final String EXPERIMENTAL_DATABASES = "experimental_databases";
	static final String EXPERIMENTAL_DATABASE = "experimental_database";
	static final String REACTOR_SETUPS = "reactor_setups";
	static final String REACTOR_SETUP = "reactor_setup";
	static final String TYPE = "type";
	static final String MODEL = "model";
	static final String LOCATION = "location";
	static final String MODE = "mode";
	static final String FITTING = "fitting";
	static final String ROSENBROCK = "rosenbrock";
	static final String NUMBEROFEVALUATIONS = "number_of_evaluations";
	static final String REACTIONS = "optimized_reactions";
	static final String REACTION = "reaction";
	static final String A = "A";
	static final String N = "n";
	static final String EA = "Ea";

	@SuppressWarnings({ "unchecked", "null" })
	public static ConfigurationInput readConfig(String configFile) {
		ConfigurationInput configurationInput = null;
		try {
			// First create a new XMLInputFactory
			XMLInputFactory inputFactory = XMLInputFactory.newInstance();
			// Setup a new eventReader
			InputStream in = new FileInputStream(configFile);
			XMLEventReader eventReader = inputFactory.createXMLEventReader(in);
			// Read the XML document

			List<ExperimentalDatabaseInput> list_expdb = null;
			List<ReactorSetupInput> list_reactor_setup = null;
			List<OptimizedReaction> reactions = null;
			while (eventReader.hasNext()) {
				XMLEvent event = eventReader.nextEvent();

				if (event.isStartElement()) {
					StartElement startElement = event.asStartElement();
					// If we have a ConfigurationInput element we create a new ConfigurationInput
					if (startElement.getName().getLocalPart() == (INPUT)) {
						configurationInput = new ConfigurationInput();
					}
					if (event.asStartElement().getName().getLocalPart()
							.equals(JAR_DIR)) {
						event = eventReader.nextEvent();
						Paths.setJarLocation(new File(event.asCharacters().getData()));
						continue;
					}
					if (event.asStartElement().getName().getLocalPart()
							.equals(CONCENTRATIONS)) {
						event = eventReader.nextEvent();
						Paths.setConcentration(event.asCharacters().getData());
						continue;
					}
					if (event.asStartElement().getName().getLocalPart()
							.equals(CHEMKIN_DIR)) {
						System.out.println("The element chemkin_dir is deprecated. Instead, the path to the Chemkin home folder should"
								+ "be set through an environment variable named CHEMKIN.");

						continue;
					}

					if (event.asStartElement().getName().getLocalPart()
							.equals(NO_LICENSES)) {
						event = eventReader.nextEvent();
						ConfigurationInput.licenses = new Licenses(Integer.parseInt(event.asCharacters().getData()));
						continue;
					}

					if (event.asStartElement().getName().getLocalPart()
							.equals(CHEMISTRY_INPUT)) {
						event = eventReader.nextEvent();
						Paths.chemistryInput=event.asCharacters().getData();
						continue;
					}

					if (event.asStartElement().getName().getLocalPart()
							.equals(TOTAL_NUMBER_OF_EXPERIMENTS)) {
						event = eventReader.nextEvent();
						ConfigurationInput.experiments.total_no_experiments = Integer.parseInt(event.asCharacters().getData());
						continue;
					}

					if (event.asStartElement().getName().getLocalPart()
							.equals(EXPERIMENTAL_DATABASES)) {
						event = eventReader.nextEvent();
						list_expdb = new ArrayList<ExperimentalDatabaseInput>();
						continue;
					}

					if (event.asStartElement().getName().getLocalPart()
							.equals(EXPERIMENTAL_DATABASE)) {
						ExperimentalDatabaseInput exp_input = new ExperimentalDatabaseInput();
						// attribute to our object
						Iterator<Attribute> attributes = event.asStartElement()
								.getAttributes();
						while (attributes.hasNext()) {
							Attribute attribute = attributes.next();
							if (attribute.getName().toString().equals(TYPE)) {
								exp_input.setType(attribute.getValue());
							}
						}
						event = eventReader.nextEvent();
						exp_input.setLocation(new File(event.asCharacters().getData()));

						list_expdb.add(exp_input);
						continue;
					}
					if (event.asStartElement().getName().getLocalPart()
							.equals(REACTOR_SETUPS)) {
						event = eventReader.nextEvent();
						list_reactor_setup = new ArrayList<ReactorSetupInput>();
						continue;
					}

					if (event.asStartElement().getName().getLocalPart()
							.equals(REACTOR_SETUP)) {
						ReactorSetupInput reactor_input = new ReactorSetupInput();
						// attribute to our object
						Iterator<Attribute> attributes = event.asStartElement()
								.getAttributes();
						while (attributes.hasNext()) {
							Attribute attribute = attributes.next();
							if (attribute.getName().toString().equals(TYPE)) {
								reactor_input.setType(attribute.getValue());
							}
							if (attribute.getName().toString().equals(MODEL)) {
								reactor_input.setModel(attribute.getValue());
							}
						}
						event = eventReader.nextEvent();
						reactor_input.setLocation(event.asCharacters().getData());

						list_reactor_setup.add(reactor_input);
						continue;
					}
					if (event.asStartElement().getName().getLocalPart()
							.equals(MODE)) {
						event = eventReader.nextEvent();
						ConfigurationInput.setMODE(Integer.parseInt(event.asCharacters().getData()));
						continue;
					}

					if (event.asStartElement().getName().getLocalPart()
							.equals(FITTING)) {
						event = eventReader.nextEvent();
						//
						ConfigurationInput.fitting.method = event.asCharacters().getData();
						continue;
					}

					if (event.asStartElement().getName().getLocalPart()
							.equals(ROSENBROCK)) {
						// attribute to our object
						Iterator<Attribute> attributes = event.asStartElement()
								.getAttributes();
						while (attributes.hasNext()) {
							Attribute attribute = attributes.next();
							if (attribute.getName().toString().equals(NUMBEROFEVALUATIONS)) {
								ConfigurationInput.fitting.setMaxNoRosenbrockEvaluations(Integer.parseInt(attribute.getValue()));
							}
						}
						event = eventReader.nextEvent();

						continue;
					}
					if (event.asStartElement().getName().getLocalPart()
							.equals(REACTIONS)) {
						event = eventReader.nextEvent();
						reactions = new ArrayList<OptimizedReaction>();
						continue;
					}
					if (event.asStartElement().getName().getLocalPart()
							.equals(REACTION)) {
						OptimizedReaction reaction = new OptimizedReaction();
						// attribute to our object
						Iterator<Attribute> attributes = event.asStartElement()
								.getAttributes();
						while (attributes.hasNext()) {
							Attribute attribute = attributes.next();
							if (attribute.getName().toString().equals(A)) {
								reaction.A = (Integer.parseInt(attribute.getValue()));
							}
							else if (attribute.getName().toString().equals(N)) {
								reaction.N = (Integer.parseInt(attribute.getValue()));
							}
							else if (attribute.getName().toString().equals(EA)) {
								reaction.Ea = (Integer.parseInt(attribute.getValue()));
							}
						}
						event = eventReader.nextEvent();
						reactions.add(reaction);
						continue;
					}

				}
				// If we reach the end of an ConfigurationInput element we add it to the list
				if (event.isEndElement()) {
					EndElement endElement = event.asEndElement();

					if (endElement.getName().getLocalPart() == (INPUT)) {
					}

					if (endElement.getName().getLocalPart() == (EXPERIMENTAL_DATABASES)) {
						ConfigurationInput.experiments.exp_db = list_expdb.toArray(new ExperimentalDatabaseInput[list_expdb.size()]);
					}

					if (endElement.getName().getLocalPart() == (REACTOR_SETUPS)) {
						ConfigurationInput.reactor_setup = list_reactor_setup.toArray(new ReactorSetupInput[list_reactor_setup.size()]);

						/* Once all the reactor setup input are collected, transform them
						* into reactor inputs and
						* create reactor input files, if necessary.
						*
						*/
						for(ReactorSetupInput input : ConfigurationInput.reactor_setup)
							configurationInput.addReactorInput(input);

					}

					if (endElement.getName().getLocalPart() == (REACTIONS)) {
						ConfigurationInput.fitting.optimizedReactions = reactions;
						ConfigurationInput.setParameters();
					}
				}

			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (XMLStreamException e) {
			e.printStackTrace();
		}
		return configurationInput;
	}

}


text:
/*
 * P1 P2 RDB board configuration file
 * This file is intended to address a set of Low End and Ultra Low End
 * Freescale SOCs of QorIQ series(RDB platforms).
 * Currently only P2020RDB
 */

#ifndef __CONFIG_H
#define __CONFIG_H

#ifdef CONFIG_36BIT
#define CONFIG_PHYS_64BIT
#endif

#ifdef CONFIG_P1011RDB
#define CONFIG_P1011
#endif
#ifdef CONFIG_P1020RDB
#define CONFIG_P1020
#endif
#ifdef CONFIG_P2010RDB
#define CONFIG_P2010
#endif
#ifdef CONFIG_P2020RDB
#define CONFIG_P2020
#endif

#ifdef CONFIG_NAND
#define CONFIG_NAND_U_BOOT		1
#define CONFIG_RAMBOOT_NAND		1
#ifdef CONFIG_NAND_SPL
#define CONFIG_SYS_TEXT_BASE_SPL 0xfff00000
#define CONFIG_SYS_MONITOR_BASE	CONFIG_SYS_TEXT_BASE_SPL /* start of monitor */
#else
#define CONFIG_SYS_LDSCRIPT $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
#define CONFIG_SYS_TEXT_BASE		0xf8f82000
#endif /* CONFIG_NAND_SPL */
#endif

#ifdef CONFIG_SDCARD
#define CONFIG_RAMBOOT_SDCARD		1
#define CONFIG_SYS_TEXT_BASE		0x11000000
#define CONFIG_RESET_VECTOR_ADDRESS	0x1107fffc
#endif

#ifdef CONFIG_SPIFLASH
#define CONFIG_RAMBOOT_SPIFLASH		1
#define CONFIG_SYS_TEXT_BASE		0x11000000
#define CONFIG_RESET_VECTOR_ADDRESS	0x1107fffc
#endif

#ifndef CONFIG_SYS_TEXT_BASE
#define CONFIG_SYS_TEXT_BASE		0xeff80000
#endif

#ifndef CONFIG_RESET_VECTOR_ADDRESS
#define CONFIG_RESET_VECTOR_ADDRESS	0xeffffffc
#endif

#ifndef CONFIG_SYS_MONITOR_BASE
#define CONFIG_SYS_MONITOR_BASE	CONFIG_SYS_TEXT_BASE	/* start of monitor */
#endif

/* High Level Configuration Options */
#define CONFIG_BOOKE		1	/* BOOKE */
#define CONFIG_E500		1	/* BOOKE e500 family */
#define CONFIG_MPC85xx		1	/* MPC8540/60/55/41/48/P1020/P2020,etc*/
#define CONFIG_FSL_ELBC		1	/* Enable eLBC Support */

#define CONFIG_PCI		1	/* Enable PCI/PCIE */
#if defined(CONFIG_PCI)
#define CONFIG_PCIE1		1	/* PCIE controler 1 (slot 1) */
#define CONFIG_PCIE2		1	/* PCIE controler 2 (slot 2) */
#define CONFIG_FSL_PCI_INIT	1	/* Use common FSL init code */
#define CONFIG_FSL_PCIE_RESET	1	/* need PCIe reset errata */
#define CONFIG_SYS_PCI_64BIT	1	/* enable 64-bit PCI resources */
#endif /* #if defined(CONFIG_PCI) */
#define CONFIG_FSL_LAW		1	/* Use common FSL init code */
#define CONFIG_TSEC_ENET		/* tsec ethernet support */
#define CONFIG_ENV_OVERWRITE

#if defined(CONFIG_PCI)
#define CONFIG_E1000		1	/*  E1000 pci Ethernet card*/
#endif

#ifndef __ASSEMBLY__
extern unsigned long get_board_sys_clk(unsigned long dummy);
#endif
#define CONFIG_DDR_CLK_FREQ	66666666 /* DDRCLK on P1_P2 RDB */
#define CONFIG_SYS_CLK_FREQ	get_board_sys_clk(0) /*sysclk for P1_P2 RDB */

#if defined(CONFIG_P2020) || defined(CONFIG_P1020)
#define CONFIG_MP
#endif

#define CONFIG_HWCONFIG

/*
 * These can be toggled for performance analysis, otherwise use default.
 */
#define CONFIG_L2_CACHE			/* toggle L2 cache */
#define CONFIG_BTB			/* toggle branch predition */

#define CONFIG_ADDR_STREAMING		/* toggle addr streaming */

#define CONFIG_ENABLE_36BIT_PHYS	1

#ifdef CONFIG_PHYS_64BIT
#define CONFIG_ADDR_MAP			1
#define CONFIG_SYS_NUM_ADDR_MAP		16	/* number of TLB1 entries */
#endif

#define CONFIG_SYS_MEMTEST_START	0x00000000	/* memtest works on */
#define CONFIG_SYS_MEMTEST_END		0x1fffffff
#define CONFIG_PANIC_HANG	/* do not reset board on panic */

 /*
  * Config the L2 Cache as L2 SRAM
  */
#define CONFIG_SYS_INIT_L2_ADDR		0xf8f80000
#ifdef CONFIG_PHYS_64BIT
#define CONFIG_SYS_INIT_L2_ADDR_PHYS	0xff8f80000ull
#else
#define CONFIG_SYS_INIT_L2_ADDR_PHYS	CONFIG_SYS_INIT_L2_ADDR
#endif
#define CONFIG_SYS_L2_SIZE		(512 << 10)
#define CONFIG_SYS_INIT_L2_END		(CONFIG_SYS_INIT_L2_ADDR + CONFIG_SYS_L2_SIZE)

/*
 * Base addresses -- Note these are effective addresses where the
 * actual resources get mapped (not physical addresses)
 */
#define CONFIG_SYS_CCSRBAR		0xffe00000	/* relocated CCSRBAR */
#ifdef CONFIG_PHYS_64BIT
#define CONFIG_SYS_CCSRBAR_PHYS	0xfffe00000ull
#else
#define CONFIG_SYS_CCSRBAR_PHYS	CONFIG_SYS_CCSRBAR
#endif
							/* CCSRBAR */
#define CONFIG_SYS_IMMR		CONFIG_SYS_CCSRBAR	/* PQII uses */
							/* CONFIG_SYS_IMMR */

#if defined(CONFIG_RAMBOOT_NAND) && !defined(CONFIG_NAND_SPL)
#define CONFIG_SYS_CCSRBAR_DEFAULT	CONFIG_SYS_CCSRBAR
#else
#define CONFIG_SYS_CCSRBAR_DEFAULT	0xff700000      /* CCSRBAR Default */
#endif

/* DDR Setup */
#define CONFIG_FSL_DDR2
#undef CONFIG_FSL_DDR_INTERACTIVE
#undef CONFIG_SPD_EEPROM		/* Use SPD EEPROM for DDR setup */

#define CONFIG_MEM_INIT_VALUE	0xDeadBeef

#define CONFIG_SYS_SDRAM_SIZE	1024 	/* DDR size on P1_P2 RDBs */
#define CONFIG_SYS_DDR_SDRAM_BASE	0x00000000
#define CONFIG_SYS_SDRAM_BASE		CONFIG_SYS_DDR_SDRAM_BASE

#define CONFIG_NUM_DDR_CONTROLLERS	1
#define CONFIG_DIMM_SLOTS_PER_CTLR	1
#define CONFIG_CHIP_SELECTS_PER_CTRL	1

#define CONFIG_SYS_DDR_ERR_INT_EN	0x0000000d
#define CONFIG_SYS_DDR_ERR_DIS		0x00000000
#define CONFIG_SYS_DDR_SBE		0x00FF0000

/*
 * Memory map
 *
 * 0x0000_0000	0x3fff_ffff	DDR			1G cacheablen
 * 0x8000_0000  0xbfff_ffff	PCI Express Mem		1G non-cacheable
 * 0xffc0_0000  0xffc3_ffff	PCI IO range		256k non-cacheable
 *
 * Localbus cacheable (TBD)
 * 0xXXXX_XXXX	0xXXXX_XXXX	SRAM			YZ M Cacheable
 *
 * Localbus non-cacheable
 * 0xef00_0000	0xefff_ffff	FLASH			16M non-cacheable
 * 0xffa0_0000	0xffaf_ffff	NAND			1M non-cacheable
 * 0xffb0_0000	0xffbf_ffff	VSC7385 switch		1M non-cacheable
 * 0xffd0_0000	0xffd0_3fff	L1 for stack		16K Cacheable TLB0
 * 0xffe0_0000	0xffef_ffff	CCSR			1M non-cacheable
 */

/*
 * Local Bus Definitions
 */
#define CONFIG_SYS_FLASH_BASE		0xef000000	/* start of FLASH 16M */

#ifdef CONFIG_PHYS_64BIT
#define CONFIG_SYS_FLASH_BASE_PHYS	0xfef000000ull
#else
#define CONFIG_SYS_FLASH_BASE_PHYS	CONFIG_SYS_FLASH_BASE
#endif

#define CONFIG_FLASH_BR_PRELIM	(BR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS) | \
					BR_PS_16 | BR_V)
#define CONFIG_FLASH_OR_PRELIM		0xff000ff7

#define CONFIG_SYS_FLASH_BANKS_LIST	{CONFIG_SYS_FLASH_BASE_PHYS}
#define CONFIG_SYS_FLASH_QUIET_TEST
#define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */

#define CONFIG_SYS_MAX_FLASH_BANKS	1	/* number of banks */
#define CONFIG_SYS_MAX_FLASH_SECT	128	/* sectors per device */
#undef	CONFIG_SYS_FLASH_CHECKSUM
#define CONFIG_SYS_FLASH_ERASE_TOUT	60000	/* Flash Erase Timeout (ms) */
#define CONFIG_SYS_FLASH_WRITE_TOUT	500	/* Flash Write Timeout (ms) */

#if defined(CONFIG_RAMBOOT_NAND) || defined(CONFIG_RAMBOOT_SDCARD) || \
    defined(CONFIG_RAMBOOT_SPIFLASH)
#define CONFIG_SYS_RAMBOOT
#define CONFIG_SYS_EXTRA_ENV_RELOC
#else
#undef CONFIG_SYS_RAMBOOT
#endif

#define CONFIG_FLASH_CFI_DRIVER
#define CONFIG_SYS_FLASH_CFI
#define CONFIG_SYS_FLASH_EMPTY_INFO
#define CONFIG_SYS_FLASH_AMD_CHECK_DQ7

#define CONFIG_BOARD_EARLY_INIT_R	/* call board_early_init_r function */
#define CONFIG_MISC_INIT_R
#define CONFIG_HWCONFIG

#define CONFIG_SYS_INIT_RAM_LOCK	1
#define CONFIG_SYS_INIT_RAM_ADDR      0xffd00000	/* stack in RAM */
#ifdef CONFIG_PHYS_64BIT
#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH 0xf
#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW CONFIG_SYS_INIT_RAM_ADDR
/* The assembler doesn't like typecast */
#define CONFIG_SYS_INIT_RAM_ADDR_PHYS \
	((CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH * 1ull << 32) | \
	  CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW)
#else
#define CONFIG_SYS_INIT_RAM_ADDR_PHYS	CONFIG_SYS_INIT_RAM_ADDR /* Initial L1 address */
#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH 0
#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW CONFIG_SYS_INIT_RAM_ADDR_PHYS
#endif
#define CONFIG_SYS_INIT_RAM_SIZE	0x00004000	/* Size of used area in RAM */

#define CONFIG_SYS_GBL_DATA_OFFSET	(CONFIG_SYS_INIT_RAM_SIZE \
						- GENERATED_GBL_DATA_SIZE)
#define CONFIG_SYS_INIT_SP_OFFSET	CONFIG_SYS_GBL_DATA_OFFSET

#define CONFIG_SYS_MONITOR_LEN		(256 * 1024) /* Reserve 256 kB for Mon*/
#define CONFIG_SYS_MALLOC_LEN		(1024 * 1024)	/* Reserved for malloc*/

#ifndef CONFIG_NAND_SPL
#define CONFIG_SYS_NAND_BASE		0xffa00000
#ifdef CONFIG_PHYS_64BIT
#define CONFIG_SYS_NAND_BASE_PHYS	0xfffa00000ull
#else
#define CONFIG_SYS_NAND_BASE_PHYS	CONFIG_SYS_NAND_BASE
#endif
#else
#define CONFIG_SYS_NAND_BASE		0xfff00000
#ifdef CONFIG_PHYS_64BIT
#define CONFIG_SYS_NAND_BASE_PHYS	0xffff00000ull
#else
#define CONFIG_SYS_NAND_BASE_PHYS	CONFIG_SYS_NAND_BASE
#endif
#endif

#define CONFIG_SYS_NAND_BASE_LIST	{CONFIG_SYS_NAND_BASE}
#define CONFIG_SYS_MAX_NAND_DEVICE	1
#define NAND_MAX_CHIPS			1
#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND			1
#define CONFIG_NAND_FSL_ELBC		1
#define CONFIG_SYS_NAND_BLOCK_SIZE	(16 * 1024)

/* NAND boot: 4K NAND loader config */
#define CONFIG_SYS_NAND_SPL_SIZE	0x1000
#define CONFIG_SYS_NAND_U_BOOT_SIZE	((512 << 10) - 0x2000)
#define CONFIG_SYS_NAND_U_BOOT_DST	(CONFIG_SYS_INIT_L2_ADDR)
#define CONFIG_SYS_NAND_U_BOOT_START	(CONFIG_SYS_INIT_L2_ADDR + CONFIG_SYS_NAND_SPL_SIZE)
#define CONFIG_SYS_NAND_U_BOOT_OFFS	(0)
#define CONFIG_SYS_NAND_U_BOOT_RELOC	(CONFIG_SYS_INIT_L2_END - 0x2000)
#define CONFIG_SYS_NAND_U_BOOT_RELOC_SP		((CONFIG_SYS_INIT_L2_END - 1) & ~0xF)

/* NAND flash config */
#define CONFIG_SYS_NAND_BR_PRELIM (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
				| (2<<BR_DECC_SHIFT)	/* Use HW ECC */ \
				| BR_PS_8	/* Port Size = 8 bit */ \
				| BR_MS_FCM		/* MSEL = FCM */ \
				| BR_V)			/* valid */

#define CONFIG_SYS_NAND_OR_PRELIM	(0xFFF80000	/* length 32K */ \
				| OR_FCM_CSCT \
				| OR_FCM_CST \
				| OR_FCM_CHT \
				| OR_FCM_SCY_1 \
				| OR_FCM_TRLX \
				| OR_FCM_EHTR)

#ifdef CONFIG_RAMBOOT_NAND
#define CONFIG_SYS_BR0_PRELIM  CONFIG_SYS_NAND_BR_PRELIM /* NAND Base Address */
#define CONFIG_SYS_OR0_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
#define CONFIG_SYS_BR1_PRELIM  CONFIG_FLASH_BR_PRELIM  /* NOR Base Address */
#define CONFIG_SYS_OR1_PRELIM  CONFIG_FLASH_OR_PRELIM  /* NOR Options */
#else
#define CONFIG_SYS_BR0_PRELIM  CONFIG_FLASH_BR_PRELIM  /* NOR Base Address */
#define CONFIG_SYS_OR0_PRELIM  CONFIG_FLASH_OR_PRELIM  /* NOR Options */
#define CONFIG_SYS_BR1_PRELIM  CONFIG_SYS_NAND_BR_PRELIM /* NAND Base Address */
#define CONFIG_SYS_OR1_PRELIM  CONFIG_SYS_NAND_OR_PRELIM /* NAND Options */
#endif

#define CONFIG_SYS_VSC7385_BASE	0xffb00000

#ifdef CONFIG_PHYS_64BIT
#define CONFIG_SYS_VSC7385_BASE_PHYS	0xfffb00000ull
#else
#define CONFIG_SYS_VSC7385_BASE_PHYS	CONFIG_SYS_VSC7385_BASE
#endif

#define CONFIG_SYS_BR2_PRELIM	(BR_PHYS_ADDR(CONFIG_SYS_VSC7385_BASE) \
							| BR_PS_8 | BR_V)
#define CONFIG_SYS_OR2_PRELIM	(OR_AM_128KB | OR_GPCM_CSNT | OR_GPCM_XACS | \
				OR_GPCM_SCY_15 | OR_GPCM_SETA | OR_GPCM_TRLX | \
				OR_GPCM_EHTR | OR_GPCM_EAD)

/* Serial Port - controlled on board with jumper J8
 * open - index 2
 * shorted - index 1
 */
#define CONFIG_CONS_INDEX	1
#define CONFIG_SYS_NS16550
#define CONFIG_SYS_NS16550_SERIAL
#define CONFIG_SYS_NS16550_REG_SIZE	1
#define CONFIG_SYS_NS16550_CLK		get_bus_freq(0)
#ifdef CONFIG_NAND_SPL
#define CONFIG_NS16550_MIN_FUNCTIONS
#endif

#define CONFIG_SERIAL_MULTI	1 /* Enable both serial ports */
#define CONFIG_SYS_CONSOLE_IS_IN_ENV	/* determine from environment */

#define CONFIG_SYS_BAUDRATE_TABLE	\
	{300, 600, 1200, 2400, 4800, 9600, 19200, 38400,115200}

#define CONFIG_SYS_NS16550_COM1	(CONFIG_SYS_CCSRBAR+0x4500)
#define CONFIG_SYS_NS16550_COM2	(CONFIG_SYS_CCSRBAR+0x4600)

/* Use the HUSH parser */
#define CONFIG_SYS_HUSH_PARSER
#ifdef	CONFIG_SYS_HUSH_PARSER
#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
#endif

/*
 * Pass open firmware flat tree
 */
#define CONFIG_OF_LIBFDT		1
#define CONFIG_OF_BOARD_SETUP		1
#define CONFIG_OF_STDOUT_VIA_ALIAS	1

/* new uImage format support */
#define CONFIG_FIT		1
#define CONFIG_FIT_VERBOSE	1 /* enable fit_format_{error,warning}() */

/* I2C */
#define CONFIG_FSL_I2C		/* Use FSL common I2C driver */
#define CONFIG_HARD_I2C		/* I2C with hardware support */
#undef	CONFIG_SOFT_I2C		/* I2C bit-banged */
#define CONFIG_I2C_MULTI_BUS
#define CONFIG_I2C_CMD_TREE
#define CONFIG_SYS_I2C_SPEED		400000	/* I2C speed and slave address*/
#define CONFIG_SYS_I2C_SLAVE		0x7F
#define CONFIG_SYS_I2C_NOPROBES	{{0,0x29}}	/* Don't probe these addrs */
#define CONFIG_SYS_I2C_OFFSET		0x3000
#define CONFIG_SYS_I2C2_OFFSET		0x3100

/*
 * I2C2 EEPROM
 */
#define CONFIG_ID_EEPROM
#ifdef CONFIG_ID_EEPROM
#define CONFIG_SYS_I2C_EEPROM_NXID
#endif
#define CONFIG_SYS_I2C_EEPROM_ADDR	0x52
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
#define CONFIG_SYS_EEPROM_BUS_NUM	1

#define CONFIG_SYS_I2C_PCA9557_ADDR	0x18

#define CONFIG_RTC_DS1337
#define CONFIG_SYS_RTC_DS1337_NOOSC
#define CONFIG_SYS_I2C_RTC_ADDR                0x68

/* eSPI - Enhanced SPI */
#define CONFIG_FSL_ESPI
#define CONFIG_SPI_FLASH
#define CONFIG_SPI_FLASH_SPANSION
#define CONFIG_CMD_SF
#define CONFIG_SF_DEFAULT_SPEED		10000000
#define CONFIG_SF_DEFAULT_MODE		SPI_MODE_0

/*
 * General PCI
 * Memory space is mapped 1-1, but I/O space must start from 0.
 */

#if defined(CONFIG_PCI)
/* controller 2, Slot 2, tgtid 2, Base address 9000 */
#define CONFIG_SYS_PCIE2_NAME		"Slot 1"
#define CONFIG_SYS_PCIE2_MEM_VIRT	0xa0000000
#ifdef CONFIG_PHYS_64BIT
#define CONFIG_SYS_PCIE2_MEM_BUS	0xc0000000
#define CONFIG_SYS_PCIE2_MEM_PHYS	0xc20000000ull
#else
#define CONFIG_SYS_PCIE2_MEM_BUS	0xa0000000
#define CONFIG_SYS_PCIE2_MEM_PHYS	0xa0000000
#endif
#define CONFIG_SYS_PCIE2_MEM_SIZE	0x20000000	/* 512M */
#define CONFIG_SYS_PCIE2_IO_VIRT	0xffc10000
#define CONFIG_SYS_PCIE2_IO_BUS		0x00000000
#ifdef CONFIG_PHYS_64BIT
#define CONFIG_SYS_PCIE2_IO_PHYS	0xfffc10000ull
#else
#define CONFIG_SYS_PCIE2_IO_PHYS	0xffc10000
#endif
#define CONFIG_SYS_PCIE2_IO_SIZE	0x00010000	/* 64k */

/* controller 1, Slot 1, tgtid 1, Base address a000 */
#define CONFIG_SYS_PCIE1_NAME		"Slot 2"
#define CONFIG_SYS_PCIE1_MEM_VIRT	0x80000000
#ifdef CONFIG_PHYS_64BIT
#define CONFIG_SYS_PCIE1_MEM_BUS	0x80000000
#define CONFIG_SYS_PCIE1_MEM_PHYS	0xc00000000ull
#else
#define CONFIG_SYS_PCIE1_MEM_BUS	0x80000000
#define CONFIG_SYS_PCIE1_MEM_PHYS	0x80000000
#endif
#define CONFIG_SYS_PCIE1_MEM_SIZE	0x20000000	/* 512M */
#define CONFIG_SYS_PCIE1_IO_VIRT	0xffc00000
#define CONFIG_SYS_PCIE1_IO_BUS		0x00000000
#ifdef CONFIG_PHYS_64BIT
#define CONFIG_SYS_PCIE1_IO_PHYS	0xfffc00000ull
#else
#define CONFIG_SYS_PCIE1_IO_PHYS	0xffc00000
#endif
#define CONFIG_SYS_PCIE1_IO_SIZE	0x00010000	/* 64k */

#define CONFIG_PCI_PNP			/* do pci plug-and-play */

#undef CONFIG_EEPRO100
#undef CONFIG_TULIP
#undef CONFIG_RTL8139

#ifdef CONFIG_RTL8139
/* This macro is used by RTL8139 but not defined in PPC architecture */
#define KSEG1ADDR(x)		(x)
#define _IO_BASE	0x00000000
#endif

#define CONFIG_PCI_SCAN_SHOW		/* show pci devices on startup */
#define CONFIG_DOS_PARTITION

#endif	/* CONFIG_PCI */

#define CONFIG_NET_MULTI	1

#if defined(CONFIG_TSEC_ENET)
#define CONFIG_MII		1	/* MII PHY management */
#define CONFIG_MII_DEFAULT_TSEC	1	/* Allow unregistered phys */
#define CONFIG_TSEC1	1
#define CONFIG_TSEC1_NAME	"eTSEC1"
#define CONFIG_TSEC2	1
#define CONFIG_TSEC2_NAME	"eTSEC2"
#define CONFIG_TSEC3	1
#define CONFIG_TSEC3_NAME	"eTSEC3"

#define TSEC1_PHY_ADDR		2
#define TSEC2_PHY_ADDR		0
#define TSEC3_PHY_ADDR		1

#define CONFIG_VSC7385_ENET

#define TSEC1_FLAGS		(TSEC_GIGABIT | TSEC_REDUCED)
#define TSEC2_FLAGS		(TSEC_GIGABIT | TSEC_REDUCED)
#define TSEC3_FLAGS		(TSEC_GIGABIT | TSEC_REDUCED)

#define TSEC1_PHYIDX		0
#define TSEC2_PHYIDX		0
#define TSEC3_PHYIDX		0

/* Vitesse 7385 */

#ifdef CONFIG_VSC7385_ENET
/* The size of the VSC7385 firmware image */
#define CONFIG_VSC7385_IMAGE_SIZE	8192
#endif

#define CONFIG_ETHPRIME		"eTSEC1"

#define CONFIG_PHY_GIGE		1	/* Include GbE speed/duplex detection */

#endif	/* CONFIG_TSEC_ENET */

/*
 * Environment
 */
#if defined(CONFIG_SYS_RAMBOOT)
#if defined(CONFIG_RAMBOOT_NAND)
	#define CONFIG_ENV_IS_IN_NAND	1
	#define CONFIG_ENV_SIZE		CONFIG_SYS_NAND_BLOCK_SIZE
	#define CONFIG_ENV_OFFSET	((512 * 1024) + CONFIG_SYS_NAND_BLOCK_SIZE)
#elif defined(CONFIG_RAMBOOT_SDCARD)
#define CONFIG_ENV_IS_IN_MMC
#define CONFIG_ENV_SIZE			0x2000
#define CONFIG_SYS_MMC_ENV_DEV		0
#elif defined(CONFIG_RAMBOOT_SPIFLASH)
	#define CONFIG_ENV_IS_IN_SPI_FLASH
	#define CONFIG_ENV_SPI_BUS	0
	#define CONFIG_ENV_SPI_CS	0
	#define CONFIG_ENV_SPI_MAX_HZ	10000000
	#define CONFIG_ENV_SPI_MODE	0
	#define CONFIG_ENV_OFFSET	0x100000	/* 1MB */
	#define CONFIG_ENV_SECT_SIZE	0x10000
	#define CONFIG_ENV_SIZE		0x2000
#endif
#else
	#define CONFIG_ENV_IS_IN_FLASH	1
	#if CONFIG_SYS_MONITOR_BASE > 0xfff80000
	#define CONFIG_ENV_ADDR		0xfff80000
	#else
	#define CONFIG_ENV_ADDR		(CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE)
	#endif
	#define CONFIG_ENV_SIZE		0x2000
	#define CONFIG_ENV_SECT_SIZE	0x20000 /* 128K (one sector) */
#endif

#define CONFIG_LOADS_ECHO	1	/* echo on for serial download */
#define CONFIG_SYS_LOADS_BAUD_CHANGE	1	/* allow baudrate change */

/*
 * Command line configuration.
 */
#include <config_cmd_default.h>

#define CONFIG_CMD_DATE
#define CONFIG_CMD_ELF
#define CONFIG_CMD_I2C
#define CONFIG_CMD_IRQ
#define CONFIG_CMD_MII
#define CONFIG_CMD_PING
#define CONFIG_CMD_SETEXPR
#define CONFIG_CMD_REGINFO

#if defined(CONFIG_PCI)
#define CONFIG_CMD_NET
#define CONFIG_CMD_PCI
#endif

#undef CONFIG_WATCHDOG			/* watchdog disabled */

#define CONFIG_MMC	1

#ifdef CONFIG_MMC
#define CONFIG_BOARD_EARLY_INIT_F	1	/* Call board_pre_init */
#define CONFIG_CMD_MMC
#define CONFIG_DOS_PARTITION
#define CONFIG_FSL_ESDHC
#define CONFIG_GENERIC_MMC
#define CONFIG_SYS_FSL_ESDHC_ADDR	CONFIG_SYS_MPC85xx_ESDHC_ADDR
#ifdef CONFIG_P2020
#define CONFIG_SYS_FSL_ESDHC_USE_PIO /* P2020 eSDHC DMA is not functional*/
#endif
#endif

#define CONFIG_USB_EHCI

#ifdef CONFIG_USB_EHCI
#define CONFIG_CMD_USB
#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
#define CONFIG_USB_EHCI_FSL
#define CONFIG_USB_STORAGE
#define CONFIG_HAS_FSL_DR_USB
#endif

#if defined(CONFIG_MMC) || defined(CONFIG_USB_EHCI)
#define CONFIG_CMD_EXT2
#define CONFIG_CMD_FAT
#define CONFIG_DOS_PARTITION
#endif

/*
 * Miscellaneous configurable options
 */
#define CONFIG_SYS_LONGHELP			/* undef to save memory	*/
#define CONFIG_CMDLINE_EDITING			/* Command-line editing */
#define CONFIG_AUTO_COMPLETE			/* add autocompletion support */
#define CONFIG_SYS_LOAD_ADDR	0x2000000	/* default load address */
#define CONFIG_SYS_PROMPT	"=> "		/* Monitor Command Prompt */
#if defined(CONFIG_CMD_KGDB)
#define CONFIG_SYS_CBSIZE	1024		/* Console I/O Buffer Size */
#else
#define CONFIG_SYS_CBSIZE	256		/* Console I/O Buffer Size */
#endif
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
						/* Print Buffer Size */
#define CONFIG_SYS_MAXARGS	16		/* max number of command args */
#define CONFIG_SYS_BARGSIZE	CONFIG_SYS_CBSIZE/* Boot Argument Buffer Size */
#define CONFIG_SYS_HZ		1000		/* decrementer freq: 1ms ticks */

/*
 * For booting Linux, the board info and command line data
 * have to be in the first 64 MB of memory, since this is
 * the maximum mapped by the Linux kernel during initialization.
 */
#define CONFIG_SYS_BOOTMAPSZ	(64 << 20)/* Initial Memory map for Linux*/
#define CONFIG_SYS_BOOTM_LEN	(64 << 20)	/* Increase max gunzip size */

#if defined(CONFIG_CMD_KGDB)
#define CONFIG_KGDB_BAUDRATE	230400	/* speed to run kgdb serial port */
#define CONFIG_KGDB_SER_INDEX	2	/* which serial port to use */
#endif

/*
 * Environment Configuration
 */

#if defined(CONFIG_TSEC_ENET)
#define CONFIG_HAS_ETH0
#define CONFIG_HAS_ETH1
#define CONFIG_HAS_ETH2
#endif

#define CONFIG_HOSTNAME		P2020RDB
#define CONFIG_ROOTPATH		/opt/nfsroot
#define CONFIG_BOOTFILE		uImage
#define CONFIG_UBOOTPATH	u-boot.bin/* U-Boot image on TFTP server */

/* default location for tftp and bootm */
#define CONFIG_LOADADDR		1000000

#define CONFIG_BOOTDELAY 10	/* -1 disables auto-boot */
#undef  CONFIG_BOOTARGS		/* the boot command will set bootargs */

#define CONFIG_BAUDRATE	115200

#define	CONFIG_EXTRA_ENV_SETTINGS				\
	"netdev=eth0\0"						\
	"uboot=" MK_STR(CONFIG_UBOOTPATH) "\0"				\
	"loadaddr=1000000\0"			\
	"tftpflash=tftpboot $loadaddr $uboot; "			\
		"protect off " MK_STR(CONFIG_SYS_TEXT_BASE) " +$filesize; "	\
		"erase " MK_STR(CONFIG_SYS_TEXT_BASE) " +$filesize; "		\
		"cp.b $loadaddr " MK_STR(CONFIG_SYS_TEXT_BASE) " $filesize; "	\
		"protect on " MK_STR(CONFIG_SYS_TEXT_BASE) " +$filesize; "		\
		"cmp.b $loadaddr " MK_STR(CONFIG_SYS_TEXT_BASE) " $filesize\0"	\
	"consoledev=ttyS0\0"				\
	"ramdiskaddr=2000000\0"			\
	"ramdiskfile=rootfs.ext2.gz.uboot\0"		\
	"fdtaddr=c00000\0"				\
	"fdtfile=p2020rdb.dtb\0"		\
	"bdev=sda1\0"	\
	"jffs2nor=mtdblock3\0"	\
	"norbootaddr=ef080000\0"	\
	"norfdtaddr=ef040000\0"	\
	"jffs2nand=mtdblock9\0"	\
	"nandbootaddr=100000\0"	\
	"nandfdtaddr=80000\0"		\
	"nandimgsize=400000\0"		\
	"nandfdtsize=80000\0"		\
	"hwconfig=usb1:dr_mode=host,phy_type=ulpi\0"	\
	"vscfw_addr=ef000000\0"	\
	"othbootargs=ramdisk_size=600000\0" \
	"usbfatboot=setenv bootargs root=/dev/ram rw "	\
	"console=$consoledev,$baudrate $othbootargs; "	\
	"usb start;"			\
	"fatload usb 0:2 $loadaddr $bootfile;"		\
	"fatload usb 0:2 $fdtaddr $fdtfile;"	\
	"fatload usb 0:2 $ramdiskaddr $ramdiskfile;"	\
	"bootm $loadaddr $ramdiskaddr $fdtaddr\0"		\
	"usbext2boot=setenv bootargs root=/dev/ram rw "	\
	"console=$consoledev,$baudrate $othbootargs; "	\
	"usb start;"			\
	"ext2load usb 0:4 $loadaddr $bootfile;"		\
	"ext2load usb 0:4 $fdtaddr $fdtfile;"	\
	"ext2load usb 0:4 $ramdiskaddr $ramdiskfile;"	\
	"bootm $loadaddr $ramdiskaddr $fdtaddr\0"		\
	"norboot=setenv bootargs root=/dev/$jffs2nor rw "	\
	"console=$consoledev,$baudrate rootfstype=jffs2 $othbootargs;"	\
	"bootm $norbootaddr - $norfdtaddr\0"		\
	"nandboot=setenv bootargs root=/dev/$jffs2nand rw rootfstype=jffs2 " \
	"console=$consoledev,$baudrate $othbootargs;"	\
	"nand read 2000000 $nandbootaddr $nandimgsize;"	\
	"nand read 3000000 $nandfdtaddr $nandfdtsize;"	\
	"bootm 2000000 - 3000000;\0"

#define CONFIG_NFSBOOTCOMMAND		\
	"setenv bootargs root=/dev/nfs rw "	\
	"nfsroot=$serverip:$rootpath "		\
	"ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
	"console=$consoledev,$baudrate $othbootargs;"	\
	"tftp $loadaddr $bootfile;"		\
	"tftp $fdtaddr $fdtfile;"		\
	"bootm $loadaddr - $fdtaddr"

#define CONFIG_HDBOOT			\
	"setenv bootargs root=/dev/$bdev rw rootdelay=30 "	\
	"console=$consoledev,$baudrate $othbootargs;"	\
	"usb start;"			\
	"ext2load usb 0:1 $loadaddr /boot/$bootfile;"		\
	"ext2load usb 0:1 $fdtaddr /boot/$fdtfile;"	\
	"bootm $loadaddr - $fdtaddr"

#define CONFIG_RAMBOOTCOMMAND		\
	"setenv bootargs root=/dev/ram rw "	\
	"console=$consoledev,$baudrate $othbootargs; "	\
	"tftp $ramdiskaddr $ramdiskfile;"	\
	"tftp $loadaddr $bootfile;"		\
	"tftp $fdtaddr $fdtfile;"		\
	"bootm $loadaddr $ramdiskaddr $fdtaddr"

#define CONFIG_BOOTCOMMAND		CONFIG_HDBOOT

#endif	/* __CONFIG_H */


text:
layout: pf-es
title: ITEM TITLE
---

"DESCRIPTION"

Volver


text:
require 'rails_helper'

RSpec.describe API::Entities::CCR::AdaptedWarrantFee, type: :adapter do
  subject(:response) { JSON.parse(described_class.represent(warrant_fee).to_json, symbolize_names: true) }

  let(:fee_type) { instance_double(Fee::WarrantFeeType, unique_code: 'WARR') }
  let(:claim) { instance_double(Claim::AdvocateInterimClaim) }
  let(:warrant_fee) { instance_double(Fee::WarrantFee, claim: claim, fee_type: fee_type, amount: 111.01, warrant_issued_date: '01-Apr-2018'.to_date) }

  it_behaves_like 'a bill types delegator', ::CCR::Fee::WarrantFeeAdapter do
    let(:bill) { warrant_fee }
  end

  it { is_expected.to expose :bill_type }
  it { is_expected.to expose :bill_subtype }
  it { is_expected.not_to expose :case_numbers }
  it { is_expected.to expose :warrant_issued_date }
  it { is_expected.not_to expose :warrant_executed_date }
  it { is_expected.to expose :amount }

  it 'exposes expected json key-value pairs' do
    is_expected.to include(
      bill_type: 'AGFS_ADVANCE',
      bill_subtype: 'AGFS_WARRANT',
      amount: '111.01',
      warrant_issued_date: '2018-04-01'
    )
  end
end


text:
var fs = require('fs');
var Budgeting = require('./budgeting');
var argv = require('minimist')(process.argv.slice(2));

var file_matches = (argv._.length == 2) ? argv._[0] : "matches.json";
var file_tx      = (argv._.length == 2) ? argv._[1] : argv._[0];

var detailKey = (argv.d) ? argv.d : "unknown";
var cat_matches = JSON.parse(fs.readFileSync(file_matches, "utf8"));
var budgeting = new Budgeting(cat_matches);

console.log("budgeting v" + budgeting.version);

if (!file_tx) {
  console.log("Usage: ./index.js tx.txt");
  return;
}

fs.readFile(file_tx, function (err, file) {
  budgeting.parseData(file);

  console.log(budgeting.expenses);

  for (var i = 0; i < budgeting.expenseDetails[detailKey].length; i++) {
    var line = budgeting.expenseDetails[detailKey][i];
    console.log("" + line[0] + "\t" + line[1]);
  }

});


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:mapsme="http://schemas.android.com/apk/res-auto"
  android:background="?cardBackground"
  android:orientation="vertical"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_centerHorizontal="true"
  android:gravity="center_horizontal"
  android:paddingTop="@dimen/margin_base"
  android:paddingBottom="@dimen/margin_base"
  android:paddingLeft="@dimen/margin_base"
  android:paddingRight="@dimen/margin_base">
  <ImageView
    android:id="@+id/close_btn"
    android:minHeight="@dimen/margin_base_plus"
    android:minWidth="@dimen/margin_base_plus"
    android:src="@drawable/ic_clear"
    android:tint="?iconTint"
    android:layout_gravity="end"
    android:background="?selectableItemBackgroundBorderless"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>
  <com.mapswithme.maps.widget.PlaceholderView
    android:id="@+id/placeholder"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center_horizontal"
    android:layout_weight="1"
    mapsme:imgSrcDefault="@drawable/img_guide_edit_on_web"
    mapsme:titleDefault="@string/edit_guide_title"
    mapsme:subTitleDefault="@string/edit_guide_subtitle"/>
  <Button
    android:id="@+id/send_me_link_btn"
    android:layout_width="@dimen/button_width"
    android:layout_height="wrap_content"
    style="@style/MwmWidget.Button.Primary"
    android:layout_weight="0"
    android:layout_marginTop="@dimen/margin_base_plus"
    android:text="@string/send_a_link_btn"
    android:textAppearance="@style/MwmTextAppearance.Body1.Light"/>
</LinearLayout>


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.sql.fluent.models;

import com.azure.core.annotation.Immutable;
import com.azure.resourcemanager.sql.models.CheckNameAvailabilityReason;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The result of a name availability check. */
@Immutable
public final class CheckNameAvailabilityResponseInner {
    /*
     * The name whose availability was checked.
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * True if the name is available, otherwise false.
     */
    @JsonProperty(value = "available", access = JsonProperty.Access.WRITE_ONLY)
    private Boolean available;

    /*
     * The reason code explaining why the name is unavailable. Will be
     * undefined if the name is available.
     */
    @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY)
    private CheckNameAvailabilityReason reason;

    /*
     * A message explaining why the name is unavailable. Will be undefined if
     * the name is available.
     */
    @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY)
    private String message;

    /**
     * Get the name property: The name whose availability was checked.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Get the available property: True if the name is available, otherwise false.
     *
     * @return the available value.
     */
    public Boolean available() {
        return this.available;
    }

    /**
     * Get the reason property: The reason code explaining why the name is unavailable. Will be undefined if the name is
     * available.
     *
     * @return the reason value.
     */
    public CheckNameAvailabilityReason reason() {
        return this.reason;
    }

    /**
     * Get the message property: A message explaining why the name is unavailable. Will be undefined if the name is
     * available.
     *
     * @return the message value.
     */
    public String message() {
        return this.message;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}


text:
using System.Collections.Generic;

namespace DotVVM.Framework.Compilation.Parser.Dothtml.Parser
{
    public abstract class DothtmlNodeWithContent : DothtmlNode
    {
        public List<DothtmlNode> Content { get; private set; } = new List<DothtmlNode>();

        public override IEnumerable<DothtmlNode> EnumerateChildNodes()
        {
            return Content;
        }
    }
}


text:
<?xml version='1.0' encoding='utf-8'?>
<feed xmlns='http://www.w3.org/2005/Atom'
xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:batch='http://schemas.google.com/gdata/batch'
xmlns:yt='http://gdata.youtube.com/schemas/2007'
xmlns:gd='http://schemas.google.com/g/2005'
gd:etag='W/"DUUDQn47eCp7ImA9WB9TE0k."'>
<id>tag:youtube.com,2008:user:zfgdata:subscriptions</id>
<updated>2007-09-20T21:01:13.000-07:00</updated>
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://gdata.youtube.com/schemas/2007#subscription' />
<title>Subscriptions of zfgdata</title>
<logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo>
<link rel='related' type='application/atom+xml'
href='http://gdata.youtube.com/feeds/api/users/zfgdata?v=2' />
<link rel='alternate' type='text/html'
href='http://www.youtube.com/profile_subscriptions?user=zfgdata' />
<link rel='http://schemas.google.com/g/2005#feed'
type='application/atom+xml'
href='http://gdata.youtube.com/feeds/api/users/zfgdata/subscriptions?v=2' />
<link rel='http://schemas.google.com/g/2005#batch'
type='application/atom+xml'
href='http://gdata.youtube.com/feeds/api/users/zfgdata/subscriptions/batch?v=2' />
<link rel='self' type='application/atom+xml'
href='http://gdata.youtube.com/feeds/api/users/zfgdata/subscriptions?start-index=1&max-results=25&v=2' />
<link rel='service' type='application/atomsvc+xml'
href='http://gdata.youtube.com/feeds/api/users/zfgdata/subscriptions?alt=atom-service&v=2' />
<author>
<name>zfgdata</name>
<uri>http://gdata.youtube.com/feeds/api/users/zfgdata</uri>
</author>
<generator version='2.0' uri='http://gdata.youtube.com/'>YouTube
data API</generator>
<openSearch:totalResults>8</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<openSearch:itemsPerPage>25</openSearch:itemsPerPage>
<entry gd:etag='W/"DUUDQn47eCp7ImA9WB9TE0k."'>
<id>tag:youtube.com,2008:user:zfgdata:subscription:_Jkf5no0ZW0</id>
<published>2007-09-20T21:01:13.000-07:00</published>
<updated>2007-09-20T21:01:13.000-07:00</updated>
<category scheme='http://gdata.youtube.com/schemas/2007/subscriptiontypes.cat'
term='channel' />
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://gdata.youtube.com/schemas/2007#subscription' />
<title>Videos published by : tonyrain</title>
<content type='application/atom+xml;type=feed'
src='http://gdata.youtube.com/feeds/api/users/tonyrain/uploads?v=2' />
<link rel='related' type='application/atom+xml'
href='http://gdata.youtube.com/feeds/api/users/zfgdata?v=2' />
<link rel='alternate' type='text/html'
href='http://www.youtube.com/profile_videos?user=tonyrain' />
<link rel='self' type='application/atom+xml'
href='http://gdata.youtube.com/feeds/api/users/zfgdata/subscriptions/_Jkf5no0ZW0?v=2' />
<author>
<name>zfgdata</name>
<uri>http://gdata.youtube.com/feeds/api/users/zfgdata</uri>
</author>
<yt:username>tonyrain</yt:username>
<yt:countHint>13</yt:countHint>
<media:thumbnail url='http://i2.ytimg.com/vi/10-yctITMjk/default.jpg' />
</entry>
<entry gd:etag='W/"C04CR347eCp7ImA9WxRaE0U."'>
<id>tag:youtube.com,2008:user:zfgdata:subscription:S_KBJ3ylYwc</id>
<published>2008-12-15T14:59:26.000-08:00</published>
<updated>2008-12-15T14:59:26.000-08:00</updated>
<category scheme='http://gdata.youtube.com/schemas/2007/subscriptiontypes.cat'
term='favorites' />
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://gdata.youtube.com/schemas/2007#subscription' />
<title>Favorites of : NBA</title>
<content type='application/atom+xml;type=feed'
src='http://gdata.youtube.com/feeds/api/users/nba/favorites?v=2' />
<link rel='related' type='application/atom+xml'
href='http://gdata.youtube.com/feeds/api/users/zfgdata?v=2' />
<link rel='alternate' type='text/html'
href='http://www.youtube.com/profile_favorites?user=NBA' />
<link rel='self' type='application/atom+xml'
href='http://gdata.youtube.com/feeds/api/users/zfgdata/subscriptions/S_KBJ3ylYwc?v=2' />
<author>
<name>zfgdata</name>
<uri>http://gdata.youtube.com/feeds/api/users/zfgdata</uri>
</author>
<yt:username>NBA</yt:username>
<media:thumbnail url='http://i4.ytimg.com/i/WJ2lWNubArHWmf3FIHbfcQ/1.jpg' />
</entry>
<entry gd:etag='W/"DUMHQ347eCp7ImA9WB9TE0k."'>
<id>tag:youtube.com,2008:user:zfgdata:subscription:i_2YXxZb9Zg</id>
<published>2007-09-20T21:03:52.000-07:00</published>
<updated>2007-09-20T21:03:52.000-07:00</updated>
<category scheme='http://gdata.youtube.com/schemas/2007/subscriptiontypes.cat'
term='playlist' />
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://gdata.youtube.com/schemas/2007#subscription' />
<title>From Google Engineers</title>
<content type='application/atom+xml;type=feed'
src='http://gdata.youtube.com/feeds/api/playlists/4AE5C0D23C2EB82D?v=2' />
<link rel='related' type='application/atom+xml'
href='http://gdata.youtube.com/feeds/api/users/zfgdata?v=2' />
<link rel='alternate' type='text/html'
href='http://www.youtube.com/view_play_list?p=4AE5C0D23C2EB82D' />
<link rel='self' type='application/atom+xml'
href='http://gdata.youtube.com/feeds/api/users/zfgdata/subscriptions/i_2YXxZb9Zg?v=2' />
<author>
<name>zfgdata</name>
<uri>http://gdata.youtube.com/feeds/api/users/zfgdata</uri>
</author>
<yt:playlistTitle>From Google Engineers</yt:playlistTitle>
<yt:username>GoogleDevelopers</yt:username>
<yt:playlistId>4AE5C0D23C2EB82D</yt:playlistId>
<media:thumbnail url='http://i3.ytimg.com/vi/zI38Tc9GjSk/default.jpg' />
</entry>
<entry gd:etag='W/"C0QFSH47eCp7ImA9WxRaE0U."'>
<id>
tag:youtube.com,2008:user:zfgdata:subscription:59NG0lkr7r4</id>
<published>2008-12-15T14:48:39.000-08:00</published>
<updated>2008-12-15T14:48:39.000-08:00</updated>
<category scheme='http://gdata.youtube.com/schemas/2007/subscriptiontypes.cat'
term='query' />
<category scheme='http://schemas.google.com/g/2005#kind'
term='http://gdata.youtube.com/schemas/2007#subscription' />
<title>Videos matching : google</title>
<content type='application/atom+xml;type=feed'
src='http://gdata.youtube.com/feeds/api/videos?q=google&v=2' />
<link rel='related' type='application/atom+xml'
href='http://gdata.youtube.com/feeds/api/users/zfgdata?v=2' />
<link rel='alternate' type='text/html'
href='http://www.youtube.com/results?search_query=google' />
<link rel='self' type='application/atom+xml'
href='http://gdata.youtube.com/feeds/api/users/zfgdata/subscriptions/59NG0lkr7r4?v=2' />
<author>
<name>zfgdata</name>
<uri>
http://gdata.youtube.com/feeds/api/users/zfgdata</uri>
</author>
<yt:queryString>google</yt:queryString>
</entry>
</feed>


text:
using System;
using System.Linq;
using System.Text.RegularExpressions;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Postal.AspNetCore;

namespace Postal.AspNetCore
{
    public static class ServiceCollectionExtensions
    {
        public static IServiceCollection AddPostal(this IServiceCollection services)
        {
            services.TryAddScoped<IActionResultExecutor<EmailViewResult>, EmailViewResultExecutor>();
            services.TryAddScoped<ITemplateService, TemplateService>();
            services.TryAddScoped<IEmailParser, EmailParser>();
            services.TryAddScoped<IEmailService, EmailService>();
            services.TryAddScoped<IEmailViewRender, EmailViewRender>();
            return services;
        }

        public static IServiceCollection ConfigurePostal(this IServiceCollection services, string smtpConnectionString)
        {
            var match = Regex.Match(smtpConnectionString, @"^smtp:\/\/((?<username>[^:@]+):(?<password>[^:@]+)@)?(?<host>[^:@,\/?#]+)(:(?<port>\d+))?(\?(?<option>[^&]+=[^&]+)(&(?<option>[^&]+=[^&]+))*)?$");

            if (!match.Success)
            {
                throw new Exception(string.Format("The connection string '{0}' is not valid.", smtpConnectionString));
            }

            var host = match.Groups["host"].Value;
            var userName = match.Groups["username"].Value;
            var password = match.Groups["password"].Value;

            int? port = default;
            bool enableSsl = default;
            string fromAddress = default;

            var portGroup = match.Groups["port"];

            if (string.IsNullOrWhiteSpace(portGroup.Value) == false)
            {
                port = int.Parse(portGroup.Value);
            }

            var optionCaptures = match.Groups["option"].Captures;

            foreach (Capture optionCapture in optionCaptures)
            {
                var parts = optionCapture.Value.Split(new[] { '=' }, 2);

                switch (parts[0])
                {
                    case "enableSsl":
                        bool.TryParse(parts[1], out enableSsl);
                        break;

                    case "fromAddress":
                        fromAddress = parts[1];
                        break;
                }
            }

            services.Configure<EmailServiceOptions>(options =>
            {
                options.Host = host;
                options.Port = port;
                options.UserName = userName;
                options.Password = password;
                options.EnableSSL = enableSsl;
                options.FromAddress = fromAddress;
            });

            return services;
        }
    }
}


text:
package com.vmware.vim25;

/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/

@SuppressWarnings("all")
public class VmResourceReallocatedEvent extends VmEvent {
}


text:
using System;
using System.Text;

namespace BestPlaylists.Common
{
    public class RandomGenerator
    {
        private const string AlphaNum = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

        private string[] words = new[]
        {
            "funny", "annoying", "monkeys", "cute", "and", "monkey", "compilation", "are", "so", "but", "sometimes", "they",
            "can", "be", "real", "jerks", "just", "look", "how", "what", "do", "to", "people", "cats", "dogs", "on",
            "hope", "you", "like", "our", "please", "share", "it", "watch", "also", "other", "videos", "at", "the",
            "zoo", "stealing", "things", "was", "aftermath", "of", "a", "big", "festival", "two", "were", "prowling",
            "together", "one", "saw", "cake", "mieued", "jumped", "up", "picket", "first", "cat", "said", "give", "me",
            "is", "i", "who", "keep", "away", "from", "picked", "fighting", "there", "no", "solution", "then", "passed",
            "by", "he", "thought", "foolish", "must", "let", "make", "use", "this", "chance", "came", "in", "loud",
            "voice", "don't", "fight", "among", "both", "handed", "over", "split", "into", "tow", "parts", "shook",
            "his", "head", "oho", "bigger", "smaller", "had", "bit", "now", "has", "become", "ate", "thus", "went",
            "eating", "part", "finally", "finished", "whole", "poor", "disappointed"
        };

        private static Random random = new Random();

        public int GetRandomNumber(int minLength = 0, int maxLength = int.MaxValue - 1)
        {
            return random.Next(minLength, maxLength + 1);
        }

        public string GetRandowSentance(int minLength = 0, int maxLength = 61)
        {
            var builder = new StringBuilder();
            var length = this.GetRandomNumber(minLength, maxLength + 1);

            for (int i = 0; i < length; i++)
            {
                builder.Append(words[this.GetRandomNumber(0, words.Length - 1)]);
                builder.Append(" ");

                if (builder.Length >= maxLength)
                {
                    break;
                }
            }

            var result = builder[0].ToString().ToUpper();
            result += builder.ToString().Substring(1, builder.Length - 1);

            return result.Trim();
        }

        public string GetRandomString(int minLength = 0, int maxLength = 61)
        {
            var length = random.Next(minLength, maxLength + 1);
            var result = new StringBuilder();

            for (int i = 0; i < length; i++)
            {
                result.Append(AlphaNum[random.Next(0, AlphaNum.Length - 1)]);
            }

            // Simulate spacing
            result.Replace('A', ' ').Replace('a', ' ');

            return result.ToString().Trim();
        }

        public DateTime GetRandomDate(DateTime? after = null, DateTime? before = null)
        {
            var minDate = after ?? new DateTime(2000, 1, 1, 0, 0, 0);
            var maxDate = before ?? new DateTime(2050, 12, 31, 23, 59, 59);

            var second = this.GetRandomNumber(minDate.Second, maxDate.Second);
            var minute = this.GetRandomNumber(minDate.Minute, maxDate.Minute);
            var hour = this.GetRandomNumber(minDate.Hour, maxDate.Hour);
            var day = this.GetRandomNumber(minDate.Day, maxDate.Day);
            var month = this.GetRandomNumber(minDate.Month, maxDate.Month);
            var year = this.GetRandomNumber(minDate.Year, maxDate.Year);

            if (day > 28)
            {
                day = 28;
            }

            return new DateTime(year, month, day, hour, minute, second);
        }
    }
}


text:
export * from "./math.axis";
export * from "./math.color";
export * from "./math.constants";
export * from "./math.frustum";
export * from "./math.path";
export * from "./math.plane";
export * from "./math.size";
export * from "./math.vector";
export * from "./math.vertexFormat";
export * from "./math.viewport";


text:
package org.apache.ignite.ml.genetic;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import javax.cache.Cache.Entry;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteException;
import org.apache.ignite.cache.affinity.Affinity;
import org.apache.ignite.cache.query.QueryCursor;
import org.apache.ignite.cache.query.SqlQuery;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.compute.ComputeJob;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeJobResultPolicy;
import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.ml.genetic.parameter.GAConfiguration;
import org.apache.ignite.ml.genetic.parameter.GAGridConstants;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.jetbrains.annotations.NotNull;

/**
 * Responsible for applying mutation on respective chromosomes.

 *
 * MutateTask leverages Ignite's data affinity capabilities for routing MutateJobs to primary IgniteNode where

 * chromosomes reside.

 */
public class MutateTask extends ComputeTaskAdapter<List<Long>, Boolean> {
    /** Ignite instance */
    @IgniteInstanceResource
    private Ignite ignite = null;

    /** GAConfiguration */
    private GAConfiguration cfg;

    /**
     * @param cfg GAConfiguration
     */
    public MutateTask(GAConfiguration cfg) {
        this.cfg = cfg;
    }

    /**
     * choose mutated genes.
     *
     * @return Gene primary keys
     */
    private List<Long> getMutatedGenes() {
        List<Long> mutatedGenes = new ArrayList<Long>();
        cfg.getChromosomeLen();

        for (int i = 0; i < cfg.getChromosomeLen(); i++)
            mutatedGenes.add(selectGene(i));

        return mutatedGenes;
    }

    /** {@inheritDoc} */
    @NotNull @Override public Map map(List<ClusterNode> nodes, List<Long> chromosomeKeys) throws IgniteException {

        Map<ComputeJob, ClusterNode> map = new HashMap<>();
        Affinity affinity = ignite.affinity(GAGridConstants.POPULATION_CACHE);

        for (Long key : chromosomeKeys) {
            MutateJob ajob = new MutateJob(key, getMutatedGenes(), this.cfg.getMutationRate());
            ClusterNode primary = affinity.mapKeyToNode(key);
            map.put(ajob, primary);
        }
        return map;
    }

    /** {@inheritDoc} */
    @Override public Boolean reduce(List<ComputeJobResult> list) throws IgniteException {
        return Boolean.TRUE;
    }

    /** {@inheritDoc} */
    @Override public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd) {
        IgniteException err = res.getException();

        if (err != null)
            return ComputeJobResultPolicy.FAILOVER;

        // If there is no exception, wait for all job results.
        return ComputeJobResultPolicy.WAIT;

    }

    /**
     * select a gene from the Gene pool
     *
     * @return Primary key of Gene
     */
    private long selectAnyGene() {
        int idx = selectRandomIndex(cfg.getGenePool().size());
        Gene gene = cfg.getGenePool().get(idx);
        return gene.id();
    }

    /**
     * select a gene based from the Gene pool
     *
     * @param k Gene index in Chromosome.
     * @return Primary key of Gene
     */
    private long selectGene(int k) {
        if (cfg.getChromosomeCriteria() == null)
            return (selectAnyGene());
        else
            return (selectGeneByChromsomeCriteria(k));
    }

    /**
     * method assumes ChromosomeCriteria is set.
     *
     * @param k Gene index in Chromosome.
     * @return Primary key of Gene
     */
    private long selectGeneByChromsomeCriteria(int k) {
        List<Gene> genes = new ArrayList<Gene>();

        StringBuffer sbSqlClause = new StringBuffer("_val like '");
        sbSqlClause.append("%");
        sbSqlClause.append(cfg.getChromosomeCriteria().getCriteria().get(k));
        sbSqlClause.append("%'");

        IgniteCache<Long, Gene> cache = ignite.cache(GAGridConstants.GENE_CACHE);

        SqlQuery sql = new SqlQuery(Gene.class, sbSqlClause.toString());

        try (QueryCursor<Entry<Long, Gene>> cursor = cache.query(sql)) {
            for (Entry<Long, Gene> e : cursor)
                genes.add(e.getValue());
        }

        int idx = selectRandomIndex(genes.size());

        Gene gene = genes.get(idx);
        return gene.id();
    }

    /**
     * select an index at random
     *
     * @param sizeOfGenePool Size of gene pool
     * @return Index of Gene to be selected
     */
    private int selectRandomIndex(int sizeOfGenePool) {
        Random randomGenerator = new Random();
        return randomGenerator.nextInt(sizeOfGenePool);
    }

}


text:
<Type Name="QueryTermNode" FullName="Hyena.Query.QueryTermNode">
  <TypeSignature Language="C#" Value="public class QueryTermNode : Hyena.Query.QueryNode" />
  <AssemblyInfo>
    <AssemblyName>Hyena</AssemblyName>
    <AssemblyVersion>0.90.1.25402</AssemblyVersion>
    <AssemblyVersion>1.3.1.0</AssemblyVersion>
    <AssemblyVersion>1.4.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>Hyena.Query.QueryNode</BaseTypeName>
  </Base>
  <Interfaces />
  <Docs>
    To be added.
    <remarks>To be added.</remarks>
  </Docs>
  <Members>

    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public QueryTermNode ();" />
      <MemberType>Constructor</MemberType>
      <Parameters />
      <Docs>To be added.<remarks>To be added.</remarks></Docs>
    <AssemblyInfo><AssemblyVersion>1.3.1.0</AssemblyVersion><AssemblyVersion>1.4.0.0</AssemblyVersion></AssemblyInfo></Member><Member MemberName="Field">
      <MemberSignature Language="C#" Value="public Hyena.Query.QueryField Field { set; get; }" />
      <MemberType>Property</MemberType>
      <ReturnValue><ReturnType>Hyena.Query.QueryField</ReturnType></ReturnValue>
      <Docs>To be added.<value>To be added.</value><remarks>To be added.</remarks></Docs>
    <AssemblyInfo><AssemblyVersion>1.3.1.0</AssemblyVersion><AssemblyVersion>1.4.0.0</AssemblyVersion></AssemblyInfo></Member><Member MemberName="Operator">
      <MemberSignature Language="C#" Value="public Hyena.Query.Operator Operator { set; get; }" />
      <MemberType>Property</MemberType>
      <ReturnValue><ReturnType>Hyena.Query.Operator</ReturnType></ReturnValue>
      <Docs>To be added.<value>To be added.</value><remarks>To be added.</remarks></Docs>
    <AssemblyInfo><AssemblyVersion>1.3.1.0</AssemblyVersion><AssemblyVersion>1.4.0.0</AssemblyVersion></AssemblyInfo></Member><Member MemberName="ParseUserQuery">
      <MemberSignature Language="C#" Value="public static Hyena.Query.QueryTermNode ParseUserQuery (Hyena.Query.QueryFieldSet field_set, string token);" />
      <MemberType>Method</MemberType>
      <ReturnValue><ReturnType>Hyena.Query.QueryTermNode</ReturnType></ReturnValue>
      <Parameters><Parameter Name="field_set" Type="Hyena.Query.QueryFieldSet" /><Parameter Name="token" Type="System.String" /></Parameters>
      <Docs><param name="field_set">To be added.</param><param name="token">To be added.</param>To be added.<returns>To be added.</returns><remarks>To be added.</remarks></Docs>
    <AssemblyInfo><AssemblyVersion>1.3.1.0</AssemblyVersion><AssemblyVersion>1.4.0.0</AssemblyVersion></AssemblyInfo></Member><Member MemberName="Value">
      <MemberSignature Language="C#" Value="public Hyena.Query.QueryValue Value { set; get; }" />
      <MemberType>Property</MemberType>
      <ReturnValue><ReturnType>Hyena.Query.QueryValue</ReturnType></ReturnValue>
      <Docs>To be added.<value>To be added.</value><remarks>To be added.</remarks></Docs>
    <AssemblyInfo><AssemblyVersion>1.3.1.0</AssemblyVersion><AssemblyVersion>1.4.0.0</AssemblyVersion></AssemblyInfo></Member>
  </Members>
</Type>


text:
NS_ASSUME_NONNULL_BEGIN

@interface CTDisplayView : UIView

@end

NS_ASSUME_NONNULL_END


text:
package com.neko.androidexamples.view_pager;

import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.neko.androidexamples.R;
import com.neko.androidexamples.common.fragments.FirstFragment;
import com.neko.androidexamples.common.fragments.SecondFragment;
import com.neko.androidexamples.common.fragments.ThirdFragment;
import com.neko.androidexamples.common.pager_animations.ZoomOutPageTransformer;

public class ViewPagerActivity extends AppCompatActivity {

    private PagerAdapter pagerAdapter;
    private ViewPager pager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_view_pager);

        // Initializing Pager
        pager = (ViewPager) findViewById(R.id.pager);
        // Initializing Pager Adapter
        pagerAdapter = new PagerAdapter(getSupportFragmentManager());
        // Adding Fragments to Pager Adapter
        pagerAdapter.addFragment(new FirstFragment());
        pagerAdapter.addFragment(new SecondFragment());
        pagerAdapter.addFragment(new ThirdFragment());
        // setting adapter to pager
        pager.setAdapter(pagerAdapter);

        // setting swipe animation
        pager.setPageTransformer(true, new ZoomOutPageTransformer());
    }
}


text:
import threading
import time
from unittest import mock

import pytest

from elasticsearch import Elasticsearch, helpers
from elasticsearch.serializer import JSONSerializer

lock_side_effect = threading.Lock()

def mock_process_bulk_chunk(*args, **kwargs):
    """
    Threadsafe way of mocking process bulk chunk:
    https://stackoverflow.com/questions/39332139/thread-safe-version-of-mock-call-count
    """

    with lock_side_effect:
        mock_process_bulk_chunk.call_count += 1
    time.sleep(0.1)
    return []

mock_process_bulk_chunk.call_count = 0

class TestParallelBulk:
    @mock.patch(
        "elasticsearch.helpers.actions._process_bulk_chunk",
        side_effect=mock_process_bulk_chunk,
    )
    def test_all_chunks_sent(self, _process_bulk_chunk):
        actions = ({"x": i} for i in range(100))
        list(
            helpers.parallel_bulk(
                Elasticsearch("http://localhost:9200"), actions, chunk_size=2
            )
        )

        assert 50 == mock_process_bulk_chunk.call_count

    @mock.patch(
        "elasticsearch.helpers.actions._process_bulk_chunk",
        # make sure we spend some time in the thread
        side_effect=lambda *_, **__: [
            (True, time.sleep(0.001) or threading.current_thread().ident)
        ],
    )
    def test_chunk_sent_from_different_threads(self, _process_bulk_chunk):
        actions = ({"x": i} for i in range(100))
        results = list(
            helpers.parallel_bulk(
                Elasticsearch("http://localhost:9200"),
                actions,
                thread_count=10,
                chunk_size=2,
            )
        )
        assert len(set([r[1] for r in results])) > 1

class TestChunkActions:
    def setup_method(self, _):
        self.actions = [({"index": {}}, {"some": "datá", "i": i}) for i in range(100)]

    def test_expand_action(self):
        assert helpers.expand_action({}) == ({"index": {}}, {})
        assert helpers.expand_action({"key": "val"}) == ({"index": {}}, {"key": "val"})

    def test_expand_action_actions(self):
        assert helpers.expand_action(
            {"_op_type": "delete", "_id": "id", "_index": "index"}
        ) == ({"delete": {"_id": "id", "_index": "index"}}, None)
        assert helpers.expand_action(
            {"_op_type": "update", "_id": "id", "_index": "index", "key": "val"}
        ) == ({"update": {"_id": "id", "_index": "index"}}, {"key": "val"})
        assert helpers.expand_action(
            {"_op_type": "create", "_id": "id", "_index": "index", "key": "val"}
        ) == ({"create": {"_id": "id", "_index": "index"}}, {"key": "val"})
        assert helpers.expand_action(
            {
                "_op_type": "create",
                "_id": "id",
                "_index": "index",
                "_source": {"key": "val"},
            }
        ) == ({"create": {"_id": "id", "_index": "index"}}, {"key": "val"})

    def test_expand_action_options(self):
        for option in (
            "_id",
            "_index",
            "_percolate",
            "_timestamp",
            "_type",
            "if_seq_no",
            "if_primary_term",
            "parent",
            "pipeline",
            "retry_on_conflict",
            "routing",
            "version",
            "version_type",
            ("_parent", "parent"),
            ("_retry_on_conflict", "retry_on_conflict"),
            ("_routing", "routing"),
            ("_version", "version"),
            ("_version_type", "version_type"),
            ("_if_seq_no", "if_seq_no"),
            ("_if_primary_term", "if_primary_term"),
        ):
            if isinstance(option, str):
                action_option = option
            else:
                option, action_option = option
            assert helpers.expand_action({"key": "val", option: 0}) == (
                {"index": {action_option: 0}},
                {"key": "val"},
            )

    def test__source_metadata_or_source(self):
        assert helpers.expand_action({"_source": {"key": "val"}}) == (
            {"index": {}},
            {"key": "val"},
        )

        assert helpers.expand_action(
            {"_source": ["key"], "key": "val", "_op_type": "update"}
        ) == ({"update": {"_source": ["key"]}}, {"key": "val"})

        assert helpers.expand_action(
            {"_source": True, "key": "val", "_op_type": "update"}
        ) == ({"update": {"_source": True}}, {"key": "val"})

        # This case is only to ensure backwards compatibility with old functionality.
        assert helpers.expand_action(
            {"_source": {"key2": "val2"}, "key": "val", "_op_type": "update"}
        ) == ({"update": {}}, {"key2": "val2"})

    def test_chunks_are_chopped_by_byte_size(self):
        assert 100 == len(
            list(helpers._chunk_actions(self.actions, 100000, 1, JSONSerializer()))
        )

    def test_chunks_are_chopped_by_chunk_size(self):
        assert 10 == len(
            list(helpers._chunk_actions(self.actions, 10, 99999999, JSONSerializer()))
        )

    def test_chunks_are_chopped_by_byte_size_properly(self):
        max_byte_size = 170
        chunks = list(
            helpers._chunk_actions(
                self.actions, 100000, max_byte_size, JSONSerializer()
            )
        )
        assert 25 == len(chunks)
        for chunk_data, chunk_actions in chunks:
            chunk = b"".join(chunk_actions)
            assert len(chunk) <= max_byte_size

class TestExpandActions:
    @pytest.mark.parametrize("action", ["whatever", b"whatever"])
    def test_string_actions_are_marked_as_simple_inserts(self, action):
        assert ({"index": {}}, b"whatever") == helpers.expand_action(action)