prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>rpcrawtransaction.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <boost/assign/... | }
const CScript& prevPubKey = mapPrevOut[txin.prevout]; |
<|file_name|>zz_generated_ssh_auth_controller.go<|end_file_name|><|fim▁begin|>package v3
import (
"context"
"time"
"github.com/rancher/norman/controller"
"github.com/rancher/norman/objectclient"
"github.com/rancher/norman/resource"
"github.com/rancher/rancher/pkg/apis/project.cattle.io/v3"
"k8s.io/apimachinery... | s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) |
<|file_name|>FileNameSource.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""Ingest workflow management tool
FileNameSource Class
"""
__copyright__ = "Copyright (C) 2016 University of Maryland"
__license__ = "GNU AFFERO GENERAL PUBLIC LICENSE, Version 3"
import abc
import os
import sys
import psycopg2<|fim▁hol... |
class FileNameSource: |
<|file_name|>my_mainwindow.py<|end_file_name|><|fim▁begin|>__author__ = 'PaleNeutron'
import os
from urllib.parse import urlparse, unquote
import sys
from PyQt5 import QtWidgets, QtCore, QtGui
class MyMainWindow(QtWidgets.QMainWindow):
file_loaded = QtCore.pyqtSignal(str)
image_loaded = QtCore.pyqt... |
def create_content_browser(self):
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2022 Google LLC
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// U... | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<|file_name|>intrusive_ptr.hpp<|end_file_name|><|fim▁begin|><|fim▁hole|>#ifndef BOOST_INTRUSIVE_PTR_HPP_INCLUDED
#define BOOST_INTRUSIVE_PTR_HPP_INCLUDED
//
// intrusive_ptr.hpp
//
// Copyright (c) 2001, 2002 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICE... | |
<|file_name|>bladeRF_source.cc<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2010, Joshua Lackey
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source cod... | m_decimation = 0; |
<|file_name|>conditionals.rs<|end_file_name|><|fim▁begin|>use shell::{status::*, Shell};
macro_rules! string_function {
($method:tt) => {
pub(crate) fn $method(args: &[&str], _: &mut Shell) -> i32 {
match args.len() {
0...2 => {
eprintln!("ion: {}: two argume... | };
}
string_function!(starts_with); |
<|file_name|>test_pp_psc_delta_stdp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# test_pp_psc_delta_stdp.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | nest.Simulate(Dt)
t.append(i * Dt)
w1.append(nest.GetStatus(conn1, keys=['weight'])[0][0]) |
<|file_name|>LPhoneSecurityProfile.java<|end_file_name|><|fim▁begin|>package com.cisco.axl.api._8;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for LPhone... | * {@link String }
*
*/
public String getProtocol() { |
<|file_name|>create.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::release_flow::{
hash_for_modules, load_artifact, save_release_artifact, verify::verify_payload_change,
ReleaseArtifact,
};
use anyhow::{bail, Result};
use diem_types:... | chain_id: ChainId,
// Public JSON-rpc endpoint URL.
// TODO: Get rid of this URL argument once we have a stable mapping from ChainId to its url.
url: String, |
<|file_name|>wamp_client.py<|end_file_name|><|fim▁begin|>import os
import sys
import asyncio
from pathlib import Path
import pendulum
sys.path.append(str(Path(__file__).absolute().parent.parent.parent))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
from django.core.wsgi import get_wsgi_applica... | |
<|file_name|>c_parser.py<|end_file_name|><|fim▁begin|>#------------------------------------------------------------------------------
# pycparser: c_parser.py
#
# CParser class: Parser and AST builder for the C language
#
# Copyright (C) 2008-2013, Eli Bendersky
# License: BSD
#-----------------------------------------... | """
# Empty block items (plain ';') produce [None], so ignore them
p[0] = p[1] if (len(p) == 2 or p[2] == [None]) else p[1] + p[2]
|
<|file_name|>opengl3graphics.hpp<|end_file_name|><|fim▁begin|>/* _______ __ __ __ ______ __ __ _______ __ __
* / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\
* / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / /
* / / /__ / / // / // / // / / / ___ ... | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
<|file_name|>servicemanagement_v1_generated_service_manager_create_service_sync.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# 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 co... | |
<|file_name|>container.go<|end_file_name|><|fim▁begin|>package container
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net"
"os"
"path/filepath"
"runtime"
"strconv"
"strings"
"sync"
"syscall"
"time"
"github.com/containerd/containerd/cio"
containertypes "github.com/docker/docker/api/types/container"
mou... | }
ipList = append(ipList, linkip)
|
<|file_name|>early-vtbl-resolution.rs<|end_file_name|><|fim▁begin|>// run-pass
#![allow(non_camel_case_types)]
#![allow(dead_code)]
// pretty-expanded FIXME #23616
<|fim▁hole|>trait thing<A> {
fn foo(&self) -> Option<A>;
}
impl<A> thing<A> for isize {
fn foo(&self) -> Option<A> { None }
}
fn foo_func<A, B: thi... | |
<|file_name|>PartitioningOperators.java<|end_file_name|><|fim▁begin|>/*
* PartitioningOperators.java Feb 3 2014, 03:44
*
* Copyright 2014 Drunken Dev.
*
* 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 ... | System.out.println("\nFirst 3 orders in WA:"); |
<|file_name|>inline.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![deny(unsafe_code)]
use app_units::Au;
use block::AbsoluteA... | minimum_depth_below_baseline: Au(0),
first_line_indentation: Au(0),
}; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Platform-specific extensions to `std` for Unix platforms.
//!
//! Provides access to platform-level information on Unix platforms, and
//! exposes Unix-specific functions that would otherwise be inappropriate as
//! part of the core `std` library.
//!
//! It exposes ... | |
<|file_name|>update_pnacl_tool_revisions.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright (c) 2013 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import collections
import datetime
import... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from tehbot.plugins import *
import tehbot.plugins as plugins
import wolframalpha
import prettytable
class WolframAlphaPlugin(StandardPlugin):
def __init__(self):
StandardPlugin.__init__(self)
self.parser.add_argument("query", nargs="+")
de... | misc.append("%s\n%s" % (p.title, self.format_table(p.text)))
|
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# test documentation build configuration file, created by
# sphinx-quickstart on Sun Jun 26 00:00:43 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values ... |
# The language for content autogenerated by Sphinx. Refer to documentation |
<|file_name|>syntax-extension-bytes-too-small-u8-literal.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE... | //~^ WARN `bytes!` is deprecated
} |
<|file_name|>http.go<|end_file_name|><|fim▁begin|>/*
Copyright 2013 Google Inc.
<|fim▁hole|>
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... | 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 |
<|file_name|>Realtime.cpp<|end_file_name|><|fim▁begin|>/*
The GTKWorkbook Project <http://gtkworkbook.sourceforge.net/>
Copyright (C) 2008, 2009 John Bellone, Jr. <jvb4@njit.edu>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License a... | else {
// STUB: Success. Do we want to do anything else here?
g_message ("Client connection opened on %s:%s on sheet %s", host_value, port_value, sheet->name);
} |
<|file_name|>wav.rs<|end_file_name|><|fim▁begin|>//! Audio IO from WAV files.
use byteorder::{self, ReadBytesExt, WriteBytesExt, LittleEndian};
use std::fs::File;
use std::io::{self, Read, Seek, SeekFrom, Write};
use std::path::Path;
use error::{Error, Result};
use types::{SAMPLE_RATE, AudioDevice, Time, Sample};
use... | .and_then(|()| w.write_u16::<LittleEndian>(self.bit_depth)) |
<|file_name|>eztext.py<|end_file_name|><|fim▁begin|># input lib
from pygame.locals import *
import pygame, string
class ConfigError(KeyError): pass
class Config:
""" A utility for configuration """
def __init__(self, options, *look_for):
assertions = []
for key in look_for:
... | elif event.key == K_b and 'B' in self.restricted: self.value += 'B'
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import datetime
from django.db import models, IntegrityError
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse as django_reverse
from django.utils.http import urlquote
from django.con... | def poster_sharing_url(self):
return self._social_sharing_url('p')
|
<|file_name|>generator.py<|end_file_name|><|fim▁begin|># Copyright 2012 SINA Corporation
# Copyright 2014 Cisco Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of ... | opt_type = None
try:
opt_type = OPTION_REGEX.search(str(type(opt))).group(0)
except (ValueError, AttributeError) as err: |
<|file_name|>SubscriptionLink.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2014 - 2016 Real Logic Ltd.
*
* 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/lic... | |
<|file_name|>data_set.py<|end_file_name|><|fim▁begin|># Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License
# as published by the Free Software Foundation, either ... | this_trait.location_repr = 'Chr%s: %.6f' % (this_trait.chr, float(this_trait.mb) )
this_trait.location_value = trait_location_value |
<|file_name|>variadic.js<|end_file_name|><|fim▁begin|>/**
* Generate a function that accepts a variable number of arguments as the last
* function argument.
*
* @param {Function} fn
* @return {Function}
*/
module.exports = function (fn) {
var count = Math.max(fn.length - 1, 0);
return function () {
var ... | var variadic = args[count] = [];
for (; index < arguments.length; index++) { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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 ... | **kw_params) |
<|file_name|>people_result.cc<|end_file_name|><|fim▁begin|>// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/app_list/search/people/people_result.h"
#include <vector>
#includ... | |
<|file_name|>reverse_complex1.rs<|end_file_name|><|fim▁begin|>fn main() {
if !(!(a && b && c) <caret>&& !d) {
<|fim▁hole|>}<|fim▁end|> | } |
<|file_name|>test_parse_jats.py<|end_file_name|><|fim▁begin|># coding=utf-8
import json
import os
import unittest
from collections import OrderedDict
from bs4 import BeautifulSoup
from ddt import ddt, data, unpack
from elifetools import parseJATS as parser
from elifetools import rawJATS as raw_parser
from elifetools.u... | def test_footnotes_json(self, xml_content, expected):
soup = parser.parse_xml(xml_content) |
<|file_name|>options.js<|end_file_name|><|fim▁begin|>// Saves options to chrome.storage
function save_options () {
var saveDict = []
var i = 1
$('input').map(function () {
var dict = {
id: 'scbcc' + i,
value: this.value
}
i++
console.log('save: ', dict)
ga('send', 'event', 'setting... | $(addto).after(newInput)
if (i !== 0) {
$(addRemove).after(removeButton) |
<|file_name|>Execute.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 restric... | _python_ = TestSCons._python_
test = TestSCons.TestSCons() |
<|file_name|>param_dict.py<|end_file_name|><|fim▁begin|>#!/user/bin/env python
"""
@package mi.dataset.param_dict
@file mi/dataset/param_dict.py
@author Emily Hahn
@brief Extend the protocol param dict to handle dataset encoding exceptions
"""
import re
from mi.core.instrument.protocol_param_dict import ProtocolParam... | """
Attempt to udpate a parameter value. By default, this assumes the input |
<|file_name|>controller.js<|end_file_name|><|fim▁begin|>/*
Copyright 2013 Northern Arizona University
This file is part of Sweet Jumps.
Sweet Jumps 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 ve... | * @param {express} app The global express app. Preferably mount a subapp or router for all of this controller's routes. |
<|file_name|>api_client.py<|end_file_name|><|fim▁begin|>import math
from service.fake_api_results import ALL_TITLES, OFFICIAL_COPY_RESULT, SELECTED_FULL_RESULTS
SEARCH_RESULTS_PER_PAGE = 20
def get_title(title_number):
return SELECTED_FULL_RESULTS.get(title_number)
<|fim▁hole|> number_pages = math.ceil(nof_re... |
def _get_titles(page_number):
nof_results = len(ALL_TITLES) |
<|file_name|>first_steps_1_simple_line.py<|end_file_name|><|fim▁begin|>from bokeh.plotting import figure, show
# prepare some data
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
# create a new plot with a title and axis labels
p = figure(title="Simple line example", x_axis_label="x", y_axis_label="y")
# add a line renderer... | p.line(x, y, legend_label="Temp.", line_width=2)
|
<|file_name|>cm_tooltip.js<|end_file_name|><|fim▁begin|>/**
* Attr: cmTooltip and cmTooltipContent
*/
myApp.directive('cmTooltip', function() {
return function (scope, iElement, iAttrs) {
console.log("appling cm tooltip");<|fim▁hole|> iElement.tooltip({
"animation": true... | var currentValue = "";
iAttrs.$observe('cmTooltipContent', function(value) {
if(value != currentValue && value != "") { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from bar import path<|fim▁end|> | |
<|file_name|>si_units.rs<|end_file_name|><|fim▁begin|>//! simple_units: a simple unit system for Rust
//!
//! Written by Willi Kappler, Version 0.1 (2017.02.22)
//!
//! Repository: https://github.com/willi-kappler/simple_units
//!
//! License: MIT
//!
use std::ops::Add;
use std::ops::Sub;
use std::ops::Mul;
use std::o... | init_unit_and_inverse!(DegCPerSecond, SecondPerDegC);
mul_div_unit!(DegCPerSecond, Second, DegC);
|
<|file_name|>logger.cpp<|end_file_name|><|fim▁begin|>//==============================================================================
// Brief : Logging Facilities
// Authors : Bruno Santos <bsantos@av.it.pt>
//------------------------------------------------------------------------------
// ODTONE - Open Dot Twenty ... | * format output.
*/ |
<|file_name|>test-stream-transform-constructor-set-methods.js<|end_file_name|><|fim▁begin|>'use strict';
var common = require('../common');
var assert = require('assert');
var Transform = require('stream').Transform;
var _transformCalled = false;
function _transform(d, e, n) {
_transformCalled = true;
n();
}
var... | transform: _transform,
flush: _flush
}); |
<|file_name|>co.test.runner.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
*/
define([
'jquery',
'underscore',
'co-test-utils',
'co-test-constants'
], function ($, _, cotu, cotc) {
var defaultTestSuiteConfig = {
class: '',
group... | viewTestConfig.viewId = ifNull(viewId, "");
viewTestConfig.testSuites = [];
if (testSuiteConfig != null) {
_.each(testSuiteConfig, function (suiteConfig) { |
<|file_name|>view.js<|end_file_name|><|fim▁begin|>/**
* View abstract class
*
* @author Mautilus s.r.o.
* @class View
* @abstract
* @mixins Events
* @mixins Deferrable
*/
function View() {
Events.call(this);
Deferrable.call(this);
this.construct.apply(this, arguments);
};
View.prototype.__proto__ = Events.... | };
/**
* @private |
<|file_name|>ue4_prereqs_stub.go<|end_file_name|><|fim▁begin|>// +build !windows<|fim▁hole|>
import "github.com/itchio/butler/endpoints/launch"
func handleUE4Prereqs(params launch.LauncherParams) error {
// nothing to worry about on non-windows platforms
return nil
}<|fim▁end|> |
package native |
<|file_name|>handlebars_partial_params.js<|end_file_name|><|fim▁begin|>// Inspired by an answer found at http://stackoverflow.com/questions/11523331/passing-variables-through-handlebars-partial
module.exports = function partialParams(partialName, options) {
if (!partialName) {
console.error('No partial nam... | console.error('Couldnt find the compiled partial: ' + partialName); |
<|file_name|>abilities.js<|end_file_name|><|fim▁begin|>exports.BattleAbilities = {
"cutecharm": {
inherit: true,
onAfterDamage: function(damage, target, source, move) {
if (move && move.isContact) {
if (this.random(3) < 1) {
source.addVolatile('attract', target);
}
}
}
},
"effectspore": {
... | } |
<|file_name|>fragment.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! The `Fragment` type, which represents the leaves of the ... | clear::left => Some(ClearLeft),
clear::right => Some(ClearRight), |
<|file_name|>run-test-sort-selection.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from algorithms.sorting.selection_sort import *
from __prototype__ import *
<|fim▁hole|>if __name__ == '__main__':
test_all(selection_sort)<|fim▁end|> | |
<|file_name|>style.hpp<|end_file_name|><|fim▁begin|>/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2006 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the t... | *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
<|file_name|>utils.js<|end_file_name|><|fim▁begin|>"use strict";
// copied from http://www.broofa.com/Tools/Math.uuid.js
var CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
exports.uuid = function () {
var chars = CHARS, uuid = new Array(36), rnd=0, r;
for (var i = 0; i < 3... | + pad(d.getUTCMonth()+1)+'-'
+ pad(d.getUTCDate())+'T'
+ pad(d.getUTCHours())+':' |
<|file_name|>matchers.qunit.js<|end_file_name|><|fim▁begin|>/*global QUnit, sinon */
sap.ui.define([
'sap/ui/test/Opa',
'sap/ui/test/Opa5',
"sap/m/Button",
"sap/m/Input",
"sap/ui/test/matchers/PropertyStrictEquals",
"sap/ui/test/matchers/Ancestor",
"sap/ui/test/matchers/Descendant",
"sap/ui/test/matchers/Matche... | var oSuccessSpy = this.spy();
|
<|file_name|>executor_unix.go<|end_file_name|><|fim▁begin|>//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
package executor
<|fim▁hole|>)
// configure new process group for child process
func (e *UniversalExecutor) setN... | import (
"fmt"
"os"
"syscall" |
<|file_name|>test-string-decoder.js<|end_file_name|><|fim▁begin|>// Copyright Joyent, Inc. and other Node contributors.
//
// 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 restricti... | let sequences;
if (!singleSequence) {
sequences = writeSequences(input.length); |
<|file_name|>SyntheticWheelEvent.js<|end_file_name|><|fim▁begin|>/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import SyntheticMouseEvent from './SyntheticMouseEvent';
/**
* ... | deltaY(event) { |
<|file_name|>njsPool.cpp<|end_file_name|><|fim▁begin|>/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. */
/******************************************************************************
*
* You may not use the identified files except in compliance with the Apache
* License, Version 2.... | // njsPool::GetPoolPingInterval() |
<|file_name|>consts.rs<|end_file_name|><|fim▁begin|>pub static PCRE_CASELESS: int = 0x00000001; // Compile
pub static PCRE_MULTILINE: int = 0x00000002; // Compile
pub static PCRE_DOTALL: int = 0x00000004; // Compile
pub static PCRE_EXTENDED: int = 0x00000008; // Compile
pub static P... | pub static PCRE_ERROR_BADOPTION: int = -3;
pub static PCRE_ERROR_BADMAGIC: int = -4;
pub static PCRE_ERROR_UNKNOWN_OPCODE: int = -5; |
<|file_name|>RenderBase.cpp<|end_file_name|><|fim▁begin|>// Copyright 2010 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
// ---------------------------------------------------------------------------------------------
// GC graphics pipeline
// ---------------------------... | void Renderer::CalculateTargetScale(int x, int y, int* scaledX, int* scaledY)
{ |
<|file_name|>seq2seq.py<|end_file_name|><|fim▁begin|># Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS fi... | for i in range(len(predictions)): |
<|file_name|>migration.py<|end_file_name|><|fim▁begin|>import logging
import time
import types
from autotest.client.shared import error
from virttest import utils_misc, utils_test, aexpect
def run(test, params, env):
"""
KVM migration test:
1) Get a live VM and clone it.
2) Verify that the source VM s... | vm.verify_alive()
session = vm.wait_for_login(timeout=login_timeout)
func = session.cmd_output |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#-*- coding:utf-8 -*-
# vim:ai:sta:et:ts=4:sw=4:sts=4
"""kernelng 0.x
Tool for maintaining customized overlays of kernel-ng.eclass-based ebuilds
Copyright 2005-2014 Gentoo Foundation
Copyright (C) 2014 Gregory M. Turner <gmt@be-evil.n... | # add the KNGConfigItem mapping the config. parameter to its default value |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|>class InvalidAPIUsage(Exception):<|fim▁hole|> Exception.__init__(self)
self.message = message
if status_code is not None:
self.status_code = status_code
self.payload = payload
def to_dict(self):
rv = dict(sel... | status_code = 400
def __init__(self, message, status_code=None, payload=None): |
<|file_name|>ConMapPersister.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2010 Yahoo! Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* ... | }
|
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/**
* @typedef {object} SalesAPI
* @property {Activities} Activities
**/
function SalesAPI(options) {
const _Activities = require('./Activities');
return {
Activities: new _Activities(options),
};
}
<|fim▁hole|><|fim▁end|> | module.exports = SalesAPI; |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use std::path::PathBuf;
<|fim▁hole|>error_chain!{
foreign_links {
Id3(::id3::Error);
Flac(::metaflac::Error);
Toml(::toml::de::Error);
Io(::std::io::Error) #[cfg(unix)];
Clap(::clap::Error);
}
errors {
PathExi... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod display;
pub mod device;
pub mod state;
pub mod termios;
mod err;
use std::os::unix::io::AsRawFd;
use std::io::{self, Write};
use std::mem;
use std::fmt;
use ::libc;
use ::child::exec;
use ::pty::prelude as pty;
use self::device::Device;
use self::termios::Ter... |
pub use super::parent::Parent;
/// The struct `Shell` is the speudo terminal interface. |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from datetime import datetime
from django.conf import settings
from... | notes = self.note_set.order_by('-sort_num')
if public_only:
notes = notes.filter(is_public=True) |
<|file_name|>testSQL.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Perform the following tests:
# 1. Generate a POT file from a set of marked SQL statements
# 2. Generate an SQL file from a translated PO file
import filecmp
import os
import subprocess
import testhelper
import unittest
class TestSQLFrame... | testhelper.mungepothead(self.testpot)
testhelper.mungepothead(self.canonpot)
self.assertEqual(filecmp.cmp(self.canonpot, self.testpot), 1) |
<|file_name|>vi.js<|end_file_name|><|fim▁begin|>/*
<|fim▁hole|> block: 'Canh đều',
center: 'Toggle Toolbars',
left: 'Canh trái',
right: 'Canh phải'
});<|fim▁end|> | Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'kitchensink', 'vi', {
|
<|file_name|>sns.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "sns")]
extern crate rusoto;
use rusoto::sns::{SnsClient, ListTopicsInput};
use rusoto::{DefaultCredentialsProvider, Region};
use rusoto::default_tls_client;<|fim▁hole|>#[test]
fn should_list_topics() {
let credentials = DefaultCredentialsProvider:... | |
<|file_name|>class-implement-traits.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://ww... | } |
<|file_name|>Config.js<|end_file_name|><|fim▁begin|>/**
* @author mrdoob / http://mrdoob.com/
*/
var Config = function () {
var namespace = 'threejs-inspector';
var storage = {
'selectionBoxEnabled': false,
'rafEnabled' : false,
'rafFps' : 30,
}
if ( window.localStorage[ namespace ] === undefined ) {
... | clear: function () {
delete window.localStorage[ namespace ]; |
<|file_name|>export_fragments.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from annotations.models import Corpus
from annotations.exports import export_fragments
from core.utils import CSV, XLSX
class Command(BaseCommand):
help = 'Expo... | |
<|file_name|>deriving-in-fn.rs<|end_file_name|><|fim▁begin|>// run-pass
#![allow(dead_code)]
pub fn main() {
#[derive(Debug)]
struct Foo {<|fim▁hole|>
let f = Foo { foo: 10 };
format!("{:?}", f);
}<|fim▁end|> | foo: isize,
} |
<|file_name|>memory.rs<|end_file_name|><|fim▁begin|>/*
Precached - A Linux process monitor and pre-caching daemon
Copyright (C) 2017-2020 the precached developers
This file is part of precached.
Precached is free software: you can redistribute it and/or modify
it under the terms of the GNU General... | // If we are on a 32 bit architecture
#[cfg(target_pointer_width = "32")]
let result = unsafe { |
<|file_name|>media.dev.js<|end_file_name|><|fim▁begin|>var findPosts;
(function($){
findPosts = {
open : function(af_name, af_val) {
var st = document.documentElement.scrollTop || $(document).scrollTop();
if ( af_name && af_val ) {
$('#affected').attr('name', af_name).val(af_val);
}
$('#fin... | }
var r = wpAjax.parseAjaxResponse(x);
|
<|file_name|>main.js<|end_file_name|><|fim▁begin|>ace.require("ace/ext/language_tools");
var editor = ace.edit("editor");
editor.setOptions({
enableBasicAutocompletion: true
});
editor.setTheme("ace/theme/eclipse");
editor.getSession().setMode("ace/mode/java");
document.getElementById('editor').style.fontSize = '... | // data: JSON.stringify(codeRunRequest),
// contentType: 'application/json'
// }).done(function (data) { |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var test = require("tape")
var add = require("../index.js")
<|fim▁hole|>
test("can add numbers", function (assert) {
assert.equal(add(3, 9), 12)
assert.end()
})<|fim▁end|> | test("add is a function", function (assert) {
assert.equal(typeof add, "function")
assert.end()
}) |
<|file_name|>book.py<|end_file_name|><|fim▁begin|># Copyright 2015 Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | |
<|file_name|>search.js<|end_file_name|><|fim▁begin|>/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy ... |
for (var i=0; i<matches.length; i++) { |
<|file_name|>configure.js<|end_file_name|><|fim▁begin|>import 'babel-polyfill';
import EdgeGrid from 'edgegrid';
import dotenv from 'dotenv';
import inquirer from 'inquirer';
import formatJson from 'format-json';
import fs from 'fs';
(async function() {
// load .env vars
dotenv.config();
let papiResponse... | name: 'outputToFile',
message: 'Output property ' + propertyName + ' v' + version + ' json to file now?', |
<|file_name|>most.ts<|end_file_name|><|fim▁begin|>import { Stream, switchLatest, map } from 'most';<|fim▁hole|>export function switchMap<A, B>(f: (a: A) => Stream<B>, stream: Stream<A>): Stream<B> {
return switchLatest(map(f, stream));
}<|fim▁end|> | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
from distutils.core import setup
setup(name='python-hivemindrpc',
version='0.1',
description='Enhanced version of python-jsonrpc for use with Hivemind',
long_description=open('README').read(),
author='Jeff Garzik',
... | maintainer_email='<jgarzik@exmulti.com>', |
<|file_name|>dns_domain.py<|end_file_name|><|fim▁begin|># Copyright (C) 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | '1.0': '1.0',
}
|
<|file_name|>terminal_info.py<|end_file_name|><|fim▁begin|>import wmi
import requests
import pythoncom
def get_iip():
""""""
f = requests.get("http://myip.dnsomatic.com")
iip = f.text
return iip
def get_lip():
""""""
c = wmi.WMI()
lip = ""
for interface in c.Win32_NetworkAdapterConf... | |
<|file_name|>qbittorrent_client.py<|end_file_name|><|fim▁begin|># Author: Mr_Orange <mr_orange@hotmail.it>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publishe... | return self._request(method='post', data=data) |
<|file_name|>cpg_gene.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
Purpose:
This script, using default values, determines and plots the CpG islands in
relation to a given feature "type" (e.g. "gene" or "mRNA") from a GFF file
which corresponds to the user-provided fasta file.
Note:
CpG Islands are dete... |
# Gather all possible CpG islands |
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 CERN.
##
## Invenio 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; e... | |
<|file_name|>BattleExperienceAI.py<|end_file_name|><|fim▁begin|>from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownBattleGlobals
from toontown.suit import SuitDNA
BattleExperienceAINotify = DirectNotifyGlobal.directNotify.newCategory('BattleExprienceAI')
def getSkillGained(toonSki... | def assignRewards(activeToons, toonSkillPtsGained, suitsKilled, zoneId, helpfulToons = None):
if helpfulToons == None: |
<|file_name|>Domicilio.js<|end_file_name|><|fim▁begin|>import React, { Component } from 'react';
import { PanResponder, StyleSheet, TextInput, ToastAndroid, View } from 'react-native';
import { Body, Button, Card, CardItem, Container, Content, Footer, FooterTab, Header, Icon, Left, Right, Text, Title } from 'native-bas... | this.state.quiz.domicilio = null;
FileStore.deleteDomicilio(this.state.admin.id);
}; |
<|file_name|>llviewerdisplayname.cpp<|end_file_name|><|fim▁begin|>/**
* @file llviewerdisplayname.cpp
* @brief Wrapper for display name functionality
*
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free softwa... | #include "llhttpclient.h" |
<|file_name|>AbstractActionGraphAndResolver.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2016-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://... | |
<|file_name|>responses.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import json
import xmltodict
from jinja2 import Template
from six import iteritems
from moto.core.responses import BaseResponse
from .models import redshift_backends
def convert_json_error_to_xml(json_error):
error ... | cluster["ClusterStatus"] = "creating" |
<|file_name|>Sketcher_pt-BR.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="pt-BR" sourcelanguage="en">
<context>
<name>CmdSketcherBSplineComb</name>
<message>
<location filename="../../CommandSketcherBSpline.cpp" line="162"/>
<sourc... | <message>
<location filename="../../SketcherSettings.ui" line="59"/>
<source>Special solver algorithm will be used while dragging sketch elements. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.