text:
"""
Create netCDF4 Storage Units and write data to them
"""
from __future__ import absolute_import

import logging
import numbers
from datetime import datetime

import netCDF4
import numpy

from datacube.storage.masking import describe_flags_def
from datacube.model import GeoPolygon, CRS
from datacube.utils import data_resolution_and_offset

# pylint: disable=ungrouped-imports,wrong-import-order
try:
    from datacube.storage.netcdf_safestrings import SafeStringsDataset as Dataset
except TypeError:  # The above fails when netCDF4.Dataset is mocked, eg in RTD
    from netCDF4 import Dataset

from datacube import __version__

_LOG = logging.getLogger(__name__)

_STANDARD_COORDINATES = {
    'longitude': {
        'standard_name': 'longitude',
        'long_name': 'longitude',
        'axis': 'X'
    },
    'latitude': {
        'standard_name': 'latitude',
        'long_name': 'latitude',
        'axis': 'Y'
    },
    'x': {
        'standard_name': 'projection_x_coordinate',
        'long_name': 'x coordinate of projection',
        # 'axis': 'X'  # this makes gdal (2.0.0) think x is longitude and it does bad things to it (subtract 360)
    },
    'y': {
        'standard_name': 'projection_y_coordinate',
        'long_name': 'y coordinate of projection',
        # 'axis': 'Y'  # see x's axis comment above
    },
    'time': {
        'standard_name': 'time',
        'long_name': 'Time, unix time-stamp',
        'axis': 'T',
        'calendar': 'standard'
    }
}

def create_netcdf(netcdf_path, **kwargs):
    nco = Dataset(netcdf_path, 'w', **kwargs)
    nco.date_created = datetime.today().isoformat()
    nco.setncattr('Conventions', 'CF-1.6, ACDD-1.3')
    nco.history = ("NetCDF-CF file created by "
                   "datacube version '{}' at {:%Y%m%d}."
                   .format(__version__, datetime.utcnow()))
    return nco

def append_netcdf(netcdf_path):
    return Dataset(netcdf_path, 'a')

def create_coordinate(nco, name, labels, units):
    """
    :type nco: netCDF4.Dataset
    :type name: str
    :type labels: numpy.array
    :type units: str
    :return: netCDF4.Variable
    """
    labels = netcdfy_coord(labels)

    nco.createDimension(name, labels.size)
    var = nco.createVariable(name, labels.dtype, name)
    var[:] = labels

    var.units = units
    for key, value in _STANDARD_COORDINATES.get(name, {}).items():
        setattr(var, key, value)

    return var

def create_variable(nco, name, var, set_crs=False, attrs=None, **kwargs):
    """
    :param nco:
    :param name:
    :type var: datacube.model.Variable
    :param kwargs:
    :return:
    """
    if 'chunksizes' in kwargs:
        maxsizes = [len(nco.dimensions[dim]) for dim in var.dims]
        kwargs['chunksizes'] = [min(chunksize, maxsize) if chunksize and maxsize else chunksize
                                for maxsize, chunksize in zip(maxsizes, kwargs['chunksizes'])]

    assert var.dtype.kind != 'U'  # Creates Non CF-Compliant NetCDF File
    if var.dtype.kind == 'S' and var.dtype.itemsize > 1:
        nco.createDimension(name + '_nchar', size=var.dtype.itemsize)
        data_var = nco.createVariable(varname=name,
                                      datatype='S1',
                                      dimensions=tuple(var.dims) + (name + '_nchar',),
                                      fill_value=getattr(var, 'nodata', None),
                                      **kwargs)
    else:
        data_var = nco.createVariable(varname=name,
                                      datatype=var.dtype,
                                      dimensions=var.dims,
                                      fill_value=getattr(var, 'nodata', None),
                                      **kwargs)
    if set_crs:
        data_var.grid_mapping = 'crs'
    if getattr(var, 'units', None):
        data_var.units = var.units
    data_var.set_auto_maskandscale(False)
    return data_var

def _create_latlon_grid_mapping_variable(nco, crs):
    crs_var = nco.createVariable('crs', 'i4')
    crs_var.long_name = crs['GEOGCS']  # "Lon/Lat Coords in WGS84"
    crs_var.grid_mapping_name = 'latitude_longitude'
    crs_var.longitude_of_prime_meridian = 0.0
    return crs_var

def _write_albers_params(crs_var, crs):
    # http://spatialreference.org/ref/epsg/gda94-australian-albers/html/
    # http://cfconventions.org/Data/cf-conventions/cf-conventions-1.7/build/cf-conventions.html#appendix-grid-mappings
    crs_var.grid_mapping_name = 'albers_conical_equal_area'
    crs_var.standard_parallel = (crs.proj.standard_parallel_1,
                                 crs.proj.standard_parallel_2)
    crs_var.longitude_of_central_meridian = crs.proj.longitude_of_center
    crs_var.latitude_of_projection_origin = crs.proj.latitude_of_center

def _write_utm_params(crs_var, crs):
    #http://spatialreference.org/ref/epsg/32636/html/
    #http://cfconventions.org/Data/cf-conventions/cf-conventions-1.7/build/cf-conventions.html#appendix-grid-mappings at the transverse mercator section.
    crs_var.grid_mapping_name = 'transverse_mercator'
    crs_var.scale_factor_at_central_meridian = crs.proj.scale_factor
    crs_var.longitude_of_central_meridian = crs.proj.longitude_of_center
    crs_var.latitude_of_projection_origin = crs.proj.latitude_of_center

def _write_sinusoidal_params(crs_var, crs):
    crs_var.grid_mapping_name = 'sinusoidal'
    crs_var.longitude_of_central_meridian = crs.proj.central_meridian

CRS_PARAM_WRITERS = {
    'albers_conic_equal_area': _write_albers_params,
    'sinusoidal': _write_sinusoidal_params,
    'transverse_mercator': _write_utm_params
}

def _create_projected_grid_mapping_variable(nco, crs):
    grid_mapping_name = crs['PROJECTION'].lower()
    if grid_mapping_name not in CRS_PARAM_WRITERS:
        raise ValueError('{} CRS is not supported'.format(grid_mapping_name))

    crs_var = nco.createVariable('crs', 'i4')
    CRS_PARAM_WRITERS[grid_mapping_name](crs_var, crs)

    crs_var.false_easting = crs.proj.false_easting
    crs_var.false_northing = crs.proj.false_northing
    crs_var.long_name = crs['PROJCS']

    return crs_var

def _write_geographical_extents_attributes(nco, extent):
    geo_extents = extent.to_crs(CRS("EPSG:4326")).points
    geo_extents.append(geo_extents[0])
    nco.geospatial_bounds = "POLYGON((" + ", ".join("{0} {1}".format(*p) for p in geo_extents) + "))"
    nco.geospatial_bounds_crs = "EPSG:4326"

    nco.geospatial_lat_min = min(lat for lon, lat in geo_extents)
    nco.geospatial_lat_max = max(lat for lon, lat in geo_extents)
    nco.geospatial_lat_units = "degrees_north"
    nco.geospatial_lon_min = min(lon for lon, lat in geo_extents)
    nco.geospatial_lon_max = max(lon for lon, lat in geo_extents)
    nco.geospatial_lon_units = "degrees_east"

    # TODO: broken anyway...
    # nco.geospatial_lat_resolution = "{} degrees".format(abs(geobox.affine.e))
    # nco.geospatial_lon_resolution = "{} degrees".format(abs(geobox.affine.a))

def create_grid_mapping_variable(nco, crs):
    if crs.geographic:
        crs_var = _create_latlon_grid_mapping_variable(nco, crs)
    elif crs.projected:
        crs_var = _create_projected_grid_mapping_variable(nco, crs)
    else:
        raise ValueError('Unknown CRS')
    crs_var.semi_major_axis = crs.semi_major_axis
    crs_var.semi_minor_axis = crs.semi_minor_axis
    crs_var.inverse_flattening = crs.inverse_flattening
    crs_var.crs_wkt = crs.wkt

    crs_var.spatial_ref = crs.wkt

    dims = crs.dimensions
    xres, xoff = data_resolution_and_offset(nco[dims[1]])
    yres, yoff = data_resolution_and_offset(nco[dims[0]])
    crs_var.GeoTransform = [xoff, xres, 0.0, yoff, 0.0, yres]

    left, right = nco[dims[1]][0]-0.5*xres, nco[dims[1]][-1]+0.5*xres
    bottom, top = nco[dims[0]][0]-0.5*yres, nco[dims[0]][-1]+0.5*yres
    points = [[left, bottom], [left, top], [right, top], [right, bottom]]
    _write_geographical_extents_attributes(nco, GeoPolygon(points, crs))

    return crs_var

def write_flag_definition(variable, flags_definition):
    # write bitflag info
    # Functions for this are stored in Measurements
    variable.QA_index = describe_flags_def(flags_def=flags_definition)
    variable.flag_masks, variable.valid_range, variable.flag_meanings = flag_mask_meanings(flags_def=flags_definition)

def netcdfy_coord(data):
    if data.dtype.kind == 'M':
        return data.astype('<M8[s]').astype('double')
    return data

def netcdfy_data(data):
    if data.dtype.kind == 'S' and data.dtype.itemsize > 1:
        return data.view('S1').reshape(data.shape + (-1,))
    else:
        return data

def flag_mask_meanings(flags_def):
    # Filter out any multi-bit mask values since we can't handle them yet
    flags_def = {k: v for k, v in flags_def.items() if isinstance(v['bits'], numbers.Integral)}
    max_bit = max([bit_def['bits'] for bit_def in flags_def.values()])

    if max_bit >= 32:
        # GDAL upto and including 2.0 can't support int64 attributes...
        raise RuntimeError('Bit index too high: %s' % max_bit)

    valid_range = numpy.array([0, (2 ** max_bit - 1) + 2 ** max_bit], dtype='int32')

    masks = []
    meanings = []

    def by_bits(i):
        _, v = i
        return v['bits']

    for name, bitdef in sorted(flags_def.items(), key=by_bits):
        try:
            true_value = bitdef['values'][1]

            if true_value is True:
                meaning = name
            elif true_value is False:
                meaning = 'no_' + name
            else:
                meaning = true_value

            masks.append(2 ** bitdef['bits'])
            meanings.append(str(meaning))
        except KeyError:
            continue

    return numpy.array(masks, dtype='int32'), valid_range, ' '.join(meanings)


text:
<?php

namespace Laminas\Filter;

/**
 * Implement this interface within Module classes to indicate that your module
 * provides filter configuration for the FilterPluginManager.
 */
interface FilterProviderInterface
{
    /**
     * Provide plugin manager configuration for filters.
     *
     * @return array
     */
    public function getFilterConfig();
}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.samza.storage.kv

import org.apache.samza.metrics.MetricsHelper
import org.apache.samza.metrics.MetricsRegistry
import org.apache.samza.metrics.MetricsRegistryMap

class SerializedKeyValueStoreMetrics(
  val storeName: String = "unknown",
  val registry: MetricsRegistry = new MetricsRegistryMap) extends MetricsHelper {

  val gets = newCounter("gets")
  val ranges = newCounter("ranges")
  val alls = newCounter("alls")
  val puts = newCounter("puts")
  val deletes = newCounter("deletes")
  val flushes = newCounter("flushes")
  val bytesSerialized = newCounter("bytes-serialized")
  val bytesDeserialized = newCounter("bytes-deserialized")

  override def getPrefix = storeName + "-"
}


text:
									Discovery
									DBS

© 发现数据

												${input_tips!''}

											<form role="form" action="${admin_login_action_uri}" enctype="multipart/form-data" method="post">
											<input  style="display:none;" type="text" id="salt" name="salt" value="${salt}" />
											<input  style="display:none;" type="text" id="action" name="action" value="login" />
												<fieldset>

															<input type="text" class="form-control"  id="email" name="email"  value="DiscoveryDBS"/>

															<input type="password" class="form-control"  id="passwd" name="passwd"  value="DiscoveryDBS" />

														<button  type="submit"  class="width-35 pull-right btn btn-sm btn-primary">

															登录
														</button>

												</fieldset>
											</form>


text:
import { Command, CommandLineInputs, CommandLineOptions, CommandPreRun } from '@ionic/cli-utils';
export declare class ResourcesCommand extends Command implements CommandPreRun {
    preRun(inputs: CommandLineInputs, options: CommandLineOptions): Promise<void | number>;
    run(inputs: CommandLineInputs, options: CommandLineOptions): Promise<void | number>;
}


text:
npm-user-service
=======

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Gittip][gittip-image]][gittip-url]
[![David deps][david-image]][david-url]

[npm-image]: https://img.shields.io/npm/v/npm-user-service.svg?style=flat
[npm-url]: https://npmjs.org/package/npm-user-service
[travis-image]: https://img.shields.io/travis/cnpm/npm-user-service.svg?style=flat
[travis-url]: https://travis-ci.org/cnpm/npm-user-service
[coveralls-image]: https://img.shields.io/coveralls/cnpm/npm-user-service.svg?style=flat
[coveralls-url]: https://coveralls.io/r/cnpm/npm-user-service?branch=master
[gittip-image]: https://img.shields.io/gittip/fengmk2.svg?style=flat
[gittip-url]: https://www.gittip.com/fengmk2/
[david-image]: https://img.shields.io/david/cnpm/npm-user-service.svg?style=flat
[david-url]: https://david-dm.org/cnpm/npm-user-service

[npm] user service for [cnpmjs.org](https://github.com/cnpm/cnpmjs.org/wiki/Use-Your-Own-User-Authorization)

## Install

```bash
$ npm install npm-user-service --save
```

## Usage

Set `userService` on [cnpmjs.org/config/config.js](https://github.com/cnpm/cnpmjs.org/blob/master/config/index.js)

```js
var NpmUserService = require('npm-user-service');

config.userService = new NpmUserService();
```

## License

MIT

[npm]: https://npmjs.org


text:
(function() {
  module.exports = function() {
    var minor;
    minor = ['bb', 'android'];
    return this.github('Fyrd/caniuse/master/data.json', (function(_this) {
      return function(data) {
        var agent, browsers, caniuse, internal, intervals, normalize, _ref;
        normalize = function(array) {
          return array.reverse().filter(function(i) {
            return i;
          });
        };
        intervals = function(array) {
          var i, interval, result, splited, sub, _i, _len;
          result = [];
          for (_i = 0, _len = array.length; _i < _len; _i++) {
            interval = array[_i];
            splited = interval.split('-').map(function(i) {
              return parseFloat(i);
            });
            splited = splited.sort().reverse();
            sub = (function() {
              var _j, _len1, _results;
              _results = [];
              for (_j = 0, _len1 = splited.length; _j < _len1; _j++) {
                i = splited[_j];
                _results.push([i, interval, splited.length]);
              }
              return _results;
            })();
            result = result.concat(sub);
          }
          return result;
        };
        agent = function(name) {
          var future, info, result, versions;
          info = data.agents[name];
          future = normalize(info.versions.slice(-3)).map(function(i) {
            return parseFloat(i);
          });
          versions = intervals(normalize(info.versions.slice(0, -3)));
          result = {
            prefix: "-" + info.prefix + "-"
          };
          if (minor.indexOf(name) !== -1) {
            result.minor = true;
          }
          if (future.length) {
            result.future = future;
          }
          result.versions = versions.map(function(i) {
            return i[0];
          });
          result.popularity = versions.map(function(i) {
            return info.usage_global[i[1]] / i[2];
          });
          return result;
        };
        browsers = {};
        _ref = _this.browsers;
        for (caniuse in _ref) {
          internal = _ref[caniuse];
          browsers[internal] = agent(caniuse);
        }
        return _this.save('browsers', browsers);
      };
    })(this));
  };

}).call(this);


text:
/*global define */

(function () {
    "use strict";

    console.log('ControllerStarter setup');
    define([
        'angular',
        'controllers/MasherCtrl',
        'controllers/TabsCtrl',
        'controllers/SPACtrl',
        'controllers/TopRowCtrl',
        'controllers/LeftColCtrl',
        'controllers/MapColCtrl',
        'controllers/RightColCtrl',
        'controllers/PositionViewCtrl',
        'controllers/MapCtrl',
        'controllers/MapLinkrPluginCtrl',
        'controllers/MapLinkrMgrCtrl',
        'controllers/WebSiteDescriptionCtrl',
        'controllers/SearcherCtrlGrp',
        'controllers/SearcherCtrlMap',
        'controllers/PusherSetupCtrl',
        'controllers/PusherCtrl',
        'controllers/DestWndSetupCtrl',
        'controllers/TransmitNewUrlCtrl',
        'controllers/ShareCtrl',
        'controllers/PopupBlockerCtrl',
        'controllers/CarouselCtrl',
        'controllers/LocateSelfCtrl',
        'lib/GeoCoder',
        'javascripts/lib/MLConfig'
    ],
        function (angular, MasherCtrl, TabsCtrl, SPACtrl, TopRowCtrl, LeftColCtrl, MapColCtrl, RightColCtrl,
            PositionViewCtrl, MapCtrl, MapLinkrPluginCtrl, MapLinkrMgrCtrl, WebSiteDescriptionCtrl,
            SearcherCtrlGrp, SearcherCtrlMap, PusherSetupCtrl, PusherCtrl, DestWndSetupCtrl,
            TransmitNewUrlCtrl, ShareCtrl, PopupBlockerCtrl, CarouselCtrl, LocateSelfCtrl, GeoCoder, MLConfig) {
            console.log('ControllerStarter define');

            function ControllerStarter($scope) {
                console.log("ControllerStarter empty block");
            }

            function getUserName($http, opts) {
                $http({method: 'GET', url: '/username'}).
                    success(function (data, status, headers, config) {
                        // this callback will be called asynchronously
                        // when the response is available.
                        console.log('ControllerStarter getUserName: ', data.name);
                        // MLConfig.setUserId(data.id );
                        if (opts.uname) {
                            MLConfig.setUserName(data.name);
                        }
                        // alert('got user name ' + data.name);
                        if (opts.uid) {
                            MLConfig.setUserId(data.id);
                        }
                        if (opts.refId === -99) {
                            MLConfig.setReferrerId(data.id);
                        }
                    }).
                    error(function (data, status, headers, config) {
                            // called asynchronously if an error occurs
                            // or server returns response with an error status.
                        console.log('Oops and error', data);
                        alert('Oops' + data.name);
                    });
            }

            function init(App, portalForSearch) {
                console.log('ControllerStarter init');
                var $inj = MLConfig.getInjector(),
                    $http = $inj.get('$http'),
                    referrerId = MLConfig.getReferrerId(),
                    urlUserName;

                console.log("Check if referrerId is -99");
                if (referrerId === -99) {
                    getUserName($http, {uname : true, uid : true, refId : referrerId === -99});
                } else {
                    urlUserName = MLConfig.getUserNameFromUrl();
                    // MLConfig.getReferrerIdFromUrl();
                    if (urlUserName) {
                        getUserName($http, {uname : false, uid : true, refId : referrerId === -99});
                    } else {
                        getUserName($http, {uname : true, uid : true, refId : referrerId === -99});
                    }

                }
                WebSiteDescriptionCtrl.start(App);
                MasherCtrl.start(App);
                TabsCtrl.start(App);
                SPACtrl.start(App);
                TopRowCtrl.start(App);
                LeftColCtrl.start(App);
                MapColCtrl.start(App);
                RightColCtrl.start(App);
                PositionViewCtrl.start(App);
                MapLinkrPluginCtrl.start(App);
                MapLinkrMgrCtrl.start(App);

                SearcherCtrlGrp.start(App, portalForSearch);
                SearcherCtrlMap.start(App, portalForSearch);

                PusherSetupCtrl.start(App);
                PusherCtrl.start(App);
                DestWndSetupCtrl.start(App);

                TransmitNewUrlCtrl.start(App);
                ShareCtrl.start(App);
                PopupBlockerCtrl.start(App);
                CarouselCtrl.start(App);
                LocateSelfCtrl.start(App);

                MapCtrl.start(App);
                GeoCoder.start(App, $http);

                return ControllerStarter;
            }

            return { start: init };

        });

}());
// }).call(this);


text:
<?php

use Faker\Generator as Faker;
use App\User;
use App\Game;
use App\GameType;
use Carbon\Carbon;

$factory->define(Game::class, function (Faker $faker) {
    $gameTypeId = GameType::getRandomRecordProperty('id');
    $creatorId = User::getRandomRecordProperty('id');
    $hostId = User::getRandomRecordProperty('id');

    // create random start and finish timestamps
    $now = Carbon::now();

    $offsetInDays = rand(1, 1000);
    $offsetInSeconds = rand(60 * 60, 24 * 60 * 60);
    $gameDuration = rand(60 * 60, 4 * 60 * 60);

    $start = (Carbon::now())->subDays($offsetInDays)
                            ->subSeconds($offsetInSeconds);

    $end = $start->addSeconds($gameDuration);

    return [
        'game_type_id' => $gameTypeId,
        'creator_id' => $creatorId,
        'host_id' => $hostId,
        'started_at' => $start,
        'finished_at' => $end,
        'note' => rand(0, 10) > 5 ? $faker->paragraph : null,
    ];
});


text:
package bookshop2.seller.incoming.purchaseBooks;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

import org.aries.runtime.BeanContext;
import org.aries.runtime.RequestContext;
import org.aries.tx.AbstractHandlerUnitTest;
import org.aries.tx.Transactional;
import org.aries.util.FieldUtil;
import org.aries.validate.util.CheckpointManager;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;

import bookshop2.ShipmentScheduledMessage;
import bookshop2.seller.SellerProcess;
import bookshop2.util.Bookshop2Fixture;

@RunWith(MockitoJUnitRunner.class)
public class ShipmentScheduledHandlerUnitTest extends AbstractHandlerUnitTest {

	private ShipmentScheduledHandlerImpl fixture;

	private RequestContext mockRequestContext;

	private SellerProcess mockSellerProcess;

	public String getName() {
		return "ShipmentScheduled";
	}

	public String getDomain() {
		return "bookshop2.seller";
	}

	public Transactional getFixture() {
		return fixture;
	}

	public SellerProcess getMockServiceProcess() {
		return mockSellerProcess;
	}

	@Before
	public void setUp() throws Exception {
		mockRequestContext = mock(RequestContext.class);
		mockSellerProcess = mock(SellerProcess.class);
		CheckpointManager.setJAXBSessionCache(getJAXBSessionCache());
		CheckpointManager.addConfiguration("bookshop2-seller-service-checks.xml");
		super.setUp();
	}

	@After
	public void tearDown() throws Exception {
		BeanContext.clear();
		mockRequestContext = null;
		mockSellerProcess = null;
		fixture = null;
		super.tearDown();
	}

	protected ShipmentScheduledHandlerImpl createFixture() throws Exception {
		fixture = new ShipmentScheduledHandlerImpl();
		FieldUtil.setFieldValue(fixture, "requestContext", mockRequestContext);
		FieldUtil.setFieldValue(fixture, "sellerProcess", mockSellerProcess);
		initialize(fixture);
		return fixture;
	}

	@Test
	public void testExecute_shipmentScheduled_Success() throws Exception {
		ShipmentScheduledMessage shipmentScheduledMessage = Bookshop2Fixture.create_ShipmentScheduledMessage();
		setupContext(expectedCorrelationId, expectedTransactionId);
		setupMessage(shipmentScheduledMessage);
		runTestExecute_shipmentScheduled(shipmentScheduledMessage);
	}

	@Test
	public void testExecute_shipmentScheduled_NullRequest() throws Exception {
		addExpectedServiceAbortedException("Incoming message is null");
		expectedCorrelationId = null;
		isRequestExpected = true;
		runTestExecute_shipmentScheduled(null);
	}

	@Test
	public void testExecute_shipmentScheduled_EmptyRequest() throws Exception {
		addExpectedServiceAbortedException("ShipmentScheduledMessage/shipment/date must be specified");
		ShipmentScheduledMessage shipmentScheduledMessage = Bookshop2Fixture.createEmpty_ShipmentScheduledMessage();
		setupContext(expectedCorrelationId, expectedTransactionId);
		setupMessage(shipmentScheduledMessage);
		isAbortExpected = true;
		runTestExecute_shipmentScheduled(shipmentScheduledMessage);
	}

	@Test
	public void testExecute_shipmentScheduled_NullCorrelationId() throws Exception {
		addExpectedServiceAbortedException("CorrelationId null");
		ShipmentScheduledMessage shipmentScheduledMessage = Bookshop2Fixture.create_ShipmentScheduledMessage();
		expectedCorrelationId = null;
		setupContext(expectedCorrelationId, expectedTransactionId);
		setupMessage(shipmentScheduledMessage);
		isAbortExpected = true;
		runTestExecute_shipmentScheduled(shipmentScheduledMessage);
	}

	@Test
	public void testExecute_shipmentScheduled_EmptyCorrelationId() throws Exception {
		addExpectedServiceAbortedException("CorrelationId empty");
		ShipmentScheduledMessage shipmentScheduledMessage = Bookshop2Fixture.create_ShipmentScheduledMessage();
		expectedCorrelationId = "";
		setupContext(expectedCorrelationId, expectedTransactionId);
		setupMessage(shipmentScheduledMessage);
		isAbortExpected = true;
		runTestExecute_shipmentScheduled(shipmentScheduledMessage);
	}

	public void runTestExecute_shipmentScheduled(ShipmentScheduledMessage shipmentScheduledMessage) throws Exception {
		try {
			fixture = createFixture();
			fixture.shipmentScheduled(shipmentScheduledMessage);
			validateProcessInvocation(shipmentScheduledMessage);

		} catch (Throwable e) {
			validateAfterException(e);

		} finally {
			validateProcessNotification();
			validateAfterExecution();
		}
	}

	protected void validateProcessInvocation(ShipmentScheduledMessage shipmentScheduledMessage) throws Exception {
		if (!isAbortExpected)
			verify(mockSellerProcess).handle_ShipmentScheduled_response(shipmentScheduledMessage);
	}

	protected void validateProcessNotification() throws Exception {
		//verify(mockSellerProcess).fireShipmentScheduledDone();
	}

}


text:
# Grouping lists of records

The [api:SS_List] class is designed to return a flat list of records.
These lists can get quite long, and hard to present on a single list.
[Pagination](/templates/how_tos/pagination) is one way to solve this problem,
by splitting up the list into multiple pages.

In this howto, we present an alternative to pagination:
Grouping a list by various criteria, through the `[api:GroupedList]` class.
This class is a `[api:SS_ListDecorator]`, which means it wraps around a list,
adding new functionality.

It provides a `groupBy()` method, which takes a field name, and breaks up the managed list
into a number of arrays, where each array contains only objects with the same value of that field.
Similarly, the `GroupedBy()` method builds on this and returns the same data in a template-friendly format.

## Grouping Sets By First Letter

This example deals with breaking up a [api:SS_List] into sub-headings by the first letter.

Let's say you have a set of Module objects, each representing a SilverStripe module, and you want to output a list of
these in alphabetical order, with each letter as a heading; something like the following list:

	*	B
		* Blog
	*	C
		* CMS Workflow
		* Custom Translations
	*	D
		* Database Plumber
		* ...

The first step is to set up the basic data model,
along with a method that returns the first letter of the title. This
will be used both for grouping and for the title in the template.

	:::php
	class Module extends DataObject {
		private static $db = array(
			'Title' => 'Text'
		);

		/**
		 * Returns the first letter of the module title, used for grouping.
		 * @return string
		 */
		public function getTitleFirstLetter() {
			return $this->Title[0];
		}
	}

The next step is to create a method or variable that will contain/return all the objects,
sorted by title. For this example this will be a method on the `Page` class.

	:::php
	class Page extends SiteTree {

		// ...

		/**
		 * Returns all modules, sorted by their title.
		 * @return GroupedList
		 */
		public function getGroupedModules() {
			return GroupedList::create(Module::get()->sort('Title'));
		}

	}

The final step is to render this into a template. The `GroupedBy()` method breaks up the set into
a number of sets, grouped by the field that is passed as the parameter.
In this case, the `getTitleFirstLetter()` method defined earlier is used to break them up.

	:::ss
	<%-- Modules list grouped by TitleFirstLetter --%>

Modules

	<% loop $GroupedModules.GroupedBy(TitleFirstLetter) %>

$TitleFirstLetter

			<% loop $Children %>

$Title

			<% end_loop %>

	<% end_loop %>

## Grouping Sets By Month

Grouping a set by month is a very similar process.
The only difference would be to sort the records by month name, and
then create a method on the DataObject that returns the month name,
and pass that to the [api:GroupedList->GroupedBy()] call.

We're reusing our example `Module` object,
but grouping by its built-in `Created` property instead,
which is automatically set when the record is first written to the database.
This will have a method which returns the month it was posted in:

	:::php
	class Module extends DataObject {

		// ...

		/**
		 * Returns the month name this news item was posted in.
		 * @return string
		 */
		public function getMonthCreated() {
			return date('F', strtotime($this->Created));
		}

	}

The next step is to create a method that will return all records that exist,
sorted by month name from January to December. This can be accomplshed by sorting by the `Created` field:

	:::php
	class Page extends SiteTree {

		// ...

		/**
		 * Returns all news items, sorted by the month they were posted
		 * @return GroupedList
		 */
		public function getGroupedModulesByDate() {
			return GroupedList::create(Module::get()->sort('Created'));
		}

	}

The final step is the render this into the template using the [api:GroupedList->GroupedBy()] method.

	:::ss
	// Modules list grouped by the Month Posted

Modules

	<% loop $GroupedModulesByDate.GroupedBy(MonthCreated) %>

$MonthCreated

			<% loop $Children %>

$Title ($Created.Nice)

			<% end_loop %>

	<% end_loop %>

## Related

 * [Howto: "Pagination"](/templates/how_tos/pagination)


text:
package cloudflare

import (
	"context"
	"encoding/json"
	"net/http"

	"github.com/pkg/errors"
)

// LogpullRetentionConfiguration describes a the structure of a Logpull Retention
// payload.
type LogpullRetentionConfiguration struct {
	Flag bool `json:"flag"`
}

// LogpullRetentionConfigurationResponse is the API response, containing the
// Logpull retention result.
type LogpullRetentionConfigurationResponse struct {
	Response
	Result LogpullRetentionConfiguration `json:"result"`
}

// GetLogpullRetentionFlag gets the current setting flag.
//
// API reference: https://developers.cloudflare.com/logs/logpull-api/enabling-log-retention/
func (api *API) GetLogpullRetentionFlag(ctx context.Context, zoneID string) (*LogpullRetentionConfiguration, error) {
	uri := "/zones/" + zoneID + "/logs/control/retention/flag"
	res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil)
	if err != nil {
		return &LogpullRetentionConfiguration{}, err
	}
	var r LogpullRetentionConfigurationResponse
	err = json.Unmarshal(res, &r)
	if err != nil {
		return nil, errors.Wrap(err, errUnmarshalError)
	}
	return &r.Result, nil
}

// SetLogpullRetentionFlag updates the retention flag to the defined boolean.
//
// API reference: https://developers.cloudflare.com/logs/logpull-api/enabling-log-retention/
func (api *API) SetLogpullRetentionFlag(ctx context.Context, zoneID string, enabled bool) (*LogpullRetentionConfiguration, error) {
	uri := "/zones/" + zoneID + "/logs/control/retention/flag"
	flagPayload := LogpullRetentionConfiguration{Flag: enabled}

	res, err := api.makeRequestContext(ctx, http.MethodPost, uri, flagPayload)
	if err != nil {
		return &LogpullRetentionConfiguration{}, err
	}
	var r LogpullRetentionConfigurationResponse
	err = json.Unmarshal(res, &r)
	if err != nil {
		return &LogpullRetentionConfiguration{}, err
	}
	return &r.Result, nil
}


text:
package org.inferred.freebuilder.processor.model;

import com.google.common.collect.ImmutableList;

import org.inferred.freebuilder.processor.source.Partial;

import java.util.List;

import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ElementVisitor;
import javax.lang.model.element.Name;
import javax.lang.model.element.NestingKind;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.TypeParameterElement;
import javax.lang.model.type.DeclaredType;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.type.TypeVisitor;

/**
 * Fake implementation of {@link DeclaredType} for unit tests.
 */
public abstract class ClassTypeImpl implements DeclaredType {

  public static final ClassTypeImpl INTEGER = newTopLevelClass(Integer.class.getName());
  public static final ClassTypeImpl STRING = newTopLevelClass(String.class.getName());

  private final Element enclosingElement;
  private final TypeMirror enclosingType;
  private final String simpleName;

  public static ClassTypeImpl newTopLevelClass(String qualifiedName) {
    String pkg = qualifiedName.substring(0, qualifiedName.lastIndexOf('.'));
    String simpleName = qualifiedName.substring(qualifiedName.lastIndexOf('.') + 1);
    PackageElement enclosingElement = PackageElementImpl.create(pkg);
    return Partial.of(ClassTypeImpl.class, enclosingElement, NoTypes.NONE, simpleName);
  }

  public static ClassTypeImpl newNestedClass(TypeElement enclosingType, String simpleName) {
    return Partial.of(ClassTypeImpl.class, enclosingType, NoTypes.NONE, simpleName);
  }

  public static ClassTypeImpl newInnerClass(DeclaredType enclosingType, String simpleName) {
    return Partial.of(ClassTypeImpl.class, enclosingType.asElement(), enclosingType, simpleName);
  }

  ClassTypeImpl(Element enclosingElement, TypeMirror enclosingType, String simpleName) {
    this.enclosingElement = enclosingElement;
    this.enclosingType = enclosingType;
    this.simpleName = simpleName;
  }

  @Override
  public TypeKind getKind() {
    return TypeKind.DECLARED;
  }

  @Override
  public <R, P> R accept(TypeVisitor<R, P> v, P p) {
    return v.visitDeclared(this, p);
  }

  @Override
  public ClassElementImpl asElement() {
    return Partial.of(ClassElementImpl.class, this);
  }

  @Override
  public TypeMirror getEnclosingType() {
    return enclosingType;
  }

  @Override
  public List<? extends TypeMirror> getTypeArguments() {
    return ImmutableList.of();
  }

  @Override
  public String toString() {
    final String prefix;
    if (enclosingElement.getKind() == ElementKind.PACKAGE) {
      prefix = ((PackageElement) enclosingElement).getQualifiedName() + ".";
    } else {
      prefix = ((TypeElement) enclosingElement).getQualifiedName() + ".";
    }
    return prefix + simpleName;
  }

  @Override
  public int hashCode() {
    return toString().hashCode();
  }

  @Override
  public boolean equals(Object o) {
    return (o instanceof ClassTypeImpl) && toString().equals(o.toString());
  }

  /**
   * Fake implementation of {@link TypeElement} for unit tests.
   */
  public abstract class ClassElementImpl implements TypeElement {

    @Override
    public ClassTypeImpl asType() {
      return ClassTypeImpl.this;
    }

    @Override
    public ElementKind getKind() {
      return ElementKind.CLASS;
    }

    @Override
    public <R, P> R accept(ElementVisitor<R, P> v, P p) {
      return v.visitType(this, p);
    }

    @Override
    public NestingKind getNestingKind() {
      return (enclosingElement.getKind() == ElementKind.PACKAGE)
          ? NestingKind.TOP_LEVEL : NestingKind.MEMBER;
    }

    @Override
    public Name getQualifiedName() {
      return new NameImpl(ClassTypeImpl.this.toString());
    }

    @Override
    public Name getSimpleName() {
      return new NameImpl(simpleName);
    }

    @Override
    public TypeMirror getSuperclass() {
      return NoTypes.NONE;
    }

    @Override
    public List<? extends TypeParameterElement> getTypeParameters() {
      return ImmutableList.of();
    }

    @Override
    public Element getEnclosingElement() {
      return enclosingElement;
    }
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OpenXMLSDK.Engine.Word.Models
{
    public class NumberingPropertiesModel
    {
        public int? NumberingLevelReference { get; set; }

        public int? NumberingId { get; set; }
    }
}


text:
const childProcess = require('child_process');

// otherwise we get a stupid warning.
process.stdout.setMaxListeners(100);
process.stderr.setMaxListeners(100);

/**
 * Promisified child_process.exec
 *
 * @param cmd
 * @param opts See child_process.exec node docs
 * @param {stream.Writable} opts.stdout If defined, child process stdout will be piped to it.
 * @param {stream.Writable} opts.stderr If defined, child process stderr will be piped to it.
 * @param {bool} opts.killOnExit Kill the child process when the parent process exits
 *
 * @returns {Promise<{ stdout: string, stderr: stderr }>}
 */
function execp(cmd, opts) {
	opts || (opts = {});
	return new Promise((resolve, reject) => {

		const child = childProcess.exec(cmd, opts,
			(err, stdout, stderr) => err ? reject(err) : resolve(stdout.toString('utf8')));

		if (opts.stdout) {
			child.stdout.pipe(opts.stdout);
		}
		if (opts.stderr) {
			child.stderr.pipe(opts.stderr);
		}

		// Kill child on exit
		const killChild = () => {
			child.kill();
		};
		process.setMaxListeners(100);
		process.on('exit', killChild);
		child.on('exit', () => process.removeListener('exit', killChild));
	});
}

module.exports = execp;


text:
[![CI Status](http://img.shields.io/travis/fangyuxi/HYCoreFramework.svg?style=flat)](https://travis-ci.org/fangyuxi/HYCoreFramework)
[![Version](https://img.shields.io/cocoapods/v/HYCoreFramework.svg?style=flat)](http://cocoapods.org/pods/HYCoreFramework)
[![License](https://img.shields.io/cocoapods/l/HYCoreFramework.svg?style=flat)](http://cocoapods.org/pods/HYCoreFramework)
[![Platform](https://img.shields.io/cocoapods/p/HYCoreFramework.svg?style=flat)](http://cocoapods.org/pods/HYCoreFramework)

## 废弃

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

HYCoreFramework is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "HYCoreFramework"
```
## Section Row Maker

```objc
        //列表页section
        [self updateSection:maker.section userMaker:^(WBPTTableViewSourceSectionMaker *maker) {

              maker.deleteAllRows();
              //cells
              for (NSInteger index = 0; index < [infoList count]; ++index)
               {
                  NSDictionary *dic = [infoList objectAtIndex:index];

                  if ([dic isKindOfClass:[NSDictionary class]])
                  {
                    WBPTMainJobCellModel *model = [[WBPTMainJobCellModel alloc]
                                                      initWithDictionary:[infoList objectAtIndex:index]];
                    [model calculateCellElementFrame];
                    maker.addRow(model).rowPosition([WBPTBaseCell plainStyleWithIndex:index Count:[infoList count]]);
                  }
                 }
         }];

                            //列表页section
                [self makeSection:^(WBPTTableViewSourceSectionMaker *maker) {

                    //identifier
                    maker.setIdentifier(@"WBPTMainJobCellModel");

                    //filterView as sectoinHeader
                    WBPTMainFilterSectionHeaderView *filterView = [[WBPTMainFilterSectionHeaderView alloc] initWithReuseIdentifier:nil];
                    maker.addUnReusedSectionHeaderView(filterView);

                    //cells
                    for (NSInteger index = 0; index < [infoList count]; ++index)
                    {
                        NSDictionary *dic = [infoList objectAtIndex:index];

                        if ([dic isKindOfClass:[NSDictionary class]])
                        {
                            WBPTMainJobCellModel *model = [[WBPTMainJobCellModel alloc]
                                                           initWithDictionary:[infoList objectAtIndex:index]];
                            [model calculateCellElementFrame];
                            maker.addRow(model).rowPosition([WBPTBaseCell plainStyleWithIndex:index Count:[infoList count]]);
                        }
                    }
                }];
```

## Author

fangyuxi, xcoder.fang@gmail.com

## License

HYCoreFramework is available under the MIT license. See the LICENSE file for more info.


text:
QuickSpecBegin(SDLPerformInteractionSpec)

describe(@"Getter/Setter Tests", ^ {
    __block SDLPerformInteraction *testRequest = nil;
    __block NSString *testInitialText = @"initialText";
    __block NSArray<SDLTTSChunk *> *testInitialPrompt = nil;
    __block NSString *testInitialPromptString = nil;
    __block SDLInteractionMode testInteractionMode = SDLInteractionModeVoiceRecognitionOnly;
    __block NSArray<NSNumber<SDLUInt> *> *testInteractionChoiceSetIDList = nil;
    __block NSString *testHelpPromptString = nil;
    __block NSArray<SDLTTSChunk *> *testHelpPrompt = nil;
    __block NSString *testTimeoutPromptString = nil;
    __block NSArray<SDLTTSChunk *> *testTimeoutPrompt = nil;
    __block int testTimeout = 6000;
    __block NSArray<SDLVRHelpItem *> *testVRHelp = nil;
    __block SDLLayoutMode testinteractionLayout = SDLLayoutModeKeyboard;
    __block int testCancelID = 9987;

    beforeEach(^{
        testInteractionChoiceSetIDList = @[@34, @55, @23];
        testInitialPromptString = @"test initial prompt";
        testInitialPrompt = [SDLTTSChunk textChunksFromString:testInitialPromptString];
        testHelpPromptString = @"test help prompt";
        testHelpPrompt = [SDLTTSChunk textChunksFromString:testHelpPromptString];
        testTimeoutPromptString = @"test timeout prompt";
        testTimeoutPrompt = [SDLTTSChunk textChunksFromString:testTimeoutPromptString];
        testVRHelp = @[[[SDLVRHelpItem alloc] initWithText:@"test vr help" image:nil]];
    });

    context(@"Getter/Setter Tests", ^{
        it(@"Should set and get correctly", ^ {
            testRequest = [[SDLPerformInteraction alloc] init];

            testRequest.initialText = testInitialText;
            testRequest.initialPrompt = testInitialPrompt;
            testRequest.interactionMode = testInteractionMode;
            testRequest.interactionChoiceSetIDList = testInteractionChoiceSetIDList;
            testRequest.helpPrompt = testHelpPrompt;
            testRequest.timeoutPrompt = testTimeoutPrompt;
            testRequest.timeout = @(testTimeout);
            testRequest.vrHelp = testVRHelp;
            testRequest.interactionLayout = testinteractionLayout;
            testRequest.cancelID = @(testCancelID);

            expect(testRequest.initialText).to(equal(testInitialText));
            expect(testRequest.initialPrompt).to(equal(testInitialPrompt));
            expect(testRequest.interactionMode).to(equal(testInteractionMode));
            expect(testRequest.interactionChoiceSetIDList).to(equal(testInteractionChoiceSetIDList));
            expect(testRequest.helpPrompt).to(equal(testHelpPrompt));
            expect(testRequest.timeoutPrompt).to(equal(testTimeoutPrompt));
            expect(testRequest.timeout).to(equal(testTimeout));
            expect(testRequest.vrHelp).to(equal(testVRHelp));
            expect(testRequest.interactionLayout).to(equal(testinteractionLayout));
            expect(testRequest.cancelID).to(equal(testCancelID));

            expect(testRequest.parameters.count).to(equal(10));
        });

        it(@"Should return nil if not set", ^ {
            testRequest = [[SDLPerformInteraction alloc] init];

            expect(testRequest.initialText).to(beNil());
            expect(testRequest.initialPrompt).to(beNil());
            expect(testRequest.interactionMode).to(beNil());
            expect(testRequest.interactionChoiceSetIDList).to(beNil());
            expect(testRequest.helpPrompt).to(beNil());
            expect(testRequest.timeoutPrompt).to(beNil());
            expect(testRequest.timeout).to(beNil());
            expect(testRequest.vrHelp).to(beNil());
            expect(testRequest.interactionLayout).to(beNil());
            expect(testRequest.cancelID).to(beNil());

            expect(testRequest.parameters.count).to(equal(0));
        });
    });

    describe(@"Initializing", ^{
        it(@"Should initialize correctly with a dictionary", ^ {
            NSDictionary *dict = @{SDLRPCParameterNameRequest:
                                                       @{SDLRPCParameterNameParameters:
                                                             @{SDLRPCParameterNameInitialText:testInitialText,
                                                               SDLRPCParameterNameInitialPrompt:testInitialPrompt,
                                                               SDLRPCParameterNameInteractionMode:testInteractionMode,
                                                               SDLRPCParameterNameInteractionChoiceSetIdList:testInteractionChoiceSetIDList,
                                                               SDLRPCParameterNameHelpPrompt:testHelpPrompt,
                                                               SDLRPCParameterNameTimeoutPrompt:testTimeoutPrompt,
                                                               SDLRPCParameterNameTimeout:@(testTimeout),
                                                               SDLRPCParameterNameVRHelp:testVRHelp,
                                                               SDLRPCParameterNameInteractionLayout:testinteractionLayout,
                                                               SDLRPCParameterNameCancelID:@(testCancelID)},
                                                         SDLRPCParameterNameOperationName:SDLRPCFunctionNamePerformInteraction}};
            testRequest = [[SDLPerformInteraction alloc] initWithDictionary:dict];

            expect(testRequest.initialText).to(equal(testInitialText));
            expect(testRequest.initialPrompt).to(equal(testInitialPrompt));
            expect(testRequest.interactionMode).to(equal(testInteractionMode));
            expect(testRequest.interactionChoiceSetIDList).to(equal(testInteractionChoiceSetIDList));
            expect(testRequest.helpPrompt).to(equal(testHelpPrompt));
            expect(testRequest.timeoutPrompt).to(equal(testTimeoutPrompt));
            expect(testRequest.timeout).to(equal(testTimeout));
            expect(testRequest.vrHelp).to(equal(testVRHelp));
            expect(testRequest.interactionLayout).to(equal(testinteractionLayout));
            expect(testRequest.cancelID).to(equal(testCancelID));

            expect(testRequest.parameters.count).to(equal(10));
        });

        it(@"Should initialize correctly with initWithInitialText:interactionMode:interactionChoiceSetIDList:cancelID:", ^{
            testRequest = [[SDLPerformInteraction alloc] initWithInitialText:testInitialText interactionMode:testInteractionMode interactionChoiceSetIDList:testInteractionChoiceSetIDList cancelID:testCancelID];

            expect(testRequest.initialText).to(equal(testInitialText));
            expect(testRequest.initialPrompt).to(beNil());
            expect(testRequest.interactionMode).to(equal(testInteractionMode));
            expect(testRequest.interactionChoiceSetIDList).to(equal(testInteractionChoiceSetIDList));
            expect(testRequest.helpPrompt).to(beNil());
            expect(testRequest.timeoutPrompt).to(beNil());
            expect(testRequest.timeout).to(beNil());
            expect(testRequest.vrHelp).to(beNil());
            expect(testRequest.interactionLayout).to(beNil());
            expect(testRequest.cancelID).to(equal(testCancelID));
        });

        it(@"Should initialize correctly with initWithInitialText:initialPrompt:interactionMode:interactionChoiceSetIDList:helpPrompt:timeoutPrompt:timeout:vrHelp:interactionLayout:cancelID:", ^{
            testRequest = [[SDLPerformInteraction alloc] initWithInitialText:testInitialText initialPrompt:testInitialPrompt interactionMode:testInteractionMode interactionChoiceSetIDList:testInteractionChoiceSetIDList helpPrompt:testHelpPrompt timeoutPrompt:testTimeoutPrompt timeout:testTimeout vrHelp:testVRHelp interactionLayout:testinteractionLayout cancelID:testCancelID];

            expect(testRequest.initialText).to(equal(testInitialText));
            expect(testRequest.initialPrompt).to(equal(testInitialPrompt));
            expect(testRequest.interactionMode).to(equal(testInteractionMode));
            expect(testRequest.interactionChoiceSetIDList).to(equal(testInteractionChoiceSetIDList));
            expect(testRequest.helpPrompt).to(equal(testHelpPrompt));
            expect(testRequest.timeoutPrompt).to(equal(testTimeoutPrompt));
            expect(testRequest.timeout).to(equal(testTimeout));
            expect(testRequest.vrHelp).to(equal(testVRHelp));
            expect(testRequest.interactionLayout).to(equal(testinteractionLayout));
            expect(testRequest.cancelID).to(equal(testCancelID));
        });
    });

    afterEach(^{
        expect(testRequest.name).to(equal(SDLRPCFunctionNamePerformInteraction));
    });
});

QuickSpecEnd


text:
<core:FragmentDefinition
	xmlns="sap.m"
	xmlns:core="sap.ui.core">
	<List footerText="Total: 1.079,00 EUR">
		<headerToolbar>
			<Toolbar>
				<Title text="Products (23)" level="H2"/>
				<ToolbarSpacer/>
				<Button icon="sap-icon://settings"/>
				<Button icon="sap-icon://person-placeholder"/>
			</Toolbar>
		</headerToolbar>
		<infoToolbar>
			<Toolbar>
				<Label text="Your Shopping cart contains 1 item" />
			</Toolbar>
		</infoToolbar>
		<ObjectListItem
			intro="HT-2001"
			icon="test-resources/sap/ui/demokit/explored/img/HT-2001.jpg"
			title="10" Portable DVD player"
			number="499.00"
			numberUnit="EUR"
			iconDensityAware="false">
			<attributes>
				<ObjectAttribute text="Titanium"/>
			</attributes>
			<firstStatus>
				<ObjectStatus
					text="Avalaible"
					state="Success"/>
			</firstStatus>
		</ObjectListItem>
	</List>
</core:FragmentDefinition>


text:
'use strict';

var path = require('path');

var GULP_EXE = 'gulp';
if (process.platform === 'win32') {
  GULP_EXE += '.cmd';
}

module.exports = function(grunt) {

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    browserify: require('./grunt/config/browserify'),
    npm: require('./grunt/config/npm'),
    clean: [
      './build',
      './*.gem',
      './docs/_site',
      './examples/shared/*.js',
      '.module-cache',
    ],
    'compare_size': require('./grunt/config/compare_size'),
  });

  grunt.config.set('compress', require('./grunt/config/compress'));

  function spawnGulp(args, opts, done) {

    grunt.util.spawn({
      // This could be more flexible (require.resolve & lookup bin in package)
      // but if it breaks we'll fix it then.
      cmd: path.join('node_modules', '.bin', GULP_EXE),
      args: args,
      opts: Object.assign({stdio: 'inherit'}, opts),
    }, function(err, result, code) {
      if (err) {
        grunt.fail.fatal('Something went wrong running gulp: ', result);
      }
      done(code === 0);
    });
  }

  Object.keys(grunt.file.readJSON('package.json').devDependencies)
    .filter(function(npmTaskName) {
      return npmTaskName.indexOf('grunt-') === 0;
    })
    .filter(function(npmTaskName) {
      return npmTaskName !== 'grunt-cli';
    })
    .forEach(function(npmTaskName) {
      grunt.loadNpmTasks(npmTaskName);
    });

  grunt.registerTask('eslint', require('./grunt/tasks/eslint'));

  grunt.registerTask('lint', ['eslint']);

  grunt.registerTask('flow', require('./grunt/tasks/flow'));

  grunt.registerTask('delete-build-modules', function() {
    // Use gulp here.
    spawnGulp(['react:clean'], null, this.async());
  });

  // Our own browserify-based tasks to build a single JS file build.
  grunt.registerMultiTask('browserify', require('./grunt/tasks/browserify'));

  grunt.registerMultiTask('npm', require('./grunt/tasks/npm'));

  var npmReactTasks = require('./grunt/tasks/npm-react');
  grunt.registerTask('npm-react:release', npmReactTasks.buildRelease);
  grunt.registerTask('npm-react:pack', npmReactTasks.packRelease);

  var npmReactDOMTasks = require('./grunt/tasks/npm-react-dom');
  grunt.registerTask('npm-react-dom:release', npmReactDOMTasks.buildRelease);
  grunt.registerTask('npm-react-dom:pack', npmReactDOMTasks.packRelease);

  var npmReactNativeTasks = require('./grunt/tasks/npm-react-native');
  grunt.registerTask('npm-react-native:release', npmReactNativeTasks.buildRelease);
  grunt.registerTask('npm-react-native:pack', npmReactNativeTasks.packRelease);

  var npmReactAddonsTasks = require('./grunt/tasks/npm-react-addons');
  grunt.registerTask('npm-react-addons:release', npmReactAddonsTasks.buildReleases);
  grunt.registerTask('npm-react-addons:pack', npmReactAddonsTasks.packReleases);

  grunt.registerTask('version-check', require('./grunt/tasks/version-check'));

  grunt.registerTask('build:basic', [
    'build-modules',
    'version-check',
    'browserify:basic',
  ]);
  grunt.registerTask('build:addons', [
    'build-modules',
    'browserify:addons',
  ]);
  grunt.registerTask('build:min', [
    'build-modules',
    'version-check',
    'browserify:min',
  ]);
  grunt.registerTask('build:addons-min', [
    'build-modules',
    'browserify:addonsMin',
  ]);
  grunt.registerTask('build:npm-react', [
    'version-check',
    'build-modules',
    'npm-react:release',
  ]);
  grunt.registerTask('build:react-dom', require('./grunt/tasks/react-dom'));

  var jestTasks = require('./grunt/tasks/jest');
  grunt.registerTask('jest:normal', jestTasks.normal);
  grunt.registerTask('jest:coverage', jestTasks.coverage);

  grunt.registerTask('test', ['jest:normal']);
  grunt.registerTask('npm:test', ['build', 'npm:pack']);

  // Optimized build task that does all of our builds. The subtasks will be run
  // in order so we can take advantage of that and only run build-modules once.
  grunt.registerTask('build', [
    'delete-build-modules',
    'build-modules',
    'version-check',
    'browserify:basic',
    'browserify:addons',
    'browserify:min',
    'browserify:addonsMin',
    'build:react-dom',
    'npm-react:release',
    'npm-react:pack',
    'npm-react-dom:release',
    'npm-react-dom:pack',
    'npm-react-native:release',
    'npm-react-native:pack',
    'npm-react-addons:release',
    'npm-react-addons:pack',
    'compare_size',
  ]);

  // Automate the release!
  var releaseTasks = require('./grunt/tasks/release');
  grunt.registerTask('release:setup', releaseTasks.setup);
  grunt.registerTask('release:bower', releaseTasks.bower);
  grunt.registerTask('release:docs', releaseTasks.docs);
  grunt.registerTask('release:msg', releaseTasks.msg);
  grunt.registerTask('release:starter', releaseTasks.starter);

  grunt.registerTask('release', [
    'release:setup',
    'clean',
    'build',
    'release:bower',
    'release:starter',
    'compress',
    'release:docs',
    'release:msg',
  ]);

  grunt.registerTask('build-modules', function() {
    spawnGulp(['react:modules'], null, this.async());
  });

  // The default task - build - to keep setup easy.
  grunt.registerTask('default', ['build']);
};


text:
require 'micronaut'
require 'svn-transform'

def not_in_editor?
  !(ENV.has_key?('TM_MODE') || ENV.has_key?('EMACS') || ENV.has_key?('VIM'))
end

Micronaut.configure do |c|
  c.color_enabled = not_in_editor?
  c.filter_run :focused => true
end

def (SvnTransform::File).example
  SvnTransform::File.new(
    '/path/to/file.txt', # Actually a Pathname
    ['body of file', {'prop:svn' => 'property value'}],
    10,
    {'svn:author' => 'me'}
  )
end

def (SvnTransform::Dir).example
  SvnTransform::Dir.new(
    '/path/to/dir', # Actually a Pathname
    [{'entry.txt' => nil}, {'prop:svn' => 'property value'}],
    10,
    {'svn:author' => 'me'},
    :repos, # Actually a Svn::Ra::Session
    :fixture_dir
  )
end


text:
DROP TABLE SPRING_SESSION_ATTRIBUTES;
DROP TABLE SPRING_SESSION;


text:
import json

from django.utils.encoding import force_bytes, force_text

from .base import BaseSerializer

class JSONSerializer(BaseSerializer):
    def dumps(self, data):
        return force_bytes(json.dumps(data))

    def loads(self, data):
        return json.loads(force_text(data))


text:
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: the RadioNodeList interface</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<link rel="help" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#radionodelist">

<form >
  <input type="checkbox" name="rdo" value="0" id="r0" checked>
  <input type="radio" name="rdo" id="r1">
  <input type="radio" name="rdo" id="r2" value="2">
</form>


text:
package network

type Processor interface {
	// must goroutine safe
	Route(msg interface{}, userData interface{}) error
	// must goroutine safe
	Unmarshal(data []byte) (interface{}, error)
	// must goroutine safe
	Marshal(msg interface{}) ([][]byte, error)
}


text:
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
    <entity name="Paysera\TimeTrackerBundle\Entity\Entry" table="entry"
            repository-class="Paysera\TimeTrackerBundle\Repository\EntryRepository">

        <indexes>
            <index columns="status"/>
            <index columns="number,status"/>
            <index columns="next_reservation_at"/>
        </indexes>

        <id name="id" type="integer">
            <generator strategy="AUTO" />
        </id>

        <field name="number" type="string" length="255" />
        <field name="transactionKey" column="transaction_key" type="string" length="255" nullable="true" />
        <field name="priceAmount" column="price_amount" type="decimal" precision="16" scale="6" nullable="true" />
        <field name="priceCurrency" column="price_currency" type="string" length="255" />
        <field name="createdAt" column="created" type="datetime" />
        <field name="updatedAt" column="updated" type="datetime" />
        <field name="nextReservationAt" column="next_reservation_at" type="datetime" />
        <field name="status" type="string" length="255" />

        <many-to-one target-entity="Paysera\TimeTrackerBundle\Entity\Location" field="location" />

    </entity>
</doctrine-mapping>


text:
import unittest

import pytest

from webmentiontools.discover import WebmentionDiscover

from .endpoints import WEBMENTION_ROCKS_TESTS

MOCK_URL = 'http://foo.bar/'

class WebmentionDiscoverTestCase(unittest.TestCase):
    def test_init(self):
        webmention = WebmentionDiscover(
            MOCK_URL
        )
        assert webmention.url == MOCK_URL

    # Conform to Webmention Protocol 3.1.1
    # https://www.w3.org/TR/webmention/#create-a-source-document-that-mentions-the-target
    def test_check_has_url(self):
        webmention = WebmentionDiscover(
            MOCK_URL
        )
        assert webmention.check_has_url() is True

    def test_check_has_url_invalid(self):
        invalid_url = "does.not.exist"
        webmention = WebmentionDiscover(
            invalid_url
        )
        assert webmention.check_has_url() is False

    # Conform to Webmention Protocol 3.1.2
    # https://www.w3.org/TR/webmention/#sender-discovers-receiver-webmention-endpoint
    @pytest.mark.integration
    def test_discover(self):
        for test in WEBMENTION_ROCKS_TESTS:
            webmention = WebmentionDiscover(test["url"])
            endpoint = webmention.discover()
            assert endpoint == test["endpoint"]

        url = "https://webmention.rocks/test/23/page"
        webmention = WebmentionDiscover(url)
        endpoint = webmention.discover()

        # This assertion is meh, because the URLs contain a changing element
        # Thus I can't just compare against a fixed string
        assert "webmention-endpoint" in endpoint

    @pytest.mark.integration
    def test_discover_no_endpoint(self):
        url = "http://example.com"
        webmention = WebmentionDiscover(url)
        endpoint = webmention.discover()
        assert endpoint is None


text:
<?php
namespace Grav\Common\Twig;

use Grav\Common\Grav;
use Grav\Common\Config\Config;
use Grav\Common\Page\Page;
use Grav\Common\Inflector;
use Grav\Common\Utils;
use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;

/**
 * The Twig object handles all the Twig template rendering for Grav. It's a singleton object
 * that is optimized so that it only needs to be initialized once and can be reused for individual
 * page template rendering as well as the main site template rendering.
 *
 * @author RocketTheme
 * @license MIT
 */
class Twig
{
    /**
     * @var \Twig_Environment
     */
    public $twig;

    /**
     * @var array
     */
    public $twig_vars;

    /**
     * @var array
     */
    public $twig_paths;

    /**
     * @var string
     */
    public $template;

    /**
     * @var Grav
     */
    protected $grav;

    /**
     * @var \Twig_Loader_Filesystem
     */
    protected $loader;

    /**
     * @var \Twig_Loader_Array
     */
    protected $loaderArray;

    /**
     * Constructor
     */
    public function __construct(Grav $grav)
    {
        $this->grav = $grav;
        $this->twig_paths = [];
    }

    /**
     * Twig initialization that sets the twig loader chain, then the environment, then extensions
     * and also the base set of twig vars
     */
    public function init()
    {
        if (!isset($this->twig)) {
            /** @var Config $config */
            $config = $this->grav['config'];
            /** @var UniformResourceLocator $locator */
            $locator = $this->grav['locator'];
            $debugger = $this->grav['debugger'];

            /** @var Language $language */
            $language = $this->grav['language'];

            $active_language = $language->getActive();

            $language_append = $active_language ? '/'.$active_language : '';

            // handle language templates if available
            if ($language->enabled()) {
                $lang_templates = $locator->findResource('theme://templates/'.$active_language);
                if ($lang_templates) {
                    $this->twig_paths[] = $lang_templates;
                }
            }

            $this->twig_paths = array_merge($this->twig_paths, $locator->findResources('theme://templates'));

            $this->grav->fireEvent('onTwigTemplatePaths');

            $this->loader = new \Twig_Loader_Filesystem($this->twig_paths);
            $this->loaderArray = new \Twig_Loader_Array(array());
            $loader_chain = new \Twig_Loader_Chain(array($this->loaderArray, $this->loader));

            $params = $config->get('system.twig');
            if (!empty($params['cache'])) {
                $params['cache'] = $locator->findResource('cache://twig', true, true);
            }

            $this->twig = new TwigEnvironment($loader_chain, $params);

            if ($config->get('system.twig.undefined_functions')) {
                $this->twig->registerUndefinedFunctionCallback(function ($name) {
                    if (function_exists($name)) {
                        return new \Twig_Function_Function($name);
                    }

                    return new \Twig_Function_Function(function() {});
                });
            }

            if ($config->get('system.twig.undefined_filters')) {
                $this->twig->registerUndefinedFilterCallback(function ($name) {
                    if (function_exists($name)) {
                        return new \Twig_Filter_Function($name);
                    }

                    return new \Twig_Filter_Function(function() {});
                });
            }

            $this->grav->fireEvent('onTwigInitialized');

            // set default date format if set in config
            if ($config->get('system.pages.dateformat.long')) {
                $this->twig->getExtension('core')->setDateFormat($config->get('system.pages.dateformat.long'));
            }
            // enable the debug extension if required
            if ($config->get('system.twig.debug')) {
                $this->twig->addExtension(new \Twig_Extension_Debug());
            }
            $this->twig->addExtension(new TwigExtension());

            $this->grav->fireEvent('onTwigExtensions');

            // Set some standard variables for twig
            $this->twig_vars = array(
                'grav' => $this->grav,
                'config' => $config,
                'uri' => $this->grav['uri'],
                'base_dir' => rtrim(ROOT_DIR, '/'),
                'base_url' => $this->grav['base_url'] . $language_append,
                'base_url_simple' => $this->grav['base_url'],
                'base_url_absolute' => $this->grav['base_url_absolute'] . $language_append,
                'base_url_relative' => $this->grav['base_url_relative'] . $language_append,
                'theme_dir' => $locator->findResource('theme://'),
                'theme_url' => $this->grav['base_url'] .'/'. $locator->findResource('theme://', false),
                'site' => $config->get('site'),
                'assets' => $this->grav['assets'],
                'taxonomy' => $this->grav['taxonomy'],
                'browser' => $this->grav['browser'],
            );
        }
    }

    /**
     * @return \Twig_Environment
     */
    public function twig()
    {
        return $this->twig;
    }

    /**
     * @return \Twig_Loader_Filesystem
     */
    public function loader()
    {
        return $this->loader;
    }

    /**
     * Adds or overrides a template.
     *
     * @param string $name     The template name
     * @param string $template The template source
     */
    public function setTemplate($name, $template)
    {
        $this->loaderArray->setTemplate($name, $template);
    }

    /**
     * Twig process that renders a page item. It supports two variations:
     * 1) Handles modular pages by rendering a specific page based on its modular twig template
     * 2) Renders individual page items for twig processing before the site rendering
     *
     * @param  Page   $item    The page item to render
     * @param  string $content Optional content override
     * @return string          The rendered output
     * @throws \Twig_Error_Loader
     */
    public function processPage(Page $item, $content = null)
    {
        $content = $content !== null ? $content : $item->content();

        // override the twig header vars for local resolution
        $this->grav->fireEvent('onTwigPageVariables');
        $twig_vars = $this->twig_vars;

        $twig_vars['page'] = $item;
        $twig_vars['media'] = $item->media();
        $twig_vars['header'] = $item->header();

        $local_twig = clone($this->twig);
        $modular_twig = $item->modularTwig();
        $process_twig = isset($item->header()->process['twig']) ? $item->header()->process['twig'] : false;

        try {
            // Process Modular Twig
            if ($modular_twig) {
                $twig_vars['content'] = $content;
                $template = $item->template() . TEMPLATE_EXT;
                $output = $content = $local_twig->render($template, $twig_vars);
            }

            // Process in-page Twig
            if (!$modular_twig || ($modular_twig && $process_twig)) {
                $name = '@Page:' . $item->path();
                $this->setTemplate($name, $content);
                $output = $local_twig->render($name, $twig_vars);
            }
        } catch (\Twig_Error_Loader $e) {
            throw new \RuntimeException($e->getRawMessage(), 404, $e);
        }

        return $output;
    }

    /**
     * Process a Twig template directly by using a template name
     * and optional array of variables
     *
     * @param string $template template to render with
     * @param array $vars      Optional variables
     * @return string
     */
    public function processTemplate($template, $vars = array())
    {
        // override the twig header vars for local resolution
        $this->grav->fireEvent('onTwigTemplateVariables');
        $vars += $this->twig_vars;

        try {
            $output = $this->twig->render($template, $vars);
        } catch (\Twig_Error_Loader $e) {
            throw new \RuntimeException($e->getRawMessage(), 404, $e);
        }

        return $output;

    }

    /**
     * Process a Twig template directly by using a Twig string
     * and optional array of variables
     *
     * @param string $string  string to render.
     * @param array $vars     Optional variables
     * @return string
     */
    public function processString($string, array $vars = array())
    {
        // override the twig header vars for local resolution
        $this->grav->fireEvent('onTwigStringVariables');
        $vars += $this->twig_vars;

        $name = '@Var:' . $string;
        $this->setTemplate($name, $string);

        try {
            $output = $this->twig->render($name, $vars);
        } catch (\Twig_Error_Loader $e) {
            throw new \RuntimeException($e->getRawMessage(), 404, $e);
        }

        return $output;
    }

    /**
     * Twig process that renders the site layout. This is the main twig process that renders the overall
     * page and handles all the layout for the site display.
     *
     * @param string $format Output format (defaults to HTML).
     * @return string the rendered output
     * @throws \RuntimeException
     */
    public function processSite($format = null)
    {
        // set the page now its been processed
        $this->grav->fireEvent('onTwigSiteVariables');
        $pages = $this->grav['pages'];
        $page = $this->grav['page'];
        $content = $page->content();
        $config = $this->grav['config'];

        $twig_vars = $this->twig_vars;

        $twig_vars['pages'] = $pages->root();
        $twig_vars['page'] = $page;
        $twig_vars['header'] = $page->header();
        $twig_vars['content'] = $content;
        $ext = '.' . ($format ? $format : 'html') . TWIG_EXT;

        // determine if params are set, if so disable twig cache
        $params = $this->grav['uri']->params(null, true);
        if (!empty($params)) {
            $this->twig->setCache(false);
        }

        // Get Twig template layout
        $template = $this->template($page->template() . $ext);

        try {
            $output = $this->twig->render($template, $twig_vars);
        } catch (\Twig_Error_Loader $e) {
            $error_msg = $e->getMessage();
            // Try html version of this template if initial template was NOT html
            if ($ext != '.html'.TWIG_EXT) {
                try {
                    $output = $this->twig->render($page->template().'.html'.TWIG_EXT, $twig_vars);
                } catch (\Twig_Error_Loader $e) {
                    throw new \RuntimeException($error_msg, 400, $e);
                }
            } else {
                throw new \RuntimeException($error_msg, 400, $e);
            }
        }

        return $output;
    }

    /**
     * Simple helper method to get the twig template if it has already been set, else return
     * the one being passed in
     *
     * @param  string $template the template name
     * @return string           the template name
     */
    public function template($template)
    {
        if (isset($this->template)) {
            return $this->template;
        } else {
            return $template;
        }
    }
}


text:
{{ $interest_form->firstname }} {{ $interest_form->lastname }} is interested
in joining the {{ $interest_form->vision_team ? " Vision " : "" }}
{{ ($interest_form->vision_team && $interest_form->regional_statistician_team) ? " and " : ($interest_form->regional_statistician_team ? "" :  "Team") }}
{{$interest_form->regional_statistician_team ? " Regional Statistician Team " : "" }}

[Interest Form]

{{ $interest_form->firstname }} {{ $interest_form->lastname }}

{{ $interest_form->email }}

{{ $interest_form->phone }}

{{ $interest_form->team->getGlobalRegion()->name }} - {{ $interest_form->team->name }}

- Vision Team


text:
'use strict'

var parseObject = function() {
	var obj = arguments[0];
	var ret = {};
	var keys = arguments[1];
	var filled = false;
	for (var i in keys) {
		var key = keys[i];
		if (obj.hasOwnProperty(key)) {
			ret[key] = obj[key];
			filled = true;
		}
	}
	if (filled)
		return ret;
	return null;
};

var parseArray = function() {
	var ret = [];
	var array = arguments[0];
	var keys = arguments[1];
	for (var i = 0; i < array.length; i++)
	{
		var obj = array[i];
		var val = parseObject(obj, keys);
		if (val != null)
			ret.push(val);
	}
	return ret;
};

Object.prototype.pick = function() {
	if (this instanceof Array)
		return parseArray(this, arguments);
	else
		return parseObject(this, arguments);
};

Object.prototype.into = function(obj) {
	if (obj != null) {
		if ((this instanceof Array) && (obj instanceof Array)) {
			for (var i = 0; i < this.length; i++) {
				obj.push(this[i]);
			}
		}
		else if ((this instanceof Object) && (obj instanceof Object)) {
			for (var key in this) {
				if (this.hasOwnProperty(key)) {
					obj[key] = this[key];
				}
			}
		}
	}
	return obj;
};

Object.prototype.mergeWith = function(array) {
	if (array instanceof Array) {
		for (var i = 0;i < array.length; i++) {
			for (var key in this) {
				if (this.hasOwnProperty(key))
					array[i][key] = this[key];
			}
		}
	}
	return array;
}

Array.prototype.mergeWith = function(array) {
	if (this instanceof Array && array instanceof Array) {
		for (var i = 0; i < array.length; i++) {
			var dest = array[i];
			for (var j = 0; j < this.length; j++) {
				var obj = this[j];
				for (var key in obj) {
					if (obj.hasOwnProperty(key)) {
						dest[key] = obj[key];
					}
				}
			}
			array[i] = dest;
		}
	}
	return array;
}


text:
<?php

namespace Google\Service\CloudBuild;

class CreateGitHubEnterpriseConfigOperationMetadata extends \Google\Model
{
  /**
   * @var string
   */
  public $completeTime;
  /**
   * @var string
   */
  public $createTime;
  /**
   * @var string
   */
  public $githubEnterpriseConfig;

  /**
   * @param string
   */
  public function setCompleteTime($completeTime)
  {
    $this->completeTime = $completeTime;
  }
  /**
   * @return string
   */
  public function getCompleteTime()
  {
    return $this->completeTime;
  }
  /**
   * @param string
   */
  public function setCreateTime($createTime)
  {
    $this->createTime = $createTime;
  }
  /**
   * @return string
   */
  public function getCreateTime()
  {
    return $this->createTime;
  }
  /**
   * @param string
   */
  public function setGithubEnterpriseConfig($githubEnterpriseConfig)
  {
    $this->githubEnterpriseConfig = $githubEnterpriseConfig;
  }
  /**
   * @return string
   */
  public function getGithubEnterpriseConfig()
  {
    return $this->githubEnterpriseConfig;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(CreateGitHubEnterpriseConfigOperationMetadata::class, 'Google_Service_CloudBuild_CreateGitHubEnterpriseConfigOperationMetadata');


text:
/*!  \file kfbxgeometrybase.h
 */

#ifndef FBXFILESDK_KFBXPLUGINS_KFBXGEOMETRYBASE_H
#define FBXFILESDK_KFBXPLUGINS_KFBXGEOMETRYBASE_H

/**************************************************************************************

 Copyright © 2001 - 2008 Autodesk, Inc. and/or its licensors.
 All Rights Reserved.

 The coded instructions, statements, computer programs, and/or related material
 (collectively the "Data") in these files contain unpublished information
 proprietary to Autodesk, Inc. and/or its licensors, which is protected by
 Canada and United States of America federal copyright law and by international
 treaties.

 The Data may not be disclosed or distributed to third parties, in whole or in
 part, without the prior written consent of Autodesk, Inc. ("Autodesk").

 THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
 ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
 WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
 BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE,
 NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE.
 WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
 OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE.

 IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
 OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
 OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
 SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
 OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
 HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
 FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
 ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
 WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
 OR DAMAGE.

**************************************************************************************/

#include <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
#include <fbxfilesdk/components/kbaselib/kaydara.h>

#include <fbxfilesdk/components/kbaselib/klib/karrayul.h>

#include <fbxfilesdk/kfbxmath/kfbxvector4.h>

#include <fbxfilesdk/kfbxplugins/kfbxlayercontainer.h>

#include <fbxfilesdk/fbxfilesdk_nsbegin.h>

class KFbxSdkManager;

/** \brief This class is the base class for managing control points.
  * Use the KFbxGeometryBase class to manage control points for mesh, nurbs, patches and normals (on Layer 0).
  * \nosubgrouping
  */
class KFBX_DLL KFbxGeometryBase : public KFbxLayerContainer
{
    KFBXOBJECT_DECLARE(KFbxGeometryBase,KFbxLayerContainer);
public:

    /**
      * \name Control Points and Normals Management.
      */
    //@{

    /** Allocate memory space for the array of control points.
      * \param pCount     The number of control points.
      * \remarks          Any previously allocated array of control points will be cleared.
      */
    virtual void InitControlPoints(int pCount);

    /** Allocate memory space for the array of normals.
      * \param pCount     The desired size for the normal array. If pCount is specified, the array will have the same size as pCount.
      *                   If pCount is not specified, the array will be the same length as the array of control points.
      * \remarks          This function must be called after function KFbxLayerContainer::InitControlPoints().
      * \remarks          The normals initialized with this function will have the ReferenceMode set to eDIRECT.
      */
    void InitNormals(int pCount = 0 );

    /** Allocate memory space for the array of normals cloning them from the pSrc.
      * \param pSrc       The source geometry from wich we will clone the normals information (on Layer 0).
      * \remarks          This function must be called with the argument otherwise it will do nothing.
      */
    void InitNormals(KFbxGeometryBase* pSrc);

    /** Sets the control point and the normal values for a given index.
      * \param pCtrlPoint     The value of the control point.
      * \param pNormal        The value of the normal.
      * \param pIndex         The index of the control point/normal to be modified.
      * \param pI2DSearch     When true AND the normals array reference mode is eINDEX_TO_DIRECT, search pNormal in the
      *                       existing array to avoid inserting it if it already exist. NOTE: this feature uses a linear
      *                       search algorithm, therefore it can be time consuming if the DIRECT array of normals contains
      *                       a huge number of elements.
      * \remarks              If the arrays are not big enough to store the values at the given index, their size will be increased.
      */
    virtual void SetControlPointAt(KFbxVector4 &pCtrlPoint , KFbxVector4 &pNormal , int pIndex, bool pI2DSearch = false);

    /** Sets the control point for a given index.
    * \param pCtrlPoint     The value of the control point.
    * \param pIndex         The index of the control point/normal to be modified.
    *
    * \remarks              If the arrays are not big enough to store the values at the given index, their size will be increased.
    */
    virtual void SetControlPointAt(KFbxVector4 &pCtrlPoint , int pIndex);

    /** Sets the the normal values for a given index.
    * \param pNormal        The value of the normal.
    * \param pIndex         The index of the control point/normal to be modified.
    * \param pI2DSearch     When true AND the normals array reference mode is eINDEX_TO_DIRECT, search pNormal in the
    *                       existing array to avoid inserting it if it already exist. NOTE: this feature uses a linear
    *                       search algorithm, therefore it can be time consuming if the DIRECT array of normals contains
    *                       a huge number of elements.
    * \remarks              If the arrays are not big enough to store the values at the given index, their size will be increased.
    */
    virtual void SetControlPointNormalAt(KFbxVector4 &pNormal, int pIndex, bool pI2DSearch=false);

    /** Get the number of control points.
      * \return     The number of control points allocated in the geometry.
      */
    virtual int GetControlPointsCount() const;

    /** Get a pointer to the array of control points.
      * \return      Pointer to the array of control points, or \c NULL if the array has not been allocated.
      * \remarks     Use the function KFbxGeometryBase::InitControlPoints() to allocate the array.
      */
    virtual KFbxVector4* GetControlPoints() const;

	virtual void SetControlPointCount(int pCount);

    /** Get a pointer to the array of normals.
      * \return      Pointer to array of normals, or \c NULL if the array hasn't been allocated yet.
      * \remarks     Use the function KFbxGeometryBase::InitNormals() to allocate the array.
      * \remarks     This method should not be called anymore since it will not put a lock to internal
      *              array. Use the other flavor instead.
      */
    K_DEPRECATED KFbxVector4* GetNormals() const;
    //@}

    /**
      * \name Public and fast access Properties
      */
    //@{
        KFbxTypedProperty<fbxDouble3>               BBoxMin;
        KFbxTypedProperty<fbxDouble3>               BBoxMax;

        /** Compute the Bounding box of the ControlPoints.
          */
        void ComputeBBox();
    //@}

    /**
      * \name Off-loading Serialization section
      */
    //@{
        virtual bool ContentWriteTo(KFbxStream& pStream) const;
        virtual bool ContentReadFrom(const KFbxStream& pStream);
    //@}

        virtual int MemoryUsage() const;

///////////////////////////////////////////////////////////////////////////////
//
//  WARNING!
//
//  Anything beyond these lines may not be documented accurately and is
//  subject to change without notice.
//
///////////////////////////////////////////////////////////////////////////////

#ifndef DOXYGEN_SHOULD_SKIP_THIS

    bool GetNormals(KFbxLayerElementArrayTemplate<KFbxVector4>** pLockableArray) const;
    bool GetNormalsIndices(KFbxLayerElementArrayTemplate<int>** pLockableArray) const;

protected:
    KFbxGeometryBase(KFbxSdkManager& pManager, char const* pName);
    virtual ~KFbxGeometryBase();

    KFbxGeometryBase& operator=(KFbxGeometryBase const& pGeometryBase);
    virtual bool ConstructProperties(bool pForceSet);
    virtual void ContentClear();

public:
    KArrayTemplate<KFbxVector4> mControlPoints;

protected:
    friend class KFbxGeometryConverter;
#endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS

};

#include <fbxfilesdk/fbxfilesdk_nsend.h>

#endif // FBXFILESDK_KFBXPLUGINS_KFBXGEOMETRYBASE_H


text:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding model 'LocationAutoComplete'
        db.create_table(u'survey_locationautocomplete', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('location', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['locations.Location'], null=True)),
            ('text', self.gf('django.db.models.fields.CharField')(max_length=500)),
        ))
        db.send_create_signal(u'survey', ['LocationAutoComplete'])

    def backwards(self, orm):
        # Deleting model 'LocationAutoComplete'
        db.delete_table(u'survey_locationautocomplete')

    models = {
        u'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        u'locations.location': {
            'Meta': {'object_name': 'Location'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
            'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'parent_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'parent_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']", 'null': 'True', 'blank': 'True'}),
            'point': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['locations.Point']", 'null': 'True', 'blank': 'True'}),
            'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
            'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
            'tree_parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': u"orm['locations.Location']"}),
            'type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'locations'", 'null': 'True', 'to': u"orm['locations.LocationType']"})
        },
        u'locations.locationtype': {
            'Meta': {'object_name': 'LocationType'},
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'primary_key': 'True'})
        },
        u'locations.point': {
            'Meta': {'object_name': 'Point'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'latitude': ('django.db.models.fields.DecimalField', [], {'max_digits': '13', 'decimal_places': '10'}),
            'longitude': ('django.db.models.fields.DecimalField', [], {'max_digits': '13', 'decimal_places': '10'})
        },
        'survey.investigator': {
            'Meta': {'object_name': 'Investigator'},
            'age': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '2', 'null': 'True'}),
            'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'level_of_education': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
            'location': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['locations.Location']", 'null': 'True'}),
            'male': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'mobile_number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
            'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        u'survey.locationautocomplete': {
            'Meta': {'object_name': 'LocationAutoComplete'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'location': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['locations.Location']", 'null': 'True'}),
            'text': ('django.db.models.fields.CharField', [], {'max_length': '500'})
        }
    }

    complete_apps = ['survey']


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace iMotto.Adapter.Readers.Requests
{
    class ReadMottoReviewsRequest : PagedHandleRequest
    {
        public long MID { get; set; }
    }
}


text:
namespace grpc_event_engine {
namespace experimental {

// Register fork handlers with the system, enabling fork support.
//
// This provides pthread-based support for fork events. Any objects that
// implement Forkable can register themselves with this system using
// ManageForkable, and their respective methods will be called upon fork.
//
// This should be called once upon grpc_initialization.
void RegisterForkHandlers();

// Global callback for pthread_atfork's *prepare argument
void PrepareFork();
// Global callback for pthread_atfork's *parent argument
void PostforkParent();
// Global callback for pthread_atfork's *child argument
void PostforkChild();

// An interface to be implemented by EventEngines that wish to have managed fork
// support.
class Forkable {
 public:
  Forkable();
  virtual ~Forkable();
  virtual void PrepareFork() = 0;
  virtual void PostforkParent() = 0;
  virtual void PostforkChild() = 0;
};

// Add Forkables from the set of objects that are supported.
// Upon fork, each forkable will have its respective fork hooks called on
// the thread that invoked the fork.
//
// Relative ordering of fork callback operations is not guaranteed.
void ManageForkable(Forkable* forkable);
// Remove a forkable from the managed set.
void StopManagingForkable(Forkable* forkable);

}  // namespace experimental
}  // namespace grpc_event_engine

#endif  // GRPC_CORE_LIB_EVENT_ENGINE_FORKABLE_H