##############################################################################
#
#	Copyright (c) GeoWorks 1992 -- All Rights Reserved
#
# PROJECT:	PC/GEOS
# MODULE:	SndPlay (Sample PC/GEOS application)
# FILE:		sndplay.gp
#
# AUTHOR:	Eric E. Del Sesto, 11/90
#
# DESCRIPTION:	This file contains Geode definitions for the "Sound Player"
#		sample application. This file is read by the GLUE linker to
#		build this application.
#
# RCS STAMP:
#	$Id: sndplay.gp,v 1.1 97/04/04 16:34:44 newdeal Exp $
#
##############################################################################
#
# Permanent name: is required by Glue to set the permanent name and extension
# of the geode. The permanent name of a library is what goes in the imported
# library table of a geode (along with the protocol number). It is also
# what Swat uses to name the patient.
#
name sndplay.app
#
# Long filename: this name can displayed by geoManager, and is used to identify
# the application for inter-application communication.
#
longname "Sound Player"
#
# Specify geode type: is an application, will have its own process (thread),
# and is multi-launchable.
#
type	appl, process
#
# Specify class name for application process. Methods sent to the Application's
# process will be handled by the SndPlayProcessClass, which is defined
# in sndplay.asm.
#
class	SndPlayGenProcessClass
#
# Specify application object. This is the object in the .ui file which serves
# as the top-level UI object in the application. See item.ui.
#
appobj	SndPlayApp
#
#Token: this four-letter name is used by geoManager to locate the icon for this
# application in the database.
#
tokenchars "SNPL"
tokenid 0
#
# Libraries: list which libraries are used by the application.
#
library	geos
library	ui
#
# Code Resources: these are all read-only and sharable by multiple instances
# of this application. The InitCode resource is marked as discard-only,
# so that it will be discarded rather than swapped to XMS/EMS memory.
#
resource InitCode	code read-only shared discard-only
resource CommonCode	code read-only shared
#
# Resources: list all resource blocks which are used by the application.
# (standard discardable code resources do not need to be mentioned).
#
resource AppResource ui-object
resource Interface ui-object

{'repo_name': 'bluewaysw/pcgeos', 'stars': '316', 'repo_language': 'Assembly', 'file_name': 'marble.goh', 'mime_type': 'text/plain', 'hash': -1713360945723050087, 'source_dataset': 'data'}


<?php

namespace WP2Static;

use vipnytt\SitemapParser;
use vipnytt\SitemapParser\Exceptions\SitemapParserException;

class DetectSitemapsURLs {

    /**
     * Detect Authors URLs
     *
     * @return string[] list of URLs
     * @throws WP2StaticException
     */
    public static function detect( string $wp_site_url ) : array {

        $sitemaps_urls = [];
        $parser = new SitemapParser( 'WP2Static.com', [ 'strict' => false ] );
        $request = new Request();
        $response = $request->getResponseCode( $wp_site_url . 'robots.txt' );
        $robots_exits = $response === 200 ? true : false;

        try {
            $sitemaps = [];

            // if robots exits we parse looking for sitemaps
            if ( $robots_exits === true ) {
                $parser->parseRecursive( $wp_site_url . 'robots.txt' );
                $sitemaps = $parser->getSitemaps();
            }

            // if no sitemaps I'm adding knowing sitemaps
            if ( count( $sitemaps ) === 0 ) {
                $sitemaps = [
                    $wp_site_url . 'sitemap.xml', // normal sitemap
                    $wp_site_url . 'sitemap_index.xml', // yoast sitemap
                    $wp_site_url . 'wp_sitemap.xml', // wp 5.5 sitemap
                ];
            }

            foreach ( $sitemaps as $sitemap ) {
                $response = $request->getResponseCode( $sitemap );
                if ( $response === 200 ) {
                    $parser->parse( $sitemap );

                    $sitemaps_urls [] = '/' . str_replace(
                        $wp_site_url,
                        '',
                        $sitemap
                    );

                    $extract_sitemaps = $parser->getSitemaps();

                    foreach ( $extract_sitemaps as $url => $tags ) {
                        $sitemap_url = str_replace(
                            $wp_site_url,
                            '',
                            $url
                        );

                        $sitemaps_urls [] = '/' . $sitemap_url;
                    }
                }
            }
        } catch ( SitemapParserException $e ) {
            WsLog::l(
                $e->getMessage()
            );
            throw new WP2StaticException( $e->getMessage(), 0, $e );
        }

        return $sitemaps_urls;
    }
}

{'repo_name': 'WP2Static/wp2static', 'stars': '672', 'repo_language': 'PHP', 'file_name': 'deploy-cache-page.php', 'mime_type': 'text/html', 'hash': -7974741779805681129, 'source_dataset': 'data'}


/*
 *
 * Copyright (c) 2004
 * John Maddock
 *
 * Use, modification and distribution are subject to the
 * Boost Software License, Version 1.0. (See accompanying file
 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 *
 */

 /*
  *   LOCATION:    see http://www.boost.org for most recent version.
  *   FILE         regex_traits_defaults.hpp
  *   VERSION      see <boost/version.hpp>
  *   DESCRIPTION: Declares API's for access to regex_traits default properties.
  */

#ifndef BOOST_REGEX_TRAITS_DEFAULTS_HPP_INCLUDED
#define BOOST_REGEX_TRAITS_DEFAULTS_HPP_INCLUDED

#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable: 4103)
#endif
#ifdef BOOST_HAS_ABI_HEADERS
#  include BOOST_ABI_PREFIX
#endif
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif

#ifndef BOOST_REGEX_SYNTAX_TYPE_HPP
#include <boost/regex/v4/syntax_type.hpp>
#endif
#ifndef BOOST_REGEX_ERROR_TYPE_HPP
#include <boost/regex/v4/error_type.hpp>
#endif

#ifdef BOOST_NO_STDC_NAMESPACE
namespace std{
   using ::strlen;
}
#endif

namespace boost{ namespace re_detail{

//
// helpers to suppress warnings:
//
template <class charT>
inline bool is_extended(charT c)
{ return c > 256; }
inline bool is_extended(char)
{ return false; }

BOOST_REGEX_DECL const char* BOOST_REGEX_CALL get_default_syntax(regex_constants::syntax_type n);
BOOST_REGEX_DECL const char* BOOST_REGEX_CALL get_default_error_string(regex_constants::error_type n);
BOOST_REGEX_DECL regex_constants::syntax_type BOOST_REGEX_CALL get_default_syntax_type(char c);
BOOST_REGEX_DECL regex_constants::escape_syntax_type BOOST_REGEX_CALL get_default_escape_syntax_type(char c);

// is charT c a combining character?
BOOST_REGEX_DECL bool BOOST_REGEX_CALL is_combining_implementation(uint_least16_t s);

template <class charT>
inline bool is_combining(charT c)
{
   return (c <= static_cast<charT>(0)) ? false : ((c >= static_cast<charT>((std::numeric_limits<uint_least16_t>::max)())) ? false : is_combining_implementation(static_cast<unsigned short>(c)));
}
template <>
inline bool is_combining<char>(char)
{
   return false;
}
template <>
inline bool is_combining<signed char>(signed char)
{
   return false;
}
template <>
inline bool is_combining<unsigned char>(unsigned char)
{
   return false;
}
#if !defined(__hpux) && !defined(__WINSCW__) // can't use WCHAR_MAX/MIN in pp-directives
#ifdef _MSC_VER
template<>
inline bool is_combining<wchar_t>(wchar_t c)
{
   return is_combining_implementation(static_cast<unsigned short>(c));
}
#elif !defined(__DECCXX) && !defined(__osf__) && !defined(__OSF__) && defined(WCHAR_MIN) && (WCHAR_MIN == 0) && !defined(BOOST_NO_INTRINSIC_WCHAR_T)
#if defined(WCHAR_MAX) && (WCHAR_MAX <= USHRT_MAX)
template<>
inline bool is_combining<wchar_t>(wchar_t c)
{
   return is_combining_implementation(static_cast<unsigned short>(c));
}
#else
template<>
inline bool is_combining<wchar_t>(wchar_t c)
{
   return (c >= (std::numeric_limits<uint_least16_t>::max)()) ? false : is_combining_implementation(static_cast<unsigned short>(c));
}
#endif
#endif
#endif

//
// is a charT c a line separator?
//
template <class charT>
inline bool is_separator(charT c)
{
   return BOOST_REGEX_MAKE_BOOL(
      (c == static_cast<charT>('\n'))
      || (c == static_cast<charT>('\r'))
      || (c == static_cast<charT>('\f'))
      || (static_cast<boost::uint16_t>(c) == 0x2028u)
      || (static_cast<boost::uint16_t>(c) == 0x2029u)
      || (static_cast<boost::uint16_t>(c) == 0x85u));
}
template <>
inline bool is_separator<char>(char c)
{
   return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r') || (c == '\f'));
}

//
// get a default collating element:
//
BOOST_REGEX_DECL std::string BOOST_REGEX_CALL lookup_default_collate_name(const std::string& name);

//
// get the state_id of a character clasification, the individual
// traits classes then transform that state_id into a bitmask:
//
template <class charT>
struct character_pointer_range
{
   const charT* p1;
   const charT* p2;

   bool operator < (const character_pointer_range& r)const
   {
      return std::lexicographical_compare(p1, p2, r.p1, r.p2);
   }
   bool operator == (const character_pointer_range& r)const
   {
      // Not only do we check that the ranges are of equal size before
      // calling std::equal, but there is no other algorithm available:
      // not even a non-standard MS one.  So forward to unchecked_equal
      // in the MS case.
      return ((p2 - p1) == (r.p2 - r.p1)) && re_detail::equal(p1, p2, r.p1);
   }
};
template <class charT>
int get_default_class_id(const charT* p1, const charT* p2)
{
   static const charT data[73] = {
      'a', 'l', 'n', 'u', 'm',
      'a', 'l', 'p', 'h', 'a',
      'b', 'l', 'a', 'n', 'k',
      'c', 'n', 't', 'r', 'l',
      'd', 'i', 'g', 'i', 't',
      'g', 'r', 'a', 'p', 'h',
      'l', 'o', 'w', 'e', 'r',
      'p', 'r', 'i', 'n', 't',
      'p', 'u', 'n', 'c', 't',
      's', 'p', 'a', 'c', 'e',
      'u', 'n', 'i', 'c', 'o', 'd', 'e',
      'u', 'p', 'p', 'e', 'r',
      'v',
      'w', 'o', 'r', 'd',
      'x', 'd', 'i', 'g', 'i', 't',
   };

   static const character_pointer_range<charT> ranges[21] =
   {
      {data+0, data+5,}, // alnum
      {data+5, data+10,}, // alpha
      {data+10, data+15,}, // blank
      {data+15, data+20,}, // cntrl
      {data+20, data+21,}, // d
      {data+20, data+25,}, // digit
      {data+25, data+30,}, // graph
      {data+29, data+30,}, // h
      {data+30, data+31,}, // l
      {data+30, data+35,}, // lower
      {data+35, data+40,}, // print
      {data+40, data+45,}, // punct
      {data+45, data+46,}, // s
      {data+45, data+50,}, // space
      {data+57, data+58,}, // u
      {data+50, data+57,}, // unicode
      {data+57, data+62,}, // upper
      {data+62, data+63,}, // v
      {data+63, data+64,}, // w
      {data+63, data+67,}, // word
      {data+67, data+73,}, // xdigit
   };
   static const character_pointer_range<charT>* ranges_begin = ranges;
   static const character_pointer_range<charT>* ranges_end = ranges + (sizeof(ranges)/sizeof(ranges[0]));

   character_pointer_range<charT> t = { p1, p2, };
   const character_pointer_range<charT>* p = std::lower_bound(ranges_begin, ranges_end, t);
   if((p != ranges_end) && (t == *p))
      return static_cast<int>(p - ranges);
   return -1;
}

//
// helper functions:
//
template <class charT>
std::ptrdiff_t global_length(const charT* p)
{
   std::ptrdiff_t n = 0;
   while(*p)
   {
      ++p;
      ++n;
   }
   return n;
}
template<>
inline std::ptrdiff_t global_length<char>(const char* p)
{
   return (std::strlen)(p);
}
#ifndef BOOST_NO_WREGEX
template<>
inline std::ptrdiff_t global_length<wchar_t>(const wchar_t* p)
{
   return (std::wcslen)(p);
}
#endif
template <class charT>
inline charT BOOST_REGEX_CALL global_lower(charT c)
{
   return c;
}
template <class charT>
inline charT BOOST_REGEX_CALL global_upper(charT c)
{
   return c;
}

BOOST_REGEX_DECL char BOOST_REGEX_CALL do_global_lower(char c);
BOOST_REGEX_DECL char BOOST_REGEX_CALL do_global_upper(char c);
#ifndef BOOST_NO_WREGEX
BOOST_REGEX_DECL wchar_t BOOST_REGEX_CALL do_global_lower(wchar_t c);
BOOST_REGEX_DECL wchar_t BOOST_REGEX_CALL do_global_upper(wchar_t c);
#endif
#ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T
BOOST_REGEX_DECL unsigned short BOOST_REGEX_CALL do_global_lower(unsigned short c);
BOOST_REGEX_DECL unsigned short BOOST_REGEX_CALL do_global_upper(unsigned short c);
#endif
//
// This sucks: declare template specialisations of global_lower/global_upper
// that just forward to the non-template implementation functions.  We do
// this because there is one compiler (Compaq Tru64 C++) that doesn't seem
// to differentiate between templates and non-template overloads....
// what's more, the primary template, plus all overloads have to be
// defined in the same translation unit (if one is inline they all must be)
// otherwise the "local template instantiation" compiler option can pick
// the wrong instantiation when linking:
//
template<> inline char BOOST_REGEX_CALL global_lower<char>(char c){ return do_global_lower(c); }
template<> inline char BOOST_REGEX_CALL global_upper<char>(char c){ return do_global_upper(c); }
#ifndef BOOST_NO_WREGEX
template<> inline wchar_t BOOST_REGEX_CALL global_lower<wchar_t>(wchar_t c){ return do_global_lower(c); }
template<> inline wchar_t BOOST_REGEX_CALL global_upper<wchar_t>(wchar_t c){ return do_global_upper(c); }
#endif
#ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T
template<> inline unsigned short BOOST_REGEX_CALL global_lower<unsigned short>(unsigned short c){ return do_global_lower(c); }
template<> inline unsigned short BOOST_REGEX_CALL global_upper<unsigned short>(unsigned short c){ return do_global_upper(c); }
#endif

template <class charT>
int global_value(charT c)
{
   static const charT zero = '0';
   static const charT nine = '9';
   static const charT a = 'a';
   static const charT f = 'f';
   static const charT A = 'A';
   static const charT F = 'F';

   if(c > f) return -1;
   if(c >= a) return 10 + (c - a);
   if(c > F) return -1;
   if(c >= A) return 10 + (c - A);
   if(c > nine) return -1;
   if(c >= zero) return c - zero;
   return -1;
}
template <class charT, class traits>
int global_toi(const charT*& p1, const charT* p2, int radix, const traits& t)
{
   (void)t; // warning suppression
   int next_value = t.value(*p1, radix);
   if((p1 == p2) || (next_value < 0) || (next_value >= radix))
      return -1;
   int result = 0;
   while(p1 != p2)
   {
      next_value = t.value(*p1, radix);
      if((next_value < 0) || (next_value >= radix))
         break;
      result *= radix;
      result += next_value;
      ++p1;
   }
   return result;
}

template <class charT>
inline const charT* get_escape_R_string()
{
#ifdef BOOST_MSVC
#  pragma warning(push)
#  pragma warning(disable:4309 4245)
#endif
   static const charT e1[] = { '(', '?', '>', '\x0D', '\x0A', '?',
      '|', '[', '\x0A', '\x0B', '\x0C', '\x85', '\\', 'x', '{', '2', '0', '2', '8', '}',
                '\\', 'x', '{', '2', '0', '2', '9', '}', ']', ')', '\0' };
   static const charT e2[] = { '(', '?', '>', '\x0D', '\x0A', '?',
      '|', '[', '\x0A', '\x0B', '\x0C', '\x85', ']', ')', '\0' };

   charT c = static_cast<charT>(0x2029u);
   bool b = (static_cast<unsigned>(c) == 0x2029u);

   return (b ? e1 : e2);
#ifdef BOOST_MSVC
#  pragma warning(pop)
#endif
}

template <>
inline const char* get_escape_R_string<char>()
{
#ifdef BOOST_MSVC
#  pragma warning(push)
#  pragma warning(disable:4309)
#endif
   static const char e2[] = { '(', '?', '>', '\x0D', '\x0A', '?',
      '|', '[', '\x0A', '\x0B', '\x0C', '\x85', ']', ')', '\0' };
   return e2;
#ifdef BOOST_MSVC
#  pragma warning(pop)
#endif
}

} // re_detail
} // boost

#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable: 4103)
#endif
#ifdef BOOST_HAS_ABI_HEADERS
#  include BOOST_ABI_SUFFIX
#endif
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif

#endif

{'repo_name': 'sdhash/sdhash', 'stars': '105', 'repo_language': 'C++', 'file_name': 'lcs.c', 'mime_type': 'text/x-c', 'hash': 1941271293004198757, 'source_dataset': 'data'}


services:

    #
    # Resolvers
    #
    controller_extra.resolver.form_annotation:
        class: Mmoreram\ControllerExtraBundle\Resolver\FormAnnotationResolver
        arguments:
            - "@form.registry"
            - "@form.factory"
            - "%controller_extra.form_default_name%"
        tags:
            - { name: controller_extra.annotation_resolver }

{'repo_name': 'mmoreram/ControllerExtraBundle', 'stars': '158', 'repo_language': 'PHP', 'file_name': 'EntityAnnotationResolverTest.php', 'mime_type': 'text/x-php', 'hash': 1189557228009841665, 'source_dataset': 'data'}


// Copyright 2016 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package prometheus

import (
	"errors"
	"fmt"
	"sort"
	"strings"

	"github.com/golang/protobuf/proto"
	"github.com/prometheus/common/model"

	dto "github.com/prometheus/client_model/go"
)

// Desc is the descriptor used by every Prometheus Metric. It is essentially
// the immutable meta-data of a Metric. The normal Metric implementations
// included in this package manage their Desc under the hood. Users only have to
// deal with Desc if they use advanced features like the ExpvarCollector or
// custom Collectors and Metrics.
//
// Descriptors registered with the same registry have to fulfill certain
// consistency and uniqueness criteria if they share the same fully-qualified
// name: They must have the same help string and the same label names (aka label
// dimensions) in each, constLabels and variableLabels, but they must differ in
// the values of the constLabels.
//
// Descriptors that share the same fully-qualified names and the same label
// values of their constLabels are considered equal.
//
// Use NewDesc to create new Desc instances.
type Desc struct {
	// fqName has been built from Namespace, Subsystem, and Name.
	fqName string
	// help provides some helpful information about this metric.
	help string
	// constLabelPairs contains precalculated DTO label pairs based on
	// the constant labels.
	constLabelPairs []*dto.LabelPair
	// VariableLabels contains names of labels for which the metric
	// maintains variable values.
	variableLabels []string
	// id is a hash of the values of the ConstLabels and fqName. This
	// must be unique among all registered descriptors and can therefore be
	// used as an identifier of the descriptor.
	id uint64
	// dimHash is a hash of the label names (preset and variable) and the
	// Help string. Each Desc with the same fqName must have the same
	// dimHash.
	dimHash uint64
	// err is an error that occurred during construction. It is reported on
	// registration time.
	err error
}

// NewDesc allocates and initializes a new Desc. Errors are recorded in the Desc
// and will be reported on registration time. variableLabels and constLabels can
// be nil if no such labels should be set. fqName must not be empty.
//
// variableLabels only contain the label names. Their label values are variable
// and therefore not part of the Desc. (They are managed within the Metric.)
//
// For constLabels, the label values are constant. Therefore, they are fully
// specified in the Desc. See the Collector example for a usage pattern.
func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) *Desc {
	d := &Desc{
		fqName:         fqName,
		help:           help,
		variableLabels: variableLabels,
	}
	if !model.IsValidMetricName(model.LabelValue(fqName)) {
		d.err = fmt.Errorf("%q is not a valid metric name", fqName)
		return d
	}
	// labelValues contains the label values of const labels (in order of
	// their sorted label names) plus the fqName (at position 0).
	labelValues := make([]string, 1, len(constLabels)+1)
	labelValues[0] = fqName
	labelNames := make([]string, 0, len(constLabels)+len(variableLabels))
	labelNameSet := map[string]struct{}{}
	// First add only the const label names and sort them...
	for labelName := range constLabels {
		if !checkLabelName(labelName) {
			d.err = fmt.Errorf("%q is not a valid label name for metric %q", labelName, fqName)
			return d
		}
		labelNames = append(labelNames, labelName)
		labelNameSet[labelName] = struct{}{}
	}
	sort.Strings(labelNames)
	// ... so that we can now add const label values in the order of their names.
	for _, labelName := range labelNames {
		labelValues = append(labelValues, constLabels[labelName])
	}
	// Validate the const label values. They can't have a wrong cardinality, so
	// use in len(labelValues) as expectedNumberOfValues.
	if err := validateLabelValues(labelValues, len(labelValues)); err != nil {
		d.err = err
		return d
	}
	// Now add the variable label names, but prefix them with something that
	// cannot be in a regular label name. That prevents matching the label
	// dimension with a different mix between preset and variable labels.
	for _, labelName := range variableLabels {
		if !checkLabelName(labelName) {
			d.err = fmt.Errorf("%q is not a valid label name for metric %q", labelName, fqName)
			return d
		}
		labelNames = append(labelNames, "$"+labelName)
		labelNameSet[labelName] = struct{}{}
	}
	if len(labelNames) != len(labelNameSet) {
		d.err = errors.New("duplicate label names")
		return d
	}

	vh := hashNew()
	for _, val := range labelValues {
		vh = hashAdd(vh, val)
		vh = hashAddByte(vh, separatorByte)
	}
	d.id = vh
	// Sort labelNames so that order doesn't matter for the hash.
	sort.Strings(labelNames)
	// Now hash together (in this order) the help string and the sorted
	// label names.
	lh := hashNew()
	lh = hashAdd(lh, help)
	lh = hashAddByte(lh, separatorByte)
	for _, labelName := range labelNames {
		lh = hashAdd(lh, labelName)
		lh = hashAddByte(lh, separatorByte)
	}
	d.dimHash = lh

	d.constLabelPairs = make([]*dto.LabelPair, 0, len(constLabels))
	for n, v := range constLabels {
		d.constLabelPairs = append(d.constLabelPairs, &dto.LabelPair{
			Name:  proto.String(n),
			Value: proto.String(v),
		})
	}
	sort.Sort(labelPairSorter(d.constLabelPairs))
	return d
}

// NewInvalidDesc returns an invalid descriptor, i.e. a descriptor with the
// provided error set. If a collector returning such a descriptor is registered,
// registration will fail with the provided error. NewInvalidDesc can be used by
// a Collector to signal inability to describe itself.
func NewInvalidDesc(err error) *Desc {
	return &Desc{
		err: err,
	}
}

func (d *Desc) String() string {
	lpStrings := make([]string, 0, len(d.constLabelPairs))
	for _, lp := range d.constLabelPairs {
		lpStrings = append(
			lpStrings,
			fmt.Sprintf("%s=%q", lp.GetName(), lp.GetValue()),
		)
	}
	return fmt.Sprintf(
		"Desc{fqName: %q, help: %q, constLabels: {%s}, variableLabels: %v}",
		d.fqName,
		d.help,
		strings.Join(lpStrings, ","),
		d.variableLabels,
	)
}

{'repo_name': 'topolvm/topolvm', 'stars': '112', 'repo_language': 'Go', 'file_name': 'csi.pb.go', 'mime_type': 'text/plain', 'hash': 5931698633269106648, 'source_dataset': 'data'}


use Mix.Config

config :ex_money,
  saltedge_client_id: "your client id",
  saltedge_service_secret: "your service secret"

config :ex_money, ExMoney.Repo,
  username: "postgres",
  password: "",
  database: "ex_money_dev",
  hostname: "localhost"

{'repo_name': 'gaynetdinov/ex_money', 'stars': '142', 'repo_language': 'JavaScript', 'file_name': 'layout_view_test.exs', 'mime_type': 'text/plain', 'hash': 322940331902429289, 'source_dataset': 'data'}


BODY
{
	BACKGROUND-COLOR: white;
	FONT-FAMILY: "Verdana", sans-serif;
	FONT-SIZE: 100%;
	MARGIN-LEFT: 0px;
	MARGIN-TOP: 0px
}
P
{
	FONT-FAMILY: "Verdana", sans-serif;
	FONT-SIZE: 70%;
	LINE-HEIGHT: 12pt;
	MARGIN-BOTTOM: 0px;
	MARGIN-LEFT: 10px;
	MARGIN-TOP: 10px
}
.note
{
	BACKGROUND-COLOR:  #ffffff;
	COLOR: #336699;
	FONT-FAMILY: "Verdana", sans-serif;
	FONT-SIZE: 100%;
	MARGIN-BOTTOM: 0px;
	MARGIN-LEFT: 0px;
	MARGIN-TOP: 0px;
	PADDING-RIGHT: 10px
}
.infotable
{
	BACKGROUND-COLOR: #f0f0e0;
	BORDER-BOTTOM: #ffffff 0px solid;
	BORDER-COLLAPSE: collapse;
	BORDER-LEFT: #ffffff 0px solid;
	BORDER-RIGHT: #ffffff 0px solid;
	BORDER-TOP: #ffffff 0px solid;
	FONT-SIZE: 70%;
	MARGIN-LEFT: 10px
}
.issuetable
{
	BACKGROUND-COLOR: #ffffe8;
	BORDER-COLLAPSE: collapse;
	COLOR: #000000;
	FONT-SIZE: 100%;
	MARGIN-BOTTOM: 10px;
	MARGIN-LEFT: 13px;
	MARGIN-TOP: 0px
}
.issuetitle
{
	BACKGROUND-COLOR: #ffffff;
	BORDER-BOTTOM: #dcdcdc 1px solid;
	BORDER-TOP: #dcdcdc 1px;
	COLOR: #003366;
	FONT-WEIGHT: normal
}
.header
{
	BACKGROUND-COLOR: #cecf9c;
	BORDER-BOTTOM: #ffffff 1px solid;
	BORDER-LEFT: #ffffff 1px solid;
	BORDER-RIGHT: #ffffff 1px solid;
	BORDER-TOP: #ffffff 1px solid;
	COLOR: #000000;
	FONT-WEIGHT: bold
}
.issuehdr
{
	BACKGROUND-COLOR: #E0EBF5;
	BORDER-BOTTOM: #dcdcdc 1px solid;
	BORDER-TOP: #dcdcdc 1px solid;
	COLOR: #000000;
	FONT-WEIGHT: normal
}
.issuenone
{
	BACKGROUND-COLOR: #ffffff;
	BORDER-BOTTOM: 0px;
	BORDER-LEFT: 0px;
	BORDER-RIGHT: 0px;
	BORDER-TOP: 0px;
	COLOR: #000000;
	FONT-WEIGHT: normal
}
.content
{
	BACKGROUND-COLOR: #e7e7ce;
	BORDER-BOTTOM: #ffffff 1px solid;
	BORDER-LEFT: #ffffff 1px solid;
	BORDER-RIGHT: #ffffff 1px solid;
	BORDER-TOP: #ffffff 1px solid;
	PADDING-LEFT: 3px
}
.issuecontent
{
	BACKGROUND-COLOR: #ffffff;
	BORDER-BOTTOM: #dcdcdc 1px solid;
	BORDER-TOP: #dcdcdc 1px solid;
	PADDING-LEFT: 3px
}
A:link
{
	COLOR: #cc6633;
	TEXT-DECORATION: underline
}
A:visited
{
	COLOR: #cc6633;
}
A:active
{
	COLOR: #cc6633;
}
A:hover
{
	COLOR: #cc3300;
	TEXT-DECORATION: underline
}
H1
{
	BACKGROUND-COLOR: #003366;
	BORDER-BOTTOM: #336699 6px solid;
	COLOR: #ffffff;
	FONT-SIZE: 130%;
	FONT-WEIGHT: normal;
	MARGIN: 0em 0em 0em -20px;
	PADDING-BOTTOM: 8px;
	PADDING-LEFT: 30px;
	PADDING-TOP: 16px
}
H2
{
	COLOR: #000000;
	FONT-SIZE: 80%;
	FONT-WEIGHT: bold;
	MARGIN-BOTTOM: 3px;
	MARGIN-LEFT: 10px;
	MARGIN-TOP: 20px;
	PADDING-LEFT: 0px
}
H3
{
	COLOR: #000000;
	FONT-SIZE: 80%;
	FONT-WEIGHT: bold;
	MARGIN-BOTTOM: -5px;
	MARGIN-LEFT: 10px;
	MARGIN-TOP: 20px
}
H4
{
	COLOR: #000000;
	FONT-SIZE: 70%;
	FONT-WEIGHT: bold;
	MARGIN-BOTTOM: 0px;
	MARGIN-TOP: 15px;
	PADDING-BOTTOM: 0px
}
UL
{
	COLOR: #000000;
	FONT-SIZE: 70%;
	LIST-STYLE: square;
	MARGIN-BOTTOM: 0pt;
	MARGIN-TOP: 0pt
}
OL
{
	COLOR: #000000;
	FONT-SIZE: 70%;
	LIST-STYLE: square;
	MARGIN-BOTTOM: 0pt;
	MARGIN-TOP: 0pt
}
LI
{
	LIST-STYLE: square;
	MARGIN-LEFT: 0px
}
.expandable
{
	CURSOR: hand
}
.expanded
{
	color: black
}
.collapsed
{
	DISPLAY: none
}
.foot
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #cecf9c 1px solid;
BORDER-TOP: #cecf9c 2px solid
}
.settings
{
MARGIN-LEFT: 25PX;
}
.help
{
TEXT-ALIGN: right;
margin-right: 10px;
}

{'repo_name': 'shiqwang/netfox', 'stars': '226', 'repo_language': 'C++', 'file_name': 'GameService.sln', 'mime_type': 'text/plain', 'hash': 4626190089508236564, 'source_dataset': 'data'}


{
  "title": "WuxiaWorld",
  "url": "https://wuxiaworld.site/",
  "testCases": [
    { //manhwa
      "url": "https://wuxiaworld.site/novel/a-returners-magic-should-be-special-manga12321334/chapter-110",
      "expected": {
        "sync": true,
        "title": "A Returner’s Magic Should be Special",
        "identifier": "a-returners-magic-should-be-special-manga12321334",
        "overviewUrl": "https://wuxiaworld.site/novel/a-returners-magic-should-be-special-manga12321334/",
        "nextEpUrl": "https://wuxiaworld.site/novel/a-returners-magic-should-be-special-manga12321334/chapter-111",
        "episode": 110,
        "uiSelector": false
      }
    },
    { //manhwa
      "url": "https://wuxiaworld.site/novel/a-returners-magic-should-be-special-manga12321334/",
      "expected": {
        "sync": false,
        "title": "A Returner’s Magic Should be Special",
        "identifier": "a-returners-magic-should-be-special-manga12321334",
        "uiSelector": true,
        "epList": {
          "1": "https://wuxiaworld.site/novel/a-returners-magic-should-be-special-manga12321334/chapter-1",
          "108": "https://wuxiaworld.site/novel/a-returners-magic-should-be-special-manga12321334/chapter-108"
        }
      }
    },
    { //novel
      "url": "https://wuxiaworld.site/novel/the-undetectable-strongest-job-rule-breaker/chapter-133",
      "expected": {
        "sync": true,
        "title": "The Undetectable Strongest Job: Rule Breaker",
        "identifier": "the-undetectable-strongest-job-rule-breaker",
        "overviewUrl": "https://wuxiaworld.site/novel/the-undetectable-strongest-job-rule-breaker/",
        "nextEpUrl": "https://wuxiaworld.site/novel/the-undetectable-strongest-job-rule-breaker/chapter-134",
        "episode": 133,
        "uiSelector": false
      }
    },
    { //novel
      "url": "https://wuxiaworld.site/novel/the-undetectable-strongest-job-rule-breaker/",
      "expected": {
        "sync": false,
        "title": "The Undetectable Strongest Job: Rule Breaker",
        "identifier": "the-undetectable-strongest-job-rule-breaker",
        "uiSelector": true,
        "epList": {
          "1": "https://wuxiaworld.site/novel/the-undetectable-strongest-job-rule-breaker/chapter-1",
          "108": "https://wuxiaworld.site/novel/the-undetectable-strongest-job-rule-breaker/chapter-108"
        }
      }
    }
  ]
}

{'repo_name': 'MALSync/MALSync', 'stars': '315', 'repo_language': 'TypeScript', 'file_name': 'settings.json', 'mime_type': 'text/plain', 'hash': 5466948073529878358, 'source_dataset': 'data'}


using System.Collections.Generic;
using YAXLib;

namespace YAXLibTests.SampleClasses
{
    [YAXNotCollection]
    public class CollectionWithExtraPropertiesAttributedAsNotCollection : List<int>
    {
        public string Property1 { get; set; }
        public double Property2 { get; set; }

        public static CollectionWithExtraPropertiesAttributedAsNotCollection GetSampleInstance()
        {
            var instance = new CollectionWithExtraPropertiesAttributedAsNotCollection { Property1 = "Property1", Property2 = 1.234 };

            instance.Add(1);
            instance.Add(2);
            instance.Add(3);
            instance.Add(4);

            return instance;
        }

        public override string ToString()
        {
            return GeneralToStringProvider.GeneralToString(this) +
                string.Format("Property1: {0}, Property2: {1}", Property1, Property2);
        }

    }
}

{'repo_name': 'GoodAI/BrainSimulator', 'stars': '254', 'repo_language': 'C#', 'file_name': 'mathjaxhelper.js', 'mime_type': 'text/plain', 'hash': -1809631888395538388, 'source_dataset': 'data'}


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">

    <xsl:include href="box.xsl" />
    <xsl:include href="default_access_denied.xsl" />

    <xsl:include href="../../base/xsl/edit_categories.xsl" />

</xsl:stylesheet>

{'repo_name': 'boonex/dolphin.pro', 'stars': '118', 'repo_language': 'PHP', 'file_name': 'Compressor.php', 'mime_type': 'text/x-php', 'hash': 4208862327522215043, 'source_dataset': 'data'}


/**
 * External dependencies
 */
import { __, sprintf } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import { createNotice, removeNotice } from 'components/global-notices/state/notices/actions';
import {
	USER_TRACKING_SETTINGS_FETCH,
	USER_TRACKING_SETTINGS_FETCH_FAIL,
	USER_TRACKING_SETTINGS_FETCH_SUCCESS,
	USER_TRACKING_SETTINGS_UPDATE,
	USER_TRACKING_SETTINGS_UPDATE_FAIL,
	USER_TRACKING_SETTINGS_UPDATE_SUCCESS,
} from 'state/action-types';
import restApi from 'rest-api';

export const fetchTrackingSettings = () => {
	return dispatch => {
		dispatch( {
			type: USER_TRACKING_SETTINGS_FETCH,
		} );
		return restApi
			.fetchUserTrackingSettings()
			.then( settings => {
				dispatch( {
					type: USER_TRACKING_SETTINGS_FETCH_SUCCESS,
					settings: settings,
				} );
				return settings;
			} )
			.catch( error => {
				dispatch( {
					type: USER_TRACKING_SETTINGS_FETCH_FAIL,
					error: error,
				} );
			} );
	};
};

export const updateTrackingSettings = newSettings => {
	return dispatch => {
		const messages = {
				progress: __( 'Updating privacy settings…', 'jetpack' ),
				success: __( 'Updated privacy settings.', 'jetpack' ),
				// We try to get a message or an error code if this is an unexpected WP_Error coming from the API.
				// Otherwise we try to show error.name (coming from the custom errors defined in rest-api/index.js and if that's not useful
				// then we try to let Javascript stringify the error object.
				error: error =>
					sprintf(
						/* translators: placeholder is an error message. */
						__( 'Error updating privacy settings. %s', 'jetpack' ),
						error.message || error.code || error.name || error
					),
			},
			updatedSettingsSuccess = () => newSettings;

		dispatch( removeNotice( 'tracking-settings-update' ) );
		dispatch( removeNotice( 'tracking-settings-update-success' ) );

		dispatch( createNotice( 'is-info', messages.progress, { id: 'tracking-settings-update' } ) );

		dispatch( {
			type: USER_TRACKING_SETTINGS_UPDATE,
			updatedSettings: newSettings,
		} );

		return restApi
			.updateUserTrackingSettings( newSettings )
			.then( success => {
				dispatch( {
					type: USER_TRACKING_SETTINGS_UPDATE_SUCCESS,
					updatedSettings: updatedSettingsSuccess( success ),
					success: success,
				} );

				dispatch( removeNotice( 'tracking-settings-update' ) );
				dispatch( removeNotice( 'tracking-settings-update-success' ) );

				dispatch(
					createNotice( 'is-success', messages.success, {
						id: 'tracking-settings-update-success',
						duration: 2000,
					} )
				);
			} )
			.catch( error => {
				dispatch( {
					type: USER_TRACKING_SETTINGS_UPDATE_FAIL,
					updatedSettings: newSettings,
					success: false,
					error: error,
				} );

				dispatch( removeNotice( 'tracking-settings-update' ) );
				dispatch( removeNotice( 'tracking-settings-update-success' ) );

				dispatch(
					createNotice( 'is-error', messages.error( error ), { id: 'tracking-settings-update' } )
				);
			} );
	};
};

{'repo_name': 'Automattic/jetpack', 'stars': '1211', 'repo_language': 'PHP', 'file_name': 'must-connect-main-blog.php', 'mime_type': 'text/html', 'hash': 6114473020489873141, 'source_dataset': 'data'}


<!DOCTYPE html>

    <meta charset="utf-8">
    <title>响应式导航</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="css/style.css" rel="stylesheet">
    <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">

Navigation

Responsive Toggle Navigation

项目 1

项目 2

项目 3

项目 4

项目 5

主体

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sem erat, egestas quis luctus ut, rhoncus vitae risus. Integer venenatis libero sit amet sapien dictum, quis bibendum mi volutpat. Cras pretium quam quis magna facilisis, eget feugiat nisi lacinia.

边栏

Donec dolor arcu, interdum sed turpis faucibus, placerat ultricies felis. Donec pulvinar gravida rhoncus.

{'repo_name': 'hjzheng/CUF_meeting_knowledge_share', 'stars': '123', 'repo_language': 'JavaScript', 'file_name': '2014-08-19.md', 'mime_type': 'text/plain', 'hash': -6121690944450015169, 'source_dataset': 'data'}


package worker

import (
	"testing"
	"time"

	. "github.com/smartystreets/goconvey/convey"
)

func TestSchedule(t *testing.T) {

	Convey("MirrorJobSchedule should work", t, func(ctx C) {
		schedule := newScheduleQueue()

		Convey("When poping on empty schedule", func() {
			job := schedule.Pop()
			So(job, ShouldBeNil)
		})

		Convey("When adding some jobs", func() {
			c := cmdConfig{
				name: "schedule_test",
			}
			provider, _ := newCmdProvider(c)
			job := newMirrorJob(provider)
			sched := time.Now().Add(1 * time.Second)

			schedule.AddJob(sched, job)
			So(schedule.Pop(), ShouldBeNil)
			time.Sleep(1200 * time.Millisecond)
			So(schedule.Pop(), ShouldEqual, job)

		})
		Convey("When adding one job twice", func() {
			c := cmdConfig{
				name: "schedule_test",
			}
			provider, _ := newCmdProvider(c)
			job := newMirrorJob(provider)
			sched := time.Now().Add(1 * time.Second)

			schedule.AddJob(sched, job)
			schedule.AddJob(sched.Add(1*time.Second), job)

			So(schedule.Pop(), ShouldBeNil)
			time.Sleep(1200 * time.Millisecond)
			So(schedule.Pop(), ShouldBeNil)
			time.Sleep(1200 * time.Millisecond)
			So(schedule.Pop(), ShouldEqual, job)

		})
		Convey("When removing jobs", func() {
			c := cmdConfig{
				name: "schedule_test",
			}
			provider, _ := newCmdProvider(c)
			job := newMirrorJob(provider)
			sched := time.Now().Add(1 * time.Second)

			schedule.AddJob(sched, job)
			So(schedule.Remove("something"), ShouldBeFalse)
			So(schedule.Remove("schedule_test"), ShouldBeTrue)
			time.Sleep(1200 * time.Millisecond)
			So(schedule.Pop(), ShouldBeNil)
		})

	})
}

{'repo_name': 'tuna/tunasync', 'stars': '766', 'repo_language': 'Go', 'file_name': 'tunasync.go', 'mime_type': 'text/x-c', 'hash': -1656485542846076764, 'source_dataset': 'data'}


/*
 * Copyright © 2009  Red Hat, Inc.
 * Copyright © 2011  Google, Inc.
 *
 *  This is part of HarfBuzz, a text shaping library.
 *
 * Permission is hereby granted, without written agreement and without
 * license or royalty fees, to use, copy, modify, and distribute this
 * software and its documentation for any purpose, provided that the
 * above copyright notice and the following two paragraphs appear in
 * all copies of this software.
 *
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Red Hat Author(s): Behdad Esfahbod
 * Google Author(s): Behdad Esfahbod, Roozbeh Pournader
 */

#include "hb.hh"

#ifndef HB_NO_OT_TAG

/* hb_script_t */

static hb_tag_t
hb_ot_old_tag_from_script (hb_script_t script)
{
  /* This seems to be accurate as of end of 2012. */

  switch ((hb_tag_t) script)
  {
    case HB_SCRIPT_INVALID:		return HB_OT_TAG_DEFAULT_SCRIPT;

    /* KATAKANA and HIRAGANA both map to 'kana' */
    case HB_SCRIPT_HIRAGANA:		return HB_TAG('k','a','n','a');

    /* Spaces at the end are preserved, unlike ISO 15924 */
    case HB_SCRIPT_LAO:			return HB_TAG('l','a','o',' ');
    case HB_SCRIPT_YI:			return HB_TAG('y','i',' ',' ');
    /* Unicode-5.0 additions */
    case HB_SCRIPT_NKO:			return HB_TAG('n','k','o',' ');
    /* Unicode-5.1 additions */
    case HB_SCRIPT_VAI:			return HB_TAG('v','a','i',' ');
  }

  /* Else, just change first char to lowercase and return */
  return ((hb_tag_t) script) | 0x20000000u;
}

static hb_script_t
hb_ot_old_tag_to_script (hb_tag_t tag)
{
  if (unlikely (tag == HB_OT_TAG_DEFAULT_SCRIPT))
    return HB_SCRIPT_INVALID;

  /* This side of the conversion is fully algorithmic. */

  /* Any spaces at the end of the tag are replaced by repeating the last
   * letter.  Eg 'nko ' -> 'Nkoo' */
  if (unlikely ((tag & 0x0000FF00u) == 0x00002000u))
    tag |= (tag >> 8) & 0x0000FF00u; /* Copy second letter to third */
  if (unlikely ((tag & 0x000000FFu) == 0x00000020u))
    tag |= (tag >> 8) & 0x000000FFu; /* Copy third letter to fourth */

  /* Change first char to uppercase and return */
  return (hb_script_t) (tag & ~0x20000000u);
}

static hb_tag_t
hb_ot_new_tag_from_script (hb_script_t script)
{
  switch ((hb_tag_t) script) {
    case HB_SCRIPT_BENGALI:		return HB_TAG('b','n','g','2');
    case HB_SCRIPT_DEVANAGARI:		return HB_TAG('d','e','v','2');
    case HB_SCRIPT_GUJARATI:		return HB_TAG('g','j','r','2');
    case HB_SCRIPT_GURMUKHI:		return HB_TAG('g','u','r','2');
    case HB_SCRIPT_KANNADA:		return HB_TAG('k','n','d','2');
    case HB_SCRIPT_MALAYALAM:		return HB_TAG('m','l','m','2');
    case HB_SCRIPT_ORIYA:		return HB_TAG('o','r','y','2');
    case HB_SCRIPT_TAMIL:		return HB_TAG('t','m','l','2');
    case HB_SCRIPT_TELUGU:		return HB_TAG('t','e','l','2');
    case HB_SCRIPT_MYANMAR:		return HB_TAG('m','y','m','2');
  }

  return HB_OT_TAG_DEFAULT_SCRIPT;
}

static hb_script_t
hb_ot_new_tag_to_script (hb_tag_t tag)
{
  switch (tag) {
    case HB_TAG('b','n','g','2'):	return HB_SCRIPT_BENGALI;
    case HB_TAG('d','e','v','2'):	return HB_SCRIPT_DEVANAGARI;
    case HB_TAG('g','j','r','2'):	return HB_SCRIPT_GUJARATI;
    case HB_TAG('g','u','r','2'):	return HB_SCRIPT_GURMUKHI;
    case HB_TAG('k','n','d','2'):	return HB_SCRIPT_KANNADA;
    case HB_TAG('m','l','m','2'):	return HB_SCRIPT_MALAYALAM;
    case HB_TAG('o','r','y','2'):	return HB_SCRIPT_ORIYA;
    case HB_TAG('t','m','l','2'):	return HB_SCRIPT_TAMIL;
    case HB_TAG('t','e','l','2'):	return HB_SCRIPT_TELUGU;
    case HB_TAG('m','y','m','2'):	return HB_SCRIPT_MYANMAR;
  }

  return HB_SCRIPT_UNKNOWN;
}

#ifndef HB_DISABLE_DEPRECATED
void
hb_ot_tags_from_script (hb_script_t  script,
			hb_tag_t    *script_tag_1,
			hb_tag_t    *script_tag_2)
{
  unsigned int count = 2;
  hb_tag_t tags[2];
  hb_ot_tags_from_script_and_language (script, HB_LANGUAGE_INVALID, &count, tags, nullptr, nullptr);
  *script_tag_1 = count > 0 ? tags[0] : HB_OT_TAG_DEFAULT_SCRIPT;
  *script_tag_2 = count > 1 ? tags[1] : HB_OT_TAG_DEFAULT_SCRIPT;
}
#endif

/*
 * Complete list at:
 * https://docs.microsoft.com/en-us/typography/opentype/spec/scripttags
 *
 * Most of the script tags are the same as the ISO 15924 tag but lowercased.
 * So we just do that, and handle the exceptional cases in a switch.
 */

static void
hb_ot_all_tags_from_script (hb_script_t   script,
			    unsigned int *count /* IN/OUT */,
			    hb_tag_t     *tags /* OUT */)
{
  unsigned int i = 0;

  hb_tag_t new_tag = hb_ot_new_tag_from_script (script);
  if (unlikely (new_tag != HB_OT_TAG_DEFAULT_SCRIPT))
  {
    /* HB_SCRIPT_MYANMAR maps to 'mym2', but there is no 'mym3'. */
    if (new_tag != HB_TAG('m','y','m','2'))
      tags[i++] = new_tag | '3';
    if (*count > i)
      tags[i++] = new_tag;
  }

  if (*count > i)
  {
    hb_tag_t old_tag = hb_ot_old_tag_from_script (script);
    if (old_tag != HB_OT_TAG_DEFAULT_SCRIPT)
      tags[i++] = old_tag;
  }

  *count = i;
}

hb_script_t
hb_ot_tag_to_script (hb_tag_t tag)
{
  unsigned char digit = tag & 0x000000FFu;
  if (unlikely (digit == '2' || digit == '3'))
    return hb_ot_new_tag_to_script (tag & 0xFFFFFF32);

  return hb_ot_old_tag_to_script (tag);
}

/* hb_language_t */

static bool
subtag_matches (const char *lang_str,
		const char *limit,
		const char *subtag)
{
  do {
    const char *s = strstr (lang_str, subtag);
    if (!s || s >= limit)
      return false;
    if (!ISALNUM (s[strlen (subtag)]))
      return true;
    lang_str = s + strlen (subtag);
  } while (true);
}

static hb_bool_t
lang_matches (const char *lang_str, const char *spec)
{
  unsigned int len = strlen (spec);

  return strncmp (lang_str, spec, len) == 0 &&
	 (lang_str[len] == '\0' || lang_str[len] == '-');
}

struct LangTag
{
  char language[4];
  hb_tag_t tag;

  int cmp (const char *a) const
  {
    const char *b = this->language;
    unsigned int da, db;
    const char *p;

    p = strchr (a, '-');
    da = p ? (unsigned int) (p - a) : strlen (a);

    p = strchr (b, '-');
    db = p ? (unsigned int) (p - b) : strlen (b);

    return strncmp (a, b, hb_max (da, db));
  }
  int cmp (const LangTag *that) const
  { return cmp (that->language); }
};

#include "hb-ot-tag-table.hh"

/* The corresponding languages IDs for the following IDs are unclear,
 * overlap, or are architecturally weird. Needs more research. */

/*{"??",	{HB_TAG('B','C','R',' ')}},*/	/* Bible Cree */
/*{"zh?",	{HB_TAG('C','H','N',' ')}},*/	/* Chinese (seen in Microsoft fonts) */
/*{"ar-Syrc?",	{HB_TAG('G','A','R',' ')}},*/	/* Garshuni */
/*{"??",	{HB_TAG('N','G','R',' ')}},*/	/* Nagari */
/*{"??",	{HB_TAG('Y','I','C',' ')}},*/	/* Yi Classic */
/*{"zh?",	{HB_TAG('Z','H','P',' ')}},*/	/* Chinese Phonetic */

#ifndef HB_DISABLE_DEPRECATED
hb_tag_t
hb_ot_tag_from_language (hb_language_t language)
{
  unsigned int count = 1;
  hb_tag_t tags[1];
  hb_ot_tags_from_script_and_language (HB_SCRIPT_UNKNOWN, language, nullptr, nullptr, &count, tags);
  return count > 0 ? tags[0] : HB_OT_TAG_DEFAULT_LANGUAGE;
}
#endif

static void
hb_ot_tags_from_language (const char   *lang_str,
			  const char   *limit,
			  unsigned int *count,
			  hb_tag_t     *tags)
{
  const char *s;
  unsigned int tag_idx;

  /* Check for matches of multiple subtags. */
  if (hb_ot_tags_from_complex_language (lang_str, limit, count, tags))
    return;

  /* Find a language matching in the first component. */
  s = strchr (lang_str, '-');
  {
    if (s && limit - lang_str >= 6)
    {
      const char *extlang_end = strchr (s + 1, '-');
      /* If there is an extended language tag, use it. */
      if (3 == (extlang_end ? extlang_end - s - 1 : strlen (s + 1)) &&
	  ISALPHA (s[1]))
	lang_str = s + 1;
    }
    if (hb_sorted_array (ot_languages).bfind (lang_str, &tag_idx))
    {
      unsigned int i;
      while (tag_idx != 0 &&
	     0 == strcmp (ot_languages[tag_idx].language, ot_languages[tag_idx - 1].language))
	tag_idx--;
      for (i = 0;
	   i < *count &&
	   tag_idx + i < ARRAY_LENGTH (ot_languages) &&
	   0 == strcmp (ot_languages[tag_idx + i].language, ot_languages[tag_idx].language);
	   i++)
	tags[i] = ot_languages[tag_idx + i].tag;
      *count = i;
      return;
    }
  }

  if (!s)
    s = lang_str + strlen (lang_str);
  if (s - lang_str == 3) {
    /* Assume it's ISO-639-3 and upper-case and use it. */
    tags[0] = hb_tag_from_string (lang_str, s - lang_str) & ~0x20202000u;
    *count = 1;
    return;
  }

  *count = 0;
}

static bool
parse_private_use_subtag (const char     *private_use_subtag,
			  unsigned int   *count,
			  hb_tag_t       *tags,
			  const char     *prefix,
			  unsigned char (*normalize) (unsigned char))
{
#ifdef HB_NO_LANGUAGE_PRIVATE_SUBTAG
  return false;
#endif

  if (!(private_use_subtag && count && tags && *count)) return false;

  const char *s = strstr (private_use_subtag, prefix);
  if (!s) return false;

  char tag[4];
  int i;
  s += strlen (prefix);
  for (i = 0; i < 4 && ISALNUM (s[i]); i++)
    tag[i] = normalize (s[i]);
  if (!i) return false;

  for (; i < 4; i++)
    tag[i] = ' ';
  tags[0] = HB_TAG (tag[0], tag[1], tag[2], tag[3]);
  if ((tags[0] & 0xDFDFDFDF) == HB_OT_TAG_DEFAULT_SCRIPT)
    tags[0] ^= ~0xDFDFDFDF;
  *count = 1;
  return true;
}

/**
 * hb_ot_tags_from_script_and_language:
 * @script: an #hb_script_t to convert.
 * @language: an #hb_language_t to convert.
 * @script_count: (allow-none): maximum number of script tags to retrieve (IN)
 * and actual number of script tags retrieved (OUT)
 * @script_tags: (out) (allow-none): array of size at least @script_count to store the
 * script tag results
 * @language_count: (allow-none): maximum number of language tags to retrieve
 * (IN) and actual number of language tags retrieved (OUT)
 * @language_tags: (out) (allow-none): array of size at least @language_count to store
 * the language tag results
 *
 * Converts an #hb_script_t and an #hb_language_t to script and language tags.
 *
 * Since: 2.0.0
 **/
void
hb_ot_tags_from_script_and_language (hb_script_t   script,
				     hb_language_t language,
				     unsigned int *script_count /* IN/OUT */,
				     hb_tag_t     *script_tags /* OUT */,
				     unsigned int *language_count /* IN/OUT */,
				     hb_tag_t     *language_tags /* OUT */)
{
  bool needs_script = true;

  if (language == HB_LANGUAGE_INVALID)
  {
    if (language_count && language_tags && *language_count)
      *language_count = 0;
  }
  else
  {
    const char *lang_str, *s, *limit, *private_use_subtag;
    bool needs_language;

    lang_str = hb_language_to_string (language);
    limit = nullptr;
    private_use_subtag = nullptr;
    if (lang_str[0] == 'x' && lang_str[1] == '-')
    {
      private_use_subtag = lang_str;
    } else {
      for (s = lang_str + 1; *s; s++)
      {
	if (s[-1] == '-' && s[1] == '-')
	{
	  if (s[0] == 'x')
	  {
	    private_use_subtag = s;
	    if (!limit)
	      limit = s - 1;
	    break;
	  } else if (!limit)
	  {
	    limit = s - 1;
	  }
	}
      }
      if (!limit)
	limit = s;
    }

    needs_script = !parse_private_use_subtag (private_use_subtag, script_count, script_tags, "-hbsc", TOLOWER);
    needs_language = !parse_private_use_subtag (private_use_subtag, language_count, language_tags, "-hbot", TOUPPER);

    if (needs_language && language_count && language_tags && *language_count)
      hb_ot_tags_from_language (lang_str, limit, language_count, language_tags);
  }

  if (needs_script && script_count && script_tags && *script_count)
    hb_ot_all_tags_from_script (script, script_count, script_tags);
}

/**
 * hb_ot_tag_to_language:
 *
 *
 *
 * Return value: (transfer none):
 *
 * Since: 0.9.2
 **/
hb_language_t
hb_ot_tag_to_language (hb_tag_t tag)
{
  unsigned int i;

  if (tag == HB_OT_TAG_DEFAULT_LANGUAGE)
    return nullptr;

  {
    hb_language_t disambiguated_tag = hb_ot_ambiguous_tag_to_language (tag);
    if (disambiguated_tag != HB_LANGUAGE_INVALID)
      return disambiguated_tag;
  }

  for (i = 0; i < ARRAY_LENGTH (ot_languages); i++)
    if (ot_languages[i].tag == tag)
      return hb_language_from_string (ot_languages[i].language, -1);

  /* If it's three letters long, assume it's ISO 639-3 and lower-case and use it
   * (if it's not a registered tag, calling hb_ot_tag_from_language on the
   * result might not return the same tag as the original tag).
   * Else return a custom language in the form of "x-hbotABCD". */
  {
    char buf[11] = "x-hbot";
    char *str = buf;
    buf[6] = tag >> 24;
    buf[7] = (tag >> 16) & 0xFF;
    buf[8] = (tag >> 8) & 0xFF;
    buf[9] = tag & 0xFF;
    if (buf[9] == 0x20)
    {
      buf[9] = '\0';
      if (ISALPHA (buf[6]) && ISALPHA (buf[7]) && ISALPHA (buf[8]))
      {
	buf[6] = TOLOWER (buf[6]);
	buf[7] = TOLOWER (buf[7]);
	buf[8] = TOLOWER (buf[8]);
	str += 6;
      }
    }
    buf[10] = '\0';
    return hb_language_from_string (str, -1);
  }
}

/**
 * hb_ot_tags_to_script_and_language:
 * @script_tag: a script tag
 * @language_tag: a language tag
 * @script: (allow-none): the #hb_script_t corresponding to @script_tag (OUT).
 * @language: (allow-none): the #hb_language_t corresponding to @script_tag and
 * @language_tag (OUT).
 *
 * Converts a script tag and a language tag to an #hb_script_t and an
 * #hb_language_t.
 *
 * Since: 2.0.0
 **/
void
hb_ot_tags_to_script_and_language (hb_tag_t       script_tag,
				   hb_tag_t       language_tag,
				   hb_script_t   *script /* OUT */,
				   hb_language_t *language /* OUT */)
{
  hb_script_t script_out = hb_ot_tag_to_script (script_tag);
  if (script)
    *script = script_out;
  if (language)
  {
    unsigned int script_count = 1;
    hb_tag_t primary_script_tag[1];
    hb_ot_tags_from_script_and_language (script_out,
					 HB_LANGUAGE_INVALID,
					 &script_count,
					 primary_script_tag,
					 nullptr, nullptr);
    *language = hb_ot_tag_to_language (language_tag);
    if (script_count == 0 || primary_script_tag[0] != script_tag)
    {
      unsigned char *buf;
      const char *lang_str = hb_language_to_string (*language);
      size_t len = strlen (lang_str);
      buf = (unsigned char *) malloc (len + 11);
      if (unlikely (!buf))
      {
	*language = nullptr;
      }
      else
      {
	memcpy (buf, lang_str, len);
	if (lang_str[0] != 'x' || lang_str[1] != '-') {
	  buf[len++] = '-';
	  buf[len++] = 'x';
	}
	buf[len++] = '-';
	buf[len++] = 'h';
	buf[len++] = 'b';
	buf[len++] = 's';
	buf[len++] = 'c';
	buf[len++] = script_tag >> 24;
	buf[len++] = (script_tag >> 16) & 0xFF;
	buf[len++] = (script_tag >> 8) & 0xFF;
	buf[len++] = script_tag & 0xFF;
	*language = hb_language_from_string ((char *) buf, len);
	free (buf);
      }
    }
  }
}

#ifdef MAIN
static inline void
test_langs_sorted ()
{
  for (unsigned int i = 1; i < ARRAY_LENGTH (ot_languages); i++)
  {
    int c = ot_languages[i].cmp (&ot_languages[i - 1]);
    if (c > 0)
    {
      fprintf (stderr, "ot_languages not sorted at index %d: %s %d %s\n",
	       i, ot_languages[i-1].language, c, ot_languages[i].language);
      abort();
    }
  }
}

int
main ()
{
  test_langs_sorted ();
  return 0;
}

#endif

#endif

{'repo_name': 'sumatrapdfreader/sumatrapdf', 'stars': '5179', 'repo_language': 'C', 'file_name': 'font.h', 'mime_type': 'text/x-c', 'hash': 680896014467004976, 'source_dataset': 'data'}


/**
* @api {post} /employee/:id/education 26.Save Employee Education
* @apiName saveEmployeeEducation
* @apiGroup Employee
* @apiVersion 0.1.0
* @apiUse AdminDescription
*
* @apiParam {Number}  id Employee id.
*
* @apiParam {Number} level Education level id.
* @apiParam {Number} seqId Education record id.
* @apiParam {String} institute Institute of studying.
* @apiParam {Date} startDate Start date.
* @apiParam {Date} endDate End date.
* @apiParam {String} specialization Specialization.
* @apiParam {String} year Year of study.
* @apiParam {String} gpa Gpa/score.
* @apiSuccess {Object} Data Success response.
*
* @apiSuccessExample Success-Response:
*     HTTP/1.1 200 OK
*
*   {
*
*   "success":"Successfully Saved",
*   "seqId":3
*
*   }
*
*
* @apiError UserNotFound The id of the employee was not found.
*
* @apiErrorExample Error-Response:
*     HTTP/1.1 404 Not Found
*     {
*       "error": "Employee Not Found"
*     }
*
*/

{'repo_name': 'orangehrm/orangehrm', 'stars': '216', 'repo_language': 'PHP', 'file_name': 'AttendanceDao.yml', 'mime_type': 'text/plain', 'hash': 2955383362692018547, 'source_dataset': 'data'}


/**
 * Copyright 2019 The JoyQueue Authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.joyqueue.model;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @author lining11
 * Date: 2018/12/13
 */
public class MonitorRecord implements Cloneable, Serializable {

    private String provider;
    private String service;
    private String endpoint;
    private String metric;
    private double value;
    private String category;
    private long timestamp;//精确到s
    private Map<String, String> tags = new HashMap<>();

    public Map<String, String> getTags() {
        return tags;
    }

    public void setTags(Map<String, String> tags) {
        this.tags = tags;
    }

    public String getProvider() {
        return provider;
    }

    public void setProvider(String provider) {
        this.provider = provider;
    }

    public String getService() {
        return service;
    }

    public void setService(String service) {
        this.service = service;
    }

    public String getEndpoint() {
        return endpoint;
    }

    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }

    public String getMetric() {
        return metric;
    }

    public void setMetric(String metric) {
        this.metric = metric;
    }

    public double getValue() {
        return value;
    }

    public void setValue(double value) {
        setValue(value,true);
    }

    public void setValue(double value,boolean positive) {
        if (positive){
            value = Math.abs(value);
        }
        this.value = value;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    /**
     * key 必须为
     * t1,brokerId
     * t2,host
     * t3,topic
     * t4,app
     * t5,partitionGroup
     * t6,partition
     *
     * @param key   key
     * @param value value
     */
    public void addTag(String key, String value) {
        tags.put(key, value);
    }

    /**
     * key 必须为
     * t1,brokerId
     * t2,host
     * t3,topic
     * t4,app
     * t5,partitionGroup
     * t6,partition
     *
     * @param key key
     * @return 对应的tag
     */
    public String getTag(String key) {
        return tags.get(key);
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    public void brokerId(String brokerId) {
        tags.put("t1", brokerId);
    }

    public void host(String host) {
        tags.put("t2", host);
    }

    public void topic(String topic) {
        tags.put("t3", topic);
    }

    public void app(String app) {
        tags.put("t4", app);
    }

    public void partitionGroup(String partitionGroup) {
        tags.put("t5", partitionGroup);
    }

    public void partition(String partiton) {
        tags.put("t6", partiton);
    }
}

{'repo_name': 'chubaostream/joyqueue', 'stars': '205', 'repo_language': 'Java', 'file_name': 'TopicMessageFilterSupport.java', 'mime_type': 'text/x-java', 'hash': 4227348820888942529, 'source_dataset': 'data'}


/*
 * Copyright 2016 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.android.things.contrib.driver.mma7660fc;

import com.google.android.things.pio.I2cDevice;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;

import java.io.IOException;

import static org.mockito.AdditionalMatchers.aryEq;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.times;

public class Mma7660FcTest {

    @Mock
    I2cDevice mI2c;

    @Rule
    public MockitoRule mMokitoRule = MockitoJUnit.rule();

    @Rule
    public ExpectedException mExpectedException = ExpectedException.none();

    @Test
    public void close() throws IOException {
        Mma7660Fc driver = new Mma7660Fc(mI2c);
        driver.close();
        Mockito.verify(mI2c).close();
    }

    @Test
    public void close_safeToCallTwice() throws IOException {
        Mma7660Fc driver = new Mma7660Fc(mI2c);
        driver.close();
        driver.close(); // should not throw
        Mockito.verify(mI2c, times(1)).close();
    }

    @Test
    public void setMode() throws IOException {
        Mma7660Fc driver = new Mma7660Fc(mI2c);
        driver.setMode(Mma7660Fc.MODE_ACTIVE);
        Mockito.verify(mI2c).writeRegByte(0x07, (byte) Mma7660Fc.MODE_ACTIVE);

        Mockito.reset(mI2c);

        driver.setMode(Mma7660Fc.MODE_STANDBY);
        Mockito.verify(mI2c).writeRegByte(0x07, (byte) Mma7660Fc.MODE_STANDBY);
    }

    @Test
    public void setMode_throwsIfClosed() throws IOException {
        Mma7660Fc driver = new Mma7660Fc(mI2c);
        driver.close();
        mExpectedException.expect(IllegalStateException.class);
        driver.setMode(Mma7660Fc.MODE_ACTIVE);
    }

    @Test
    public void getMode() throws IOException {
        Mma7660Fc driver = new Mma7660Fc(mI2c);
        driver.getMode();
        Mockito.verify(mI2c).readRegByte(0x07);
    }

    @Test
    public void getMode_throwsIfClosed() throws IOException {
        Mma7660Fc driver = new Mma7660Fc(mI2c);
        driver.close();
        mExpectedException.expect(IllegalStateException.class);
        driver.getMode();
    }

    @Test
    public void setSamplingRate() throws IOException {
        Mma7660Fc driver = new Mma7660Fc(mI2c);
        driver.setSamplingRate(Mma7660Fc.RATE_1HZ);
        Mockito.verify(mI2c).writeRegByte(0x08, (byte) Mma7660Fc.RATE_1HZ);
    }

    @Test
    public void setSamplingRate_throwsIfClosed() throws IOException {
        Mma7660Fc driver = new Mma7660Fc(mI2c);
        driver.close();
        mExpectedException.expect(IllegalStateException.class);
        driver.setSamplingRate(Mma7660Fc.RATE_1HZ);
    }

    @Test
    public void getSamplingRate() throws IOException {
        Mma7660Fc driver = new Mma7660Fc(mI2c);
        driver.getSamplingRate();
        Mockito.verify(mI2c).readRegByte(0x08);
    }

    @Test
    public void getSamplingRate_throwsIfClosed() throws IOException {
        Mma7660Fc driver = new Mma7660Fc(mI2c);
        driver.close();
        mExpectedException.expect(IllegalStateException.class);
        driver.getSamplingRate();
    }

    @Test
    public void readSample() throws IOException {
        Mma7660Fc driver = new Mma7660Fc(mI2c);
        driver.readSample();
        Mockito.verify(mI2c).read(aryEq(new byte[3]), eq(3));
    }

    @Test
    public void readSample_throwsIfClosed() throws IOException {
        Mma7660Fc driver = new Mma7660Fc(mI2c);
        driver.close();
        mExpectedException.expect(IllegalStateException.class);
        driver.readSample();
    }
}

{'repo_name': 'androidthings/contrib-drivers', 'stars': '526', 'repo_language': 'Java', 'file_name': 'MotorHatTest.java', 'mime_type': 'text/x-java', 'hash': 285049573887366360, 'source_dataset': 'data'}


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>IDECodeSnippetCompletionPrefix</key>
	<string>snp_remake</string>
	<key>IDECodeSnippetCompletionScopes</key>
	<array>
		<string>TopLevel</string>
	</array>
	<key>IDECodeSnippetContents</key>
	<string><#view#>.snp_remakeConstraints { make in
    <#code#>
}</string>
	<key>IDECodeSnippetIdentifier</key>
	<string>FD093546-D614-4311-82C3-E8FE842F62B1</string>
	<key>IDECodeSnippetLanguage</key>
	<string>Xcode.SourceCodeLanguage.Swift</string>
	<key>IDECodeSnippetTitle</key>
	<string>SnapKit Constraint Remake</string>
	<key>IDECodeSnippetUserSnippet</key>
	<true/>
	<key>IDECodeSnippetVersion</key>
	<integer>0</integer>
</dict>
</plist>

{'repo_name': 'richeterre/SwiftGoal', 'stars': '303', 'repo_language': 'Swift', 'file_name': 'PlayerSpec.swift', 'mime_type': 'text/plain', 'hash': -5330671581921955389, 'source_dataset': 'data'}


package org.knowm.xchange.kucoin;

import com.google.common.base.Strings;
import org.knowm.xchange.client.ExchangeRestProxyBuilder;
import org.knowm.xchange.kucoin.service.AccountAPI;
import org.knowm.xchange.kucoin.service.DepositAPI;
import org.knowm.xchange.kucoin.service.FillAPI;
import org.knowm.xchange.kucoin.service.HistOrdersAPI;
import org.knowm.xchange.kucoin.service.HistoryAPI;
import org.knowm.xchange.kucoin.service.KucoinApiException;
import org.knowm.xchange.kucoin.service.KucoinDigest;
import org.knowm.xchange.kucoin.service.OrderAPI;
import org.knowm.xchange.kucoin.service.OrderBookAPI;
import org.knowm.xchange.kucoin.service.SymbolAPI;
import org.knowm.xchange.kucoin.service.WebsocketAPI;
import org.knowm.xchange.kucoin.service.WithdrawalAPI;
import org.knowm.xchange.service.BaseExchangeService;
import org.knowm.xchange.service.BaseService;
import si.mazi.rescu.SynchronizedValueFactory;

public class KucoinBaseService extends BaseExchangeService<KucoinExchange> implements BaseService {

  protected final SymbolAPI symbolApi;
  protected final OrderBookAPI orderBookApi;
  protected final HistoryAPI historyApi;
  protected final AccountAPI accountApi;
  protected final WithdrawalAPI withdrawalAPI;
  protected final DepositAPI depositAPI;
  protected final OrderAPI orderApi;
  protected final FillAPI fillApi;
  protected final HistOrdersAPI histOrdersApi;
  protected final WebsocketAPI websocketAPI;

  protected KucoinDigest digest;
  protected String apiKey;
  protected String passphrase;
  protected SynchronizedValueFactory<Long> nonceFactory;

  protected KucoinBaseService(KucoinExchange exchange) {
    super(exchange);
    this.symbolApi = service(exchange, SymbolAPI.class);
    this.orderBookApi = service(exchange, OrderBookAPI.class);
    this.historyApi = service(exchange, HistoryAPI.class);
    this.accountApi = service(exchange, AccountAPI.class);
    this.withdrawalAPI = service(exchange, WithdrawalAPI.class);
    this.depositAPI = service(exchange, DepositAPI.class);
    this.orderApi = service(exchange, OrderAPI.class);
    this.fillApi = service(exchange, FillAPI.class);
    this.histOrdersApi = service(exchange, HistOrdersAPI.class);
    this.websocketAPI = service(exchange, WebsocketAPI.class);

    this.digest = KucoinDigest.createInstance(exchange.getExchangeSpecification().getSecretKey());
    this.apiKey = exchange.getExchangeSpecification().getApiKey();
    this.passphrase =
        (String)
            exchange.getExchangeSpecification().getExchangeSpecificParametersItem("passphrase");
    this.nonceFactory = exchange.getNonceFactory();
  }

  private <T> T service(KucoinExchange exchange, Class<T> clazz) {
    return ExchangeRestProxyBuilder.forInterface(clazz, exchange.getExchangeSpecification())
        .build();
  }

  protected void checkAuthenticated() {
    if (Strings.isNullOrEmpty(this.apiKey)) throw new KucoinApiException("Missing API key");
    if (this.digest == null) throw new KucoinApiException("Missing secret key");
    if (Strings.isNullOrEmpty(this.passphrase)) throw new KucoinApiException("Missing passphrase");
  }
}

{'repo_name': 'knowm/XChange', 'stars': '2943', 'repo_language': 'Java', 'file_name': 'CobinhoodMarketDataDtoTest.java', 'mime_type': 'text/x-java', 'hash': -4835876406261936134, 'source_dataset': 'data'}


var s = "abçd"
System.print(s.iterate(null)) // expect: 0
System.print(s.iterate(0)) // expect: 1
System.print(s.iterate(1)) // expect: 2
// Skip 3 because that's the middle of the ç sequence.
System.print(s.iterate(2)) // expect: 4
// Iterating from the middle of a UTF-8 sequence goes to the next one.
System.print(s.iterate(3)) // expect: 4
System.print(s.iterate(4)) // expect: false

// Out of bounds.
System.print(s.iterate(123)) // expect: false
System.print(s.iterate(-1)) // expect: false

// Nothing to iterate in an empty string.
System.print("".iterate(null)) // expect: false

// 8-bit clean.
System.print("a\0b\0c".iterate(null)) // expect: 0
System.print("a\0b\0c".iterate(0)) // expect: 1
System.print("a\0b\0c".iterate(1)) // expect: 2
System.print("a\0b\0c".iterate(2)) // expect: 3
System.print("a\0b\0c".iterate(3)) // expect: 4
System.print("a\0b\0c".iterate(4)) // expect: false

// Iterates over invalid UTF-8 one byte at a time.
System.print("\xef\xf7".iterate(null)) // expect: 0
System.print("\xef\xf7".iterate(0)) // expect: 1
System.print("\xef\xf7".iterate(1)) // expect: false

{'repo_name': 'wren-lang/wren', 'stars': '4293', 'repo_language': 'C', 'file_name': '0001-smarter-imports.md', 'mime_type': 'text/x-c', 'hash': 2044025576809105158, 'source_dataset': 'data'}


import React from 'react'
import cx from 'classnames'

import { MenuOptions, MenuOption } from '../types'

const styles = require('./help-menu.css')

export interface Props {
    menuOptions: MenuOptions
    extVersion: string
}

export class HelpMenu extends React.PureComponent<Props> {
    private renderFooter() {
        return (

                Memex {this.props.extVersion}

        )
    }

    private renderMenuOption = (
        { text, link, small }: MenuOption,
        i: number,
    ) => (

                {text}

    )

    private renderSeparator = (val, i: number) => (

    )

    render() {
        return (

                    {this.props.menuOptions.map(
                        (opt, i) =>
                            opt === '-'
                                ? this.renderSeparator(opt, i)
                                : this.renderMenuOption(opt, i),
                    )}

                {this.renderFooter()}

        )
    }
}

{'repo_name': 'WorldBrain/Memex', 'stars': '2530', 'repo_language': 'TypeScript', 'file_name': 'devcontainer.json', 'mime_type': 'text/plain', 'hash': 1904052981419855007, 'source_dataset': 'data'}


/*
 * Copyright (C) 2008, 2013 Apple Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1.  Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 * 2.  Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
 *     its contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef HTMLTableRowsCollection_h
#define HTMLTableRowsCollection_h

#include "CachedHTMLCollection.h"
#include "HTMLTableElement.h"

namespace WebCore {

class HTMLTableRowElement;

class HTMLTableRowsCollection final : public CachedHTMLCollection<HTMLTableRowsCollection, CollectionTypeTraits<TableRows>::traversalType> {
public:
    static Ref<HTMLTableRowsCollection> create(HTMLTableElement&, CollectionType);

    HTMLTableElement& tableElement() { return downcast<HTMLTableElement>(ownerNode()); }
    const HTMLTableElement& tableElement() const { return downcast<HTMLTableElement>(ownerNode()); }

    static HTMLTableRowElement* rowAfter(HTMLTableElement&, HTMLTableRowElement*);
    static HTMLTableRowElement* lastRow(HTMLTableElement&);

    // For CachedHTMLCollection.
    Element* customElementAfter(Element*) const;

private:
    explicit HTMLTableRowsCollection(HTMLTableElement&);
};

} // namespace WebCore

SPECIALIZE_TYPE_TRAITS_HTMLCOLLECTION(HTMLTableRowsCollection, TableRows)

#endif // HTMLTableRowsCollection_h

{'repo_name': 'naver/sling', 'stars': '115', 'repo_language': 'C++', 'file_name': 'configure-clang-linux.sh', 'mime_type': 'text/x-shellscript', 'hash': 8119331810478362760, 'source_dataset': 'data'}


                                                                Strategy Tester Report
                                                             EA31337-Lite-Backtest-v1.078
                                                                     (Build 1010)

Symbol                            EURUSD (Euro vs US Dollar)
Period                            30 Minutes (M30) 2018.01.04 03:00 - 2018.12.30 23:30 (2018.01.01 - 2018.12.31)
Model                             Every tick (the most precise method based on all available least timeframes)
                                  __EA_Parameters__="-- Input EA parameters for EA31337 Lite (Backtest) v1.078 --"; __Trade_Parameters__="-- Trade
                                  parameters --"; MaxOrders=0; MaxOrdersPerType=0; LotSize=0.01; TradeMicroLots=true; MinVolumeToTrade=2;
                                  MaxOrderPriceSlippage=50; MaxTries=5; MinPipChangeToTrade=0; MinPipGap=10; __EA_Order_Parameters__="-- Profit and
                                  loss parameters --"; TakeProfitMax=0; StopLossMax=40; __EA_Trailing_Parameters__="-- Profit and loss trailing
                                  parameters --"; TrailingStop=50; TrailingProfit=0; TrailingStopAddPerMinute=0.1; __EA_Risk_Parameters__="-- Risk
                                  management parameters --"; RiskMarginPerOrder=1; RiskMarginTotal=10; RiskRatio=0; RiskRatioIncreaseMethod=0;
                                  RiskRatioDecreaseMethod=0; InitNoOfDaysToWarmUp=21; CloseOrderAfterXHours=24; __Strategy_Parameters__="-- Per
                                  strategy parameters (0 to disable) --"; ProfitFactorMinToTrade=0; ProfitFactorMaxToTrade=0;
                                  InitNoOfOrdersToCalcPF=20; __Strategy_Boosting_Parameters__="-- Strategy boosting parameters (set 1.0 for default)
                                  --"; Boosting_Enabled=false; BoostTrendFactor=1.1; StrategyBoostByPF=true; StrategyHandicapByPF=true;
                                  BestDailyStrategyMultiplierFactor=1; BestWeeklyStrategyMultiplierFactor=1; BestMonthlyStrategyMultiplierFactor=1;
                                  WorseDailyStrategyMultiplierFactor=1; WorseWeeklyStrategyMultiplierFactor=1.1;
                                  WorseMonthlyStrategyMultiplierFactor=1; ConWinsIncreaseFactor=0.4; ConLossesIncreaseFactor=0.7;
                                  ConFactorOrdersLimit=600; __SmartQueue_Parameters__="-- Smart queue parameters --"; SmartQueueActive=false;
                                  SmartQueueMethod=11; SmartQueueFilter=91; __EA_Account_Conditions__="-- Account conditions --";
                                  Account_Conditions_Active=false; Account_Condition_MinProfitCloseOrder=20; __EA_Account_Conditions_Params__="-
                                  - Account conditions parameters --"; MarketSpecificHour=10; CloseConditionOnlyProfitable=true; __AC_Parameters__="-
                                  - Settings for the Bill Williams' Accelerator/Decelerator oscillator --"; AC_Active_Tf=0; AC_SignalLevel=0.0004;
Parameters                        AC_Shift=0; AC1_SignalMethod=1; AC5_SignalMethod=1; AC15_SignalMethod=0; AC30_SignalMethod=1; __AD_Parameters__="-
                                  - Settings for the Accumulation/Distribution indicator --"; AD_Active_Tf=0; AD_SignalLevel=0; AD_Shift=0;
                                  AD1_SignalMethod=0; AD5_SignalMethod=0; AD15_SignalMethod=0; AD30_SignalMethod=0; __ADX_Parameters__="-- Settings
                                  for the Average Directional Movement Index indicator --"; ADX_Active_Tf=0; ADX_Period_M1=20; ADX_Period_M5=14;
                                  ADX_Period_M15=28; ADX_Period_M30=26; ADX_SignalLevel=18; ADX_Shift=3; ADX1_SignalMethod=0; ADX5_SignalMethod=0;
                                  ADX15_SignalMethod=0; ADX30_SignalMethod=0; __Alligator_Parameters__="-- Settings for the Alligator indicator --";
                                  Alligator_Active_Tf=0; Alligator_Period_Jaw=16; Alligator_Period_Teeth=8; Alligator_Period_Lips=6;
                                  Alligator_Shift_Jaw=5; Alligator_Shift_Teeth=7; Alligator_Shift_Lips=5; Alligator_Shift=2;
                                  Alligator_SignalLevel=0.1; Alligator1_SignalMethod=19; Alligator5_SignalMethod=27; Alligator15_SignalMethod=20;
                                  Alligator30_SignalMethod=16; __Bands_Parameters__="-- Settings for the Bollinger Bands indicator --";
                                  Bands_Active_Tf=0; Bands_Period_M1=2; Bands_Period_M5=2; Bands_Period_M15=2; Bands_Period_M30=2;
                                  Bands_Deviation_M1=1.8; Bands_Deviation_M5=1.8; Bands_Deviation_M15=1.8; Bands_Deviation_M30=1.8; Bands_HShift=0;
                                  Bands_Shift=0; Bands_SignalLevel=18; Bands1_SignalMethod=-85; Bands5_SignalMethod=-74; Bands15_SignalMethod=-127;
                                  Bands30_SignalMethod=-127; BWMFI_Shift=0; __CCI_Parameters__="-- Settings for the Commodity Channel Index indicator
                                  --"; CCI_Active_Tf=0; CCI_Shift=1; CCI_Period_M1=58; CCI_Period_M5=22; CCI_Period_M15=18; CCI_Period_M30=26;
                                  CCI_SignalLevel=98; CCI1_SignalMethod=34; CCI5_SignalMethod=18; CCI15_SignalMethod=0; CCI30_SignalMethod=-44;
                                  __DeMarker_Parameters__="-- Settings for the DeMarker indicator --"; DeMarker_Active_Tf=0; DeMarker_Period_M1=36;
                                  DeMarker_Period_M5=54; DeMarker_Period_M15=10; DeMarker_Period_M30=2; DeMarker_Shift=5; DeMarker_SignalLevel=0.2;
                                  DeMarker1_SignalMethod=12; DeMarker5_SignalMethod=12; DeMarker15_SignalMethod=4; DeMarker30_SignalMethod=12;
                                  __Envelopes_Parameters__="-- Settings for the Envelopes indicator --"; Envelopes_Active_Tf=0;
Bars in test                11890 Ticks modelled                      108400237 Modelling quality                                              89.24%
Mismatched charts errors        0
Initial deposit          10000.00                                               Spread                                                             10
Total net profit         -5623.05 Gross profit                         25711.37 Gross loss                                                  -31334.43
Profit factor                0.82 Expected payoff                         -0.86
Absolute drawdown         6059.13 Maximal drawdown             6410.06 (61.93%) Relative drawdown                                    61.93% (6410.06)
Total trades                 6535 Short positions (won %)         1310 (33.59%) Long positions (won %)                                   5225 (9.28%)
                                  Profit trades (% of total)       925 (14.15%) Loss trades (% of total)                                5610 (85.85%)
                          Largest profit trade                           150.50 loss trade                                                     -65.50
                          Average profit trade                            27.80 loss trade                                                      -5.59
                          Maximum consecutive wins (profit in       10 (114.23) consecutive losses (loss in money)                       67 (-265.22)
                                  money)
                          Maximal consecutive profit (count of       412.10 (4) consecutive loss (count of losses)                       -538.74 (38)
                                  wins)
                          Average consecutive wins                            2 consecutive losses                                                 10
                                                                       [Graph]

{'repo_name': 'EA31337/EA31337', 'stars': '216', 'repo_language': 'MQL5', 'file_name': 'copy_set_mqh.sh', 'mime_type': 'text/x-shellscript', 'hash': 8440351873207087859, 'source_dataset': 'data'}


{'repo_name': 'jedisct1/libsodium.js', 'stars': '575', 'repo_language': 'HTML', 'file_name': 'core6.html', 'mime_type': 'text/html', 'hash': -1284036266937469636, 'source_dataset': 'data'}


//  ---------------------------------------------------------------------------
//
//  @file       TwOpenGL.h
//  @brief      OpenGL graph functions
//  @author     Philippe Decaudin
//  @license    This file is part of the AntTweakBar library.
//              For conditions of distribution and use, see License.txt
//
//  note:       Private header
//
//  ---------------------------------------------------------------------------

#if !defined ANT_TW_OPENGL_INCLUDED
#define ANT_TW_OPENGL_INCLUDED

#include "TwGraph.h"

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

class CTwGraphOpenGL : public ITwGraph
{
public:
    virtual int         Init();
    virtual int         Shut();
    virtual void        BeginDraw(int _WndWidth, int _WndHeight);
    virtual void        EndDraw();
    virtual bool        IsDrawing();
    virtual void        Restore();
    virtual void        DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color0, color32 _Color1, bool _AntiAliased=false);
    virtual void        DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color, bool _AntiAliased=false) { DrawLine(_X0, _Y0, _X1, _Y1, _Color, _Color, _AntiAliased); }
    virtual void        DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color00, color32 _Color10, color32 _Color01, color32 _Color11);
    virtual void        DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color) { DrawRect(_X0, _Y0, _X1, _Y1, _Color, _Color, _Color, _Color); }
    virtual void        DrawTriangles(int _NumTriangles, int *_Vertices, color32 *_Colors, Cull _CullMode);

    virtual void *      NewTextObj();
    virtual void        DeleteTextObj(void *_TextObj);
    virtual void        BuildText(void *_TextObj, const std::string *_TextLines, color32 *_LineColors, color32 *_LineBgColors, int _NbLines, const CTexFont *_Font, int _Sep, int _BgWidth);
    virtual void        DrawText(void *_TextObj, int _X, int _Y, color32 _Color, color32 _BgColor);

    virtual void        ChangeViewport(int _X0, int _Y0, int _Width, int _Height, int _OffsetX, int _OffsetY);
    virtual void        RestoreViewport();
    virtual void        SetScissor(int _X0, int _Y0, int _Width, int _Height);

protected:
    bool                m_Drawing;
    GLuint              m_FontTexID;
    const CTexFont *    m_FontTex;
    GLfloat             m_PrevLineWidth;
    GLint               m_PrevTexEnv;
    GLint               m_PrevPolygonMode[2];
    GLint               m_MaxClipPlanes;
    GLint               m_PrevTexture;
    GLint               m_PrevArrayBufferARB;
    GLint               m_PrevElementArrayBufferARB;
    GLboolean           m_PrevVertexProgramARB;
    GLboolean           m_PrevFragmentProgramARB;
    GLuint              m_PrevProgramObjectARB;
    GLboolean           m_PrevTexture3D;
    enum EMaxTextures   { MAX_TEXTURES = 128 };
    GLboolean           m_PrevActiveTexture1D[MAX_TEXTURES];
    GLboolean           m_PrevActiveTexture2D[MAX_TEXTURES];
    GLboolean           m_PrevActiveTexture3D[MAX_TEXTURES];
    GLboolean           m_PrevClientTexCoordArray[MAX_TEXTURES];
    GLint               m_PrevActiveTextureARB;
    GLint               m_PrevClientActiveTextureARB;
    bool                m_SupportTexRect;
    GLboolean           m_PrevTexRectARB;
    GLint               m_PrevBlendEquation;
    GLint               m_PrevBlendEquationRGB;
    GLint               m_PrevBlendEquationAlpha;
    GLint               m_PrevBlendSrcRGB;
    GLint               m_PrevBlendDstRGB;
    GLint               m_PrevBlendSrcAlpha;
    GLint               m_PrevBlendDstAlpha;
    GLuint              m_PrevVertexArray;
    GLint               m_ViewportInit[4];
    GLfloat             m_ProjMatrixInit[16];
    enum EMaxVtxAttribs { MAX_VERTEX_ATTRIBS = 128 };
    GLint               m_PrevEnabledVertexAttrib[MAX_VERTEX_ATTRIBS];
    int                 m_WndWidth;
    int                 m_WndHeight;

    struct Vec2         { GLfloat x, y; Vec2(){} Vec2(GLfloat _X, GLfloat _Y):x(_X),y(_Y){} Vec2(int _X, int _Y):x(GLfloat(_X)),y(GLfloat(_Y)){} };
    struct CTextObj
    {
        std::vector<Vec2>   m_TextVerts;
        std::vector<Vec2>   m_TextUVs;
        std::vector<Vec2>   m_BgVerts;
        std::vector<color32>m_Colors;
        std::vector<color32>m_BgColors;
    };
};

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

#endif // !defined ANT_TW_OPENGL_INCLUDED

{'repo_name': 'opengl-tutorials/ogl', 'stars': '1813', 'repo_language': 'C++', 'file_name': 'playground.cpp', 'mime_type': 'text/x-c', 'hash': -5657041647902126006, 'source_dataset': 'data'}


import os

from pytest_shutil import env, run

TEMP_NAME = 'JUNK123_456_789'

def test_set_env_ok_if_exists():
    ev = os.environ[TEMP_NAME] = 'junk_name'
    try:
        with env.set_env(TEMP_NAME, 'anything'):
            out = run.run('env', capture_stdout=True)
            for o in out.split('\n'):
                if o.startswith(TEMP_NAME):
                    assert o == '%s=anything' % TEMP_NAME
                    break
            else:
                assert False, '%s not found in os.environ' % TEMP_NAME
        assert os.environ[TEMP_NAME] == ev

    finally:
        if TEMP_NAME in os.environ:
            del os.environ[TEMP_NAME]

def test_set_env_ok_if_not_exists():
    if TEMP_NAME in os.environ:
        del os.environ[TEMP_NAME]
    with env.set_env(TEMP_NAME, 'anything'):
        out = run.run('env', capture_stdout=True)
        for o in out.split('\n'):
            if o.startswith(TEMP_NAME):
                assert o == '%s=anything' % TEMP_NAME
                break
        else:
            assert False, '%s not found in os.environ' % TEMP_NAME

def test_subprocecmdline():
    ev = os.environ[TEMP_NAME] = 'junk_name'
    try:
        with env.no_env(TEMP_NAME):
            out = run.run('env', capture_stdout=True)
            for o in out.split('\n'):
                if o.startswith(TEMP_NAME):
                    assert False, '%s found in os.environ' % TEMP_NAME

        assert os.environ[TEMP_NAME] == ev
    finally:
        if TEMP_NAME in os.environ:
            del os.environ[TEMP_NAME]

def test_no_env_ok_if_not_exists():
    if TEMP_NAME in os.environ:
        del os.environ[TEMP_NAME]
    with env.no_env(TEMP_NAME):
        out = run.run('env', capture_stdout=True)
        for o in out.split('\n'):
            if o.startswith(TEMP_NAME):
                assert False, '%s found in os.environ' % TEMP_NAME

    assert TEMP_NAME not in os.environ

{'repo_name': 'man-group/pytest-plugins', 'stars': '327', 'repo_language': 'Python', 'file_name': 'test_example.py', 'mime_type': 'text/x-python', 'hash': -8760569770439410580, 'source_dataset': 'data'}