/**
 * @fileoverview Rule to flag non-quoted property names in object literals.
 * @author Mathias Bynens <http://mathiasbynens.be/>
 * @copyright 2014 Brandon Mills. All rights reserved.
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

var espree = require("espree");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

module.exports = function(context) {

    var MODE = context.options[0];

    /**
     * Ensures that a property's key is quoted only when necessary
     * @param   {ASTNode} node Property AST node
     * @returns {void}
     */
    function asNeeded(node) {
        var key = node.key,
            tokens;

        if (key.type === "Literal" && typeof key.value === "string") {
            try {
                tokens = espree.tokenize(key.value);
            } catch (e) {
                return;
            }

            if (tokens.length === 1 &&
                (["Identifier", "Null", "Boolean"].indexOf(tokens[0].type) >= 0 ||
                (tokens[0].type === "Numeric" && "" + +tokens[0].value === tokens[0].value))
            ) {
                context.report(node, "Unnecessarily quoted property `{{value}}` found.", key);
            }
        }
    }

    /**
     * Ensures that a property's key is quoted
     * @param   {ASTNode} node Property AST node
     * @returns {void}
     */
    function always(node) {
        var key = node.key;

        if (!node.method && !(key.type === "Literal" && typeof key.value === "string")) {
            context.report(node, "Unquoted property `{{key}}` found.", {
                key: key.name || key.value
            });
        }
    }

    return {
        "Property": MODE === "as-needed" ? asNeeded : always
    };

};

{'repo_name': 'nodejs/node-convergence-archive', 'stars': '1897', 'repo_language': 'JavaScript', 'file_name': '2015-04-08.md', 'mime_type': 'text/plain', 'hash': 7499632144940444438, 'source_dataset': 'data'}


/*
 * Copyright 2019 Amazon.com, Inc. or its affiliates.
 * 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 software.amazon.kinesis.retrieval.fanout;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import java.util.concurrent.CompletableFuture;

import org.apache.commons.lang3.StringUtils;
import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import software.amazon.awssdk.services.kinesis.KinesisAsyncClient;
import software.amazon.awssdk.services.kinesis.model.Consumer;
import software.amazon.awssdk.services.kinesis.model.ConsumerDescription;
import software.amazon.awssdk.services.kinesis.model.ConsumerStatus;
import software.amazon.awssdk.services.kinesis.model.DescribeStreamConsumerRequest;
import software.amazon.awssdk.services.kinesis.model.DescribeStreamConsumerResponse;
import software.amazon.awssdk.services.kinesis.model.DescribeStreamSummaryRequest;
import software.amazon.awssdk.services.kinesis.model.DescribeStreamSummaryResponse;
import software.amazon.awssdk.services.kinesis.model.LimitExceededException;
import software.amazon.awssdk.services.kinesis.model.RegisterStreamConsumerRequest;
import software.amazon.awssdk.services.kinesis.model.RegisterStreamConsumerResponse;
import software.amazon.awssdk.services.kinesis.model.ResourceNotFoundException;
import software.amazon.awssdk.services.kinesis.model.StreamDescriptionSummary;
import software.amazon.awssdk.services.kinesis.model.StreamStatus;
import software.amazon.kinesis.leases.exceptions.DependencyException;

/**
 *
 */
@RunWith(MockitoJUnitRunner.class)
public class FanOutConsumerRegistrationTest {
    private static final String STREAM_NAME = "TestStream";
    private static final String CONSUMER_NAME = "TestConsumer";
    private static final String STREAM_ARN = "TestStreamArn";
    private static final String CONSUMER_ARN = "TestConsumerArn";
    private static final int MAX_DSS_RETRIES = 5;
    private static final int MAX_DSC_RETRIES = 5;
    private static final int RSC_RETRIES = 5;
    private static final long BACKOFF_MILLIS = 50L;

    @Mock
    private KinesisAsyncClient client;

    private FanOutConsumerRegistration consumerRegistration;

    @Before
    public void setup() {
        consumerRegistration = new FanOutConsumerRegistration(client, STREAM_NAME, CONSUMER_NAME, MAX_DSS_RETRIES,
                MAX_DSC_RETRIES, RSC_RETRIES, BACKOFF_MILLIS);
    }

    @Test
    public void testConsumerAlreadyExists() throws Exception {
        final CompletableFuture<DescribeStreamSummaryResponse> dssFuture = CompletableFuture
                .completedFuture(createDescribeStreamSummaryResponse());
        final CompletableFuture<DescribeStreamConsumerResponse> dscFuture = CompletableFuture
                .completedFuture(createDescribeStreamConsumerResponse(ConsumerStatus.ACTIVE));

        when(client.describeStreamSummary(any(DescribeStreamSummaryRequest.class))).thenReturn(dssFuture);
        when(client.describeStreamConsumer(any(DescribeStreamConsumerRequest.class))).thenReturn(dscFuture);

        final String consumerArn = consumerRegistration.getOrCreateStreamConsumerArn();

        assertThat(consumerArn, equalTo(CONSUMER_ARN));

        verify(client, never()).registerStreamConsumer(any(RegisterStreamConsumerRequest.class));
    }

    @Test
    public void testConsumerAlreadyExistsMultipleCalls() throws Exception {
        final CompletableFuture<DescribeStreamSummaryResponse> dssFuture = CompletableFuture
                .completedFuture(createDescribeStreamSummaryResponse());
        final CompletableFuture<DescribeStreamConsumerResponse> dscFuture = CompletableFuture
                .completedFuture(createDescribeStreamConsumerResponse(ConsumerStatus.ACTIVE));

        when(client.describeStreamSummary(any(DescribeStreamSummaryRequest.class))).thenReturn(dssFuture);
        when(client.describeStreamConsumer(any(DescribeStreamConsumerRequest.class))).thenReturn(dscFuture);

        final String firstCall = consumerRegistration.getOrCreateStreamConsumerArn();

        final String secondCall = consumerRegistration.getOrCreateStreamConsumerArn();

        assertThat(firstCall, equalTo(CONSUMER_ARN));
        assertThat(secondCall, equalTo(CONSUMER_ARN));

        verify(client, never()).registerStreamConsumer(any(RegisterStreamConsumerRequest.class));
    }

    @Test(expected = LimitExceededException.class)
    public void testDescribeStreamConsumerThrottled() throws Exception {
        final CompletableFuture<DescribeStreamSummaryResponse> dssFuture = CompletableFuture
                .completedFuture(createDescribeStreamSummaryResponse());
        final CompletableFuture<DescribeStreamConsumerResponse> dscFuture = CompletableFuture.supplyAsync(() -> {
            throw LimitExceededException.builder().build();
        });

        when(client.describeStreamSummary(any(DescribeStreamSummaryRequest.class))).thenReturn(dssFuture);
        when(client.describeStreamConsumer(any(DescribeStreamConsumerRequest.class))).thenReturn(dscFuture);

        try {
            consumerRegistration.getOrCreateStreamConsumerArn();
        } finally {
            verify(client, times(MAX_DSC_RETRIES))
                    .describeStreamConsumer(any(DescribeStreamConsumerRequest.class));
        }
    }

    @Test(expected = DependencyException.class)
    public void testRegisterStreamConsumerThrottled() throws Exception {
        final CompletableFuture<DescribeStreamSummaryResponse> dssFuture = CompletableFuture
                .completedFuture(createDescribeStreamSummaryResponse());
        final CompletableFuture<DescribeStreamConsumerResponse> dscFuture = CompletableFuture.supplyAsync(() -> {
            throw ResourceNotFoundException.builder().build();
        });
        final CompletableFuture<RegisterStreamConsumerResponse> rscFuture = CompletableFuture.supplyAsync(() -> {
            throw LimitExceededException.builder().build();
        });

        when(client.describeStreamSummary(any(DescribeStreamSummaryRequest.class))).thenReturn(dssFuture);
        when(client.describeStreamConsumer(any(DescribeStreamConsumerRequest.class))).thenReturn(dscFuture);
        when(client.registerStreamConsumer(any(RegisterStreamConsumerRequest.class))).thenReturn(rscFuture);

        try {
            consumerRegistration.getOrCreateStreamConsumerArn();
        } finally {
            verify(client, times(RSC_RETRIES))
                    .registerStreamConsumer(any(RegisterStreamConsumerRequest.class));
        }
    }

    @Test
    public void testNewRegisterStreamConsumer() throws Exception {
        final CompletableFuture<DescribeStreamSummaryResponse> dssFuture = CompletableFuture
                .completedFuture(createDescribeStreamSummaryResponse());
        final CompletableFuture<DescribeStreamConsumerResponse> failureResponse = CompletableFuture.supplyAsync(() -> {
            throw ResourceNotFoundException.builder().build();
        });
        final CompletableFuture<DescribeStreamConsumerResponse> intermidateResponse = CompletableFuture
                .completedFuture(createDescribeStreamConsumerResponse(ConsumerStatus.CREATING));
        final CompletableFuture<DescribeStreamConsumerResponse> successResponse = CompletableFuture
                .completedFuture(createDescribeStreamConsumerResponse(ConsumerStatus.ACTIVE));
        final CompletableFuture<RegisterStreamConsumerResponse> rscFuture = CompletableFuture
                .completedFuture(createRegisterStreamConsumerResponse());

        when(client.describeStreamSummary(any(DescribeStreamSummaryRequest.class))).thenReturn(dssFuture);
        when(client.describeStreamConsumer(any(DescribeStreamConsumerRequest.class))).thenReturn(failureResponse)
                .thenReturn(intermidateResponse).thenReturn(successResponse);
        when(client.registerStreamConsumer(any(RegisterStreamConsumerRequest.class))).thenReturn(rscFuture);

        final long startTime = System.currentTimeMillis();
        final String consumerArn = consumerRegistration.getOrCreateStreamConsumerArn();
        final long endTime = System.currentTimeMillis();

        assertThat(consumerArn, equalTo(CONSUMER_ARN));
        assertThat(endTime - startTime, greaterThanOrEqualTo(2 * BACKOFF_MILLIS));

        verify(client).registerStreamConsumer(any(RegisterStreamConsumerRequest.class));
    }

    @Test(expected = IllegalStateException.class)
    public void testStreamConsumerStuckInCreating() throws Exception {
        final CompletableFuture<DescribeStreamSummaryResponse> dssFuture = CompletableFuture.completedFuture(
                createDescribeStreamSummaryResponse());
        final CompletableFuture<DescribeStreamConsumerResponse> dscFuture = CompletableFuture
                .completedFuture(createDescribeStreamConsumerResponse(ConsumerStatus.CREATING));

        when(client.describeStreamSummary(any(DescribeStreamSummaryRequest.class))).thenReturn(dssFuture);
        when(client.describeStreamConsumer(any(DescribeStreamConsumerRequest.class))).thenReturn(dscFuture);

        try {
            consumerRegistration.getOrCreateStreamConsumerArn();
        } finally {
            // Verify that the call to DSC was made for the max retry attempts and one for the initial response object.
            verify(client, times(MAX_DSC_RETRIES + 1))
                    .describeStreamConsumer(any(DescribeStreamConsumerRequest.class));
            verify(client, never()).registerStreamConsumer(any(RegisterStreamConsumerRequest.class));
        }

    }

    private DescribeStreamSummaryRequest createDescribeStreamSummaryRequest() {
        return DescribeStreamSummaryRequest.builder().streamName(STREAM_NAME).build();
    }

    private DescribeStreamSummaryResponse createDescribeStreamSummaryResponse() {
        return DescribeStreamSummaryResponse.builder().streamDescriptionSummary(StreamDescriptionSummary.builder()
                .streamName(STREAM_NAME).streamARN(STREAM_ARN).streamStatus(StreamStatus.ACTIVE).build()).build();
    }

    private DescribeStreamConsumerRequest createDescribeStreamConsumerRequest(final String consumerArn) {
        if (StringUtils.isEmpty(consumerArn)) {
            return DescribeStreamConsumerRequest.builder().streamARN(STREAM_ARN).consumerName(CONSUMER_NAME).build();
        }
        return DescribeStreamConsumerRequest.builder().consumerARN(consumerArn).build();
    }

    private DescribeStreamConsumerResponse createDescribeStreamConsumerResponse(final ConsumerStatus status) {
        return DescribeStreamConsumerResponse.builder().consumerDescription(ConsumerDescription.builder()
                .consumerStatus(status).consumerARN(CONSUMER_ARN).consumerName(CONSUMER_NAME).build()).build();
    }

    private RegisterStreamConsumerRequest createRegisterStreamConsumerRequest() {
        return RegisterStreamConsumerRequest.builder().streamARN(STREAM_ARN).consumerName(CONSUMER_NAME).build();
    }

    private RegisterStreamConsumerResponse createRegisterStreamConsumerResponse() {
        return RegisterStreamConsumerResponse.builder().consumer(Consumer.builder().consumerName(CONSUMER_NAME)
                .consumerARN(CONSUMER_ARN).consumerStatus(ConsumerStatus.CREATING).build()).build();
    }

}

{'repo_name': 'awslabs/amazon-kinesis-client', 'stars': '504', 'repo_language': 'Java', 'file_name': 'MANIFEST.MF', 'mime_type': 'text/plain', 'hash': -3530547556249968189, 'source_dataset': 'data'}


/* $Id: neatoprocs.h,v 1.4 2005/11/15 22:55:48 erg Exp $ $Revision: 1.4 $ */
/* vim:set shiftwidth=4 ts=8: */

/**********************************************************
*      This software is part of the graphviz package      *
*                http://www.graphviz.org/                 *
*                                                         *
*            Copyright (c) 1994-2004 AT&T Corp.           *
*                and is licensed under the                *
*            Common Public License, Version 1.0           *
*                      by AT&T Corp.                      *
*                                                         *
*        Information and Software Systems Research        *
*              AT&T Research, Florham Park NJ             *
**********************************************************/

#ifndef NEATOPROCS_H
#define NEATOPROCS_H

#ifdef __cplusplus
extern "C" {
#endif

    extern int allow_edits(int);
    extern void avoid_cycling(graph_t *, Agnode_t *, double *);
    extern int checkStart(graph_t * G, int nG, int);
    extern Agnode_t *choose_node(graph_t *, int);
    extern int circuit_model(graph_t *, int);
    extern void D2E(Agraph_t *, int, int, double *);
    extern void diffeq_model(graph_t *, int);
    extern double distvec(double *, double *, double *);
    extern void do_graph_label(Agraph_t *);
    extern void final_energy(graph_t *, int);
    extern double doubleattr(void *, int, double);
    extern double fpow32(double);
    extern Ppolyline_t getPath(edge_t *, vconfig_t *, int, Ppoly_t **,
			       int);
    extern void heapdown(Agnode_t *);
    extern void heapup(Agnode_t *);
    extern void initial_positions(graph_t *, int);
    extern int init_port(Agnode_t *, Agedge_t *, char *, bool);
    extern void jitter3d(Agnode_t *, int);
    extern void jitter_d(Agnode_t *, int, int);
    extern Ppoly_t *makeObstacle(node_t * n, double SEP);
    extern void makeSelfArcs(path * P, edge_t * e, int stepx);
    extern void makeSpline(edge_t *, Ppoly_t **, int, bool);
    extern void make_spring(graph_t *, Agnode_t *, Agnode_t *, double);
    extern void move_node(graph_t *, int, Agnode_t *);
    extern int init_nop(graph_t * g, int);
    extern void neato_nodesize(node_t * n, bool flip);
    extern void neato_cleanup(graph_t * g);
    extern void neato_cleanup_edge(edge_t * e);
    extern void neato_cleanup_graph(graph_t * g);
    extern void neato_cleanup_node(node_t * n);
    extern node_t *neato_dequeue(void);
    extern void neato_enqueue(node_t *);
    extern void neato_free_splines(edge_t * e);
    extern void neato_init_node_edge(Agraph_t *);
    extern void neato_init_edge(Agedge_t *);
    extern void neato_init_node(Agnode_t *);
    extern void neato_layout(Agraph_t * g);
    extern void neatoLayout(Agraph_t *mg, Agraph_t * g, int layoutMode, int layoutModel);
    extern void neato_init_graph(graph_t * g);
    extern void neato_init_graphn(graph_t * g, int);
    extern int Plegal_arrangement(Ppoly_t ** polys, int n_polys);
    extern void randompos(Agnode_t *, int);
    extern void s1(graph_t *, node_t *);
    extern int scan_graph(graph_t *);
    extern int scan_graph_mode(graph_t * G, int mode);
    extern void free_scan_graph(graph_t *);
    extern void shortest_path(graph_t *, int);
    extern void solve(double *, double *, double *, int);
    extern void solve_model(graph_t *, int);
    extern int solveCircuit(int nG, double **Gm, double **Gm_inv);
    extern void spline_edges(Agraph_t *);
    extern void spline_edges0(Agraph_t *);
    extern int spline_edges1(graph_t * g, int);
    extern int splineEdges(graph_t *,
			   int (*edgefn) (graph_t *, double, int), int);
    extern void neato_set_aspect(graph_t * g);
    extern void toggle(int);
    extern int user_pos(Agsym_t *, Agsym_t *, Agnode_t *, int);
    extern double **new_array(int i, int j, double val);
    extern void free_array(double **rv);
    extern int matinv(double **A, double **Ainv, int n);

#ifdef __cplusplus
}
#endif
#endif

{'repo_name': 'mjwybrow/adaptagrams', 'stars': '152', 'repo_language': 'C++', 'file_name': 'description.doc', 'mime_type': 'text/html', 'hash': -362494657655591885, 'source_dataset': 'data'}


<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_checkin
 *
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Checkin Controller
 *
 * @since  1.6
 */
class CheckinController extends JControllerLegacy
{
	/**
	 * Method to display a view.
	 *
	 * @param   boolean  $cachable   If true, the view output will be cached
	 * @param   array    $urlparams  An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
	 *
	 * @return  JControllerLegacy  A JControllerLegacy object to support chaining.
	 */
	public function display($cachable = false, $urlparams = false)
	{
		// Load the submenu.
		$this->addSubmenu($this->input->getWord('option', 'com_checkin'));

		parent::display();

		return $this;
	}

	/**
	 * Check in a list of items.
	 *
	 * @return  void
	 */
	public function checkin()
	{
		// Check for request forgeries
		JSession::checkToken() or jexit(JText::_('JInvalid_Token'));

		$ids = $this->input->get('cid', array(), 'array');

		if (empty($ids))
		{
			JError::raiseWarning(500, JText::_('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST'));
		}
		else
		{
			// Get the model.
			$model = $this->getModel();

			// Checked in the items.
			$this->setMessage(JText::plural('COM_CHECKIN_N_ITEMS_CHECKED_IN', $model->checkin($ids)));
		}

		$this->setRedirect('index.php?option=com_checkin');
	}

	/**
	 * Configure the Linkbar.
	 *
	 * @param   string  $vName  The name of the active view.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function addSubmenu($vName)
	{
		JHtmlSidebar::addEntry(
			JText::_('JGLOBAL_SUBMENU_CHECKIN'),
			'index.php?option=com_checkin',
			$vName == 'com_checkin'
		);

		JHtmlSidebar::addEntry(
			JText::_('JGLOBAL_SUBMENU_CLEAR_CACHE'),
			'index.php?option=com_cache',
			$vName == 'cache'
		);
		JHtmlSidebar::addEntry(
			JText::_('JGLOBAL_SUBMENU_PURGE_EXPIRED_CACHE'),
			'index.php?option=com_cache&view=purge',
			$vName == 'purge'
		);
	}
}

{'repo_name': 'SniperOJ/Attack-Defense-Challenges', 'stars': '125', 'repo_language': 'PHP', 'file_name': 'Mockery.php', 'mime_type': 'text/x-php', 'hash': -2030478421278811417, 'source_dataset': 'data'}


<?php

if( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

if( ! class_exists('acf_location_widget') ) :

class acf_location_widget extends acf_location {

	/*
	*  __construct
	*
	*  This function will setup the class functionality
	*
	*  @type	function
	*  @date	5/03/2014
	*  @since	5.0.0
	*
	*  @param	n/a
	*  @return	n/a
	*/

	function initialize() {

		// vars
		$this->name = 'widget';
		$this->label = __("Widget",'acf');
		$this->category = 'forms';

	}

	/*
	*  rule_match
	*
	*  This function is used to match this location $rule to the current $screen
	*
	*  @type	function
	*  @date	3/01/13
	*  @since	3.5.7
	*
	*  @param	$match (boolean)
	*  @param	$rule (array)
	*  @return	$options (array)
	*/

	function rule_match( $result, $rule, $screen ) {

		// vars
		$widget = acf_maybe_get( $screen, 'widget' );

		// bail early if not widget
		if( !$widget ) return false;

        // return
        return $this->compare( $widget, $rule );

	}

	/*
	*  rule_operators
	*
	*  This function returns the available values for this rule type
	*
	*  @type	function
	*  @date	30/5/17
	*  @since	5.6.0
	*
	*  @param	n/a
	*  @return	(array)
	*/

	function rule_values( $choices, $rule ) {

		// global
		global $wp_widget_factory;

		// vars
		$choices = array( 'all' => __('All', 'acf') );

		// loop
		if( !empty( $wp_widget_factory->widgets ) ) {

			foreach( $wp_widget_factory->widgets as $widget ) {

				$choices[ $widget->id_base ] = $widget->name;

			}

		}

		// return
		return $choices;

	}

}

// initialize
acf_register_location_rule( 'acf_location_widget' );

endif; // class_exists check

?>

{'repo_name': 'bovas85/nuxt-headless', 'stars': '212', 'repo_language': 'PHP', 'file_name': 'hotjar.client.js', 'mime_type': 'text/plain', 'hash': 4015975402277820400, 'source_dataset': 'data'}


Ddoc

$(D_S dmd - DMD Compiler,

$(P Documentation for DMD is split up by operating system. Choose one from
the menu on the left.)

)

Macros:
    TITLE=DMD Compiler
    SUBNAV=$(SUBNAV_CLI_REFERENCE)

{'repo_name': 'dlang/dlang.org', 'stars': '254', 'repo_language': 'D', 'file_name': 'README.md', 'mime_type': 'text/x-java', 'hash': 6762401845189982867, 'source_dataset': 'data'}


class Rectangle(object,IDisposable):
 """
 Stores a set of four integers that represent the left,top,right and bottom of a rectangle.

 Rectangle(left: int,top: int,right: int,bottom: int)

 Rectangle()

 Rectangle(other: Rectangle)
 """
 def Dispose(self):
  """ Dispose(self: Rectangle) """
  pass
 def IsNormalized(self):
  """
  IsNormalized(self: Rectangle) -> bool

   Returns true if the rectangle coordinates are normalized to the screen

    coordinate space; that is,left is less than right and top is less than bottom.
  """
  pass
 def ReleaseUnmanagedResources(self,*args):
  """ ReleaseUnmanagedResources(self: Rectangle,disposing: bool) """
  pass
 def __enter__(self,*args):
  """ __enter__(self: IDisposable) -> object """
  pass
 def __exit__(self,*args):
  """ __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
  pass
 def __init__(self,*args):
  """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
  pass
 @staticmethod
 def __new__(self,*__args):
  """
  __new__(cls: type,left: int,top: int,right: int,bottom: int)

  __new__(cls: type)

  __new__(cls: type,other: Rectangle)
  """
  pass
 def __repr__(self,*args):
  """ __repr__(self: object) -> str """
  pass
 Bottom=property(lambda self: object(),lambda self,v: None,lambda self: None)
 """The y-coordinate of the bottom-right corner of the rectangle.

Get: Bottom(self: Rectangle) -> int

Set: Bottom(self: Rectangle)=value

"""

 IsValidObject=property(lambda self: object(),lambda self,v: None,lambda self: None)
 """Specifies whether the .NET object represents a valid Revit entity.

Get: IsValidObject(self: Rectangle) -> bool

"""

 Left=property(lambda self: object(),lambda self,v: None,lambda self: None)
 """The x-coordinate of the top-left corner of the rectangle.

Get: Left(self: Rectangle) -> int

Set: Left(self: Rectangle)=value

"""

 Right=property(lambda self: object(),lambda self,v: None,lambda self: None)
 """The x-coordinate of the bottom-right corner of the rectangle.

Get: Right(self: Rectangle) -> int

Set: Right(self: Rectangle)=value

"""

 Top=property(lambda self: object(),lambda self,v: None,lambda self: None)
 """The y-coordinate of the top-left corner of the rectangle.

Get: Top(self: Rectangle) -> int

Set: Top(self: Rectangle)=value

"""

{'repo_name': 'gtalarico/ironpython-stubs', 'stars': '117', 'repo_language': 'Python', 'file_name': '__init__.py', 'mime_type': 'text/x-python', 'hash': 1416358161999042320, 'source_dataset': 'data'}


# -----------------------------------------------------------------------------
# benchmark - Application Routes Configuration
#
# Refer documentation to explore and configure routes.
# Doc: https://docs.aahframework.org/routing.html
# -----------------------------------------------------------------------------

domains {

  localhost {
    name = "benchmark routes"
    host = "localhost"

    routes {

      json {
        path = "/json"
        controller = "AppController"
        action = "JSON"
      }

      plaintext {
        path = "/plaintext"
        controller = "AppController"
        action = "Plaintext"
      }

      # For MySQL datasource
      db {
        path = "/db"
        controller = "AppController"
        action = "World"

        routes {
          dbs {
            path = "/queries"
            action = "Worlds"
          }
          fortunes {
            path = "/fortunes"
            action = "Fortunes"
          }
          updates {
            path = "/updates"
            action = "UpdateWorlds"
          }
        }
      }

      # For PostgreSQL datasource
      pg_db {
        path = "/pg-db"
        controller = "AppController"
        action = "PGWorld"

        routes {
          pg_dbs {
            path = "/queries"
            action = "PGWorlds"
          }
          pg_fortunes {
            path = "/fortunes"
            action = "PGFortunes"
          }
          pg_updates {
            path = "/updates"
            action = "PGUpdateWorlds"
          }
        }
      }

    } # end - routes

  } # end - localhost

} # end - domains

{'repo_name': 'TechEmpower/FrameworkBenchmarks', 'stars': '5262', 'repo_language': 'Java', 'file_name': 'app.vala', 'mime_type': 'text/plain', 'hash': -7263784437872074186, 'source_dataset': 'data'}


using System;
using Glass.Mapper.Sc.DataMappers;
using NUnit.Framework;
using Sitecore.Data;

namespace Glass.Mapper.Sc.FakeDb.DataMappers
{
    [TestFixture]
    public class SitecoreFieldGuidMapperFixture : AbstractMapperFixture
    {
        #region Method - GetField

        [Test]
        public void GetField_ContainsGuid_GuidObjectReturned()
        {
            //Assign
            var fieldValue = "{FC1D0AFD-71CC-47e2-84B3-7F1A2973248B}";
            var fieldId = Guid.NewGuid();

            var item = Helpers.CreateFakeItem(fieldId, fieldValue);
            var field = item.Fields[new ID(fieldId)];

            var expected = new Guid(fieldValue);

            var mapper = new SitecoreFieldGuidMapper();

            //Act
            var result = (Guid)mapper.GetField(field, null, null);

            //Assert
            Assert.AreEqual(expected, result);
        }

        [Test]
        public void GetField_FieldEmpty_EmptyGuidReturned()
        {
            //Assign
            var fieldValue = string.Empty;
            var fieldId = Guid.NewGuid();

            var item = Helpers.CreateFakeItem(fieldId, fieldValue);
            var field = item.Fields[new ID(fieldId)];

            var expected = Guid.Empty;

            var mapper = new SitecoreFieldGuidMapper();

            //Act
            var result = (Guid)mapper.GetField(field, null, null);

            //Assert
            Assert.AreEqual(expected, result);
        }

        #endregion

        #region Method - SetField

        [Test]
        public void SetField_Guidpassed_ValueSetOnField()
        {
            //Assign
            var expected = "{FC1D0AFD-71CC-47E2-84B3-7F1A2973248B}";
            var fieldId = Guid.NewGuid();

            var item = Helpers.CreateFakeItem(fieldId, string.Empty);
            var field = item.Fields[new ID(fieldId)];

            var value = new Guid(expected);

            var mapper = new SitecoreFieldGuidMapper();

          item.Editing.BeginEdit();

            //Act

                mapper.SetField(field, value, null, null);

            //Assert
            Assert.AreEqual(expected, field.Value);
        }

        [Test]
        public void SetField_EmptyGuidPassed_ValueSetOnField()
        {
            //Assign
            var expected = "{00000000-0000-0000-0000-000000000000}";
            var fieldId = Guid.NewGuid();

            var item = Helpers.CreateFakeItem(fieldId, string.Empty);
            var field = item.Fields[new ID(fieldId)];

            var value = new Guid(expected);

            var mapper = new SitecoreFieldGuidMapper();

            item.Editing.BeginEdit();

            //Act

                mapper.SetField(field, value, null, null);

            //Assert
            Assert.AreEqual(expected, field.Value);
        }

        [Test]
        public void SetField_IntegerPassed_ValueSetOnField()
        {
            //Assign
            var fieldId = Guid.NewGuid();

            var item = Helpers.CreateFakeItem(fieldId, string.Empty);
            var field = item.Fields[new ID(fieldId)];

            var value = 1;

            var mapper = new SitecoreFieldGuidMapper();

            item.Editing.BeginEdit();

            //Act

            Assert.Throws<MapperException>(() =>
            {
                mapper.SetField(field, value, null, null);
            });
            //Assert
        }

        #endregion
    }

}

{'repo_name': 'mikeedwards83/Glass.Mapper', 'stars': '116', 'repo_language': 'C#', 'file_name': 'AssemblyInfo.cs', 'mime_type': 'text/plain', 'hash': -8232418236309456401, 'source_dataset': 'data'}


package org.ovirt.engine.core.bll.network;

import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;

import org.ovirt.engine.core.common.action.ActionParametersBase;
import org.ovirt.engine.core.common.action.PersistentHostSetupNetworksParameters;
import org.ovirt.engine.core.common.businessentities.network.Network;
import org.ovirt.engine.core.common.businessentities.network.NetworkAttachment;
import org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface;
import org.ovirt.engine.core.common.errors.EngineError;
import org.ovirt.engine.core.common.errors.EngineException;
import org.ovirt.engine.core.dao.VdsStaticDao;
import org.ovirt.engine.core.dao.network.InterfaceDao;
import org.ovirt.engine.core.dao.network.NetworkAttachmentDao;
import org.ovirt.engine.core.dao.network.NetworkClusterDao;
import org.ovirt.engine.core.utils.NetworkUtils;

public class AddNetworkParametersBuilder extends HostSetupNetworksParametersBuilder {

    @Inject
    public AddNetworkParametersBuilder(InterfaceDao interfaceDao,
            VdsStaticDao vdsStaticDao,
            NetworkClusterDao networkClusterDao,
            NetworkAttachmentDao networkAttachmentDao) {
        super(interfaceDao, vdsStaticDao, networkClusterDao, networkAttachmentDao);
    }

    public ArrayList<ActionParametersBase> buildParameters(Network network, List<VdsNetworkInterface> nics) {
        ArrayList<ActionParametersBase> parameters = new ArrayList<>();

        for (VdsNetworkInterface nic : nics) {
            PersistentHostSetupNetworksParameters setupNetworkParams =
                    createHostSetupNetworksParameters(nic.getVdsId());
            setupNetworkParams.setNetworkNames(network.getName());
            VdsNetworkInterface nicToConfigure = getNicToConfigure(getNics(nic.getVdsId()), nic.getId());
            if (nicToConfigure == null) {
                throw new EngineException(EngineError.LABELED_NETWORK_INTERFACE_NOT_FOUND);
            }

            NetworkAttachment networkAttachment =
                    new NetworkAttachment(nicToConfigure,
                            network,
                            NetworkUtils.createIpConfigurationFromVdsNetworkInterface(getVlanDevice(nicToConfigure,
                                    network.getVlanId())));

            setupNetworkParams.getNetworkAttachments().add(networkAttachment);
            addBootProtocolForRoleNetworkAttachment(nicToConfigure, network, networkAttachment);

            parameters.add(setupNetworkParams);
        }

        return parameters;
    }
}

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


/*
  Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License, version 2.0,
  as published by the Free Software Foundation.

  This program is also distributed with certain software (including
  but not limited to OpenSSL) that is licensed under separate terms,
  as designated in a particular file or component or in included license
  documentation.  The authors of MySQL hereby grant you an additional
  permission to link the program and your derivative works with the
  separately licensed software that they have included with MySQL.

  This program 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 this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#include "mysqlrouter/mysql_protocol.h"
#include "mysqlrouter/utils.h"

#include <cassert>
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>

namespace mysql_protocol {

ErrorPacket::ErrorPacket(uint8_t sequence_id, uint16_t err_code, const std::string &err_msg,
                         const std::string &sql_state, Capabilities::Flags capabilities)
    : Packet(sequence_id, capabilities),
      code_(err_code),
      message_(err_msg),
      sql_state_(sql_state) {
  prepare_packet();
}

ErrorPacket::ErrorPacket(const std::vector<uint8_t> &buffer,
                         Capabilities::Flags capabilities) : Packet(buffer, capabilities) {
  parse_payload();
}

static constexpr uint8_t kHashChar = 0x23;  // 0x23 == '#'

void ErrorPacket::prepare_packet() {
  assert(sql_state_.size() == 5);

  reset();
  position_ = size();

  reserve(size() +
    sizeof(uint8_t) +   // error identifier byte
    sizeof(uint16_t) +  // error code
    sizeof(uint8_t) +   // SQL state
    message_.size()     // the message
  );

  // Error identifier byte
  write_int<uint8_t>(0xff);

  // error code
  write_int<uint16_t>(code_);

  // SQL State
  if (capability_flags_.test(Capabilities::PROTOCOL_41)) {
    write_int<uint8_t>(kHashChar);
    if (sql_state_.size() != 5) {
      write_string("HY000");
    } else {
      write_string(sql_state_);
    }
  }

  // The message
  write_string(message_);

  // Update the payload size in the header
  update_packet_size();
}

void ErrorPacket::parse_payload() {
  bool prot41 = capability_flags_.test(Capabilities::PROTOCOL_41);
  // Sanity checks
  if (!((*this)[4] == 0xff && (*this)[6])) {
    throw packet_error("Error packet marker 0xff not found");
  }
  // Check if SQLState is available when CLIENT_PROTOCOL_41 flag is set
  if (prot41 && (*this)[7] != kHashChar) {
    throw packet_error("Error packet does not contain SQL state");
  }

  unsigned long pos = 5;
  code_ = read_int_from<uint16_t>(pos);
  pos += 2;
  if ((*this)[7] == kHashChar) {
    // We get the SQLState even when CLIENT_PROTOCOL_41 flag was not set
    // This is needed in cases when the server sends an
    // error to the client instead of the handshake.
    sql_state_ = read_string_from(++pos, 5); // We skip kHashChar ('#')
    pos += 5;
  } else {
    sql_state_ = "";
  }
  message_ = read_string_from(pos);
}

} // namespace mysql_protocol

{'repo_name': 'mysql/mysql-router', 'stars': '128', 'repo_language': 'C++', 'file_name': 'docs.cmake', 'mime_type': 'text/plain', 'hash': -716067369774284979, 'source_dataset': 'data'}


package org.autojs.autojs.tool;

import io.reactivex.Observer;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable;

/**
 * Created by Stardust on 2017/8/20.
 */

public class SimpleObserver<T> implements Observer<T> {
    @Override
    public void onSubscribe(@NonNull Disposable d) {

    }

    @Override
    public void onNext(@NonNull T t) {

    }

    @Override
    public void onError(@NonNull Throwable e) {

    }

    @Override
    public void onComplete() {

    }
}

{'repo_name': 'hyb1996/Auto.js', 'stars': '7034', 'repo_language': 'Java', 'file_name': 'MultiLinePreprocessorTest.java', 'mime_type': 'text/x-java', 'hash': -8036414231563392291, 'source_dataset': 'data'}


using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Mvc.ModelBinding;

namespace MusicStore.Models
{
    //[Bind(Include = "FirstName,LastName,Address,City,State,PostalCode,Country,Phone,Email")]
    public class Order
    {
        [BindNever]
        [ScaffoldColumn(false)]
        public int OrderId { get; set; }

        [BindNever]
        [ScaffoldColumn(false)]
        public System.DateTime OrderDate { get; set; }

        [BindNever]
        [ScaffoldColumn(false)]
        public string Username { get; set; }

        [Required]
        [Display(Name = "First Name")]
        [StringLength(160)]
        public string FirstName { get; set; }

        [Required]
        [Display(Name = "Last Name")]
        [StringLength(160)]
        public string LastName { get; set; }

        [Required]
        [StringLength(70, MinimumLength = 3)]
        public string Address { get; set; }

        [Required]
        [StringLength(40)]
        public string City { get; set; }

        [Required]
        [StringLength(40)]
        public string State { get; set; }

        [Required]
        [Display(Name = "Postal Code")]
        [StringLength(10, MinimumLength = 5)]
        public string PostalCode { get; set; }

        [Required]
        [StringLength(40)]
        public string Country { get; set; }

        [Required]
        [StringLength(24)]
        [DataType(DataType.PhoneNumber)]
        public string Phone { get; set; }

        [Required]
        [Display(Name = "Email Address")]
        [RegularExpression(@"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}",
            ErrorMessage = "Email is not valid.")]
        [DataType(DataType.EmailAddress)]
        public string Email { get; set; }

        [BindNever]
        [ScaffoldColumn(false)]
        public decimal Total { get; set; }

        [BindNever]
        public List<OrderDetail> OrderDetails { get; set; }
    }
}

{'repo_name': 'Glimpse/Glimpse.Prototype', 'stars': '168', 'repo_language': 'JavaScript', 'file_name': 'debugSettings.json', 'mime_type': 'text/plain', 'hash': -2598651220967758374, 'source_dataset': 'data'}


var baseFlatten = require('./_baseFlatten');

/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;

/**
 * Recursively flattens `array`.
 *
 * @static
 * @memberOf _
 * @category Array
 * @param {Array} array The array to flatten.
 * @returns {Array} Returns the new flattened array.
 * @example
 *
 * _.flattenDeep([1, [2, [3, [4]], 5]]);
 * // => [1, 2, 3, 4, 5]
 */
function flattenDeep(array) {
  var length = array ? array.length : 0;
  return length ? baseFlatten(array, INFINITY) : [];
}

module.exports = flattenDeep;

{'repo_name': 'rhiokim/haroopad', 'stars': '1458', 'repo_language': 'JavaScript', 'file_name': 'default.css', 'mime_type': 'text/plain', 'hash': 4598161416434817784, 'source_dataset': 'data'}


--------------------------------------------------
Name
--------------------------------------------------
Sage Apple Chicken with Brie
--------------------------------------------------
Ingredients
--------------------------------------------------
1 cup
red wine
1/4 cup
olive oil
1 teaspoon
salt, divided
1 tablespoon
dried sage, divided
2
skinless, boneless chicken breast halves
1
Red Delicious apple, cored and sliced
4 slices
Brie cheese
--------------------------------------------------
Directions
--------------------------------------------------
In a large resealable bag, combine the red wine, olive oil, 1/2 teaspoon of salt and 1/2 teaspoon sage. Place the chicken in the bag, seal and shake to coat. Place in the refrigerator to marinate overnight
Preheat the oven to 400 degrees F (200 degrees C). Place the chicken on a baking sheet. Season with the remaining sage and salt. Discard marinade
Bake for about 25 minutes, or until chicken juices run clear. Remove from the oven and top each piece of chicken with slices of apple and Brie cheese. Return to the oven and set it to Broil
Broil the chicken for about 5 minutes, or until the apple and cheese are toasted
--------------------------------------------------

{'repo_name': 'mikeizbicki/ucr-cs100', 'stars': '399', 'repo_language': 'C++', 'file_name': 'grade', 'mime_type': 'text/plain', 'hash': -7867576509373795703, 'source_dataset': 'data'}


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

#include "config.h"
#include "DFGThreadData.h"

#if ENABLE(DFG_JIT)

#include "JSCInlines.h"

namespace JSC { namespace DFG {

ThreadData::ThreadData(Worklist* worklist)
    : m_worklist(worklist)
    , m_safepoint(nullptr)
{
}

ThreadData::~ThreadData()
{
}

} } // namespace JSC::DFG

#endif // ENABLE(DFG_JIT)

{'repo_name': 'hxxft/lynx-native', 'stars': '360', 'repo_language': 'JavaScript', 'file_name': 'GTestDriverReceiver.java', 'mime_type': 'text/x-java', 'hash': 2369017294186281192, 'source_dataset': 'data'}


#ifndef SF_H_
#define SF_H_

/*
 * sophia database
 * sphia.org
 *
 * Copyright (c) Dmitry Simonenko
 * BSD License
*/

typedef struct sfvar sfvar;
typedef struct sfv sfv;

#define SVNONE   0
#define SVDELETE 1
#define SVUPSERT 2
#define SVGET    4
#define SVDUP    8
#define SVBEGIN  16

struct sfvar {
	uint32_t size;
} sspacked;

struct sfv {
	char     *pointer;
	uint32_t  size;
	union {
		uint8_t  u8;
		uint16_t u16;
		uint32_t u32;
		uint64_t u64;
	} numeric;
};

static inline uint32_t
sf_ttl(sfscheme *s, char *data)
{
	assert(s->has_expire);
	return *(uint32_t*)(data + s->offset_expire);
}

static inline uint8_t
sf_flags(sfscheme *s, char *data)
{
	assert(s->has_flags);
	return *(uint8_t*)(data + s->offset_flags);
}

static inline int
sf_flagsequ(uint8_t flags, uint8_t value) {
	return (flags & value) > 0;
}

static inline int
sf_is(sfscheme *s, char *data, uint8_t flags) {
	return sf_flagsequ(sf_flags(s, data), flags) > 0;
}

static inline void
sf_flagsset(sfscheme *s, char *data, uint8_t flags)
{
	assert(s->has_flags);
	*(uint8_t*)(data + s->offset_flags) = flags;
}

static inline sfvar*
sf_var(sfscheme *s, int pos, char *data)
{
	return &((sfvar*)(data + s->var_offset))[pos];
}

static inline uint32_t
sf_size(sfscheme *s, char *data)
{
	if (sslikely(sf_schemefixed(s)))
		return s->var_offset;
	uint32_t size = s->var_offset + (sizeof(sfvar) * s->var_count);
	sfvar *v = sf_var(s, 0, data);
	sfvar *end = sf_var(s, s->var_count, data);
	for (; v < end; v++)
		size += v->size;
	return size;
}

static inline uint64_t
sf_lsn(sfscheme *s, char *data)
{
	assert(s->has_lsn);
	return *(uint64_t*)(data + s->offset_lsn);
}

static inline void
sf_lsnset(sfscheme *s, char *data, uint64_t lsn)
{
	assert(s->has_lsn);
	*(uint64_t*)(data + s->offset_lsn) = lsn;
}

static inline char*
sf_fieldptr(sfscheme *s, sffield *f, char *data, uint32_t *size)
{
	if (sslikely(f->fixed_size > 0)) {
		*size = f->fixed_size;
		return data + f->fixed_offset;
	}
	uint32_t offset = s->var_offset + (sizeof(sfvar) * s->var_count);
	uint32_t pos = 0;
	sfvar *v = sf_var(s, 0, data);
	for (; pos < f->position_ref; v++, pos++)
		offset += v->size;
	*size = v->size;
	return data + offset;
}

static inline char*
sf_field(sfscheme *s, int pos, char *data, uint32_t *size)
{
	return sf_fieldptr(s, s->fields[pos], data, size);
}

static inline int
sf_fieldsize(sfscheme *s, int pos, char *data)
{
	sffield *f = s->fields[pos];
	if (sslikely(f->fixed_size > 0))
		return f->fixed_size;
	return sf_var(s, f->position_ref, data)->size;
}

static inline int
sf_writesize(sfscheme *s, sfv *v)
{
	if (sf_schemefixed(s))
		return s->var_offset;
	int sum = s->var_offset;
	int i;
	for (i = 0; i < s->fields_count; i++) {
		sffield *f = s->fields[i];
		if (f->fixed_size != 0)
			continue;
		sum += sizeof(sfvar)+ v[i].size;
	}
	return sum;
}

static inline void
sf_write(sfscheme *s, sfv *v, char *dest)
{
	int var_value_offset =
		s->var_offset + sizeof(sfvar) * s->var_count;
	int i;
	for (i = 0; i < s->fields_count; i++) {
		sffield *f = s->fields[i];
		if (f->fixed_size) {
			if (sslikely(v[i].size > 0))
				memcpy(dest + f->fixed_offset, v[i].pointer, v[i].size);
			else
				memset(dest + f->fixed_offset, 0, f->fixed_size);
			continue;
		}
		sfvar *var = sf_var(s, f->position_ref, dest);
		var->size = v[i].size;
		if (sslikely(v[i].size > 0))
			memcpy(dest + var_value_offset, v[i].pointer, v[i].size);
		var_value_offset += var->size;
	}
}

static inline uint64_t
sf_hash(sfscheme *s, char *data)
{
	uint64_t hash = 0;
	int i;
	for (i = 0; i < s->keys_count; i++) {
		uint32_t size;
		char *field = sf_field(s, i, data, &size);
		hash ^= ss_fnv(field, size);
	}
	return hash;
}

static inline int
sf_comparable_size(sfscheme *s, char *data)
{
	int sum = s->var_offset;
	int i;
	for (i = 0; i < s->fields_count; i++) {
		sffield *f = s->fields[i];
		if (f->fixed_size != 0)
			continue;
		if (f->key)
			sum += sf_fieldsize(s, i, data);
		sum += sizeof(sfvar);
	}
	return sum;
}

static inline void
sf_comparable_write(sfscheme *s, char *src, char *dest)
{
	int var_value_offset =
		s->var_offset + sizeof(sfvar) * s->var_count;
	memcpy(dest, src, s->var_offset);
	int i;
	for (i = 0; i < s->fields_count; i++) {
		sffield *f = s->fields[i];
		if (f->fixed_size != 0)
			continue;
		sfvar *var = sf_var(s, f->position_ref, dest);
		if (! f->key) {
			var->size = 0;
			continue;
		}
		char *ptr = sf_fieldptr(s, f, src, &var->size);
		memcpy(dest + var_value_offset, ptr, var->size);
		var_value_offset += var->size;
	}
}

#endif

{'repo_name': 'pmwkaa/sophia', 'stars': '1768', 'repo_language': 'C', 'file_name': 'crud.c', 'mime_type': 'text/x-c', 'hash': 567940190786744524, 'source_dataset': 'data'}


#include "SeatsCommon.as"

// optimization: we use script globals here cause all seats GUI use the same value for this
f32 bounce;
u32 lastBounceTime;

void onRender(CSprite@ this)
{
	if (g_videorecording)
		return;
	if (this is null) return; //can happen with bad reload

	// draw only for local player
	CBlob@ localBlob = getLocalPlayerBlob();

	if (localBlob is null || localBlob.isAttached() || localBlob.isInInventory())
	{
		return;
	}
	CBlob@ blob = this.getBlob();

	f32 arrowVisibleRadius = blob.getRadius() + 15.0f;

	//too far away
	if ((localBlob.getPosition() - blob.getPosition()).getLength() > arrowVisibleRadius)
	{
		return;
	}
	//carrying us
	if (localBlob.getCarriedBlob() is blob)
	{
		return;
	}
	//not same team
	if ((blob.getTeamNum() <= 8 && blob.getTeamNum() != localBlob.getTeamNum()))
	{
		return;
	}

	//behind solid blocks
	if (localBlob.getMap().rayCastSolid(localBlob.getPosition(), blob.getPosition()))
	{
		return;
	}

	// dont draw if angle is upside down
	f32 angle = blob.getAngleDegrees();

	if (angle > 70.0f && angle < 290.0f)
	{
		return;
	}

	// draw arrows pointing towards seats
	if (lastBounceTime != getGameTime())
	{
		bounce = Maths::Sin((getGameTime() + blob.getNetworkID()) / 4.5f);
		lastBounceTime = getGameTime();
	}

	if (bounce > 0.8f)
	{
		return;
	}

	AttachmentPoint@[] aps;
	if (blob.getAttachmentPoints(@aps))
	{
		string lastPointName;
		for (uint i = 0; i < aps.length; i++)
		{
			AttachmentPoint@ ap = aps[i];

			if (ap.getOccupied() is null && ap.socket && ap.getKeysToTake() > 0 && ap.radius > 0.0f && lastPointName != ap.name) // gather empty controllers attachments/seats
			{
				int occupied = ap.customData;
				const bool driver = ap.name == "DRIVER";  // HACK:
				if (driver && blob.hasTag("immobile")) continue;

				if (occupied == 0 && (!driver || (driver && !blob.isAttached())))
				{
					Vec2f pos = getDriver().getScreenPosFromWorldPos(ap.getPosition());
					pos.y += -3.0f + 10.0f * bounce;
					if (blob.isFacingLeft())
					{
						pos.x -= 8.0f;
					}

					GUI::DrawIconByName("$down_arrow$", pos);

					if (g_debug == 0)
					{
						lastPointName = ap.name;  // draw just one of a kind
					}
				}
			}
		}
	}
}

{'repo_name': 'transhumandesign/kag-base', 'stars': '215', 'repo_language': 'AngelScript', 'file_name': 'team1.cfg', 'mime_type': 'text/plain', 'hash': -5292987532343654936, 'source_dataset': 'data'}


<?php

namespace TwigBridge\Tests\Node;

use Illuminate\Database\Eloquent\Model;

class TemplateModel extends Model
{
    //
}

{'repo_name': 'rcrowe/TwigBridge', 'stars': '829', 'repo_language': 'PHP', 'file_name': 'TwigTest.php', 'mime_type': 'text/x-php', 'hash': 9080696910349372373, 'source_dataset': 'data'}


儲蓄互助社法

為健全儲蓄互助社經營發展，維護社員權益，改善基層民眾互助資金之流通，發揮社會安全制度功能，特制定本法。

儲蓄互助社為法人。本法所稱儲蓄互助社，係指本法公布施行前已成立或依法新設立，且具共同關係之自然人及非營利法人所組成之非營利社團法人。前項所稱共同關係，乃指工作於同一公司、工廠或職業團體、或參加同一社團或宗教團體或原住民團體、或居住於同一鄉、鎮者。無共同關係而參加儲蓄互助社者無效。但於本法修正前已參加者，不在此限。社員喪失共同關係者，於喪失共同關係起二年內仍為社員。

一、增列第一項明定儲蓄互助社之性質為法人，不必向地方法院辦理法人登記，向主管機關登記後即有法人資格。二、原第一、二、三、四項移為第二、三、四、五項。

儲蓄互助社採有限責任制，社員以其股金為限負其責任。

儲蓄互助社之可貸放資金，主要來自社員儲蓄股金。儲蓄互助社不准吸收非社員股金。貸放對象亦是限於社員，不對外營業，是以要求社員就其出資股金負有限責任，即可維護儲蓄互助社與社員之債權債務關係。

本法所稱中華民國儲蓄互助協會（以下簡稱協會），係指由全體儲蓄互助社共同組成之社團法人，凡已成立之儲蓄互助社均應參加協會為會員。儲蓄互助社之管理與監督，由協會依本法之規定執行。

強制規定每一儲蓄互助社均需加入協會，可使儲蓄互助社納入協會之監督輔導體系，亦可強化儲蓄互助社彼此之合作力量，並避免儲蓄互助社因未納入而任意發展，不受約束而變質。

儲蓄互助社之主管機關：在中央為內政部；在直轄市為直轄市政府；在縣（市）為縣（市）政府。

為符合儲蓄互助社的設立目的及法人屬性，增訂中央主管機關為內政部。

儲蓄互助社應於名稱上標明；非依本法規定，不得使用儲蓄互助社之名稱。

避免其他類似機構或組織假借儲蓄互助社之名，行變相經營及逃避課稅之實，尤其應該防範地下錢莊、高利貸組織藉儲蓄互助社之名牟利。

儲蓄互助社之設立、管理、監督與輔導，由協會辦理。前項設立、管理、監督與輔導辦法由協會定之，並送中央主管機關核備。

一、第四條第二項「監督」移置第一項。二、由協會訂定及執行儲蓄互助社之設立、管理、監督與輔導辦法。

依本法設立之儲蓄互助社組織，依法經營者，免徵所得稅及營業稅。

儲蓄互助社之任務如下：一、收受社員股金。二、辦理社員放款。三、參加協會代辦之各項互助基金。四、代理收受社員水電費、瓦斯費、學費、電話費、稅金及罰鍰。五、參加協會資金融通。六、購買國家公債。七、其他經中央主管機關核可之相關事項。儲蓄互助社收受社員股金不得有保本保息或固定收益之約定。

為避免因「列舉」規定而生掛一漏萬的僵化可能，宜修正為「例示」規定，增訂第一項第七款。

（刪除）

一、本條刪除。二、本條文內容不符「授權明確性」的要求有可能產生行政機關不當介入與過當裁量的疑慮。三、與本法相類似的合作社法並無與本條文相同的規定。四、本法訂有罰責規定，即可收監督管理的效果。

儲蓄互助社對單一社員之放款總額不得超過該社股金與公積金總額百分之十。儲蓄互助社放款總額不得超過該社自有資金總額。前項所稱自有資金係指：社員股金、留置股金、資本公積、公積金、特別公積，未分配盈餘及本期損益。

一、將「股金與公積金」更改為「自有資金」，並刪除「百分之九十」的限制。二、增訂第三項「自有資金」之名詞解釋。

儲蓄互助社不得對非社員為收受股金及放款之服務。

堅守合作原則，實踐儲蓄互助社「非為營利、非為救濟、乃是服務」之宗旨。

社股金額為每股新臺幣一百元，每一社員股金，至多不得超過社股金總額百分之十。前項股金繳納係社員之義務，具有儲蓄性質。

增訂第二項。儲蓄互助社最主要任務為對社員放款，而資金的唯一來源即社員持續不斷儲蓄股金，不僅促使社員養成儲蓄習慣累積個人信用能力，也使社健全發展而有充裕資金來源，故將社員繳納儲蓄股金列社員義務之一。

儲蓄互助社社員之儲蓄股金未達一百萬元者，其股息所得免稅。

一、本條新增。二、一來是根據本法第十三條強制儲蓄性質依所得稅法第四條第一項第六款規定應予免稅的理由，二來是基於儲蓄互助社為非營利自助互助封閉型合作組織，兼具資金供給於需求者的雙重屬性，三來是針對儲蓄互助社社員大都是原住民或偏遠地區居民，是以對於中低收入者強制性的儲蓄行為，就公平與效率的課稅原則而言，即使不予免稅，至少應給予定額免稅優惠的規定以資鼓勵。

社員申請退股，須以書面提出之，並經理事會之同意。理事會於必要時得遲延支付退股之股金，但最遲不得超過同意退股之日起六十日。社員於年度中退股，該部分當年度不得分配股息。第一項社員退股，於儲蓄互助社發生經營重大危機時，理事會得暫停社員退股申請，並於一個月內召開臨時社員大會。

一、儲蓄互助社採門戶開放合作原則，應准許社員自由出入。但為避免影響經營運作及資金流動性，應予以適度限制，以維財務穩健。二、遇有儲蓄互助社經營重大危機時，為免因社員退社加深惡化速度，得暫停社員退股申請，但需於一個月內召開臨時社員大會解決經營危機及退股風潮，以免儲蓄互助社無法承受而倒閉。

儲蓄互助社之年度盈餘，依下列優先順序提撥或分配：一、彌補累積虧損。二、利息攤還。三、公積金百分之二十以上。四、公益金及教育金百分之五。五、社股股息。前項所稱公積金達股金總額百分之二十時，得酌減提撥比率。

依據儲蓄互助社特殊且慣行的業務，增訂第一項第二款「利息攤還」的規定。原第二、三、四款修正為第三、四、五款。

儲蓄互助社以全體社員組成之社員大會為最高權力機構。社員大會應有全體社員五分之一之出席，或成年社員一定人數以上之出席，始得開會。社員大會每一社員有一票之表決權，不得委託他人行使權利。

一、明定社員大會為最高權力機關。二、以「一人一票」之合作原則，落實人人平等。

社員大會分常年大會及臨時大會。常年大會應於每一會計年度終了兩個月內召開，並於七日前，以書面通知社員；臨時大會依章程規定召開。

明定社員大會種類與召開程序。

儲蓄互助社設理事會，執行社員大會之決議，對儲蓄互助社負連帶責任。理事七至二十一人，由社員大會選任之，任期三年，連選得連任。理事會設理事長一人，由理事互選之，連選得連任一次。

明定理事會職權及理事產生方式、人數及任期。

儲蓄互助社設監事會，對儲蓄互助社負連帶責任。監事五至十五人，由社員大會選任之，任期三年，連選得連任。

明定監事會責任及監事產生方式、人數及任期。

理事、監事均為無給職，且不得支領酬勞金。

儲蓄互助社鼓勵社員志願服務，除僱用之專職人員支領薪酬外，選任幹部一概不支薪酬。

儲蓄互助社運用資金，辦理放款，或解散清算時有任何損失，由全體理監事負連帶有限責任。協會執行任務而有損失時，亦同。

明定儲蓄互助社辦理放款如有損失，或協會執行任務有損失，於解散清算時均應由全體社員連帶負責。

理事應依照法令、章程及社員大會之決議執行職務。理、監事會之決議違反前項規定，致儲蓄互助社受損害時，理、監事對儲蓄互助社應負賠償責任。但經表示異議並有會議紀錄可證者，不在此限。監事因怠忽監察職務，致儲蓄互助社受損害時，對儲蓄互助社應負賠償責任。

一、第二項文中「理事會」修改為「理、監事會」。二、增列第三項，因第一次修正時，此項並未列入修正，但總統公布時卻漏列，為恢復原條文完整性，應予增列。

儲蓄互助社因下列各款情事之一而解放，應由協會呈報主管機關核准：一、社員大會之解散決議。二、社員不滿五十人。三、經破產宣告。四、經協會命令解散。前項第一款之決議，應有全體社員四分之三以上之出席，出席社員三分之二以上之同意。

明定儲蓄互助社解散之各種情形，並須經由主管機關核准。

儲蓄互助社因解散清算時，應受協會監督，其清算人由社員大會選任之。如社員大會不選任時，由理事充任之。

明定清算之監督及清算人之選任。

儲蓄互助社年度決算或清算後有虧損時，以各項準備金、公積金、股金順序抵補之；清算有賸餘時，依社員股金分配之。

明定清算虧損之彌補程序以及賸餘之處理。

清算人於清算事務終了後，應於二十日內造具報告書，送協會轉呈主管機關，並分送社員。

協會之任務如下：一、輔導儲蓄互助社訂定章程。二、辦理有關互助之教育訓練。三、審核設立儲蓄互助社並保障其權益。四、監督、稽核及輔導各儲蓄互助社。五、代辦儲蓄互助社各項互助基金。六、管理儲蓄互助社提存之公積金。七、辦理儲蓄互助社資金融通。八、其他經核可之事項。協會執行任務，由內政部、財政部分別予以監督及輔導。

規定協會之業務、協會對儲蓄互助社之監督管理及呈報資料義務。

協會於每一年度終了後三個月內，應將所屬儲蓄互助社營運之有關資料，呈報主管機關。

明定授權協會管理後，協會每年必須呈報主管機關各項有關資料，以利主管機關之瞭解。

儲蓄互助社違反法令、章程，或無法健全經營而損及社員權益之虞時，主管機關得為下列之處分，協會為處分時並應報主管機關核備：一、撤銷會議之決議。二、停止或解除理事、監事職務。三、命令儲蓄互助社處分失職人員。四、停止部分業務。五、命令解散。六、其他必要之處置。前項情形，得對理事、監事處新台幣六萬元以上三十萬元以下之罰鍰。

第一項「備查」修正為「核備」，以明確行政處分的權責機關，不宜歸由民間法人團體來執行。

本法公布施行前已成立之儲蓄互助社，應自本法修正施行後一年內向主管機關備案登記。本法修正施行前，既有儲蓄互助社登記有案，其以自有資金取得而以自然人或協會名義登記之土地及建築改良物，得更名為該儲蓄互助社所有。儲蓄互助社辦理前項更名所需證明文件，向直轄市、縣（市）主管機關申請之，有關更名作業辦法，由中央主管機關定之。

一、將第一項「公布」修正為「修正」。二、增訂第二項及第三項，係因儲蓄互助法於民國八十六年五月二十一日制定公布以來，迭發生立法前各儲蓄互助社（單位社）以自有資金購得之土地及地上物礙於法令的限制，致無法登記為各單位社所有，而以自然人或協會名義登記的事實，立法時卻漏未訂定相關的程序規定，使得各單位社未能辦理更名登記。

違反第六條規定，或未依法設立、成立儲蓄互助社或類似組織而營業者，處二年以下有期徒刑，得併科新臺幣三十萬元以下罰金。法人犯前項之罪者，處罰其行為負責人。

明定非法使用儲蓄互助社或近似名稱之罰則。

儲蓄互助社理事、監事或其他職員有下列情形之一者，處一年以下有期徒刑、拘役或科或併科新臺幣六十萬元以下罰金：一、拒絕移交者。二、隱匿或毀損社之財產或帳冊文件者。三、偽造債務或承認不真實之債務者。

明定儲蓄互助社主要負責人及職員之刑事責任。

儲蓄互助社有下列情形之一者，由協會報請主管機關按情節輕重，處新臺幣六萬元以上三十萬元以下之罰鍰。一、違反第九條規定，經營未經核准之業務項目者。二、違反第十一條規定，放款逾越限制者。三、違反第十二條規定，對非社員營業者。四、違反第十三條規定，吸收個人股金逾越上限者。五、違反第十四條規定，未依規定辦理退股者。六、違反第十五條規定，盈餘分配不當者。七、違反第二十條規定，支付酬勞金者。前項所定罰鍰之受罰人為儲蓄互助社。儲蓄互助社經依前項受罰後，對應負責之人有求償權。

明定儲蓄互助社違反本法之罰則內容。

協會有下列情事之一者，主管機關得依情節輕重，處新臺幣六萬元以上三十萬元以下之罰鍰。一、違反第二十七條規定，經營未經核准之業務項目。二、違反第二十八條規定，未呈報資料或呈報不實者。

明定協會違反本法之罰則內容。

本法自公布日施行。

{'repo_name': 'victorhsieh/tw-law-corpus', 'stars': '152', 'repo_language': 'Shell', 'file_name': '在臺公司大陸地區股東股權行使條例.md', 'mime_type': 'text/plain', 'hash': 3214028759102590809, 'source_dataset': 'data'}


/* pages/userhome/address/address.wxss */
.addressDefault{
	padding:0rpx 40rpx 20rpx;
	color: #fff;
	background-color: #f12035;
}
.userInfo{
	line-height: 90rpx;
}
.number{
	margin-left: 120rpx;
}
.addressInfo{
	line-height: 50rpx;
}
.addressInfo .default{
	color: #f2d0aa;
}
.address{
	padding:0rpx 40rpx 20rpx;
	border-bottom: 1rpx solid #f3f3f3;
	background: #fff;
}
.add_address{
	width: 600rpx;
	height: 90rpx;
	line-height: 90rpx;
	text-align: center;
	background: #fff;
	position: absolute;
	bottom: 20rpx;
	left: 10%;
	border-radius: 10rpx;
}

{'repo_name': 'ritaswc/wechat_app_template', 'stars': '185', 'repo_language': 'JavaScript', 'file_name': 'bson.js', 'mime_type': 'text/plain', 'hash': -847219054789601728, 'source_dataset': 'data'}


        Chart demonstrating more advanced accessibility configuration, using
        a custom series type based on the boxplot series.
        The chart is depicting fictional fruit consumption data, with the
        minimum, maximum and median values for each month of 2019. Most plums
        were eaten in spring, and none at all in July or August. Bananas and
        apples were both consumed in smaller numbers and steadily throughout
        the year.

{'repo_name': 'highcharts/highcharts', 'stars': '9562', 'repo_language': 'TypeScript', 'file_name': 'check_and_trigger_docs_deploy.sh', 'mime_type': 'text/x-shellscript', 'hash': -6063339423306437480, 'source_dataset': 'data'}


/*
 * JBoss, Home of Professional Open Source
 * Copyright 2010, Red Hat, Inc., and individual contributors
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jboss.weld.tests.builtinBeans;

import jakarta.enterprise.inject.spi.InjectionPoint;
import jakarta.inject.Inject;
import java.io.Serializable;

public class Dog implements Serializable {

    private static InjectionPoint injectionPoint;

    @Inject
    public Dog(InjectionPoint injectionPoint) {
        Dog.injectionPoint = injectionPoint;
    }

    public static void reset() {
        Dog.injectionPoint = null;
    }

    public static InjectionPoint getInjectionPoint() {
        return injectionPoint;
    }

}

{'repo_name': 'weld/core', 'stars': '314', 'repo_language': 'Java', 'file_name': 'Baz.java', 'mime_type': 'text/x-java', 'hash': -6069216542654510857, 'source_dataset': 'data'}


//===- unittest/Format/FormatTestProto.cpp --------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "FormatTestUtils.h"
#include "clang/Format/Format.h"
#include "llvm/Support/Debug.h"
#include "gtest/gtest.h"

#define DEBUG_TYPE "format-test"

namespace clang {
namespace format {

class FormatTestProto : public ::testing::Test {
protected:
  static std::string format(llvm::StringRef Code, unsigned Offset,
                            unsigned Length, const FormatStyle &Style) {
    LLVM_DEBUG(llvm::errs() << "---\n");
    LLVM_DEBUG(llvm::errs() << Code << "\n\n");
    std::vector<tooling::Range> Ranges(1, tooling::Range(Offset, Length));
    tooling::Replacements Replaces = reformat(Style, Code, Ranges);
    auto Result = applyAllReplacements(Code, Replaces);
    EXPECT_TRUE(static_cast<bool>(Result));
    LLVM_DEBUG(llvm::errs() << "\n" << *Result << "\n\n");
    return *Result;
  }

  static std::string format(llvm::StringRef Code) {
    FormatStyle Style = getGoogleStyle(FormatStyle::LK_Proto);
    Style.ColumnLimit = 60; // To make writing tests easier.
    return format(Code, 0, Code.size(), Style);
  }

  static void verifyFormat(llvm::StringRef Code) {
    EXPECT_EQ(Code.str(), format(Code)) << "Expected code is not stable";
    EXPECT_EQ(Code.str(), format(test::messUp(Code)));
  }
};

TEST_F(FormatTestProto, FormatsMessages) {
  verifyFormat("message SomeMessage {\n"
               "  required int32 field1 = 1;\n"
               "}");
  verifyFormat("message SomeMessage {\n"
               "  required .absolute.Reference field1 = 1;\n"
               "}");
  verifyFormat("message SomeMessage {\n"
               "  required int32 field1 = 1;\n"
               "  optional string field2 = 2 [default = \"2\"]\n"
               "}");

  verifyFormat("message SomeMessage {\n"
               "  optional really.really.long.qualified.type.aaa.aaaaaaa\n"
               "      fiiiiiiiiiiiiiiiiiiiiiiiiield = 1;\n"
               "  optional\n"
               "      really.really.long.qualified.type.aaa.aaaaaaa.aaaaaaaa\n"
               "          another_fiiiiiiiiiiiiiiiiiiiiield = 2;\n"
               "}");
  verifyFormat("message SomeMessage {\n"
               "  map<string, Project> projects = 1;\n"
               "  optional map<string, int32> size_projects = 2;\n"
               "  map<int, really.really.really.long.qualified.type.nameeee>\n"
               "      projects = 3;\n"
               "  map<int, really.really.really.really.long.qualified.type\n"
               "               .nameeee> projects = 4;\n"
               "  map<int,\n"
               "      reallyreallyreallyreallyreallyreallyreallylongname>\n"
               "      projects = 5;\n"
               "  map<int, Project>\n"
               "      longlonglonglonglonglonglonglonglonglongonglon = 6;\n"
               "  map<releleallyreallyreallyreallyreallyreallyreallylongname,\n"
               "      int> projects = 7;\n"
               "  map<releleallyreallyreallyreallyreallyreallyreallylongname,\n"
               "      releleallyreallyreallyreallyreallyreallyreallylongname>\n"
               "      releleallyreallyreallyreallyreallyreallyreallylongnam =\n"
               "          8;\n"
               "  map<relele.llyreal.yreallyr.allyreally.eallyreal\n"
               "          .sauenirylongname,\n"
               "      really.really.really.really.long.qualified.type\n"
               "          .nameeee> projects = 9;\n"
               "}");
}

TEST_F(FormatTestProto, KeywordsInOtherLanguages) {
  verifyFormat("optional string operator = 1;");
}

TEST_F(FormatTestProto, FormatsEnums) {
  verifyFormat("enum Type {\n"
               "  UNKNOWN = 0;\n"
               "  TYPE_A = 1;\n"
               "  TYPE_B = 2;\n"
               "};");
  verifyFormat("enum Type {\n"
               "  UNKNOWN = 0 [(some_options) = { a: aa, b: bb }];\n"
               "};");
  verifyFormat("enum Type {\n"
               "  UNKNOWN = 0 [(some_options) = {\n"
               "    a: aa,  // wrap\n"
               "    b: bb\n"
               "  }];\n"
               "};");
}

TEST_F(FormatTestProto, UnderstandsReturns) {
  verifyFormat("rpc Search(SearchRequest) returns (SearchResponse);");
}

TEST_F(FormatTestProto, MessageFieldAttributes) {
  verifyFormat("optional string test = 1 [default = \"test\"];");
  verifyFormat("optional bool a = 1 [default = true, deprecated = true];");
  verifyFormat("optional LongMessageType long_proto_field = 1 [\n"
               "  default = REALLY_REALLY_LONG_CONSTANT_VALUE,\n"
               "  deprecated = true\n"
               "];");
  verifyFormat("optional LongMessageType long_proto_field = 1\n"
               "    [default = REALLY_REALLY_LONG_CONSTANT_VALUE];");
  verifyFormat("repeated double value = 1\n"
               "    [(aaaaaaa.aaaaaaaaa) = { aaaaaaaaaaaaaaaaa: AAAAAAAA }];");
  verifyFormat("repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = {\n"
               "  aaaaaaaaaaaaaaaa: AAAAAAAAAA,\n"
               "  bbbbbbbbbbbbbbbb: BBBBBBBBBB\n"
               "}];");
  verifyFormat("repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = {\n"
               "  aaaaaaaaaaaaaaaa: AAAAAAAAAA\n"
               "  bbbbbbbbbbbbbbbb: BBBBBBBBBB\n"
               "}];");
  verifyFormat("repeated double value = 1 [\n"
               "  (aaaaaaa.aaaaaaaaa) = {\n"
               "    aaaaaaaaaaaaaaaa: AAAAAAAAAA\n"
               "    bbbbbbbbbbbbbbbb: BBBBBBBBBB\n"
               "  },\n"
               "  (bbbbbbb.bbbbbbbbb) = {\n"
               "    aaaaaaaaaaaaaaaa: AAAAAAAAAA\n"
               "    bbbbbbbbbbbbbbbb: BBBBBBBBBB\n"
               "  }\n"
               "];");
  verifyFormat("repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = {\n"
               "  type: \"AAAAAAAAAA\"\n"
               "  is: \"AAAAAAAAAA\"\n"
               "  or: \"BBBBBBBBBB\"\n"
               "}];");
  verifyFormat("repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = {\n"
               "  aaaaaaaaaaaaaaaa: AAAAAAAAAA,\n"
               "  bbbbbbb: BBBB,\n"
               "  bbbb: BBB\n"
               "}];");
  verifyFormat("optional AAA aaa = 1 [\n"
               "  foo = {\n"
               "    key: 'a'  //\n"
               "  },\n"
               "  bar = {\n"
               "    key: 'a'  //\n"
               "  }\n"
               "];");
  verifyFormat("optional string test = 1 [default = \"test\"\n"
               "                                    \"test\"];");
  verifyFormat("optional Aaaaaaaa aaaaaaaa = 12 [\n"
               "  (aaa) = aaaa,\n"
               "  (bbbbbbbbbbbbbbbbbbbbbbbbbb) = {\n"
               "    aaaaaaaaaaaaaaaaa: true,\n"
               "    aaaaaaaaaaaaaaaa: true\n"
               "  }\n"
               "];");
  verifyFormat("extensions 20 [(proto2.type) = 'Aaaa.bbbb'];");
  verifyFormat("extensions 20\n"
               "    [(proto3.type) = 'Aaaa.bbbb', (aaa.Aaa) = 'aaa.bbb'];");
  verifyFormat("extensions 123 [\n"
               "  (aaa) = aaaa,\n"
               "  (bbbbbbbbbbbbbbbbbbbbbbbbbb) = {\n"
               "    aaaaaaaaaaaaaaaaa: true,\n"
               "    aaaaaaaaaaaaaaaa: true\n"
               "  }\n"
               "];");
}

TEST_F(FormatTestProto, DoesntWrapFileOptions) {
  EXPECT_EQ(
      "option java_package = "
      "\"some.really.long.package.that.exceeds.the.column.limit\";",
      format("option    java_package   =    "
             "\"some.really.long.package.that.exceeds.the.column.limit\";"));
}

TEST_F(FormatTestProto, FormatsOptions) {
  verifyFormat("option (MyProto.options) = {\n"
               "  field_a: OK\n"
               "  field_b: \"OK\"\n"
               "  field_c: \"OK\"\n"
               "  msg_field: { field_d: 123 }\n"
               "};");
  verifyFormat("option (MyProto.options) = {\n"
               "  field_a: OK\n"
               "  field_b: \"OK\"\n"
               "  field_c: \"OK\"\n"
               "  msg_field: { field_d: 123 field_e: OK }\n"
               "};");
  verifyFormat("option (MyProto.options) = {\n"
               "  field_a: OK  // Comment\n"
               "  field_b: \"OK\"\n"
               "  field_c: \"OK\"\n"
               "  msg_field: { field_d: 123 }\n"
               "};");
  verifyFormat("option (MyProto.options) = {\n"
               "  field_c: \"OK\"\n"
               "  msg_field { field_d: 123 }\n"
               "};");
  verifyFormat("option (MyProto.options) = {\n"
               "  field_a: OK\n"
               "  field_b { field_c: OK }\n"
               "  field_d: OKOKOK\n"
               "  field_e: OK\n"
               "}");

  // Support syntax with <> instead of {}.
  verifyFormat("option (MyProto.options) = {\n"
               "  field_c: \"OK\",\n"
               "  msg_field: < field_d: 123 >\n"
               "  empty: <>\n"
               "  empty <>\n"
               "};");

  verifyFormat("option (MyProto.options) = {\n"
               "  field_a: OK\n"
               "  field_b < field_c: OK >\n"
               "  field_d: OKOKOK\n"
               "  field_e: OK\n"
               "}");

  verifyFormat("option (MyProto.options) = {\n"
               "  msg_field: <>\n"
               "  field_c: \"OK\",\n"
               "  msg_field: < field_d: 123 >\n"
               "  field_e: OK\n"
               "  msg_field: < field_d: 12 >\n"
               "};");

  verifyFormat("option (MyProto.options) = <\n"
               "  field_a: OK\n"
               "  field_b: \"OK\"\n"
               "  field_c: 1\n"
               "  field_d: 12.5\n"
               "  field_e: OK\n"
               ">;");

  verifyFormat("option (MyProto.options) = <\n"
               "  field_a: OK,\n"
               "  field_b: \"OK\",\n"
               "  field_c: 1,\n"
               "  field_d: 12.5,\n"
               "  field_e: OK,\n"
               ">;");

  verifyFormat("option (MyProto.options) = <\n"
               "  field_a: \"OK\"\n"
               "  msg_field: { field_b: OK }\n"
               "  field_g: OK\n"
               "  field_g: OK\n"
               "  field_g: OK\n"
               ">;");

  verifyFormat("option (MyProto.options) = <\n"
               "  field_a: \"OK\"\n"
               "  msg_field <\n"
               "    field_b: OK\n"
               "    field_c: OK\n"
               "    field_d: OK\n"
               "    field_e: OK\n"
               "    field_f: OK\n"
               "  >\n"
               "  field_g: OK\n"
               ">;");

  verifyFormat("option (MyProto.options) = <\n"
               "  field_a: \"OK\"\n"
               "  msg_field <\n"
               "    field_b: OK,\n"
               "    field_c: OK,\n"
               "    field_d: OK,\n"
               "    field_e: OK,\n"
               "    field_f: OK\n"
               "  >\n"
               "  field_g: OK\n"
               ">;");

  verifyFormat("option (MyProto.options) = <\n"
               "  field_a: \"OK\"\n"
               "  msg_field: <\n"
               "    field_b: OK\n"
               "    field_c: OK\n"
               "    field_d: OK\n"
               "    field_e: OK\n"
               "    field_f: OK\n"
               "  >\n"
               "  field_g: OK\n"
               ">;");

  verifyFormat("option (MyProto.options) = <\n"
               "  field_a: \"OK\"\n"
               "  msg_field: {\n"
               "    field_b: OK\n"
               "    field_c: OK\n"
               "    field_d: OK\n"
               "    field_e: OK\n"
               "    field_f: OK\n"
               "  }\n"
               "  field_g: OK\n"
               ">;");

  verifyFormat("option (MyProto.options) = <\n"
               "  field_a: \"OK\"\n"
               "  msg_field {\n"
               "    field_b: OK\n"
               "    field_c: OK\n"
               "    field_d: OK\n"
               "    field_e: OK\n"
               "    field_f: OK\n"
               "  }\n"
               "  field_g: OK\n"
               ">;");

  verifyFormat("option (MyProto.options) = {\n"
               "  field_a: \"OK\"\n"
               "  msg_field <\n"
               "    field_b: OK\n"
               "    field_c: OK\n"
               "    field_d: OK\n"
               "    field_e: OK\n"
               "    field_f: OK\n"
               "  >\n"
               "  field_g: OK\n"
               "};");

  verifyFormat("option (MyProto.options) = {\n"
               "  field_a: \"OK\"\n"
               "  msg_field: <\n"
               "    field_b: OK\n"
               "    field_c: OK\n"
               "    field_d: OK\n"
               "    field_e: OK\n"
               "    field_f: OK\n"
               "  >\n"
               "  field_g: OK\n"
               "};");

  verifyFormat("option (MyProto.options) = <\n"
               "  field_a: \"OK\"\n"
               "  msg_field {\n"
               "    field_b: OK\n"
               "    field_c: OK\n"
               "    field_d: OK\n"
               "    msg_field <\n"
               "      field_A: 1\n"
               "      field_B: 2\n"
               "      field_C: 3\n"
               "      field_D: 4\n"
               "      field_E: 5\n"
               "    >\n"
               "    msg_field < field_A: 1 field_B: 2 field_C: 3 f_D: 4 >\n"
               "    field_e: OK\n"
               "    field_f: OK\n"
               "  }\n"
               "  field_g: OK\n"
               ">;");

  verifyFormat("option (MyProto.options) = <\n"
               "  data1 < key1: value1 >\n"
               "  data2 { key2: value2 }\n"
               ">;");

  verifyFormat("option (MyProto.options) = <\n"
               "  app_id: 'com.javax.swing.salsa.latino'\n"
               "  head_id: 1\n"
               "  data < key: value >\n"
               ">;");

  verifyFormat("option (MyProto.options) = {\n"
               "  app_id: 'com.javax.swing.salsa.latino'\n"
               "  head_id: 1\n"
               "  headheadheadheadheadhead_id: 1\n"
               "  product_data { product { 1 } }\n"
               "};");
}

TEST_F(FormatTestProto, FormatsService) {
  verifyFormat("service SearchService {\n"
               "  rpc Search(SearchRequest) returns (SearchResponse) {\n"
               "    option foo = true;\n"
               "  }\n"
               "};");
}

TEST_F(FormatTestProto, ExtendingMessage) {
  verifyFormat("extend .foo.Bar {}");
}

TEST_F(FormatTestProto, FormatsImports) {
  verifyFormat("import \"a.proto\";\n"
               "import \"b.proto\";\n"
               "// comment\n"
               "message A {}");

  verifyFormat("import public \"a.proto\";\n"
               "import \"b.proto\";\n"
               "// comment\n"
               "message A {}");

  // Missing semicolons should not confuse clang-format.
  verifyFormat("import \"a.proto\"\n"
               "import \"b.proto\"\n"
               "// comment\n"
               "message A {}");
}

TEST_F(FormatTestProto, KeepsLongStringLiteralsOnSameLine) {
  verifyFormat(
      "option (MyProto.options) = {\n"
      "  foo: {\n"
      "    text: \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasaaaaaaaa\"\n"
      "  }\n"
      "}");
}

TEST_F(FormatTestProto, FormatsOptionsExtensions) {
  verifyFormat("option (MyProto.options) = {\n"
               "  msg_field: { field_d: 123 }\n"
               "  [ext.t/u] { key: value }\n"
               "  key: value\n"
               "  [t.u/v] <\n"
               "    [ext] { key: value }\n"
               "  >\n"
               "};");
}

TEST_F(FormatTestProto, SpacesAroundPercents) {
  verifyFormat("option (MyProto.options) = {\n"
               "  key: %lld\n"
               "  key: 0x%04x\n"
               "  key: \"%d %d\"\n"
               "};");
}

TEST_F(FormatTestProto, FormatsRepeatedListInitializersInOptions) {
  verifyFormat("option (MyProto.options) = {\n"
               "  key: item\n"
               "  keys: [\n"
               "    'ala',\n"
               "    'bala',\n"
               "    'porto',\n"
               "    'kala',\n"
               "    'too',\n"
               "    'long',\n"
               "    'long',\n"
               "    'long'\n"
               "  ]\n"
               "  key: [ item ]\n"
               "  msg {\n"
               "    key: item\n"
               "    keys: [\n"
               "      'ala',\n"
               "      'bala',\n"
               "      'porto',\n"
               "      'kala',\n"
               "      'too',\n"
               "      'long',\n"
               "      'long'\n"
               "    ]\n"
               "  }\n"
               "  key: value\n"
               "};");
}

TEST_F(FormatTestProto, AcceptsOperatorAsKeyInOptions) {
  verifyFormat("option (MyProto.options) = {\n"
               "  bbbbbbbbb: <\n"
               "    ccccccccccccccccccccccc: <\n"
               "      operator: 1\n"
               "      operator: 2\n"
               "      operator: 3\n"
               "      operator { key: value }\n"
               "    >\n"
               "  >\n"
               "};");
}

TEST_F(FormatTestProto, BreaksEntriesOfSubmessagesContainingSubmessages) {
  FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
  Style.ColumnLimit = 60;
  // The column limit allows for the keys submessage to be put on 1 line, but we
  // break it since it contains a submessage an another entry.
  verifyFormat("option (MyProto.options) = {\n"
               "  key: valueeeeeeee\n"
               "  keys: {\n"
               "    item: 'aaaaaaaaaaaaaaaa'\n"
               "    sub <>\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  key: valueeeeeeee\n"
               "  keys: {\n"
               "    item: 'aaaaaaaaaaaaaaaa'\n"
               "    sub {}\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  key: valueeeeeeee\n"
               "  keys: {\n"
               "    sub {}\n"
               "    sub: <>\n"
               "    sub: []\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  key: valueeeeeeee\n"
               "  keys: {\n"
               "    item: 'aaaaaaaaaaa'\n"
               "    sub { msg: 1 }\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  key: valueeeeeeee\n"
               "  keys: {\n"
               "    item: 'aaaaaaaaaaa'\n"
               "    sub: { msg: 1 }\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  key: valueeeeeeee\n"
               "  keys: {\n"
               "    item: 'aaaaaaaaaaa'\n"
               "    sub < msg: 1 >\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  key: valueeeeeeee\n"
               "  keys: {\n"
               "    item: 'aaaaaaaaaaa'\n"
               "    sub: [ msg: 1 ]\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  key: valueeeeeeee\n"
               "  keys: <\n"
               "    item: 'aaaaaaaaaaa'\n"
               "    sub: [ 1, 2 ]\n"
               "  >\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  key: valueeeeeeee\n"
               "  keys: {\n"
               "    sub {}\n"
               "    item: 'aaaaaaaaaaaaaaaa'\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  key: valueeeeeeee\n"
               "  keys: {\n"
               "    sub: []\n"
               "    item: 'aaaaaaaaaaaaaaaa'\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  key: valueeeeeeee\n"
               "  keys: {\n"
               "    sub <>\n"
               "    item: 'aaaaaaaaaaaaaaaa'\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  key: valueeeeeeee\n"
               "  keys: {\n"
               "    sub { key: value }\n"
               "    item: 'aaaaaaaaaaaaaaaa'\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  key: valueeeeeeee\n"
               "  keys: {\n"
               "    sub: [ 1, 2 ]\n"
               "    item: 'aaaaaaaaaaaaaaaa'\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  key: valueeeeeeee\n"
               "  keys: {\n"
               "    sub < sub_2: {} >\n"
               "    item: 'aaaaaaaaaaaaaaaa'\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  key: valueeeeeeee\n"
               "  keys: {\n"
               "    item: data\n"
               "    sub: [ 1, 2 ]\n"
               "    item: 'aaaaaaaaaaaaaaaa'\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  key: valueeeeeeee\n"
               "  keys: {\n"
               "    item: data\n"
               "    sub < sub_2: {} >\n"
               "    item: 'aaaaaaaaaaaaaaaa'\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  sub: {\n"
               "    key: valueeeeeeee\n"
               "    keys: {\n"
               "      sub: [ 1, 2 ]\n"
               "      item: 'aaaaaaaaaaaaaaaa'\n"
               "    }\n"
               "  }\n"
               "}");
}

TEST_F(FormatTestProto, PreventBreaksBetweenKeyAndSubmessages) {
  verifyFormat("option (MyProto.options) = {\n"
               "  submessage: {\n"
               "    key: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  submessage {\n"
               "    key: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'\n"
               "  }\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  submessage: <\n"
               "    key: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'\n"
               "  >\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  submessage <\n"
               "    key: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'\n"
               "  >\n"
               "}");
  verifyFormat("option (MyProto.options) = {\n"
               "  repeatedd: [\n"
               "    'eyaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'\n"
               "  ]\n"
               "}");
}

} // end namespace tooling
} // end namespace clang

{'repo_name': 'microsoft/clang', 'stars': '166', 'repo_language': 'C++', 'file_name': '__init__.py', 'mime_type': 'text/plain', 'hash': -3555904382843622943, 'source_dataset': 'data'}


safer-buffer

Modern Buffer API polyfill without footguns

browserify --external tape tests.js > browserify-tests.js && tape browserify-tests.js

{'repo_name': 'awslabs/aws-api-gateway-developer-portal', 'stars': '599', 'repo_language': 'JavaScript', 'file_name': 'cfn-integration-test.js', 'mime_type': 'text/html', 'hash': -7416251938881621062, 'source_dataset': 'data'}


/******************************************************************************
* The MIT License
*
* 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.
*******************************************************************************/

using System;

namespace System.DirectoryServices
{
	[Flags]
	public enum ActiveDirectoryRights
	{
		Delete = 65536,
		ReadControl = 131072,
		WriteDacl = 262144,
		WriteOwner = 524288,
		Synchronize = 1048576,
		AccessSystemSecurity = 16777216,
		GenericRead = 131220,
		GenericWrite = 131112,
		GenericExecute = 131076,
		GenericAll = 983551,
		CreateChild = 1,
		DeleteChild = 2,
		ListChildren = 4,
		Self = 8,
		ReadProperty = 16,
		WriteProperty = 32,
		DeleteTree = 64,
		ListObject = 128,
		ExtendedRight = 256
	}
}

{'repo_name': 'roozbehid/WasmWinforms', 'stars': '421', 'repo_language': 'C#', 'file_name': 'ChangeLog', 'mime_type': 'text/plain', 'hash': 7701164060028666576, 'source_dataset': 'data'}