prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>basespace.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# filename: basespace.py
#
# Copyright (c) 2015 Bryan Briney
# License: The MIT license (http://opensource.org/licenses/MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
# and associated docume... | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
<|file_name|>snpTableMaker.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import random
__author__ = 'duceppemo'
class SnpTableMaker(object):
"""
Everything is ran inside the class because data structures have to be
shared across parent and child process during multi threading
"""
... | if line: # skip blank lines or lines with only whitespaces
if line.startswith('##'): # skip comment lines
continue |
<|file_name|>__manifest__.py<|end_file_name|><|fim▁begin|># Copyright 2017 ForgeFlow S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Purchase Order Approved",
"summary": "Add a new state 'Approved' in purchase orders.",
"version": "14.0.1.1.0",
"category": "Purchases",<|f... | "website": "https://github.com/OCA/purchase-workflow",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"license": "AGPL-3", |
<|file_name|>genderController.js<|end_file_name|><|fim▁begin|>import { exec, getById } from "../database/database";
import Gender from "../entities/gender";
export default class GenderController {
constructor() {}
static getById(id, as_object = true) {
let gender = null;
let results = getById(id,
`<... | SELECT
t1.id,
t1.identifier as name
FROM genders as t1 |
<|file_name|>event.py<|end_file_name|><|fim▁begin|>"""
sentry.models.event
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import logging
from django.db import models
from django.utils import timezone
from django.utils.da... | |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>import os
import logging
from urllib.parse import urlencode, unquote
from flask import request, current_app
from flask_api import FlaskAPI
from flask_api.exceptions import APIException, NotFound
from . import services
from . import stores
from . import routes
log = lo... | app.register_blueprint(routes.links.blueprint)
app.register_blueprint(routes.image.blueprint) |
<|file_name|>quick-start.go<|end_file_name|><|fim▁begin|>package assets
var Init_doc_quick_start = `# 0.1 - Quick Start
This is a set of short examples with minmal explanation. It is meant as
a "quick start". Soon, we'll write a longer tour :-)
Add a file to ipfs:
echo "hello world" >hello
ipfs add hello
Vie... | |
<|file_name|>suggestions.js<|end_file_name|><|fim▁begin|>var clientElasticsearch = require("../../../Elasticsearch/ElasticsearchClient");
var ElasticsearchParser = require("../../../Elasticsearch/ElasticsearchParser");
var Q = require('q');
var getSuggestions=function(){
return clientElasticsearch.search({
"index":... | |
<|file_name|>CamBlur.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Create the RenderWindow, Renderer and both Actors
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(r... | spikeActor2 = vtk.vtkActor() |
<|file_name|>A10BaseClass.py<|end_file_name|><|fim▁begin|>__author__ = 'mthompson'
import copy
import inspect
import importlib
import urllib
import json
from urlparse import urlparse
import collections
import re
import os
import keyword
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
class A10BaseClass(object)... | |
<|file_name|>NewContact.py<|end_file_name|><|fim▁begin|>from models.contact import Contacts
from data.data_for_contacts import constant as testdata
import pytest
def test_NewContact(app, db, json_contacts):
contact = json_contacts
old_contacts = db.get_contact_list()<|fim▁hole|> app.contacts.create_contac... | |
<|file_name|>fake_dbclient.go<|end_file_name|><|fim▁begin|>/*
Copyright 2019 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.<|fim▁hole|>Unless required by applicable law or agreed to in writing, software
distributed un... | You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
|
<|file_name|>msg.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
This file is part of libzmq, the ZeroMQ core engine in C++.
libzmq is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License ... | |
<|file_name|>IdentityProvider.java<|end_file_name|><|fim▁begin|>/*
* SonarQube
* Copyright (C) 2009-2016 SonarSource SA<|fim▁hole|> * mailto:contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as pu... | |
<|file_name|>GoldStandard.java<|end_file_name|><|fim▁begin|>package de.uni_koeln.spinfo.textengineering.ir.eval;
import java.util.ArrayList;
import java.util.List;
import de.uni_koeln.spinfo.textengineering.ir.basic.Work;
import de.uni_koeln.spinfo.textengineering.ir.boole.PositionalIndex;
import de.uni_koeln.spinfo.... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>"""
Views for the verification flow
"""
import json
import logging
import decimal
from mitxmako.shortcuts import render_to_response
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseBadReq... | |
<|file_name|>album.rs<|end_file_name|><|fim▁begin|>use postgres;
use uuid::Uuid;
use std::fmt;
use chrono::{NaiveDateTime, Utc};
use apple_music;
use spotify;
use error::Error;
use super::{conn, Model};
use model::provider::Provider;
use model::state::State;
use model::enclosure::Enclosure;
use model::track::Track;
us... | } |
<|file_name|>attributes.go<|end_file_name|><|fim▁begin|>/*
Copyright IBM Corp. 2016 All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.... | //EncryptAttributeValuePK0 encrypts "attributeValue" using a key derived from preK0.
func EncryptAttributeValuePK0(preK0 []byte, attributeName string, attributeValue []byte) ([]byte, error) { |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
h "goshawkdb.io/tests/harness"
"log"
"time"
)
func main() {
setup := h.NewSetup()
config1, err := h.NewPathProvider("./v1.json", false)
if err != nil {
log.Fatal(err)
}
config2, err := h.NewPathProvider("./v2.json", false)
if err != n... | rm2.Wait(),
rm3.Wait(), |
<|file_name|>ajax.js<|end_file_name|><|fim▁begin|>// ajax mode: abort
// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()
var pendingRequests = {},
ajax;
// Use a prefilter if available... | // Proxy ajax |
<|file_name|>incremental.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 flow::{self, FlowFlags, Flow};
use style::computed_va... | /// Used in a flow traversal to indicate whether this re-layout should be incremental or not. |
<|file_name|>StalkerRequestHandler.java<|end_file_name|><|fim▁begin|>package com.mvas.webproxy.portals;
import com.mvas.webproxy.DeviceConnectionInfo;
import com.mvas.webproxy.RequestData;
import com.mvas.webproxy.WebServer;
import com.mvas.webproxy.config.PortalConfiguration;
import org.apache.commons.io.IOUtils;
im... | HashMap<String, String> list = params.getList();
for(String name: configOptions) |
<|file_name|>0005_auto__chg_field_campaign_user.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
... | 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}) |
<|file_name|>jasmine-html.js<|end_file_name|><|fim▁begin|>/* */
"format global";
jasmine.HtmlReporterHelpers = {};
jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
var el = document.createElement(type);
for (var i = 2; i < arguments.length; i++) {
var child = arguments[i];
... | |
<|file_name|>teamstestsutils.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from django.core.management import call_command
from teams.models import Team, TeamMember, Workflow
from widget.rpc import Rpc
def refresh_obj(m):
return m.__class__._default_manager.get(pk=m.pk)
def reset_solr()... | call_command('update_index')
rpc = Rpc() |
<|file_name|>dellos6.py<|end_file_name|><|fim▁begin|>#
# (c) 2016 Red Hat Inc.
#
# (c) 2017 Dell EMC.
#
# This file is part of Ansible
#
# Ansible 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... | def on_unbecome(self):
prompt = self._get_prompt()
if prompt is None:
# if prompt is None most likely the terminal is hung up at a prompt |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import Form from 'cerebral-module-forms/Form'
import submitForm from './chains/submitForm'
import resetForm from './chains/resetForm'
import validateForm from './chains/validateForm'
<|fim▁hole|> module.addState(Form({
name: {
value: '',
isRequ... | export default (options = {}) => {
return (module, controller) => { |
<|file_name|>SkidSteerDrivePlugin.cc<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2012-2014 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> *
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in wr... | * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at |
<|file_name|>dao_contact.go<|end_file_name|><|fim▁begin|>package user
import (
"context"
"regexp"
"time"
"github.com/go-gorp/gorp"
"github.com/rockbears/log"
"github.com/ovh/cds/engine/api/database/gorpmapping"
"github.com/ovh/cds/engine/gorpmapper"
"github.com/ovh/cds/sdk"
)
func getContacts(ctx context.Co... | }
|
<|file_name|>queryz.go<|end_file_name|><|fim▁begin|>/*
Copyright 2019 The Vitess 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
Unless requ... | val := float64(qzs.RowsReturned) / float64(qzs.Count) |
<|file_name|>216_havana.py<|end_file_name|><|fim▁begin|># Copyright 2012 OpenStack Foundation
#
# 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/licens... | key_pairs = Table('key_pairs', meta,
Column('created_at', DateTime),
Column('updated_at', DateTime),
Column('deleted_at', DateTime), |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.contrib import admin
from models import FileMapping
# Register your models here.
<|fim▁hole|>admin.site.register(FileMapping)<|fim▁end|> | |
<|file_name|>FraudDetectionController.java<|end_file_name|><|fim▁begin|>package com.example.fraud;
import static org.springframework.web.bind.annotation.RequestMethod.PUT;
import java.math.BigDecimal;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMa... | return new FraudCheckResult(FraudCheckStatus.OK, NO_REASON);
}
|
<|file_name|>shell_tests_main.cc<|end_file_name|><|fim▁begin|>// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/command_line.h"
#include "base/test/launcher/test_launcher.h"<|fim▁hole|>#inc... | |
<|file_name|>windows_registry.py<|end_file_name|><|fim▁begin|>#!./env/bin/python
""" Windows Registry Network Query
Lists the network name and MAC addresses of the networks that
this computer has connected to. If the location command is given
print the coordinates of the network if they are in the wigile
... | --version Display the version of this program
""" |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use core::primitives::*;
use core::io::*;
use operations::scope::ScopeStack;
/// Populates the given scope with all declarations that
/// should be available in every module at the top level
/// (known as the Prelude)
pub fn populate_scope(scope: &mut ScopeStack) {
... | } |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>var app = app || {};
$(function() { //when DOM is ready...
if ( app.user_session ) {
console.log( "%csession" , "font-size: 2em; color: rgba(100,100,200,1.0);" );
} else {
console.log( "%cno session" , "font-size: 2em; color: rgba(200,100,100,1.0);" );
}
... | }); |
<|file_name|>term_query.rs<|end_file_name|><|fim▁begin|>use super::term_weight::TermWeight;
use crate::query::bm25::Bm25Weight;
use crate::query::Weight;
use crate::query::{Explanation, Query};
use crate::schema::IndexRecordOption;
use crate::Searcher;
use crate::Term;
use std::collections::BTreeMap;
use std::fmt;
///... | /// title => "The Diary of a Young Girl",
/// ))?; |
<|file_name|>HTMLProgressElement.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Founda... | |
<|file_name|>_keyToPairIn.js<|end_file_name|><|fim▁begin|>import _curry2 from "./_curry2";
/**
* Accepts an object and build a function expecting a key to create a "pair" with the key
* and its value.
* @private
* @function
* @param {Object} obj
* @returns {Function}
*/
var _keyToPairIn = _curry2(function (obj,... | |
<|file_name|>DetachInstancesResponse.java<|end_file_name|><|fim▁begin|>package com.aliyun.api.ess.ess20140828.response;
import com.aliyun.api.AliyunResponse;
import com.taobao.api.internal.mapping.ApiField;
/**
* TOP API: ess.aliyuncs.com.DetachInstances.2014-08-28 response.
*
* @author auto create
* @since 1.0,... | /**
* 1 |
<|file_name|>timeStub.cpp<|end_file_name|><|fim▁begin|>#include "hal/time/time.hpp"
namespace hal
{
namespace time
{
static u64 currentTime = 0;
u64 milliseconds()
{
return currentTime;
}
} // namespace time
} // namespace hal
namespace stub
{
namespace time
{
void setCurrentTime(u64... |
void forwardTime(u64 milliseconds)
{
|
<|file_name|>DP - Subset Sum.cpp<|end_file_name|><|fim▁begin|>//Subset-Sum -> (G = O valor total sendo testado, N = numero de valores disponiveis no array 'values'<|fim▁hole|> sub[0] = 1;
for(j = 0; j < n; j++) if(values[j] != g) {
for(int k = g; k >= values[j]; k--) {
sub[k] |= sub[k - value... | int values[n];
bool subsetSum(int n, int g) {
for(j = 0; j <= g; j++) sub[j] = 0; |
<|file_name|>SipAddressDataItem.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:... | |
<|file_name|>data_utils.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import os
import re
import numpy as np
import tensorflow as tf
stop_words=set(["a","an","the"])
def load_candidates(data_dir, task_id):
assert task_id > 0 and task_id < 6
candidates=[]
candidates_f=None
can... | story_query_vocab.add(w)
story_query_vocab = story_query_vocab.intersection(atmosphere_restriction_set) |
<|file_name|>test_shutdown.rs<|end_file_name|><|fim▁begin|>use std::thread::{self};
use std::time::{Duration};
use umio::{ELoopBuilder};
use {MockDispatcher, MockMessage};
#[test]
fn positive_execute_shutdown() {
let eloop_addr = "127.0.0.1:0".parse().unwrap();
let mut eloop = ELoopBuilder::new()
.bi... | }); |
<|file_name|>resolve_dns_test.go<|end_file_name|><|fim▁begin|>package uri
import (
"testing"
"github.com/telehash/gogotelehash/Godeps/_workspace/src/github.com/stretchr/testify/assert"
_ "github.com/telehash/gogotelehash/e3x"
)
func Test_resolveDNS(t *testing.T) {
// When using boot2docker run:
// boot2docke... | panic(err)
}
|
<|file_name|>usat.rs<|end_file_name|><|fim▁begin|>use crate::core::instruction::Instruction;
#[allow(non_snake_case)]
pub fn decode_USAT_t1(opcode: u32) -> Instruction {
Instruction::UDF {
imm32: 0,<|fim▁hole|> thumb32: true,
}
}<|fim▁end|> | opcode: opcode.into(), |
<|file_name|>ban.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 https://mozilla.org/MPL/2.0/. */
#![feature(plugin)]
#![plugin(script_plugins)]
extern crate js;... | use std::cell::Cell; |
<|file_name|>CustomLabel.java<|end_file_name|><|fim▁begin|>/*
* uiComponents.CustomLabel
*
*------------------------------------------------------------------------------
* Copyright (C) 2006-2008 University of Dundee. All rights reserved.
*
*
* This program is free software; you can redistribute it and/or mo... | *------------------------------------------------------------------------------ |
<|file_name|>DirectionalLightHelper.js<|end_file_name|><|fim▁begin|>/**
* @author alteredq / http://alteredqualia.com/
* @author mrdoob / http://mrdoob.com/
* @author WestLangley / http://github.com/WestLangley
*/
THREE.DirectionalLightHelper = function ( light, size ) {
THREE.Object3D.call( this );
this.light... | |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "photoboard.settings")
application = get... | """
WSGI config for photoboard project.
It exposes the WSGI callable as a module-level variable named ``application``. |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>SUCCESS_URL_KEY = 'twitter_success_url'
USERINFO_KEY = 'twitter_user_info'<|fim▁end|> | ACCESS_KEY = 'twitter_access_token'
REQUEST_KEY = 'twitter_request_token' |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod mod2a;
mod mod2b;
mod mymod1 {
use mod2a::{Bar, Foo};
mod mod3a;
}
#[path = "mod2c.rs"]
mod mymod2;
<|fim▁hole|><|fim▁end|> | mod submod2; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Lexical analysis.
use std::str;
use std::fmt;
use kailua_diag::{Locale, Localize, Localized};
use string::{Name, Str};
/// A token.
#[derive(Clone, Debug, PartialEq)]
pub enum Tok {
/// A token which is distinct from all other tokens.
///
/// The lexer... |
meta_only { // Kailua extensions
Assume b"assume", /// `assume`. [M] |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory<|fim▁hole|><|fim▁end|> | ##############################################################################
from . import account_move
from . import account_move_line
from . import account_master_port |
<|file_name|>action.go<|end_file_name|><|fim▁begin|>// Copyright 2014 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package state
import (
"time"
"github.com/juju/errors"
"github.com/juju/loggo"
"github.com/juju/names"
"github.com/juju/utils"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bso... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from . import website |
<|file_name|>flac.js<|end_file_name|><|fim▁begin|>(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return ... | break;
|
<|file_name|>rlseries_scraper.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of ... | return frozenset([VIDEO_TYPES.SEASON, VIDEO_TYPES.EPISODE])
|
<|file_name|>unboxed-closures-extern-fn.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
// http://www... | // option. This file may not be copied, modified, or distributed
// except according to those terms. |
<|file_name|>test_auth_crypt.py<|end_file_name|><|fim▁begin|>import json
import pytest
from indy import crypto, did, error
@pytest.mark.asyncio
async def test_auth_crypt_works_for_created_key(wallet_handle, seed_my1, verkey_my2, message):
verkey = await did.create_key(wallet_handle, json.dumps({'seed': seed_my1... | |
<|file_name|>glue.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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.apache.org/licen... | And(bcx, not_init, not_done, DebugLoc::None);
with_cond(bcx, drop_flag_neither_initialized_nor_cleared, |cx| {
let llfn = cx.ccx().get_intrinsic(&("llvm.debugtrap")); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
logbook.testsuite
~~~~~~~~~~~~~~~~~
The logbook testsuite.
:copyright: (c) 2010 by Armin Ronacher, Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import sys
import unittest
import logbook
_skipped_m... | sys.modules[name] = old
return wrapper |
<|file_name|>test_discovery.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from turnstile.checks import get_checks
from turnstile.manager import get_commands
CORE_COMMIT_MSG_CHECKS = ['branch_pattern', 'branch_release', 'branch_type', 'protect_master', 'specification']
CORE_SUBCOMMANDS ... | |
<|file_name|>recovery_journal_chapters.py<|end_file_name|><|fim▁begin|>#utils
from struct import pack
from struct import unpack
def timestamp_compare(x, y):
if x[1]>y[1]:
return 1
elif x[1]==y[1]:
return 0
else: # x[1]<y[1]
return -1
def reverse_timestamp(x, y):
return y[1]-x[1... | velocity = note_on[0][2] |
<|file_name|>0003_auto_20141104_2232.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
<|fim▁hole|>
class Migration(migrations.Migration):
dependencies = [
('blog', '0002_auto_20141029_1945'),
]
operations = [
... | |
<|file_name|>app.module.js<|end_file_name|><|fim▁begin|>"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "obj... | __metadata('design:paramtypes', []) |
<|file_name|>croc-hunter.go<|end_file_name|><|fim▁begin|>// The infamous "croc-hunter" game as featured at many a demo
package main
import (
"flag"
"fmt"
"log"
"net/http"
"os"
)
func main() {
httpListenAddr := flag.String("port", "8080", "HTTP Listen address.")
flag.Parse()
log.Println("Starting server...")... | fmt.Fprintf(w, html, hostname, release, commit, powered)
} |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// src/cpu/mod.rs
// Copyright 2016 Alexis Williams
//
// Licensed under the MIT License <http://opensource.org/licenses/MIT>.
// CPU-specific modules
#[cfg(all(target_arch = "thumbv7a", feature = "cpu-am335x"))]
pub use self::am335x::*;
#[macro_use]<|fim▁hole|><|fim▁e... | pub mod generic;
pub mod am335x; |
<|file_name|>interfaceorg_1_1onosproject_1_1net_1_1behaviour_1_1PortAdmin.js<|end_file_name|><|fim▁begin|>var interfaceorg_1_1onosproject_1_1net_1_1behaviour_1_1PortAdmin =<|fim▁hole|>];<|fim▁end|> | [
[ "enable", "interfaceorg_1_1onosproject_1_1net_1_1behaviour_1_1PortAdmin.html#a4fa39b1dc477558945e9211986dabcf3", null ] |
<|file_name|>test_utils_request.py<|end_file_name|><|fim▁begin|>import unittest
from scrapy.http import Request
from scrapy.utils.request import request_fingerprint, _fingerprint_cache, \
request_authenticate, request_httprepr
class UtilsRequestTest(unittest.TestCase):
def test_request_fingerprint(self):
... |
def test_request_httprepr_for_non_http_request(self): |
<|file_name|>cmd_resp.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 TiKV Project Authors. Licensed under Apache-2.0.
use std::error;
use crate::Error;
use kvproto::raft_cmdpb::RaftCmdResponse;
pub fn bind_term(resp: &mut RaftCmdResponse, term: u64) {
if term == 0 {
return;
}
resp.mut_header(... | |
<|file_name|>test_transmuters.py<|end_file_name|><|fim▁begin|># coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import warnings
import unittest
import os
from pymatgen.alchemy.transmuters import CifTransmuter, PoscarTransmuter
from pymatgen.alchemy.filters im... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import logging
import os
import shlex
import unittest
import sys
from toil.common import toilPackageDirPath
from toil.lib.bioio import getBasicOptionParser, parseSuiteTestOptions
log = logging.getLogger(__name__)
class ToilTest(unittest.TestCase):
"""
A ... | super(ToilTest, self).tearDown()
log.info("Tearing down down %s", self.id()) |
<|file_name|>tokeniser.rs<|end_file_name|><|fim▁begin|>//! The _Tokeniser_ class.
#![experimental]
use std::char::is_whitespace;
use escape_scheme::EscapeScheme;
/// A tokeniser object.
///
/// A Tokeniser can be fed characters from an iterator, string, or individually.
/// It is an _immutable_ object: actions on a... | ///
/// * `quote_map` - A map, mapping characters that serve as opening quotes
/// to their closing quotes and quote modes. |
<|file_name|>fashion_mnist_cnn.py<|end_file_name|><|fim▁begin|>'''Trains a simple convnet on the Fashion MNIST dataset.
Gets to % test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
'''
from __future__ import print_function
import keras
from keras.datasets import fashion_mnist
from ke... | x_test = x_test.reshape(x_test.shape[0], 1, img_rows, img_cols) |
<|file_name|>bitcoin_id_ID.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="id_ID" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About minty</source>
<translation type="unfinis... | </message>
<message>
<location line="+95"/>
<source>Wallet %s resides outside data directory %s.</source> |
<|file_name|>test_mgmt_containerregistry_2017_03_01.py<|end_file_name|><|fim▁begin|># coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license... | RegistryCreateParameters,
RegistryUpdateParameters,
StorageAccountParameters,
Sku, |
<|file_name|>test_fibermatch.py<|end_file_name|><|fim▁begin|>import pytest
from megaradrp.processing.fibermatch import generate_box_model
from megaradrp.processing.fibermatch import count_peaks
PEAKS = [
3.806000000000000000e+03,
3.812000000000000000e+03,
3.818000000000000000e+03,
3.82400000000000000... | 3.830000000000000000e+03,
3.836000000000000000e+03, |
<|file_name|>test_funcs.py<|end_file_name|><|fim▁begin|>import unittest
from libs.funcs import *
class TestFuncs(unittest.TestCase):
<|fim▁hole|>
recPaths, repPaths, rouPaths, corePaths = buildPaths()
findTxt = lambda x, y: x.find(y) > -1
assert findTxt(recPaths["Task"][0], "base")
ass... | def test_buildPaths(self): |
<|file_name|>svg-sample-icons.js<|end_file_name|><|fim▁begin|>/**
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
http://polymer.github.io/AUTHOR... | </g> |
<|file_name|>shared.ts<|end_file_name|><|fim▁begin|>import { NgModule, ModuleWithProviders } from '@angular/core';<|fim▁hole|>import { CommonModule } from "@angular/common";
import { SharedComponent } from './src/components/shared.component';
import { SharedService } from './src/services/shared.service';
export * fro... | |
<|file_name|>ng2-file-upload.component.ts<|end_file_name|><|fim▁begin|>/// <reference path="../../../typings/tsd.d.ts" />
import {Component} from '@angular/core';
import { Http, Response, Headers, RequestOptions} from '@angular/http';
import {CORE_DIRECTIVES, FORM_DIRECTIVES, NgClass, NgStyle} from '@angular/common... | })
export class NG2FileUploadComponent {
|
<|file_name|>games.js<|end_file_name|><|fim▁begin|>var express = require('express');
var router = express.Router();
// Play a game from the DB
router.get('/games', function (req, res) {<|fim▁hole|><|fim▁end|> | res.render('games', data);
});
module.exports = router; |
<|file_name|>lib.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/licens... | #[deprecated="use `Path::parse`"]
pub fn path_from_str(s: &str) -> Result<Path, String> {
Path::parse(s) |
<|file_name|>case4_air_quality_analysis9.py<|end_file_name|><|fim▁begin|>fig, ax = plt.subplots()
data['2012':].mean().plot(kind='bar', ax=ax, rot=0, color='C0')
ax.set_ylabel("NO$_2$ concentration (µg/m³)")
ax.axhline(y=40., color='darkorange')
ax.text(0.01, 0.48, 'Yearly limit is 40 µg/m³',
horizontalalignmen... | transform=ax.transAxes, color='darkorange'); |
<|file_name|>log.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# log.py - Copyright (C) 2015 Red Hat, Inc.
# Written by Ryan Barry <rbarry@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publishe... | })
|
<|file_name|>test_is_thue_morse.py<|end_file_name|><|fim▁begin|>"""Test."""
import pytest
TM_TABLE = [
([0, 1, 1, 0, 1], True),
([0], True),
([1], False),
([0, 1, 0, 0], False),<|fim▁hole|>]
@pytest.mark.parametrize("n, result", TM_TABLE)
def test_is_thue_morse(n, result):
"""Test."""
from ... | |
<|file_name|>util.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2010 Michael Buesch <m@bues.ch>
*
* 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 ... | while (msecs >= 1000) {
time.tv_sec++;
msecs -= 1000; |
<|file_name|>SCORM13API.java<|end_file_name|><|fim▁begin|>package org.sakaiproject.scorm.ui.player.behaviors;
import org.adl.api.ecmascript.SCORM13APIInterface;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.sakaiproject.scorm.model.api.ScoBean;
import org.sakaiproject.... |
if (isSuccessful) {
result = STRING_TRUE;
|
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian<|fim▁hole|>fn main() {
println!("cargo:rustc-flags=-l usp10");
}<|fim▁end|> | // Licensed under the MIT License <LICENSE.md> |
<|file_name|>EqualElement.java<|end_file_name|><|fim▁begin|>/*
* lemonjuice - Java Template Engine.
* Copyright (C) 2009-2012 Manuel Tomis manuel@codegremlins.com
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published ... | |
<|file_name|>MapleTVEffect.java<|end_file_name|><|fim▁begin|>/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it ... | setActive(active_); |
<|file_name|>test_provider.py<|end_file_name|><|fim▁begin|>import numpy as np
from esdl.cube_provider import CubeSourceProvider
from esdl.cube_config import CubeConfig
class TestCubeSourceProvider(CubeSourceProvider):
"""
CubeSourceProvider implementation used for testing cube generation without any source fi... | The following usage generates a cube with two variables ``test_1`` and ``test_2``:
cube-gen -c ./myconf.py ./mycube test:var=test_1 test:var=test_2 |
<|file_name|>log.rs<|end_file_name|><|fim▁begin|>//! Logger implementation
use std::fs::File;
use std::io::Write;
use std::fs::OpenOptions;
use std::path::PathBuf;
use std::collections::HashMap;
use std::sync::{Mutex, MutexGuard};
use std::borrow::Borrow;
use std;
/// Logger category. Logger can be configured to save... | default_settings: LoggerSettings,
category_settings: HashMap<LoggerCategory, LoggerSettings>, |
<|file_name|>sr_masterctl.rs<|end_file_name|><|fim▁begin|>// SairaDB - A distributed database
// Copyright (C) 2015 by Siyu Wang
//
// 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 vers... | use std::collections::HashMap; |
<|file_name|>blockDoc.rs<|end_file_name|><|fim▁begin|>/*! # Iterator
*
* The heart and soul of this module is the [`Iterator`] trait. The core of<|fim▁hole|> * trait Iterator {
* type Item;
* fn next(&mut self) -> Option<Self::Item>;
* }
* ```
*
* An iterator has a method, [`next()`], which when ... | * [`Iterator`] looks like this:
*
* ``` |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>import sys
import gc
import pygame
from pygame.locals import *
from input import *
import snd
TICKS_PER_SECOND = 25
GAMETICKS = 1000 / TICKS_PER_SECOND
def set_game_speed( slowdown ):
global TICKS_PER_SECOND
global GAMETICKS
TICKS_PER_SEC... | |
<|file_name|>permissions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from __fu... | discard_url=get_model_url(self.object),
with_split_save=False
) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.