//===-- ARMMachineFunctionInfo.h - ARM machine function info ----*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// This file declares ARM-specific per-machine-function information.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIB_TARGET_ARM_ARMMACHINEFUNCTIONINFO_H
#define LLVM_LIB_TARGET_ARM_ARMMACHINEFUNCTIONINFO_H

#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/Support/ErrorHandling.h"
#include <utility>

namespace llvm {

/// ARMFunctionInfo - This class is derived from MachineFunctionInfo and
/// contains private ARM-specific information for each MachineFunction.
class ARMFunctionInfo : public MachineFunctionInfo {
  virtual void anchor();

  /// isThumb - True if this function is compiled under Thumb mode.
  /// Used to initialized Align, so must precede it.
  bool isThumb = false;

  /// hasThumb2 - True if the target architecture supports Thumb2. Do not use
  /// to determine if function is compiled under Thumb mode, for that use
  /// 'isThumb'.
  bool hasThumb2 = false;

  /// StByValParamsPadding - For parameter that is split between
  /// GPRs and memory; while recovering GPRs part, when
  /// StackAlignment > 4, and GPRs-part-size mod StackAlignment != 0,
  /// we need to insert gap before parameter start address. It allows to
  /// "attach" GPR-part to the part that was passed via stack.
  unsigned StByValParamsPadding = 0;

  /// VarArgsRegSaveSize - Size of the register save area for vararg functions.
  ///
  unsigned ArgRegsSaveSize = 0;

  /// ReturnRegsCount - Number of registers used up in the return.
  unsigned ReturnRegsCount = 0;

  /// HasStackFrame - True if this function has a stack frame. Set by
  /// determineCalleeSaves().
  bool HasStackFrame = false;

  /// RestoreSPFromFP - True if epilogue should restore SP from FP. Set by
  /// emitPrologue.
  bool RestoreSPFromFP = false;

  /// LRSpilledForFarJump - True if the LR register has been for spilled to
  /// enable far jump.
  bool LRSpilledForFarJump = false;

  /// LRSpilled - True if the LR register has been for spilled for
  /// any reason, so it's legal to emit an ARM::tBfar (i.e. "bl").
  bool LRSpilled = false;

  /// FramePtrSpillOffset - If HasStackFrame, this records the frame pointer
  /// spill stack offset.
  unsigned FramePtrSpillOffset = 0;

  /// GPRCS1Offset, GPRCS2Offset, DPRCSOffset - Starting offset of callee saved
  /// register spills areas. For Mac OS X:
  ///
  /// GPR callee-saved (1) : r4, r5, r6, r7, lr
  /// --------------------------------------------
  /// GPR callee-saved (2) : r8, r10, r11
  /// --------------------------------------------
  /// DPR callee-saved : d8 - d15
  ///
  /// Also see AlignedDPRCSRegs below. Not all D-regs need to go in area 3.
  /// Some may be spilled after the stack has been realigned.
  unsigned GPRCS1Offset = 0;
  unsigned GPRCS2Offset = 0;
  unsigned DPRCSOffset = 0;

  /// GPRCS1Size, GPRCS2Size, DPRCSSize - Sizes of callee saved register spills
  /// areas.
  unsigned GPRCS1Size = 0;
  unsigned GPRCS2Size = 0;
  unsigned DPRCSAlignGapSize = 0;
  unsigned DPRCSSize = 0;

  /// NumAlignedDPRCS2Regs - The number of callee-saved DPRs that are saved in
  /// the aligned portion of the stack frame.  This is always a contiguous
  /// sequence of D-registers starting from d8.
  ///
  /// We do not keep track of the frame indices used for these registers - they
  /// behave like any other frame index in the aligned stack frame.  These
  /// registers also aren't included in DPRCSSize above.
  unsigned NumAlignedDPRCS2Regs = 0;

  unsigned PICLabelUId = 0;

  /// VarArgsFrameIndex - FrameIndex for start of varargs area.
  int VarArgsFrameIndex = 0;

  /// HasITBlocks - True if IT blocks have been inserted.
  bool HasITBlocks = false;

  /// CPEClones - Track constant pool entries clones created by Constant Island
  /// pass.
  DenseMap<unsigned, unsigned> CPEClones;

  /// ArgumentStackSize - amount of bytes on stack consumed by the arguments
  /// being passed on the stack
  unsigned ArgumentStackSize = 0;

  /// CoalescedWeights - mapping of basic blocks to the rolling counter of
  /// coalesced weights.
  DenseMap<const MachineBasicBlock*, unsigned> CoalescedWeights;

  /// True if this function has a subset of CSRs that is handled explicitly via
  /// copies.
  bool IsSplitCSR = false;

  /// Globals that have had their storage promoted into the constant pool.
  SmallPtrSet<const GlobalVariable*,2> PromotedGlobals;

  /// The amount the literal pool has been increasedby due to promoted globals.
  int PromotedGlobalsIncrease = 0;

  /// True if r0 will be preserved by a call to this function (e.g. C++
  /// con/destructors).
  bool PreservesR0 = false;

public:
  ARMFunctionInfo() = default;

  explicit ARMFunctionInfo(MachineFunction &MF);

  bool isThumbFunction() const { return isThumb; }
  bool isThumb1OnlyFunction() const { return isThumb && !hasThumb2; }
  bool isThumb2Function() const { return isThumb && hasThumb2; }

  unsigned getStoredByValParamsPadding() const { return StByValParamsPadding; }
  void setStoredByValParamsPadding(unsigned p) { StByValParamsPadding = p; }

  unsigned getArgRegsSaveSize() const { return ArgRegsSaveSize; }
  void setArgRegsSaveSize(unsigned s) { ArgRegsSaveSize = s; }

  unsigned getReturnRegsCount() const { return ReturnRegsCount; }
  void setReturnRegsCount(unsigned s) { ReturnRegsCount = s; }

  bool hasStackFrame() const { return HasStackFrame; }
  void setHasStackFrame(bool s) { HasStackFrame = s; }

  bool shouldRestoreSPFromFP() const { return RestoreSPFromFP; }
  void setShouldRestoreSPFromFP(bool s) { RestoreSPFromFP = s; }

  bool isLRSpilled() const { return LRSpilled; }
  void setLRIsSpilled(bool s) { LRSpilled = s; }

  bool isLRSpilledForFarJump() const { return LRSpilledForFarJump; }
  void setLRIsSpilledForFarJump(bool s) { LRSpilledForFarJump = s; }

  unsigned getFramePtrSpillOffset() const { return FramePtrSpillOffset; }
  void setFramePtrSpillOffset(unsigned o) { FramePtrSpillOffset = o; }

  unsigned getNumAlignedDPRCS2Regs() const { return NumAlignedDPRCS2Regs; }
  void setNumAlignedDPRCS2Regs(unsigned n) { NumAlignedDPRCS2Regs = n; }

  unsigned getGPRCalleeSavedArea1Offset() const { return GPRCS1Offset; }
  unsigned getGPRCalleeSavedArea2Offset() const { return GPRCS2Offset; }
  unsigned getDPRCalleeSavedAreaOffset()  const { return DPRCSOffset; }

  void setGPRCalleeSavedArea1Offset(unsigned o) { GPRCS1Offset = o; }
  void setGPRCalleeSavedArea2Offset(unsigned o) { GPRCS2Offset = o; }
  void setDPRCalleeSavedAreaOffset(unsigned o)  { DPRCSOffset = o; }

  unsigned getGPRCalleeSavedArea1Size() const { return GPRCS1Size; }
  unsigned getGPRCalleeSavedArea2Size() const { return GPRCS2Size; }
  unsigned getDPRCalleeSavedGapSize() const   { return DPRCSAlignGapSize; }
  unsigned getDPRCalleeSavedAreaSize()  const { return DPRCSSize; }

  void setGPRCalleeSavedArea1Size(unsigned s) { GPRCS1Size = s; }
  void setGPRCalleeSavedArea2Size(unsigned s) { GPRCS2Size = s; }
  void setDPRCalleeSavedGapSize(unsigned s)   { DPRCSAlignGapSize = s; }
  void setDPRCalleeSavedAreaSize(unsigned s)  { DPRCSSize = s; }

  unsigned getArgumentStackSize() const { return ArgumentStackSize; }
  void setArgumentStackSize(unsigned size) { ArgumentStackSize = size; }

  void initPICLabelUId(unsigned UId) {
    PICLabelUId = UId;
  }

  unsigned getNumPICLabels() const {
    return PICLabelUId;
  }

  unsigned createPICLabelUId() {
    return PICLabelUId++;
  }

  int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
  void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }

  bool hasITBlocks() const { return HasITBlocks; }
  void setHasITBlocks(bool h) { HasITBlocks = h; }

  bool isSplitCSR() const { return IsSplitCSR; }
  void setIsSplitCSR(bool s) { IsSplitCSR = s; }

  void recordCPEClone(unsigned CPIdx, unsigned CPCloneIdx) {
    if (!CPEClones.insert(std::make_pair(CPCloneIdx, CPIdx)).second)
      llvm_unreachable("Duplicate entries!");
  }

  unsigned getOriginalCPIdx(unsigned CloneIdx) const {
    DenseMap<unsigned, unsigned>::const_iterator I = CPEClones.find(CloneIdx);
    if (I != CPEClones.end())
      return I->second;
    else
      return -1U;
  }

  DenseMap<const MachineBasicBlock*, unsigned>::iterator getCoalescedWeight(
                                                  MachineBasicBlock* MBB) {
    auto It = CoalescedWeights.find(MBB);
    if (It == CoalescedWeights.end()) {
      It = CoalescedWeights.insert(std::make_pair(MBB, 0)).first;
    }
    return It;
  }

  /// Indicate to the backend that \c GV has had its storage changed to inside
  /// a constant pool. This means it no longer needs to be emitted as a
  /// global variable.
  void markGlobalAsPromotedToConstantPool(const GlobalVariable *GV) {
    PromotedGlobals.insert(GV);
  }
  SmallPtrSet<const GlobalVariable*, 2>& getGlobalsPromotedToConstantPool() {
    return PromotedGlobals;
  }
  int getPromotedConstpoolIncrease() const {
    return PromotedGlobalsIncrease;
  }
  void setPromotedConstpoolIncrease(int Sz) {
    PromotedGlobalsIncrease = Sz;
  }

  DenseMap<unsigned, unsigned> EHPrologueRemappedRegs;

  void setPreservesR0() { PreservesR0 = true; }
  bool getPreservesR0() const { return PreservesR0; }
};

} // end namespace llvm

#endif // LLVM_LIB_TARGET_ARM_ARMMACHINEFUNCTIONINFO_H

{'repo_name': 'llvm-mirror/llvm', 'stars': '4375', 'repo_language': 'LLVM', 'file_name': 'alias-analysis-uses.ll', 'mime_type': 'text/plain', 'hash': 8912135701467288771, 'source_dataset': 'data'}


/*
 * HydraBus/HydraNFC
 *
 * Copyright (C) 2014-2016 Benjamin VERNOUX
 * Copyright (C) 2016 Nicolas OBERLI
 *
 * 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.
 */

#include "common.h"
#include "tokenline.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

#include "hydrabus_bbio.h"
#include "hydrabus_bbio_rawwire.h"
#include "hydrabus_mode_twowire.h"
#include "hydrabus_mode_threewire.h"
#include "hydrabus_bbio_aux.h"

const mode_rawwire_exec_t bbio_twowire = {
	.init = &twowire_init_proto_default,
	.pin_init = &twowire_pin_init,
	.tim_init = &twowire_tim_init,
	.tim_update = &twowire_tim_set_prescaler,
	.read_u8 = &twowire_read_u8,
	.read_bit_clock = &twowire_read_bit_clock,
	.read_bit = &twowire_read_bit,
	.write_u8 = &twowire_write_u8,
	.write_bit = &twowire_send_bit,
	.clock = &twowire_clock,
	.clock_high = &twowire_clk_high,
	.clock_low = &twowire_clk_low,
	.data_high = &twowire_sda_high,
	.data_low = &twowire_sda_low,
	.cleanup = &twowire_cleanup,
};
const mode_rawwire_exec_t bbio_threewire = {
	.init = &threewire_init_proto_default,
	.pin_init = &threewire_pin_init,
	.tim_init = &threewire_tim_init,
	.tim_update = &threewire_tim_set_prescaler,
	.read_u8 = &threewire_read_u8,
	.read_bit_clock = &threewire_read_bit_clock,
	.read_bit = &threewire_read_bit,
	.write_u8 = &threewire_write_read_u8,
	.write_bit = &threewire_send_bit,
	.clock = &threewire_clock,
	.clock_high = &threewire_clk_high,
	.clock_low = &threewire_clk_low,
	.data_high = &threewire_sdo_high,
	.data_low = &threewire_sdo_low,
	.cleanup = &threewire_cleanup,
};

static void bbio_mode_id(t_hydra_console *con)
{
	cprint(con, BBIO_RAWWIRE_HEADER, 4);
}

void bbio_mode_rawwire(t_hydra_console *con)
{
	uint8_t bbio_subcommand, i;
	uint8_t rx_data[16], tx_data[16];
	uint8_t data;
	mode_rawwire_exec_t curmode = bbio_twowire;
	mode_config_proto_t* proto = &con->mode->proto;

	curmode.init(con);
	curmode.pin_init(con);
	curmode.tim_init(con);
	curmode.clock_low(con);
	curmode.data_low(con);

	bbio_mode_id(con);

	while (!hydrabus_ubtn()) {
		if(chnRead(con->sdu, &bbio_subcommand, 1) == 1) {
			switch(bbio_subcommand) {
			case BBIO_RESET:
				curmode.cleanup(con);
				return;
			case BBIO_MODE_ID:
				bbio_mode_id(con);
				break;
			case BBIO_RAWWIRE_READ_BYTE:
				rx_data[0] = curmode.read_u8(con);
				cprint(con, (char *)&rx_data[0], 1);
				break;
			case BBIO_RAWWIRE_READ_BIT:
				rx_data[0] = curmode.read_bit_clock(con);
				cprint(con, (char *)&rx_data[0], 1);
				break;
			case BBIO_RAWWIRE_PEEK_INPUT:
				rx_data[0] = curmode.read_bit(con);
				cprint(con, (char *)&rx_data[0], 1);
				break;
			case BBIO_RAWWIRE_CLK_TICK:
				curmode.clock(con);
				cprint(con, "\x01", 1);
				break;
			case BBIO_RAWWIRE_CLK_LOW:
				curmode.clock_low(con);
				cprint(con, "\x01", 1);
				break;
			case BBIO_RAWWIRE_CLK_HIGH:
				curmode.clock_high(con);
				cprint(con, "\x01", 1);
				break;
			case BBIO_RAWWIRE_DATA_LOW:
				curmode.data_low(con);
				cprint(con, "\x01", 1);
				break;
			case BBIO_RAWWIRE_DATA_HIGH:
				curmode.data_high(con);
				cprint(con, "\x01", 1);
				break;
			default:
				if ((bbio_subcommand & BBIO_AUX_MASK) == BBIO_AUX_MASK) {
					cprintf(con, "%c", bbio_aux(con, bbio_subcommand));
				} else if ((bbio_subcommand & BBIO_RAWWIRE_BULK_TRANSFER) == BBIO_RAWWIRE_BULK_TRANSFER) {
					// data contains the number of bytes to
					// write
					data = (bbio_subcommand & 0b1111) + 1;

					chnRead(con->sdu, tx_data, data);
					cprint(con, "\x01", 1);
					for(i=0; i<data; i++) {
						rx_data[i] = curmode.write_u8(con, tx_data[i]);
					}
					cprint(con, (char *)rx_data, data);
				} else if ((bbio_subcommand & BBIO_RAWWIRE_BULK_BIT) == BBIO_RAWWIRE_BULK_BIT) {
					// data contains the number of bits to
					// write
					data = (bbio_subcommand & 0b1111) + 1;

					chnRead(con->sdu, &tx_data[0], 1);
					if(proto->config.rawwire.dev_bit_lsb_msb == DEV_FIRSTBIT_MSB) {
						tx_data[0] = reverse_u8(tx_data[0]);
					}
					for (i=0; i<data; i++) {
						curmode.write_bit(con, (tx_data[0]>>i) & 1);
					}
					cprint(con, "\x01", 1);

				} else if ((bbio_subcommand & BBIO_RAWWIRE_BULK_CLK) == BBIO_RAWWIRE_BULK_CLK) {
					// data contains the number of bytes to
					// write
					data = (bbio_subcommand & 0b1111) + 1;

					for(i=0; i<data; i++) {
						curmode.clock(con);
					}
					cprint(con, "\x01", 1);
				} else if ((bbio_subcommand & BBIO_SPI_SET_SPEED) == BBIO_SPI_SET_SPEED) {
					switch(bbio_subcommand & 0b11){
					case 0:
						proto->config.rawwire.dev_speed = 5000;
						break;
					case 1:
						proto->config.rawwire.dev_speed = 50000;
						break;
					case 2:
						proto->config.rawwire.dev_speed = 100000;
						break;
					case 3:
						proto->config.rawwire.dev_speed = 1000000;
						break;
					}
					curmode.tim_update(con);
				} else if ((bbio_subcommand & BBIO_RAWWIRE_CONFIG) == BBIO_RAWWIRE_CONFIG) {
					curmode.cleanup(con);
					if(bbio_subcommand & 0b100){
						curmode = bbio_threewire;
					} else {
						curmode = bbio_twowire;
					}
					curmode.init(con);
					if(bbio_subcommand & 0b10){
						proto->config.rawwire.dev_bit_lsb_msb = DEV_FIRSTBIT_LSB;
					} else {
						proto->config.rawwire.dev_bit_lsb_msb = DEV_FIRSTBIT_MSB;
					}
					if(bbio_subcommand & 0b1000){
						proto->config.rawwire.dev_gpio_mode = MODE_CONFIG_DEV_GPIO_OUT_PUSHPULL;
					} else {
						proto->config.rawwire.dev_gpio_mode = MODE_CONFIG_DEV_GPIO_OUT_OPENDRAIN;
					}
					curmode.pin_init(con);
					curmode.tim_init(con);
					curmode.clock_low(con);
					curmode.data_low(con);

					cprint(con, "\x01", 1);
				} else if ((bbio_subcommand & BBIO_RAWWIRE_CONFIG_PERIPH) == BBIO_RAWWIRE_CONFIG_PERIPH) {
					if(bbio_subcommand & 0b100){
						proto->config.rawwire.dev_gpio_pull = MODE_CONFIG_DEV_GPIO_PULLUP;
					} else {
						proto->config.rawwire.dev_gpio_pull = MODE_CONFIG_DEV_GPIO_NOPULL;
					}
					//Set AUX[0] (PC4) value
					bbio_aux_write((bbio_subcommand & 0b10)>>1);

					curmode.pin_init(con);
					curmode.tim_init(con);
					curmode.clock_low(con);
					curmode.data_low(con);

					cprint(con, "\x01", 1);
				}
			}
		}
	}
	curmode.cleanup(con);
}

{'repo_name': 'hydrabus/hydrafw', 'stars': '138', 'repo_language': 'C', 'file_name': 'tx_bench.py', 'mime_type': 'text/x-python', 'hash': -4480078664451904146, 'source_dataset': 'data'}


/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Copyright (C) 2011-2019 OpenFOAM Foundation
     \\/     M anipulation  |
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    You should have received a copy of the GNU General Public License
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.

Class
    Foam::displacementSBRStressFvMotionSolver

Description
    Mesh motion solver for an fvMesh.  Based on solving the cell-centre
    solid-body rotation stress equations for the motion displacement.

SourceFiles
    displacementSBRStressFvMotionSolver.C

\*---------------------------------------------------------------------------*/

#ifndef displacementSBRStressFvMotionSolver_H
#define displacementSBRStressFvMotionSolver_H

#include "displacementMotionSolver.H"
#include "fvMotionSolver.H"

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

namespace Foam
{

// Forward class declarations
class motionDiffusivity;

/*---------------------------------------------------------------------------*\
             Class displacementSBRStressFvMotionSolver Declaration
\*---------------------------------------------------------------------------*/

class displacementSBRStressFvMotionSolver
:
    public displacementMotionSolver,
    public fvMotionSolver
{
    // Private Data

        //- Cell-centre motion field
        mutable volVectorField cellDisplacement_;

        //- Diffusivity used to control the motion
        autoPtr<motionDiffusivity> diffusivityPtr_;

public:

    //- Runtime type information
    TypeName("displacementSBRStress");

    // Constructors

        //- Construct from polyMesh and dictionary
        displacementSBRStressFvMotionSolver
        (
            const polyMesh&,
            const dictionary&
        );

        //- Disallow default bitwise copy construction
        displacementSBRStressFvMotionSolver
        (
            const displacementSBRStressFvMotionSolver&
        );

    //- Destructor
    ~displacementSBRStressFvMotionSolver();

    // Member Functions

        //- Return reference to the cell motion displacement field
        volVectorField& cellDisplacement()
        {
            return cellDisplacement_;
        }

        //- Return const reference to the cell motion displacement field
        const volVectorField& cellDisplacement() const
        {
            return cellDisplacement_;
        }

        //- Return diffusivity
        motionDiffusivity& diffusivity()
        {
            return diffusivityPtr_();
        }

        //- Return point location obtained from the current motion field
        virtual tmp<pointField> curPoints() const;

        //- Solve for motion
        virtual void solve();

        //- Update topology
        virtual void updateMesh(const mapPolyMesh&);

    // Member Operators

        //- Disallow default bitwise assignment
        void operator=(const displacementSBRStressFvMotionSolver&) = delete;
};

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

} // End namespace Foam

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

#endif

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

{'repo_name': 'OpenFOAM/OpenFOAM-dev', 'stars': '633', 'repo_language': 'C++', 'file_name': 'tensorOperator.sty', 'mime_type': 'text/plain', 'hash': 6790859290982669090, 'source_dataset': 'data'}


<?xml version="1.0" encoding="utf-8"?>
<root>
  <!--
    Microsoft ResX Schema

    Version 2.0

    The primary goals of this format is to allow a simple XML format
    that is mostly human readable. The generation and parsing of the
    various data types are done through the TypeConverter classes
    associated with the data types.

    Example:

    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">2.0</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>[base64 mime encoded serialized .NET Framework object]</value>
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
        <comment>This is a comment</comment>
    </data>

    There are any number of "resheader" rows that contain simple
    name/value pairs.

    Each data row contains a name, and value. The row also contains a
    type or mimetype. Type corresponds to a .NET class that support
    text/value conversion through the TypeConverter architecture.
    Classes that don't support this are serialized and stored with the
    mimetype set.

    The mimetype is used for serialized objects, and tells the
    ResXResourceReader how to depersist the object. This is currently not
    extensible. For a given mimetype the value must be set accordingly:

    Note - application/x-microsoft.net.object.binary.base64 is the format
    that the ResXResourceWriter will generate, however the reader can
    read any of the formats listed below.

    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
              </xsd:sequence>
              <xsd:attribute name="name" use="required" type="xsd:string" />
              <xsd:attribute name="type" type="xsd:string" />
              <xsd:attribute name="mimetype" type="xsd:string" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="assembly">
            <xsd:complexType>
              <xsd:attribute name="alias" type="xsd:string" />
              <xsd:attribute name="name" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <data name="CryptCommon_GenericError" xml:space="preserve">
    <value>An error occurred during a cryptographic operation.</value>
  </data>
  <data name="Common_BufferIncorrectlySized" xml:space="preserve">
    <value>The provided buffer is of length {0} byte(s). It must instead be exactly {1} byte(s) in length.</value>
  </data>
  <data name="CryptCommon_PayloadInvalid" xml:space="preserve">
    <value>The payload was invalid.</value>
  </data>
  <data name="Common_PropertyCannotBeNullOrEmpty" xml:space="preserve">
    <value>Property {0} cannot be null or empty.</value>
  </data>
  <data name="Common_DecryptionFailed" xml:space="preserve">
    <value>The provided payload could not be decrypted. Refer to the inner exception for more information.</value>
  </data>
  <data name="Common_EncryptionFailed" xml:space="preserve">
    <value>An error occurred while trying to encrypt the provided data. Refer to the inner exception for more information.</value>
  </data>
  <data name="Common_KeyNotFound" xml:space="preserve">
    <value>The key {0:B} was not found in the key ring.</value>
  </data>
  <data name="Common_KeyRevoked" xml:space="preserve">
    <value>The key {0:B} has been revoked.</value>
  </data>
  <data name="ProtectionProvider_BadMagicHeader" xml:space="preserve">
    <value>The provided payload cannot be decrypted because it was not protected with this protection provider.</value>
  </data>
  <data name="ProtectionProvider_BadVersion" xml:space="preserve">
    <value>The provided payload cannot be decrypted because it was protected with a newer version of the protection provider.</value>
  </data>
  <data name="Common_ValueMustBeNonNegative" xml:space="preserve">
    <value>Value must be non-negative.</value>
  </data>
  <data name="TypeExtensions_BadCast" xml:space="preserve">
    <value>The type '{1}' is not assignable to '{0}'.</value>
  </data>
  <data name="KeyManagementOptions_MinNewKeyLifetimeViolated" xml:space="preserve">
    <value>The new key lifetime must be at least one week.</value>
  </data>
  <data name="XmlKeyManager_DuplicateKey" xml:space="preserve">
    <value>The key {0:B} already exists in the keyring.</value>
  </data>
  <data name="Common_ArgumentCannotBeNullOrEmpty" xml:space="preserve">
    <value>Argument cannot be null or empty.</value>
  </data>
  <data name="Common_PropertyMustBeNonNegative" xml:space="preserve">
    <value>Property {0} must have a non-negative value.</value>
  </data>
  <data name="Platform_WindowsRequiredForGcm" xml:space="preserve">
    <value>GCM algorithms require the Windows platform.</value>
  </data>
  <data name="CertificateXmlEncryptor_CertificateNotFound" xml:space="preserve">
    <value>A certificate with the thumbprint '{0}' could not be found.</value>
  </data>
  <data name="EncryptedXmlDecryptor_DoesNotWorkOnCoreClr" xml:space="preserve">
    <value>Decrypting EncryptedXml-encapsulated payloads is not yet supported on Core CLR.</value>
  </data>
  <data name="AlgorithmAssert_BadBlockSize" xml:space="preserve">
    <value>The symmetric algorithm block size of {0} bits is invalid. The block size must be between 64 and 2048 bits, inclusive, and it must be a multiple of 8 bits.</value>
  </data>
  <data name="AlgorithmAssert_BadDigestSize" xml:space="preserve">
    <value>The validation algorithm digest size of {0} bits is invalid. The digest size must be between 128 and 2048 bits, inclusive, and it must be a multiple of 8 bits.</value>
  </data>
  <data name="AlgorithmAssert_BadKeySize" xml:space="preserve">
    <value>The symmetric algorithm key size of {0} bits is invalid. The key size must be between 128 and 2048 bits, inclusive, and it must be a multiple of 8 bits.</value>
  </data>
  <data name="KeyRingProvider_NoDefaultKey_AutoGenerateDisabled" xml:space="preserve">
    <value>The key ring does not contain a valid default protection key. The data protection system cannot create a new key because auto-generation of keys is disabled.</value>
  </data>
  <data name="LifetimeMustNotBeNegative" xml:space="preserve">
    <value>{0} must not be negative</value>
  </data>
  <data name="XmlKeyManager_IXmlRepositoryNotFound" xml:space="preserve">
    <value>The '{0}' instance could not be found. When an '{1}' instance is set, a corresponding '{0}' instance must also be set.</value>
  </data>
  <data name="FileSystem_EphemeralKeysLocationInContainer" xml:space="preserve">
    <value>Storing keys in a directory '{path}' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.</value>
  </data>
</root>

{'repo_name': 'dotnet/aspnetcore', 'stars': '18362', 'repo_language': 'C#', 'file_name': 'Cpp.Common.targets', 'mime_type': 'text/plain', 'hash': 2110322384441983558, 'source_dataset': 'data'}


package com.john.waveview;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;

import com.balaganovrocks.yourmasterclean.R;

// y=Asin(ωx+φ)+k
class Wave extends View {
    private final int WAVE_HEIGHT_LARGE = 16;
    private final int WAVE_HEIGHT_MIDDLE = 8;
    private final int WAVE_HEIGHT_LITTLE = 5;

    private final float WAVE_LENGTH_MULTIPLE_LARGE = 1.5f;
    private final float WAVE_LENGTH_MULTIPLE_MIDDLE = 1f;
    private final float WAVE_LENGTH_MULTIPLE_LITTLE = 0.5f;

    private final float WAVE_HZ_FAST = 0.13f;
    private final float WAVE_HZ_NORMAL = 0.09f;
    private final float WAVE_HZ_SLOW = 0.05f;

    public final int DEFAULT_ABOVE_WAVE_ALPHA = 50;
    public final int DEFAULT_BLOW_WAVE_ALPHA = 30;

    private final float X_SPACE = 20;
    private final double PI2 = 2 * Math.PI;

    private Path mAboveWavePath = new Path();
    private Path mBlowWavePath = new Path();

    private Paint mAboveWavePaint = new Paint();
    private Paint mBlowWavePaint = new Paint();

    private int mAboveWaveColor;
    private int mBlowWaveColor;

    private float mWaveMultiple;
    private float mWaveLength;
    private int mWaveHeight;
    private float mMaxRight;
    private float mWaveHz;

    // wave animation
    private float mAboveOffset = 0.0f;
    private float mBlowOffset;

    private RefreshProgressRunnable mRefreshProgressRunnable;

    private int left, right, bottom;
    // ω
    private double omega;

    public Wave(Context context, AttributeSet attrs) {
        this(context, attrs, R.attr.waveViewStyle);
    }

    public Wave(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);

        canvas.drawPath(mBlowWavePath, mBlowWavePaint);
        canvas.drawPath(mAboveWavePath, mAboveWavePaint);
    }

    public void setAboveWaveColor(int aboveWaveColor) {
        this.mAboveWaveColor = aboveWaveColor;
    }

    public void setBlowWaveColor(int blowWaveColor) {
        this.mBlowWaveColor = blowWaveColor;
    }

    public Paint getAboveWavePaint() {
        return mAboveWavePaint;
    }

    public Paint getBlowWavePaint() {
        return mBlowWavePaint;
    }

    public void initializeWaveSize(int waveMultiple, int waveHeight, int waveHz) {
        mWaveMultiple = getWaveMultiple(waveMultiple);
        mWaveHeight = getWaveHeight(waveHeight);
        mWaveHz = getWaveHz(waveHz);
        mBlowOffset = mWaveHeight * 0.4f;
        ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                mWaveHeight * 2);
        setLayoutParams(params);
    }

    public void initializePainters() {
        mAboveWavePaint.setColor(mAboveWaveColor);
        mAboveWavePaint.setAlpha(DEFAULT_ABOVE_WAVE_ALPHA);
        mAboveWavePaint.setStyle(Paint.Style.FILL);
        mAboveWavePaint.setAntiAlias(true);

        mBlowWavePaint.setColor(mBlowWaveColor);
        mBlowWavePaint.setAlpha(DEFAULT_BLOW_WAVE_ALPHA);
        mBlowWavePaint.setStyle(Paint.Style.FILL);
        mBlowWavePaint.setAntiAlias(true);
    }

    private float getWaveMultiple(int size) {
        switch (size) {
            case WaveView.LARGE:
                return WAVE_LENGTH_MULTIPLE_LARGE;
            case WaveView.MIDDLE:
                return WAVE_LENGTH_MULTIPLE_MIDDLE;
            case WaveView.LITTLE:
                return WAVE_LENGTH_MULTIPLE_LITTLE;
        }
        return 0;
    }

    private int getWaveHeight(int size) {
        switch (size) {
            case WaveView.LARGE:
                return WAVE_HEIGHT_LARGE;
            case WaveView.MIDDLE:
                return WAVE_HEIGHT_MIDDLE;
            case WaveView.LITTLE:
                return WAVE_HEIGHT_LITTLE;
        }
        return 0;
    }

    private float getWaveHz(int size) {
        switch (size) {
            case WaveView.LARGE:
                return WAVE_HZ_FAST;
            case WaveView.MIDDLE:
                return WAVE_HZ_NORMAL;
            case WaveView.LITTLE:
                return WAVE_HZ_SLOW;
        }
        return 0;
    }

    /**
     * calculate wave track
     */
    private void calculatePath() {
        mAboveWavePath.reset();
        mBlowWavePath.reset();

        getWaveOffset();

        float y;
        mAboveWavePath.moveTo(left, bottom);
        for (float x = 0; x <= mMaxRight; x += X_SPACE) {
            y = (float) (mWaveHeight * Math.sin(omega * x + mAboveOffset) + mWaveHeight);
            mAboveWavePath.lineTo(x, y);
        }
        mAboveWavePath.lineTo(right, bottom);

        mBlowWavePath.moveTo(left, bottom);
        for (float x = 0; x <= mMaxRight; x += X_SPACE) {
            y = (float) (mWaveHeight * Math.sin(omega * x + mBlowOffset) + mWaveHeight);
            mBlowWavePath.lineTo(x, y);
        }
        mBlowWavePath.lineTo(right, bottom);
    }

    @Override
    protected void onWindowVisibilityChanged(int visibility) {
        super.onWindowVisibilityChanged(visibility);
        if (View.GONE == visibility) {
            removeCallbacks(mRefreshProgressRunnable);
        } else {
            removeCallbacks(mRefreshProgressRunnable);
            mRefreshProgressRunnable = new RefreshProgressRunnable();
            post(mRefreshProgressRunnable);
        }
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
    }

    @Override
    public void onWindowFocusChanged(boolean hasWindowFocus) {
        super.onWindowFocusChanged(hasWindowFocus);
        if (hasWindowFocus) {
            if (mWaveLength == 0) {
                startWave();
            }
        }
    }

    private void startWave() {
        if (getWidth() != 0) {
            int width = getWidth();
            mWaveLength = width * mWaveMultiple;
            left = getLeft();
            right = getRight();
            bottom = getBottom();
            mMaxRight = right + X_SPACE;
            omega = PI2 / mWaveLength;
        }
    }

    private void getWaveOffset() {
        if (mBlowOffset > Float.MAX_VALUE - 100) {
            mBlowOffset = 0;
        } else {
            mBlowOffset += mWaveHz;
        }

        if (mAboveOffset > Float.MAX_VALUE - 100) {
            mAboveOffset = 0;
        } else {
            mAboveOffset += mWaveHz;
        }
    }

    private class RefreshProgressRunnable implements Runnable {
        public void run() {
            synchronized (Wave.this) {
                long start = System.currentTimeMillis();

                calculatePath();

                invalidate();

                long gap = 16 - System.currentTimeMillis() - start;
                postDelayed(this, gap < 0 ? 0 : gap);
            }
        }
    }

}

{'repo_name': 'joyoyao/superCleanMaster', 'stars': '1809', 'repo_language': 'Java', 'file_name': 'ApplicationTest.java', 'mime_type': 'text/html', 'hash': -7114524226611808818, 'source_dataset': 'data'}


/*********************************************
作者：曹旭升
QQ：279060597
访问博客了解详细介绍及更多内容：
http://blog.shengxunwei.com
**********************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sheng.SailingEase.Kernal;
namespace Sheng.SailingEase.Core
{
    public class ToolStripPageEntity : EntityBase
    {
        public ToolStripPageEntity()
        {
            XmlRootName = "Page";
        }
        public override void FromXml(string strXml)
        {
            SEXElement xmlDoc = SEXElement.Parse(strXml);
            this.Id = xmlDoc.GetAttributeObject("Id");
            this.Name = xmlDoc.GetAttributeObject("Name");
            this.Code = xmlDoc.GetAttributeObject("Code");
        }
        public override string ToXml()
        {
            SEXElement xmlDoc = SEXElement.Parse(base.ToXml());
            xmlDoc.AppendChild(XmlRootName);
            xmlDoc.AppendAttribute(String.Empty, "Id", this.Id);
            xmlDoc.AppendAttribute(String.Empty, "Name", this.Name);
            xmlDoc.AppendAttribute(String.Empty, "Code", this.Code);
            return xmlDoc.ToString();
        }
    }
}

{'repo_name': 'iccb1013/Sheng.Winform.IDE', 'stars': '159', 'repo_language': 'C#', 'file_name': 'SailingEase.sln', 'mime_type': 'text/plain', 'hash': -2939965754345083721, 'source_dataset': 'data'}


<?php

/*
 * This file is part of EC-CUBE
 *
 * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
 *
 * http://www.ec-cube.co.jp/
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Eccube\Service\Composer;

use Eccube\Entity\BaseInfo;
use Eccube\Repository\BaseInfoRepository;
use Symfony\Component\DependencyInjection\ContainerInterface;

class ComposerServiceFactory
{
    public static function createService(ContainerInterface $container)
    {
        return $container->get(ComposerApiService::class);
    }
}

{'repo_name': 'EC-CUBE/ec-cube', 'stars': '536', 'repo_language': 'PHP', 'file_name': 'devcontainer.json', 'mime_type': 'text/plain', 'hash': -5291556681962523531, 'source_dataset': 'data'}


<?php
/*
 * Copyright 2014 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.
 */

class Google_Service_BigtableAdmin_ListInstancesResponse extends Google_Collection
{
  protected $collection_key = 'instances';
  public $failedLocations;
  protected $instancesType = 'Google_Service_BigtableAdmin_Instance';
  protected $instancesDataType = 'array';
  public $nextPageToken;

  public function setFailedLocations($failedLocations)
  {
    $this->failedLocations = $failedLocations;
  }
  public function getFailedLocations()
  {
    return $this->failedLocations;
  }
  /**
   * @param Google_Service_BigtableAdmin_Instance
   */
  public function setInstances($instances)
  {
    $this->instances = $instances;
  }
  /**
   * @return Google_Service_BigtableAdmin_Instance
   */
  public function getInstances()
  {
    return $this->instances;
  }
  public function setNextPageToken($nextPageToken)
  {
    $this->nextPageToken = $nextPageToken;
  }
  public function getNextPageToken()
  {
    return $this->nextPageToken;
  }
}

{'repo_name': 'googleapis/google-api-php-client-services', 'stars': '842', 'repo_language': 'PHP', 'file_name': 'ServiceTest.php', 'mime_type': 'text/x-php', 'hash': 2722519041975100049, 'source_dataset': 'data'}


package org.ovirt.engine.ui.webadmin.section.main.view.tab.network;

import org.ovirt.engine.core.common.businessentities.network.ExternalSubnet;
import org.ovirt.engine.core.common.businessentities.network.ExternalSubnet.IpVersion;
import org.ovirt.engine.core.common.businessentities.network.NetworkView;
import org.ovirt.engine.ui.common.idhandler.ElementIdHandler;
import org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider;
import org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn;
import org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn;
import org.ovirt.engine.ui.uicommonweb.models.networks.NetworkExternalSubnetListModel;
import org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel;
import org.ovirt.engine.ui.webadmin.ApplicationConstants;
import org.ovirt.engine.ui.webadmin.gin.AssetProvider;
import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.network.SubTabNetworkExternalSubnetPresenter;
import org.ovirt.engine.ui.webadmin.section.main.view.AbstractSubTabTableView;

import com.google.gwt.core.client.GWT;
import com.google.inject.Inject;

public class SubTabNetworkExternalSubnetView extends AbstractSubTabTableView<NetworkView, ExternalSubnet, NetworkListModel, NetworkExternalSubnetListModel>
        implements SubTabNetworkExternalSubnetPresenter.ViewDef {

    interface ViewIdHandler extends ElementIdHandler<SubTabNetworkExternalSubnetView> {
        ViewIdHandler idHandler = GWT.create(ViewIdHandler.class);
    }

    private static final ApplicationConstants constants = AssetProvider.getConstants();

    @Inject
    public SubTabNetworkExternalSubnetView(SearchableDetailModelProvider<ExternalSubnet, NetworkListModel, NetworkExternalSubnetListModel> modelProvider) {
        super(modelProvider);
        initTable();
        initWidget(getTableContainer());
    }

    @Override
    protected void generateIds() {
        ViewIdHandler.idHandler.generateAndSetIds(this);
    }

    void initTable() {
        getTable().enableColumnResizing();

        AbstractTextColumn<ExternalSubnet> nameColumn =
                new AbstractTextColumn<ExternalSubnet>() {
                    @Override
                    public String getValue(ExternalSubnet object) {
                        return object.getName();
                    }
                };
        nameColumn.makeSortable();
        getTable().addColumn(nameColumn, constants.nameExternalSubnet(), "200px"); //$NON-NLS-1$

        AbstractTextColumn<ExternalSubnet> cidrColumn =
                new AbstractTextColumn<ExternalSubnet>() {
            @Override
            public String getValue(ExternalSubnet object) {
                return object.getCidr();
            }
        };
        cidrColumn.makeSortable();
        getTable().addColumn(cidrColumn, constants.cidrExternalSubnet(), "100px"); //$NON-NLS-1$

        AbstractTextColumn<ExternalSubnet> ipVersionColumn =
                new AbstractEnumColumn<ExternalSubnet, IpVersion>() {
            @Override
            protected IpVersion getRawValue(ExternalSubnet object) {
                return object.getIpVersion();
            }
        };
        ipVersionColumn.makeSortable();
        getTable().addColumn(ipVersionColumn, constants.ipVersionExternalSubnet(), "80px"); //$NON-NLS-1$

        AbstractTextColumn<ExternalSubnet> gatewayColumn =
                new AbstractTextColumn<ExternalSubnet>() {
                    @Override
                    public String getValue(ExternalSubnet object) {
                        return object.getGateway();
                    }
                };
        gatewayColumn.makeSortable();
        getTable().addColumn(gatewayColumn, constants.gatewayExternalSubnet(), "100px"); //$NON-NLS-1$

        AbstractTextColumn<ExternalSubnet> dnsServersColumn =
                new AbstractTextColumn<ExternalSubnet>() {
                    @Override
                    public String getValue(ExternalSubnet object) {
                        if (object != null && object.getDnsServers() != null) {
                            return String.join(", ", object.getDnsServers()); //$NON-NLS-1$
                        } else {
                            return "";
                        }
                    }
                };
        dnsServersColumn.makeSortable();
        getTable().addColumn(dnsServersColumn, constants.dnsServersExternalSubnet(), "200px"); //$NON-NLS-1$

        AbstractTextColumn<ExternalSubnet> externalIdColumn =
                new AbstractTextColumn<ExternalSubnet>() {
            @Override
            public String getValue(ExternalSubnet object) {
                return object.getId();
            }
        };
        externalIdColumn.makeSortable();
        getTable().addColumn(externalIdColumn, constants.externalIdExternalSubnet(), "300px"); //$NON-NLS-1$
    }
}

{'repo_name': 'oVirt/ovirt-engine', 'stars': '257', 'repo_language': 'Java', 'file_name': 'jboss-app.xml', 'mime_type': 'text/plain', 'hash': -4214165440241108898, 'source_dataset': 'data'}


# declaration-no-important

Disallow `!important` within declarations.

<!-- prettier-ignore -->
```css
a { color: pink !important; }
/**             ↑
 * This !important */
```

If you always want `!important` in your declarations, e.g. if you're writing [user styles](https://userstyles.org/), you can _safely_ add them using [`postcss-safe-important`](https://github.com/crimx/postcss-safe-important).

## Options

### `true`

The following patterns are considered violations:

<!-- prettier-ignore -->
```css
a { color: pink !important; }
```

<!-- prettier-ignore -->
```css
a { color: pink ! important; }
```

<!-- prettier-ignore -->
```css
a { color: pink!important; }
```

The following patterns are _not_ considered violations:

<!-- prettier-ignore -->
```css
a { color: pink; }
```

{'repo_name': 'ChromeDevTools/devtools-frontend', 'stars': '1492', 'repo_language': 'JavaScript', 'file_name': 'timestamp.ts', 'mime_type': 'text/plain', 'hash': -8681411339729871670, 'source_dataset': 'data'}


syntax = "proto3";

package nested;

message FooFlat {
  repeated int32 int_field = 1;
  repeated string str_field = 2;
}

message FooNested {
  message Sub {
    int32 int_field = 1;
    string str_field = 2;
  }

  repeated Sub sub = 1;
}

{'repo_name': 'google/proto-lens', 'stars': '357', 'repo_language': 'Haskell', 'file_name': 'Setup.hs', 'mime_type': 'text/plain', 'hash': -1516529228624527023, 'source_dataset': 'data'}


/*
Copyright 2017 Google Inc. All Rights Reserved.

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.
*/

#include "seurat/image/deep_exr_image_reader.h"
#include "seurat/image/deep_exr_image_writer.h"

#include <cmath>
#include <memory>
#include <string>

#include "ion/math/vector.h"
#include "ion/math/vectorutils.h"
#include "gtest/gtest.h"
#include "seurat/base/status.h"
#include "seurat/image/ldi.h"
#include "seurat/image/ldi_test_utils.h"
#include "seurat/testing/ion_test_utils.h"
#include "seurat/testing/test_flags.h"

namespace seurat {
namespace image {
namespace {

using base::Color4f;
using ion::math::Point2i;
using ion::math::Vector2i;

Ldi4f CreateTestLdi(const Vector2i& size) {
  std::vector<int> sample_counts;
  std::vector<Color4f> colors;
  std::vector<float> depths;
  for (int y = 0; y < size[1]; ++y) {
    for (int x = 0; x < size[0]; ++x) {
      const int sample_count = y * size[0] + x;
      sample_counts.push_back(sample_count);
      for (int i = 0; i < sample_count; ++i) {
        const float value = i / static_cast<float>(sample_count);
        colors.push_back(Color4f(value, value, value, value));
        depths.push_back(value);
      }
    }
  }
  return Ldi4f(size, sample_counts, colors, depths);
}

// Comparator for color values, taking into account float->half precision loss.
template <typename ColorType>
bool HalfColorAlmostEqual(const ColorType& lhs, const ColorType& rhs) {
  const float kEpsilon = 2e-4f;
  for (int i = 0; i < ColorType::kDimension; ++i) {
    if (std::abs(lhs[i] - rhs[i]) > kEpsilon) {
      return false;
    }
  }
  return true;
}

// Comparator for depth values, taking into account float->half precision loss.
template <typename T>
bool HalfDepthAlmostEqual(const T& lhs, const T& rhs) {
  const float kEpsilon = 2e-4f;
  return (std::abs(lhs - rhs) <= kEpsilon);
}

base::Status ReadExr(const std::string& serialized_exr, Ldi4f* ldi) {
  // Read an LDI back from the string.
  std::unique_ptr<DeepExrImageReader> reader;
  SEURAT_RETURN_IF_ERROR(
      DeepExrImageReader::Create(serialized_exr, &reader));
  std::vector<Color4f> colors(reader->GetSampleCount());
  std::vector<float> depths(reader->GetSampleCount());
  const auto sample_counts = reader->GetSampleCounts();
  reader->AddChannel({"R", &colors.data()[0][0], 4});
  reader->AddChannel({"G", &colors.data()[0][1], 4});
  reader->AddChannel({"B", &colors.data()[0][2], 4});
  reader->AddChannel({"A", &colors.data()[0][3], 4});
  reader->AddChannel({"Z", &depths.data()[0], 1});
  SEURAT_RETURN_IF_ERROR(reader->Read());

  *ldi = Ldi4f({reader->GetImageWidth(), reader->GetImageHeight()},
               {sample_counts.begin(), sample_counts.end()}, std::move(colors),
               std::move(depths));
  return base::OkStatus();
}

base::Status WriteExr(const Ldi4f& ldi,
                      DeepExrImageWriter::ValueType color_type,
                      DeepExrImageWriter::ValueType depth_type,
                      std::string* serialized_exr) {
  // Write the LDI to a string.
  std::vector<int> sample_counts;
  sample_counts.reserve(ldi.GetWidth() * ldi.GetHeight());
  for (int y = 0; y < ldi.GetHeight(); ++y) {
    for (int x = 0; x < ldi.GetWidth(); ++x) {
      sample_counts.push_back(ldi.GetSampleCount({x, y}));
    }
  }
  std::unique_ptr<DeepExrImageWriter> writer;
  SEURAT_RETURN_IF_ERROR(DeepExrImageWriter::Create(
      ldi.GetSize()[0], ldi.GetSize()[1], sample_counts, &writer));
  writer->AddChannel({"R", &ldi.GetColors()[0][0], 4, color_type});
  writer->AddChannel({"G", &ldi.GetColors()[0][1], 4, color_type});
  writer->AddChannel({"B", &ldi.GetColors()[0][2], 4, color_type});
  writer->AddChannel({"A", &ldi.GetColors()[0][3], 4, color_type});
  writer->AddChannel({"Z", &ldi.GetDepths()[0], 1, depth_type});
  SEURAT_RETURN_IF_ERROR(writer->Write(serialized_exr));
  return base::OkStatus();
}

TEST(DeepExrIo, WriteAndReadEmptyExr) {
  Vector2i size(3, 2);
  std::vector<int> sample_counts{{0, 0, 0, 0, 0, 0}};
  std::vector<Color4f> colors;
  std::vector<float> depths;
  Ldi4f ldi(size, sample_counts, colors, depths);

  // Write the LDI to a temp string
  std::string serialized_exr;
  base::Status status =
      WriteExr(ldi, DeepExrImageWriter::ValueType::kFloat,
               DeepExrImageWriter::ValueType::kFloat, &serialized_exr);
  EXPECT_TRUE(status.ok());

  // Read the LDI back from the string.
  Ldi4f ldi_copy;
  EXPECT_TRUE(ReadExr(serialized_exr, &ldi_copy).ok());

  EXPECT_TRUE(LdiEquals(ldi, ldi_copy));
}

TEST(DeepExrIo, WriteAndReadExrWithEmptyPixelAtEndOfScanline) {
  // This particular configuration was triggering a bug in the past, when the
  // sample count slice was stubbed out by a dummy in DeepExrImageReader::Read,
  // incorrectly assuming that OpenEXR would use the data from the previous call
  // in DeepExrImageReader::Init.
  Vector2i size(3, 2);
  std::vector<int> sample_counts{{1, 1, 1, 1, 1, 0}};
  std::vector<Color4f> colors{{
      Color4f(1.0f, 0.0f, 0.0f, 1.0f),
      Color4f(1.0f, 0.0f, 0.0f, 1.0f),
      Color4f(1.0f, 0.0f, 0.0f, 1.0f),
      Color4f(1.0f, 0.0f, 0.0f, 1.0f),
      Color4f(1.0f, 0.0f, 0.0f, 1.0f),
  }};
  std::vector<float> depths{{0.5f, 0.5f, 0.5f, 0.5f, 0.5f}};
  Ldi4f ldi(size, sample_counts, colors, depths);

  // Write the LDI to a temp string
  std::string serialized_exr;
  base::Status status =
      WriteExr(ldi, DeepExrImageWriter::ValueType::kFloat,
               DeepExrImageWriter::ValueType::kFloat, &serialized_exr);
  EXPECT_TRUE(status.ok());

  // Read the LDI back from the string.
  Ldi4f ldi_copy;
  EXPECT_TRUE(ReadExr(serialized_exr, &ldi_copy).ok());

  EXPECT_TRUE(LdiEquals(ldi, ldi_copy));
}

TEST(DeepExrIo, WriteAndReadExr) {
  // Create a test LDI and write it to a temp string.
  const Ldi4f ldi = CreateTestLdi({3, 2});
  std::string serialized_exr;
  base::Status status =
      WriteExr(ldi, DeepExrImageWriter::ValueType::kFloat,
               DeepExrImageWriter::ValueType::kFloat, &serialized_exr);
  EXPECT_TRUE(status.ok());

  // Read the LDI back from the string.
  Ldi4f ldi_copy;
  EXPECT_TRUE(ReadExr(serialized_exr, &ldi_copy).ok());

  EXPECT_TRUE(LdiEquals(ldi, ldi_copy));
}

TEST(DeepExrIo, ReadSpecialChannels) {
  // Create a test LDI and write it to a temp string.
  const Ldi4f ldi = CreateTestLdi({3, 2});
  std::string serialized_exr;
  base::Status status =
      WriteExr(ldi, DeepExrImageWriter::ValueType::kFloat,
               DeepExrImageWriter::ValueType::kFloat, &serialized_exr);
  EXPECT_TRUE(status.ok());

  // Read the LDI back from the string, but swizzle components and also use some
  // of the reserved channels.
  std::unique_ptr<DeepExrImageReader> reader;
  EXPECT_TRUE(DeepExrImageReader::Create(serialized_exr, &reader).ok());
  std::vector<Color4f> read_colors(reader->GetSampleCount());
  std::vector<float> read_depths(reader->GetSampleCount());
  const auto sample_counts = reader->GetSampleCounts();
  reader->AddChannel({"G", &read_colors[0][0], 4});
  reader->AddChannel({"B", &read_colors[0][1], 4});
  reader->AddChannel({"CONSTANT_ZERO", &read_colors[0][2], 4});
  reader->AddChannel({"CONSTANT_ONE", &read_colors[0][3], 4});
  reader->AddChannel({"Z", &read_depths[0], 1});
  EXPECT_TRUE(reader->Read().ok());
  Ldi4f ldi_copy = Ldi4f({reader->GetImageWidth(), reader->GetImageHeight()},
                         {sample_counts.begin(), sample_counts.end()},
                         std::move(read_colors), std::move(read_depths));

  Ldi4f modified_ldi = ldi;
  for (auto& color : modified_ldi.GetMutableColors()) {
    color = Color4f(color[1], color[2], 0.0f, 1.0f);
  }
  EXPECT_TRUE(LdiEquals(modified_ldi, ldi_copy, HalfColorAlmostEqual<Color4f>));
}

TEST(DeepExrIo, NonExistentChannels) {
  // Create a test LDI and write it to a temp string.
  const Ldi4f ldi = CreateTestLdi({3, 2});
  std::string serialized_exr;
  base::Status write_status =
      WriteExr(ldi, DeepExrImageWriter::ValueType::kFloat,
               DeepExrImageWriter::ValueType::kFloat, &serialized_exr);
  EXPECT_TRUE(write_status.ok());

  // Read the LDI back from the string, but specify a channel that does not
  // exist.
  std::unique_ptr<DeepExrImageReader> reader;
  EXPECT_TRUE(DeepExrImageReader::Create(serialized_exr, &reader).ok());
  std::vector<Color4f> read_colors(reader->GetSampleCount());
  std::vector<float> read_depths(reader->GetSampleCount());
  reader->AddChannel({"R", &read_colors[0][0], 4});
  reader->AddChannel({"foo", &read_colors[0][1], 4});
  reader->AddChannel({"B", &read_colors[0][2], 4});
  reader->AddChannel({"A", &read_colors[0][3], 4});
  reader->AddChannel({"Z", &read_depths[0], 1});
  base::Status read_status = reader->Read();
  EXPECT_FALSE(read_status.ok());
  EXPECT_EQ("EXR channel \"foo\" missing", read_status.error_message());
}

TEST(DeepExrIo, HalfPrecisionConversion) {
  // Create a test LDI and write it to a temp string.
  const Ldi4f ldi = CreateTestLdi({3, 2});
  std::string serialized_exr;
  base::Status status =
      WriteExr(ldi, DeepExrImageWriter::ValueType::kHalf,
               DeepExrImageWriter::ValueType::kHalf, &serialized_exr);
  EXPECT_TRUE(status.ok());

  // Read the LDI back from the string.
  Ldi4f ldi_copy;
  EXPECT_TRUE(ReadExr(serialized_exr, &ldi_copy).ok());

  EXPECT_TRUE(LdiEquals(ldi, ldi_copy, HalfColorAlmostEqual<Color4f>,
                        HalfDepthAlmostEqual<float>));
}

}  // namespace
}  // namespace image
}  // namespace seurat

{'repo_name': 'googlevr/seurat', 'stars': '804', 'repo_language': 'C++', 'file_name': 'openexr.BUILD', 'mime_type': 'text/plain', 'hash': -7742008626919179731, 'source_dataset': 'data'}


<cffunction name="onSessionEnd" returntype="void" access="public" output="false">
	<cfargument name="sessionscope" type="any" required="true">
	<cfargument name="applicationscope" type="any" required="true">
	<cfscript>
		$simpleLock(execute="$runOnSessionEnd", executeArgs=arguments, name="wheelsReloadLock", type="readOnly", timeout=180);
	</cfscript>
</cffunction>

<cffunction name="$runOnSessionEnd" returntype="void" access="public" output="false">
	<cfargument name="sessionscope" type="any" required="true">
 	<cfargument name="applicationscope" type="any" required="true">
	<cfscript>
		$include(template="#application.wheels.eventPath#/onsessionend.cfm");
	</cfscript>
</cffunction>

{'repo_name': 'zzzprojects/sqlfiddle', 'stars': '274', 'repo_language': 'JavaScript', 'file_name': 'sqlite_driver.js', 'mime_type': 'text/plain', 'hash': 1359730821252398166, 'source_dataset': 'data'}


<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="NReco.PdfGenerator" version="1.1.15" targetFramework="net40" />
  <package id="NUnit" version="3.8.1" targetFramework="net40" />
  <package id="NUnit3TestAdapter" version="3.8.0" targetFramework="net40" />
</packages>

{'repo_name': 'BoletoNet/boleto2net', 'stars': '105', 'repo_language': 'C#', 'file_name': 'AssemblyInfo.cs', 'mime_type': 'text/plain', 'hash': 6328704182493492072, 'source_dataset': 'data'}


..
    Copyright (c) 2020 The STE||AR-Group

    SPDX-License-Identifier: BSL-1.0
    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)

.. _modules_runtime_local:

=============
runtime_local
=============

TODO: High-level description of the library.

See the :ref:`API reference <modules_runtime_local_api>` of this module for more
details.

{'repo_name': 'STEllAR-GROUP/hpx', 'stars': '1458', 'repo_language': 'C++', 'file_name': 'CMakeLists.txt', 'mime_type': 'text/plain', 'hash': -2087513598583365804, 'source_dataset': 'data'}


#!/usr/bin/env python
"""
Usage:
    strip-eol-spaces <filepath>

"""
from difflib import unified_diff as differ
import sys
from xml.etree import cElementTree as ElementTree

def strip_eol_spaces(filepath):
    mode = "b" if sys.platform.startswith('win') else ""
    extra_space_string = ""
    with open(filepath, "rU" + mode) as fd:
        extra_space_string = fd.read()
    compact_string = extra_space_string.rstrip()
    diff = list(differ(extra_space_string.splitlines(),
                       compact_string.splitlines(),
                       filepath, filepath))
    changed = '\n'.join(diff)
    if changed:
        with open(filepath, 'w' + mode) as fd:
            fd.write(compact_string)
        print "Striped extra EOL Spaces:", filepath

if __name__ == "__main__":
    import sys

    argv = sys.argv[1:] if len(sys.argv) > 1 else []
    if not argv:
        print __doc__
    else:
        filepath = argv[0]
        extensions_to_convert = ('c', 'cpp', 'h', 'hpp', 'cs', 'py',
                                 'vcxproj', 'vcxproj.filters', 'xml')
        if filepath.endswith(extensions_to_convert):
            strip_eol_spaces(filepath)

{'repo_name': 'RegrowthStudios/SoACode-Public', 'stars': '188', 'repo_language': 'C++', 'file_name': 'HunterGate.cmake', 'mime_type': 'text/plain', 'hash': 7818355100679801569, 'source_dataset': 'data'}


<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <stroke android:width="3dp" android:color="#fff" />
    <padding android:left="-5dp" android:top="1dp" android:right="-5dp"
        android:bottom="1dp" />
</shape>

{'repo_name': 'vpaliy/Melophile', 'stars': '855', 'repo_language': 'Java', 'file_name': 'UserMapperTest.kt', 'mime_type': 'text/x-c++', 'hash': 7062823402129544418, 'source_dataset': 'data'}


var path = require('path')

var mr = require('npm-registry-mock')
var test = require('tap').test
var common = require('../common-tap')
var Tacks = require('tacks')
var Dir = Tacks.Dir
var File = Tacks.File

var workdir = common.pkg
var cachedir = common.cache
var modulesdir = path.join(workdir, 'modules')
var oldModule = path.join(modulesdir, 'good-night-0.1.0.tgz')
var newModule = path.join(modulesdir, 'good-night-1.0.0.tgz')

var config = [
  '--cache', cachedir,
  '--prefix', workdir,
  '--registry', common.registry
]

var fixture = new Tacks(Dir({
  'modules': Dir({
    'good-night-0.1.0.tgz': File(Buffer.from(
      '1f8b0800000000000003ed934f4bc43010c57beea7187a59056dd36eff80' +
      'de85050541c1f3d8c634da4e4a925a8af8dd6db7bb8ba0e0c15559e9eff2' +
      '206f929909bc06f327143c6826f51f8d2267cf30c6d2388641c32c61ef75' +
      '4d9426e084519a25491645cbcc61e192c5d1e0ef7b90cf688d453d8cf2dd' +
      '77a65d60a707c28b0b031e61cdbd33f08452c52949515aef64729eb93652' +
      'd168323ff4d9f6bce026d7b2b11bafef11b1eb3a221a2aa6126c6da9f4e8' +
      '5e691f6e908a1a697b5ff346196995eec7023399c1c7fe95cc3999f57077' +
      'b717d7979efbeafef5a7fd2336b90f6a943484ff477a7c917f96c5bbfc87' +
      '493ae63f627138e7ff37c815195571bf52e268b1820e0d0825498055d069' +
      '6939d8521ab86f2dace0815715a0a9386f16c7e7730c676666660e9837c0' +
      'f6795d000c0000',
      'hex'
    )),
    'good-night-1.0.0.tgz': File(Buffer.from(
      '1f8b0800000000000003ed954d6bc24010863dfb2bb6b9a8503793b849a0' +
      'eda5979efa052d484184252e495a331b76d78a94fef76e8cf683163cd42a' +
      '957d2e03796777268187543c7de299f0aba6d2472db1b5650020668cd81a' +
      '24117cae4bc23822ad208c93284a1208c216040318c436dff6223f31d386' +
      '2bbbca6fef69de85bcd77fc24b9b583ce4a5f04e88974939e96391e5c63b' +
      '6e9267a17421b10e030a14d6cf2742a7aaa8cc2a5b2c38e7f3f91c116d47' +
      'd3c2672697aa4eaf1425771c2725c7f579252aa90b23d5a26ed04de87f9f' +
      '3f2d52817ab9dcf0fee2f6d26bbfb6f7fdd10e8895f77ec90bb4f2ffc98c' +
      '0dfe439c7cf81fc4b5ff213070feef8254a2965341a732eb76b4cef39c12' +
      'e456eb52d82a29198dc637639f9c751fce8796eba35ea777ea0c3c14d6fe' +
      '532314f62ba9ccf6676cf21fbefcff59ed3f4b22e7ff2e60110bc37d2fe1' +
      '70381c8e9df306642df14500100000',
      'hex'
    ))
  })
}))

var server

// In this test we mock a situation where the user has a package in his cache,
// a newer version of the package is published, and the user tried to install
// said new version while requestion that the cache be used.
// npm should see that it doesn't have the package in its cache and hit the
// registry.
var onlyOldMetadata = {
  'name': 'good-night',
  'dist-tags': {
    'latest': '0.1.0'
  },
  'versions': {
    '0.1.0': {
      'name': 'good-night',
      'version': '0.1.0',
      'dist': {
        'shasum': '2a746d49dd074ba0ec2d6ff13babd40c658d89eb',
        'tarball': 'http://localhost:' + common.port + '/good-night/-/good-night-0.1.0.tgz'
      }
    }
  }
}

var oldAndNewMetadata = Object.assign({}, onlyOldMetadata)
oldAndNewMetadata['dist-tags'] = { latest: '1.0.0' }
oldAndNewMetadata.versions = Object.assign({
  '1.0.0': {
    'name': 'good-night',
    'version': '1.0.0',
    'dist': {
      'shasum': 'f377bf002a0a8fc4085d347a160a790b76896bc3',
      'tarball': 'http://localhost:' + common.port + '/good-night/-/good-night-1.0.0.tgz'
    }
  }
}, oldAndNewMetadata.versions)

function setup () {
  cleanup()
  fixture.create(workdir)
}

function cleanup () {
  fixture.remove(workdir)
}

test('setup', function (t) {
  setup()
  t.end()
})

test('setup initial server', function (t) {
  mr({
    port: common.port,
    throwOnUnmatched: true
  }, function (err, s) {
    t.ifError(err, 'registry mocked successfully')
    server = s

    server.get('/good-night')
      .many({ min: 1, max: 1 })
      .reply(200, onlyOldMetadata)
    server.get('/good-night/-/good-night-0.1.0.tgz')
      .many({ min: 1, max: 1 })
      .replyWithFile(200, oldModule)

    t.end()
  })
})

test('install initial version', function (t) {
  common.npm(config.concat([
    'install', 'good-night'
  ]), {stdio: 'inherit'}, function (err, code) {
    if (err) throw err
    t.is(code, 0, 'initial install succeeded')
    server.done()
    t.end()
  })
})

test('cleanup initial server', function (t) {
  server.close()
  t.end()
})

test('setup new server', function (t) {
  mr({
    port: common.port,
    throwOnUnmatched: true
  }, function (err, s) {
    t.ifError(err, 'registry mocked successfully')
    server = s

    server.get('/good-night')
      .many({ min: 1, max: 1 })
      .reply(200, oldAndNewMetadata)

    server.get('/good-night/-/good-night-1.0.0.tgz')
      .many({ min: 1, max: 1 })
      .replyWithFile(200, newModule)

    t.end()
  })
})

test('install new version', function (t) {
  common.npm(config.concat([
    '--prefer-offline',
    'install', 'good-night@1.0.0'
  ]), {}, function (err, code, stdout, stderr) {
    if (err) throw err
    t.equal(stderr, '', 'no error output')
    t.is(code, 0, 'install succeeded')

    t.end()
  })
})

test('install does not hit server again', function (t) {
  // The mock server route definitions ensure we don't hit the server again
  common.npm(config.concat([
    '--prefer-offline',
    '--parseable',
    'install', 'good-night'
  ]), {stdio: [0, 'pipe', 2]}, function (err, code, stdout) {
    if (err) throw err
    t.is(code, 0, 'install succeeded')

    t.match(stdout, /^update\tgood-night\t1.0.0\t/, 'installed latest version')
    server.done()
    t.end()
  })
})

test('cleanup', function (t) {
  server.close()
  cleanup()
  t.end()
})

{'repo_name': 'nodejs/node', 'stars': '71611', 'repo_language': 'JavaScript', 'file_name': 'rc4-586.s', 'mime_type': 'text/x-asm', 'hash': -103703504122007115, 'source_dataset': 'data'}


/*
 * Copyright 2013-2020 consulo.io
 *
 * 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.intellij.openapi.editor.markup;

/**
 * Type of the analyzing status that's taking place.
 * <p>
 * from kotlin
 */
public enum AnalyzingType {
  COMPLETE, // Analyzing complete
  PARTIAL,  // Analyzing has partial results available for displaying
  EMPTY     // Analyzing in progress but no information is available
}

{'repo_name': 'consulo/consulo', 'stars': '603', 'repo_language': 'Java', 'file_name': 'UIController.java', 'mime_type': 'text/x-java', 'hash': 4601272109234314051, 'source_dataset': 'data'}


user nginx nginx;
worker_processes 1;

error_log /var/log/nginx/error_log info;

events {
        worker_connections 1024;
        use epoll;
}

http {
        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        log_format main
                '$remote_addr - $remote_user [$time_local] '
                '"$request" $status $bytes_sent '
                '"$http_referer" "$http_user_agent" '
                '"$gzip_ratio"';

        client_header_timeout 10m;
        client_body_timeout 10m;
        send_timeout 10m;

        connection_pool_size 256;
        client_header_buffer_size 1k;
        large_client_header_buffers 4 2k;
        request_pool_size 4k;

        gzip on;
        gzip_min_length 1100;
        gzip_buffers 4 8k;
        gzip_types text/plain;

        output_buffers 1 32k;
        postpone_output 1460;

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;

        keepalive_timeout 75 20;

        ignore_invalid_headers on;

        ssl_session_cache shared:SSL:10m;

        index index.html;

        server {
                listen 127.0.0.1;
                server_name localhost;

                access_log /var/log/nginx/localhost.access_log main;
                error_log /var/log/nginx/localhost.error_log info;

                root /var/www/localhost/htdocs;
        }

        # SSL example
        server {
                listen 127.0.0.1:443;
                server_name localhost;

                ssl on;
                ssl_certificate /etc/ssl/nginx/nginx-server.pem;
                ssl_client_certificate /etc/ssl/nginx/cacert.pem;
                ssl_certificate_key /etc/ssl/nginx/nginx.key;
                ssl_verify_client optional;

                access_log /var/log/nginx/localhost.ssl_access_log main;
                error_log /var/log/nginx/localhost.ssl_error_log info;

                root /var/www/localhost/htdocs;

                set $web2pyroot /home/Desktop/source/michelecomitini-facebookaccess;

                location /pki/ {
                         root /var/www/localhost/html;
                }

                location ~* ^/(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ {
                    alias $web2pyroot/applications/$1/static/$2;
                    expires max;
                }

                location / {
                         include /etc/nginx/scgi_params;
                         scgi_pass 127.0.0.1:4000;

                         #Module ngx_http_ssl_module supports the following built-in variables:

                         #$ssl_cipher returns the cipher suite being used for the currently established SSL/TLS connection
                         #$ssl_client_serial returns the serial number of the client certificate for the currently established SSL/TLS connection — if applicable, i.e., if client authentication is activated in the connection
                         #$ssl_client_s_dn returns the subject Distinguished Name (DN) of the client certificate for the currently established SSL/TLS connection — if applicable, i.e., if client authentication is activated in the connection
                         #$ssl_client_i_dn returns the issuer DN of the client certificate for the currently established SSL/TLS connection — if applicable, i.e., if client authentication is activated in the connection
                         #$ssl_protocol returns the protocol of the currently established SSL/TLS connection — depending on the configuration and client available options it's one of SSLv2, SSLv3 or TLSv1
                         #$ssl_session_id the Session ID of the established secure connection — requires Nginx version greater or equal to 0.8.20
                         #$ssl_client_cert
                         #$ssl_client_raw_cert
                         #$ssl_client_verify takes the value "SUCCESS" when the client certificate is successfully verified
                         scgi_param SSL_PROTOCOL $ssl_protocol;
                         scgi_param HTTPS on;
                         scgi_param SSL_CIPHER $ssl_cipher;
                         scgi_param SSL_CLIENT_SERIAL $ssl_client_serial;
                         scgi_param SSL_CLIENT_S_DN $ssl_client_s_dn;
                         scgi_param SSL_CLIENT_I_DN $ssl_client_i_dn;
                         scgi_param SSL_SESSION_ID $ssl_session_id;
                         scgi_param SSL_CLIENT_CERT $ssl_client_cert;
                         scgi_param SSL_CLIENT_RAW_CERT $ssl_client_raw_cert;
                         scgi_param SSL_CLIENT_VERIFY $ssl_client_verify;
                }
        }
}

{'repo_name': 'realpython/book2-exercises', 'stars': '157', 'repo_language': 'Python', 'file_name': 'test_users.py', 'mime_type': 'text/x-python', 'hash': 2590221847875626185, 'source_dataset': 'data'}


---
layout: default
built_from_commit: 2959aff838fdb13a35943fa8a83581fc3c1f0707
title: 'Man Page: puppet apply'
canonical: "/puppet/latest/man/apply.html"
---

NAME

  puppet-apply - Apply Puppet manifests locally

SYNOPSIS

Applies a standalone Puppet manifest to the local system.

USAGE

puppet apply [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose]
  [-e|--execute] [--detailed-exitcodes] [-L|--loadclasses]
  [-l|--logdest syslog|eventlog|<var>ABS FILEPATH</var>|console] [--noop]
  [--catalog <var>catalog</var>] [--write-catalog-summary] <var>file</var>

DESCRIPTION

This is the standalone puppet execution tool; use it to apply
individual manifests.

When provided with a modulepath, via command line or config file, puppet
apply can effectively mimic the catalog that would be served by puppet
master with access to the same modules, although there are some subtle
differences. When combined with scheduling and an automated system for
pushing manifests, this can be used to implement a serverless Puppet
site.

Most users should use 'puppet agent' and 'puppet master' for site-wide
manifests.

OPTIONS

Any setting that's valid in the configuration
file is a valid long argument for puppet apply. For example, 'tags' is a
valid setting, so you can specify '--tags <var>class</var>,<var>tag</var>'
as an argument.

See the configuration file documentation at
https://puppet.com/docs/puppet/latest/configuration.html for the
full list of acceptable parameters. You can generate a commented list of all
configuration options by running puppet with
'--genconfig'.

--debug:
Enable full debugging.

--detailed-exitcodes:
Provide extra information about the run via exit codes. If enabled, 'puppet
apply' will use the following exit codes:

0: The run succeeded with no changes or failures; the system was already in
the desired state.

1: The run failed.

2: The run succeeded, and some resources were changed.

4: The run succeeded, and some resources failed.

6: The run succeeded, and included both changes and failures.

--help:
Print this help message

--loadclasses:
Load any stored classes. 'puppet agent' caches configured classes
(usually at /etc/puppetlabs/puppet/classes.txt), and setting this option causes
all of those classes to be set in your puppet manifest.

--logdest:
Where to send log messages. Choose between 'syslog' (the POSIX syslog
service), 'eventlog' (the Windows Event Log), 'console', or the path to a log
file. Defaults to 'console'.

A path ending with '.json' will receive structured output in JSON format. The
log file will not have an ending ']' automatically written to it due to the
appending nature of logging. It must be appended manually to make the content
valid JSON.

A path ending with '.jsonl' will receive structured output in JSON Lines
format.

--noop:
Use 'noop' mode where Puppet runs in a no-op or dry-run mode. This
is useful for seeing what changes Puppet will make without actually
executing the changes.

--execute:
Execute a specific piece of Puppet code

--test:
Enable the most common options used for testing. These are 'verbose',
'detailed-exitcodes' and 'show_diff'.

--verbose:
Print extra information.

--catalog:
Apply a JSON catalog (such as one generated with 'puppet master --compile'). You can
either specify a JSON file or pipe in JSON from standard input.

--write-catalog-summary
After compiling the catalog saves the resource list and classes list to the node
in the state directory named classes.txt and resources.txt

EXAMPLE

$ puppet apply -l /tmp/manifest.log manifest.pp
$ puppet apply --modulepath=/root/dev/modules -e "include ntpd::server"
$ puppet apply --catalog catalog.json

AUTHOR

Luke Kanies

COPYRIGHT

Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License

{'repo_name': 'puppetlabs/puppet-docs', 'stars': '225', 'repo_language': 'HTML', 'file_name': 'sentence_segmenter.rb', 'mime_type': 'text/x-ruby', 'hash': -4699210431781076978, 'source_dataset': 'data'}


# Chinese Language Modeling

## Background

A language model (LM) assigns a probability to any text string or corpus.  Its goal is to assign high probability (or low perplexity) to fluent text strings it has never observed before, and low probability to others.

## Example

Input:

```
我们体育界是有信心做到为北京2022年冬季奥运会提供坚实的人才基础
```

Output:

```
60.2 perplexity
```

## Standard metric:

* Perplexity (ppl) measures how well the LM performs on previously-unseen text S.  If an LM assigns probability P(S) to S of length N, the perplexity is 2^{-(1/N) log2 P(S)}.  Length may be measured in characters or words.
  * Language models typically assign probability incrementally, in which case perplexity sums up log probabilities of individual tokens given their left contexts: 2^{-(1/N) sum_i log2 P(S_i)}
* An related metric is bits-per-character (bpc).  If perplexity is measured on a character basis, then ppl = 2^bpc.
* Performance in English language modeling is tracked in places such as [here](https://paperswithcode.com/task/language-modeling).  Standard datasets come with a shared specification for:
  * Train/dev/test corpora splits
  * Units of prediction (typically words rather than characters)
  * Fixed word tokenization
  * Handling of out-of-vocabulary (OOV) items

Common English datasets include:

|   | Train (wds) | Dev (wds) | Test (wds) | Genre |
| --- | --- | --- | --- | --- |
|  Penn Treebank | 888k | 70k | 79k | News |
|  WikiText-103 | 103m | 218k | 246k | Wikipedia |
|  Google 1B | 829m | 160k | 160k | News commentary |

Generally speaking, Chinese LM datasets do not yet have this level of shared specification.

## Chinese Treebank.

The Chinese Treebank is available from the Linguistic Data Consortium.  It does not come with a standard train/dev/test split for language modeling.

|   | Word tokens |
| --- | --- |
|  [Chinese Treebank (CBT) v9](https://catalog.ldc.upenn.edu/LDC2016T13) | 2m |

### Results

These numbers are not comparable, given different training conditions!

|   | Character ppl | Word ppl | Notes |
| --- | --- | --- | --- |
|  Glyce (glyph vectors). [We et al, 2019](https://arxiv.org/abs/1901.10125) | 51 | 176 | V6. 4,401 distinct characters.. Data split 80/10/10. For word-level: Jieba segmentation. Singletons → UNK. |
|  RNNG [Dyer et al, 2016](https://arxiv.org/abs/1602.07776) | -- | 171.9 | V5.1. 31k vocab. Maybe singletons → UNK? Test is just 348 lines, so standard split. Claim train is 50k (LDC says 19k). |
|  Segmental NLMs [Kawakami et al, 2016](https://arxiv.org/pdf/1811.09353.pdf) | 4.8 bits per character (not ppl) | -- | V5.1 manual segmentation. Score as bits per character (bpc). Data [here](https://s3.eu-west-2.amazonaws.com/k-kawakami/seg.zip). |

## Chinese Gigaword.

Chinese Gigaword is also available from the Linguistic Data Consortium.

|  Corpora | Word tokens |
| --- | --- |
|  [Chinese Gigaword](https://catalog.ldc.upenn.edu/LDC2011T13) V5 (others exist) | 934k |

### Results

These numbers are not comparable, given different training conditions.

|  Chinese Gigaword | Character ppl | Word ppl | Notes |
| --- | --- | --- | --- |
|  [Liu et al, NTU 2016](https://arxiv.org/abs/1611.08656) [GW v1] | 86.9 | -- | 531k lines train, 260k test. 5k vocab. Unclear if character or word-based LM. |
|  [Huang et al, 2010 [GW v2]](http://www.imaging.org/site/PDFS/Reporter/Articles/2010_25/Rep25_2_EI2010_HUANG.pdf) | -- | 220.6 | 610m chars, random 11m for test. MSR segmenter. |
|  Neural Lattice Models [v5] [Buckman+Neubig, 2018](https://www.mitpressjournals.org/doi/pdf/10.1162/tacl_a_00036) | 32.19 | -- | *Guangming Daily subset, top 10k chars + UNK, length <150. 934k lines train, 30k line test. Data [here](https://github.com/jbuckman/neural-lattice-language-models). |

## Other Resources

### Common Crawl Data

[CommonCrawl](https://commoncrawl.org) has released enormous quantities of web-crawled data that can be mined for Chinese text. Several groups have built their own pipelines to do the extraction and filtering.

The CLUE Organization extracted "Clue Corpus 2020" (also called "C5") from the Common Crawl data. It is 100G raw text with 35 billion Chinese characters.
Intended to be a large-scale corpus for pre-training Chinese language models.
Preprint paper by [Xu, Zhang, and Dong](https://arxiv.org/abs/2003.01355v2)

### CLUECorpusSmall

Publicly-available data, collected at https://github.com/CLUEbenchmark/CLUECorpus2020 and https://github.com/brightmart/nlp_chinese_corpus
Includes:

1. Wikipedia (wiki2019zh), 1 million well-structured Chinese entries
2. News corpus (news2016zh), 2.5 million pieces of news, including keywords and descriptions
3. Baike 2018qa (baike2018qa), 1.5 million question-and-answer questions
4. Community Q&A json version (webtext2019zh), 4.1 million high-quality community questions and answers, suitable for training large models
5. Translation corpus (translation2019zh), 5.2 million Chinese and English sentence pairs

---

**Suggestions? Changes? Please send email to [chinesenlp.xyz@gmail.com](mailto:chinesenlp.xyz@gmail.com)**

{'repo_name': 'didi/ChineseNLP', 'stars': '838', 'repo_language': 'HTML', 'file_name': 'sentiment_analysis.md', 'mime_type': 'text/plain', 'hash': -6025578345213159407, 'source_dataset': 'data'}


import os
import pytest

def pytest_addoption(parser):
    parser.addoption("--cfg", action="store")

@pytest.fixture(scope="module")
def cfg(request):
    return request.config.getoption("--cfg")

@pytest.fixture(scope="module")
def testdata():
    import pandas
    return pandas.read_pickle("{}/../testdata/test.pkl".format(os.path.dirname(__file__)))

{'repo_name': 'binaryai/sdk', 'stars': '219', 'repo_language': 'Python', 'file_name': 'function.py', 'mime_type': 'text/plain', 'hash': -1082761550166963922, 'source_dataset': 'data'}


/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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.apache.kafka.connect.runtime.errors;

import java.util.concurrent.Callable;

/**
 * A recoverable operation evaluated in the connector pipeline.
 *
 * @param <V> return type of the result of the operation.
 */
public interface Operation<V> extends Callable<V> {

}

{'repo_name': 'apache/kafka', 'stars': '16347', 'repo_language': 'Java', 'file_name': 'checkstyle.xml', 'mime_type': 'text/xml', 'hash': -2233016692217384502, 'source_dataset': 'data'}