text:
/*
 * Custom Skin Sample
 *
 * This file shows an example of a custom skin.  It targets any menu that has the Skin set to "None"
 *
 * Copy this to custom/custom.css to apply this custom skin
 *
 * For a copy of this file with comments for each style, see https://gist.github.com/sevenspark/24a087689db958670ed5
 */
/* UberMenu - Copyright 2011-2016, SevenSpark */
.ubermenu-skin-none {
  font-size: 12px;
  color: #888888;
}
.ubermenu-skin-none .ubermenu-target {
  color: #555555;
}
.ubermenu-skin-none .ubermenu-target-description {
  color: #aaaaaa;
}
.ubermenu-skin-none.ubermenu-responsive-toggle {
  background: #222222;
  color: #eeeeee;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: bold;
}
.ubermenu-skin-none.ubermenu-responsive-toggle:hover {
  background: #111111;
  color: #ffffff;
}
.ubermenu-skin-none {
  border: none;
  background: #222222;
}
.ubermenu-skin-none .ubermenu-item-level-0.ubermenu-current-menu-item > .ubermenu-target,
.ubermenu-skin-none .ubermenu-item-level-0.ubermenu-current-menu-parent > .ubermenu-target,
.ubermenu-skin-none .ubermenu-item-level-0.ubermenu-current-menu-ancestor > .ubermenu-target {
  color: #ffffff;
  background: #000000;
}
.ubermenu-skin-none .ubermenu-item.ubermenu-item-level-0 > .ubermenu-highlight {
  color: #4d90fe;
  background: transparent;
}
.ubermenu-skin-none.ubermenu-vertical .ubermenu-item-level-0 > .ubermenu-target {
  background: #222222;
}
.ubermenu-skin-none .ubermenu-item-level-0 > .ubermenu-target {
  font-weight: bold;
  color: #d9d9d9;
  text-transform: uppercase;
  border-left: none;
}
body:not(.rtl) .ubermenu-skin-none.ubermenu-horizontal .ubermenu-item-level-0:first-child > .ubermenu-target {
  box-shadow: none;
}
.ubermenu-skin-none .ubermenu-item-level-0:hover > .ubermenu-target,
.ubermenu-skin-none .ubermenu-item-level-0.ubermenu-active > .ubermenu-target {
  background: #000000;
  color: #ffffff;
}
.ubermenu-skin-none .ubermenu-item-level-0 > .ubermenu-submenu-type-stack > .ubermenu-item > .ubermenu-target {
  color: #d9d9d9;
}
.ubermenu-skin-none .ubermenu-item-level-0 > .ubermenu-submenu-type-stack > .ubermenu-item > .ubermenu-target:hover {
  color: #ffffff;
}
.ubermenu-skin-none .ubermenu-submenu.ubermenu-submenu-drop {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
}
.ubermenu-skin-none.ubermenu-horizontal .ubermenu-item-level-0 > .ubermenu-submenu-drop {
  border-top: none;
}
.ubermenu-skin-none .ubermenu-tab-content-panel {
  background: #f9f9f9;
}
.ubermenu-skin-none .ubermenu-submenu,
.ubermenu-skin-none .ubermenu-submenu .ubermenu-target {
  color: #555555;
}
.ubermenu-skin-none .ubermenu-submenu .ubermenu-highlight {
  color: #4d90fe;
}
.ubermenu-skin-none .ubermenu-submenu .ubermenu-target:hover,
.ubermenu-skin-none .ubermenu-submenu .ubermenu-active > .ubermenu-target {
  color: #111111;
}
.ubermenu-skin-none .ubermenu-submenu .ubermenu-target > .ubermenu-target-description {
  color: #aaaaaa;
}
.ubermenu-skin-none .ubermenu-submenu .ubermenu-active > .ubermenu-target > .ubermenu-target-description {
  color: #666666;
}
.ubermenu-skin-none .ubermenu-submenu .ubermenu-item-header > .ubermenu-target {
  font-weight: bold;
  color: #555555;
}
.ubermenu-skin-none .ubermenu-submenu .ubermenu-item-header.ubermenu-has-submenu-stack > .ubermenu-target {
  border-bottom: 1px solid #e9e9e9;
}
.ubermenu-skin-none .ubermenu-submenu .ubermenu-item-header > .ubermenu-target:hover {
  color: #222222;
}
.ubermenu-skin-none .ubermenu-submenu .ubermenu-current-menu-item > .ubermenu-target {
  color: #222222;
  background: transparent;
}
.ubermenu-nojs.ubermenu-skin-none .ubermenu-submenu .ubermenu-tabs .ubermenu-tab:hover > .ubermenu-target,
.ubermenu-skin-none .ubermenu-submenu .ubermenu-tab.ubermenu-active > .ubermenu-target {
  background: #eeeeee;
  color: #111111;
}
.ubermenu-skin-none .ubermenu-tabs-group,
.ubermenu-skin-none .ubermenu-tab > .ubermenu-target,
.ubermenu-skin-none .ubermenu-tab-content-panel {
  border-color: #eeeeee;
}
.ubermenu-skin-none .ubermenu-submenu-drop {
  border-bottom-width: 3px;
}


text:
using System;
using NBitcoin;
using Stratis.Bitcoin.Configuration.Settings;
using Stratis.Bitcoin.P2P.Protocol.Payloads;

namespace Stratis.Bitcoin.Consensus
{
    ///
    /// A context that is used by consensus that is required for validation, in case validation failed the <see cref="ValidationContext.Error"/> property will be set.
    /// It is used when a new block is downloaded or mined.
    ///
    public class ValidationContext
    {
        /// A value indicating the peer should not be banned.
        public const int BanDurationNoBan = -1;

        /// A value indicating the peer ban time should be <see cref="ConnectionManagerSettings.BanTimeSeconds"/>.
        public const int BanDurationDefaultBan = 0;

        /// Chained header of the block being validated.
        public ChainedHeader ChainedHeaderToValidate { get; set; }

        /// Downloaded or mined block to be validated.
        public Block BlockToValidate { get; set; }

        /// If the block validation failed this will be set with the reason of failure.
        public ConsensusError Error { get; set; }

        ///
        /// If the block validation failed with <see cref="ConsensusErrors.BlockTimestampTooFar"/>
        /// then this is set to a time until which the block should be marked as invalid. Otherwise it is <c>null</c>.
        ///
        public DateTime? RejectUntil { get; set; }

        ///
        /// If the block validation failed with a <see cref="ConsensusError"/> that is considered malicious the peer will get banned.
        /// The ban, unless specified otherwise, will default to <see cref="ConnectionManagerSettings.BanTimeSeconds"/>.
        ///
        /// <remarks>
        /// Setting this value to be <see cref="BanDurationNoBan"/> will prevent the peer from being banned.
        /// Setting this value to be <see cref="BanDurationDefaultBan"/> will default to <see cref="ConnectionManagerSettings.BanTimeSeconds"/>.
        /// </remarks>
        public int BanDurationSeconds { get; set; }

        /// Services that are missing from the peers.
        /// <remarks>
        /// Set in case some information is missing from the block which leads
        /// to inability to validate the block properly. Set to <c>null</c> otherwise.
        /// </remarks>
        public NetworkPeerServices? MissingServices { get; set; }

        /// Gets or sets flag indicating if we do not have enough information to validate UTOX.
        public bool InsufficientHeaderInformation { get; set; }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package commandframework_discordgo

// Command represents a command used within Discord.
//
// If the prefix is "!", then "!h" and "!help" would require:
// ```go
// Command {
// 	Handler: func(context *CommandContext) { context.DoStuff() },
// 	Names: []string{"h", "help"},
// }
// ```
type Command struct {
	// Handler represents the function that will handle the command.
	Handler func(context *CommandContext)

	// Names represent the name and aliases this command can be used with.
	//
	// Names[0] is the main name, while the rest are counted as aliases.
	// If there is no name upon registration, this will produce an error.
	Names []string

	// Predicates represent the different conditions that are required the be fullfilled
	// before the command will be executed as usual.
	Predicates []func(context *CommandContext) bool
}


text:
#include <stdio.h>
#include <unistd.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>

#include "vr_types.h"
#include "vr_os.h"
#include "vr_packet.h"
#include "vr_message.h"
#include "vr_interface.h"

#include "host/vr_host.h"
#include "host/vr_host_packet.h"
#include "host/vr_host_interface.h"

extern int vrouter_host_init(unsigned int);
extern unsigned int vr_num_cpus;
extern unsigned int vr_bridge_entries;
extern unsigned int vr_bridge_oentries;
extern unsigned int vr_flow_entries;
extern unsigned int vr_oflow_entries;

unsigned int allocated = 0;

void *alloc_for_test(unsigned int size, unsigned int obj) {
    void *ptr;

    ptr = malloc(size);
    allocated++;

    return ptr;
}

void free_for_test(void *ptr, unsigned int obj) {
    free(ptr);
    allocated--;
}

int fake_response_cb(void *ptr1, unsigned int i, void *ptr2) {
    return 1;
}

void drop_stats_memory_test(void **state) {
    vr_drop_stats_req req = {
        .h_op = SANDESH_OP_GET,
        .vds_rid = 0
    };

    /* process request */
    vr_drop_stats_req_process(&req);

    /* currently one response queued */
    assert_int_equal(allocated, 2);

    /* dequeue it, and check the alloctions */
    vr_message_process_response(fake_response_cb, NULL);
    assert_int_equal(allocated, 0);
}

static void setup(void **state) {
    vrouter_host->hos_malloc = alloc_for_test;
    vrouter_host->hos_zalloc = alloc_for_test;
    vrouter_host->hos_free = free_for_test;
}

static void teardown(void **state) {
    free(*state);
}

int main(void) {
    int ret;

    /*
     * Initialise the tables to small values, in the test they
     * are likely to fail with huge values
     */
    vr_bridge_entries = 1024;
    vr_bridge_oentries = 64;
    vr_flow_entries = 1024;
    vr_oflow_entries = 64;

    /* test suite */
    const UnitTest tests[] = {
        unit_test_setup_teardown(drop_stats_memory_test, setup, teardown),
    };

    vr_diet_message_proto_init();

    /* init the vrouter */
    ret = vrouter_host_init(VR_MPROTO_SANDESH);
    if (ret)
        return ret;

    /* let's run the test suite */
    ret = run_tests(tests);

    return ret;
}


text:
package com.facebook.infrastructure.db;

import com.facebook.infrastructure.concurrent.StageManager;
import com.facebook.infrastructure.io.DataInputBuffer;
import com.facebook.infrastructure.net.EndPoint;
import com.facebook.infrastructure.net.IVerbHandler;
import com.facebook.infrastructure.net.Message;
import com.facebook.infrastructure.net.MessagingService;
import com.facebook.infrastructure.service.StorageService;
import com.facebook.infrastructure.utils.LogUtil;
import org.apache.log4j.Logger;

import java.io.IOException;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;

/**
 * Author : Avinash Lakshman ( alakshman@facebook.com) & Prashant Malik ( pmalik@facebook.com )
 */

public class RowMutationVerbHandler implements IVerbHandler<byte[]>
{
    protected static class RowMutationContext
    {
        protected Row row_ = new Row();
        protected DataInputBuffer buffer_ = new DataInputBuffer();
    }

    private static Logger logger_ = Logger.getLogger(RowMutationVerbHandler.class);
    /* We use this so that we can reuse the same row mutation context for the mutation. */
    private static ThreadLocal<RowMutationContext> tls_ = new InheritableThreadLocal<RowMutationContext>();

    public void doVerb(Message<byte[]> message)
    {
        byte[] bytes = message.getMessageBody();
        /* Obtain a Row Mutation Context from TLS */
        RowMutationContext rowMutationCtx = tls_.get();
        if ( rowMutationCtx == null )
        {
            rowMutationCtx = new RowMutationContext();
            tls_.set(rowMutationCtx);
        }

        rowMutationCtx.buffer_.reset(bytes, bytes.length);

        try
        {
            RowMutation rm = RowMutation.serializer().deserialize(rowMutationCtx.buffer_);
            logger_.debug("Applying " + rm);

            /* Check if there were any hints in this message */
            byte[] hintedBytes = message.getHeader(RowMutation.HINT);
            if ( hintedBytes != null && hintedBytes.length > 0 )
            {
            	EndPoint hint = EndPoint.fromBytes(hintedBytes);
                logger_.debug("Adding hint for " + hint);
                /* add necessary hints to this mutation */
                RowMutation hintedMutation = new RowMutation(rm.table(), HintedHandOffManager.key_);
                hintedMutation.addHints(rm.key() + ":" + hint.getHost());
                hintedMutation.apply();
            }

            long start = System.currentTimeMillis();

            rowMutationCtx.row_.clear();
            rowMutationCtx.row_.key(rm.key());
            rm.apply(rowMutationCtx.row_);

            long end = System.currentTimeMillis();

            WriteResponse response = new WriteResponse(rm.table(), rm.key(), true);
            Message responseMessage = WriteResponse.makeWriteResponseMessage(message, response);
            logger_.debug("Mutation applied in " + (end - start) + "ms.  Sending response to " +  message.getFrom() + " for key :" + rm.key());
            MessagingService.getMessagingInstance().sendOneWay(responseMessage, message.getFrom());
        }
        catch( ColumnFamilyNotDefinedException ex )
        {
            // TODO shouldn't this be checked before it's sent to us?
            logger_.warn("column family not defined, and no way to tell the client", ex);
        }
        catch ( IOException e )
        {
            throw new RuntimeException(e);
        }
    }
}


text:
package ocagent

const (
	maxAnnotationEventsPerSpan = 32
	maxMessageEventsPerSpan    = 128
)

type SpanConfig struct {
	AnnotationEventsPerSpan int
	MessageEventsPerSpan    int
}

func (spanConfig SpanConfig) GetAnnotationEventsPerSpan() int {
	if spanConfig.AnnotationEventsPerSpan <= 0 {
		return maxAnnotationEventsPerSpan
	}
	return spanConfig.AnnotationEventsPerSpan
}

func (spanConfig SpanConfig) GetMessageEventsPerSpan() int {
	if spanConfig.MessageEventsPerSpan <= 0 {
		return maxMessageEventsPerSpan
	}
	return spanConfig.MessageEventsPerSpan
}


text:
require "minitest/autorun"
require "minitest/spec"

require "google/cloud/language"

describe "LanguageServiceSmokeTest" do
  it "runs one smoke test with analyze_sentiment" do

    language_service_client = Google::Cloud::Language.new
    content = "Hello, world!"
    type = :PLAIN_TEXT
    document = { content: content, type: type }
    response = language_service_client.analyze_sentiment(document)
  end
end


text:
/* $Id: sph_simd.h 154 2010-04-26 17:00:24Z tp $ */
/**
 * SIMD interface. SIMD is a family of functions which differ by
 * their output size; this implementation defines SIMD for output
 * sizes 224, 256, 384 and 512 bits.
 *
 * ==========================(LICENSE BEGIN)============================
 *
 * Copyright (c) 2007-2010  Projet RNRT SAPHIR
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * ===========================(LICENSE END)=============================
 *
 * @file     sph_simd.h
 * @author   Thomas Pornin <thomas.pornin@cryptolog.com>
 */

#ifndef SPH_SIMD_H__
#define SPH_SIMD_H__

#ifdef __cplusplus
extern "C"{
#endif

#include <stddef.h>
#include "sph_types.h"

/**
 * Output size (in bits) for SIMD-224.
 */
#define SPH_SIZE_simd224   224

/**
 * Output size (in bits) for SIMD-256.
 */
#define SPH_SIZE_simd256   256

/**
 * Output size (in bits) for SIMD-384.
 */
#define SPH_SIZE_simd384   384

/**
 * Output size (in bits) for SIMD-512.
 */
#define SPH_SIZE_simd512   512

/**
 * This structure is a context for SIMD computations: it contains the
 * intermediate values and some data from the last entered block. Once
 * an SIMD computation has been performed, the context can be reused for
 * another computation. This specific structure is used for SIMD-224
 * and SIMD-256.
 *
 * The contents of this structure are private. A running SIMD computation
 * can be cloned by copying the context (e.g. with a simple
 * memcpy()).
 */
typedef struct {
#ifndef DOXYGEN_IGNORE
  unsigned char buf[64];    /* first field, for alignment */
  size_t ptr;
  sph_u32 state[16];
  sph_u32 count_low, count_high;
#endif
} sph_simd_small_context;

/**
 * This structure is a context for SIMD computations: it contains the
 * intermediate values and some data from the last entered block. Once
 * an SIMD computation has been performed, the context can be reused for
 * another computation. This specific structure is used for SIMD-384
 * and SIMD-512.
 *
 * The contents of this structure are private. A running SIMD computation
 * can be cloned by copying the context (e.g. with a simple
 * memcpy()).
 */
typedef struct {
#ifndef DOXYGEN_IGNORE
  unsigned char buf[128];    /* first field, for alignment */
  size_t ptr;
  sph_u32 state[32];
  sph_u32 count_low, count_high;
#endif
} sph_simd_big_context;

/**
 * Type for a SIMD-224 context (identical to the common "small" context).
 */
typedef sph_simd_small_context sph_simd224_context;

/**
 * Type for a SIMD-256 context (identical to the common "small" context).
 */
typedef sph_simd_small_context sph_simd256_context;

/**
 * Type for a SIMD-384 context (identical to the common "big" context).
 */
typedef sph_simd_big_context sph_simd384_context;

/**
 * Type for a SIMD-512 context (identical to the common "big" context).
 */
typedef sph_simd_big_context sph_simd512_context;

/**
 * Initialize an SIMD-224 context. This process performs no memory allocation.
 *
 * @param cc   the SIMD-224 context (pointer to a
 *             sph_simd224_context)
 */
void sph_simd224_init(void *cc);

/**
 * Process some data bytes. It is acceptable that len is zero
 * (in which case this function does nothing).
 *
 * @param cc     the SIMD-224 context
 * @param data   the input data
 * @param len    the input data length (in bytes)
 */
void sph_simd224(void *cc, const void *data, size_t len);

/**
 * Terminate the current SIMD-224 computation and output the result into
 * the provided buffer. The destination buffer must be wide enough to
 * accomodate the result (28 bytes). The context is automatically
 * reinitialized.
 *
 * @param cc    the SIMD-224 context
 * @param dst   the destination buffer
 */
void sph_simd224_close(void *cc, void *dst);

/**
 * Add a few additional bits (0 to 7) to the current computation, then
 * terminate it and output the result in the provided buffer, which must
 * be wide enough to accomodate the result (28 bytes). If bit number i
 * in ub has value 2^i, then the extra bits are those
 * numbered 7 downto 8-n (this is the big-endian convention at the byte
 * level). The context is automatically reinitialized.
 *
 * @param cc    the SIMD-224 context
 * @param ub    the extra bits
 * @param n     the number of extra bits (0 to 7)
 * @param dst   the destination buffer
 */
void sph_simd224_addbits_and_close(
    void *cc, unsigned ub, unsigned n, void *dst);

/**
 * Initialize an SIMD-256 context. This process performs no memory allocation.
 *
 * @param cc   the SIMD-256 context (pointer to a
 *             sph_simd256_context)
 */
void sph_simd256_init(void *cc);

/**
 * Process some data bytes. It is acceptable that len is zero
 * (in which case this function does nothing).
 *
 * @param cc     the SIMD-256 context
 * @param data   the input data
 * @param len    the input data length (in bytes)
 */
void sph_simd256(void *cc, const void *data, size_t len);

/**
 * Terminate the current SIMD-256 computation and output the result into
 * the provided buffer. The destination buffer must be wide enough to
 * accomodate the result (32 bytes). The context is automatically
 * reinitialized.
 *
 * @param cc    the SIMD-256 context
 * @param dst   the destination buffer
 */
void sph_simd256_close(void *cc, void *dst);

/**
 * Add a few additional bits (0 to 7) to the current computation, then
 * terminate it and output the result in the provided buffer, which must
 * be wide enough to accomodate the result (32 bytes). If bit number i
 * in ub has value 2^i, then the extra bits are those
 * numbered 7 downto 8-n (this is the big-endian convention at the byte
 * level). The context is automatically reinitialized.
 *
 * @param cc    the SIMD-256 context
 * @param ub    the extra bits
 * @param n     the number of extra bits (0 to 7)
 * @param dst   the destination buffer
 */
void sph_simd256_addbits_and_close(
    void *cc, unsigned ub, unsigned n, void *dst);

/**
 * Initialize an SIMD-384 context. This process performs no memory allocation.
 *
 * @param cc   the SIMD-384 context (pointer to a
 *             sph_simd384_context)
 */
void sph_simd384_init(void *cc);

/**
 * Process some data bytes. It is acceptable that len is zero
 * (in which case this function does nothing).
 *
 * @param cc     the SIMD-384 context
 * @param data   the input data
 * @param len    the input data length (in bytes)
 */
void sph_simd384(void *cc, const void *data, size_t len);

/**
 * Terminate the current SIMD-384 computation and output the result into
 * the provided buffer. The destination buffer must be wide enough to
 * accomodate the result (48 bytes). The context is automatically
 * reinitialized.
 *
 * @param cc    the SIMD-384 context
 * @param dst   the destination buffer
 */
void sph_simd384_close(void *cc, void *dst);

/**
 * Add a few additional bits (0 to 7) to the current computation, then
 * terminate it and output the result in the provided buffer, which must
 * be wide enough to accomodate the result (48 bytes). If bit number i
 * in ub has value 2^i, then the extra bits are those
 * numbered 7 downto 8-n (this is the big-endian convention at the byte
 * level). The context is automatically reinitialized.
 *
 * @param cc    the SIMD-384 context
 * @param ub    the extra bits
 * @param n     the number of extra bits (0 to 7)
 * @param dst   the destination buffer
 */
void sph_simd384_addbits_and_close(
    void *cc, unsigned ub, unsigned n, void *dst);

/**
 * Initialize an SIMD-512 context. This process performs no memory allocation.
 *
 * @param cc   the SIMD-512 context (pointer to a
 *             sph_simd512_context)
 */
void sph_simd512_init(void *cc);

/**
 * Process some data bytes. It is acceptable that len is zero
 * (in which case this function does nothing).
 *
 * @param cc     the SIMD-512 context
 * @param data   the input data
 * @param len    the input data length (in bytes)
 */
void sph_simd512(void *cc, const void *data, size_t len);

/**
 * Terminate the current SIMD-512 computation and output the result into
 * the provided buffer. The destination buffer must be wide enough to
 * accomodate the result (64 bytes). The context is automatically
 * reinitialized.
 *
 * @param cc    the SIMD-512 context
 * @param dst   the destination buffer
 */
void sph_simd512_close(void *cc, void *dst);

/**
 * Add a few additional bits (0 to 7) to the current computation, then
 * terminate it and output the result in the provided buffer, which must
 * be wide enough to accomodate the result (64 bytes). If bit number i
 * in ub has value 2^i, then the extra bits are those
 * numbered 7 downto 8-n (this is the big-endian convention at the byte
 * level). The context is automatically reinitialized.
 *
 * @param cc    the SIMD-512 context
 * @param ub    the extra bits
 * @param n     the number of extra bits (0 to 7)
 * @param dst   the destination buffer
 */
void sph_simd512_addbits_and_close(
    void *cc, unsigned ub, unsigned n, void *dst);
#ifdef __cplusplus
}
#endif

#endif


text:
using System;

namespace AssetPackage.Exceptions
{
    public class TrackerException : Exception{
        public TrackerException(string message) : base(message){
        }
    }
}


text:
<?php

namespace Acme\FmpsBundle\Entity;

use Doctrine\ORM\EntityRepository;

class AttachementRepository extends EntityRepository
{
    public function findBySearchCriteria($options)
    {

      $qb = $this->createQueryBuilder('a')->select('a');

      if ($options->getActualite() && $options->getActualite() != '')
      {
          $qb->andWhere('a.actualite = :actualite')->setParameter('actualite', $options->getActualite());
      }

      return $qb->getQuery();
    }
}

?>


text:
version_file="${1:-lib/hub/version.rb}"

if git rev-parse --verify HEAD >/dev/null 2>&1; then
  if git diff-index --quiet --cached HEAD -- "$version_file"; then
    exit 1
  else
    git cat-file blob ":$version_file" | grep VERSION | head -1 | cut -d\' -f2
  fi
else
  exit 1
fi


text:
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
using OmniSharp.DotNetTest.Models;
using OmniSharp.DotNetTest.TestFrameworks;
using OmniSharp.Eventing;
using OmniSharp.Extensions;
using OmniSharp.Services;

namespace OmniSharp.DotNetTest
{
    internal class VSTestManager : TestManager
    {
        public VSTestManager(Project project, string workingDirectory, IDotNetCliService dotNetCli, SemanticVersion dotNetCliVersion, IEventEmitter eventEmitter, ILoggerFactory loggerFactory)
            : base(project, workingDirectory, dotNetCli, dotNetCliVersion, eventEmitter, loggerFactory.CreateLogger<VSTestManager>())
        {
        }

        private object LoadRunSettingsOrDefault(string runSettingsPath, string targetFrameworkVersion)
        {
            if (runSettingsPath != null)
            {
                try
                {
                    return File.ReadAllText(runSettingsPath);
                }
                catch (FileNotFoundException)
                {
                    EmitTestMessage(TestMessageLevel.Warning, $"RunSettings file {runSettingsPath} not found. Continuing with default settings...");
                }
                catch (Exception e)
                {
                    EmitTestMessage(TestMessageLevel.Warning, $"There was an error loading runsettings at {runSettingsPath}: {e}. Continuing with default settings...");
                }
            }

            if (!string.IsNullOrWhiteSpace(targetFrameworkVersion))
            {
                return $@"
<RunSettings>
    <RunConfiguration>
        <TargetFrameworkVersion>{targetFrameworkVersion}</TargetFrameworkVersion>
    </RunConfiguration>
</RunSettings>";
            }

            return "<RunSettings/>";
        }

        protected override string GetCliTestArguments(int port, int parentProcessId)
        {
            return $"vstest --Port:{port} --ParentProcessId:{parentProcessId}";
        }

        protected override void VersionCheck()
        {
            SendMessage(MessageType.VersionCheck, 1);

            var message = ReadMessage();
            var version = message.DeserializePayload<int>();

            if (version != 1)
            {
                throw new InvalidOperationException($"Expected ProtocolVersion 1, but was {version}");
            }
        }

        protected override bool PrepareToConnect(bool noBuild)
        {
            if (noBuild)
            {
                return true;
            }

            // The project must be built before we can test.
            var arguments = "build";

            // If this is .NET CLI version 2.0.0 or greater, we also specify --no-restore to ensure that
            // implicit restore on build doesn't slow the build down.
            if (DotNetCliVersion >= new SemanticVersion(2, 0, 0))
            {
                arguments += " --no-restore";
            }

            var process = DotNetCli.Start(arguments, WorkingDirectory);

            process.OutputDataReceived += (_, e) =>
            {
                EmitTestMessage(TestMessageLevel.Informational, e.Data ?? string.Empty);
            };

            process.ErrorDataReceived += (_, e) =>
            {
                EmitTestMessage(TestMessageLevel.Error, e.Data ?? string.Empty);
            };

            process.BeginOutputReadLine();
            process.BeginErrorReadLine();

            process.WaitForExit();

            return process.ExitCode == 0
                && File.Exists(Project.OutputFilePath);
        }

        private static void VerifyTestFramework(string testFrameworkName)
        {
            var testFramework = TestFramework.GetFramework(testFrameworkName);
            if (testFramework == null)
            {
                throw new InvalidOperationException($"Unknown test framework: {testFrameworkName}");
            }
        }

        public override async Task<DiscoverTestsResponse> DiscoverTestsAsync(string runSettings, string testFrameworkName, string targetFrameworkVersion, CancellationToken cancellationToken)
        {
            var testCases = await DiscoverTestsAsync(null, runSettings, targetFrameworkVersion, cancellationToken);
            return new DiscoverTestsResponse
            {
                Tests = testCases.Select(o => new Test
                {
                    FullyQualifiedName = o.FullyQualifiedName,
                    DisplayName = o.DisplayName,
                    Source = o.Source,
                    CodeFilePath = o.CodeFilePath,
                    LineNumber = o.LineNumber
                }).ToArray()
            };
        }

        public override async Task<GetTestStartInfoResponse> GetTestStartInfoAsync(string methodName, string runSettings, string testFrameworkName, string targetFrameworkVersion, CancellationToken cancellationToken)
        {
            VerifyTestFramework(testFrameworkName);

            var testCases = await DiscoverTestsAsync(new string[] { methodName }, runSettings, targetFrameworkVersion, cancellationToken);
            var testStartInfo = await GetTestRunnerProcessStartInfo(testCases, debuggingEnabled: false, runSettings, targetFrameworkVersion, cancellationToken);

            return new GetTestStartInfoResponse
            {
                Executable = testStartInfo.FileName,
                Argument = testStartInfo.Arguments,
                WorkingDirectory = testStartInfo.WorkingDirectory
            };
        }

        public override async Task<DebugTestGetStartInfoResponse> DebugGetStartInfoAsync(string methodName, string runSettings, string testFrameworkName, string targetFrameworkVersion, CancellationToken cancellationToken)
         => await DebugGetStartInfoAsync(new string[] { methodName }, runSettings, testFrameworkName, targetFrameworkVersion, cancellationToken);

        public override async Task<DebugTestGetStartInfoResponse> DebugGetStartInfoAsync(string[] methodNames, string runSettings, string testFrameworkName, string targetFrameworkVersion, CancellationToken cancellationToken)
        {
            VerifyTestFramework(testFrameworkName);

            var testCases = await DiscoverTestsAsync(methodNames, runSettings, targetFrameworkVersion, cancellationToken);
            var testStartInfo = await GetTestRunnerProcessStartInfo(testCases, debuggingEnabled: true, runSettings, targetFrameworkVersion, cancellationToken);

            return new DebugTestGetStartInfoResponse
            {
                FileName = testStartInfo.FileName,
                Arguments = testStartInfo.Arguments,
                WorkingDirectory = testStartInfo.WorkingDirectory,
                EnvironmentVariables = testStartInfo.EnvironmentVariables,
                Succeeded = true
            };
        }

        private async Task<TestProcessStartInfo> GetTestRunnerProcessStartInfo(TestCase[] testCases, bool debuggingEnabled, string runSettings, string targetFrameworkVersion, CancellationToken cancellationToken)
        {
            SendMessage(MessageType.GetTestRunnerProcessStartInfoForRunSelected,
                new
                {
                    TestCases = testCases,
                    RunSettings = LoadRunSettingsOrDefault(runSettings, targetFrameworkVersion)
                });

            bool done = false;
            TestProcessStartInfo startInfo = null;
            while (!done)
            {
                var (success, message) = await TryReadMessageAsync(cancellationToken);
                if (!success)
                {
                    return startInfo;
                }

                switch (message.MessageType)
                {
                    case MessageType.TestMessage:
                        EmitTestMessage(message.DeserializePayload<TestMessagePayload>());
                        break;

                    case MessageType.CustomTestHostLaunch:
                        startInfo = message.DeserializePayload<TestProcessStartInfo>();
                        done = true;
                        break;

                    case MessageType.ExecutionComplete:
                        done = true;
                        break;
                }
            }

            return startInfo;
        }

        public override async Task DebugLaunchAsync(CancellationToken cancellationToken)
        {
            SendMessage(MessageType.CustomTestHostLaunchCallback,
                new
                {
                    HostProcessId = Process.GetCurrentProcess().Id
                });

            var done = false;

            while (!done)
            {
                var (success, message) = await TryReadMessageAsync(cancellationToken);
                if (!success)
                {
                    break;
                }

                switch (message.MessageType)
                {
                    case MessageType.TestMessage:
                        EmitTestMessage(message.DeserializePayload<TestMessagePayload>());
                        break;

                    case MessageType.ExecutionComplete:
                        done = true;
                        break;
                }
            }
        }

#nullable enable
        public override async Task<(string[]? MethodNames, string? TestFramework)> GetContextTestMethodNames(int line, int column, Document contextDocument, CancellationToken cancellationToken)
        {
            Logger.LogDebug($"Loading info for {contextDocument.FilePath} {line}:{column}");
            var syntaxTree = await contextDocument.GetSyntaxTreeAsync(cancellationToken);
            if (syntaxTree is null)
            {
                return default;
            }

            var semanticModel = await contextDocument.GetSemanticModelAsync(cancellationToken);
            if (semanticModel is null)
            {
                return default;
            }

            var sourceText = await contextDocument.GetTextAsync();

            var position = sourceText.Lines.GetPosition(new LinePosition(line, column));
            var node = (await syntaxTree.GetRootAsync()).FindToken(position).Parent;

            string[]? methodNames = null;
            TestFramework? testFramework = null;

            while (node is object)
            {
                if (node is MethodDeclarationSyntax methodDeclaration)
                {
                    // If a user invokes a test before or after a test method, it's likely that
                    // they meant the context to be the entire containing type, not the current
                    // methodsyntax to which the trivia was attached to. If we're in that scenario,
                    // just continue searching up.
                    if (position < methodDeclaration.SpanStart || position >= methodDeclaration.Span.End)
                    {
                        node = node.Parent;
                        continue;
                    }

                    var methodSymbol = semanticModel.GetDeclaredSymbol(methodDeclaration, cancellationToken);
                    if (methodSymbol is null)
                    {
                        Logger.LogWarning($"Could not find method symbol for method syntax {node} {contextDocument.FilePath} {node.SpanStart}:{node.Span.End}. This should not be possible.");
                        Debug.Fail($"Did not find method symbol");
                        continue;
                    }

                    if (isTestMethod(methodSymbol, ref testFramework))
                    {
                        methodNames = new[] { methodSymbol.GetMetadataName() };
                        Logger.LogDebug($"Found test method {methodNames[0]}");
                        break;
                    }

                    Logger.LogDebug($"Method {methodSymbol.Name} is not a test method, searching containing type");
                }
                else if (node is ClassDeclarationSyntax classDeclaration)
                {
                    var typeSymbol = semanticModel.GetDeclaredSymbol(classDeclaration);
                    if (typeSymbol is null)
                    {
                        Logger.LogWarning($"Could not find type symbol for class declaration syntax {node} {contextDocument.FilePath} {node.SpanStart}:{node.Span.End}. This should not be possible.");
                        Debug.Fail($"Did not find class symbol symbol");
                        continue;
                    }

                    var members = typeSymbol.GetMembers();
                    ImmutableArray<string>.Builder? nameBuilder = null;

                    foreach (var member in members)
                    {
                        if (!(member is IMethodSymbol methodSymbol) || !isTestMethod(methodSymbol, ref testFramework))
                        {
                            continue;
                        }

                        // This might be longer than the members we end up needing, but at least we won't do expensive
                        // array reallocation during search.
                        nameBuilder ??= ImmutableArray.CreateBuilder<string>(members.Length);
                        nameBuilder.Add(member.GetMetadataName());
                    }

                    if (nameBuilder is object)
                    {
                        methodNames = nameBuilder.ToArray();
                        Logger.LogDebug($"Found test methods {string.Join(", ", methodNames)}");
                        break;
                    }

                    Logger.LogDebug($"Class {typeSymbol.Name} does not contain test methods, searching containing type (if applicable)");
                }

                node = node.Parent;
            }

            return (methodNames, testFramework?.Name);

            static bool isTestMethod(IMethodSymbol methodSymbol, ref TestFramework? framework)
            {
                if (framework is object)
                {
                    return framework.IsTestMethod(methodSymbol);
                }

                foreach (var f in TestFramework.Frameworks)
                {
                    if (f.IsTestMethod(methodSymbol))
                    {
                        framework = f;
                        return true;
                    }
                }

                return false;
            }
        }
#nullable restore

        public override Task<RunTestResponse> RunTestAsync(string methodName, string runSettings, string testFrameworkName, string targetFrameworkVersion, CancellationToken cancellationToken)
            => RunTestAsync(new string[] { methodName }, runSettings, testFrameworkName, targetFrameworkVersion, cancellationToken);

        public override async Task<RunTestResponse> RunTestAsync(string[] methodNames, string runSettings, string testFrameworkName, string targetFrameworkVersion, CancellationToken cancellationToken)
        {
            VerifyTestFramework(testFrameworkName);

            var testCases = await DiscoverTestsAsync(methodNames, runSettings, targetFrameworkVersion, cancellationToken);

            var passed = true;
            var results = new List<DotNetTestResult>();

            if (testCases.Length > 0)
            {
                // Now, run the tests.
                SendMessage(MessageType.TestRunSelectedTestCasesDefaultHost,
                    new
                    {
                        TestCases = testCases,
                        RunSettings = LoadRunSettingsOrDefault(runSettings, targetFrameworkVersion)
                    });

                var done = false;

                while (!done)
                {
                    var message = ReadMessage();

                    switch (message.MessageType)
                    {
                        case MessageType.TestMessage:
                            EmitTestMessage(message.DeserializePayload<TestMessagePayload>());
                            break;

                        case MessageType.TestRunStatsChange:
                            var testRunChange = message.DeserializePayload<TestRunChangedEventArgs>();
                            var newResults = ConvertResults(testRunChange.NewTestResults);
                            passed = passed && !testRunChange.NewTestResults.Any(o => o.Outcome == TestOutcome.Failed);
                            results.AddRange(newResults);
                            foreach (var result in newResults)
                            {
                                EmitTestComletedEvent(result);
                            }
                            break;

                        case MessageType.ExecutionComplete:
                            var payload = message.DeserializePayload<TestRunCompletePayload>();
                            if (payload.LastRunTests != null && payload.LastRunTests.NewTestResults != null)
                            {
                                var lastRunResults = ConvertResults(payload.LastRunTests.NewTestResults);
                                passed = passed && !payload.LastRunTests.NewTestResults.Any(o => o.Outcome == TestOutcome.Failed);
                                results.AddRange(lastRunResults);
                                foreach (var result in lastRunResults)
                                {
                                    EmitTestComletedEvent(result);
                                }
                            }
                            done = true;
                            break;
                    }
                }
            }

            return new RunTestResponse
            {
                Results = results.ToArray(),
                Pass = passed,
                ContextHadNoTests = false
            };
        }

        private static IEnumerable<DotNetTestResult> ConvertResults(IEnumerable<TestResult> results)
        {
            return results.Select(testResult => new DotNetTestResult
            {
                MethodName = testResult.TestCase.FullyQualifiedName,
                Outcome = testResult.Outcome.ToString().ToLowerInvariant(),
                ErrorMessage = testResult.ErrorMessage,
                ErrorStackTrace = testResult.ErrorStackTrace,
                StandardOutput = testResult.Messages
                    .Where(message => message.Category == TestResultMessage.StandardOutCategory)
                    .Select(message => message.Text).ToArray(),
                StandardError = testResult.Messages.Where(message => message.Category == TestResultMessage.StandardErrorCategory)
                    .Select(message => message.Text).ToArray()
            });
        }

        private async Task<TestCase[]> DiscoverTestsAsync(string[] methodNames, string runSettings, string targetFrameworkVersion, CancellationToken cancellationToken)
        {
            SendMessage(MessageType.StartDiscovery,
                new
                {
                    Sources = new[]
                    {
                        Project.OutputFilePath
                    },
                    RunSettings = LoadRunSettingsOrDefault(runSettings, targetFrameworkVersion)
                });

            var testCases = new List<TestCase>();
            var done = false;
            HashSet<string> hashset = null;
            if (methodNames != null)
            {
                hashset = new HashSet<string>(methodNames);
            }

            while (!done)
            {
                var (success, message) = await TryReadMessageAsync(cancellationToken);
                if (!success)
                {
                    return Array.Empty<TestCase>();
                }

                switch (message.MessageType)
                {
                    case MessageType.TestMessage:
                        EmitTestMessage(message.DeserializePayload<TestMessagePayload>());
                        break;

                    case MessageType.TestCasesFound:
                        var foundTestCases = message.DeserializePayload<TestCase[]>();
                        testCases.AddRange(methodNames != null ? foundTestCases.Where(isInRequestedMethods) : foundTestCases);
                        break;

                    case MessageType.DiscoveryComplete:
                        var lastDiscoveredTests = message.DeserializePayload<DiscoveryCompletePayload>().LastDiscoveredTests;
                        if (lastDiscoveredTests != null)
                        {
                            testCases.AddRange(methodNames != null ? lastDiscoveredTests.Where(isInRequestedMethods) : lastDiscoveredTests);
                        }

                        done = true;
                        break;
                }
            }

            return testCases.ToArray();

            // checks whether a discovered test case is matched with the list of the requested method names.
            bool isInRequestedMethods(TestCase testCase)
            {
                var testName = testCase.FullyQualifiedName;

                var testNameEnd = testName.IndexOf('(');
                if (testNameEnd >= 0)
                {
                    testName = testName.Substring(0, testNameEnd);
                }

                testName = testName.Trim();

                // Discovered tests in generic classes come back in the form `Namespace.GenericClass<TParam>.TestName`
                // however requested test names are sent from the IDE in the form of `Namespace.GenericClass`1.TestName`
                // to compensate we format each part of the discovered test name to match what the IDE would send.
                testName = string.Join(".", testName.Split('.').Select(FormatAsMetadata));

                return hashset.Contains(testName, StringComparer.Ordinal);
            }

            static string FormatAsMetadata(string name)
            {
                if (!name.EndsWith(">"))
                {
                    return name;
                }

                var genericParamStart = name.IndexOf('<');
                if (genericParamStart < 0)
                {
                    return name;
                }

                var genericParams = name.Substring(genericParamStart, name.Length - genericParamStart - 1);
                var paramCount = genericParams.Split(',').Length;
                return $"{name.Substring(0, genericParamStart)}`{paramCount}";
            }
        }
    }
}


text:
using System;
using System.Collections.Generic;

using System.Text;

namespace Ctrip.SOA.Comm.Cache.Entity
{
    public partial class WSIPListInfo
    {
        public string IP1
        {
            get;
            set;
        }
    }
}


text:
import logging
import random
from time import sleep

import numpy as np

from pymeasure.experiment import IntegerParameter, FloatParameter, Parameter
from pymeasure.experiment import Procedure
from pymeasure.instruments.keithley import Keithley2600

log = logging.getLogger(__name__)
log.addHandler(logging.NullHandler())

##########
# global #
##########

##########################
# Pre-Defined Procedures #
##########################

# todo: Define Standard Procedures

###########################
# User-Defined Procedures #
###########################
# Todo: Write Sweep Procedure
# Todo: Write Cycle Procedure
# Todo: Write Pulse Procedure (Just factory script)
# Todo: Write Pulse Procedure (write Pulse, read cycle)
# Todo: Write Retention Procedure
# Todo: Write Endurance Procedure

class ProcedureWithInstruments(Procedure):
    """Class that adds a dict of instruments to Procedure. SelectionWindow uses this dict to pass
    user selected, connected devices (names & adresses)"""
    def __init__(self, instruments_dict={}):
        Procedure.__init__(self)
        instrument_adress = ''

class IVCycles(ProcedureWithInstruments):

    #define required instruments
    required_instruments = ['Keithley Instruments Inc., Model 2635B']

    # define measurement paramters here
    averages = IntegerParameter('Averages', default=50)
    measurement_delay = FloatParameter('Measurement Delay', default=0.5)
    max_voltage = FloatParameter('Maximum Voltage', units='V', default=0.5)
    min_voltage = IntegerParameter('Minimum Voltage', units='V', default=-1.0)
    compliance = FloatParameter('Compliance', units='A', default=0.1)
    cycles = IntegerParameter('No. of Cycles', default=1)
    voltage_step = FloatParameter('Voltage Step', units='V', default=0.1)

    # Add Comments as parameters to show up in measurement file
    operator = Parameter('Operator', default='JD')
    location = Parameter('Location', default='Mun')
    setup = Parameter('Setup', default='Probe Station')

    # Calculate the number of data points from range and step
    data_points = IntegerParameter('Data points',
                                   default=np.ceil((max_voltage.value - min_voltage.value) / voltage_step.value))

    # define DATA_COLUMNS that are written to the file
    DATA_COLUMNS = ['Voltage (V)', 'Current (A)']

    def startup(self):
        print('startup')
        for adress,name in self.instruments_dict.items():
            if 'Keithley Instruments Inc., Model 2635B' in name:
                self.instrument_adress = adress
        log.info("Connecting and configuring the instrument")
        log.info("Instrument Adress: " + self.instrument_adress)
        log.info("Instrument Dict: " + str(self.instruments_dict))
        self.sourcemeter = Keithley2600(self.instrument_adress)
        self.sourcemeter.triad()
        self.sourcemeter.set_screentext('$R PulseIVCycle $N$B Ready to measure')

    def execute(self):
        print('execute')
        # reset instrument and its dedicated buffer
        self.sourcemeter.reset()
        self.sourcemeter.clear_buffer()
        self.sourcemeter.setup_buffer(precision=6)
        log.info(f'start: {self.min_voltage}. stop {self.max_voltage}, stime {self.measurement_delay}. points = {self.data_points}')

        self.sourcemeter.set_output(state='ON')
        self.sourcemeter.auto_sweep(start=0, stop=self.max_voltage, stime=self.measurement_delay, points=np.ceil(self.data_points / 2 +1),
                                   source='V')
        self.sourcemeter.wait_for_srq()
        results = self.sourcemeter.get_buffer_data()
        for i in range(0, len(results['sourced']) - 1):
            self.emit('results',
                      {
                          'Voltage (V)': results['sourced'][i],
                          'Current (A)': results['measured'][i],
                      })

    def shutdown(self):
        self.sourcemeter.shutdown()
        log.info("Finished measuring")
        print('shutdown')

class PulseIVCycle(ProcedureWithInstruments):
    """
    Uses a Keithley 26XX device to perform the following measurement:
    1. Pulse at voltage `pulse_voltage` for `pulse_duration` in ms
    2. Perform `cycles` sweeps from `min_voltage` to `max_voltage` starting with a sweep from 0 to max and ending with a sweep from max to 0
    """

    # define measurement paramters here
    max_voltage = FloatParameter('Maximum Voltage', units='V', default=1)
    min_voltage = FloatParameter('Minimum Voltage', units='V',
                                   default=-1)
    compliance = FloatParameter('Compliance', units='A', default=0.1)
    cycles = IntegerParameter('No. of Cycles', default=1)
    voltage_step = FloatParameter('Voltage Step', units='V', default=0.1)
    stime = FloatParameter('Settling Time', units='s', default=0.5)

    # Add Comments as parameters to show up in measurement file
    operator = Parameter('Operator', default='JD')
    location = Parameter('Location', default='Mun')
    setup = Parameter('Setup', default='Probe Station')

    # define DATA_COLUMNS that are written to the file
    DATA_COLUMNS = ['Voltage (V)', 'Current (A)', 'Current Std (A)', 'Cycle']

    def startup(self):
        # System startup: Build instances of all necessary device objects here
        log.info("Connecting and configuring the instrument")
        log.info("Instrument Adress" + instrument_adress)
        self.sourcemeter = Keithley2600(instrument_adress)
        self.sourcemeter.reset()
        self.sourcemeter.clear_buffer()
        self.sourcemeter.triad()
        self.sourcemeter.set_screentext('$R PulseIVCycle $N$B Ready to measure')

    def execute(self):
        # Make Pulse

        # Make Sweep
        log.info("Starting sweep")
        steps = (self.max_voltage - self.min_voltage) / self.voltage_step
        self.sourcemeter.autosweep(0, self.max_voltage, self.stime, steps, 'lin', 'V')
        for i in cycles:
            if self.should_stop():
                log.info("User aborted the procedure")
                break
            log.info(f"Performing sweep number {i}")
            self.soucemeter.autosweep(self.max_voltage, self.min_voltage, self.stime, steps, 'lin', 'V')
            # TODO:Wait for finished measurement?!
            self.soucemeter.autosweep(self.min_voltage, self.max_voltage, self.stime, steps, 'lin', 'V')
            # TODO:Wait for finished measurement?!
        else:
            self.sourcemeter.autosweep(self.max_voltage, 0, self.stime, steps, 'lin', 'V')
            # TODO:Wait for finished measurement?!

        data_array = self.sourcemeter.get_buffer_data()

        # print to console to check array
        print(data_array)
        # emit data
        for i in range(0, len(data_array) - 1):
            self.emit('results',
                      {
                          'Voltage (V)': data_array[0][i],
                          'Current (A)': data_array[1][i],
                          'Voltage Std (V)': data_array[2][i]
                      })

    def shutdown(self):
        self.sourcemeter.shutdown()

class Retention(ProcedureWithInstruments):
    # retention here
    # paramet

    averages = IntegerParameter('Averages', default=50)
    set_voltage = FloatParameter('SET Voltage', units='V', default=1)
    read_voltage = FloatParameter('READ Voltage', units='V', default=1)
    set_duration = FloatParameter('Duration SET Pulse', units='ms', default=1)
    read_duration = FloatParameter('Duration READ Pulse', units='ms', default=1)
    read_delay = FloatParameter('WRITE-READ Delay', units='s', default=1)
    cycles = IntegerParameter('#Cycles', default=1)
    DATA_COLUMNS = ['Voltage (V)', 'Current (A)', 'Current Std (A)', 'Cycle']

    def execute(self):
        log.info("Retention Procedure Running")

    def shutdown(self):
        self.sourcemeter.shutdown()
        log.info("Finished measuring")

class RandomProcedure(ProcedureWithInstruments):
    iterations = IntegerParameter('Loop Iterations')
    delay = FloatParameter('Delay Time', units='s', default=0.2)
    seed = Parameter('Random Seed', default='12345')
    negNumber = IntegerParameter('Number', default=-1)

    DATA_COLUMNS = ['Iteration', 'Random Number']

    def startup(self):
        log.info("Setting the seed of the random number generator")
        log.info("Connected Instruments:"+str(self.instruments_dict))
        random.seed(self.seed)

    def execute(self):
        log.info("Starting the loop of %d iterations" % self.iterations)
        for i in range(self.iterations):
            data = {
                'Iteration': i,
                'Random Number': random.random()
            }
            self.emit('results', data)
            log.debug("Emitting results: %s" % data)
            sleep(self.delay)
            if self.should_stop():
                log.warning("Caught the stop flag in the procedure")
                break


text:
import { PopupView } from "../../base/layer/layer.popup";

export declare class MultiPopupView extends PopupView {
    static xtype: string;

    static EVENT_CHANGE: string;

    static EVENT_CLICK_TOOLBAR_BUTTON: string;
}


text:
category: event
title: Scala Italy
logo: /resources/img/scala-italy.jpeg
location: Venice, Italy
description: The only Italian conference on Scala.
start: 14 May 2016
end: 14 May 2016
link-out: http://2016.scala-italy.it/
---


text:
```text
*** THE DEPLOY IS UNDER CONSTRUCTION - CHECK BACK SOON ***
```

`slack` _._

Documentation and reference,

* View a list of all my-cheat-sheets on my
  [github webpage](https://jeffdecola.github.io/my-cheat-sheets/)

## OVERVIEW

tbd


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Oh My Svelte</title>
  <meta name="description" content="Building scalable web apps from Web Fundamentals to Firebase Platform and then to Google Cloud.">
  <link rel="icon" type="image/x-icon" href="/assets/images/favicon.ico">

  This is your fallback content in case JavaScript fails to load.


text:
<ng-include src="'views/administration/menu.html'"></ng-include>

{{'GROUPS' | translate}}

            <button type="button" class="btn btn-default" data-toggle="modal" data-target="#modal" ng-click="new()">

            </button>

          <form>

                <input type="text" class="form-control" placeholder="{{'GROUP_FILTER' | translate}}" ng-model="filter">

          </form>

            #
            {{'NAME' | translate}}
            {{'DESCRIPTION' | translate}}
            {{'ACTIVE' | translate}}

              {{$index + 1}}

              {{group.name}}

              {{group.description}}

              {{group.isActive ? 'YES' : 'NO' | translate}}

              <button class="btn btn-default" type="button" data-toggle="modal" data-target="#modal" ng-click="set(group)">

              </button>
              <button class="btn btn-default" type="button" ng-click="remove(group)">

              </button>

        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          ×
        </button>

{{'GROUP' | translate}}

        <form>

            {{'NAME' | translate}}
            <input type="text" class="form-control" id="inputName" placeholder="Name" ng-model="group.name">

            {{'DESCRIPTION' | translate}}
            <textarea class="form-control" rows="6" id="inputDescription" placeholder="Description" ng-model="group.description"></textarea>

              <input type="checkbox" id="inputIsActive" ng-model="group.isActive"> {{'ACTIVE' | translate}}

        </form>

        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="save()" ng-disabled="!group.name || !group.description">
           {{'BTN_SAVE' | translate}}
        </button>


text:
<?php

namespace Sonata\PageBundle\Tests\Page;

use Sonata\PageBundle\CmsManager\CmsSnapshotManager;
use Sonata\PageBundle\Model\Block;
use Sonata\PageBundle\Tests\Model\Page;
use Sonata\PageBundle\Model\BlockInteractorInterface;

class SnapshotBlock extends Block
{
    public function setId($id)
    {}

    public function getId()
    {}
}

/**
 * Test CmsSnapshotManager
 */
class CmsSnapshotManagerTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \Sonata\PageBundle\CmsManager\CmsSnapshotManager
     */
    protected $manager;

    /**
     * Setup manager object to test
     */
    public function setUp()
    {
        $this->blockInteractor = $this->getMockBlockInteractor();
        $this->snapshotManager  = $this->getMock('Sonata\PageBundle\Model\SnapshotManagerInterface');
        $this->transformer  = $this->getMock('Sonata\PageBundle\Model\TransformerInterface');
        $this->manager = new CmsSnapshotManager($this->snapshotManager, $this->transformer);
    }

    /**
     * Test finding an existing container in a page
     */
    public function testFindExistingContainer()
    {
        $block = new SnapshotBlock();
        $block->setSettings(array('code' => 'findme'));

        $page = new Page();
        $page->addBlocks($block);

        $container = $this->manager->findContainer('findme', $page);

        $this->assertEquals(spl_object_hash($block), spl_object_hash($container), 'should retrieve the block of the page');
    }

    /**
     * Test finding an non-existing container in a page does NOT create a new block
     */
    public function testFindNonExistingContainerCreatesNoNewBlock()
    {
        $page = new Page();

        $container = $this->manager->findContainer('newcontainer', $page);

        $this->assertNull($container, 'should not create a new container block');
    }

    /**
     * Returns a mock block interactor
     *
     * @return \Sonata\PageBundle\Model\BlockInteractorInterface
     */
    protected function getMockBlockInteractor()
    {
        $callback = function($options) {
            $block = new SnapshotBlock;
            $block->setSettings($options);

            return $block;
        };

        $mock = $this->getMock('Sonata\PageBundle\Model\BlockInteractorInterface');
        $mock->expects($this->any())->method('createNewContainer')->will($this->returnCallback($callback));

        return $mock;
    }
}


text:
FOUNDATION_EXPORT double OMSDKVersionNumber;

//! Project version string for OMSDK.
FOUNDATION_EXPORT const unsigned char OMSDKVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <OMSDK/PublicHeader.h>

#import <OMSDK/OMIDImports.h>