'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _boxBase = require('./boxBase');

var _boxBase2 = _interopRequireDefault(_boxBase);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = (0, _boxBase2.default)('padding');
module.exports = exports['default'];

{'repo_name': 'makuga01/dnsFookup', 'stars': '116', 'repo_language': 'JavaScript', 'file_name': 'main.py', 'mime_type': 'text/x-python', 'hash': -7917085130611025856, 'source_dataset': 'data'}


# Copyright (C) 2010-2013 Zentyal S.L.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation.
#
# 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

package ZentyalDesktop::SoftwareConfigurator;

use ZentyalDesktop::Util;
use ZentyalDesktop::LDAP;

sub configure
{
    my ($class, $server, $user) = @_;

    ZentyalDesktop::Util::createFirefoxProfile();

    my $ldap = new ZentyalDesktop::LDAP($server, $user);

    my $services = $ldap->servicesInfo();

    foreach my $service (keys %{$services}) {
        my $package = "ZentyalDesktop::Services::$service";
        eval "use $package";
        my $data = $services->{$service};
        $package->configure($server, $user, $data);
    }
}

1;

{'repo_name': 'zentyal/zentyal', 'stars': '361', 'repo_language': 'Perl', 'file_name': 'apache.conf', 'mime_type': 'text/plain', 'hash': 828320158415243233, 'source_dataset': 'data'}


// hrtimer.cpp - written and placed in the public domain by Wei Dai

#include "pch.h"
#include "hrtimer.h"
#include "misc.h"

#include <stddef.h>		// for NULL
#include <time.h>

#if defined(CRYPTOPP_WIN32_AVAILABLE)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
# if ((WINVER >= 0x0602 /*_WIN32_WINNT_WIN8*/) || (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/))
# include <processthreadsapi.h>
# if defined(WINAPI_FAMILY)
#  if (WINAPI_FAMILY_PARTITION(WINAPI_FAMILY_PHONE_APP))
#   include <profileapi.h>
#  endif
# endif
#endif
#endif

#if defined(CRYPTOPP_UNIX_AVAILABLE)
#include <sys/time.h>
#include <sys/times.h>
#include <unistd.h>
#endif

#include "trap.h"

NAMESPACE_BEGIN(CryptoPP)

#ifndef CRYPTOPP_IMPORTS

#if defined(CRYPTOPP_WIN32_AVAILABLE)
static TimerWord InitializePerformanceCounterFrequency()
{
	LARGE_INTEGER freq = {0,0};
	if (!QueryPerformanceFrequency(&freq))
		throw Exception(Exception::OTHER_ERROR, "Timer: QueryPerformanceFrequency failed with error " + IntToString(GetLastError()));
	return freq.QuadPart;
}

inline TimerWord PerformanceCounterFrequency()
{
	static const word64 freq = InitializePerformanceCounterFrequency();
	return freq;
}
#endif

double TimerBase::ConvertTo(TimerWord t, Unit unit)
{
	static unsigned long unitsPerSecondTable[] = {1, 1000, 1000*1000, 1000*1000*1000};

	// When 'unit' is an enum 'Unit', a Clang warning is generated.
	CRYPTOPP_ASSERT(static_cast<unsigned int>(unit) < COUNTOF(unitsPerSecondTable));
	return static_cast<double>(t) * unitsPerSecondTable[unit] / TicksPerSecond();
}

void TimerBase::StartTimer()
{
	m_last = m_start = GetCurrentTimerValue();
	m_started = true;
}

double TimerBase::ElapsedTimeAsDouble()
{
	if (m_stuckAtZero)
		return 0;

	if (m_started)
	{
		TimerWord now = GetCurrentTimerValue();
		if (m_last < now)	// protect against OS bugs where time goes backwards
			m_last = now;
		return ConvertTo(m_last - m_start, m_timerUnit);
	}

	StartTimer();
	return 0;
}

unsigned long TimerBase::ElapsedTime()
{
	double elapsed = ElapsedTimeAsDouble();
	CRYPTOPP_ASSERT(elapsed <= (double)ULONG_MAX);
	return (unsigned long)elapsed;
}

TimerWord Timer::GetCurrentTimerValue()
{
#if defined(CRYPTOPP_WIN32_AVAILABLE)
	// Use the first union member to avoid an uninitialized warning
	LARGE_INTEGER now = {0,0};
	if (!QueryPerformanceCounter(&now))
		throw Exception(Exception::OTHER_ERROR, "Timer: QueryPerformanceCounter failed with error " + IntToString(GetLastError()));
	return now.QuadPart;
#elif defined(CRYPTOPP_UNIX_AVAILABLE)
	timeval now;
	gettimeofday(&now, NULL);
	return (TimerWord)now.tv_sec * 1000000 + now.tv_usec;
#else
	// clock_t now;
	return clock();
#endif
}

TimerWord Timer::TicksPerSecond()
{
#if defined(CRYPTOPP_WIN32_AVAILABLE)
	return PerformanceCounterFrequency();
#elif defined(CRYPTOPP_UNIX_AVAILABLE)
	return 1000000;
#else
	return CLOCKS_PER_SEC;
#endif
}

#endif	// #ifndef CRYPTOPP_IMPORTS

TimerWord ThreadUserTimer::GetCurrentTimerValue()
{
#if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(THREAD_TIMER_AVAILABLE)
	static bool getCurrentThreadImplemented = true;
	if (getCurrentThreadImplemented)
	{
		FILETIME now, ignored;
		if (!GetThreadTimes(GetCurrentThread(), &ignored, &ignored, &ignored, &now))
		{
			const DWORD lastError = GetLastError();
			if (lastError == ERROR_CALL_NOT_IMPLEMENTED)
			{
				getCurrentThreadImplemented = false;
				goto GetCurrentThreadNotImplemented;
			}
			throw Exception(Exception::OTHER_ERROR, "ThreadUserTimer: GetThreadTimes failed with error " + IntToString(lastError));
		}
		return now.dwLowDateTime + ((TimerWord)now.dwHighDateTime << 32);
	}
GetCurrentThreadNotImplemented:
	return (TimerWord)clock() * (10*1000*1000 / CLOCKS_PER_SEC);
#elif defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(THREAD_TIMER_AVAILABLE)
	LARGE_INTEGER now;
	if (!QueryPerformanceCounter(&now))
	{
		const DWORD lastError = GetLastError();
		throw Exception(Exception::OTHER_ERROR, "ThreadUserTimer: QueryPerformanceCounter failed with error " + IntToString(lastError));
	}
	return now.QuadPart;
#elif defined(CRYPTOPP_UNIX_AVAILABLE)
	tms now;
	times(&now);
	return now.tms_utime;
#else
	return clock();
#endif
}

TimerWord ThreadUserTimer::TicksPerSecond()
{
#if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(THREAD_TIMER_AVAILABLE)
	return 10*1000*1000;
#elif defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(THREAD_TIMER_AVAILABLE)
	static const TimerWord ticksPerSecond = PerformanceCounterFrequency();
	return ticksPerSecond;
#elif defined(CRYPTOPP_UNIX_AVAILABLE)
	static const long ticksPerSecond = sysconf(_SC_CLK_TCK);
	return ticksPerSecond;
#else
	return CLOCKS_PER_SEC;
#endif
}

NAMESPACE_END

{'repo_name': 'bitcoinx-project/bitcoinx', 'stars': '108', 'repo_language': 'C++', 'file_name': 'Makefile.am', 'mime_type': 'text/plain', 'hash': 2781077153999966948, 'source_dataset': 'data'}


#!/usr/bin/env python3

# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ***** END GPL LICENSE BLOCK *****

# <pep8 compliant>

import project_source_info
import subprocess
import sys
import os

USE_QUIET = (os.environ.get("QUIET", None) is not None)

CHECKER_IGNORE_PREFIX = [
    "extern",
    "intern/moto",
]

CHECKER_BIN = "python2"

CHECKER_ARGS = [
    os.path.join(os.path.dirname(__file__), "clang_array_check.py"),
    # not sure why this is needed, but it is.
    "-I" + os.path.join(project_source_info.SOURCE_DIR, "extern", "glew", "include"),
    # stupid but needed
    "-Dbool=char"
]

def main():
    source_info = project_source_info.build_info(ignore_prefix_list=CHECKER_IGNORE_PREFIX)

    check_commands = []
    for c, inc_dirs, defs in source_info:

        #~if "source/blender" not in c:
        #~    continue

        cmd = ([CHECKER_BIN] +
               CHECKER_ARGS +
               [c] +
               [("-I%s" % i) for i in inc_dirs] +
               [("-D%s" % d) for d in defs]
               )

        check_commands.append((c, cmd))

    process_functions = []

    def my_process(i, c, cmd):
        if not USE_QUIET:
            percent = 100.0 * (i / (len(check_commands) - 1))
            percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"

            sys.stdout.flush()
            sys.stdout.write("%s %s\n" % (percent_str, c))

        return subprocess.Popen(cmd)

    for i, (c, cmd) in enumerate(check_commands):
        process_functions.append((my_process, (i, c, cmd)))

    project_source_info.queue_processes(process_functions)

if __name__ == "__main__":
    main()

{'repo_name': 'mgschwan/blensor', 'stars': '108', 'repo_language': 'C', 'file_name': 'license.txt', 'mime_type': 'text/plain', 'hash': -6592139853313812724, 'source_dataset': 'data'}


% File src/library/utils/man/help.request.Rd
% Part of the R package, https://www.R-project.org
% Copyright 2008-2015 R Core Team
% Distributed under GPL 2 or later

\name{help.request}
\alias{help.request}
\title{Send a Post to R-help}
\description{
  Prompts the user to check they have done all that is expected of them
  before sending a post to the R-help mailing list, provides a template
  for the post with session information included and optionally sends
  the email (on Unix systems).
}
\usage{
help.request(subject = "",
             address = "r-help@R-project.org",
             file = "R.help.request", \dots)
}
\arguments{
  \item{subject}{subject of the email.  Please do not use single quotes
    (\kbd{'}) in the subject!  Post separate help requests for multiple
    queries.}
  \item{address}{recipient's email address.}
  \item{file}{filename to use (if needed) for setting up the email.}
  \item{\dots}{additional named arguments such as \code{method} and
    \code{ccaddress} to pass to \code{\link{create.post}}.}
}
\details{
  This function is not intended to replace the posting
  guide.  Please read the guide before posting to R-help or using this
  function (see \url{https://www.r-project.org/posting-guide.html}).

  The \code{help.request} function:
  \itemize{
    \item asks whether the user has consulted relevant resources,
      stopping and opening the relevant URL if a negative response if
      given.
    \item checks whether the current version of \R is being used and
      whether the add-on packages are up-to-date, giving the option of
      updating where necessary.
    \item asks whether the user has prepared appropriate (minimal,
      reproducible, self-contained, commented) example code ready to
      paste into the post.
  }
  Once this checklist has been completed a template post is prepared
  including current session information, and passed to
  \code{\link{create.post}}.
}
\value{
  Nothing useful.
}
\seealso{The posting guide (\url{https://www.r-project.org/posting-guide.html}),
  also \code{\link{sessionInfo}()} from which you may add to the help request.

  \code{\link{create.post}}.
}
\author{Heather Turner, based on the then current code and help page of
  \code{\link{bug.report}()}.}
\keyword{utilities}
\keyword{error}

{'repo_name': 'wch/r-source', 'stars': '733', 'repo_language': 'R', 'file_name': 'immbnd.md', 'mime_type': 'text/plain', 'hash': -5448792538410762150, 'source_dataset': 'data'}


const React = require('react');
const FocusTrap = require('focus-trap-react');
const displace = require('react-displace');
const noScroll = require('no-scroll');

class Modal extends React.Component {
  static defaultProps = {
    underlayProps: {},
    dialogId: 'react-aria-modal-dialog',
    underlayClickExits: true,
    escapeExits: true,
    underlayColor: 'rgba(0,0,0,0.5)',
    includeDefaultStyles: true,
    focusTrapPaused: false,
    scrollDisabled: true
  };

  componentWillMount() {
    if (!this.props.titleText && !this.props.titleId) {
      throw new Error(
        'react-aria-modal instances should have a `titleText` or `titleId`'
      );
    }
  }

  componentDidMount() {
    if (this.props.onEnter) {
      this.props.onEnter();
    }

    // Timeout to ensure this happens *after* focus has moved
    const applicationNode = this.getApplicationNode();
    setTimeout(() => {
      if (applicationNode) {
        applicationNode.setAttribute('aria-hidden', 'true');
      }
    }, 0);

    if (this.props.escapeExits) {
      this.addKeyDownListener();
    }

    if (this.props.scrollDisabled) {
      noScroll.on();
    }
  }

  componentDidUpdate(prevProps) {
    if (prevProps.scrollDisabled && !this.props.scrollDisabled) {
      noScroll.off();
    } else if (!prevProps.scrollDisabled && this.props.scrollDisabled) {
      noScroll.on();
    }

    if (this.props.escapeExits && !prevProps.escapeExits) {
      this.addKeyDownListener();
    } else if (!this.props.escapeExits && prevProps.escapeExits) {
      this.removeKeyDownListener();
    }
  }

  componentWillUnmount() {
    if (this.props.scrollDisabled) {
      noScroll.off();
    }
    const applicationNode = this.getApplicationNode();
    if (applicationNode) {
      applicationNode.setAttribute('aria-hidden', 'false');
    }
    this.removeKeyDownListener();
  }

  addKeyDownListener() {
    setTimeout(() => {
      document.addEventListener('keydown', this.checkDocumentKeyDown);
    });
  }

  removeKeyDownListener() {
    setTimeout(() => {
      document.removeEventListener('keydown', this.checkDocumentKeyDown);
    });
  }

  getApplicationNode = () => {
    if (this.props.getApplicationNode) return this.props.getApplicationNode();
    return this.props.applicationNode;
  };

  checkUnderlayClick = event => {
    if (
      (this.dialogNode && this.dialogNode.contains(event.target)) ||
      // If the click is on the scrollbar we don't want to close the modal.
      event.pageX > event.target.ownerDocument.documentElement.offsetWidth ||
      event.pageY > event.target.ownerDocument.documentElement.offsetHeight
    )
      return;
    this.exit(event);
  };

  checkDocumentKeyDown = event => {
    if (
      this.props.escapeExits &&
      (event.key === 'Escape' || event.key === 'Esc' || event.keyCode === 27)
    ) {
      this.exit(event);
    }
  };

  exit = event => {
    if (this.props.onExit) {
      this.props.onExit(event);
    }
  };

  render() {
    const props = this.props;

    let style = {};
    if (props.includeDefaultStyles) {
      style = {
        position: 'fixed',
        top: 0,
        left: 0,
        width: '100%',
        height: '100%',
        zIndex: 1050,
        overflowX: 'hidden',
        overflowY: 'auto',
        WebkitOverflowScrolling: 'touch',
        textAlign: 'center'
      };

      if (props.underlayColor) {
        style.background = props.underlayColor;
      }

      if (props.underlayClickExits) {
        style.cursor = 'pointer';
      }
    }

    if (props.underlayStyle) {
      for (const key in props.underlayStyle) {
        if (!props.underlayStyle.hasOwnProperty(key)) continue;
        style[key] = props.underlayStyle[key];
      }
    }

    const underlayProps = {
      className: props.underlayClass,
      style: style
    };

    if (props.underlayClickExits) {
      underlayProps.onMouseDown = this.checkUnderlayClick;
    }

    for (const prop in this.props.underlayProps) {
      underlayProps[prop] = this.props.underlayProps[prop];
    }

    let verticalCenterStyle = {};
    if (props.includeDefaultStyles) {
      verticalCenterStyle = {
        display: 'inline-block',
        height: '100%',
        verticalAlign: 'middle'
      };
    }

    const verticalCenterHelperProps = {
      key: 'a',
      style: verticalCenterStyle
    };

    let dialogStyle = {};
    if (props.includeDefaultStyles) {
      dialogStyle = {
        display: 'inline-block',
        textAlign: 'left',
        top: 0,
        maxWidth: '100%',
        cursor: 'default',
        outline: props.focusDialog ? 0 : null
      };

      if (props.verticallyCenter) {
        dialogStyle.verticalAlign = 'middle';
        dialogStyle.top = 0;
      }
    }

    if (props.dialogStyle) {
      for (const key in props.dialogStyle) {
        if (!props.dialogStyle.hasOwnProperty(key)) continue;
        dialogStyle[key] = props.dialogStyle[key];
      }
    }

    const dialogProps = {
      key: 'b',
      ref: function(el) {
        this.dialogNode = el;
      }.bind(this),
      role: props.alert ? 'alertdialog' : 'dialog',
      id: props.dialogId,
      className: props.dialogClass,
      style: dialogStyle
    };
    if (props.titleId) {
      dialogProps['aria-labelledby'] = props.titleId;
    } else if (props.titleText) {
      dialogProps['aria-label'] = props.titleText;
    }
    if (props.focusDialog) {
      dialogProps.tabIndex = '-1';
    }

    // Apply data- and aria- attributes passed as props
    for (let key in props) {
      if (/^(data-|aria-)/.test(key)) {
        dialogProps[key] = props[key];
      }
    }

    const childrenArray = [
      React.createElement('div', dialogProps, props.children)
    ];

    if (props.verticallyCenter) {
      childrenArray.unshift(
        React.createElement('div', verticalCenterHelperProps)
      );
    }

    const focusTrapOptions = props.focusTrapOptions || {};
    if (props.focusDialog || props.initialFocus) {
      focusTrapOptions.initialFocus = props.focusDialog
        ? `#${this.props.dialogId}`
        : props.initialFocus;
    }
    focusTrapOptions.escapeDeactivates = props.escapeExits;

    return React.createElement(
      FocusTrap,
      {
        focusTrapOptions,
        paused: props.focusTrapPaused
      },
      React.createElement('div', underlayProps, childrenArray)
    );
  }
}

const DisplacedModal = displace(Modal);

DisplacedModal.renderTo = function(input) {
  return displace(Modal, { renderTo: input });
};

module.exports = DisplacedModal;

{'repo_name': 'davidtheclark/react-aria-modal', 'stars': '749', 'repo_language': 'JavaScript', 'file_name': 'isomorphadorphic.js', 'mime_type': 'text/plain', 'hash': -3124021758293542069, 'source_dataset': 'data'}


/*
 * JasperReports - Free Java Reporting Library.
 * Copyright (C) 2001 - 2019 TIBCO Software Inc. All rights reserved.
 * http://www.jaspersoft.com
 *
 * Unless you have purchased a commercial license agreement from Jaspersoft,
 * the following license terms apply:
 *
 * This program is part of JasperReports.
 *
 * JasperReports is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * JasperReports 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with JasperReports. If not, see <http://www.gnu.org/licenses/>.
 */
package net.sf.jasperreports.crosstabs.base;

import java.io.Serializable;

import net.sf.jasperreports.crosstabs.JRCellContents;
import net.sf.jasperreports.crosstabs.JRCrosstabCell;
import net.sf.jasperreports.engine.JRConstants;
import net.sf.jasperreports.engine.JRRuntimeException;
import net.sf.jasperreports.engine.base.JRBaseObjectFactory;
import net.sf.jasperreports.engine.util.JRCloneUtils;

/**
 * Base read-only implementation of {@link net.sf.jasperreports.crosstabs.JRCrosstabCell JRCrosstabCell}.
 *
 * @author Lucian Chirita (lucianc@users.sourceforge.net)
 */
public class JRBaseCrosstabCell implements JRCrosstabCell, Serializable
{
	private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;

	protected Integer width;
	protected Integer height;
	protected String rowTotalGroup;
	protected String columnTotalGroup;
	protected JRCellContents contents;

	protected JRBaseCrosstabCell()
	{
	}

	public JRBaseCrosstabCell(JRCrosstabCell crosstabCell, JRBaseObjectFactory factory)
	{
		factory.put(crosstabCell, this);

		width = crosstabCell.getWidth();
		height = crosstabCell.getHeight();

		rowTotalGroup = crosstabCell.getRowTotalGroup();
		columnTotalGroup = crosstabCell.getColumnTotalGroup();

		contents = factory.getCell(crosstabCell.getContents());
	}

	@Override
	public String getRowTotalGroup()
	{
		return rowTotalGroup;
	}

	@Override
	public String getColumnTotalGroup()
	{
		return columnTotalGroup;
	}

	@Override
	public JRCellContents getContents()
	{
		return contents;
	}

	@Override
	public Integer getHeight()
	{
		return height;
	}

	@Override
	public Integer getWidth()
	{
		return width;
	}

	@Override
	public Object clone()
	{
		JRBaseCrosstabCell clone = null;

		try
		{
			clone = (JRBaseCrosstabCell)super.clone();
		}
		catch (CloneNotSupportedException e)
		{
			throw new JRRuntimeException(e);
		}

		clone.contents = JRCloneUtils.nullSafeClone(contents);

		return clone;
	}
}

{'repo_name': 'TIBCOSoftware/jasperreports', 'stars': '458', 'repo_language': 'Java', 'file_name': 'org.eclipse.jdt.core.prefs', 'mime_type': 'text/plain', 'hash': -5899085074775138955, 'source_dataset': 'data'}


//
// basic_signal_set.cpp
// ~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)

// Test that header file is self-contained.
#include "asio/basic_signal_set.hpp"

#include "unit_test.hpp"

ASIO_TEST_SUITE
(
  "basic_signal_set",
  ASIO_TEST_CASE(null_test)
)

{'repo_name': 'resiprocate/resiprocate', 'stars': '333', 'repo_language': 'C++', 'file_name': 'TestClient_14_0.vcxproj', 'mime_type': 'text/xml', 'hash': 5416804598135473148, 'source_dataset': 'data'}


// rule: skip on arch=genx32
// rule: skip on arch=genx64

export void f_f(uniform float RET[], uniform float aFOO[]) {
    uniform float * uniform buf = uniform new uniform float[32l*32l];
    for (uniform int i = 0; i < 32l*32l; ++i)
        buf[i] = i;

    #pragma ignore warning(perf)
    float a = buf[4*programIndex];
    #pragma ignore warning(perf)
    float b = buf[4*programIndex+1];
    #pragma ignore warning(perf)
    float c = buf[4*programIndex+2];
    #pragma ignore warning(perf)
    float d = buf[4*programIndex+3];

    RET[programIndex] = a+b+c+d;;
}

export void result(uniform float RET[]) {
    RET[programIndex] = 4 * programIndex + 4 * programIndex + 1 +
        4 * programIndex + 2 + 4 * programIndex + 3;
}

{'repo_name': 'ispc/ispc', 'stars': '1599', 'repo_language': 'C++', 'file_name': 'FixWindowsPath.cmake', 'mime_type': 'text/plain', 'hash': 3659931229497578146, 'source_dataset': 'data'}


{'repo_name': 'apple/swift-3-api-guidelines-review', 'stars': '449', 'repo_language': 'Swift', 'file_name': 'CFBag.swift', 'mime_type': 'text/x-c++', 'hash': 2066181741196912424, 'source_dataset': 'data'}


<?php
/**
 * System messages translation for CodeIgniter(tm)
 *
 * @author	CodeIgniter community
 * @author	Kim Chanthoeun
 * @copyright	Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
 * @license	http://opensource.org/licenses/MIT	MIT License
 * @link	http://codeigniter.com
 */
defined('BASEPATH') OR exit('No direct script access allowed');

$lang['pagination_first_link'] = '‹ ដំបូង';
$lang['pagination_next_link'] = '>';
$lang['pagination_prev_link'] = '<';
$lang['pagination_last_link'] = 'ចុងក្រោយ ›';

{'repo_name': 'jiji262/codeigniter_boilerplate', 'stars': '123', 'repo_language': 'JavaScript', 'file_name': 'latest.sql', 'mime_type': 'text/plain', 'hash': -6688052367456877593, 'source_dataset': 'data'}


/*
 * searchtools.js
 * ~~~~~~~~~~~~~~~~
 *
 * Sphinx JavaScript utilities for the full-text search.
 *
 * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
 * :license: BSD, see LICENSE for details.
 *
 */

if (!Scorer) {
  /**
   * Simple result scoring code.
   */
  var Scorer = {
    // Implement the following function to further tweak the score for each result
    // The function takes a result array [filename, title, anchor, descr, score]
    // and returns the new score.
    /*
    score: function(result) {
      return result[4];
    },
    */

    // query matches the full name of an object
    objNameMatch: 11,
    // or matches in the last dotted part of the object name
    objPartialMatch: 6,
    // Additive scores depending on the priority of the object
    objPrio: {0:  15,   // used to be importantResults
              1:  5,   // used to be objectResults
              2: -5},  // used to be unimportantResults
    //  Used when the priority is not in the mapping.
    objPrioDefault: 0,

    // query found in title
    title: 15,
    // query found in terms
    term: 5
  };
}

if (!splitQuery) {
  function splitQuery(query) {
    return query.split(/\s+/);
  }
}

/**
 * Search Module
 */
var Search = {

  _index : null,
  _queued_query : null,
  _pulse_status : -1,

  init : function() {
      var params = $.getQueryParameters();
      if (params.q) {
          var query = params.q[0];
          $('input[name="q"]')[0].value = query;
          this.performSearch(query);
      }
  },

  loadIndex : function(url) {
    $.ajax({type: "GET", url: url, data: null,
            dataType: "script", cache: true,
            complete: function(jqxhr, textstatus) {
              if (textstatus != "success") {
                document.getElementById("searchindexloader").src = url;
              }
            }});
  },

  setIndex : function(index) {
    var q;
    this._index = index;
    if ((q = this._queued_query) !== null) {
      this._queued_query = null;
      Search.query(q);
    }
  },

  hasIndex : function() {
      return this._index !== null;
  },

  deferQuery : function(query) {
      this._queued_query = query;
  },

  stopPulse : function() {
      this._pulse_status = 0;
  },

  startPulse : function() {
    if (this._pulse_status >= 0)
        return;
    function pulse() {
      var i;
      Search._pulse_status = (Search._pulse_status + 1) % 4;
      var dotString = '';
      for (i = 0; i < Search._pulse_status; i++)
        dotString += '.';
      Search.dots.text(dotString);
      if (Search._pulse_status > -1)
        window.setTimeout(pulse, 500);
    }
    pulse();
  },

  /**
   * perform a search for something (or wait until index is loaded)
   */
  performSearch : function(query) {
    // create the required interface elements
    this.out = $('#search-results');
    this.title = $('
' + _('Searching') + '
').appendTo(this.out);
    this.dots = $('').appendTo(this.title);
    this.status = $('

').appendTo(this.out);
    this.output = $('
').appendTo(this.out);

    $('#search-progress').text(_('Preparing search...'));
    this.startPulse();

    // index already loaded, the browser was quick!
    if (this.hasIndex())
      this.query(query);
    else
      this.deferQuery(query);
  },

  /**
   * execute search (requires search index to be loaded)
   */
  query : function(query) {
    var i;

    // stem the searchterms and add them to the correct list
    var stemmer = new Stemmer();
    var searchterms = [];
    var excluded = [];
    var hlterms = [];
    var tmp = splitQuery(query);
    var objectterms = [];
    for (i = 0; i < tmp.length; i++) {
      if (tmp[i] !== "") {
          objectterms.push(tmp[i].toLowerCase());
      }

      if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) ||
          tmp[i] === "") {
        // skip this "word"
        continue;
      }
      // stem the word
      var word = stemmer.stemWord(tmp[i].toLowerCase());
      // prevent stemmer from cutting word smaller than two chars
      if(word.length < 3 && tmp[i].length >= 3) {
        word = tmp[i];
      }
      var toAppend;
      // select the correct list
      if (word[0] == '-') {
        toAppend = excluded;
        word = word.substr(1);
      }
      else {
        toAppend = searchterms;
        hlterms.push(tmp[i].toLowerCase());
      }
      // only add if not already in the list
      if (!$u.contains(toAppend, word))
        toAppend.push(word);
    }
    var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));

    // console.debug('SEARCH: searching for:');
    // console.info('required: ', searchterms);
    // console.info('excluded: ', excluded);

    // prepare search
    var terms = this._index.terms;
    var titleterms = this._index.titleterms;

    // array of [filename, title, anchor, descr, score]
    var results = [];
    $('#search-progress').empty();

    // lookup as object
    for (i = 0; i < objectterms.length; i++) {
      var others = [].concat(objectterms.slice(0, i),
                             objectterms.slice(i+1, objectterms.length));
      results = results.concat(this.performObjectSearch(objectterms[i], others));
    }

    // lookup as search terms in fulltext
    results = results.concat(this.performTermsSearch(searchterms, excluded, terms, titleterms));

    // let the scorer override scores with a custom scoring function
    if (Scorer.score) {
      for (i = 0; i < results.length; i++)
        results[i][4] = Scorer.score(results[i]);
    }

    // now sort the results by score (in opposite order of appearance, since the
    // display function below uses pop() to retrieve items) and then
    // alphabetically
    results.sort(function(a, b) {
      var left = a[4];
      var right = b[4];
      if (left > right) {
        return 1;
      } else if (left < right) {
        return -1;
      } else {
        // same score: sort alphabetically
        left = a[1].toLowerCase();
        right = b[1].toLowerCase();
        return (left > right) ? -1 : ((left < right) ? 1 : 0);
      }
    });

    // for debugging
    //Search.lastresults = results.slice();  // a copy
    //console.info('search results:', Search.lastresults);

    // print the results
    var resultCount = results.length;
    function displayNextItem() {
      // results left, load the summary and display it
      if (results.length) {
        var item = results.pop();
        var listItem = $('

');
        if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') {
          // dirhtml builder
          var dirname = item[0] + '/';
          if (dirname.match(/\/index\/$/)) {
            dirname = dirname.substring(0, dirname.length-6);
          } else if (dirname == 'index/') {
            dirname = '';
          }
          listItem.append($('').attr('href',
            DOCUMENTATION_OPTIONS.URL_ROOT + dirname +
            highlightstring + item[2]).html(item[1]));
        } else {
          // normal html builders
          listItem.append($('').attr('href',
            item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
            highlightstring + item[2]).html(item[1]));
        }
        if (item[3]) {
          listItem.append($(' (' + item[3] + ')'));
          Search.output.append(listItem);
          listItem.slideDown(5, function() {
            displayNextItem();
          });
        } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
          var suffix = DOCUMENTATION_OPTIONS.SOURCELINK_SUFFIX;
          if (suffix === undefined) {
            suffix = '.txt';
          }
          $.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + 'sources/' + item[5] + (item[5].slice(-suffix.length) === suffix ? '' : suffix),
                  dataType: "text",
                  complete: function(jqxhr, textstatus) {
                    var data = jqxhr.responseText;
                    if (data !== '' && data !== undefined) {
                      listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
                    }
                    Search.output.append(listItem);
                    listItem.slideDown(5, function() {
                      displayNextItem();
                    });
                  }});
        } else {
          // no source available, just display title
          Search.output.append(listItem);
          listItem.slideDown(5, function() {
            displayNextItem();
          });
        }
      }
      // search finished, update title and status message
      else {
        Search.stopPulse();
        Search.title.text(_('Search Results'));
        if (!resultCount)
          Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.'));
        else
            Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount));
        Search.status.fadeIn(500);
      }
    }
    displayNextItem();
  },

  /**
   * search for object names
   */
  performObjectSearch : function(object, otherterms) {
    var filenames = this._index.filenames;
    var docnames = this._index.docnames;
    var objects = this._index.objects;
    var objnames = this._index.objnames;
    var titles = this._index.titles;

    var i;
    var results = [];

    for (var prefix in objects) {
      for (var name in objects[prefix]) {
        var fullname = (prefix ? prefix + '.' : '') + name;
        if (fullname.toLowerCase().indexOf(object) > -1) {
          var score = 0;
          var parts = fullname.split('.');
          // check for different match types: exact matches of full name or
          // "last name" (i.e. last dotted part)
          if (fullname == object || parts[parts.length - 1] == object) {
            score += Scorer.objNameMatch;
          // matches in last name
          } else if (parts[parts.length - 1].indexOf(object) > -1) {
            score += Scorer.objPartialMatch;
          }
          var match = objects[prefix][name];
          var objname = objnames[match[1]][2];
          var title = titles[match[0]];
          // If more than one term searched for, we require other words to be
          // found in the name/title/description
          if (otherterms.length > 0) {
            var haystack = (prefix + ' ' + name + ' ' +
                            objname + ' ' + title).toLowerCase();
            var allfound = true;
            for (i = 0; i < otherterms.length; i++) {
              if (haystack.indexOf(otherterms[i]) == -1) {
                allfound = false;
                break;
              }
            }
            if (!allfound) {
              continue;
            }
          }
          var descr = objname + _(', in ') + title;

          var anchor = match[3];
          if (anchor === '')
            anchor = fullname;
          else if (anchor == '-')
            anchor = objnames[match[1]][1] + '-' + fullname;
          // add custom score for some objects according to scorer
          if (Scorer.objPrio.hasOwnProperty(match[2])) {
            score += Scorer.objPrio[match[2]];
          } else {
            score += Scorer.objPrioDefault;
          }
          results.push([docnames[match[0]], fullname, '#'+anchor, descr, score, filenames[match[0]]]);
        }
      }
    }

    return results;
  },

  /**
   * search for full-text terms in the index
   */
  performTermsSearch : function(searchterms, excluded, terms, titleterms) {
    var docnames = this._index.docnames;
    var filenames = this._index.filenames;
    var titles = this._index.titles;

    var i, j, file;
    var fileMap = {};
    var scoreMap = {};
    var results = [];

    // perform the search on the required terms
    for (i = 0; i < searchterms.length; i++) {
      var word = searchterms[i];
      var files = [];
      var _o = [
        {files: terms[word], score: Scorer.term},
        {files: titleterms[word], score: Scorer.title}
      ];

      // no match but word was a required one
      if ($u.every(_o, function(o){return o.files === undefined;})) {
        break;
      }
      // found search word in contents
      $u.each(_o, function(o) {
        var _files = o.files;
        if (_files === undefined)
          return

        if (_files.length === undefined)
          _files = [_files];
        files = files.concat(_files);

        // set score for the word in each file to Scorer.term
        for (j = 0; j < _files.length; j++) {
          file = _files[j];
          if (!(file in scoreMap))
            scoreMap[file] = {}
          scoreMap[file][word] = o.score;
        }
      });

      // create the mapping
      for (j = 0; j < files.length; j++) {
        file = files[j];
        if (file in fileMap)
          fileMap[file].push(word);
        else
          fileMap[file] = [word];
      }
    }

    // now check if the files don't contain excluded terms
    for (file in fileMap) {
      var valid = true;

      // check if all requirements are matched
      if (fileMap[file].length != searchterms.length)
          continue;

      // ensure that none of the excluded terms is in the search result
      for (i = 0; i < excluded.length; i++) {
        if (terms[excluded[i]] == file ||
            titleterms[excluded[i]] == file ||
            $u.contains(terms[excluded[i]] || [], file) ||
            $u.contains(titleterms[excluded[i]] || [], file)) {
          valid = false;
          break;
        }
      }

      // if we have still a valid result we can add it to the result list
      if (valid) {
        // select one (max) score for the file.
        // for better ranking, we should calculate ranking by using words statistics like basic tf-idf...
        var score = $u.max($u.map(fileMap[file], function(w){return scoreMap[file][w]}));
        results.push([docnames[file], titles[file], '', null, score, filenames[file]]);
      }
    }
    return results;
  },

  /**
   * helper function to return a node containing the
   * search summary for a given text. keywords is a list
   * of stemmed words, hlwords is the list of normal, unstemmed
   * words. the first one is used to find the occurrence, the
   * latter for highlighting it.
   */
  makeSearchSummary : function(text, keywords, hlwords) {
    var textLower = text.toLowerCase();
    var start = 0;
    $.each(keywords, function() {
      var i = textLower.indexOf(this.toLowerCase());
      if (i > -1)
        start = i;
    });
    start = Math.max(start - 120, 0);
    var excerpt = ((start > 0) ? '...' : '') +
      $.trim(text.substr(start, 240)) +
      ((start + 240 - text.length) ? '...' : '');
    var rv = $('

').text(excerpt);
    $.each(hlwords, function() {
      rv = rv.highlightText(this, 'highlighted');
    });
    return rv;
  }
};

$(document).ready(function() {
  Search.init();
});

{'repo_name': 'improbable-research/keanu', 'stars': '146', 'repo_language': 'Java', 'file_name': 'Vizer.java', 'mime_type': 'text/x-java', 'hash': -9180784810047072717, 'source_dataset': 'data'}


package com.ctrip.xpipe.retry;

import com.ctrip.xpipe.api.retry.RetryTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author wenchao.meng
 *
 * Jul 9, 2016
 */
public abstract class AbstractRetryTemplate<V> implements RetryTemplate<V>{

	protected Logger logger = LoggerFactory.getLogger(getClass());

}

{'repo_name': 'ctripcorp/x-pipe', 'stars': '1164', 'repo_language': 'Java', 'file_name': 'design.md', 'mime_type': 'text/plain', 'hash': 6096649173113297508, 'source_dataset': 'data'}


// Author: Kun Ren (kun@cs.yale.edu)
// Author: Alexander Thomson (thomson@cs.yale.edu)

#include "common/connection.h"

#include <cstdio>
#include <iostream>

#include "common/configuration.h"
#include "common/utils.h"
#include "sequencer/sequencer.h"

using zmq::socket_t;

ConnectionMultiplexer::ConnectionMultiplexer(Configuration* config)
    : configuration_(config), context_(1), new_connection_channel_(NULL),
      delete_connection_channel_(NULL), deconstructor_invoked_(false) {
  // Lookup port. (Pick semi-arbitrary port if node id < 0).
  if (config->this_node_id < 0)
    port_ = config->all_nodes.begin()->second->port;
  else
    port_ = config->all_nodes.find(config->this_node_id)->second->port;

  // Bind local (inproc) incoming socket.
  inproc_in_ = new socket_t(context_, ZMQ_PULL);
  inproc_in_->bind("inproc://__inproc_in_endpoint__");

  // Bind port for remote incoming socket.
  char endpoint[256];
  snprintf(endpoint, sizeof(endpoint), "tcp://*:%d", port_);
  remote_in_ = new socket_t(context_, ZMQ_PULL);
  remote_in_->bind(endpoint);

  // Wait for other nodes to bind sockets before connecting to them.
  Spin(0.1);

  send_mutex_ = new pthread_mutex_t[(int)config->all_nodes.size()];

  // Connect to remote outgoing sockets.
  for (map<int, Node*>::const_iterator it = config->all_nodes.begin();
       it != config->all_nodes.end(); ++it) {
    if (it->second->node_id != config->this_node_id) {  // Only remote nodes.
      snprintf(endpoint, sizeof(endpoint), "tcp://%s:%d",
               it->second->host.c_str(), it->second->port);
      remote_out_[it->second->node_id] = new socket_t(context_, ZMQ_PUSH);
      remote_out_[it->second->node_id]->connect(endpoint);
      pthread_mutex_init(&send_mutex_[it->second->node_id], NULL);
    }
  }

cpu_set_t cpuset;
pthread_attr_t attr;
pthread_attr_init(&attr);
//pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);

CPU_ZERO(&cpuset);
CPU_SET(3, &cpuset);
//CPU_SET(4, &cpuset);
//CPU_SET(5, &cpuset);
//CPU_SET(6, &cpuset);
//CPU_SET(7, &cpuset);
pthread_attr_setaffinity_np(&attr, sizeof(cpu_set_t), &cpuset);

  // Start Multiplexer main loop running in background thread.
  pthread_create(&thread_, &attr, RunMultiplexer, reinterpret_cast<void*>(this));

  // Initialize mutex for future calls to NewConnection.
  pthread_mutex_init(&new_connection_mutex_, NULL);
  new_connection_channel_ = NULL;

  // Just to be safe, wait a bit longer for all other nodes to finish
  // multiplexer initialization before returning to the caller, who may start
  // sending messages immediately.
  Spin(0.1);
}

ConnectionMultiplexer::~ConnectionMultiplexer() {
  // Stop the multixplexer's main loop.
  deconstructor_invoked_ = true;
  pthread_join(thread_, NULL);

  // Close tcp sockets.
  delete remote_in_;
  for (unordered_map<int, zmq::socket_t*>::iterator it = remote_out_.begin();
       it != remote_out_.end(); ++it) {
    delete it->second;
  }

  // Close inproc sockets.
  delete inproc_in_;
  for (unordered_map<string, zmq::socket_t*>::iterator it = inproc_out_.begin();
       it != inproc_out_.end(); ++it) {
    delete it->second;
  }

  for (unordered_map<string, AtomicQueue<MessageProto>*>::iterator it = remote_result_.begin();
       it != remote_result_.end(); ++it) {
    delete it->second;
  }

  for (unordered_map<string, AtomicQueue<MessageProto>*>::iterator it = link_unlink_queue_.begin();
       it != link_unlink_queue_.end(); ++it) {
    delete it->second;
  }

}

Connection* ConnectionMultiplexer::NewConnection(const string& channel) {
  // Disallow concurrent calls to NewConnection/~Connection.
  pthread_mutex_lock(&new_connection_mutex_);

  // Register the new connection request.
  new_connection_channel_ = &channel;

  // Wait for the Run() loop to create the Connection object. (It will reset
  // new_connection_channel_ to NULL when the new connection has been created.
  while (new_connection_channel_ != NULL) {}

  Connection* connection = new_connection_;
  new_connection_ = NULL;

  // Allow future calls to NewConnection/~Connection.
  pthread_mutex_unlock(&new_connection_mutex_);

  return connection;
}

Connection* ConnectionMultiplexer::NewConnection(const string& channel, AtomicQueue<MessageProto>** aa) {
  // Disallow concurrent calls to NewConnection/~Connection.
  pthread_mutex_lock(&new_connection_mutex_);

    remote_result_[channel] = *aa;
  // Register the new connection request.
  new_connection_channel_ = &channel;
  // Wait for the Run() loop to create the Connection object. (It will reset
  // new_connection_channel_ to NULL when the new connection has been created.
  while (new_connection_channel_ != NULL) {}
  Connection* connection = new_connection_;
  new_connection_ = NULL;

  // Allow future calls to NewConnection/~Connection.
  pthread_mutex_unlock(&new_connection_mutex_);
  return connection;
}

void ConnectionMultiplexer::Run() {
  MessageProto message;
  zmq::message_t msg;

  while (!deconstructor_invoked_) {
    // Serve any pending NewConnection request.
    if (new_connection_channel_ != NULL) {
      if (inproc_out_.count(*new_connection_channel_) > 0) {
        // Channel name already in use. Report an error and set new_connection_
        // (which NewConnection() will return) to NULL.
        std::cerr << "Attempt to create channel that already exists: "
                  << (*new_connection_channel_) << "\n" << std::flush;
        new_connection_ = NULL;
      } else {
        // Channel name is not already in use. Create a new Connection object
        // and connect it to this multiplexer.
        new_connection_ = new Connection();
        new_connection_->channel_ = *new_connection_channel_;
        new_connection_->multiplexer_ = this;
        char endpoint[256];
        snprintf(endpoint, sizeof(endpoint), "inproc://%s",
                 new_connection_channel_->c_str());
        inproc_out_[*new_connection_channel_] =
            new socket_t(context_, ZMQ_PUSH);
        inproc_out_[*new_connection_channel_]->bind(endpoint);
        new_connection_->socket_in_ = new socket_t(context_, ZMQ_PULL);
        new_connection_->socket_in_->connect(endpoint);
        new_connection_->socket_out_ = new socket_t(context_, ZMQ_PUSH);
        new_connection_->socket_out_
            ->connect("inproc://__inproc_in_endpoint__");

          // Forward on any messages sent to this channel before it existed.
        vector<MessageProto>::iterator i;
        for (i = undelivered_messages_[*new_connection_channel_].begin();
             i != undelivered_messages_[*new_connection_channel_].end(); ++i) {
          Send(*i);
        }
        undelivered_messages_.erase(*new_connection_channel_);
      }

      if (new_connection_channel_->substr(0, 6) == "worker") {
        link_unlink_queue_[*new_connection_channel_] = new AtomicQueue<MessageProto>();
      }
      // Reset request variable.
      new_connection_channel_ = NULL;
    }

    // Serve any pending (valid) connection deletion request.
    if (delete_connection_channel_ != NULL &&
        inproc_out_.count(*delete_connection_channel_) > 0) {
      delete inproc_out_[*delete_connection_channel_];
      inproc_out_.erase(*delete_connection_channel_);
      delete_connection_channel_ = NULL;
      // TODO(alex): Should we also be emptying deleted channels of messages
      // and storing them in 'undelivered_messages_' in case the channel is
      // reopened/relinked? Probably.
    }

    // Forward next message from a remote node (if any).
    if (remote_in_->recv(&msg, ZMQ_NOBLOCK)) {
      message.ParseFromArray(msg.data(), msg.size());
      Send(message);
    }

    // Forward next message from a local component (if any), intercepting
    // local Link/UnlinkChannel requests.
    if (inproc_in_->recv(&msg, ZMQ_NOBLOCK)) {
      message.ParseFromArray(msg.data(), msg.size());
        // Normal message. Forward appropriately.
        Send(message);
    }

   for (unordered_map<string, AtomicQueue<MessageProto>*>::iterator it = link_unlink_queue_.begin();
        it != link_unlink_queue_.end(); ++it) {
     MessageProto message;
     bool got_it = it->second->Pop(&message);
     if (got_it == true) {
       if (message.type() == MessageProto::LINK_CHANNEL) {
         remote_result_[message.channel_request()] = remote_result_[it->first];
         // Forward on any messages sent to this channel before it existed.
         vector<MessageProto>::iterator i;
         for (i = undelivered_messages_[message.channel_request()].begin();
              i != undelivered_messages_[message.channel_request()].end();
              ++i) {
           Send(*i);
         }
         undelivered_messages_.erase(message.channel_request());
         if (doing_deadlocks.count(message.channel_request()) > 0) {
           MessageProto message1;
           message1.set_type(MessageProto::TXN_ABORT);
           message1.set_destination_channel(message.channel_request());
           message1.set_destination_node(configuration_->this_node_id);
           Send(message1);
         }
       } else if (message.type() == MessageProto::UNLINK_CHANNEL) {
         remote_result_.erase(message.channel_request());
       }
     }
   }

  }
}

// Function to call multiplexer->Run() in a new pthread.
void* ConnectionMultiplexer::RunMultiplexer(void *multiplexer) {
  reinterpret_cast<ConnectionMultiplexer*>(multiplexer)->Run();
  return NULL;
}

void ConnectionMultiplexer::Send(const MessageProto& message) {
  if ((message.destination_node() == configuration_->this_node_id) && (message.type() == MessageProto::TXN_ABORT)) {
    if (undelivered_messages_.count(message.destination_channel()) > 0) {
      undelivered_messages_.erase(message.destination_channel());
      remote_result_["force_abort_unactive_txn"]->Push(message);
      doing_deadlocks[message.destination_channel()] = 1;
    } else {
      if (remote_result_.count(message.destination_channel()) == 0) {
        remote_result_["force_abort_unactive_txn"]->Push(message);
        doing_deadlocks[message.destination_channel()] = 1;
      } else {
        remote_result_[message.destination_channel()]->Push(message);
      }
    }
    return ;
  }

  if ((message.destination_node() == configuration_->this_node_id) && (message.type() == MessageProto::READ_RESULT || message.type() == MessageProto::PREPARED ||
      message.type() == MessageProto::PREPARED_REPLY || message.type() == MessageProto::COMMIT ||
      message.type() == MessageProto::COMMIT_REPLY || message.type() == MessageProto::WAIT_FOR_GRAPH)) {
    if (remote_result_.count(message.destination_channel()) > 0) {
      remote_result_[message.destination_channel()]->Push(message);
    } else {
      undelivered_messages_[message.destination_channel()].push_back(message);
    }
  } else {
    // Prepare message.
    string* message_string = new string();
    message.SerializeToString(message_string);
    zmq::message_t msg(reinterpret_cast<void*>(
                       const_cast<char*>(message_string->data())),
                       message_string->size(),
                       DeleteString,
                       message_string);

    // Send message.
    if (message.destination_node() == configuration_->this_node_id) {
      // Message is addressed to a local channel. If channel is valid, send the
      // message on, else store it to be delivered if the channel is ever created.
        if (inproc_out_.count(message.destination_channel()) > 0)
          inproc_out_[message.destination_channel()]->send(msg);
        else
          undelivered_messages_[message.destination_channel()].push_back(message);

    } else {
      // Message is addressed to valid remote node. Channel validity will be
      // checked by the remote multiplexer.
      pthread_mutex_lock(&send_mutex_[message.destination_node()]);
      remote_out_[message.destination_node()]->send(msg);
      pthread_mutex_unlock(&send_mutex_[message.destination_node()]);
    }
  }
}

Connection::~Connection() {
  // Unlink any linked channels.
  for (set<string>::iterator it = linked_channels_.begin();
       it != linked_channels_.end(); ++it) {
    UnlinkChannel(*it);
  }

  // Disallow concurrent calls to NewConnection/~Connection.
  pthread_mutex_lock(&(multiplexer_->new_connection_mutex_));

  // Delete socket on Connection end.
  delete socket_in_;
  delete socket_out_;

  // Prompt multiplexer to delete socket on its end.
  multiplexer_->delete_connection_channel_ = &channel_;

  // Wait for the Run() loop to delete its socket for this Connection object.
  // (It will then reset delete_connection_channel_ to NULL.)
  while (multiplexer_->delete_connection_channel_ != NULL) {}

  // Allow future calls to NewConnection/~Connection.
  pthread_mutex_unlock(&(multiplexer_->new_connection_mutex_));
}

void Connection::Send(const MessageProto& message) {
  // Prepare message.
  string* message_string = new string();
  message.SerializeToString(message_string);
  zmq::message_t msg(reinterpret_cast<void*>(
                       const_cast<char*>(message_string->data())),
                     message_string->size(),
                     DeleteString,
                     message_string);
  // Send message.
  socket_out_->send(msg);
}

void Connection::Send1(const MessageProto& message) {
  // Prepare message.
  string* message_string = new string();
  message.SerializeToString(message_string);
  zmq::message_t msg(reinterpret_cast<void*>(
                       const_cast<char*>(message_string->data())),
                     message_string->size(),
                     DeleteString,
                     message_string);
  pthread_mutex_lock(&multiplexer()->send_mutex_[message.destination_node()]);
  multiplexer()->remote_out_[message.destination_node()]->send(msg);
  pthread_mutex_unlock(&multiplexer()->send_mutex_[message.destination_node()]);
}

bool Connection::GetMessage(MessageProto* message) {
  zmq::message_t msg_;
  if (socket_in_->recv(&msg_, ZMQ_NOBLOCK)) {
    // Received a message.
    message->ParseFromArray(msg_.data(), msg_.size());
    return true;
  } else {
    // No message received at this time.
    return false;
  }
}

bool Connection::GetMessageBlocking(MessageProto* message,
                                    double max_wait_time) {
  double start = GetTime();
  do {
    if (GetMessage(message)) {
      // Received a message.
      return true;
    }
  } while (GetTime() < start + max_wait_time);

  // Waited for max_wait_time, but no message was received.
  return false;
}

void Connection::LinkChannel(const string& channel) {
  MessageProto m;
  m.set_type(MessageProto::LINK_CHANNEL);
  m.set_channel_request(channel);
  multiplexer()->link_unlink_queue_[channel_]->Push(m);
}

void Connection::UnlinkChannel(const string& channel) {
  MessageProto m;
  m.set_type(MessageProto::UNLINK_CHANNEL);
  m.set_channel_request(channel);
  multiplexer()->link_unlink_queue_[channel_]->Push(m);
}

{'repo_name': 'yaledb/calvin', 'stars': '218', 'repo_language': 'C++', 'file_name': 'tpcc_args.proto', 'mime_type': 'text/plain', 'hash': 3162445834005867129, 'source_dataset': 'data'}


contract A {
    uint[] x;
    function f() public view returns (uint) {
        return x.push();
    }
}
// ----
// TypeError 8961: (88-96): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.

{'repo_name': 'ethereum/solidity', 'stars': '8066', 'repo_language': 'C++', 'file_name': 'libsolc.cpp', 'mime_type': 'text/x-c++', 'hash': 763672940154773931, 'source_dataset': 'data'}


{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "loki.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "loki.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "loki.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create the name of the service account
*/}}
{{- define "loki.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
    {{ default (include "loki.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
    {{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}

{{/*
Create the app name of loki clients. Defaults to the same logic as "loki.fullname", and default client expects "promtail".
*/}}
{{- define "client.name" -}}
{{- if .Values.client.name -}}
{{- .Values.client.name -}}
{{- else if .Values.client.fullnameOverride -}}
{{- .Values.client.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default "promtail" .Values.client.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{'repo_name': 'scality/metalk8s', 'stars': '173', 'repo_language': 'SaltStack', 'file_name': 'main.go', 'mime_type': 'text/x-c', 'hash': 3168560389010991266, 'source_dataset': 'data'}