prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.
mod future_pool;
mod metrics;
pub use future_pool::{Full, FuturePool};
use crate::time::{Duration, Instant};
use std::sync::Arc;
use yatp::pool::{CloneRunnerBuilder, Local, Runner};
use yatp::queue::{mu... | |
<|file_name|>scipy_test.py<|end_file_name|><|fim▁begin|>import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
from scipy.stats import multivariate_normal as mvn
norm.pdf(0)
# mean: loc, stddev: scale
norm.pdf(0, loc=5, scale=10)
r = np.random.randn(10)
# probability distributio... | norm.logcdf(r)
|
<|file_name|>textile.js<|end_file_name|><|fim▁begin|>/***
* Textile parser for JavaScript
*
* Copyright (c) 2012 Borgar Þorsteinsson (MIT License).
*
*/
/*jshint
laxcomma:true
laxbreak:true
eqnull:true
loopfunc:true
sub:true
*/
;(function(){
"use strict";
/***
* Regular Expression helper methods
... | if ( pba ) {
inner.advance( pba[0] ); |
<|file_name|>modelPortfolio.js<|end_file_name|><|fim▁begin|>import mongoose from 'mongoose';
const ModelPortfolioSchema = new mongoose.Schema({
id: String,
name: String,
displayName: String,
email: String,
securities: [{
symbol: String,
allocation: {type: Number, min: 0, max: 100},
}]
});
<|fim▁hole|> ... | ModelPortfolioSchema.add({
subGroups: [ModelPortfolioSchema], |
<|file_name|>ranking.py<|end_file_name|><|fim▁begin|>from trueskill import TrueSkill, Rating, rate
import argparse
from pytba import api as tba
import math
class FrcTrueSkill:
def __init__(self):
self.env = TrueSkill(draw_probability=0.02)
self.trueskills = {}
self.events = {}
def upd... | new_ratings = new_red + new_blue
for rating, team_number in zip(new_ratings, red_alliance + blue_alliance): |
<|file_name|>client_test.go<|end_file_name|><|fim▁begin|>// +build !integration
package logstash
import (
"strings"
"testing"
"time"
"github.com/elastic/go-lumber/server/v2"
"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/libbeat/outputs"
"github.com/elastic/beats/libbeat/outputs/transpor... | |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Numeric integration of data coming from a source sensor over time."""
from decimal import Decimal, DecimalException
import logging
import voluptuous as vol
from homeassistant.components.sensor import (
DEVICE_CLASS_ENERGY,
DEVICE_CLASS_POWER,
PLATFORM... | |
<|file_name|>errors.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of EUDAT B2Share.
# Copyright (C) 2016 CERN.
#
# B2Share 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... | class EpicPIDError(Exception):
"""Raise when a record has no community."""
|
<|file_name|>elf.go<|end_file_name|><|fim▁begin|>/*
* ELF constants and data structures
*
* Derived from:
* $FreeBSD: src/sys/sys/elf32.h,v 1.8.14.1 2005/12/30 22:13:58 marcel Exp $
* $FreeBSD: src/sys/sys/elf64.h,v 1.10.14.1 2005/12/30 22:13:58 marcel Exp $
* $FreeBSD: src/sys/sys/elf_common.h,v 1.15.8.1 2005/12... | R_AARCH64_MOVW_UABS_G1_NC R_AARCH64 = 266
R_AARCH64_MOVW_UABS_G2 R_AARCH64 = 267 |
<|file_name|>listtransactions.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the listtransactions API."""
from t... | |
<|file_name|>CCBone.js<|end_file_name|><|fim▁begin|>/****************************************************************************
Copyright (c) 2011-2012 cocos2d-x.org
Copyright (c) 2013-2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a... | getNodeToWorldTransform: function(){ |
<|file_name|>font_template.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/. */
use app_units::Au;
use core_graphics::data_provider::CG... | /// performs disk I/O.
pub fn bytes_if_in_memory(&self) -> Option<Vec<u8>> { |
<|file_name|>IOCTL.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
# $Id$
#
# Copyright (C) 1999-2006 Keith Dart <keith@kdart.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Pu... | # Encoding the size of the parameter structure in the ioctl request |
<|file_name|>xattrs_unsupported.go<|end_file_name|><|fim▁begin|>// +build !linux
package system
// Lgetxattr is not supported on platforms other than linux.
func Lgetxattr(path string, attr string) ([]byte, error) {
return nil, ErrNotSupportedPlatform
}
// Lsetxattr is not supported on platforms other than linux.
f... | return ErrNotSupportedPlatform
} |
<|file_name|>intrinsic.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/... | (_, "i32_sub_with_overflow") =>
with_overflow_intrinsic(bcx, "llvm.ssub.with.overflow.i32", ret_ty, |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// run-pass
// aux-build:lib.rs
// Regression test for #50865.
// When using generics or specifying the type directly, this example
// codegens `foo` internally. However, when using a private `impl Trait`
// function which references another private item, `foo` (in thi... | |
<|file_name|>av_widgets.py<|end_file_name|><|fim▁begin|># Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2008, Frank Scholz <coherence@beebits.net>
""" simple and hopefully reusable widgets to ease
the creation of UPnP UI applications
icons taken from the Tango De... | BUS_NAME = 'org.Coherence'
OBJECT_PATH = '/org/Coherence'
|
<|file_name|>experimenter.py<|end_file_name|><|fim▁begin|>import multiprocessing
import logging
class Experimenter(object):
"""
Coordinated, parallel execution of Experiments with logging.
"""
def __init__(self, log_name, experiments, cpu_limit=2**16):
"""
:param experiments: A list o... | |
<|file_name|>supersized.imgs.js<|end_file_name|><|fim▁begin|>jQuery(function($){
$.supersized({
//Functionality
slideshow : 1, //Slideshow on/off
autoplay : 1, //Slideshow starts playing automatically<|fim▁hole|> transition ... | start_slide : 1, //Start slide (0 is random)
slide_interval : 4000, //Length between transitions
slideshow_interval : 4000, //Length between transitions |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|>'use strict';
module.exports = require('./EuCookies');<|fim▁end|> | |
<|file_name|>test_devstack.py<|end_file_name|><|fim▁begin|># Copyright 2013: Mirantis 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
#
# http://w... | },
}
|
<|file_name|>cartesian_grid.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, division
import hashlib
from copy import deepcopy
import h5py
import numpy as np
from astropy import log as logger
from ..util.meshgrid import meshgrid_nd
from ..util.functions import FreezableClass, is_numpy_array, mo... | '''
# Create HDF5 groups if needed
|
<|file_name|>dolocanjeGostisc.py<|end_file_name|><|fim▁begin|>import csv
#import datetime
import numpy as np
import HackApp.models as database
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
def handle(self, *args, **options):
percentageAfterNine = 0.05
... |
koordinate = np.array(koordinate).transpose()
kot = np.arctan2(koordinate[1], koordinate[0]) |
<|file_name|>fullscreen.rs<|end_file_name|><|fim▁begin|>mod support;
use glutin::event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent};
use glutin::event_loop::{ControlFlow, EventLoop};
use glutin::monitor::{MonitorHandle, VideoMode};
use glutin::window::{Fullscreen, WindowBuilder};
use std::io::{st... |
monitor
}
|
<|file_name|>syn_test.js<|end_file_name|><|fim▁begin|>module("funcunit-syn integration")
test("Type and slow Click", function(){
S.open("//funcunit/test/myapp.html", null, 10000);
S("#typehere").type("javascriptmvc", function(){
equals(S("#seewhatyoutyped").text(), "typed javascriptmvc","typing");
})
S("#co... | |
<|file_name|>cursor.rs<|end_file_name|><|fim▁begin|>// This file is part of rgtk.
//
// rgtk 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... | None
} else {
Some(Cursor { |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from .views import simple_password
urlpatterns = [
url(r'^$', view=simple_password, name="simple_auth_password"),
]<|fim▁end|> | from django.conf.urls import url
|
<|file_name|>parseur_noeuds.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2015 Mael Valais <mael.valais@univ-tlse3.fr>
#
# Distributed under terms of the MIT license.
#
# Pour lancer glpsol et générer en même temps le graphe.dot :
# python parseur_noeu... | |
<|file_name|>khash.py<|end_file_name|><|fim▁begin|># The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at ... | |
<|file_name|>MapDataTest.java<|end_file_name|><|fim▁begin|>//: containers/MapDataTest.java
package course.containers; /* Added by Eclipse.py */
import java.util.*;
import net.mindview.util.*;
import static net.mindview.util.Print.*;
class Letters implements Generator<Pair<Integer,String>>,
Iterable<Integer> {
... | };
|
<|file_name|>sessionsControllerSpec.js<|end_file_name|><|fim▁begin|>'use strict';
describe('Controllers Tests ', function () {
beforeEach(module('solrpressApp'));
describe('SessionsController', function () {
var $scope, SessionsService;
beforeEach(inject(function ($rootScope, $controller, Se... | //WHEN
$scope.invalidate($scope.series); |
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import textwrap
from unittest import mock
from unittest.mock import call
import pytest
from flask_forecaster.config import Config, ConfigError, parse_vcap, require
@mock.patch('flask_forecaster.config.os.getenv')
def test_require_success(getenv):
getenv.r... | |
<|file_name|>cmdshell.py<|end_file_name|><|fim▁begin|># Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, includ... |
def exists(self, path):
status = self.run('[ -a %s ] || echo "FALSE"' % path)
if status[1].startswith('FALSE'): |
<|file_name|>AmountAndDirection55.go<|end_file_name|><|fim▁begin|>package iso20022
// Amount of money debited or credited on the books of an account servicer.
type AmountAndDirection55 struct {
// Amount of money in the cash entry.
Amount *RestrictedFINActiveOrHistoricCurrencyAndAmount `xml:"Amt"`
// Indicates wh... | }
func (a *AmountAndDirection55) SetAmount(value, currency string) { |
<|file_name|>plottools.py<|end_file_name|><|fim▁begin|>import numpy as np
def rainbow(n):
"""
Returns a list of colors sampled at equal intervals over the spectrum.
Parameters
----------
n : int
The number of colors to return
Returns
-------<|fim▁hole|> -----
Converts from ... | R : (n,3) array
An of rows of RGB color values
Notes |
<|file_name|>sites.js<|end_file_name|><|fim▁begin|>const express = require('express');
const router = express.Router();
const queries = require('../db/queries');
const knex = require('../db/knex.js');
const request = require('request');
router.get('/clear', (req, res, next) => {
queries.clearStationsTable((results) ... | for (var i = 0; i < parsedUSGS.length; i++) {
var stationData = {
river: 'Blue',
site_name: parsedUSGS[i].sourceInfo.siteName, |
<|file_name|>polymer_8cpp.js<|end_file_name|><|fim▁begin|>var polymer_8cpp =
[
[ "buf_mindist4", "polymer_8cpp.html#a2080040fff4e87f6c075beafbdf99c1e", null ],
[ "collectBonds", "polymer_8cpp.html#a7f7eaba446fd0bed3b96996e0845fa4f", null ],
[ "collision", "polymer_8cpp.html#a59b45a870af8c48e35778c1aa024784f... | |
<|file_name|>icons.py<|end_file_name|><|fim▁begin|>""" Various kinds of icon widgets.
<|fim▁hole|>from ...properties import Bool, Float, Enum
from ...enums import NamedIcon
from ..widget import Widget
class AbstractIcon(Widget):
""" An abstract base class for icon widgets. ``AbstractIcon``
is not generally use... | """
from __future__ import absolute_import
|
<|file_name|>test.py<|end_file_name|><|fim▁begin|>"""Run Valgrind on all demos."""
<|fim▁hole|># DOLFIN 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 opt... | # Copyright (C) 2008 Ilmar Wilbers
#
# This file is part of DOLFIN.
# |
<|file_name|>test_hosts.py<|end_file_name|><|fim▁begin|>"""test passlib.hosts"""
#=============================================================================
# imports
#=============================================================================
from __future__ import with_statement
# core
import logging; log = logg... | from lib.passlib import hosts, hash as hashmod
from lib.passlib.utils import unix_crypt_schemes
from lib.passlib.tests.utils import TestCase |
<|file_name|>test_clock_resolution.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Wed Sep 09 13:04:53 2015
* If TimerTool.exe is running, kill the process.
* If input parameter is given, start TimerTool and set clock resolution
Starts TimerTool.exe and sets the clock resolution to argv[0]... | |
<|file_name|>util.go<|end_file_name|><|fim▁begin|>// Copyright Istio Authors
//
// 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... | // limitations under the License. |
<|file_name|>failure-handler.js<|end_file_name|><|fim▁begin|>'use strict';
/* istanbul ignore next */
/* eslint-disable no-console */
/**
* Handle failures in the application by terminating.
* @param {Exception} err - Exception to handle.
*/
module.exports = (err) => {
console.log(err);
console.log(err.... | }; |
<|file_name|>issue-21291.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 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://www.apa... | |
<|file_name|>employee.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import getdate, validate_email_add, today
from frappe.model.namin... | holiday_list, company = frappe.db.get_value("Employee", employee, ["holiday_list", "company"])
else:
holiday_list=''
company=frappe.db.get_value("Global Defaults", None, "default_company") |
<|file_name|>indexing.rs<|end_file_name|><|fim▁begin|>use crate::core::{prelude::*, util::sort::Rated};
use anyhow::Result as Fallible;
pub fn reindex_place(
indexer: &dyn PlaceIndexer,
place: &Place,
status: ReviewStatus,
ratings: &[Rating],
) -> Fallible<AvgRatings> {<|fim▁hole|> Ok(avg_ratings)
... | let avg_ratings = place.avg_ratings(ratings);
indexer.add_or_update_place(place, status, &avg_ratings)?; |
<|file_name|>HeaderResizer.js<|end_file_name|><|fim▁begin|>/**
* Plugin to add header resizing functionality to a HeaderContainer.
* Always resizing header to the left of the splitter you are resizing.
*/
Ext.define('Ext.grid.plugin.HeaderResizer', {
extend: 'Ext.plugin.Abstract',
requires: [
'Ext.dd... | return; |
<|file_name|>tree_model_filter.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (5c017c9) from gir-files (71d73f0)
// DO NOT EDIT
use TreeIter;
use TreeModel;
use TreePath;
use ffi;
use glib;
use glib::Value;
use glib::object::IsA;
use glib::translate::*;
use gobject_ffi;
glib_wrapper! {
pub stru... | }
} |
<|file_name|>Score.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from color import *
from pygame.locals import *
class Score(pygame.sprite.Sprite):
def __init__(self, score, player, width, height):
super(pygame.sprite.Sprite).__init__(Score)
self.score = int(score)
self.color = None
... | # coding: utf-8
import pygame
import os |
<|file_name|>1_name_phone_number.py<|end_file_name|><|fim▁begin|>student_phoneNumber_name = {1: 'a', 3: 'c', 2: 'b'}
def Handler() :
while (1) :
choice = eval(input("Enter :\t 1 - to search student name \n \t 2 - to insert new student record \n \t 0 - to quit\n"))
print(choice)
if (choice == 1) :
if (student... | else:
print("Enter correct choice")
|
<|file_name|>stmtbuilder.py<|end_file_name|><|fim▁begin|>"""
Copyright (C) 2018 Roberto Bruttomesso <roberto.bruttomesso@gmail.com>
This file is distributed under the terms of the 3-clause BSD License.
A copy of the license can be found in the root directory or at
https://opensource.org/licenses/BSD-3-Clause.
Author:... | return self._binaryExpressionHelper(ctx)
def visitBinaryTermExpression(self, ctx):
return self._binaryExpressionHelper(ctx) |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>extern crate serde_codegen;
use std::env;
use std::path::Path;
fn main() {
let out_dir = env::var_os("OUT_DIR").unwrap();
let src = Path::new("src/serde_types.in.rs");
let dst = Path::new(&out_dir).join("serde_types.rs");
<|fim▁hole|><|fim▁end|> | serde_codegen::expand(&src, &dst).unwrap();
} |
<|file_name|>conf_fixture.py<|end_file_name|><|fim▁begin|># Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file exc... | #
# http://www.apache.org/licenses/LICENSE-2.0 |
<|file_name|>local_image_cache.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/. */
/*!
An adapter for ImageCacheTask that does local c... |
fn get_state(&self, url: &Url) -> @mut ImageState { |
<|file_name|>vue-channel.js<|end_file_name|><|fim▁begin|>"use strict";
let templatePad = function (n, padTemplate) {
let str = (n).toString();
return (padTemplate + str).substring(str.length);
};
let formatByte = function (n) {
return templatePad(n.toString(16).toLocaleUpperCase(), '00');
};
let instructionProper... | <button |
<|file_name|>test_student.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and Contributors<|fim▁hole|>
import frappe
import unittest
# test_records = frappe.get_test_records('Student')
class TestStudent(unittest.TestCase):
pass<|fim▁end|> | # See license.txt
from __future__ import unicode_literals |
<|file_name|>ConsoleClient.js<|end_file_name|><|fim▁begin|>//console:messageId:refHandle
var CONSOLE_ID_MATCHER = /^console:(\d+):(\d+)$/;
function ConsoleClient(config, debuggerClient, frontendClient) {
this._debuggerClient = debuggerClient;
this._frontendClient = frontendClient;
}
ConsoleClient.prototype.isCons... | |
<|file_name|>memory-usage.ts<|end_file_name|><|fim▁begin|>import { gql } from 'apollo-server-core';
export const memoryUsageSchema = gql`
"Quantity of memory used for some computation."
type MemoryUsage {
"Quantity of memory expressed in bytes."
bytes: Float!
}
"Field containing a memo... | "The memory usage, if known."
memoryUsage: MemoryUsage
"Maximum value over which the precise quantity of memory used is not relevant anymore."
memoryUsageMaxRelevant: MemoryUsage! |
<|file_name|>sortOrderReducer.js<|end_file_name|><|fim▁begin|>import { SET_SORT_ORDER } from '../constants/actions';
export default function (state = 'ASCENDING', action) {<|fim▁hole|> default:
return state;
}
}<|fim▁end|> | switch (action.type) {
case SET_SORT_ORDER:
return action.order; |
<|file_name|>GenerateBinaryNumbers1toN.java<|end_file_name|><|fim▁begin|>/**
*
*/
package com.kant.datastructure.queues;
import com.kant.sortingnsearching.MyUtil;
/**
* @author shaskant
*
*/
public class GenerateBinaryNumbers1toN {
/**
*
* @param n
* @return
* @throws OverFlowException
* @throws Un... | |
<|file_name|>rano.py<|end_file_name|><|fim▁begin|>import sys
try:
data = map(int, sys.stdin.readline().split())
except ValueError:
sys.stdout.write("NO" + '\n')
exit()
if not data:
sys.stdout.write("NO" + '\n')
exit()
if len(data) != 2:
sys.stdout.write("NO" + '\n')
exit()
if data[0] < 1... | exit()
|
<|file_name|>VisorValidateIndexesJobResult.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file ... | |
<|file_name|>test_template.py<|end_file_name|><|fim▁begin|>import os
import unittest
from lxml import etree
from hovercraft.template import (Template, CSS_RESOURCE, JS_RESOURCE,
JS_POSITION_BODY, JS_POSITION_HEADER)
TEST_DATA = os.path.join(os.path.split(__file__)[0], 'test_data')
c... | |
<|file_name|>tojson.rs<|end_file_name|><|fim▁begin|>#[cfg(feature = "with_json")]
use json;
use response;
pub trait ToJson {
type ResultType;
fn json(&self) -> Self::ResultType;
}
#[cfg(feature = "with_json")]
impl ToJson for response::Response {<|fim▁hole|> fn json(&self) -> <response::Response as ToJson... | type ResultType = json::Result<json::JsonValue>; |
<|file_name|>demo_gevent_only.py<|end_file_name|><|fim▁begin|>#! /usr/local/bin/stackless2.6
# by pts@fazekas.hu at Fri Jun 17 14:08:07 CEST 2011
"""Demo for hosting a gevent application with Stackless, without Syncless."""
__author__ = 'pts@fazekas.hu (Peter Szabo)'
import sys
# Import best_greenlet before gevent ... | |
<|file_name|>static_priv_by_default.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 or
// http://www.apa... | |
<|file_name|>SlackNotificationPayloadManager.java<|end_file_name|><|fim▁begin|>package slacknotifications.teamcity.payload;
import jetbrains.buildServer.messages.Status;
import jetbrains.buildServer.responsibility.ResponsibilityEntry;
import jetbrains.buildServer.responsibility.TestNameResponsibilityEntry;
import jetb... | + " with comment '"
+ responsibilityEntryNew.getComment().toString().trim() |
<|file_name|>clusters_calculator.py<|end_file_name|><|fim▁begin|>from models import Marker
from static.pymapcluster import calculate_clusters
import time
import logging
import concurrent.futures
import multiprocessing
<|fim▁hole|>def retrieve_clusters(**kwargs):
marker_boxes = divide_to_boxes(kwargs['ne_lat'], kwar... | |
<|file_name|>tests.entry.ts<|end_file_name|><|fim▁begin|>import 'core-js/es6';
import 'core-js/es7/reflect';
import 'reflect-metadata';
import 'zone.js/dist/zone';
import 'zone.js/dist/sync-test';
import 'zone.js/dist/async-test';
import 'zone.js/dist/fake-async-test';
import 'zone.js/dist/proxy';
import 'zone.js/dis... |
const tests = testContext.keys().filter(f => /\.test\.ts$/.test(f));
|
<|file_name|>bcbio_setup_genome.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python -Es
"""
Script to set up a custom genome for bcbio-nextgen
"""
from __future__ import print_function
from argparse import ArgumentParser
import collections
import gzip
import os
from Bio import SeqIO
import toolz as tz
from bcbio.ut... | def _output_ncbi_gff3(gff3_file, out_file, dialect):
gene_key = "gene"
id_spec = {"gene": gene_key}
db = gffutils.create_db(gff3_file, ":memory:", id_spec=id_spec) |
<|file_name|>jQuery.scrollSpeed.js<|end_file_name|><|fim▁begin|>// Plugin: jQuery.scrollSpeed
// Source: github.com/nathco/jQuery.scrollSpeed
// Author: Nathan Rutzky
// Update: 1.0.2
(function($) {
jQuery.scrollSpeed = function(step, speed, easing) {
var $document = $(document),
... | root = root <= 0 ? 0 : root -= step;
|
<|file_name|>event.js<|end_file_name|><|fim▁begin|>var Event = {
addListener: function (obj, event, listener, scope) {
if (obj) {
if (typeof obj.__listeners == "undefined") {
obj.__listeners = new Object();
}
if (typeof obj.__listeners[event] == "undefine... | |
<|file_name|>Likelihood.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Mon Oct 10 17:27:49 2016
@author: camacho
"""
import Kernel;reload(Kernel);kl = Kernel
import numpy as np
from time import time
import inspect as i
##### LIKELIHOOD
def likelihood(kernel, x, xcalc, y, yerr): #covariance ... | ##### LIKELIHOOD GRADIENT |
<|file_name|>StationModel.java<|end_file_name|><|fim▁begin|>package edu.wsu.weather.agweathernet.helpers;
import java.io.Serializable;
public class StationModel implements Serializable {
private static final long serialVersionUID = 1L;
private String unitId;
private String name;
private String county;
private St... | }
|
<|file_name|>kernel.java<|end_file_name|><|fim▁begin|>package jnt.scimark2;
public class kernel
{
// each measurement returns approx Mflops
public static double measureFFT(int N, double mintime, Random R)
{
// initialize FFT data as complex (N real/img pairs)
double x[] = RandomVector(2*N, R);
... | |
<|file_name|>shapeobjects.py<|end_file_name|><|fim▁begin|>###############################################################################
# Copyright (C) 2008 Johann Haarhoff <johann.haarhoff@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU... |
def createFromFile(self,filestream,shapenum): |
<|file_name|>english.py<|end_file_name|><|fim▁begin|>words = [
'abandon',
'ability',
'able',
'about',
'above',
'absent',
'absorb',
'abstract',
'absurd',
'abuse',
'access',
'accident',
'account',
'accuse',
'achieve',
'acid',
'acoustic',
'acquire',
'across',
'act',
'action',
'actor',
'actress',
'actual',
'adapt',
'add',
... | 'globe',
'gloom',
'glory',
'glove', |
<|file_name|>clone.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
use core::clone::Clone;
// pub trait FixedSizeArray<T> {
// /// Converts the array to immutable slice
// fn as_slice(&self) -> &[T];
// /// Converts the array to mutable sli... | // #[stable(feature = "rust1", since = "1.0.0")]
// impl<T:Ord> Ord for [T; $N] {
// #[inline]
// fn cmp(&self, other: &[T; $N]) -> Ordering { |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#![stable(feature = "rust1", since = "1.0.0")]
pub mod ffi;
/// A prelude for conveniently writing platform-specific code.
///
/// Includes all extension traits, and some important type definitions.
#[stable(feature = "rust1", since = "1.0.0")]
pub mod prelude {
#[... | } |
<|file_name|>library.py<|end_file_name|><|fim▁begin|># -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding: utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
#
# Convolve MTSS rotamers with MD trajectory.
# Copyright (c) 2011-2017 Philip Fowler and AUTHORS
# Published under the... | 'topology': "rotamer1_R1A_298K_2011.pdb",
'ensemble': "rotamer1_R1A_298K_2011.dcd",
'populations': "R1A_298K_populations_2011.dat",
'author': "Gunnar Jeschke", |
<|file_name|>test_mount.py<|end_file_name|><|fim▁begin|>import shutil
import tempfile
import time
import os
import random
import subprocess
import unittest
from basefs.keys import Key
from basefs.logs import Log
from . import utils
class MountTests(unittest.TestCase):<|fim▁hole|> self.addCleanup(os.remove, s... | def setUp(self):
__, self.logpath = tempfile.mkstemp()
__, self.logpath_b = tempfile.mkstemp() |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Google 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.<|fim▁hole|># http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | # You may obtain a copy of the License at
# |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use sfml::graphics;
use engine::resource_loader::{ResourceLoader, Resource};
use engine::state::StateMachine;
use engine::rendering::RenderContext;
use engine::settings::Settings;
use self::State::*;
pub mod colors;
pub mod main_menu;
pub mod game_state;
pub mod slot_... | OptionsStateID, |
<|file_name|>Choice.py<|end_file_name|><|fim▁begin|>import wx
class Choice(wx.Choice):
def GetValue(self):<|fim▁hole|><|fim▁end|> | return self.GetSelection() |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>"use strict";
exports.__esModule = true;
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _createElement = _interopRequireDefault(require("../createElement"));
var _useMergeRefs = _interopRequireDefault(require("../../modules/use... | |
<|file_name|>0006_add_imported_file.py<|end_file_name|><|fim▁begin|># encoding: 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 'ImportedFile'
db.creat... | 'path': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'project_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), |
<|file_name|>server.js<|end_file_name|><|fim▁begin|>/**!
* urllib - test/fixtures/server.js
*
* Copyright(c) 2011 - 2014 fengmk2 and other contributors.
* MIT Licensed
*
* Authors:
* fengmk2 <fengmk2@gmail.com> (http://fengmk2.github.com)
*/
"use strict";
/**
* Module dependencies.
*/
var should = requir... | chunks.push(buf);
size += buf.length;
});
|
<|file_name|>transform.rs<|end_file_name|><|fim▁begin|>use geometry::Transformable;
use math;
#[derive(Deserialize, Debug)]
#[serde(tag = "type")]
pub enum Transform {
Translate { value: [f32; 3] },
Scale { value: [f32; 3] },
RotateX { value: f32 },
RotateY { value: f32 },
RotateZ { value: f32 },
}... | |
<|file_name|>typeck-macro-interaction-issue-8852.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 or
// h... | B(f64)
}
|
<|file_name|>add_dict.py<|end_file_name|><|fim▁begin|>d = {}
for i in range(100000):
d[i] = i
JS_CODE = '''
var d = {};
for (var i = 0; i < 100000; i++) {<|fim▁hole|><|fim▁end|> | d[i] = i;
}
''' |
<|file_name|>briefcase.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | import * as React from 'react';
import { IconBaseProps } from 'react-icon-base';
export default class TiBriefcase extends React.Component<IconBaseProps> { } |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
var redis = require('redis')
, xtend = require('xtend')
, hyperquest = require('hyperquest')
;
module.exports = FetchAndCache;
/**
* Creates a fetchncache instance.
*
* #### redis opts
*
* - **opts.redis.host** *{number=}* host a... | val = opts.transform(res);
} catch (e) {
return cb(e);
} |
<|file_name|>scope7.js<|end_file_name|><|fim▁begin|>function f1(a) {
try {
throw "x";<|fim▁hole|>}
f1(3);<|fim▁end|> | } catch (arguments) {
console.log(arguments);
} |
<|file_name|>extern-crate-only-used-in-link.rs<|end_file_name|><|fim▁begin|>// This test is just a little cursed.
// aux-build:issue-66159-1.rs
// aux-crate:priv:issue_66159_1=issue-66159-1.rs
// aux-build:empty.rs
// aux-crate:priv:empty=empty.rs
// aux-build:empty2.rs
// aux-crate:priv:empty2=empty2.rs<|fim▁hole|>
//... | // build-aux-docs
// compile-flags:-Z unstable-options --edition 2018 |
<|file_name|>ly_proxy_test.py<|end_file_name|><|fim▁begin|># Author: Jason Lu
import urllib.request
from bs4 import BeautifulSoup
import time
req_header = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
'Accept':'text/html,application/xhtml+xml,ap... | |
<|file_name|>new.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
use core::atomic::AtomicUsize;
use core::atomic::Ordering::Relaxed;
// pub struct AtomicUsize {
// v: UnsafeCell<usize>,
// }
// impl Default for AtomicUsize {
// fn defa... | // /// some_usize.store(10, Ordering::Relaxed);
// /// assert_eq!(some_usize.load(Ordering::Relaxed), 10);
// /// ```
// /// |
<|file_name|>exhaustive.rs<|end_file_name|><|fim▁begin|>use chars::exhaustive::{exhaustive_chars, ExhaustiveChars};
use num::exhaustive::PrimitiveIntIncreasingRange;
use strings::{strings_from_char_vecs, StringsFromCharVecs};
use vecs::exhaustive::{
exhaustive_vecs, exhaustive_vecs_fixed_length_from_single, lex_vec... | #[inline]
pub fn exhaustive_fixed_length_strings( |
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under t... | |
<|file_name|>helper_thread.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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.... | drop(chan);
helper_signal::signal(*self.signal.get() as helper_signal::signal);
|
<|file_name|>prop.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""This module contains the parser/generators (or coders/encoders if you
prefer) for the classes/datatypes that are used in iCalendar:
###########################################################################
# This module defines these proper... | value = timedelta(days=int(days or 0), |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.