prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>foldable.rs<|end_file_name|><|fim▁begin|>use lift::Foldable;
use std::hash::Hash;
use std::collections::linked_list::LinkedList;
use std::collections::vec_deque::VecDeque;
use std::collections::{BinaryHeap, BTreeSet, HashSet};
//Implementation of Foldable for Vec
foldable!(Vec);
//Implementation of Folda... | self.iter().fold(accum, f)
} |
<|file_name|>assetloader.js<|end_file_name|><|fim▁begin|>'use strict';
import EventMap from 'eventmap';
import Log from './log';
var audioTypes = {
'mp3': 'audio/mpeg',
'wav': 'audio/wav',
'ogg': 'audio/ogg'
};
var imageTypes = {
'png': 'image/png',
'jpg': 'image/jpg',
'gif': 'image/gif'
};
class AssetL... | this.cache = {}; |
<|file_name|>test-perf2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import time
import unittest
import dpkt
class TestPerf(unittest.TestCase):
rounds = 10000
def setUp(self):
self.start = time.time()
def tearDown(self):
print self.rounds / (time.time() - self.start), 'rounds/s... | for i in xrange(self.rounds): |
<|file_name|>TestConfigView.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
* to you ... | |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# pysaml2 documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 24 08:13:41 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values... | |
<|file_name|>stats.py<|end_file_name|><|fim▁begin|>import glob, csv, re, shutil, mustache, time
import numpy as np
oddsfile = list(sorted(glob.glob('raw/odds*.csv')))[-1]
timestamp = re.search('s(.*?)\.', oddsfile).group(1)
with open(oddsfile) as infile:
reader = csv.reader(infile)
header = reader.next()
t... |
context = {"last_updated": last_updated}
out = mustache.render(file("index.mustache.html").read(), context) |
<|file_name|>IndexProcessor.java<|end_file_name|><|fim▁begin|>/*
* Symphony - A modern community (forum/SNS/blog) platform written in Java.
* Copyright (C) 2012-2017, b3log.org & hacpai.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public Lice... |
final List<JSONObject> perfectArticles = articleQueryService.getIndexPerfectArticles(avatarViewMode);
dataModel.put(Common.PERFECT_ARTICLES, perfectArticles);
|
<|file_name|>cli-client.js<|end_file_name|><|fim▁begin|>const fetch = require("isomorphic-fetch");
function getUrl(query, variables) {
const urlRoot = `http://localhost:3000/graphql?query=${query}`;
if (variables == null) {
return urlRoot;
} else {
return urlRoot + `&variables=${JSON.stringify(variables... | {
luke: human(id: "1000") { |
<|file_name|>CsvToMySql.java<|end_file_name|><|fim▁begin|>package com.camillepradel.movierecommender.utils;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.sql.Connection;
import java.sql.Date;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import ja... | |
<|file_name|>sync_broadcast.rs<|end_file_name|><|fim▁begin|>#![allow(clippy::cognitive_complexity)]
#![warn(rust_2018_idioms)]
#![cfg(feature = "sync")]
#[cfg(target_arch = "wasm32")]
use wasm_bindgen_test::wasm_bindgen_test as test;
use tokio::sync::broadcast;
use tokio_test::task;
use tokio_test::{
assert_err, ... |
let tx2 = tx.clone();
|
<|file_name|>generate-certs.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Copyright (c) 2016 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.
"""
A chain with four possible intermediates with different notBefore and notAfte... | #!/usr/bin/python |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: UTF-8 -*-<|fim▁hole|>from distutils.core import setup
import switchscreen
shutil.copyfile("switchscreen.py", "switchscreen")
setup(
name = "switchscreen",
version = switchscreen.__version__,
description = "",
autho... |
import shutil
import os
|
<|file_name|>autowrapped_static_text.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import wx
from copy import copy
sWhitespace = ' \t\n'
def SplitAndKeep(string, splitchars = " \t\n"):
substrs = []<|fim▁hole|> if string[i] in splitchars:
substrs.append(string[:i])
substrs.append(string[i])
stri... |
i = 0
while len(string) > 0: |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|>'use strict';
/**
* Load all public assets, e.g js, css, images
*/
exports.register = function (server, options, next) {
server.route({
method: 'GET',
path: '/public/{params*}',
config: {
description: 'load assets',
auth: false,... | |
<|file_name|>default_log.cpp<|end_file_name|><|fim▁begin|>#include "pch.hpp"
#include "default_log.hpp"
#include "service_log.hpp"
#include "service_helpers.hpp"
namespace be {<|fim▁hole|>///////////////////////////////////////////////////////////////////////////////
bool default_log_available() {
return check_serv... | |
<|file_name|>20120430B.py<|end_file_name|><|fim▁begin|>"""
Consider this game: Write 8 blanks on a sheet of paper. Randomly pick a digit 0-9. After seeing the digit, choose one
of the 8 blanks to place that digit in. Randomly choose another digit (with replacement) and then choose one of the 7
remaining blanks to place... | of the time. Can you do better?
|
<|file_name|>test_statistics.py<|end_file_name|><|fim▁begin|>import numpy as np
import pytest
from numpy.testing import assert_allclose
try:
import scipy
except ImportError:
HAS_SCIPY = False
else:
HAS_SCIPY = True
import astropy.units as u
from astropy.timeseries.periodograms.lombscargle import LombScarg... |
@pytest.mark.parametrize('method', sorted(set(METHODS) - {'bootstrap'})) |
<|file_name|>users.rs<|end_file_name|><|fim▁begin|>#![crate_name = "users"]
/*
* This file is part of the uutils coreutils package.
*
* (c) KokaKiwi <kokakiwi@kokakiwi.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/<|fim▁hole... |
/* last synced with: whoami (GNU coreutils) 8.22 */
|
<|file_name|>Strings.java<|end_file_name|><|fim▁begin|>package cc.mallet.util;
/**
* Static utility methods for Strings
*/
final public class Strings {
public static int commonPrefixIndex (String[] strings)
{
int prefixLen = strings[0].length();
for (int i = 1; i < strings.length; i++) {
if (... | break;
|
<|file_name|>LoginEventHandler.java<|end_file_name|><|fim▁begin|>package zoara.sfs2x.extension;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Arrays;
import zoara.sfs2x.extension.simulation.World;
import zoara.sfs2x.extension.u... | { |
<|file_name|>worker.py<|end_file_name|><|fim▁begin|>import os
import socket
import venusian
from botocore.exceptions import ClientError
from flowy.swf.client import SWFClient, IDENTITY_SIZE
from flowy.swf.decision import SWFActivityDecision
from flowy.swf.decision import SWFWorkflowDecision
from flowy.swf.history imp... | |
<|file_name|>unit-test.js<|end_file_name|><|fim▁begin|>var page = require('webpage').create();
var url;
if (phantom.args) {
url = phantom.args[0];
} else {
url = require('system').args[1];
}
page.onConsoleMessage = function (message) {
console.log(message);<|fim▁hole|>
function exit(code) {
setTimeout(functio... | }; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>VERSION = (0, 11)
__version__ = '.'.join(map(str, VERSION))<|fim▁hole|>DATE = "2015-02-06"<|fim▁end|> | |
<|file_name|>location_mock.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Location, LocationStrategy, PlatformLocation} from... | |
<|file_name|>buttons.js<|end_file_name|><|fim▁begin|>var buttons = function(req, res, next) {
var request = require('request');
var cheerio = require('cheerio');
var Case = require('case');
// var url = "http://clas.asu.edu";
var url = req.body.page;
var parsedResults = [];
//testing url argument site... | |
<|file_name|>model-selector-test.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
moduleForComponent('model-selector', 'Unit | Component | model selector', {
// Specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar'],
unit: true
});
test('it renders', function(assert) {
as... | import { moduleForComponent, test } from 'ember-qunit'; |
<|file_name|>InsertAnchor.js<|end_file_name|><|fim▁begin|>//>>built
define(
"dojox/editor/plugins/nls/cs/InsertAnchor", //begin v1.x content
({
insertAnchor: "Vložit kotvu",
title: "Vlastnosti kotvy",
anchor: "Název:",
text: "Popis:",<|fim▁hole|> cancel: "Storno"
})
//end v1.x content
);<|fim▁end|> | set: "Nastavit", |
<|file_name|>wk02_twitter_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-#
"""
Basic Twitter Authentication
requirements: Python 2.5+ tweepy (easy_install tweepy | pip install tweepy)
"""
__author__ = 'Bernie Hogan'
__version__= '1.0'
import string
import codecs
import os
import pickle
import copy
im... | CONSUMER_SECRET = th.CONSUMER_SECRET |
<|file_name|>game.js<|end_file_name|><|fim▁begin|>import {
store
} from '../store.js';
import {
selectGameCurrentState,
selectGameChest,
selectGameName
} from '../selectors.js';
import {
deepCopy,
getProperty,
setPropertyInClone
} from '../util.js';
export const UPDATE_GAME_ROUTE = 'UPDATE_GAME_ROUTE';... | |
<|file_name|>gen_test2123.py<|end_file_name|><|fim▁begin|>import numpy as np
import pandas as pd
import scipy as sp
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os, sys
try:
import cPickle as pickle
except:
import pickle
#connect echoRD Tools
pathdir='../echoRD' #path to echoRD
l... | #use modified routines for binned retention definitions
mc.part_sizefac=500 |
<|file_name|>Helpers.ts<|end_file_name|><|fim▁begin|>import builder = require('botbuilder');
export module Helpers {
export class API {
public static async DownloadJson(url:string, post:boolean=false, options:any=undefined): Promise<string>{
return new Promise<string>(resolve => {
... | }); |
<|file_name|>ir_filters.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import ast
from odoo import api, fields, models, _
from odoo.exceptions import UserError
class IrFilters(models.Model):
_name = 'ir.filters'
_description... | ``is_default``
:raises odoo.exceptions.UserError: if there is an existing default and
we're not updating it |
<|file_name|>edge.py<|end_file_name|><|fim▁begin|>from pseudoregion import *
class Edge(PseudoRegion):
"""EDGE Fringe field and other kicks for hard-edged field models
1) edge type (A4) {SOL, DIP, HDIP, DIP3, QUAD, SQUA, SEX, BSOL, FACE}
2.1) model # (I) {1}
2.2-5) p1, p2, p3,p4 (R) model-dependent ... | p2: radius of curvature of reference particle [m]
p3: if not 0 => correct kick by factor 1/(1+delta)
p4: if not 0 ==> apply horizontal focus with strength = (-vertical strength)
If a FACE command is used before and after a sector dipole (DIP), you can approximate a rectangular dipole field. |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# CodeBug Tether documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 20 15:23:09 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all... | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.pngmath']
|
<|file_name|>Hydra.py<|end_file_name|><|fim▁begin|>'''
Created on Feb 3, 2013
@author: bpurgaso
'''
from twisted.words.protocols import irc
from twisted.internet import protocol
from twisted.internet import reactor
from twisted.internet import threads
from ConfigManager import ConfigManager
from Authenticator import ... | return s
|
<|file_name|>compile_and_link.rs<|end_file_name|><|fim▁begin|>#[cfg(test)]
mod compile_and_link_tests {
use lucet_wasi_sdk::*;
use std::path::PathBuf;
use tempfile::TempDir;
fn test_file(name: &str) -> PathBuf {
let mut p = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
p.push("tests");
... | |
<|file_name|>graph.go<|end_file_name|><|fim▁begin|>package graph
import (
"compress/gzip"
"crypto/sha256"
"fmt"
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
"runtime"
"strings"
"syscall"
"time"
"github.com/Sirupsen/logrus"
"github.com/docker/distribution/digest"
"github.com/docker/docker/autogen/docker... | return
}
if children, exists := byParent[parent.ID]; exists {
byParent[parent.ID] = append(children, img) |
<|file_name|>ODataMetaModel.qunit.js<|end_file_name|><|fim▁begin|>/*!
* ${copyright}
*/
sap.ui.require([
"jquery.sap.global",
"sap/ui/base/SyncPromise",
"sap/ui/model/BindingMode",
"sap/ui/model/ChangeReason",
"sap/ui/model/ClientListBinding",
"sap/ui/model/Context",
"sap/ui/model/ContextBinding",
"sap/ui/mod... | |
<|file_name|>test_cluster_config.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 Mirantis 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/LICEN... | get_data = self.get_object(self.url_cluster_with_slash, |
<|file_name|>uiSlider.js<|end_file_name|><|fim▁begin|>function CreateUiSlider(args) {
var instanceSlider = Titanium.UI.createSlider({
height:"auto",
width:"auto",
//top:100,<|fim▁hole|> max:10 //Maximum value for the slider (needed for Android)
});
... | min:0, //Minimum value for the slider (needed for Android) |
<|file_name|>numberFormatter.py<|end_file_name|><|fim▁begin|>import math
def formatAmount(val, prec=3, lowest=0, highest=0, currency=False, forceSign=False):
"""
Add suffix to value, transform value to match new suffix and round it.
Keyword arguments:
val -- value to process
prec -- precision of ... | |
<|file_name|>DefaultCharacteristicTest.java<|end_file_name|><|fim▁begin|>/*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2014 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube is free software; you can redistribute it and/or
* modify it under the terms of the GNU... | .setRootId(3)
.setParentId(2);
assertThat(requirement.id()).isEqualTo(1); |
<|file_name|>test_pheno2sql.py<|end_file_name|><|fim▁begin|>import os
import tempfile
import unittest
import numpy as np
import pandas as pd
from sqlalchemy import create_engine
from tests.settings import POSTGRESQL_ENGINE, SQLITE_ENGINE
from tests.utils import get_repository_path, DBTest
from ukbrest.common.pheno2sq... | p2sql.load_data()
# Validate
assert p2sql.db_type == 'postgresql' |
<|file_name|>defineSetByView.js<|end_file_name|><|fim▁begin|>//AppliedRules.defineSetByView<|fim▁hole|><|fim▁end|> | module.exports = (function( viewId ){
return this.defineSetByTag( viewId );
}); |
<|file_name|>region.rs<|end_file_name|><|fim▁begin|>use native;
use rustrt::rtio;
use rustrt::rtio::RtioFileStream;
use std::cell::Cell;
use std::os;
use array::*;
use chunk::{
BiomeId,
BlockState,
Chunk,
ChunkColumn,
EMPTY_CHUNK,
LightLevel,
SIZE
};
use minecraft::nbt::Nbt;
<|fim▁hole|> ... | pub struct Region { |
<|file_name|>LeenoUtils.py<|end_file_name|><|fim▁begin|>'''
Often used utility functions
Copyright 2020 by Massimo Del Fedele
'''
import sys
import uno
from com.sun.star.beans import PropertyValue
from datetime import date
import calendar
import PyPDF2
'''
ALCUNE COSE UTILI
La finestra che contiene il documento (o ... | |
<|file_name|>world.rs<|end_file_name|><|fim▁begin|>use rand::Rng;
use crate::{
geometry::Size,
models::{Bullet, Enemy, Particle, Player, Powerup, Star},
};
const MAX_STARS: usize = 100;
/// A model that contains the other models and renders them
pub struct World {
pub player: Player,
pub particles: V... | powerups: vec![],
bullets: vec![], |
<|file_name|>persona.py<|end_file_name|><|fim▁begin|>"""
BrowserID support
"""
from social.backends.base import BaseAuth
from social.exceptions import AuthFailed, AuthMissingParameter
class PersonaAuth(BaseAuth):
"""BrowserID authentication backend"""
name = 'persona'
def get_user_id(self, details, respo... | return details['email']
def get_user_details(self, response):
"""Return user details, BrowserID only provides Email.""" |
<|file_name|>tuple-style-enum.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.apac... | // lldb-check:[...]$2 = Case3(0, 6438275382588823897)
// lldb-command:print univariant |
<|file_name|>watcher.error-no-input.js<|end_file_name|><|fim▁begin|>import { exec } from "child_process"<|fim▁hole|>import test from "tape"
import cliBin from "./utils/cliBin"
test("--watch error if no input files", (t) => {
exec(
`${ cliBin }/testBin --watch`,
(err, stdout, stderr) => {
t.ok(
... | |
<|file_name|>test_mimehandler.py<|end_file_name|><|fim▁begin|>from thug.ThugAPI.ThugAPI import ThugAPI
class TestMIMEHandler(object):
def do_perform_test(self, caplog, url, expected, type_ = "remote"):
thug = ThugAPI()<|fim▁hole|> thug.set_ssl_verify()
thug.log_init(url)
m = getatt... |
thug.set_useragent('win7ie90')
thug.set_features_logging() |
<|file_name|>theming-tests.tsx<|end_file_name|><|fim▁begin|>import * as React from "react";
import {
channel,
ContextWithTheme,
Theme,
themeListener,
ThemeProvider,
withTheme
} from "theming";
// Typings currently accept non-plain-objects while they get rejected at runtime.
// There exists currently no typ... | return (
<ThemeProvider theme={customTheme}>
<ThemeProvider theme={outerTheme => ({ ...outerTheme, augmented: true })}> |
<|file_name|>actionpotential.py<|end_file_name|><|fim▁begin|>import os
import webapp2
from actions import cronActions
from views import views
import secrets
SECS_PER_WEEK = 60 * 60 * 24 * 7
# Enable ctypes -> Jinja2 tracebacks
PRODUCTION_MODE = not os.environ.get(
'SERVER_SOFTWARE', 'Development').startswith('Dev... | } |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>from datetime import date
NTESTS = 1
PREV_DAYS = 10
PERCENT_UP = 0.01
PERCENT_DOWN = 0.01
PERIOD = 'Hourly' # [5-min, 15-min, 30-min, Hourly, 2-hour, 6-hour, 12-hour, Daily, Weekly]
MARKET = 'bitstampUSD'
# DATE START
YEAR_START = 2011
MONTH_START = 9
DAY_START = ... | DATE_START = date(YEAR_START, MONTH_START, DAY_START)
# DATE END |
<|file_name|>Short.java<|end_file_name|><|fim▁begin|><|fim▁hole|> * Convert short to any primitive data type
*/
public class Short {
/**
* Convert short to boolean
*
* @param input short
* @return boolean
*/
public static boolean shortToBoolean(short input) {
return input != 0;... | package com.kashukov.convert;
/** |
<|file_name|>consul_agent_test.go<|end_file_name|><|fim▁begin|>package cloudfoundry_test
import (
"github.com/enaml-ops/omg-product-bundle/products/oss_cf/enaml-gen/consul_agent"
. "github.com/enaml-ops/omg-product-bundle/products/oss_cf/plugin"
"github.com/enaml-ops/omg-product-bundle/products/oss_cf/plugin/config... | consulAgent := NewConsulAgent([]string{}, cfg)
job := consulAgent.CreateJob()
Ω(job).ShouldNot(BeNil())
props := job.Properties.(*consul_agent.ConsulAgentJob) |
<|file_name|>implicit_cellular.rs<|end_file_name|><|fim▁begin|>/// The documentation is taken from original [C++ library by Joshua Tippetts](http://accidentalnoise.sourceforge.net/docs.html).
use super::implicit_base::ImplicitModuleBase;
use super::ImplicitModule;
use super::cellular_gen::*;
use std::rc::Rc;
use std:... |
/// The Cellular function provides an interface to a [`CellularGenerator`](struct.CellularGenerator.html) to generate cellular noise based on the function originally written by Steve Worley. The function calculates F1,F2,F3 and F4 as distances to the first, second, third and fourth nearest seed points, applies the spe... |
<|file_name|>exception_sink.py<|end_file_name|><|fim▁begin|># Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import datetime
import faulthandler
import logging
import os
import signal
import sys
import threading
import traceback
from con... | cls._reset_exiter(new_exiter)
yield
cls._reset_exiter(previous_exiter)
|
<|file_name|>receitas-app.js<|end_file_name|><|fim▁begin|>angular.module('ReceitasApp', ['ngRoute', 'minhasDiretivas'])
.config(function ($routeProvider) {
$routeProvider.when('/', {
templateUrl: 'home.html',
});
$routeProvider.when('/adicionar', {
templateUrl: 'adic... | })
.run(['DbFactory', function (DbFactory) { |
<|file_name|>ClassDemo03.java<|end_file_name|><|fim▁begin|>package com.jikexueyuan.classdemo;
/**
* Created by zmzp on 14-12-4.
*/
class Student{<|fim▁hole|>public class ClassDemo03 {
public static void main(String[] args) {
// Student stu = new Student();
// stu.tell();
//匿名对象
new ... | public void tell(){
System.out.println("Hello Jikexueyuan");
}
} |
<|file_name|>music.py<|end_file_name|><|fim▁begin|>#Music Class and support functions
import pygame
import parameters
from filemanager import filemanager
from pygame.locals import *
from pygame import *
from pygame.mixer import *
#Pygame Module for Music and Sound
pigmusic = None
currentStdMusic=None
currentMenuMusic=... | if currentType == 'menu':
#print "music menu, currentType is menu isn't it : ",currentType
if currentMenuMusic.getfile()==self._file:
#print "music menu, same music don't do anything" |
<|file_name|>copy.cc<|end_file_name|><|fim▁begin|>// { dg-options "-std=gnu++11" }
// { dg-require-cstdint "" }
//
// 2010-02-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010-2014 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; ... | |
<|file_name|>message.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-burnout library 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 So... | }
// Decode parses the RLP content of a message into
// the given value, which must be a pointer. |
<|file_name|>toolkit.js<|end_file_name|><|fim▁begin|>re.on = function(name, callback) {
return function(el) {
return el.addEventListener(name, callback);
};
};
(function() {
[ 'click', 'dblclick', 'wheel',
'keydown', 'keyup',
'input', 'focus', 'blur',
'drag', 'd... | |
<|file_name|>MicroLock.cpp<|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://www.apache.org/licenses/... | if (!wordPtr->compare_exchange_weak(oldWord,
newWord, |
<|file_name|>xchacha20poly1305_key_manager.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 The Tink-Rust 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.ap... | tink_proto::XChaCha20Poly1305Key {
version: X_CHA_CHA20_POLY1305_KEY_VERSION,
key_value,
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import prosper.datareader.exceptions<|fim▁hole|><|fim▁end|> | import prosper.datareader._version |
<|file_name|>p037.py<|end_file_name|><|fim▁begin|><|fim▁hole|># The number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage: 3797, 797, 97, and 7. Similarly we can work from right to left: 3797, 379, 37, and 3.
# Find t... | #! /usr/bin/python3
|
<|file_name|>glprogram.cpp<|end_file_name|><|fim▁begin|>#include "glprogram.h"
#include <gl/gl3w.h>
#include <cstdio>
bool compileStatus(GLuint shader) {
int ret;
glGetShaderiv(shader, GL_COMPILE_STATUS, &ret);
return ret;
}
bool linkStatus(GLuint program) {
int ret;
glGetProgramiv(program, GL_LINK_STATUS, &ret);... | |
<|file_name|>database_sync.go<|end_file_name|><|fim▁begin|>// Copyright 2019 NDP Systèmes. All Rights Reserved.
// See LICENSE file for full licensing details.
package models
import (
"fmt"
"strings"
"github.com/hexya-erp/hexya/src/models/security"
)
// SyncDatabase creates or updates database tables with the da... | |
<|file_name|>logger.py<|end_file_name|><|fim▁begin|>import os
import inspect
import logging
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
TRACEBACK_INSPECTOR = inspect.currentframe
DEBUG = logging.DEBUG
INFO = logging.INFO
ERROR = logging.ERROR
WARNING = logging.WARN
CRITICAL = logging.CRITICAL
... | """ |
<|file_name|>bdfix.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# см. также http://habrahabr.ru/post/135863/
# "Как написать дополнение для GIMP на языке Python"
# Импортируем необходимые модули
from gimpfu import *
## fix
def bdfix(image, drawable, w0, c0, w1, c1):
# for Undo
pdb.gim... | [ |
<|file_name|>assoc-type.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 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<|fim▁hole|>// <LICENSE-MIT or... | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
<|file_name|>example02.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
A simple python example for multiprocess.
Created by yetship at 2017/4/18 08:57
"""
from random import randint
import multiprocessing
<|fim▁hole|>
def worker(lower, upper):
"""thread worker function"""
print("get a random ... | |
<|file_name|>bundles.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016, 2017 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; eithe... | |
<|file_name|>0002_auto_20180924_1938.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-09-24 19:38
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
... | name='property_name',
field=models.CharField(choices=[(b'definition', b'Definition'), (b'description', b'Description'), (b'note', b'Note'), (b'system', b'System')], help_text=b"The name of the added property; e.g., 'Description'.", max_length=50, verbose_name=b'Property Type'),
),
... |
<|file_name|>test.java<|end_file_name|><|fim▁begin|>package db;
import db.*;
<|fim▁hole|> // TODO Auto-generated method stub
Database.getInstance().register("111", "22");
// Database.getInstance().login("111", "22");
}
}<|fim▁end|> | public class test {
public static void main(String[] args) { |
<|file_name|>QmitkUSNavigationProcessWidget.cpp<|end_file_name|><|fim▁begin|>/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This soft... | {
this->SetSettingsWidgetVisible(true);
}
|
<|file_name|>export_test.go<|end_file_name|><|fim▁begin|>// -*- Mode: Go; indent-tabs-mode: t -*-
/*
* Copyright (C) 2016 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foun... | func (cm *CacheManager) Cleanup() error { |
<|file_name|>utils.js<|end_file_name|><|fim▁begin|>'use strict';
const path = require('path');
const os = require('os');
const fs = require('fs-extra');
const fieHome = require('fie-home');
const debug = require('debug')('core-report');
const fieUser = require('fie-user');
const execSync = require('child_process').exe... | /** |
<|file_name|>ruby.py<|end_file_name|><|fim▁begin|>from .base_executor import ScriptExecutor
from judgeenv import env
<|fim▁hole|> ext = '.rb'
name = 'RUBY'
address_grace = 65536
fs = ['.*\.(?:so|rb$)', '/etc/localtime$', '/dev/urandom$', '/proc/self', '/usr/lib/ruby/gems/']
test_program = 'puts gets'... |
class RubyExecutor(ScriptExecutor): |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation.
# 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
# ... | # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | import search_duplicated_task |
<|file_name|>bip.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
#################################################################################################
#
# Script Name: bip.py
# Script Usage: This script is the menu system and runs everything else. Do not use other
# files unles... | # 3.
# 4.
#
# You will probably want to do the following: |
<|file_name|>windowing.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/. */
//! Abstract windowing methods. The concrete implementation... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import './modal.less'
import { show } from './show'
import { alert } from './alert'
import { confirm } from './confirm'
import { clear } from './clear'
import { attachPropertiesToComponent } from '../../utils/attach-properties-to-component'
import { Modal } from './mod... | export default attachPropertiesToComponent(Modal, {
show,
alert, |
<|file_name|>RabinKarp.java<|end_file_name|><|fim▁begin|>// Copyright (c) 2015 Elements of Programming Interviews. All rights reserved.
package com.epi;
import java.util.Random;
public class RabinKarp {
// @include
// Returns the index of the first character of the substring if found, -1
// otherwise.
public... | // against hash collision.
if (tHash == sHash && t.substring(i - s.length(), i).equals(s)) {
return i - s.length(); // Found a match.
} |
<|file_name|>hero-list.component.ts<|end_file_name|><|fim▁begin|>// #docregion
import {Component, OnInit} from 'angular2/core';
import {Hero} from './hero';
import {HeroService} from './hero.service';
@Component({
selector: 'hero-list',
template: `
<h3>Heroes:</h3>
<ul>
<li *ngFor="#hero... | errorMessage: string; |
<|file_name|>ide-fetcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Author: Thomas Goodwin <btgoodwin@geontech.com>
import urllib2, json, os, sys, re
def download_asset(path, url):
asset_path = None
try:
file_name = os.path.basename(url)
asset_path = os.path.join(path, file_name)
... |
def handle_release_assets(assets):
assets = [ asset for asset in assets if re.match(r'redhawk-ide.+?(?=x86_64)', asset['name'])]
if not assets: |
<|file_name|>hbFontaineListController.js<|end_file_name|><|fim▁begin|>(function() {
angular.module('hb5').controller('HbFontaineListController', ['$attrs', '$scope', 'GeoxmlService', '$routeParams', '$log', '$filter', '$timeout', 'hbAlertMessages', 'hbUtil', function($attrs, $scope, GeoxmlService, $routeParams, $l... | } else {
//$log.debug(">>>>> HbFontaineListController elfins NOT YET LOADED <<<<<"); |
<|file_name|>child.js<|end_file_name|><|fim▁begin|>var lightstep = require("../../../..");
var FileTransport = require("../../../util/file_transport");
var path = require('path');
var reportFilename = path.join(__dirname, "../../../results/on_exit_child.json");<|fim▁hole|>Tracer = new lightstep.Tracer({
access_tok... | |
<|file_name|>sim_plot.py<|end_file_name|><|fim▁begin|>import sys
from ocelot.adaptors.genesis import *
from ocelot.cpbd.elements import Element, Quadrupole, RBend, Drift, Undulator
from ocelot import MagneticLattice
from ocelot.cpbd.beam import Beam
from ocelot.cpbd.optics import *
import numpy.fft as fft
from sim_i... | #params = {'backend': 'ps', 'axes.labelsize': 18, 'text.fontsize': 18, 'legend.fontsize': 18, 'xtick.labelsize': 18, 'ytick.labelsize': 18, 'text.usetex': True}
#rcParams.update(params) |
<|file_name|>boss_shadow_hunter_voshgajin.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2011-2021 Project SkyFire <https://www.projectskyfire.org/>
* Copyright (C) 2008-2021 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2021 MaNGOS <https://www.getmangos.eu/>
* Copyright (C) 2006-2014 ScriptD... | |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>"""Utilities functions which assist in the generation of commonly required data
structures from the products of placement, allocation and routing.
"""
from collections import defaultdict
from six import iteritems, itervalues
import warnings
from rig.place_and_route... | """
reservation = None
# Cores is in ascending order |
<|file_name|>page_sets.py<|end_file_name|><|fim▁begin|># Copyright 2017 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 py_utils
from telemetry import story as story_module
from telemetry.page import page as page_mo... | for url in urls_list:
self.AddStory(LeakDetectionPage(url, self, url)) |
<|file_name|>showdesktop_da_DK.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="da_DK">
<context>
<name>ShowDesktop</name>
<message><|fim▁hole|> <translation type="unfinished"></translation>
</message>
<message>
<location fil... | <location filename="../showdesktop.cpp" line="48"/>
<source>Show desktop</source> |
<|file_name|>network_environment.py<|end_file_name|><|fim▁begin|># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2011,2012,2013,2014,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... |
from aquilon.aqdb.model import NetworkEnvironment
from aquilon.worker.formats.formatters import ObjectFormatter |
<|file_name|>plotter.py<|end_file_name|><|fim▁begin|># coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals, print_function
import logging
from collections import OrderedDict
import numpy as np
from monty.json imp... | uniq_l.append(temp_ticks[i][1])
logger.debug("Unique labels are %s" % list(zip(uniq_d, uniq_l)))
plt.gca().set_xticks(uniq_d) |
<|file_name|>OperatorStats.java<|end_file_name|><|fim▁begin|>/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... | new Duration(addInputCpu, NANOSECONDS).convertToMostSuccinctTimeUnit(), |
<|file_name|>AgentProfileManager.py<|end_file_name|><|fim▁begin|>import json
import datetime
from django.core.files.base import ContentFile
from django.core.exceptions import ValidationError
from django.utils.timezone import utc
from ..models import AgentProfile
from ..exceptions import IDNotFoundError, ParamError
fr... | except IDNotFoundError:
pass |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.