prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>bolter-memory.js<|end_file_name|><|fim▁begin|>'use strict';
var Q = require('q')
, _ = require('underscore');
exports.defaults = function () { return { storage: {} }; };
exports.mixin = {
/**
* Converts `arguments` to a key to be stored.
*/
toKey: function () {
return _.toArray(argument... | return this.containsKey(this.toKey.apply(this, _.toArray(arguments)));
},
containsKey: function (key) { |
<|file_name|>ccc10j1.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
using namespace std;
<|fim▁hole|>int main()
{
int n;
cin >> n;
if(n<6)
cout << n/2+1 <<endl;
else
cout << (10-n)/2+1 <<endl;
return 0;
}<|fim▁end|> | |
<|file_name|>boss_drakkari_colossus.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.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;... | return new npc_living_mojoAI (pCreature);
} |
<|file_name|>fileio.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (C) 2014 Swift Navigation Inc.
# Contact: Gareth McMullin <gareth@swift-nav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved... | Delete a file.
Parameters |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>require.config({ urlArgs: "v=" + (new Date()).getTime() });
require(["game"], function(game) {
// I know it's ugly but it works, make game a global object
G = game;<|fim▁hole|> G.init();
$(window).resize(G.camera.resize);
G.render();
});<|fim▁end|> | |
<|file_name|>netfilter.py<|end_file_name|><|fim▁begin|>import sys
import threading
from netfilterqueue import NetfilterQueue
import dpkt
import socket
import config
logger = config.logger
class FlowControlQueue:
''' The class creates a NetfilterQueue that blocks/releases IP packets of
given types.
'''
... | self.thread_recv_pkt = None |
<|file_name|>control.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2012 Fabian Barkhau <fabian.barkhau@gmail.com>
# License: MIT (see LICENSE.TXT file)
import os
from django.core.exceptions import PermissionDenied
from apps.gallery.models import Gallery
from apps.gallery.m... | |
<|file_name|>configcache.py<|end_file_name|><|fim▁begin|># vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2018-2021 Jay Kamat <jaygkamat@gmail.com>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public ... | #
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <https://www.gnu.org/licenses/>.
|
<|file_name|>tutils.py<|end_file_name|><|fim▁begin|>from io import BytesIO
import tempfile
import os
import time
import shutil
from contextlib import contextmanager
import six
import sys
from netlib import utils, tcp, http
def treader(bytes):
"""
Construct a tcp.Read object from bytes.
"""
fp = B... | scheme=b"http",
host=b"address",
port=22,
path=b"/path", |
<|file_name|>basic.details.component.ts<|end_file_name|><|fim▁begin|>import {AbstractControl, FormBuilder, FormGroup, Validators} from "@angular/forms";
import {DatePickerOptions} from "ng2-datepicker";
import {MatchesDataStoreService} from "../../matches-data-store";
import {MatchesConstants} from "../../matches.const... | 'mom': ['', Validators.compose([Validators.required, Validators.minLength(1000000)])],
'maxovers': ['', Validators.compose([Validators.required, Validators.minLength(1)])],
'matchResult': ['', Validators.compose([Validators.required, Validators.minLength(1)])], |
<|file_name|>ValidConfigurationWithoutDefaults.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 th... | * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software |
<|file_name|>lights.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/. */
//! Module that implements lights for `PhilipsHueAdapter`
//!
... | })); |
<|file_name|>escp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2007 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU Lesser General Pub... | |
<|file_name|>render_options.rs<|end_file_name|><|fim▁begin|>use piston_window::*;
use piston_window::character::CharacterCache;
use game::config::Config;
pub struct RenderOptions<'a, G: 'a, C: 'a>
where C: CharacterCache,
G: Graphics<Texture = <C as CharacterCache>::Texture>
{<|fim▁hole|> pub charact... | pub config: &'a Config, |
<|file_name|>webpack.config.js<|end_file_name|><|fim▁begin|>/*global module, process*/
/*eslint no-use-before-define:0 */
var webpack = require('webpack');
var webpackDevServer = require('webpack-dev-server');
var path = require('path');
// Support for extra commandline arguments
var argv = require('optimist')
... | output: { |
<|file_name|>0110-Balanced Binary Tree.py<|end_file_name|><|fim▁begin|># Definition for a binary tree node.
class TreeNode:<|fim▁hole|> self.left = None
self.right = None
class Solution:
def isBalanced(self, root: TreeNode) -> bool:
def dfs(root):
if root is None:
... | def __init__(self, x):
self.val = x |
<|file_name|>ga.js<|end_file_name|><|fim▁begin|>function populate(form)
{
form.options.length = 0;
form.options[0] = new Option("Select a county of Georgia","");
form.options[1] = new Option("Appling County","Appling County");
form.options[2] = new Option("Atkinson County","Atkinson County");
form.options[3] = new Opti... | form.options[127] = new Option("Stephens County","Stephens County"); |
<|file_name|>CdbReaderFactory.java<|end_file_name|><|fim▁begin|>package org.eso.ias.cdb;<|fim▁hole|>
import org.eso.ias.cdb.json.CdbFiles;
import org.eso.ias.cdb.json.CdbJsonFiles;
import org.eso.ias.cdb.json.JsonReader;
import org.eso.ias.cdb.rdb.RdbReader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
imp... | |
<|file_name|>product-filter.pipe.ts<|end_file_name|><|fim▁begin|>import { PipeTransform, Pipe } from '@angular/core';
import { IProduct } from './product'
@Pipe({
name: 'productFilter'
})
export class ProductFilterPipe implements PipeTransform {
transform(value: IProduct[], filterBy: string): IProduct[] {
... | } |
<|file_name|>regions-fn-subtyping.rs<|end_file_name|><|fim▁begin|>// run-pass
#![allow(dead_code)]
#![allow(unused_assignments)]
// Issue #2263.
// pretty-expanded FIXME #23616
#![allow(unused_variables)]
// Should pass region checking.<|fim▁hole|> // f's type should be a subtype of g's type), because f can be
... | fn ok(f: Box<dyn FnMut(&usize)>) {
// Here, g is a function that can accept a usize pointer with
// lifetime r, and f is a function that can accept a usize pointer
// with any lifetime. The assignment g = f should be OK (i.e., |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>#coding: utf-8
__author__ = 'horacioibrahim'
import unittest, os
import datetime
from time import sleep, ctime, time
from random import randint
from hashlib import md5
from types import StringType
# python-iugu package modules
import merchant, customers, config, inv... | def test_plan_edit_changes_features_value_by_set(self):
salt = randint(1, 99) |
<|file_name|>reporter.js<|end_file_name|><|fim▁begin|><|fim▁hole|>jasmine.getEnv().clearReporters(); // remove default reporter logs
jasmine.getEnv().addReporter(new SpecReporter({ // add jasmine-spec-reporter
spec: {
displayPending: true,
},
summary: {
displayDuration: true,
}
}));<|fim▁... | const SpecReporter = require('jasmine-spec-reporter').SpecReporter;
|
<|file_name|>page-tests.ts<|end_file_name|><|fim▁begin|>import page = require("page");
//***********************************************************************
// Basic Example
// https://github.com/visionmedia/page.js/tree/master/examples/basic
//**********************************************************************... | // check if we have .state.avatar already available
// this could for example be a cached html fragment. |
<|file_name|>astconv.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.apache.org/license... | ty::ty_infer(_) => a.mode,
|
<|file_name|>ArchiveController.java<|end_file_name|><|fim▁begin|>package com.ihidea.component.datastore.archive;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import j... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################<|fim▁hole|># OpenERP, Open Source Management Solution
# Copyright (C) 2013 Smile (<http://www.smile.fr>). All Rights Reserved
#
# This program is free s... | # |
<|file_name|>semdb.cc<|end_file_name|><|fim▁begin|>//////////////////////////////////////////////////////////////////
//
// FreeLing - Open Source Language Analyzers
//
// Copyright (C) 2014 TALP Research Center
// Universitat Politecnica de Catalunya
//
// This library is free softwa... | /// Constructor of the auxiliary class "sense_info"
/////////////////////////////////////////////////////////////// |
<|file_name|>recu.rs<|end_file_name|><|fim▁begin|>/*
recu.rs
demonstrates enums, recursive datatypes, and methdos
vanilla
*/
<|fim▁hole|> println!("Product of all values in the list {:i}.",list2.prod());
}
enum IntList {
Node(int, ~IntList),
Empty
}
impl IntList {
fn sum(~self) -> int {
... | fn main() {
let list = ~Node(1, ~Node(2, ~Node(3, ~Empty)));
let list2 = ~Node(2, ~Node(3, ~Node(5, ~Empty)));
println!("Sum of all values in the list: {:i}.", list.sum()); |
<|file_name|>fix_nt_file.py<|end_file_name|><|fim▁begin|>import sys
def fix(element):
if element and element[0] == '<':
new = '<'
for c in element[1:-1]:
if c == '<':
new += '<'
elif c == '>':<|fim▁hole|> new += c
new += '>'
return new
else:
return element
for lin... | new += '>'
else: |
<|file_name|>templatetags.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship ... | assert top_scorer["user"].email_hash in rendered |
<|file_name|>generic-fn-box.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.apache.org/... |
pub fn main() { let x = f(@3); debug!(*x); } |
<|file_name|>config.spec.ts<|end_file_name|><|fim▁begin|>import config from '../src/config';
import skift from '../src/index';
describe('Config', () => {
it('should get default configuration', () => {
expect(config).toBeDefined();
expect(config.cookieName).toBeDefined();
expect(config.globa... | expect(config.sessionPersister).toBeDefined(); |
<|file_name|>css-find.js<|end_file_name|><|fim▁begin|>var search = require('simple-object-query').search,
CssSelectorParser = require('css-selector-parser').CssSelectorParser,
cssParser = new CssSelectorParser();
cssParser
.registerNestingOperators('>')
.registerAttrEqualityMods('^', '$', '*', '~')
;
... | }
}
|
<|file_name|>amp-3q-player.js<|end_file_name|><|fim▁begin|><|fim▁hole|>/**
* Copyright 2017 The AMP HTML 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
*
... | |
<|file_name|>rasterize.js<|end_file_name|><|fim▁begin|>var system = require('system');
var args = system.args;
var url = "http://"+args[1],
filename = args[2]+".png",
timeout = args[3],
savePath = args[4],
page = require('webpage').create();
//setTimeout(function(){phantom.exit();}, timeout)
page.viewportSize = { w... | |
<|file_name|>BookUpdaterProgram.java<|end_file_name|><|fim▁begin|>package com.osiykm.flist.services.programs;
import com.osiykm.flist.entities.Book;
import com.osiykm.flist.enums.BookStatus;<|fim▁hole|>import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springfra... | import com.osiykm.flist.repositories.BookRepository;
import com.osiykm.flist.services.parser.FanfictionUrlParserService; |
<|file_name|>assign_generic_numbers_gpcr.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.PDB import *
from Bio.PDB.PDBIO import Select
from common.definitions import *
from protein.models import Protein, ProteinSegment
from r... | from collections import OrderedDict
|
<|file_name|>main.controller.ts<|end_file_name|><|fim▁begin|>import * as _ from 'lodash';
import { IAppService } from '../app.service';
export class mainCtrl {
title: string;
static $inject = ['$scope', '$state', 'appService', '$mdDialog'];
constructor(private $scope, private $state: ng.ui.IStateService,... |
OnWSError(data) { |
<|file_name|>unit.go<|end_file_name|><|fim▁begin|>// Copyright 2017 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package models
// UnitType is Unit's Type
type UnitType int
// Enumerate all the unit types
const (
Unit... | 1, |
<|file_name|>shared.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. 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 {Parser as ExpressionParser} from '../expression_parser/p... | return res;
}
return value; |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Role',
... | |
<|file_name|>helloworld.rs<|end_file_name|><|fim▁begin|>#include <constants.rh>
#include <crctools.rh>
#include <math.rh>
#include <util.rh>
; vim: syntax=fasm
; Test RAR assembly file that just demonstrates the syntax.
;
; Usage:
;
; $ unrar p -inul helloworld.rar
; Hello, World!
;<|fim▁hole|> ; Install our m... |
_start: |
<|file_name|>quotasv2.py<|end_file_name|><|fim▁begin|># Copyright 2011 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
# a copy of the License at
#
# http:/... | from neutron import quota
from neutron.quota import resource_registry |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>#from flask.templating import render_template
# Also installed redis
from app import app
from flask import Flask, request, url_for, Response, redirect
from extended_client import extended_client
import json
from jinja2 import Environment, PackageLoader
import logging
f... | ip = socket.gethostbyname(socket.gethostname()) + ""
host = {} |
<|file_name|>bitcoin_mk_MK.ts<|end_file_name|><|fim▁begin|><TS language="mk_MK" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Десен клик за уредување на адреса или етикета</translation>
</message>
<messa... | </message>
<message>
<source>%1 ms</source>
<translation>%1 мс</translation> |
<|file_name|>scheduler.cc<|end_file_name|><|fim▁begin|>// Copyright 2007-2009 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE... | |
<|file_name|>bitcoin_tr.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="tr" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="14"/>
<source>About FlorijnCoin</source>
... | |
<|file_name|>build.js<|end_file_name|><|fim▁begin|>/**
* download webdriver
*/
var path = require('path');
var fs = require('fs');<|fim▁hole|>var Decompress = require('decompress');
var fse = require('fs-extra');
var debug = require('debug')('browser');
var chromeVersion = '2.20';
var phantomVersion = '1.9.7';
var ... | var rimraf = require('rimraf');
var Download = require('download'); |
<|file_name|>products.client.controller.test.js<|end_file_name|><|fim▁begin|>'use strict';
(function() {
// ProductAppliers Controller Spec
describe('ProductAppliersController', function() {
// Initialize global variables
var ProductAppliersController,
scope,
$httpBackend,
$stateParams,
$location;
... | |
<|file_name|>hashmap.go<|end_file_name|><|fim▁begin|>package datastruct
import (
"strings"
"github.com/xyproto/algernon/lua/convert"
"github.com/xyproto/gopher-lua"
"github.com/xyproto/pinterface"
)
// Identifier for the Hash class in Lua
const lHashClass = "HASH"
// Get the first argument, "self", and cast it ... |
// For a given element id (for instance a user id), check if it exists in the hash map.
// Returns true only if it exists and there were no errors.
// hash:exists(string) -> bool |
<|file_name|>generate_blink_resource_map.py<|end_file_name|><|fim▁begin|># Copyright 2015 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.
from string import Template
import optparse
import os
import sys
try:
grit_modul... | |
<|file_name|>opening.rs<|end_file_name|><|fim▁begin|>use std::io::prelude::*;
use std::path::Path;
use std::fs::File;
use std::io::Result;
use bitboard::Board;
use bitboard::Move;
use bitboard::Turn;
///
///Opening book file format:
///(16 bytes: hash table array size (n))
///n * (20 bytes: (1 byte used)(16 bytes: ... | black_minimax : i16, |
<|file_name|>fileServingSpec.js<|end_file_name|><|fim▁begin|>const frisby = require('frisby')
const config = require('config')
const URL = 'http://localhost:3000'
let blueprint
for (const product of config.get('products')) {
if (product.fileForRetrieveBlueprintChallenge) {
blueprint = product.fileForRetrieveBl... | |
<|file_name|>ConflictType.js<|end_file_name|><|fim▁begin|>"use strict";
(function (ConflictType) {
ConflictType[ConflictType["IndividualAttendeeConflict"] = 0] = "IndividualAttendeeConflict";
ConflictType[ConflictType["GroupConflict"] = 1] = "GroupConflict";
ConflictType[ConflictType["GroupTooBigConflict"] ... | ConflictType[ConflictType["UnknownAttendeeConflict"] = 3] = "UnknownAttendeeConflict";
})(exports.ConflictType || (exports.ConflictType = {}));
var ConflictType = exports.ConflictType; |
<|file_name|>test_vmhmm.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, division
import random
from itertools import permutations
import numpy as np
from scipy.stats.distributions import vonmises
import pickle
import tempfile
from sklearn.pipeline import Pipeline
from msmbuilder.example_datas... | return x - 2 * np.pi * np.floor(x / (2 * np.pi) + 0.5)
|
<|file_name|>resource.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https:... | } |
<|file_name|>JailedPlayer.java<|end_file_name|><|fim▁begin|>package net.simpvp.Jail;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;
import org.bukkit.Location;
/**
* Class representing the stored information about a jailed player
*/
public class JailedPlayer {
public UUID uuid;
... | Jail.jailed_players.add(this.uuid);
}
public void insert() { |
<|file_name|>day22.rs<|end_file_name|><|fim▁begin|>extern crate dotenv;
extern crate lettre;
extern crate uuid;
use std::env;
use lettre::email::{EmailBuilder, SendableEmail};
use lettre::transport::EmailTransport;
use lettre::transport::smtp;
struct Report {
contents: String,
recipient: String,
}
impl Senda... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate nickel;
use std::io::net::ip::Ipv4Addr;
use nickel::{ Nickel, Request, Response, HttpRouter };
fn main() {
let mut server = Nickel::new();
fn a_handler (_request: &Request, response: &mut Response) {
<|fim▁hole|> response.send("hello world... | |
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>import { Component, ViewChild, ElementRef } from '@angular/core';
import { jqxButtonGroupComponent } from '../../../../../jqwidgets-ts/angular_jqxbuttongroup';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class Ap... | this.myButtonGroup.mode('checkbox'); |
<|file_name|>check_button.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2015, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
//! Create widgets with a discrete ... | check_pointer!(tmp_pointer, CheckButton)
}
pub fn new_with_mnemonic(mnemonic: &str) -> Option<CheckButton> { |
<|file_name|>lib_dalek_config_TEST.js<|end_file_name|><|fim▁begin|>'use strict';
var expect = require('chai').expect;
var Config = require('../lib/dalek/config.js');
describe('dalek-internal-config', function () {
it('should exist', function () {
expect(Config).to.be.ok;
});
it('can be initialized', funct... | it('can read & parse a js file', function () {
var config = new Config({}, {tests: []}, {});
var fileContents = config.readjs(__dirname + '/mock/Dalekfile.js'); |
<|file_name|>mofgpr.rs<|end_file_name|><|fim▁begin|>#[doc = "Register `MOFGPR` reader"]
pub struct R(crate::R<MOFGPR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<MOFGPR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<MOFGPR_SPEC>> for R ... | |
<|file_name|>Box.uni.driver.js<|end_file_name|><|fim▁begin|>import { baseUniDriverFactory } from '../../test/utils/unidriver';<|fim▁hole|>export const boxDriverFactory = base => {
return {
...baseUniDriverFactory(base),
};
};<|fim▁end|> | |
<|file_name|>gen.rs<|end_file_name|><|fim▁begin|>// This file is @generated by syn-internal-codegen.
// It is not intended for manual editing.
use super::{Lite, RefCast};
use std::fmt::{self, Debug, Display};
impl Debug for Lite<syn::Abi> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
let... | formatter.finish()
}
syn::ForeignItem::Macro(_val) => { |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Resolves identifiers to decide if they are macros, terminals, or
//! nonterminals. Rewrites the parse tree accordingly.
use super::{NormResult, NormError};
use grammar::parse_tree::*;
use intern::{InternedString};
use collections::{map, Map};
#[cfg(test)]
mod test... | Def::MacroArg |
Def::Nonterminal(0) => SymbolKind::Nonterminal(NonterminalString(id)),
Def::Terminal => SymbolKind::Terminal(TerminalString::Bare(id)),
Def::Nonterminal(_) => return_err!(symbol.span, "`{}` is a macro", id), |
<|file_name|>required.spec.ts<|end_file_name|><|fim▁begin|>import { FormControl } from '../../form-control';
import { RequiredValidator } from './required';
describe('Required validator', () => {
let formControl: FormControl<any>;
beforeEach(() => {
formControl = new FormControl<any>(
[Req... | |
<|file_name|>lexer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from fsm import parse_automaton, accept
import re
__author__ = 'Roland'
import sys
keywords = ['float', 'char', 'print', 'input', 'break', 'continue', 'return', 'def', 'if', 'elif',
'else', 'while', 'or', 'and', 'not']
operators = ['=',... | |
<|file_name|>search.js<|end_file_name|><|fim▁begin|>// Search script generated by doxygen
// Copyright (C) 2009 by Dimitri van Heesch.
// The code in this file is loosly based on main.js, part of Natural Docs,
// which is Copyright (C) 2003-2008 Greg Valure
// Natural Docs is licensed under the GPL.
var indexSections... | |
<|file_name|>functional_tests.py<|end_file_name|><|fim▁begin|>from selenium import webdriver
from django.test import LiveServerTestCase, TestCase
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
import datetime
from planner.models import Participation, Event, Occurrence, EventType, Role
from djan... |
if __name__ == '__main__':
unittest.main() |
<|file_name|>compiler.ts<|end_file_name|><|fim▁begin|>import {Binding, resolveForwardRef, Injectable, Inject} from 'angular2/src/core/di';
import {DEFAULT_PIPES_TOKEN} from 'angular2/src/core/pipes';
import {
Type,
isBlank,
isType,
isPresent,
normalizeBlank,
stringify,
isArray,
isPromise
} from 'angular... | if (binder.hasStaticComponent() || |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import datetime
import requests
from django.test import TestCase
from wikidata import wikidata
from person.models import Person
from person.util import parse_name_surname_initials, parse_surname_comma_surname_prefix
class TestFindName(TestCase):
@classmethod
... | self.assertEqual(person.slug, 'mark-rutte') |
<|file_name|>test_format.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Test output formatting for Series/DataFrame, including to_string & reprs
"""
from __future__ import print_function
from datetime import datetime
import itertools
from operator import methodcaller
import os
import re
import sys
impor... | 'B': np.arange(41, 41 + h)}).set_index('idx') |
<|file_name|>ND280Transform_CSVEvtList.py<|end_file_name|><|fim▁begin|>from GangaCore.GPIDev.Schema import *
from GangaCore.GPIDev.Lib.Tasks.common import *
from GangaCore.GPIDev.Lib.Tasks.ITransform import ITransform
from GangaCore.GPIDev.Lib.Job.Job import JobError
from GangaCore.GPIDev.Lib.Registry.JobRegistry impor... | if parent.status != "completed":
return None
|
<|file_name|>position_correction.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
/***************************************************************************
SuroLeveling
A QGIS plugin
todo
-------------------
begin : 20... | # connect to provide cleanup on closing of dockwidget
# self.dockwidget.closingPlugin.connect(self.onClosePlugin) CAUSE OF ENABLE SECOND OPENING |
<|file_name|>opcode_ins.py<|end_file_name|><|fim▁begin|># This file is part of Androguard.
#
# Copyright (C) 2012, Geoffroy Gueguen <geoffroy.gueguen@gmail.com>
# 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.
#... | exp = UnaryExpression(Op.NEG, b, 'J')
return AssignExpression(a, exp)
|
<|file_name|>franken.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# FRANKEN CIPHER
# WRITTEN FOR ACADEMIC PURPOSES
#
# AUTHORED BY: Dan C and james@forscience.xyz
#
# THIS SCRIPT IS WRITTEN TO DEMONSTRATE A UNIQUE ENCRYPTION ALGORITHM THAT IS INSPIRED BY A NUMBER
# OF EXISTING ALGORITHMS.
# THE SCRIPT IS WRITTEN ... | |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>import {IconDefinition, IconLookup, IconName, IconPrefix, IconPathData, IconPack } from '@fortawesome/fontawesome-common-types';
export {IconDefinition, IconLookup, IconName, IconPrefix, IconPathData, IconPack } from '@fortawesome/fontawesome-common-types';
export co... | }
export interface Params {
title?: string;
classes?: string | string[]; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import sys<|fim▁hole|>sys.path.append(os.path.abspath(os.curdir))<|fim▁end|> | import os |
<|file_name|>simd.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 blake2-rfc Developers
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. This file may not be
//... | self.2.to_le(),
self.3.to_le())
}
|
<|file_name|>flushLogs.ts<|end_file_name|><|fim▁begin|>import { ClientCommand } from './clientCommand';
import { BaseCommand } from './baseCommand';
module.exports = class FlushLogs extends ClientCommand {
static create(): BaseCommand {
return new FlushLogs();
}
constructor() {
super('Flus... | } |
<|file_name|>2.module.js<|end_file_name|><|fim▁begin|>webpackJsonp([2],{
/***/ 16:
/***/ function(module, exports, __webpack_require__) {
/// <reference path="../../typings/tsd.d.ts" />
var ListController = __webpack_require__(17);
// webpack will load the html. Nifty, eh?
__webpack_require__(9);
// webpack will... | |
<|file_name|>notifications-add-interval.js<|end_file_name|><|fim▁begin|>var builder = require("botbuilder");
var botbuilder_azure = require("botbuilder-azure");
const notUtils = require('./notifications-utils.js');
module.exports = [
function (session) {
session.beginDialog('notifications-common-symbol');... | session.endDialog('Notification created!'); |
<|file_name|>common.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Common client code
#
# Copyright 2016 Markus Zoeller
import os
from launchpadlib.launchpad import Launchpad
def get_project_client(project_name):
cachedir = os.path.expanduser("~/.launchpadlib/cache/")
if not os.path.exists(cachedi... | def __str__(self):
data = {'link': self.link, 'title': self.title, 'age': self.age}
return "{link} ({title}) - ({age} days)".format(**data)
|
<|file_name|>spelling.py<|end_file_name|><|fim▁begin|># Copyright 2014 Michal Nowikowski.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) a... |
if enchant is None:
return |
<|file_name|>serviceworkercontainer.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 crate::dom::bindings::codegen::Bindings::S... | |
<|file_name|>file_exporter.py<|end_file_name|><|fim▁begin|>import shutil
import os
import errno
class file_exporter:
def __init__(self):
self.error_message = ''
def get_error_message (self):
return self.error_message
def tally_path_segments (self, file):
while (file != ''):
... | #### we strip the base path from the full filenames |
<|file_name|>analyze.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
var execSync = require('child_process').execSync;
var fs = require("fs");
var args = process.argv.slice(2);
var guid = args[0];
if (typeof guid === "undefined") {
console.log("provide a guid");
} else {
var fileList = ""+execSync("ls -lh");
... | var execStr = "cd /Users/topher/code/rfcx/worker-analysis && /usr/local/bin/python2.7"
+" /Users/topher/code/rfcx/worker-analysis/analyze.py"
+" --wav_path /Volumes/rfcx-audio/GuardianAudio/"+guid+"/"+fileName |
<|file_name|>groupLayersAlgorithm.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
/***************************************************************************
DsgTools
A QGIS plugin
Brazilian Army Cartographic Production Tools
----------------... | return self.createGroup(categoryText, rootNode)
def createGroup(self, groupName, rootNode):
""" |
<|file_name|>YQZyppSolverDialogPluginStub.cc<|end_file_name|><|fim▁begin|>/**************************************************************************
Copyright (C) 2000 - 2010 Novell, Inc.
All Rights Reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Pu... | |
<|file_name|>mnist_tf_keras.py<|end_file_name|><|fim▁begin|>import tensorflow as tf
import numpy as np
import deep_architect.modules as mo
import deep_architect.hyperparameters as hp
from deep_architect.contrib.misc.search_spaces.tensorflow.common import siso_tfm
D = hp.Discrete # Discrete Hyperparameter
def dense... | |
<|file_name|>ImportFatalError.ts<|end_file_name|><|fim▁begin|>import { c } from 'ttag';
export class ImportFatalError extends Error {
error: Error;
constructor(error: Error) {<|fim▁hole|>}<|fim▁end|> | super(c('Error importing calendar').t`An unexpected error occurred. Import must be restarted.`);
this.error = error;
Object.setPrototypeOf(this, ImportFatalError.prototype);
} |
<|file_name|>seriesPicker.js<|end_file_name|><|fim▁begin|>/**
* Piwik - free/libre analytics platform
*
* Series Picker control addition for DataTable visualizations.
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
(function ($, require) {
/**
* This c... | var self = this;
var selectedColumns = this.selectableColumns |
<|file_name|>Handler.js<|end_file_name|><|fim▁begin|>"use strict";
var _ = require("lodash");
var Base = require("./Base");
var User = require("./User");
var UpdateMixin = require("./UpdateMixin");
/**
* Ticket handler model for the client
*
* @namespace models.client
* @class Handler
* @extends models.client.B... | getUser: function(){
return this.rel("handler");
},
|
<|file_name|>base.py<|end_file_name|><|fim▁begin|># Licensed to the StackStorm, Inc ('StackStorm') 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 under the Apache License,... | if publish:
try:
if is_update:
cls.publish_update(model_object) |
<|file_name|>mongo_test.go<|end_file_name|><|fim▁begin|>package mongo
import (
"fmt"
"labix.org/v2/mgo"
"testing"<|fim▁hole|>)
var (
taro = &User{Name: "Taro", Age: 20}
hanako = &User{Name: "Hanako", Age: 22}
)
// テストデータを投入
func init() {
session, err := mgo.Dial("localhost")
if err != nil {
panic(err)
}
... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import ReactIdSwiper from './ReactIdSwiper';
// Types
export {
ReactIdSwiperProps,<|fim▁hole|> ReactIdSwiperChildren,
SwiperModuleName,
SwiperRefNode
} from './types';
// React-id-swiper
export default ReactIdSwiper;<|fim▁end|> | ReactIdSwiperRenderProps,
SelectableElement,
SwiperInstance,
WrappedElementType, |
<|file_name|>problem-039.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 Peter Beard
// Distributed under the GNU GPL v2. For full terms, see the LICENSE file.
//
// If p is the perimeter of a right angle triangle with integral length sides,
// {a,b,c}, there are exactly three solutions for p = 120.
//
// {20,48,52}... | fn num_triangles(p: u32) -> u32 { |
<|file_name|>iplookup.py<|end_file_name|><|fim▁begin|>"""This will perform basic enrichment on a given IP."""
import csv
import json
import mmap
import os
import socket
import urllib
import dns.resolver
import dns.reversename
from geoip import geolite2
from IPy import IP
from joblib import Parallel, delayed
from neta... |
def mainlookup(var):
"""Wrap the main lookup and generated the dictionary.""" |
<|file_name|>root_check.cpp<|end_file_name|><|fim▁begin|>/*root_check.c
*/
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <linux/input.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/types.h>
#include <time.... | if(fp_info)
{ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.