prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>filemap.py<|end_file_name|><|fim▁begin|># Copyright 2012 Lee Verberne <lee@blarg.org>
#
# 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 3 of the License, or
# (at you... | |
<|file_name|>SABRCMSSpreadNoExtrapolationYCNSFunction.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2012 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.financial.analytics.model.sabrcube;
import static com.opengamma.engine.... | @Override
protected PresentValueNodeSensitivityCalculator getNodeSensitivityCalculator(final ValueRequirement desiredValue) {
return NSC; |
<|file_name|>build.js<|end_file_name|><|fim▁begin|>process.env.NODE_ENV = 'production'
var ora = require('ora')
var rm = require('rimraf')
var path = require('path')
var chalk = require('chalk')
var webpack = require('webpack')
var config = require('../config')
var webpackConfig = require('./webpack.prod.conf')
var s... | }) + '\n\n') |
<|file_name|>model_json.go<|end_file_name|><|fim▁begin|>// generated by jwg -output misc/fixture/j/model_json.go misc/fixture/j; DO NOT EDIT
package j
import (
"encoding/json"
)
// FooJSON is jsonized struct for Foo.
type FooJSON struct {
Tmp *Temp `json:"tmp,omitempty"`
Bar `json:",omitempty"`
*Buzz... | |
<|file_name|>pacman.rs<|end_file_name|><|fim▁begin|>use std::env;
use std::ffi::OsString;
use std::fs;
use std::os::unix::fs::symlink;
use std::path::Path;
use std::process::{Command, Stdio};
use std::time::Duration;
use crossbeam_channel::Sender;
use regex::Regex;
use serde_derive::Deserialize;
use crate::blocks::{B... | |
<|file_name|>runtest.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://www.apache.org/li... | } = procsrv::run(lib_path,
&prog,
aux_path,
&args, |
<|file_name|>vn_char.py<|end_file_name|><|fim▁begin|>import lxml.html as l
import requests
def key_char_parse(char_id):
url = 'https://vndb.org/c' + str(char_id)
page = requests.get(url)
root = l.fromstring(page.text)
name = root.cssselect('.mainbox h1')[0].text
kanji_name = root.cssselect('.main... | key = row[0][0].text
except IndexError:
key = row[0].text |
<|file_name|>jsxmin_renaming.cpp<|end_file_name|><|fim▁begin|>#include "jsxmin_renaming.h"
#include <assert.h>
#include <stdio.h>
#include <iostream>
// Varaible renaming of JS files.
// This file includes three renaming strategies:
// 1. local variable renaming;
// 2. global variable renaming in the current file... | bool Scope::declared(string name) {
if (_replacement.find(name) != _replacement.end()) { |
<|file_name|>http.py<|end_file_name|><|fim▁begin|># encoding: utf-8
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#... | |
<|file_name|>regions-close-over-type-parameter-multiple.rs<|end_file_name|><|fim▁begin|>// Copyright 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 ... | } |
<|file_name|>proguard.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# 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.
import optparse
import os
import sys
from util import build_utils
from util im... | default='', |
<|file_name|>CollisionCheckStack.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU ... | |
<|file_name|>most_calls.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import collections
import os
import sys
<|fim▁hole|>from librarytrader.librarystore import LibraryStore
s = LibraryStore()
s.load(sys.argv[1])
n = 20
if len(sys.argv) > 2:
n = int(sys.argv[2])
outgoing_calls = set()
incoming_calls = ... | |
<|file_name|>factorssvr.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"net/http"
"log"
"strconv"
"github.com/stvndall/languagetechstats/src/go/services/factors"
"github.com/gorilla/mux"
)
func main(){
router := mux.NewRouter().StrictSlash(true)
router.HandleFunc("/{numbers}", factorise)
log.Fata... | func factorise(w http.ResponseWriter, r *http.Request) {
number, err := strconv.Atoi(mux.Vars(r)["numbers"]) |
<|file_name|>staticfiles.js<|end_file_name|><|fim▁begin|>var Path = require('path');
var Hapi = require('hapi');
var server = new Hapi.Server();
var port = process.env.PORT || 5000;<|fim▁hole|>server.views({
engines: {
html: require('handlebars')
},
path: Path.join(__dirname, 'views')
});
serve... |
server.connection({ port: port });
|
<|file_name|>structdpctl__params.js<|end_file_name|><|fim▁begin|>var structdpctl__params =<|fim▁hole|> [ "aux", "structdpctl__params.html#a875761aaf475439ac2f51f564f8a558d", null ],
[ "is_appctl", "structdpctl__params.html#a4d1857bb1afb99d03f1586a81c415b17", null ],
[ "may_create", "structdpctl__params.html#... | [ |
<|file_name|>bless.rs<|end_file_name|><|fim▁begin|>//! `bless` updates the reference files in the repo with changed output files
//! from the last test run.
use std::ffi::OsStr;
use std::fs;
use std::lazy::SyncLazy;
use std::path::{Path, PathBuf};
use walkdir::WalkDir;
use crate::clippy_project_root;
static CLIPPY_B... | if reference_file.is_empty() { |
<|file_name|>node_addr.py<|end_file_name|><|fim▁begin|>import squeakspace.common.util as ut
import squeakspace.common.util_http as ht
import squeakspace.proxy.server.db_sqlite3 as db
import squeakspace.common.squeak_ex as ex
import config
def post_handler(environ):
query = ht.parse_post_request(environ)
cooki... |
finally: |
<|file_name|>test_func_transmit.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
##
## Copyright 2008, Various
## Adrian Likins <alikins@redhat.com>
##
## This software may be freely redistributed under the terms of the GNU
## general public license.<|fim▁hole|>##
import os
import socket
import subprocess
import ti... | |
<|file_name|>mp4.rs<|end_file_name|><|fim▁begin|>#![no_main]
use libfuzzer_sys::fuzz_target;
use mp4parse_capi::*;
use std::convert::TryInto;
use std::io::Read;
type CursorType<'a> = std::io::Cursor<&'a [u8]>;
extern "C" fn vec_read(buf: *mut u8, size: usize, userdata: *mut std::os::raw::c_void) -> isize {
let i... | let io = Mp4parseIo { |
<|file_name|>callback_utils.py<|end_file_name|><|fim▁begin|>__all__ = [
'fixed_value',
'coalesce',
]
try:
from itertools import ifilter as filter
except ImportError:
pass
class _FixedValue(object):
def __init__(self, value):
self._value = value
def __call__(self, *args, **kwargs):
... | |
<|file_name|>test_layers.py<|end_file_name|><|fim▁begin|>import unittest
import numpy as np
import theano
import theano.tensor as T
from tests.helpers import (SimpleTrainer, SimpleClf, SimpleTransformer,
simple_reg)
from theano_wrapper.layers import (BaseLayer, HiddenLayer, MultiLayerBase,
... | except Exception as e: |
<|file_name|>GCodeListDecorator.py<|end_file_name|><|fim▁begin|>from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
class GCodeListDecorator(SceneNodeDecorator):
def __init__(self):
super().__init__()
self._gcode_list = []
def getGCodeList(self):<|fim▁hole|> return self._gcode_l... | |
<|file_name|>watch_zeromq.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright (c) 2017 DevicePilot Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, ... | |
<|file_name|>PathProperty.ts<|end_file_name|><|fim▁begin|>import { Path, PathUtil } from 'app/model/paths';
import { Property } from './Property';
export class PathProperty extends Property<Path> {
// @Override
setEditableValue(model: any, propertyName: string, value: string) {
let path: Path;
try {
... | return end;
}
return PathUtil.interpolate(start, end, fraction); |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
use protoc_grpcio;
use std::path::{Path, PathBuf};
use build_utils::BuildRoot;
use std::collections::HashSet;
fn main() {
let buil... | }
dirs_needing_mod_rs.remove(&dst);
dst = dst.join("mod.rs"); |
<|file_name|>oncer_test.go<|end_file_name|><|fim▁begin|>package sync
import (
"testing"
"time"
. "github.com/franela/goblin"
)
<|fim▁hole|> g := Goblin(t)
g.Describe("#Once", func() {
g.It("should return nil only once for one id", func() {
var id = "1"
g.Assert(Once(id) == nil).IsTrue()
g.Assert(Once(i... | func TestOnce(t *testing.T) { |
<|file_name|>IndividualSelection.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# MLC (Machine Learning Control): A genetic algorithm library to solve chaotic problems
# Copyright (C) 2015-2017, Thomas Duriez (thomas.duriez@gmail.com)
# Copyright (C) 2015, Adrian Durán (adrianmdu@gmail.com)
# Copyright (C) 201... | BaseCreation.__init__(self)
self.__fill_creator = fill_creator
self.__selected_individuals = selected_individuals |
<|file_name|>timer.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
class Timer(object):
'''
Simple timer control
'''
def __init__(self, delay):
self.current_time = 0
self.set_delay(delay)
def pause(self, pause):
if pause >= self.delay... | assert delay >= 0
self.delay = delay
if self.delay == 0:
|
<|file_name|>KML.py<|end_file_name|><|fim▁begin|>import os
import sys
import time
import numpy
import logging
from stoqs import models as m
from django.conf import settings
from django.db.models import Avg
from django.http import HttpResponse, HttpResponseBadRequest
import pprint
logger = logging.getLogger(__name__)
... | clients can get KML output with the kmlResponse() method.
'''
def __init__(self, request, qs_mp, qparams, stoqs_object_name, **kwargs):
''' |
<|file_name|>jsdoc.js<|end_file_name|><|fim▁begin|>//@flow
const {foo, Bar, baz, qux} = require('./jsdoc-exports');<|fim▁hole|> NumberEnum,
BooleanEnum,
SymbolEnum,
} = require('./jsdoc-objects');
/** a JSDoc in the same file */
function x() {}
( );
// ^<|fim▁end|> | const {
DefaultedStringEnum,
InitializedStringEnum, |
<|file_name|>FizzBuzz3Compile.rs<|end_file_name|><|fim▁begin|>pub fn evaluate(Config((d1, w1), (d2, w2)): Config, i: int)
-> String {
match (i % d1 == 0, i % d2 == 0) {
(true, false) => w1.to_string(),<|fim▁hole|> (true, true) => w1.to_string().append(w2),
(false, false) => i.to_string()... | (false, true) => w2.to_string(), |
<|file_name|>systemmonitor.py<|end_file_name|><|fim▁begin|>"""
Support for monitoring the local system..
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.systemmonitor/
"""
import logging
import homeassistant.util.dt as dt_util
from homeassistant.c... | self._state = None
self._unit_of_measurement = SENSOR_TYPES[sensor_type][1]
self.update()
|
<|file_name|>test_log_depot_operation.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
""" Tests used to check the operation of log collecting.
Author: Milan Falešník <mfalesni@redhat.com>
Since: 2013-02-20
"""
from datetime import datetime
import fauxfactory
import pytest
import re
from cfme import test_requ... | @pytest.fixture(scope="module")
def configured_external_appliance(temp_appliance_preconfig, app_creds_modscope,
temp_appliance_unconfig):
hostname = temp_appliance_preconfig.address |
<|file_name|>namespace_linux.go<|end_file_name|><|fim▁begin|>package osl
import (
"fmt"
"io/ioutil"
"net"
"os"
"os/exec"
"path/filepath"
"runtime"
"strconv"
"strings"
"sync"
"syscall"
"time"
"github.com/docker/docker/pkg/reexec"
"github.com/docker/libnetwork/ns"
"github.com/docker/libnetwork/types"
"g... | |
<|file_name|>jsxFactoryMissingErrorInsideAClass.js<|end_file_name|><|fim▁begin|>//// [test.tsx]
export class C {
factory() {
return <div></div>;
}
}
//// [test.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.C = void 0;
class C {
factory() {
... | exports.C = C; |
<|file_name|>boyer_moore_memchr.rs<|end_file_name|><|fim▁begin|>use memchr::memchr;
use std::cmp::max;
use skip_search::*;
use super::SearchIn;
pub struct BoyerMooreMemchr <'a> {
needle: &'a [u8],
bad_chars: [usize; 256],
good_suffixes: Vec<usize>
}
<|fim▁hole|> needle: needle,
bad_c... | impl <'a> BoyerMooreMemchr <'a> {
pub fn new(needle: &'a [u8]) -> BoyerMooreMemchr {
BoyerMooreMemchr { |
<|file_name|>load.js<|end_file_name|><|fim▁begin|>var loadState = {
preload: function() {
/*
Load all game assets
Place your load bar, some messages.
In this case of loading, only text is placed...<|fim▁hole|> //Load your images, spritesheets, bitmaps...
game.load.im... | */
var loadingLabel = game.add.text(80, 150, 'loading...', {font: '30px Courier', fill: '#fff'});
|
<|file_name|>lien.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
##This file is part of pySequence
#############################################################################
#############################################################################
## ... | # #
# ##########################################################################################################
# class URLParamDialog(wx.Dialog):
# def __init__(self, parent, lien, pathref): |
<|file_name|>test_settings.py<|end_file_name|><|fim▁begin|>from django.test import override_settings, SimpleTestCase
from arcutils.settings import NO_DEFAULT, PrefixedSettings, get_setting
@override_settings(ARC={
'a': 'a',
'b': [0, 1],
'c': [{'c': 'c'}],
'd': 'd',
})
class TestGetSettings(SimpleTest... | |
<|file_name|>feature-gate-log_syntax2.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 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://www.a... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import unittest
import tempfile
from jsonconfigparser import JSONConfigParser, NoSectionError, ParseError
class JSONConfigTestCase(unittest.TestCase):
def test_init(self):
JSONConfigParser()
def test_read_string(self):
cf = JSONConfigPars... | def test_has_option(self):
cf = JSONConfigParser()
|
<|file_name|>component_access_token.py<|end_file_name|><|fim▁begin|>import redis
from app.config import get_config_obj
from app.util.httputil import Http_util
class Component_access_token():
def __init__(self):
self.component_appid = get_config_obj().component_appid
self.component_appsecret = get... | # TODO 读取保存的ticket
component_verify_ticket = self.r.get('component_verify_ticket')
return component_verify_ticket |
<|file_name|>purge.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 Matthieu Huguet
<|fim▁hole|># Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limi... | |
<|file_name|>quaternion_coordinates.rs<|end_file_name|><|fim▁begin|>use std::mem;
use std::ops::{Deref, DerefMut};
use simba::simd::SimdValue;
use crate::base::coordinates::IJKW;
use crate::Scalar;
use crate::geometry::Quaternion;
impl<N: Scalar + SimdValue> Deref for Quaternion<N> {
type Target = IJKW<N>;<|fim... |
#[inline] |
<|file_name|>test_issue_20.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#######################################################################
# Name: test_optional_in_choice
# Purpose: Optional matches always succeds but should not stop alternative
# probing on failed match.
# Author: Igor R. Deja... | # Copyright: (c) 2015 Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com> |
<|file_name|>GameClient.ts<|end_file_name|><|fim▁begin|>export namespace GameClient {
export function initGame(socket: WebSocket) {
socket.onopen = () => {
console.log("Connected to server");
};
socket.onmessage = (message: MessageEvent) => {
console.log(message.data... | alert("Connection closed");
}; |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, t... | homepage = "https://github.com/jupyter/nbformat"
url = "https://github.com/jupyter/nbformat/archive/4.1.0.tar.gz"
|
<|file_name|>issue-46553.rs<|end_file_name|><|fim▁begin|>// run-pass
#![feature(const_fn_fn_ptr_basics)]
#![deny(const_err)]
pub struct Data<T> {
function: fn() -> T,
}
impl<T> Data<T> {
pub const fn new(function: fn() -> T) -> Data<T> {
Data {
function: function,
}
}
}
pub st... | |
<|file_name|>OrderApp_order.graphql.ts<|end_file_name|><|fim▁begin|>/* tslint:disable */
/* eslint-disable */
import { ReaderFragment } from "relay-runtime";
import { FragmentRefs } from "relay-runtime";
export type CommerceOrderModeEnum = "BUY" | "OFFER" | "%future added value";
export type OrderApp_order = {
rea... | |
<|file_name|>scope.ts<|end_file_name|><|fim▁begin|>import { hideProperty } from '../util';
export const scopeKey = '__scope__';
export class ScopeData {
public $state: any = {};
public $getters: any = {};
public static get(ctx: any): ScopeData {
return ctx[scopeKey] || (function () {<|fim▁hole|... | const scope = new ScopeData();
hideProperty(ctx, scopeKey, scope);
return scope;
})(); |
<|file_name|>Command.cpp<|end_file_name|><|fim▁begin|>/*************** <auto-copyright.pl BEGIN do not edit this line> **************
*
* VR Juggler is (C) Copyright 1998-2007 by Iowa State University
*
* Original Authors:
* Allen Bierbaum, Christopher Just,
* Patrick Hartling, Kevin Meinert,
* Carolina Cr... |
writer->beginAttribute(gadget::tokens::SampleBufferLenAttrib);
// Write the # of vectors in the stable buffer.
writer->writeUint16(stable_buffer.size()); |
<|file_name|>test_array_from_pyobj.py<|end_file_name|><|fim▁begin|>from __future__ import division, absolute_import, print_function
import unittest
import os
import sys
import copy
from numpy import (
array, alltrue, ndarray, zeros, dtype, intp, clongdouble
)
from numpy.testing import (
run_module_suite, asse... | obj = array(self.num23seq, dtype=self.type.dtype, order='C')
shape = (len(self.num23seq), len(self.num23seq[0]))
try: |
<|file_name|>SWMMOpenMINoGlobalsPythonTest.py<|end_file_name|><|fim▁begin|>from ctypes import*
import math
<|fim▁hole|>print(lib)
print("\n")
finp = b"Z:\\Documents\\Projects\\SWMMOpenMIComponent\\Source\\SWMMOpenMINoGlobalsPythonTest\\test.inp"
frpt = b"Z:\\Documents\\Projects\\SWMMOpenMIComponent\\Source\\SWMMOpe... | lib = cdll.LoadLibrary("Z:\\Documents\Projects\\SWMMOpenMIComponent\\Source\\SWMMOpenMIComponent\\bin\\Debug\\SWMMComponent.dll") |
<|file_name|>test_reindex_library.py<|end_file_name|><|fim▁begin|>""" Tests for library reindex command """
import ddt
from django.core.management import call_command, CommandError
import mock
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.te... | call_command('reindex_library', unicode(self._get_lib_key(self.second_lib))) |
<|file_name|>url_package.py<|end_file_name|><|fim▁begin|>import posixpath
class UrlPackage:
""" Represents a package specified as a Url """
def __init__(self, url):
""" Initialize with the url """
if ':' in url:
self.url = url
else:
self.url = posi... | def forRequirements(self, versions):
|
<|file_name|>wiki.go<|end_file_name|><|fim▁begin|>package robots
import (
"fmt"
"log"
"net/http"
"net/url"
"strings"
)
type WikiBot struct {
}
func init() {
RegisterRobot("/wiki", func() (robot Robot) { return new(WikiBot) })
}
<|fim▁hole|>
func (w WikiBot) DeferredAction(command *SlashCommand) {
text := stri... | func (w WikiBot) Run(command *SlashCommand) (slashCommandImmediateReturn string) {
go w.DeferredAction(command)
return ""
} |
<|file_name|>semigroup.rs<|end_file_name|><|fim▁begin|>//! Module for holding the Semigroup typeclass definition and typeclass instances
//!
//! You can, for example, combine tuples.
#![cfg_attr(
feature = "std",
doc = r#"
# Examples
```
#[macro_use]
extern crate frunk;
# fn main() {
use frunk::Semigroup;
le... | }
}
|
<|file_name|>proxier.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses... | return err
} |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import shutil
import tempfile
import numpy as np
import os
from os.path import getsize
import pytest
import yaml
from util import PATH_TO_TESTS, seed, dummy_predict_with_threshold
PATH_TO_ASSETS = os.path.join(PATH_TO_TESTS, 'assets')
PATH_TO_RETINA_DIR = os.path.j... |
def _data_info(): |
<|file_name|>pareto_node.hpp<|end_file_name|><|fim▁begin|>#ifndef PARETO_NODE_HPP
#define PARETO_NODE_HPP
#include <core/forward_sampleable_node.hpp>
#include <helper/node_counter.hpp>
#include <string><|fim▁hole|>
namespace mcmc_utilities
{
template <typename T,template <typename TE> class T_vector>
class pareto_n... | #include <helper/abstract_node_factory.hpp>
#include <math/distributions.hpp> |
<|file_name|>bitcoin-wallet.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2016-2020 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
#e... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from setuptools import setup, find_packages<|fim▁hole|>setup(name='conwhat', #version=versioneer.get_version(),
description='python library for connectome-based white matter atlas analyses in neuroimaging',
long_description='python li... | import versioneer
|
<|file_name|>sha1.rs<|end_file_name|><|fim▁begin|>use std::num::Wrapping;
use byteorder::ByteOrder;
use byteorder::ReadBytesExt;
use byteorder::WriteBytesExt;
use byteorder::BigEndian as BE;
static K1: u32 = 0x5A827999u32;
static K2: u32 = 0x6ED9EBA1u32;
static K3: u32 = 0x8F1BBCDCu32;
static K4: u32 = 0xCA62C1D6u32;... | |
<|file_name|>constants_darwin_64.go<|end_file_name|><|fim▁begin|>//
// Copyright 2014-2017 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file.
//
//go:build darwin && (amd64 || arm64)
// +build darwin
// +build amd64 arm64
packa... | var baudrateMap = map[int]uint64{ |
<|file_name|>su-popup.spec.js<|end_file_name|><|fim▁begin|>import * as riot from 'riot'
import { init, compile } from '../../helpers/'
import TargetComponent from '../../../dist/tags/popup/su-popup.js'
describe('su-popup', function () {
let element, component
let spyOnMouseover, spyOnMouseout
init(riot)
const... | riot.unregister('su-popup') |
<|file_name|>self_assessment_module.py<|end_file_name|><|fim▁begin|>import json
import logging
from lxml import etree
from xmodule.capa_module import ComplexEncoder
from xmodule.progress import Progress
from xmodule.stringify import stringify_children
import openendedchild
from .combined_open_ended_rubric import Comb... | }) |
<|file_name|>0007_auto__add_messagerecord.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'MessageRecord'
db.... | },
u'nuntium.message': {
'Meta': {'object_name': 'Message'}, |
<|file_name|>utils.spec.ts<|end_file_name|><|fim▁begin|>import * as utils from '../utils';
<|fim▁hole|><|fim▁end|> | // Test Utils Functions |
<|file_name|>Department.java<|end_file_name|><|fim▁begin|>package org.softlang.service.company;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
/**
* A department has a name, a manager, employees, and subdepartments.
*/
public class Department implements Serializable {
private sta... | |
<|file_name|>contact-group.js<|end_file_name|><|fim▁begin|><|fim▁hole|> function (Model) {
var ContactGroup = GO.extend(Model, function () {
//rename function because this record has a delete attribute on the server
this.deleteRecord = this.delete;
this.$parent.constructor.call(this, arguments);
});
... | 'use strict';
angular.module('GO.Modules.GroupOffice.Contacts').factory('GO.Modules.GroupOffice.Contacts.Model.ContactGroup', [
'GO.Core.Factories.Data.Model', |
<|file_name|>utils.js<|end_file_name|><|fim▁begin|>/*istanbul ignore next*/'use strict';
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = tru... |
return EgoJSUtils;
})();
|
<|file_name|>yahoo.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import unicode_literals
import itertools
import json
import re
from .common import InfoExtractor, SearchInfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urlparse,
)
from ..utils import (
clean_html,
dete... | return brightcove_url_result( |
<|file_name|>header.hpp<|end_file_name|><|fim▁begin|>#ifndef SELECT_ALIEN_HPP
#define SELECT_ALIEN_HPP
#include "animation.hpp"
#include "game_object.hpp"
#include "text.hpp"
using namespace engine;
class Header: public GameObject{
public:
Header(double positionX, double positionY, int maxPapers, int stageNumber... | void updatePaperQuantity(int newValue);
private:
Animation* animator;
Animation* paper_icon; |
<|file_name|>data.js<|end_file_name|><|fim▁begin|>'use strict';
const TYPE = Symbol.for('type');<|fim▁hole|>
class Data {
constructor(options) {
// File details
this.filepath = options.filepath;
// Type
this[TYPE] = 'data';
// Data
Object.assign(this, options.data);
}
}
module.exports =... | |
<|file_name|>workbenchTestServices.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information... | @IBackupFileService public backupFileService: NodeTestBackupFileService, |
<|file_name|>MongodbManagerTest.java<|end_file_name|><|fim▁begin|>//package org.grain.mongo;
//
//import static org.junit.Assert.assertEquals;
//
//import java.util.ArrayList;
//import java.util.List;
//import java.util.UUID;
//
//import org.bson.conversions.Bson;
//import org.junit.BeforeClass;
//import org.junit.Test... | // testMongo.setName("name" + UUID.randomUUID().toString());
// result = MongodbManager.updateById("test_table", testMongo); |
<|file_name|>res_company.py<|end_file_name|><|fim▁begin|>from odoo import models, fields, api, _
# import odoo.tools as tools
try:
from pyafipws.iibb import IIBB
except ImportError:
IIBB = None
# from pyafipws.padron import PadronAFIP
from odoo.exceptions import UserError
import logging
import json
import reque... | if ws.Excepcion:
raise UserError("%s\nExcepcion: %s" % (
ws.Traceback, ws.Excepcion))
|
<|file_name|>async_waiter.cc<|end_file_name|><|fim▁begin|>// Copyright 2014 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 "mojo/public/cpp/environment/async_waiter.h"
namespace mojo {
AsyncWaiter::AsyncWaite... | id_ = 0;
callback_.Run(result); |
<|file_name|>scan.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# @Author: yancz1989
# @Date: 2017-01-17 23:43:18
# @Last Modified by: yancz1989<|fim▁hole|>import os
import json
import sys
from PIL import Image, ImageDraw
import SimpleITK as sitk
from env import *
def generate_scan_image(subset):
list_... | # @Last Modified time: 2017-02-22 20:33:29
import utilities as util
from utilities import parse_image_file, filterBoxes, voxel_2_world, mkdir
import numpy as np |
<|file_name|>text.rs<|end_file_name|><|fim▁begin|>use std::str;
use crate::{
AttributeId,
AttributeValue,
Document,
Node,
};
trait StrTrim {
fn remove_first(&mut self);
fn remove_last(&mut self);
}
impl StrTrim for String {
fn remove_first(&mut self) {
self.drain(0..1);
}
... |
let c1 = bytes1.first().cloned();
let c2 = bytes1.last().cloned(); |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|>import os
import smtplib
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
<|fim▁hole|> emailCount = 0;
def __init__(self, address, password):
self.address = address
self.pa... | class Email:
|
<|file_name|>index.tsx<|end_file_name|><|fim▁begin|>import { useState, useEffect } from "react";
import { FixedSizeList as List } from "react-window";
import './index.scss';
import { ReactComponent as MenuIcon } from './menu.svg';
import { ReactComponent as DownIcon } from './down.svg';
import Select, {components, Inp... | |
<|file_name|>viewLoanGroup.js<|end_file_name|><|fim▁begin|>Behaviour.register({
'#backButton': function(button) {<|fim▁hole|> button.onclick = function() {
if (isNaN(memberId) || memberId <= 0) {
self.location = pathPrefix + "/searchLoanGroups";
} else {
self.location = pathPrefix + "/memberLoanGroups?m... | |
<|file_name|>load-as-root-component.ts<|end_file_name|><|fim▁begin|>import {Component, DynamicComponentLoader, ElementRef, Injector}
from 'angular2/core';
import DynamicComponent from './dynamic-component';
import Hello from './hello';
@Component({
selector: 'load-as-root-component',
directives: [
Hello
],
... | <div class="wrapper">
<h3>LoadAsRoot Component</h3> |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Atomic counting semaphore that can help you control access to a common resource
//! by multiple processes in a concurrent system.
//!
//! ## Features
//!
//! - Effectively lock-free* semantics
//! - Provides RAII-style acquire/release API
//! - Implements `Send`, `Sy... | pub use shutdown::ShutdownHandle; |
<|file_name|>weather.js<|end_file_name|><|fim▁begin|><|fim▁hole|> classNames: 'weather-view dashboard-item'
});<|fim▁end|> | import Ember from 'ember';
export default Ember.View.extend({ |
<|file_name|>strings.py<|end_file_name|><|fim▁begin|>import os
import re
import codecs
import subprocess
import tempfile
import shutil
from .tylogger import logger
DEFAULT_ENCODING = 'utf16'
class Strings(object):
def __init__(self, encoding=DEFAULT_ENCODING, aliases=None):
self.encoding = encoding if en... | |
<|file_name|>treeAndTable.js<|end_file_name|><|fim▁begin|>/**
* @author: * @date: 2016/1/21
*/
define(["core/js/layout/Panel"],
function (Panel) {
var view = Panel.extend({
/*Panel的配置项 start*/
title:"表单-",
help:"内容",
brief:"摘要",
/*Panel 配置 End... | |
<|file_name|>test_rand.py<|end_file_name|><|fim▁begin|># Copyright (c) Frederick Dean
# See LICENSE for details.
"""
Unit tests for :py:obj:`OpenSSL.rand`.
"""
from unittest import main
import os
import stat
from OpenSSL.test.util import TestCase, b
from OpenSSL import rand
class RandTests(TestCase):
def test_... | |
<|file_name|>feature.pb.cc<|end_file_name|><|fim▁begin|>// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: diplomacy_tensorflow/core/example/feature.proto
#include "diplomacy_tensorflow/core/example/feature.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/prot... | if (other == this) return;
GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
InternalSwap(other); |
<|file_name|>collector_dmidecode.py<|end_file_name|><|fim▁begin|>import os
import re
from opsbro.collector import Collector
# DMI have lot of useful information that detectors can use to know lot about the platform/hardware
class Dmidecode(Collector):
def launch(self):
logger = self.logger
logger... | self.set_not_eligible('Windows is currently not managed for DMI informations')
return False
# Ok not direct access, try to launch with |
<|file_name|>api_endpoints.go<|end_file_name|><|fim▁begin|>package model
import (
"fmt"
)
type APIEndpoints []APIEndpoint
// DefaultAPIEndpointName is the default endpoint name used when you've omitted `apiEndpoints` but not `externalDNSName`
const DefaultAPIEndpointName = "Default"
// NewDefaultAPIEndpoints creat... | // HostedZone HostedZone
//} |
<|file_name|>httpshandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import httplib
import socket
import urllib2
from lib.core.data import logger
from lib.core.exception import SqlmapCo... | sock.close()
except ssl.SSLError, errMsg:
logger.debug("SSL connection error occured ('%s')" % errMsg)
|
<|file_name|>unused-move-capture.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http:/... | |
<|file_name|>macros.rs<|end_file_name|><|fim▁begin|>#![macro_use]
<|fim▁hole|> return Err(::std::convert::From::from($expr));
};
}<|fim▁end|> | macro_rules! fail {
($expr:expr) => { |
<|file_name|>HorizontalDividerList.styles.js<|end_file_name|><|fim▁begin|>// @flow
import { StyleSheet } from 'react-native';
import { colors } from '../../themes';
const styles = StyleSheet.create({<|fim▁hole|> marginHorizontal: 0,
backgroundColor: colors.darkDivider,
},
});
export default styles;<|fim▁end|... | divider: {
height: 1, |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|> return Math.floor(Math.random() * 256);
}
/**
* Creates a random image
*/
module.exports = function(width, height, callback) {
var buffer = new Buffer(width * height * 3);
for (var x = 0; x < width; x++) {
for (var y = 0; y < height;... | var Buffer = require('buffer').Buffer,
Jpeg = require('jpeg').Jpeg;
function randomColorComponent() { |
<|file_name|>lookup-get-cname-example-1.6.x.py<|end_file_name|><|fim▁begin|># Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACCOUNT_SID"
auth_token = "your_auth_token"
client = Client(a... | type="caller-name",
)
|
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
... | ('date_modified', models.DateField(auto_now=True)), |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.