// WebAssemblyInstrInfo.td-Describe the WebAssembly Instructions-*- tablegen -*-
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
/// \file
/// WebAssembly Instruction definitions.
///
//===----------------------------------------------------------------------===//

//===----------------------------------------------------------------------===//
// WebAssembly Instruction Predicate Definitions.
//===----------------------------------------------------------------------===//

def IsPIC     : Predicate<"TM.isPositionIndependent()">;
def IsNotPIC  : Predicate<"!TM.isPositionIndependent()">;

def HasAddr32 : Predicate<"!Subtarget->hasAddr64()">;

def HasAddr64 : Predicate<"Subtarget->hasAddr64()">;

def HasSIMD128 :
    Predicate<"Subtarget->hasSIMD128()">,
    AssemblerPredicate<"FeatureSIMD128", "simd128">;

def HasUnimplementedSIMD128 :
    Predicate<"Subtarget->hasUnimplementedSIMD128()">,
    AssemblerPredicate<"FeatureUnimplementedSIMD128", "unimplemented-simd128">;

def HasAtomics :
    Predicate<"Subtarget->hasAtomics()">,
    AssemblerPredicate<"FeatureAtomics", "atomics">;

def HasMultivalue :
    Predicate<"Subtarget->hasMultivalue()">,
    AssemblerPredicate<"FeatureMultivalue", "multivalue">;

def HasNontrappingFPToInt :
    Predicate<"Subtarget->hasNontrappingFPToInt()">,
    AssemblerPredicate<"FeatureNontrappingFPToInt", "nontrapping-fptoint">;

def NotHasNontrappingFPToInt :
    Predicate<"!Subtarget->hasNontrappingFPToInt()">,
    AssemblerPredicate<"!FeatureNontrappingFPToInt", "nontrapping-fptoint">;

def HasSignExt :
    Predicate<"Subtarget->hasSignExt()">,
    AssemblerPredicate<"FeatureSignExt", "sign-ext">;

def HasTailCall :
    Predicate<"Subtarget->hasTailCall()">,
    AssemblerPredicate<"FeatureTailCall", "tail-call">;

def HasExceptionHandling :
    Predicate<"Subtarget->hasExceptionHandling()">,
    AssemblerPredicate<"FeatureExceptionHandling", "exception-handling">;

def HasBulkMemory :
    Predicate<"Subtarget->hasBulkMemory()">,
    AssemblerPredicate<"FeatureBulkMemory", "bulk-memory">;

//===----------------------------------------------------------------------===//
// WebAssembly-specific DAG Node Types.
//===----------------------------------------------------------------------===//

def SDT_WebAssemblyCallSeqStart : SDCallSeqStart<[SDTCisVT<0, iPTR>,
                                                  SDTCisVT<1, iPTR>]>;
def SDT_WebAssemblyCallSeqEnd :
    SDCallSeqEnd<[SDTCisVT<0, iPTR>, SDTCisVT<1, iPTR>]>;
def SDT_WebAssemblyCall0      : SDTypeProfile<0, -1, [SDTCisPtrTy<0>]>;
def SDT_WebAssemblyCall1      : SDTypeProfile<1, -1, [SDTCisPtrTy<1>]>;
def SDT_WebAssemblyBrTable    : SDTypeProfile<0, -1, [SDTCisPtrTy<0>]>;
def SDT_WebAssemblyArgument   : SDTypeProfile<1, 1, [SDTCisVT<1, i32>]>;
def SDT_WebAssemblyReturn     : SDTypeProfile<0, -1, []>;
def SDT_WebAssemblyWrapper    : SDTypeProfile<1, 1, [SDTCisSameAs<0, 1>,
                                                     SDTCisPtrTy<0>]>;
def SDT_WebAssemblyWrapperPIC : SDTypeProfile<1, 1, [SDTCisSameAs<0, 1>,
                                                     SDTCisPtrTy<0>]>;
def SDT_WebAssemblyThrow      : SDTypeProfile<0, -1, [SDTCisPtrTy<0>]>;

//===----------------------------------------------------------------------===//
// WebAssembly-specific DAG Nodes.
//===----------------------------------------------------------------------===//

def WebAssemblycallseq_start :
    SDNode<"ISD::CALLSEQ_START", SDT_WebAssemblyCallSeqStart,
           [SDNPHasChain, SDNPOutGlue]>;
def WebAssemblycallseq_end :
    SDNode<"ISD::CALLSEQ_END", SDT_WebAssemblyCallSeqEnd,
           [SDNPHasChain, SDNPOptInGlue, SDNPOutGlue]>;
def WebAssemblycall0 : SDNode<"WebAssemblyISD::CALL0",
                              SDT_WebAssemblyCall0,
                              [SDNPHasChain, SDNPVariadic]>;
def WebAssemblycall1 : SDNode<"WebAssemblyISD::CALL1",
                              SDT_WebAssemblyCall1,
                              [SDNPHasChain, SDNPVariadic]>;
def WebAssemblyretcall : SDNode<"WebAssemblyISD::RET_CALL",
                                SDT_WebAssemblyCall0,
                                [SDNPHasChain, SDNPVariadic]>;
def WebAssemblybr_table : SDNode<"WebAssemblyISD::BR_TABLE",
                                 SDT_WebAssemblyBrTable,
                                 [SDNPHasChain, SDNPVariadic]>;
def WebAssemblyargument : SDNode<"WebAssemblyISD::ARGUMENT",
                                 SDT_WebAssemblyArgument>;
def WebAssemblyreturn   : SDNode<"WebAssemblyISD::RETURN",
                                 SDT_WebAssemblyReturn,
                                 [SDNPHasChain, SDNPVariadic]>;
def WebAssemblywrapper  : SDNode<"WebAssemblyISD::Wrapper",
                                 SDT_WebAssemblyWrapper>;
def WebAssemblywrapperPIC  : SDNode<"WebAssemblyISD::WrapperPIC",
                                     SDT_WebAssemblyWrapperPIC>;
def WebAssemblythrow : SDNode<"WebAssemblyISD::THROW", SDT_WebAssemblyThrow,
                              [SDNPHasChain, SDNPVariadic]>;

//===----------------------------------------------------------------------===//
// WebAssembly-specific Operands.
//===----------------------------------------------------------------------===//

// Default Operand has AsmOperandClass "Imm" which is for integers (and
// symbols), so specialize one for floats:
def FPImmAsmOperand : AsmOperandClass {
  let Name = "FPImm";
  let PredicateMethod = "isFPImm";
}

class FPOperand<ValueType ty> : Operand<ty> {
  AsmOperandClass ParserMatchClass = FPImmAsmOperand;
}

let OperandNamespace = "WebAssembly" in {

let OperandType = "OPERAND_BASIC_BLOCK" in
def bb_op : Operand<OtherVT>;

let OperandType = "OPERAND_LOCAL" in
def local_op : Operand<i32>;

let OperandType = "OPERAND_GLOBAL" in
def global_op : Operand<i32>;

let OperandType = "OPERAND_I32IMM" in
def i32imm_op : Operand<i32>;

let OperandType = "OPERAND_I64IMM" in
def i64imm_op : Operand<i64>;

let OperandType = "OPERAND_F32IMM" in
def f32imm_op : FPOperand<f32>;

let OperandType = "OPERAND_F64IMM" in
def f64imm_op : FPOperand<f64>;

let OperandType = "OPERAND_VEC_I8IMM" in
def vec_i8imm_op : Operand<i32>;

let OperandType = "OPERAND_VEC_I16IMM" in
def vec_i16imm_op : Operand<i32>;

let OperandType = "OPERAND_VEC_I32IMM" in
def vec_i32imm_op : Operand<i32>;

let OperandType = "OPERAND_VEC_I64IMM" in
def vec_i64imm_op : Operand<i64>;

let OperandType = "OPERAND_FUNCTION32" in
def function32_op : Operand<i32>;

let OperandType = "OPERAND_OFFSET32" in
def offset32_op : Operand<i32>;

let OperandType = "OPERAND_P2ALIGN" in {
def P2Align : Operand<i32> {
  let PrintMethod = "printWebAssemblyP2AlignOperand";
}

let OperandType = "OPERAND_EVENT" in
def event_op : Operand<i32>;

} // OperandType = "OPERAND_P2ALIGN"

let OperandType = "OPERAND_SIGNATURE" in
def Signature : Operand<i32> {
  let PrintMethod = "printWebAssemblySignatureOperand";
}

let OperandType = "OPERAND_TYPEINDEX" in
def TypeIndex : Operand<i32>;

} // OperandNamespace = "WebAssembly"

//===----------------------------------------------------------------------===//
// WebAssembly Register to Stack instruction mapping
//===----------------------------------------------------------------------===//

class StackRel;
def getStackOpcode : InstrMapping {
  let FilterClass = "StackRel";
  let RowFields = ["BaseName"];
  let ColFields = ["StackBased"];
  let KeyCol = ["false"];
  let ValueCols = [["true"]];
}

//===----------------------------------------------------------------------===//
// WebAssembly Instruction Format Definitions.
//===----------------------------------------------------------------------===//

include "WebAssemblyInstrFormats.td"

//===----------------------------------------------------------------------===//
// Additional instructions.
//===----------------------------------------------------------------------===//

multiclass ARGUMENT<WebAssemblyRegClass reg, ValueType vt> {
  let hasSideEffects = 1, isCodeGenOnly = 1, Defs = []<Register>,
      Uses = [ARGUMENTS] in
  defm ARGUMENT_#vt :
    I<(outs reg:$res), (ins i32imm:$argno), (outs), (ins i32imm:$argno),
      [(set (vt reg:$res), (WebAssemblyargument timm:$argno))]>;
}
defm "": ARGUMENT<I32, i32>;
defm "": ARGUMENT<I64, i64>;
defm "": ARGUMENT<F32, f32>;
defm "": ARGUMENT<F64, f64>;
defm "": ARGUMENT<EXNREF, exnref>;

// local.get and local.set are not generated by instruction selection; they
// are implied by virtual register uses and defs.
multiclass LOCAL<WebAssemblyRegClass vt> {
  let hasSideEffects = 0 in {
  // COPY is not an actual instruction in wasm, but since we allow local.get and
  // local.set to be implicit during most of codegen, we can have a COPY which
  // is actually a no-op because all the work is done in the implied local.get
  // and local.set. COPYs are eliminated (and replaced with
  // local.get/local.set) in the ExplicitLocals pass.
  let isAsCheapAsAMove = 1, isCodeGenOnly = 1 in
  defm COPY_#vt : I<(outs vt:$res), (ins vt:$src), (outs), (ins), [],
                    "local.copy\t$res, $src", "local.copy">;

  // TEE is similar to COPY, but writes two copies of its result. Typically
  // this would be used to stackify one result and write the other result to a
  // local.
  let isAsCheapAsAMove = 1, isCodeGenOnly = 1 in
  defm TEE_#vt : I<(outs vt:$res, vt:$also), (ins vt:$src), (outs), (ins), [],
                   "local.tee\t$res, $also, $src", "local.tee">;

  // This is the actual local.get instruction in wasm. These are made explicit
  // by the ExplicitLocals pass. It has mayLoad because it reads from a wasm
  // local, which is a side effect not otherwise modeled in LLVM.
  let mayLoad = 1, isAsCheapAsAMove = 1 in
  defm LOCAL_GET_#vt : I<(outs vt:$res), (ins local_op:$local),
                         (outs), (ins local_op:$local), [],
                         "local.get\t$res, $local", "local.get\t$local", 0x20>;

  // This is the actual local.set instruction in wasm. These are made explicit
  // by the ExplicitLocals pass. It has mayStore because it writes to a wasm
  // local, which is a side effect not otherwise modeled in LLVM.
  let mayStore = 1, isAsCheapAsAMove = 1 in
  defm LOCAL_SET_#vt : I<(outs), (ins local_op:$local, vt:$src),
                         (outs), (ins local_op:$local), [],
                         "local.set\t$local, $src", "local.set\t$local", 0x21>;

  // This is the actual local.tee instruction in wasm. TEEs are turned into
  // LOCAL_TEEs by the ExplicitLocals pass. It has mayStore for the same reason
  // as LOCAL_SET.
  let mayStore = 1, isAsCheapAsAMove = 1 in
  defm LOCAL_TEE_#vt : I<(outs vt:$res), (ins local_op:$local, vt:$src),
                         (outs), (ins local_op:$local), [],
                         "local.tee\t$res, $local, $src", "local.tee\t$local",
                         0x22>;

  // Unused values must be dropped in some contexts.
  defm DROP_#vt : I<(outs), (ins vt:$src), (outs), (ins), [],
                    "drop\t$src", "drop", 0x1a>;

  let mayLoad = 1 in
  defm GLOBAL_GET_#vt : I<(outs vt:$res), (ins global_op:$local),
                          (outs), (ins global_op:$local), [],
                          "global.get\t$res, $local", "global.get\t$local",
                          0x23>;

  let mayStore = 1 in
  defm GLOBAL_SET_#vt : I<(outs), (ins global_op:$local, vt:$src),
                          (outs), (ins global_op:$local), [],
                          "global.set\t$local, $src", "global.set\t$local",
                          0x24>;

} // hasSideEffects = 0
}
defm "" : LOCAL<I32>;
defm "" : LOCAL<I64>;
defm "" : LOCAL<F32>;
defm "" : LOCAL<F64>;
defm "" : LOCAL<V128>, Requires<[HasSIMD128]>;
defm "" : LOCAL<EXNREF>, Requires<[HasExceptionHandling]>;

let isMoveImm = 1, isAsCheapAsAMove = 1, isReMaterializable = 1 in {
defm CONST_I32 : I<(outs I32:$res), (ins i32imm_op:$imm),
                   (outs), (ins i32imm_op:$imm),
                   [(set I32:$res, imm:$imm)],
                   "i32.const\t$res, $imm", "i32.const\t$imm", 0x41>;
defm CONST_I64 : I<(outs I64:$res), (ins i64imm_op:$imm),
                   (outs), (ins i64imm_op:$imm),
                   [(set I64:$res, imm:$imm)],
                   "i64.const\t$res, $imm", "i64.const\t$imm", 0x42>;
defm CONST_F32 : I<(outs F32:$res), (ins f32imm_op:$imm),
                   (outs), (ins f32imm_op:$imm),
                   [(set F32:$res, fpimm:$imm)],
                   "f32.const\t$res, $imm", "f32.const\t$imm", 0x43>;
defm CONST_F64 : I<(outs F64:$res), (ins f64imm_op:$imm),
                   (outs), (ins f64imm_op:$imm),
                   [(set F64:$res, fpimm:$imm)],
                   "f64.const\t$res, $imm", "f64.const\t$imm", 0x44>;
} // isMoveImm = 1, isAsCheapAsAMove = 1, isReMaterializable = 1

def : Pat<(i32 (WebAssemblywrapper tglobaladdr:$addr)),
          (CONST_I32 tglobaladdr:$addr)>, Requires<[IsNotPIC]>;

def : Pat<(i32 (WebAssemblywrapper tglobaladdr:$addr)),
          (GLOBAL_GET_I32 tglobaladdr:$addr)>, Requires<[IsPIC]>;

def : Pat<(i32 (WebAssemblywrapperPIC tglobaladdr:$addr)),
          (CONST_I32 tglobaladdr:$addr)>, Requires<[IsPIC]>;

def : Pat<(i32 (WebAssemblywrapper texternalsym:$addr)),
          (GLOBAL_GET_I32 texternalsym:$addr)>, Requires<[IsPIC]>;

def : Pat<(i32 (WebAssemblywrapper texternalsym:$addr)),
          (CONST_I32 texternalsym:$addr)>, Requires<[IsNotPIC]>;

def : Pat<(i32 (WebAssemblywrapper mcsym:$sym)), (CONST_I32 mcsym:$sym)>;
def : Pat<(i64 (WebAssemblywrapper mcsym:$sym)), (CONST_I64 mcsym:$sym)>;

//===----------------------------------------------------------------------===//
// Additional sets of instructions.
//===----------------------------------------------------------------------===//

include "WebAssemblyInstrMemory.td"
include "WebAssemblyInstrCall.td"
include "WebAssemblyInstrControl.td"
include "WebAssemblyInstrInteger.td"
include "WebAssemblyInstrConv.td"
include "WebAssemblyInstrFloat.td"
include "WebAssemblyInstrAtomics.td"
include "WebAssemblyInstrSIMD.td"
include "WebAssemblyInstrRef.td"
include "WebAssemblyInstrBulkMemory.td"

{'repo_name': 'earl/llvm-mirror', 'stars': '122', 'repo_language': 'LLVM', 'file_name': 'registers_readonly.s', 'mime_type': 'text/plain', 'hash': 1041134826541203732, 'source_dataset': 'data'}


const fs = `
precision highp float;

uniform sampler2D texture;
uniform float isParticle;

varying float vDepth;
varying float vColor;

void main() {
  float d = 2.*clamp(length(.5-gl_PointCoord.xy),0.,1.);
  if(d>1.) {
    discard;
  }
    d = 1.-smoothstep(.5-.5*vDepth,.5+.5*vDepth, d);
  if(isParticle==1.){
    gl_FragColor.rgb = vec3(vColor + .2);
  } else {
    gl_FragColor.rgb = vec3(vColor);
  }
  gl_FragColor.a = d;
}`;

export { fs };

{'repo_name': 'spite/looper', 'stars': '866', 'repo_language': 'JavaScript', 'file_name': 'THREE.OBJLoader.js', 'mime_type': 'text/x-java', 'hash': 8201226233462942342, 'source_dataset': 'data'}


/*
  Copyright 1999-2017 ImageMagick Studio LLC, a non-profit organization
  dedicated to making software imaging solutions freely available.

  You may not use this file except in compliance with the License.
  obtain a copy of the License at

    http://www.imagemagick.org/script/license.php

  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.

  MagickCore digital signature methods.
*/
#ifndef MAGICKCORE_SIGNATURE_H
#define MAGICKCORE_SIGNATURE_H

#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif

extern MagickExport MagickBooleanType
  SignatureImage(Image *);

#if defined(__cplusplus) || defined(c_plusplus)
}
#endif

#endif

{'repo_name': 'xiaobocser/Mac-command-wallpaper', 'stars': '204', 'repo_language': 'Shell', 'file_name': 'magick-baseconfig.h', 'mime_type': 'text/x-c', 'hash': 3678725273390889338, 'source_dataset': 'data'}


#!/usr/bin/env python
#
# download and unpack a riot-web tarball.
#
# Allows `bundles` to be extracted to a common directory, and a link to
# config.json to be added.

from __future__ import print_function

import argparse
import os
import os.path
import subprocess
import sys
import tarfile
import shutil
import glob

try:
    # python3
    from urllib.request import urlretrieve
except ImportError:
    # python2
    from urllib import urlretrieve

class DeployException(Exception):
    pass

def create_relative_symlink(linkname, target):
    relpath = os.path.relpath(target, os.path.dirname(linkname))
    print ("Symlink %s -> %s" % (linkname, relpath))
    os.symlink(relpath, linkname)

def move_bundles(source, dest):
    """Move the contents of the 'bundles' directory to a common dir

    We check that we will not be overwriting anything before we proceed.

    Args:
        source (str): path to 'bundles' within the extracted tarball
        dest (str): target common directory
    """

    if not os.path.isdir(dest):
        os.mkdir(dest)

    # build a map from source to destination, checking for non-existence as we go.
    renames = {}
    for f in os.listdir(source):
        dst = os.path.join(dest, f)
        if os.path.exists(dst):
            print (
                "Skipping bundle. The bundle includes '%s' which we have previously deployed."
                % f
            )
        else:
            renames[os.path.join(source, f)] = dst

    for (src, dst) in renames.iteritems():
        print ("Move %s -> %s" % (src, dst))
        os.rename(src, dst)

class Deployer:
    def __init__(self):
        self.packages_path = "."
        self.bundles_path = None
        self.should_clean = False
        # filename -> symlink path e.g 'config.localhost.json' => '../localhost/config.json'
        self.symlink_paths = {}
        self.verify_signature = True

    def deploy(self, tarball, extract_path):
        """Download a tarball if necessary, and unpack it

        Returns:
            (str) the path to the unpacked deployment
        """
        print("Deploying %s to %s" % (tarball, extract_path))

        name_str = os.path.basename(tarball).replace(".tar.gz", "")
        extracted_dir = os.path.join(extract_path, name_str)
        if os.path.exists(extracted_dir):
            raise DeployException('Cannot unpack %s: %s already exists' % (
                tarball, extracted_dir))

        downloaded = False
        if tarball.startswith("http://") or tarball.startswith("https://"):
            tarball = self.download_and_verify(tarball)
            print("Downloaded file: %s" % tarball)
            downloaded = True

        try:
            with tarfile.open(tarball) as tar:
                tar.extractall(extract_path)
        finally:
            if self.should_clean and downloaded:
                os.remove(tarball)

        print ("Extracted into: %s" % extracted_dir)

        if self.symlink_paths:
            for link_path, file_path in self.symlink_paths.iteritems():
                create_relative_symlink(
                    target=file_path,
                    linkname=os.path.join(extracted_dir, link_path)
                )

        if self.bundles_path:
            extracted_bundles = os.path.join(extracted_dir, 'bundles')
            move_bundles(source=extracted_bundles, dest=self.bundles_path)

            # replace the extracted_bundles dir (which may not be empty if some
            # bundles were skipped) with a symlink to the common dir.
            shutil.rmtree(extracted_bundles)
            create_relative_symlink(
                target=self.bundles_path,
                linkname=extracted_bundles,
            )
        return extracted_dir

    def download_and_verify(self, url):
        tarball = self.download_file(url)

        if self.verify_signature:
            sigfile = self.download_file(url + ".asc")
            subprocess.check_call(["gpg", "--verify", sigfile, tarball])

        return tarball

    def download_file(self, url):
        if not os.path.isdir(self.packages_path):
            os.mkdir(self.packages_path)
        local_filename = os.path.join(self.packages_path,
                                      url.split('/')[-1])
        sys.stdout.write("Downloading %s -> %s..." % (url, local_filename))
        sys.stdout.flush()
        urlretrieve(url, local_filename)
        print ("Done")
        return local_filename

if __name__ == "__main__":
    parser = argparse.ArgumentParser("Deploy a Riot build on a web server.")
    parser.add_argument(
        "-p", "--packages-dir", default="./packages", help=(
            "The directory to download the tarball into. (Default: '%(default)s')"
        )
    )
    parser.add_argument(
        "-e", "--extract-path", default="./deploys", help=(
            "The location to extract .tar.gz files to. (Default: '%(default)s')"
        )
    )
    parser.add_argument(
        "-b", "--bundles-dir", nargs='?', default="./bundles", help=(
            "A directory to move the contents of the 'bundles' directory to. A \
            symlink to the bundles directory will also be written inside the \
            extracted tarball. Example: './bundles'. \
            (Default: '%(default)s')"
        )
    )
    parser.add_argument(
        "-c", "--clean", action="store_true", default=False, help=(
            "Remove .tar.gz files after they have been downloaded and extracted. \
            (Default: %(default)s)"
        )
    )
    parser.add_argument(
        "--include", nargs='*', default=['./config*.json'], help=(
            "Symlink these files into the root of the deployed tarball. \
             Useful for config files and home pages. Supports glob syntax. \
             (Default: '%(default)s')"
        )
    )
    parser.add_argument(
        "tarball", help=(
            "filename of tarball, or URL to download."
        ),
    )

    args = parser.parse_args()

    deployer = Deployer()
    deployer.packages_path = args.packages_dir
    deployer.bundles_path = args.bundles_dir
    deployer.should_clean = args.clean

    for include in args.include:
        deployer.symlink_paths.update({ os.path.basename(pth): pth for pth in glob.iglob(include) })

    deployer.deploy(args.tarball, args.extract_path)

{'repo_name': 'vector-im/riot-web', 'stars': '5228', 'repo_language': 'HTML', 'file_name': 'joining-test.js', 'mime_type': 'text/x-java', 'hash': 2442721496626802498, 'source_dataset': 'data'}


class Trend extends Node {
  PImage imgText;
  float animaTime, animation, animationColor;
  Trend(Node parent, float x, float y, float s, String name) {
    super(parent, x, y, s, name);
    timeHide = int(60*ui.tiempoTrend);
    vs = 0.04;
    animaTime = 50;

    createText();
  }

  void update() {
    super.update();

    timeHide = int(60*ui.tiempoTrend);

    if (click && text != null) {
      textView.setTrend(this);
    }

    if (toParent) {
      x += (parent.x-x)*0.2;
      y += (parent.y-y)*0.2;
      s *= 0.8;
    } else {
      if (drag) {
        x = touch.cx;
        y = touch.cy;
      } else {
        elasticMovement();
      }
    }

    if (view) {
      for (int i = 0; i < nodes.size (); i++) {
        nodes.get(i).update();
      }
    }
    animation = 1;
    if (parent.time < animaTime) {
      animation = map(parent.time, 0, animaTime, 0, 1);
    }
    if (timeLive < animaTime) {
      animation = map(timeLive, 0, animaTime, 0, 1);
    } else {
      if (animation < 0.3) {
        active = false;
        toParent = true;
      }
    }
    animation = constrain(animation, 0, 1);
  }

  void show() {
    if (view) drawSubNodes();

    noStroke();
    fill(colorBlack, 33);
    ellipse(x, y, s*2.1, s*2.1);
    fill(colorBlack);
    if (view) {
      /*
      float ani = (time < 20)? time/20. : (timeHide-time)/20.;
       color col = lerpColor(colorBlack, colorGreen, ani);
       fill(col);
       */
      fill(colorGreen);
    } else {
      fill(colorBlack);
    }
    ellipse(x, y, s, s);
  }

  void showText() {
    float alp = 512*animation-256;
    tint(255, alp);
    float des = (s*0.5+5);
    float da = 0;
    float angle = ang;
    if (parent instanceof Trend) angle = parent.ang;
    if (angle <= -HALF_PI || angle > HALF_PI) {
      des *= -1;
      des -= imgText.width;
      da = PI;
    }
    if (textRotate) {
      pushMatrix();
      float dx = cos(ang+da)*des;
      float dy = sin(ang+da)*des;
      translate(x+dx, y+dy);
      rotate(ang+da);
      image(imgText, 0, 0);
      popMatrix();
    } else {
      image(imgText, x+des, y-imgText.height/2);
    }
    noTint();
    /*
    float alp = 512*animation-256;
     fill(colorWhite, alp);
     if (parent instanceof Cell) textFont(fontMedium);
     else textFont(fontMedium2);
     float des = (s*0.5+5);
     float da = 0;
     float angle = ang;
     if (parent instanceof Trend) angle = parent.ang;
     if (angle > -HALF_PI && angle <= HALF_PI) {
     textAlign(LEFT, BASELINE);
     } else {
     textAlign(RIGHT, BASELINE);
     des *= -1;
     da = PI;
     }
     if (textRotate) {
     pushMatrix();
     float dx = cos(ang+da)*des;
     float dy = sin(ang+da)*des;
     translate(x+dx, y+dy);
     rotate(ang+da);
     text(name, 0, 0);
     popMatrix();
     } else {
     text(name, x+des, y);
     }
     textAlign(LEFT, BASELINE);

     */

    for (int i = 0; i < nodes.size (); i++) {
      Node n = nodes.get(i);
      if (n != select) n.showText();
    }
    if (select != null)select.showText();
  }

  void drawSubNodes() {
    for (int i = 0; i < nodes.size (); i++) {
      Node n = nodes.get(i);
      strokeWeight(2);
      stroke(colorGreen);
      line(x, y, n.x, n.y);
    }

    for (int i = 0; i < nodes.size (); i++) {
      Node n = nodes.get(i);
      if (n != select) n.show();
    }
    if (select != null)select.show();
  }

  void createText() {
    if (parent instanceof Cell) textFont(fontMedium);
    else textFont(fontMedium2);
    int ww = int(textWidth(name)+2);
    int hh = 12;
    if (parent instanceof Cell) hh = 17;
    PGraphics aux = createGraphics(ww, hh);
    aux.beginDraw();
    if (parent instanceof Cell) aux.textFont(fontMedium);
    else aux.textFont(fontMedium2);
    //aux.background(255, 0, 0);
    aux.fill(255);
    aux.textAlign(LEFT, TOP);
    aux.text(name, 0, 0);
    aux.endDraw();
    imgText = aux.get();
  }
}

{'repo_name': 'manoloide/AllSketchs', 'stars': '393', 'repo_language': 'Processing', 'file_name': 'ordeco.np', 'mime_type': 'text/plain', 'hash': 2501373171226525242, 'source_dataset': 'data'}


    Details
    Submodule
    Event
    Time

        <button class="toggle-button">Toggle Display</button>

{'repo_name': 'nwjs/chromium.src', 'stars': '111', 'repo_language': 'None', 'file_name': 'AndroidManifest.xml', 'mime_type': 'text/xml', 'hash': -5564191318079850261, 'source_dataset': 'data'}


//---------------------------------------------------------------------------//
// Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
//
// Distributed under 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
//
// See http://boostorg.github.com/compute for more information.
//---------------------------------------------------------------------------//

#ifndef BOOST_COMPUTE_ALLOCATOR_BUFFER_ALLOCATOR_HPP
#define BOOST_COMPUTE_ALLOCATOR_BUFFER_ALLOCATOR_HPP

#include <boost/compute/buffer.hpp>
#include <boost/compute/config.hpp>
#include <boost/compute/context.hpp>
#include <boost/compute/detail/device_ptr.hpp>

namespace boost {
namespace compute {

/// \class buffer_allocator
/// \brief The buffer_allocator class allocates memory with \ref buffer objects
///
/// \see buffer
template<class T>
class buffer_allocator
{
public:
    typedef T value_type;
    typedef detail::device_ptr<T> pointer;
    typedef const detail::device_ptr<T> const_pointer;
    typedef std::size_t size_type;
    typedef std::ptrdiff_t difference_type;

    explicit buffer_allocator(const context &context)
        : m_context(context),
          m_mem_flags(buffer::read_write)
    {
    }

    buffer_allocator(const buffer_allocator<T> &other)
        : m_context(other.m_context),
          m_mem_flags(other.m_mem_flags)
    {
    }

    buffer_allocator<T>& operator=(const buffer_allocator<T> &other)
    {
        if(this != &other){
            m_context = other.m_context;
            m_mem_flags = other.m_mem_flags;
        }

        return *this;
    }

    #ifndef BOOST_COMPUTE_NO_RVALUE_REFERENCES
    buffer_allocator(buffer_allocator<T>&& other) BOOST_NOEXCEPT
        : m_context(std::move(other.m_context)),
          m_mem_flags(other.m_mem_flags)
    {
    }

    buffer_allocator<T>& operator=(buffer_allocator<T>&& other) BOOST_NOEXCEPT
    {
        m_context = std::move(other.m_context);
        m_mem_flags = other.m_mem_flags;

        return *this;
    }
    #endif // BOOST_COMPUTE_NO_RVALUE_REFERENCES

    ~buffer_allocator()
    {
    }

    pointer allocate(size_type n)
    {
        buffer buf(m_context, n * sizeof(T), m_mem_flags);
        clRetainMemObject(buf.get());
        return detail::device_ptr<T>(buf);
    }

    void deallocate(pointer p, size_type n)
    {
        BOOST_ASSERT(p.get_buffer().get_context() == m_context);

        (void) n;

        clReleaseMemObject(p.get_buffer().get());
    }

    size_type max_size() const
    {
        return m_context.get_device().max_memory_alloc_size() / sizeof(T);
    }

    context get_context() const
    {
        return m_context;
    }

protected:
    void set_mem_flags(cl_mem_flags flags)
    {
        m_mem_flags = flags;
    }

private:
    context m_context;
    cl_mem_flags m_mem_flags;
};

} // end compute namespace
} // end boost namespace

#endif // BOOST_COMPUTE_ALLOCATOR_BUFFER_ALLOCATOR_HPP

{'repo_name': 'stan-dev/math', 'stars': '437', 'repo_language': 'C++', 'file_name': 'eigen-license.txt', 'mime_type': 'text/plain', 'hash': -8136832271567602442, 'source_dataset': 'data'}


#ifndef _WIN32
# include <errno.h>
# include <sys/time.h>
# include <sys/resource.h>
# include <time.h>
#endif /* _WIN32 */

#include "uv.h"
#include "clocks.h"
#include "wasi_types.h"
#include "uv_mapping.h"

#define UVWASI__WIN_TIME_AND_RETURN(handle, time)                             \
  do {                                                                        \
    FILETIME create;                                                          \
    FILETIME exit;                                                            \
    FILETIME system;                                                          \
    FILETIME user;                                                            \
    SYSTEMTIME sys_system;                                                    \
    SYSTEMTIME sys_user;                                                      \
    if (0 == GetProcessTimes((handle), &create, &exit, &system, &user)) {     \
      return uvwasi__translate_uv_error(                                      \
        uv_translate_sys_error(GetLastError())                                \
      );                                                                      \
    }                                                                         \
                                                                              \
    if (0 == FileTimeToSystemTime(&system, &sys_system)) {                    \
      return uvwasi__translate_uv_error(                                      \
        uv_translate_sys_error(GetLastError())                                \
      );                                                                      \
    }                                                                         \
                                                                              \
    if (0 == FileTimeToSystemTime(&user, &sys_user)) {                        \
      return uvwasi__translate_uv_error(                                      \
        uv_translate_sys_error(GetLastError())                                \
      );                                                                      \
    }                                                                         \
                                                                              \
    (time) = (((sys_system.wHour * 3600) + (sys_system.wMinute * 60) +        \
              sys_system.wSecond) * NANOS_PER_SEC) +                          \
             (sys_system.wMilliseconds * 1000000) +                           \
             (((sys_user.wHour * 3600) + (sys_user.wMinute * 60) +            \
              sys_user.wSecond) * NANOS_PER_SEC) +                            \
             (sys_user.wMilliseconds * 1000000);                              \
    return UVWASI_ESUCCESS;                                                   \
  } while (0)

#define UVWASI__CLOCK_GETTIME_AND_RETURN(clk, time)                           \
  do {                                                                        \
    struct timespec ts;                                                       \
    if (0 != clock_gettime((clk), &ts))                                       \
      return uvwasi__translate_uv_error(uv_translate_sys_error(errno));       \
    (time) = (ts.tv_sec * NANOS_PER_SEC) + ts.tv_nsec;                        \
    return UVWASI_ESUCCESS;                                                   \
  } while (0)

#define UVWASI__GETRUSAGE_AND_RETURN(who, time)                               \
  do {                                                                        \
    struct rusage ru;                                                         \
    if (0 != getrusage((who), &ru))                                           \
      return uvwasi__translate_uv_error(uv_translate_sys_error(errno));       \
    (time) = (ru.ru_utime.tv_sec * NANOS_PER_SEC) +                           \
             (ru.ru_utime.tv_usec * 1000) +                                   \
             (ru.ru_stime.tv_sec * NANOS_PER_SEC) +                           \
             (ru.ru_stime.tv_usec * 1000);                                    \
    return UVWASI_ESUCCESS;                                                   \
  } while (0)

#define UVWASI__OSX_THREADTIME_AND_RETURN(time)                               \
  do {                                                                        \
    mach_port_t thread;                                                       \
    thread_basic_info_data_t info;                                            \
    mach_msg_type_number_t count;                                             \
    count = THREAD_BASIC_INFO_COUNT;                                          \
    thread = pthread_mach_thread_np(pthread_self());                          \
    if (KERN_SUCCESS != thread_info(thread,                                   \
                                    THREAD_BASIC_INFO,                        \
                                    (thread_info_t) &info,                    \
                                    &count)) {                                \
      return UVWASI_ENOSYS;                                                   \
    }                                                                         \
    (time) = (info.user_time.seconds * NANOS_PER_SEC) +                       \
             (info.user_time.microseconds * 1000) +                           \
             (info.system_time.seconds * NANOS_PER_SEC) +                     \
             (info.system_time.microseconds * 1000);                          \
    return UVWASI_ESUCCESS;                                                   \
  } while (0)

#define UVWASI__WIN_GETRES_AND_RETURN(time)                                   \
  do {                                                                        \
    /* The GetProcessTimes() docs claim a resolution of 100 ns. */            \
    (time) = 100;                                                             \
    return UVWASI_ESUCCESS;                                                   \
  } while (0)

#define UVWASI__CLOCK_GETRES_AND_RETURN(clk, time)                            \
  do {                                                                        \
    struct timespec ts;                                                       \
    /* Try calling clock_getres(). If it doesn't succeed, then default to     \
       1000000. We implement all of the clocks, and some platforms (such as   \
       SmartOS) don't support all of the clocks, even though they define      \
       the constants for them. */                                             \
    if (0 != clock_getres((clk), &ts))                                        \
      (time) = 1000000;                                                       \
    else                                                                      \
      (time) = (ts.tv_sec * NANOS_PER_SEC) + ts.tv_nsec;                      \
    return UVWASI_ESUCCESS;                                                   \
  } while (0)

#define UVWASI__SLOW_GETRES_AND_RETURN(time)                                  \
  do {                                                                        \
    /* Assume a "worst case" of 1000000 ns resolution. */                     \
    (time) = 1000000;                                                         \
    return UVWASI_ESUCCESS;                                                   \
  } while (0)

uvwasi_errno_t uvwasi__clock_gettime_realtime(uvwasi_timestamp_t* time) {
  uv_timeval64_t tv;
  int r;

  r = uv_gettimeofday(&tv);
  if (r != 0)
    return uvwasi__translate_uv_error(r);

  *time = (tv.tv_sec * NANOS_PER_SEC) + (tv.tv_usec * 1000);
  return UVWASI_ESUCCESS;
}

uvwasi_errno_t uvwasi__clock_gettime_process_cputime(uvwasi_timestamp_t* time) {
#if defined(_WIN32)
  UVWASI__WIN_TIME_AND_RETURN(GetCurrentProcess(), *time);
#elif defined(CLOCK_PROCESS_CPUTIME_ID) && \
      !defined(__APPLE__)               && \
      !defined(__sun)
  UVWASI__CLOCK_GETTIME_AND_RETURN(CLOCK_PROCESS_CPUTIME_ID, *time);
#else
  UVWASI__GETRUSAGE_AND_RETURN(RUSAGE_SELF, *time);
#endif
}

uvwasi_errno_t uvwasi__clock_gettime_thread_cputime(uvwasi_timestamp_t* time) {
#if defined(_WIN32)
  UVWASI__WIN_TIME_AND_RETURN(GetCurrentThread(), *time);
#elif defined(__APPLE__)
  UVWASI__OSX_THREADTIME_AND_RETURN(*time);
#elif defined(CLOCK_THREAD_CPUTIME_ID) && !defined(__sun) && !defined(__PASE__)
  UVWASI__CLOCK_GETTIME_AND_RETURN(CLOCK_THREAD_CPUTIME_ID, *time);
#else
# if defined(RUSAGE_LWP)
  UVWASI__GETRUSAGE_AND_RETURN(RUSAGE_LWP, *time);
# elif defined(RUSAGE_THREAD)
  UVWASI__GETRUSAGE_AND_RETURN(RUSAGE_THREAD, *time);
# else
  return UVWASI_ENOSYS;
# endif /* RUSAGE_LWP */
#endif
}

uvwasi_errno_t uvwasi__clock_getres_process_cputime(uvwasi_timestamp_t* time) {
#if defined(_WIN32)
  UVWASI__WIN_GETRES_AND_RETURN(*time);
#elif defined(CLOCK_PROCESS_CPUTIME_ID) && \
      !defined(__APPLE__)               && \
      !defined(__sun)
  UVWASI__CLOCK_GETRES_AND_RETURN(CLOCK_PROCESS_CPUTIME_ID, *time);
#else
  UVWASI__SLOW_GETRES_AND_RETURN(*time);
#endif
}

uvwasi_errno_t uvwasi__clock_getres_thread_cputime(uvwasi_timestamp_t* time) {
#if defined(_WIN32)
  UVWASI__WIN_GETRES_AND_RETURN(*time);
#elif defined(__APPLE__)
  UVWASI__SLOW_GETRES_AND_RETURN(*time);
#elif defined(CLOCK_THREAD_CPUTIME_ID) && !defined(__sun) && !defined(__PASE__)
  UVWASI__CLOCK_GETTIME_AND_RETURN(CLOCK_THREAD_CPUTIME_ID, *time);
#elif defined(RUSAGE_THREAD) || defined(RUSAGE_LWP)
  UVWASI__SLOW_GETRES_AND_RETURN(*time);
#else
  return UVWASI_ENOSYS;
#endif
}

{'repo_name': 'nodejs/quic', 'stars': '266', 'repo_language': 'JavaScript', 'file_name': 'd8-worker-shutdown-gc.js', 'mime_type': 'text/plain', 'hash': 6477014926855345550, 'source_dataset': 'data'}


require 'date' unless RUBY_PLATFORM == 'opal'

# Add custom functions to this module that you want to use in your Slim
# templates. Within the template you can invoke them as top-level functions
# just like in Haml.
module Slim::Helpers

  # URIs of external assets.
  FONT_AWESOME_URI     = '//cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css'
  HIGHLIGHTJS_BASE_URI = '//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/'
  KATEX_CSS_URI        = '//cdn.jsdelivr.net/npm/katex@0.8.3/dist/katex.min.css'
  KATEX_JS_URI         = '//cdn.jsdelivr.net/npm/katex@0.8.3/dist/katex.min.js'

  # Defaults
  DEFAULT_HIGHLIGHTJS_THEME = 'github'
  DEFAULT_SECTNUMLEVELS = 3
  DEFAULT_TOCLEVELS = 2

  KATEX_RENDER_CODE = <<-JS.gsub(/\s+/, ' ')
    document.addEventListener("DOMContentLoaded", function() {
      var elements = document.getElementsByClassName("math");
      for (var i = 0; i < elements.length; i++) {
        var el = elements[i];
        if (el.getAttribute("data-lang") !== "tex") {
          continue;
        }
        katex.render(el.textContent.slice(2, -2), el, {
          "displayMode": el.nodeName.toUpperCase() !== "SPAN",
          "throwOnError": false,
        });
      }
    });
  JS

  VOID_ELEMENTS = %w(area base br col command embed hr img input keygen link
                     meta param source track wbr)

  # @return [Logger]
  def log
    @_html5s_logger ||= ::Asciidoctor::Html5s::Logging.default_logger
  end

  ##
  # Captures the given block for later yield.
  #
  # @example Basic capture usage.
  #   - capture
  #     img src=image_uri
  #   - if title?
  #     figure.image
  #       - yield_capture
  #       figcaption =captioned_title
  #   - else
  #     - yield_capture
  #
  # @example Capture with passing parameters.
  #   - capture do |id|
  #     img src=image_uri
  #   - if title?
  #     figure id=@id
  #       - yield_capture
  #       figcaption =caption
  #   - else
  #     - yield_capture @id
  #
  # @see yield_capture
  def capture(&block)
    @_html5s_capture = block
    nil
  end

  ##
  # Yields the captured block (see {#capture}).
  #
  # @param *params parameters to pass to the block.
  # @return A content of the captured block.
  # @see capture
  def yield_capture(*params)
    @_html5s_capture.call(*params) if @_html5s_capture
  end

  ##
  # Creates an HTML tag with the given name and optionally attributes. Can take
  # a block that will run between the opening and closing tags.
  #
  # @param name [#to_s] the name of the tag.
  # @param attributes [Hash] (default: {})
  # @param content [#to_s] the content; +nil+ to call the block. (default: nil).
  # @yield The block of Slim/HTML code within the tag (optional).
  # @return [String] a rendered HTML element.
  #
  def html_tag(name, attributes = {}, content = nil)
    attrs = attributes.inject([]) do |attrs, (k, v)|
      next attrs if !v || v.nil_or_empty?
      v = v.compact.join(' ') if v.is_a? Array
      attrs << (v == true ? k : %(#{k}="#{v}"))
    end
    attrs_str = attrs.empty? ? '' : ' ' + attrs.join(' ')

    if VOID_ELEMENTS.include? name.to_s
      %(<#{name}#{attrs_str}>)
    else
      content ||= yield if block_given?
      %(<#{name}#{attrs_str}>#{content}</#{name}>)
    end
  end

  ##
  # Conditionally wraps a block in an element. If condition is +true+ then it
  # renders the specified tag with optional attributes and the given
  # block inside, otherwise it just renders the block.
  #
  # For example:
  #
  #    = html_tag_if link?, 'a', {class: 'image', href: (attr :link)}
  #      img src='./img/tux.png'
  #
  # will produce:
  #
  #
  #
  #
  #
  # if +link?+ is truthy, and just
  #
  #
  #
  # otherwise.
  #
  # @param condition [Boolean] the condition to test to determine whether to
  #        render the enclosing tag.
  # @param name (see #html_tag)
  # @param attributes (see #html_tag)
  # @param content (see #html_tag)
  # @yield (see #html_tag)
  # @return [String] a rendered HTML fragment.
  #
  def html_tag_if(condition, name, attributes = {}, content = nil, &block)
    if condition
      html_tag name, attributes, content, &block
    else
      content || yield
    end
  end

  ##
  # Wraps a block in a div element with the specified class and optionally
  # the node's +id+ and +role+(s). If the node's +title+ is not empty, then a
  # nested div with the class "title" and the title's content is added as well.
  #
  # @example When @id, @role and @title attributes are set.
  #   = block_with_title :class=>['quote-block', 'center']
  #     blockquote =content
  #
  #

  #
Block Title

  #
Lorem ipsum

  #

  #
  # @example When @id, @role and @title attributes are empty.
  #   = block_with_title :class=>'quote-block center', :style=>style_value(float: 'left')
  #     blockquote =content
  #
  #

  #
Lorem ipsum

  #

  #
  # @example When shorthand style for class attribute is used.
  #   = block_with_title 'quote-block center'
  #     blockquote =content
  #
  #

  #
Lorem ipsum

  #

  #
  # @param attrs [Hash, String] the tag's attributes as Hash),
  #        or the tag's class if it's not a Hash.
  # @param title [String, nil] the title.
  # @yield The block of Slim/HTML code within the tag (optional).
  # @return [String] a rendered HTML fragment.
  #
  def block_with_title(attrs = {}, title = @title, &block)
    if (klass = attrs[:class]).is_a? String
      klass = klass.split(' ')
    end
    attrs[:class] = [klass, role].flatten.uniq
    attrs[:id] = id

    if title.nil_or_empty?
      # XXX quick hack
      nested = is_a?(::Asciidoctor::List) &&
          (parent.is_a?(::Asciidoctor::ListItem) || parent.is_a?(::Asciidoctor::List))
      html_tag_if !nested, :div, attrs, yield
    else
      html_tag :section, attrs do
        [html_tag(:h6, {class: 'block-title'}, title), yield].join("\n")
      end
    end
  end

  def block_with_caption(position = :bottom, attrs = {}, &block)
    if (klass = attrs[:class]).is_a? String
      klass = klass.split(' ')
    end
    attrs[:class] = [klass, role].flatten.uniq
    attrs[:id] = id

    if title.nil_or_empty?
      html_tag :div, attrs, yield
    else
      html_tag :figure, attrs do
        ary = [yield, html_tag(:figcaption) { captioned_title }]
        ary.reverse! if position == :top
        ary.compact.join("\n")
      end
    end
  end

  ##
  # Delimite the given equation as a STEM of the specified type.
  #
  # Note: This is not needed nor used for KaTeX, but keep this for the case
  # user wants to use a different method.
  #
  # @param equation [String] the equation to delimite.
  # @param type [#to_sym] the type of the STEM renderer (latexmath, or asciimath).
  # @return [String] the delimited equation.
  #
  def delimit_stem(equation, type)
    if (@_html5s_stem_type ||= document.attr('html5s-force-stem-type'))
      type = @_html5s_stem_type
    end

    if is_a? ::Asciidoctor::Block
      open, close = ::Asciidoctor::BLOCK_MATH_DELIMITERS[type.to_sym]
    else
      open, close = ::Asciidoctor::INLINE_MATH_DELIMITERS[type.to_sym]
    end

    if !equation.start_with?(open) || !equation.end_with?(close)
      equation = [open, equation, close].join
    end
    equation
  end

  ##
  # Formats the given hash as CSS declarations for an inline style.
  #
  # @example
  #   style_value(text_align: 'right', float: 'left')
  #   => "text-align: right; float: left;"
  #
  #   style_value(text_align: nil, float: 'left')
  #   => "float: left;"
  #
  #   style_value(width: [90, '%'], height: '50px')
  #   => "width: 90%; height: 50px;"
  #
  #   style_value(width: ['120px', 'px'])
  #   => "width: 90px;"
  #
  #   style_value(width: [nil, 'px'])
  #   => nil
  #
  # @param declarations [Hash]
  # @return [String, nil]
  #
  def style_value(declarations)
    decls = []

    declarations.each do |prop, value|
      next if value.nil?

      if value.is_a? Array
        value, unit = value
        next if value.nil?
        value = value.to_s + unit unless value.end_with? unit
      end
      prop = prop.to_s.gsub('_', '-')
      decls << "#{prop}: #{value}"
    end

    decls.empty? ? nil : decls.join('; ') + ';'
  end

  def urlize(*segments)
    path = segments * '/'
    if path.start_with? '//'
      @_html5s_uri_scheme ||= document.attr('asset-uri-scheme', 'https')
      path = "#{@_html5s_uri_scheme}:#{path}" unless @_html5s_uri_scheme.empty?
    end
    normalize_web_path path
  end

  ##
  # Gets the value of the specified attribute in this node.
  #
  # This is just an alias for +attr+ method with disabled _inherit_ to make it
  # more clear.
  #
  # @param name [String, Symbol] the name of the attribute to lookup.
  # @param default_val the value to return if the attribute is not found.
  # @return value of the attribute or +default_val+ if not found.
  #
  def local_attr(name, default_val = nil)
    attr(name, default_val, false)
  end

  ##
  # Checks if the attribute is defined on this node, optionally performing
  # a comparison of its value if +expect_val+ is not nil.
  #
  # This is just an alias for +attr?+ method with disabled _inherit_ to make it
  # more clear.
  #
  # @param name [String, Symbol] the name of the attribute to lookup.
  # @param default_val the expected value of the attribute.
  # @return [Boolean] whether the attribute exists and, if +expect_val+ is
  #   specified, whether the value of the attribute matches the +expect_val+.
  #
  def local_attr?(name, expect_val = nil)
    attr?(name, expect_val, false)
  end

  ##
  # @param index [Integer] the footnote's index.
  # @return [String] footnote id to be used in a link.
  def footnote_id(index = local_attr(:index))
    "_footnote_#{index}"
  end

  ##
  # @param index (see #footnote_id)
  # @return [String] footnoteref id to be used in a link.
  def footnoteref_id(index = local_attr(:index))
    "_footnoteref_#{index}"
  end

  def nowrap?
    'nowrap' if !document.attr?(:prewrap) || option?('nowrap')
  end

  def print_item_content(item)
    wrap = item.blocks? && !item.blocks.all? { |b| b.is_a? ::Asciidoctor::List }
    [ (html_tag_if(wrap, :p) { item.text } if item.text?), item.content ].join
  end

  ##
  # Returns corrected section level.
  #
  # @param sec [Asciidoctor::Section] the section node (default: self).
  # @return [Integer]
  #
  def section_level(sec = self)
    (sec.level == 0 && sec.special) ? 1 : sec.level
  end

  ##
  # Returns the captioned section's title, optionally numbered.
  #
  # @param sec [Asciidoctor::Section] the section node (default: self).
  # @return [String]
  #
  def section_title(sec = self)
    sectnumlevels = document.attr(:sectnumlevels, DEFAULT_SECTNUMLEVELS).to_i

    if sec.numbered && !sec.caption && sec.level <= sectnumlevels
      [sec.sectnum, sec.captioned_title].join(' ')
    else
      sec.captioned_title
    end
  end

  ##
  # @return [String] language of STEM block or inline node (tex or asciimath).
  def stem_lang
    value = (inline? ? type : style).to_s
    value == 'latexmath' ? 'tex' : value
  end

  def link_rel
    'noopener' if option?('noopener') || attr(:window) == '_blank'
  end

  #--------------------------------------------------------
  # block_admonition
  #

  ##
  # @return [Boolean] should be this admonition wrapped in aside element?
  def admonition_aside?
    %w[note tip].include? attr(:name)
  end

  ##
  # @return [String, nil] WAI-ARIA role of this admonition.
  def admonition_aria
    case attr(:name)
    when 'note'
      'note'  # https://www.w3.org/TR/wai-aria/roles#note
    when 'tip'
      'doc-tip'  # https://www.w3.org/TR/dpub-aria-1.0/#doc-tip
    when 'caution', 'important', 'warning'
      'doc-notice'  # https://www.w3.org/TR/dpub-aria-1.0/#doc-notice
    end
  end

  #--------------------------------------------------------
  # block_listing
  #

  ##
  # @return [String] a canonical name of the source-highlighter to be used as
  #         a style class.
  def highlighter
    @_html5s_highlighter ||=
      case (highlighter = document.attr('source-highlighter'))
      when 'coderay'; 'CodeRay'
      when 'highlight.js'; 'highlightjs'
      else highlighter
      end
  end

  ##
  # Returns the callout list attached to this listing node, or +nil+ if none.
  #
  # Note: This variable is set by extension
  # {Asciidoctor::Html5s::AttachedColistTreeprocessor}.
  #
  # @return [Asciidoctor::List, nil]
  def callout_list
    @html5s_colist
  end

  def source_lang
    local_attr :language, false
  end

  #--------------------------------------------------------
  # block_open
  #

  ##
  # Returns +true+ if an abstract block is allowed in this document type,
  # otherwise prints warning and returns +false+.
  def abstract_allowed?
    if result = (parent == document && document.doctype == 'book')
      log.warn 'asciidoctor: WARNING: abstract block cannot be used in a document
without a title when doctype is book. Excluding block content.'
    end
    !result
  end

  ##
  # Returns +true+ if a partintro block is allowed in this context, otherwise
  # prints warning and returns +false+.
  def partintro_allowed?
    if result = (level != 0 || parent.context != :section || document.doctype != 'book')
      log.warn "asciidoctor: ERROR: partintro block can only be used when doctype
is book and it's a child of a book part. Excluding block content."
    end
    !result
  end

  #--------------------------------------------------------
  # block_table
  #

  def autowidth?
    option? :autowidth
  end

  def spread?
    if !autowidth? || local_attr?('width')
      'spread' if attr? :tablepcwidth, 100
    end
  end

  #--------------------------------------------------------
  # block_video
  #

  # @return [Boolean] +true+ if the video should be embedded in an iframe.
  def video_iframe?
    ['vimeo', 'youtube'].include? attr(:poster)
  end

  def video_uri
    case attr(:poster, '').to_sym
    when :vimeo
      params = {
        autoplay: (1 if option? 'autoplay'),
        loop:     (1 if option? 'loop')
      }
      start_anchor = "#at=#{attr :start}" if attr? :start
      "//player.vimeo.com/video/#{attr :target}#{start_anchor}#{url_query params}"

    when :youtube
      video_id, list_id = attr(:target).split('/', 2)
      params = {
        rel:      0,
        start:    (attr :start),
        end:      (attr :end),
        list:     (attr :list, list_id),
        autoplay: (1 if option? 'autoplay'),
        loop:     (1 if option? 'loop'),
        controls: (0 if option? 'nocontrols')
      }
      "//www.youtube.com/embed/#{video_id}#{url_query params}"
    else
      anchor = [attr(:start), attr(:end)].join(',').chomp(',')
      anchor = '#t=' + anchor unless anchor.empty?
      media_uri "#{attr :target}#{anchor}"
    end
  end

  # Formats URL query parameters.
  def url_query(params)
    str = params.map { |k, v|
      next if v.nil? || v.to_s.empty?
      [k, v] * '='
    }.compact.join('&')

    '?' + str unless str.empty?
  end

  #--------------------------------------------------------
  # document
  #

  ##
  # @return [String, nil] the revision date in ISO 8601, or nil if not
  #   available or in invalid format.
  def revdate_iso
    ::Date.parse(revdate).iso8601 if defined? ::Date
  rescue ArgumentError
    nil
  end

  ##
  # Returns HTML meta tag if the given +content+ is not +nil+.
  #
  # @param name [#to_s] the name for the metadata.
  # @param content [#to_s, nil] the value of the metadata, or +nil+.
  # @return [String, nil] the meta tag, or +nil+ if the +content+ is +nil+.
  #
  def html_meta_if(name, content)
    %(<meta name="#{name}" content="#{content}">) if content
  end

  # Returns formatted style/link and script tags for header.
  def styles_and_scripts
    scripts = []
    styles = []
    tags = []

    stylesheet = attr :stylesheet
    stylesdir = attr :stylesdir, ''
    default_style = ::Asciidoctor::DEFAULT_STYLESHEET_KEYS.include? stylesheet
    linkcss = attr?(:linkcss) || safe >= ::Asciidoctor::SafeMode::SECURE
    ss = ::Asciidoctor::Stylesheets.instance

    if linkcss
      path = default_style ? ::Asciidoctor::DEFAULT_STYLESHEET_NAME : stylesheet
      styles << { href: [stylesdir, path] }
    elsif default_style
      styles << { text: ss.primary_stylesheet_data }
    else
      styles << { text: read_asset(normalize_system_path(stylesheet, stylesdir), true) }
    end

    if attr? :icons, 'font'
      if attr? 'iconfont-remote'
        styles << { href: attr('iconfont-cdn', FONT_AWESOME_URI) }
      else
        styles << { href: [stylesdir, "#{attr 'iconfont-name', 'font-awesome'}.css"] }
      end
    end

    if attr? 'stem'
      styles << { href: KATEX_CSS_URI }
      scripts << { src: KATEX_JS_URI }
      scripts << { text: KATEX_RENDER_CODE }
    end

    case attr 'source-highlighter'
    when 'coderay'
      if attr('coderay-css', 'class') == 'class'
        if linkcss
          styles << { href: [stylesdir, ss.coderay_stylesheet_name] }
        else
          styles << { text: ss.coderay_stylesheet_data }
        end
      end

    when 'highlightjs'
      hjs_base = attr :highlightjsdir, HIGHLIGHTJS_BASE_URI
      hjs_theme = attr 'highlightjs-theme', DEFAULT_HIGHLIGHTJS_THEME

      scripts << { src: [hjs_base, 'highlight.min.js'] }
      scripts << { text: 'hljs.initHighlightingOnLoad()' }
      styles  << { href: [hjs_base, "styles/#{hjs_theme}.min.css"] }
    end

    styles.each do |item|
      if item.key?(:text)
        tags << html_tag(:style) { item[:text] }
      else
        tags << html_tag(:link, rel: 'stylesheet', href: urlize(*item[:href]))
      end
    end

    scripts.each do |item|
      if item.key? :text
        tags << html_tag(:script, type: item[:type]) { item[:text] }
      else
        tags << html_tag(:script, type: item[:type], src: urlize(*item[:src]))
      end
    end

    tags.join("\n")
  end

  #--------------------------------------------------------
  # inline_anchor
  #

  # @return [String] text of the xref anchor.
  def xref_text
    str =
      if text
        text
      elsif (path = local_attr :path)
        path
      elsif document.respond_to? :catalog  # Asciidoctor >=1.5.6
        ref = document.catalog[:refs][attr :refid]
        if ref.kind_of? Asciidoctor::AbstractNode
          ref.xreftext((@_html5s_xrefstyle ||= document.attributes['xrefstyle']))
        end
      else  # Asciidoctor < 1.5.6
        document.references[:ids][attr :refid || target]
      end
    (str || "[#{attr :refid}]").tr_s("\n", ' ')
  end

  # @return [String, nil] text of the bibref anchor, or +nil+ if not found.
  def bibref_text
    if document.respond_to? :catalog  # Asciidoctor >=1.5.6
      # NOTE: Technically it should be `reftext`, but subs have already been applied to text.
      text
    else
      "[#{target}]"
    end
  end

  #--------------------------------------------------------
  # inline_image
  #

  # @return [Array] style classes for a Font Awesome icon.
  def icon_fa_classes
    [ "fa fa-#{target}",
      ("fa-#{attr :size}" if attr? :size),
      ("fa-rotate-#{attr :rotate}" if attr? :rotate),
      ("fa-flip-#{attr :flip}" if attr? :flip)
    ].compact
  end
end

{'repo_name': 'apache/lucene-solr', 'stars': '3625', 'repo_language': 'Java', 'file_name': 'addBackcompatIndexes.py', 'mime_type': 'text/x-python', 'hash': -4095018976400296765, 'source_dataset': 'data'}


SHA256 (Metabase-Client-Simple-0.012.tar.gz) = b2b19441feb11b187bb71a8eba777a7d609e18f2bcdb85db6d73b655aed15520
SIZE (Metabase-Client-Simple-0.012.tar.gz) = 17457

{'repo_name': 'freebsd/freebsd-ports', 'stars': '572', 'repo_language': 'None', 'file_name': 'distinfo', 'mime_type': 'text/plain', 'hash': 5493166373319027345, 'source_dataset': 'data'}


/**
 * This plugin prevents from duplicate resource loading
 *
 * Flag "race"
 *
 * This plugin provides private "race_callbacks" function
 */

/**
 * @name sandbox
 */
(function (sb) {

var race_callbacks = {},
    /**
     * Creates race.
     *
     * @param {String}   name     race name
     * @param {Function} callback callback
     */
    create_race = function (name, callback) {
        if (!race_callbacks[name]) {
            // create race
            race_callbacks[name] = [];
        }
        race_callbacks[name].push(callback);

        return function (result) {
            var callbacks = race_callbacks[name];
            while(callbacks && callbacks.length) {
                callbacks.shift()(result);
            }
            // reset race
            race_callbacks[name] = false;
        }
    };

    /**
     * @event *:request-race race module request eg for cases when some async modules are required simultaneously
     *
     * @param {String}   moduleName race for module name
     * @param {Function} callback   this callback will be called when module inited
     *
     * @retuns yes returns callback if race is empty or only 1 item in it
     */
sb.on('*:request-race', function (moduleName, callback) {
    callback = create_race(moduleName, callback);
    if (race_callbacks[moduleName].length > 1) {
        return [moduleName];
    } else {
        return [moduleName, callback];
    }
});

}(sandbox));

{'repo_name': 'pierrec/js-xxhash', 'stars': '208', 'repo_language': 'JavaScript', 'file_name': 'xxhash.js', 'mime_type': 'text/plain', 'hash': -5236743808210776071, 'source_dataset': 'data'}


>>> Flow 1 (client to server)
00000000  16 03 01 01 10 01 00 01  0c 03 03 00 00 00 00 00  |................|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  00 00 00 00 00 00 00 00  00 00 00 20 00 00 00 00  |........... ....|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 32 cc a8  |.............2..|
00000050  cc a9 c0 2f c0 2b c0 30  c0 2c c0 27 c0 13 c0 23  |.../.+.0.,.'...#|
00000060  c0 09 c0 14 c0 0a 00 9c  00 9d 00 3c 00 2f 00 35  |...........<./.5|
00000070  c0 12 00 0a 00 05 c0 11  c0 07 13 01 13 03 13 02  |................|
00000080  01 00 00 91 33 74 00 00  00 05 00 05 01 00 00 00  |....3t..........|
00000090  00 00 0a 00 0a 00 08 00  1d 00 17 00 18 00 19 00  |................|
000000a0  0b 00 02 01 00 00 0d 00  18 00 16 08 04 08 05 08  |................|
000000b0  06 04 01 04 03 05 01 05  03 06 01 06 03 02 01 02  |................|
000000c0  03 ff 01 00 01 00 00 10  00 10 00 0e 06 70 72 6f  |.............pro|
000000d0  74 6f 32 06 70 72 6f 74  6f 31 00 12 00 00 00 2b  |to2.proto1.....+|
000000e0  00 09 08 03 04 03 03 03  02 03 01 00 33 00 26 00  |............3.&.|
000000f0  24 00 1d 00 20 2f e5 7d  a3 47 cd 62 43 15 28 da  |$... /.}.G.bC.(.|
00000100  ac 5f bb 29 07 30 ff f6  84 af c4 cf c2 ed 90 99  |._.).0..........|
00000110  5f 58 cb 3b 74                                    |_X.;t|
>>> Flow 2 (server to client)
00000000  16 03 03 00 7a 02 00 00  76 03 03 8b 65 4e 74 f0  |....z...v...eNt.|
00000010  c4 05 7a a1 58 a7 fd b0  55 9e d2 15 67 1f 19 f9  |..z.X...U...g...|
00000020  25 e1 3e 89 4f a6 79 90  95 5a 8c 20 00 00 00 00  |%.>.O.y..Z. ....|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 13 01 00 00  |................|
00000050  2e 00 2b 00 02 03 04 00  33 00 24 00 1d 00 20 a5  |..+.....3.$... .|
00000060  e3 ac d0 3c 26 f8 66 41  ac b5 47 6f 63 a0 8f 0a  |...<&.fA..Goc...|
00000070  6f 79 62 23 15 01 d0 57  5d 66 9c 09 50 c5 45 14  |oyb#...W]f..P.E.|
00000080  03 03 00 01 01 17 03 03  00 24 7d dc b2 50 38 8e  |.........$}..P8.|
00000090  15 52 73 25 90 d3 d3 f2  19 da 76 ae 64 42 29 eb  |.Rs%......v.dB).|
000000a0  21 1b 7d b1 d9 04 94 ac  71 b9 b3 e1 d7 59 17 03  |!.}.....q....Y..|
000000b0  03 02 6d cb 4e 30 d0 df  41 b8 1a 76 1d e2 a2 14  |..m.N0..A..v....|
000000c0  24 ec e4 b8 e4 5b 98 49  ed 4e 48 98 3d a7 89 d4  |$....[.I.NH.=...|
000000d0  d1 35 2f d4 12 dc 0b c3  3f e7 0c df 11 20 41 fb  |.5/.....?.... A.|
000000e0  5c 24 62 82 26 ad 28 25  59 c0 c0 81 41 9d 80 b7  |\$b.&.(%Y...A...|
000000f0  db cd 41 bb 27 66 ba 55  e6 2f 52 5d 71 d4 77 6a  |..A.'f.U./R]q.wj|
00000100  5c 5d 72 34 e6 83 9d c6  24 d1 be 3b 99 90 9b 22  |\]r4....$..;..."|
00000110  7f d8 81 39 d4 7b a8 f9  d7 61 82 a1 72 f9 27 0b  |...9.{...a..r.'.|
00000120  b8 6a 5c 72 bd 8f 84 34  c6 d0 c8 1a b9 27 d6 7b  |.j\r...4.....'.{|
00000130  12 20 37 b7 64 85 19 7e  b4 37 46 df 51 77 23 be  |. 7.d..~.7F.Qw#.|
00000140  c4 7a e4 7e 37 3b 53 3e  3b 86 8f 22 31 28 4b 8f  |.z.~7;S>;.."1(K.|
00000150  89 0d dc 8d 67 37 53 9d  38 f2 5f 99 2c f4 76 64  |....g7S.8._.,.vd|
00000160  87 e4 ce b7 4f d0 83 99  b2 55 8c 38 8c d0 89 d1  |....O....U.8....|
00000170  2f 91 e8 ae ec b1 a6 29  65 3a 8f af 69 e0 48 00  |/......)e:..i.H.|
00000180  db 3e 30 bd 7f 4b 82 56  cf f9 5b 5e 74 d7 d5 4b  |.>0..K.V..[^t..K|
00000190  47 4f 22 17 53 fc e6 98  a4 5a 25 ca 7d ca 39 e9  |GO".S....Z%.}.9.|
000001a0  fe 11 f5 ca 91 e1 25 3c  6d f2 b3 d0 9f ee 88 d2  |......%<m.......|
000001b0  dd a5 9f 7c a8 33 59 20  62 fd 4e d6 98 4b ef af  |...|.3Y b.N..K..|
000001c0  a6 fa 79 f5 26 90 fe 32  0a 6a e4 40 b9 e5 4d 1a  |..y.&..2.j.@..M.|
000001d0  1f 02 49 4b 1b 6b 31 53  3d 0e 04 98 17 6e 1e 4a  |..IK.k1S=....n.J|
000001e0  a3 8d ba 0e 8f 33 f6 23  41 5f f8 aa 1f 57 b1 7b  |.....3.#A_...W.{|
000001f0  a2 fb c6 7f da b4 56 cf  d3 5e 78 de 3c 15 c5 6c  |......V..^x.<..l|
00000200  62 ef 46 c4 a2 c0 fd a6  86 91 fb f2 98 57 cc 82  |b.F..........W..|
00000210  7e e7 88 1b f4 65 eb df  2a 7c 7a 81 95 e8 3c 0d  |~....e..*|z...<.|
00000220  c1 85 8f 55 49 c0 50 d0  c8 5f e7 32 7c 8c c2 ae  |...UI.P.._.2|...|
00000230  8c af 3f 4c 4f 23 f6 80  0b c1 c3 1c a2 50 6b 37  |..?LO#.......Pk7|
00000240  38 53 59 66 9c 5a d3 6d  39 59 99 14 79 d5 17 e3  |8SYf.Z.m9Y..y...|
00000250  89 73 9e fe ed 43 2c 4a  2f 55 c7 c6 9e cf 82 64  |.s...C,J/U.....d|
00000260  f5 5e 90 88 67 05 7a 00  b1 88 87 9c b2 51 61 1c  |.^..g.z......Qa.|
00000270  c2 8a ea 9f b1 07 0c 17  ed b6 6e cc 4d 14 04 91  |..........n.M...|
00000280  65 00 3b 8f ae d0 14 64  63 92 bd 3b 14 9c 1d 40  |e.;....dc..;...@|
00000290  67 01 b1 38 26 86 4d e6  f3 20 ed f5 63 17 fc d0  |g..8&.M.. ..c...|
000002a0  fb ad 5c 17 c8 d5 18 53  8b 89 70 13 2f 83 6a 3f  |..\....S..p./.j?|
000002b0  4c 57 be 71 43 1d 9f bf  eb 30 7e de 7f 17 78 f1  |LW.qC....0~...x.|
000002c0  af 69 13 9b f3 4a e6 69  4e 30 dc 99 af be 6f ee  |.i...J.iN0....o.|
000002d0  1d d5 39 b4 19 29 ed 5c  58 bc 4a 08 7b 34 90 21  |..9..).\X.J.{4.!|
000002e0  a5 ae 74 4c 17 95 79 8b  9c ee 47 99 32 f9 7d f2  |..tL..y...G.2.}.|
000002f0  98 93 ec 12 52 7d 36 cc  a7 ca a2 cd fc ce 12 0e  |....R}6.........|
00000300  32 e7 28 69 ce d4 a7 19  56 9f 90 1a d0 af f1 ee  |2.(i....V.......|
00000310  77 a4 29 45 cb 2c ff 1a  90 9d 98 73 65 2a 82 77  |w.)E.,.....se*.w|
00000320  17 03 03 00 99 76 fe 3b  d7 a3 d2 ec a0 28 bd ed  |.....v.;.....(..|
00000330  64 41 ac 1c d0 60 79 29  26 f9 ad a1 2d 79 b6 f0  |dA...`y)&...-y..|
00000340  cc de 8f c3 92 4a 1e 02  76 7a b4 86 d3 64 b3 a6  |.....J..vz...d..|
00000350  2d bb d9 92 1e 12 1d e4  96 64 3c 41 7f 11 28 51  |-........d<A..(Q|
00000360  69 83 64 45 fb a6 2c 34  97 e8 4b e8 48 92 b0 de  |i.dE..,4..K.H...|
00000370  a0 37 8e fa d8 88 29 4c  8e e4 7e 1e d2 c1 b8 f2  |.7....)L..~.....|
00000380  d3 5c 2f 09 9d e2 0b 4d  64 25 52 dc 77 d2 a4 fc  |.\/....Md%R.w...|
00000390  c3 de 83 3c 04 19 f0 d9  d6 40 bb f1 8b c7 40 b3  |...<.....@....@.|
000003a0  a9 62 99 4c 64 96 a4 67  a0 6b 7c 09 b3 10 97 e1  |.b.Ld..g.k|.....|
000003b0  b5 83 9e 7e b4 97 bd b7  f9 70 48 2b aa f6 17 03  |...~.....pH+....|
000003c0  03 00 35 a6 fc 3f d4 90  93 91 02 e8 0a a6 c1 6f  |..5..?.........o|
000003d0  fa ee e2 6a 41 8d fd ac  53 ae 83 73 e1 d1 17 de  |...jA...S..s....|
000003e0  36 5d db c6 06 98 f9 23  db d9 8a 35 c1 9b bc a5  |6].....#...5....|
000003f0  f8 a8 8f 70 e2 c8 4e 22                           |...p..N"|
>>> Flow 3 (client to server)
00000000  14 03 03 00 01 01 17 03  03 00 35 f6 6b cb 4a 37  |..........5.k.J7|
00000010  3e e2 61 7e 5b ac c5 25  cc 54 a2 6d 4e 7c 37 19  |>.a~[..%.T.mN|7.|
00000020  ea 21 af df 7b dc 04 2d  db 84 ad 06 04 bd 50 f5  |.!..{..-......P.|
00000030  05 9b 19 01 37 22 d2 6f  06 c2 63 dd 95 e6 ef 45  |....7".o..c....E|
00000040  17 03 03 00 17 6d 03 e7  38 f9 a4 3c a7 c2 ee 8d  |.....m..8..<....|
00000050  07 49 bd e6 e4 be 3f a3  ec 64 6c 3a 17 03 03 00  |.I....?..dl:....|
00000060  13 cc a9 19 b1 03 56 99  c1 4c d0 f5 fd 3b e2 dd  |......V..L...;..|
00000070  0e ef a0 20                                       |... |

{'repo_name': 'autc04/Retro68', 'stars': '257', 'repo_language': 'None', 'file_name': 'helpdoc.go', 'mime_type': 'text/plain', 'hash': -4480627651641976253, 'source_dataset': 'data'}


Link: http://example.com/.

With an ampersand: http://example.com/?foo=1&bar=2

In a list?

http://example.com/

It should.

Blockquoted: http://example.com/

Auto-links should not occur here: <http://example.com/>

or here: <http://example.com/>

{'repo_name': 'evilstreak/markdown-js', 'stars': '7414', 'repo_language': 'JavaScript', 'file_name': 'footnotes_markup.opts', 'mime_type': 'text/plain', 'hash': -2785996278062801843, 'source_dataset': 'data'}


'use strict';

export default {
  skillName: 'dog',
  intents: [
    {
      intentName: 'dogNumber',
      slots: {
        number: {
          type: 'custom',
          values: [
            'example',
            'other example',
            'some other example'
          ]
        }
      },
      utterances: [
        'say the number {-|number}',
        'find {-|number}'
      ],
      response: (request, response) => {
        const number = request.slot('number');
        response.say(`The number you asked to say is ${number}`);
      }
    },
    {
      intentName: 'dogFood',
      slots: null,
      utterances: [
        'give {him|her} food',
        '{she|he} {wants|needs} food'
      ],
      response: (request, response) => {
        response.say('Yes, much food, such wow');
      }
    }
  ]
};

{'repo_name': 'AlexSapoznikov/node-alexa-starter-kit', 'stars': '137', 'repo_language': 'JavaScript', 'file_name': 'sampleSkill', 'mime_type': 'text/plain', 'hash': -1530025109944837906, 'source_dataset': 'data'}


#import "BITDomain.h"
#import "BITSessionState.h"

@interface BITSessionStateData : BITDomain <NSCoding>

@property (nonatomic, copy, readonly) NSString *envelopeTypeName;
@property (nonatomic, copy, readonly) NSString *dataTypeName;
@property (nonatomic, assign) BITSessionState state;

@end

{'repo_name': 'bitstadium/HockeySDK-Mac', 'stars': '124', 'repo_language': 'Objective-C', 'file_name': 'Crash Reporting Not Working.md', 'mime_type': 'text/plain', 'hash': 5982806940963809035, 'source_dataset': 'data'}


/*
 * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
 * Copyright (C) 2005-2012, Anthony Minessale II <anthm@freeswitch.org>
 *
 * Version: MPL 1.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (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.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
 *
 * The Initial Developer of the Original Code is
 * Mathieu Rene <mathieu.rene@gmail.com>
 * Portions created by the Initial Developer are Copyright (C)
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Mathieu Rene <mathieu.rene@gmail.com>
 *
 *
 * switch_xml_config.h - Generic configuration parser
 *
 */

#ifndef SWITCH_XML_CONFIG_H
#define SWITCH_XML_CONFIG_H

#include <switch.h>

SWITCH_BEGIN_EXTERN_C
/*! \brief Type of value to parse */
	typedef enum {
	SWITCH_CONFIG_INT,			/*< (ptr=int* default=int data=NULL) Integer */
	SWITCH_CONFIG_STRING,		/*< (ptr=[char* or char ** (for alloc)] default=char* data=switch_xml_config_string_options_t*) Zero-terminated C-string */
	SWITCH_CONFIG_BOOL,			/*< (ptr=switch_bool_t* default=switch_bool_t data=NULL) Yes and no */
	SWITCH_CONFIG_CUSTOM,		/*< (ptr=<custom function data> default=<custom function data> data=switch_xml_config_callback_t) Custom, get value through function pointer  */
	SWITCH_CONFIG_ENUM,			/*< (ptr=int* default=int data=switch_xml_config_enum_item_t*) */
	SWITCH_CONFIG_FLAG,			/*< (ptr=int32_t* default=switch_bool_t data=int (flag index) */
	SWITCH_CONFIG_FLAGARRAY,	/*< (ptr=int8_t* default=switch_bool_t data=int (flag index) */

	/* No more past that line */
	SWITCH_CONFIG_LAST
} switch_xml_config_type_t;

typedef struct {
	char *key;					/*< The item's key or NULL if this is the last one in the list */
	int value;					/*< The item's value */
} switch_xml_config_enum_item_t;

typedef struct {
	switch_memory_pool_t *pool;	/*< If set, the string will be allocated on the pool (unless the length param is > 0, then you misread this file) */
	switch_size_t length;		/*< Length of the char array, or 0 if memory has to be allocated dynamically */
	char *validation_regex;		/*< Enforce validation using this regular expression */
} switch_xml_config_string_options_t;

SWITCH_DECLARE_DATA extern switch_xml_config_string_options_t switch_config_string_strdup;	/*< String options structure for strdup, no validation */

typedef struct {
	switch_bool_t enforce_min;
	int min;
	switch_bool_t enforce_max;
	int max;
} switch_xml_config_int_options_t;

struct switch_xml_config_item;
typedef struct switch_xml_config_item switch_xml_config_item_t;

typedef enum {
	CONFIG_LOAD,
	CONFIG_RELOAD,
	CONFIG_SHUTDOWN
} switch_config_callback_type_t;

typedef enum {
	CONFIG_RELOADABLE = (1 << 0),
	CONFIG_REQUIRED = (1 << 1)
} switch_config_flags_t;

typedef switch_status_t (*switch_xml_config_callback_t) (switch_xml_config_item_t *item, const char *newvalue, switch_config_callback_type_t callback_type,
														 switch_bool_t changed);

/*!
 * \brief A configuration instruction read by switch_xml_config_parse
*/
struct switch_xml_config_item {
	const char *key;			/*< The key of the element, or NULL to indicate the end of the list */
	switch_xml_config_type_t type;	/*< The type of variable */
	int flags;					/*< True if the var can be changed on reload */
	void *ptr;					/*< Ptr to the var to be changed */
	const void *defaultvalue;	/*< Default value */
	void *data;					/*< Custom data (depending on the type) */
	switch_xml_config_callback_t function;	/*< Callback to be called after the var is parsed */
	const char *syntax;			/*< Optional syntax documentation for this setting */
	const char *helptext;		/*< Optional documentation text for this setting */
};

#define SWITCH_CONFIG_ITEM(_key, _type, _flags, _ptr, _defaultvalue, _data, _syntax, _helptext)	{ _key, _type, _flags, _ptr, (void*)_defaultvalue, (void*)_data, NULL, _syntax, _helptext }
#define SWITCH_CONFIG_ITEM_STRING_STRDUP(_key, _flags, _ptr, _defaultvalue, _syntax, _helptext)	{ (_key), SWITCH_CONFIG_STRING, (_flags), (_ptr), ((void*)_defaultvalue), (NULL), (NULL), (_syntax), (_helptext) }
#define SWITCH_CONFIG_ITEM_CALLBACK(_key, _type, _flags, _ptr, _defaultvalue, _function, _functiondata, _syntax, _helptext)	{ _key, _type, _flags, _ptr, (void*)_defaultvalue, _functiondata, _function, _syntax, _helptext }
#define SWITCH_CONFIG_ITEM_END() { NULL, SWITCH_CONFIG_LAST, 0, NULL, NULL, NULL, NULL, NULL, NULL }

#define SWITCH_CONFIG_SET_ITEM(_item, _key, _type, _flags, _ptr, _defaultvalue, _data, _syntax, _helptext)  switch_config_perform_set_item(&(_item), _key, _type, _flags, _ptr, (void*)(_defaultvalue), _data, NULL, _syntax, _helptext)
#define SWITCH_CONFIG_SET_ITEM_CALLBACK(_item, _key, _type, _flags, _ptr, _defaultvalue, _data, _function, _syntax, _helptext)  switch_config_perform_set_item(&(_item), _key, _type, _flags, _ptr, (void*)(_defaultvalue), _data, _function, _syntax, _helptext)

SWITCH_DECLARE(void) switch_config_perform_set_item(switch_xml_config_item_t *item, const char *key, switch_xml_config_type_t type, int flags, void *ptr,
													const void *defaultvalue, void *data, switch_xml_config_callback_t function, const char *syntax,
													const char *helptext);

/*!
 * \brief Gets the int representation of an enum
 * \param enum_options the switch_xml_config_enum_item_t array for this enum
 * \param value string value to search
 */
SWITCH_DECLARE(switch_status_t) switch_xml_config_enum_str2int(switch_xml_config_enum_item_t *enum_options, const char *value, int *out);

/*!
 * \brief Gets the string representation of an enum
 * \param enum_options the switch_xml_config_enum_item_t array for this enum
 * \param value int value to search
 */
SWITCH_DECLARE(const char *) switch_xml_config_enum_int2str(switch_xml_config_enum_item_t *enum_options, int value);

/*!
 * \brief Prints out an item's documentation on the console
 * \param level loglevel to use
 * \param item item which the doc should be printed
 */
SWITCH_DECLARE(void) switch_xml_config_item_print_doc(int level, switch_xml_config_item_t *item);

/*!
 * \brief Parses all the xml elements, following a ruleset defined by an array of switch_xml_config_item_t
 * \param xml The first element of the list to parse
 * \param reload true to skip all non-reloadable options
 * \param instructions instrutions on how to parse the elements
 * \see switch_xml_config_item_t
 */
SWITCH_DECLARE(switch_status_t) switch_xml_config_parse(switch_xml_t xml, switch_bool_t reload, switch_xml_config_item_t *instructions);

/*!
 * \brief Parses a module's settings
 * \param reload true to skip all non-reloadable options
 * \param file the configuration file to look for
 * \param instructions the instructions
 */
SWITCH_DECLARE(switch_status_t) switch_xml_config_parse_module_settings(const char *file, switch_bool_t reload, switch_xml_config_item_t *instructions);

/*!
 * \brief Parses all of an event's elements, following a ruleset defined by an array of switch_xml_config_item_t
 * \param event The event structure containing the key and values to parse
 * \param reload true to skip all non-reloadable options
 * \param instructions instrutions on how to parse the elements
 * \see switch_xml_config_item_t
 */
SWITCH_DECLARE(switch_status_t) switch_xml_config_parse_event(switch_event_t *event, int count, switch_bool_t reload,
															  switch_xml_config_item_t *instructions);

/*!
 * \brief Parses a list of xml elements into an event
 * \param xml First element of the xml list to parse
 * \param keyname Name of the key attribute
 * \param keyvalue Name of the value attribute
 * \param event [out] event (if *event is NOT NULL, the headers will be appended to the existing event)
 */
SWITCH_DECLARE(switch_size_t) switch_event_import_xml(switch_xml_t xml, const char *keyname, const char *valuename, switch_event_t **event);

/*!
 * \brief Free any memory allocated by the configuration
 * \param instructions instrutions on how to parse the elements
 */
SWITCH_DECLARE(void) switch_xml_config_cleanup(switch_xml_config_item_t *instructions);

SWITCH_END_EXTERN_C
#endif /* !defined(SWITCH_XML_CONFIG_H) */
/* For Emacs:
 * Local Variables:
 * mode:c
 * indent-tabs-mode:t
 * tab-width:4
 * c-basic-offset:4
 * End:
 * For VIM:
 * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
 */

{'repo_name': 'seven1240/FreeSWITCH-OLD', 'stars': '102', 'repo_language': 'C', 'file_name': 'freeswitch_dialplan.dtd', 'mime_type': 'text/plain', 'hash': -5889435298357178446, 'source_dataset': 'data'}


'use strict'

var fs = require('fs')
var path = require('path')
var camelcase = require('camelcase')
var clone = require('clone')
var parseDefaults = require('../../packages/remark-parse/lib/defaults.js')
var stringifyDefaults = require('../../packages/remark-stringify/lib/defaults.js')

var own = {}.hasOwnProperty
var read = fs.readFileSync
var exists = fs.existsSync
var stat = fs.statSync
var join = path.join

var defaults = {
  parse: parseDefaults,
  stringify: stringifyDefaults
}

var typeMap = {
  true: 'all',
  false: 'physical'
}

var TYPE = typeMap[Boolean(process.env.TEST_EXTENDED)]

// Defaults.
var keys = Object.keys(defaults.parse)
keys.splice(keys.indexOf('blocks'), 1)

// Create a single source with all parse options turned to their default values.
var sources = [keys.join('.')]

// Create all possible `parse` values.
keys.forEach(function (key) {
  sources = [].concat.apply(
    sources,
    sources.map(function (source) {
      return source
        .split('.')
        .map(function (subkey) {
          return subkey === key ? 'no' + key : subkey
        })
        .join('.')
    })
  )
})

// Parse a `string` `value` into a javascript value.
function augment(key, value) {
  if (!value) {
    value = key.slice(0, 2) !== 'no'

    if (!value) {
      key = key.slice(2)
    }
  }

  key = camelcase(key)

  if (own.call(augment, key)) {
    value = augment[key](value)
  }

  return {key: key, value: value}
}

augment.ruleRepetition = Number

// Parse options from a filename.
function parseOptions(name) {
  var index = -1
  var parts = name.split('.')
  var results = []
  var length = parts.length
  var options = clone(defaults)
  var part
  var augmented
  var key
  var value

  while (++index < length) {
    part = parts[index].split('=')
    augmented = augment(part[0], part.slice(1).join('='))
    key = augmented.key
    value = augmented.value

    if (key === 'output') {
      options[key] = value
    } else {
      if (key in defaults.parse && value !== options.parse[key]) {
        options.parse[key] = value

        results.push(parts[index])
      }

      if (key in defaults.stringify && value !== options.stringify[key]) {
        options.stringify[key] = value

        // Protect common options from `parse` and `stringify` from
        // appearing twice.
        if (results.indexOf(parts[index]) < 0) {
          results.push(parts[index])
        }
      }
    }
  }

  options.source = results.join('.')

  return options
}

// Cache all possible options.
//
// Virtual options are generated when no fixtures exist, whereas physical
// options are only used whn a file exists.
var virtual = {}
var physical = {}
var all = {}

sources.forEach(function (source) {
  var options = parseOptions(source)

  source = options.source

  // `position` and `blocks` are such a tiny feature, but result in lots of
  // duplicate fixtures, that I've ignored it for the virtual options.
  if (
    options.parse.position !== defaults.parse.position ||
    options.parse.blocks !== defaults.parse.blocks
  ) {
    physical[source] = options.parse
  } else {
    virtual[source] = options.parse
  }

  all[source] = options.parse
})

// Get the difference between two objects.  Greatly simplified because `options`
// and `compate` consist solely of booleans, and all properties exist in both.
function difference(options, compare) {
  var count = 0

  Object.keys(options).forEach(function (key) {
    if (options[key] !== compare[key]) {
      count++
    }
  })

  return count
}

// Find the closest fixture for a `source` in all `fixtures`.  Returns a key of
// a fixture.
function resolveFixture(source, fixtures, options) {
  var minimum = Infinity
  var resolved
  var offset

  Object.keys(fixtures).forEach(function (key) {
    offset = difference(options[source], options[key])

    if (offset < minimum) {
      minimum = offset
      resolved = key
    }
  })

  return resolved
}

// Find the closest fixture for all `options`.  Returns an object mapping
// options sources to fixture names.
function resolveFixtures(fixtures, options) {
  var resolved = {}

  Object.keys(options).forEach(function (source) {
    resolved[source] = resolveFixture(source, fixtures, options)
  })

  return resolved
}

// Gather fixtures.
var tests = fs
  .readdirSync(join(__dirname, 'input'))
  .filter(function (filepath) {
    return filepath.indexOf('.') !== 0
  })
  .map(function (filepath) {
    var filename = filepath.split('.').slice(0, -1)
    var name = filename.join('.').replace(/-asterisk-/g, '*')
    var settings = parseOptions(name)
    var input = read(join(__dirname, 'input', filepath), 'utf-8')
    var fixtures = {}
    var possibilities = {}
    var resolved

    Object.keys(all).forEach(function (source) {
      var treename
      var tree

      treename = [filename.join('.'), source ? '.' + source : '', '.json'].join(
        ''
      )

      tree = join(__dirname, 'tree', treename)

      if (exists(tree)) {
        fixtures[source] = JSON.parse(read(tree, 'utf-8'))

        possibilities[source] = all[source]
      } else if (
        TYPE === typeMap.true &&
        source in virtual &&
        !settings.output
      ) {
        possibilities[source] = all[source]
      }
    })

    if (Object.keys(fixtures).length === 0) {
      throw new Error('Missing fixture for `' + name + '`')
    }

    resolved = resolveFixtures(fixtures, possibilities)

    if (settings.output) {
      if (Object.keys(fixtures).length > 1) {
        throw new Error('Multiple fixtures for output `' + name + '`')
      }
    }

    return {
      input: input,
      possibilities: possibilities,
      mapping: resolved,
      trees: fixtures,
      stringify: settings.stringify,
      output: settings.output,
      size: stat(join(__dirname, 'input', filepath)).size,
      name: name
    }
  })

module.exports = tests

{'repo_name': 'remarkjs/remark', 'stars': '3123', 'repo_language': 'JavaScript', 'file_name': 'products.md', 'mime_type': 'text/plain', 'hash': 4903820153487417249, 'source_dataset': 'data'}


load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
    name = "go_default_library",
    srcs = [
        "doc.go",
        "register.go",
        "types.go",
        "zz_generated.deepcopy.go",
    ],
    importpath = "k8s.io/kubernetes/pkg/apis/networking",
    visibility = ["//visibility:public"],
    deps = [
        "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/util/intstr:go_default_library",
        "//vendor/k8s.io/kubernetes/pkg/apis/core:go_default_library",
    ],
)

filegroup(
    name = "package-srcs",
    srcs = glob(["**"]),
    tags = ["automanaged"],
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [
        ":package-srcs",
        "//vendor/k8s.io/kubernetes/pkg/apis/networking/fuzzer:all-srcs",
        "//vendor/k8s.io/kubernetes/pkg/apis/networking/install:all-srcs",
        "//vendor/k8s.io/kubernetes/pkg/apis/networking/v1:all-srcs",
        "//vendor/k8s.io/kubernetes/pkg/apis/networking/validation:all-srcs",
    ],
    tags = ["automanaged"],
    visibility = ["//visibility:public"],
)

{'repo_name': 'kubernetes-retired/federation', 'stars': '205', 'repo_language': 'Go', 'file_name': 'etcd.BUILD', 'mime_type': 'text/plain', 'hash': 5530735184545484931, 'source_dataset': 'data'}


/**
 * @license
 * Copyright 2018 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.
 */
.neuroglancer-icon {
  display: inline-flex;
  text-decoration: none;
  align-self: center;
  white-space: nowrap;
  padding-left: 2px;
  padding-right: 2px;
  min-width: 18px;
  min-height: 18px;
  border-radius: 20%;
  align-items: center;
  justify-content: center;
  color: white;
  font: 12px sans-serif;
  cursor: pointer;
  font-weight: 900;
}

.neuroglancer-icon svg {
  width: 16px;
  height: 16px;
  fill: transparent;
  stroke: white;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.neuroglancer-icon:hover {
  background-color: #db4437;
}

{'repo_name': 'google/neuroglancer', 'stars': '513', 'repo_language': 'TypeScript', 'file_name': 'webpack-fix.diff', 'mime_type': 'text/x-diff', 'hash': 2657059271105190212, 'source_dataset': 'data'}