prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>test_line.py<|end_file_name|><|fim▁begin|>import copy
import pytest
from peek.line import InvalidIpAddressException, Line, InvalidStatusException
# 127.0.0.1 - - [01/Jan/1970:00:00:01 +0000] "GET / HTTP/1.1" 200 193 "-" "Python"
test_line_contents = {
'ip_address': '127.0.0.1',
'timestamp': '[0... | 'user_agent': 'Python'
}
|
<|file_name|>endpoint_delete.py<|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 applicabl... | |
<|file_name|>pagination.js<|end_file_name|><|fim▁begin|>var Pagination = Pagination || function(container, goto) {
"use strict";
var $pg = $(container);
var span = 5;
$pg.on("click", "a", function() {
event.preventDefault();
var page = $(this).prop("id");
goto(page);
});... | if (page > 1) {
html.push("<a href='#' id='{0}'><span class='glyphicon glyphicon-chevron-left'></span></a>".build(page-1));
} |
<|file_name|>component_manager.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# ... | |
<|file_name|>test_blog_category.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals<|fim▁hole|>
import frappe
test_records = frappe.get_test_records('Blog Category')<|fim▁end|> | |
<|file_name|>objectmanager.py<|end_file_name|><|fim▁begin|>"""
Contains functionality relate to interfacing wiggly and puq
"""
import binascii,os,re
import numpy as np
import matplotlib.pyplot as plt
import shapely.geometry
import CrispObjects,FuzzyObjects,fuzz,utilities
import _distributions as distributions
import pu... | baseShapeData['isClosed'], |
<|file_name|>callable.hpp<|end_file_name|><|fim▁begin|>// Boost.TypeErasure library
//
// Copyright 2011 Steven Watanabe
//
// Distributed under the Boost Software License Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// $Id$
#if !defined(BOOST_PP_IS_ITER... | struct concept_interface<
callable<R(BOOST_PP_ENUM_PARAMS(N, T)), F>, |
<|file_name|>cli.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
var listCommand = [];
require('./listCommand')(listCommand)
var logDetail = (str) => {
console.log(' > '+str);
}
var printHelp = () => {
var txtHelp = "";
var h = ' ';
var t = ' ';
txtHelp += "\n"+h+"Usage : rider [command] \n";
txtHelp ... | txtHelp +=txt;
txtHelp +"\n";
});
console.log(txtHelp); |
<|file_name|>search_term_targeting_status.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/ads/googleads/v2/enums/search_term_targeting_status.proto
package enums
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "google.golang.org/genp... | "ADDED_EXCLUDED": 4,
"NONE": 5,
}
|
<|file_name|>IndicesParser.java<|end_file_name|><|fim▁begin|>package com.github.obourgain.elasticsearch.http.response.parser;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.elasticsearch.common.xcontent.XContentParser;
import com.github.obourgain.elasticse... | import com.github.obourgain.elasticsearch.http.response.entity.ShardFailure; |
<|file_name|>helpers_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes Authors.
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 writing, software
distributed under the Licens... | you may not use this file except in compliance with the License.
You may obtain a copy of the License at
|
<|file_name|>Embed.js<|end_file_name|><|fim▁begin|>Ext.define("Voyant.notebook.util.Embed", {
transferable: ['embed'],
embed: function() { // this is for instances
embed.apply(this, arguments);
},
constructor: function(config) {
var me = this;
},
statics: {
i18n: {},
api: {
embeddedParameters: undefine... | } |
<|file_name|>DbWrite.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2013-2018 Emmanuel BRUN (contact@amapj.fr)
*
<|fim▁hole|> * AmapJ is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, eithe... | * This file is part of AmapJ.
*
|
<|file_name|>toscanfv_parser.py<|end_file_name|><|fim▁begin|>import json
import pyaml
import yaml
from lib.util import Util
from lib.parser import Parser
import logging
import traceback
import glob
import os
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger('ToscanfvParser')
class ToscanfvParser(Parser... | 'toscayaml':{},
'positions': {} |
<|file_name|>MakeVerboseFormat.cpp<|end_file_name|><|fim▁begin|>/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
All rights reserved.
Red... | while (pcMesh->HasTextureCoords(p))
{ |
<|file_name|>movie4kis.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
fantastic Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, o... | try:
name = item[0]
name = client.replaceHTMLCodes(name) |
<|file_name|>S15.4.4.11_A7.1.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.<|fim▁hole|>/**
* The length property of sort has the attribute DontEnum
*
* @path ch15/15.4/15.4.4/15.4.4.11/S15.4.4.11_A7.1... | |
<|file_name|>radiowatchframe.py<|end_file_name|><|fim▁begin|>import wx
import sys
import os
import time
import threading
import math
import pynotify
import pygame.mixer
sys.path.append(os.getenv("PAPARAZZI_HOME") + "/sw/ext/pprzlink/lib/v1.0/python")
from pprzlink.ivy import IvyMessagesInterface
WIDTH = 150
HEIGHT ... | |
<|file_name|>CodeGenAction.cpp<|end_file_name|><|fim▁begin|>//===--- CodeGenAction.cpp - LLVM Code Generation Frontend Action ---------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
... | // Create the copy and transfer ownership to clang::SourceManager.
// TODO: Avoid copying files into memory.
std::unique_ptr<llvm::MemoryBuffer> CBuf =
llvm::MemoryBuffer::getMemBufferCopy(LBuf->getBuffer(), |
<|file_name|>derives-span-PartialEq-struct.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 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://... | x: Error //~ ERROR |
<|file_name|>RdbmsStoreFactory.java<|end_file_name|><|fim▁begin|>package xsmeral.semnet.sink;
import java.util.Properties;
import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.sail.SailRepository;
import org.openrdf.sail.rdbms.RdbmsStore;
/**
* Fa... | if (jdbcDriver == null || url == null || user == null || pwd == null) { |
<|file_name|>configuration.py<|end_file_name|><|fim▁begin|>"""Configure heppyplotlib or the underlying matplotlib."""
import matplotlib.pyplot as plt
def use_tex(use_serif=True, overwrite=True, preamble=None):
"""Configure pyplot to use LaTeX for text rendering."""
if plt.rcParams['text.usetex'] and not over... | preamble = [r'\usepackage{amsmath}', |
<|file_name|>bitmap_glyph.rs<|end_file_name|><|fim▁begin|>use std::ptr::null_mut;
use { ffi, Bitmap };
pub struct BitmapGlyph {
library_raw: ffi::FT_Library,
raw: ffi::FT_BitmapGlyph
}
impl BitmapGlyph {
pub unsafe fn from_raw(library_raw: ffi::FT_Library, raw: ffi::FT_BitmapGlyph) -> Self {
ffi::... | }
#[inline(always)] |
<|file_name|>TIFFHeader.java<|end_file_name|><|fim▁begin|>/*
* @(#)TIFFHeader.java
*
* $Date: 2014-03-13 04:15:48 -0400 (Thu, 13 Mar 2014) $
*
* Copyright (c) 2011 by Jeremy Wood.
* All rights reserved.
*
* The copyright of this software is owned by Jeremy Wood.
* You may not use, copy or modify this software... | |
<|file_name|>Cache.js<|end_file_name|><|fim▁begin|>/**
* JSONDB - JSON Database Manager
*
* Manage JSON files as databases with JSONDB Query Language (JQL)
*
* This content is released under the GPL License (GPL-3.0)
*
* Copyright (c) 2016, Centers Technologies
*
* @package JSONDB
* @author Nana Axel
... | Cache.cache = {}; |
<|file_name|>fixer_virtualbox_rename_test.go<|end_file_name|><|fim▁begin|>package fix
import (
"reflect"
"testing"
)
func TestFixerVirtualBoxRename_impl(t *testing.T) {
var _ Fixer = new(FixerVirtualBoxRename)
}
func TestFixerVirtualBoxRename_Fix(t *testing.T) {
cases := []struct {
Input map[string]interfac... | },
},
|
<|file_name|>handlers.py<|end_file_name|><|fim▁begin|>import logging
from time import strftime
def closed():
logging.info('Headlights process stopped')
def criterr(errortext):
logging.critical('A fatal error occured :: ' + errortext)
exit()
def err(errortext):
logging.error('An error occured :: ' + e... |
def inf(errortext):
logging.info(errortext)
|
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function, unicode_literals
from django.views.generic.base import TemplateView<|fim▁hole|><|fim▁end|> |
class CoachToolsView(TemplateView):
template_name = "coach/coach.html" |
<|file_name|>ClientProxy.java<|end_file_name|><|fim▁begin|>package cf.energizingcoalition.energizingcoalition.proxy;<|fim▁hole|>public class ClientProxy extends CommonProxy
{
@Override
public void registerRenderers()
{
}
}<|fim▁end|> | |
<|file_name|>CatalogManagerTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 OpenCB
*
* 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/LICE... | * Sample methods
* ***************************
*/
|
<|file_name|>test.py<|end_file_name|><|fim▁begin|>class B(object):<|fim▁hole|> pass
def __new__<warning descr="Signature is not compatible to __init__">(cls, x, y)</warning>: # error
pass
class A1(B):
pass
class A2(A1):
def __new__<warning descr="Signature is not compatible to __init__">(cls, a)</wa... | def __init__<warning descr="Signature is not compatible to __new__">(self)</warning>: # error |
<|file_name|>help.py<|end_file_name|><|fim▁begin|>from wrappers import *
from inspect import getdoc
@plugin
class Help:
@command("list")
def list(self, message):
"""list the loaded plugins"""
return message.reply(list(self.bot.plugins.keys()), "loaded plugins: " + ", ".join(self.bot.p... | elif message.data:
try:
com = message.data.split()[0]
|
<|file_name|>self.rs<|end_file_name|><|fim▁begin|>#![crate_name = "cross_crate_self"]
/// Link to [Self]
/// Link to [crate]
pub struct S;
impl S {
/// Link to [Self::f]<|fim▁hole|>}<|fim▁end|> | pub fn f() {} |
<|file_name|>BasicSpinnerUI.java<|end_file_name|><|fim▁begin|>/*
* This file is modified by Ivan Maidanski <ivmai@ivmaisoft.com>
* Project name: JCGO-SUNAWT (http://www.ivmaisoft.com/jcgo/)
*/
/*
* @(#)BasicSpinnerUI.java 1.18 06/08/17
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* SUN PR... | child, spinner)) { |
<|file_name|>broker.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it unde... | else: |
<|file_name|>get_nn.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import scipy
from sklearn.neighbors import KNeighborsClassifier
from scipy.cluster import hierarchy as hier
from scipy.spatial import ... | knn = KNeighborsClassifier() |
<|file_name|>queue.rs<|end_file_name|><|fim▁begin|>// Generated by build.rs script in the amqp0-primitives crate.
// Pre-generated files are used by default. Generation is done with the amqp0-codegen crate.
//
// To regenerate, ignoring the pre-generated files, use: cargo --features="amqp0-build-primitives"
// To forma... | |
<|file_name|>issue-61475.rs<|end_file_name|><|fim▁begin|>// run-pass
#![allow(dead_code)]
enum E {
A, B
}
<|fim▁hole|> match &&E::A {
&&E::A => {
}
&&E::B => {
}
};
}<|fim▁end|> | fn main() { |
<|file_name|>BayesUpdating.py<|end_file_name|><|fim▁begin|># Add any code that updates the current probability
# values of any of the nodes here.
# For example, here is a method that updates the probability of
# a single node, where this node is assumed to have a single parent.
def update_node_with_one_parent(n):
... | and accumulate these to get the current probability of pv.
'''
if len(n.parents)!= 1:
print "The function update_node_with_one_parent cannot handle node "+n.name |
<|file_name|>decode.go<|end_file_name|><|fim▁begin|>package imap
import (
"bytes"
"crypto/md5"
"encoding/base64"
"fmt"
"io"
"io/ioutil"
"mime"
"mime/multipart"
"mime/quotedprintable"
"net/mail"
"github.com/yesnault/go-imap/imap"
"github.com/ovh/venom"
)
func decodeHeader(msg *mail.Message, headerName st... | return nil, err
}
} |
<|file_name|>x86_reset16.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2016 Google, Inc
# Written by Simon Glass <sjg@chromium.org>
#
# Entry-type module for the 16-bit x86 reset code for U-Boot
#
from binman.entry import Entry
from binman.etype.blob import Entry_blob
class Entry... | |
<|file_name|>prompt.py<|end_file_name|><|fim▁begin|>class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Prompt',
# lis... | 'OutputExtension' : "",
# if the module needs administrative privileges |
<|file_name|>_validate_displaylayer.py<|end_file_name|><|fim▁begin|>import pyblish.api
import maya.cmds as cmds
import pymel
<|fim▁hole|>
families = ['scene']
optional = True
label = 'Modeling - Display Layers'
def process(self, instance):
"""Process all the nodes in the instance """
... | class ValidateDisplaylayer(pyblish.api.Validator):
""" Ensure no construction history exists on the nodes in the instance """ |
<|file_name|>test_user.py<|end_file_name|><|fim▁begin|>#import pytest
#import sys
import test.api as api
#import bauble.db as db
from bauble.model.user import User
def xtest_user_json(session):
username = 'test_user_json'
password = username
users = session.query(User).filter_by(username=username)
... | |
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>//! Provides common utility functions<|fim▁hole|>use num::traits::{NumCast, cast};
/// Shared Lock used for our tensors
pub type ArcLock<T> = Arc<RwLock<T>>;
/// Create a simple native backend.
///
/// This is handy when you need to sync data to host memory to read/wr... | use std::sync::{Arc, RwLock};
use co::prelude::*;
use coblas::plugin::*;
use conn; |
<|file_name|>0003_alter_task_input_field.py<|end_file_name|><|fim▁begin|># Generated by Django 1.11.21 on 2019-07-01 12:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('instructor_task', '0002_gradereportsetting'),
]
operations = [
m... | field=models.TextField(), |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for mords_backend project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""<|fim▁hole|>
import os
from django.core.w... | |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>/*
Copyright 2020 The Knative Authors
<|fim▁hole|>You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,... | Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. |
<|file_name|>S15.10.2.15_A1_T8.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.10.2.15_A1_T8;
* @section: 15.10.2.15;
* @assertion: The internal helper function CharacterRange take... | }
} |
<|file_name|>chip-list.d.ts<|end_file_name|><|fim▁begin|>import { AfterContentInit, ElementRef, QueryList } from '@angular/core';
import { MdChip } from './chip';
import { FocusKeyManager } from '../core/a11y/focus-key-manager';
/**
* A material design chips component (named ChipList for it's similarity to the List co... | |
<|file_name|>test_events.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
from pida.core.events import EventsConfig
import unittest
class MockCallback(object):
def __init__(self):
self.calls = []
def __call__(self, **kw):
self... | """used instead of None cause weakref proxy cant handle None""" |
<|file_name|>gridcontrol.js<|end_file_name|><|fim▁begin|>//When change in default attribute:
// Make code revision and check all values working with the default HTML attribute name 'gridindex' and or the variable `attribute`
var navigationItem, attribute;
var navigationActive = false;
var gridindex = "1-2";
var backup... | }
} else {
getAttribute(elem);
} |
<|file_name|>dataset.py<|end_file_name|><|fim▁begin|># Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
from __future__ import absolute_import
import ROOT
from . import log; log = log[__name__]
from .. import QROOT, asrootpy
from ..base import NamedObject
from ..ext... | def __iter__(self): |
<|file_name|>svg2js.js<|end_file_name|><|fim▁begin|>'use strict';
var SAX = require('sax'),
JSAPI = require('./jsAPI');
var config = {
strict: true,
trim: false,
normalize: true,
lowercase: true,
xmlns: true,
position: false
};
/**
* Convert SVG (XML) string to SVG-as-JS object.
*
* @p... | sax.onclosetag = function() {
|
<|file_name|>cache.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 The Kubernetes 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 r... | "fmt"
"github.com/golang/glog"
|
<|file_name|>color_button.rs<|end_file_name|><|fim▁begin|>// Copyright 2016, 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>
use ColorButton;
use Widget;
use ffi;
us... | Widget::from_glib_none(ffi::gtk_color_button_new_with_color(color)).downcast_unchecked()
}
} |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, t... | |
<|file_name|>pidlimit.go<|end_file_name|><|fim▁begin|>/*
Copyright 2019 The Ceph-CSI 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 ... |
return f.Close()
} |
<|file_name|>extendedHand.py<|end_file_name|><|fim▁begin|>import math
from math import *
#We have put this in the same order as the types in the LeapSDK.
finger_names = ['thumb', 'index', 'middle', 'ring', 'pinky']
'''
Function that returns the palm orientation
@hand: the hand that we're analysing.
'''
def palmOrient... | if finger_type == finger_names[finger.type]:
return finger
''' |
<|file_name|>ng-map.no-dependency.js<|end_file_name|><|fim▁begin|>(function(root, factory) {
if (typeof exports === "object") {
module.exports = factory();
} else if (typeof define === "function" && define.amd) {
define([], factory);
} else{
factory();
}
}(this, function() {
/**
* AngularJS Google Maps Ver. 1.18.4
*
... | |
<|file_name|>borrowck-mut-addr-of-imm-var.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://w... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
<|file_name|>HotPotatoHost.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* This application simulates turn-based games hosted on a server.
* Copyright (C) 2014
* Initiators : Fabien Delecroix and Yoann Dufresne
* Developpers : Raphael... | *
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
<|file_name|>fitvids.js<|end_file_name|><|fim▁begin|>/**
* FitVids 1.1
*
* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
* Released under the WTFPL license - http://sa... | d.innerHTML='<p>x</p><style id="fit-vids-style">'+a+"</style>",r.appendChild(d.childNodes[1])}return e&&t.extend(i,e),this.each(function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"] |
<|file_name|>DiagonalizationMethods.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Wed Jun 26 11:09:05 2013
@author: jotterbach
"""
from numpy import *
from ED_HalfFilling import EigSys_HalfFilling
from DotProduct import scalar_prod
from multiprocessing import *
from multiprocessing import P... | it = [pool.apply_async(EigSys_HalfFilling, (number_particles, number_sites, hopping[idx], interaction_strength, angle, noEV, spectrum, gamma, independent_v1_v2)) for idx in range(len(hopping))]
for ridx in it:
idx = nonzero(hopping == ridx.get()[5]) |
<|file_name|>titcoin.py<|end_file_name|><|fim▁begin|>import os
import platform
from twisted.internet import defer
from .. import data, helper
from p2pool.util import pack
P2P_PREFIX = '25174c22'.decode('hex')
P2P_PORT = 8698
ADDRESS_VERSION = 0
RPC_PORT = 8697
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defe... | BLOCK_EXPLORER_URL_PREFIX = 'https://blockexperts.com/tit/hash/'
ADDRESS_EXPLORER_URL_PREFIX = 'http://blockexperts.com/tit/address/' |
<|file_name|>procsrv.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... | env: ~[(~str, ~str)],
input: Option<~str>) -> Result {
|
<|file_name|>PointFeatureInputFormat.java<|end_file_name|><|fim▁begin|>package com.esri.mapred;
import com.esri.io.PointFeatureWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.mapred.InputSplit;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.RecordReader;
import or... | final Reporter reporter) throws IOException |
<|file_name|>punch.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit, Input } from '@angular/core';
@Component({
selector: 'app-punch',
templateUrl: './punch.component.html',
styleUrls: ['./punch.component.css']
})
export class PunchComponent implements OnInit {
@Input()
value: string;
... | |
<|file_name|>next_permutation.py<|end_file_name|><|fim▁begin|>"""
6 8 7 4 3 2
1. from right to left, find the first element which violates the increasing order, marked as N.
2. from right to left, find the first element which is larger that N, marked as M.
3. swap N and M.
> 7 8 6 4 3 2
4. reverse all digits on t... | if len(num) <= 1:
|
<|file_name|>backup.rs<|end_file_name|><|fim▁begin|>// id number A unique number used to identify and reference
// a specific image.
// name string The display name of the image. This is shown in
// the web UI and is generally a descriptive title for the image in question.
// type ... | |
<|file_name|>tar.gz_test.js<|end_file_name|><|fim▁begin|>"use strict";
<|fim▁hole|>/*
======== A Handy Little Nodeunit Reference ========
https://github.com/caolan/nodeunit
Test methods:
test.expect(numAssertions)
test.done()
Test assertions:
test.ok(value, [message])
test.equal(actual, expecte... | |
<|file_name|>LuaUpvalueIdentifierImpl.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2011 Jon S Akhtar (Sylvanaar)
*
* 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.apac... | return symbol instanceof LuaLocalDeclarationImpl || symbol instanceof LuaParameter;
}
@Override |
<|file_name|>diff.rs<|end_file_name|><|fim▁begin|>use ansi_term::{ANSIStrings, Style};
use ansi_term::Colour::{Green, Red};
use config::use_ansi;
use diff;
use std::borrow::Borrow;
use std::cmp::max;
use std::fmt::{Debug, Write};
use unicode_width::UnicodeWidthStr;
/// Can be diffed
pub trait Diffable<T: ?Si... | fn diff(&self, to: &str) -> String {
diff_str(self, to)
}
}
|
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>const App = require('./spec/app');
module.exports = config => {
const params = {
basePath: '',
frameworks: [
'express-http-server',
'jasmine'
],
files: [
'lib/**/*.js'
],
colo... | {
type: 'lcov',
subdir: '.'
} |
<|file_name|>Window.js<|end_file_name|><|fim▁begin|>var _elm_lang$window$Native_Window = function()
{
var size = _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) {
callback(_elm_lang$core$Native_Scheduler.succeed({
width: window.innerWidth,
height: window.innerHeight
}));<|fim▁hole|> size: size
}... | });
return { |
<|file_name|>conditional-compile.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// 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/licenses/LICENSE-2.0> or the MIT license
// <LIC... | // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT |
<|file_name|>promote.test.ts<|end_file_name|><|fim▁begin|>import {expect, test} from '@oclif/test'
import * as PromoteCmd from '../../../src/commands/pipelines/promote'
describe('pipelines:promote', () => {
const apiUrl = 'https://api.heroku.com'
const pipeline = {
id: '123-pipeline-456',
name: 'example-p... | const promotion = {
id: '123-promotion-456', |
<|file_name|>logout.spec.js<|end_file_name|><|fim▁begin|>'use strict';
var config = browser.params;
var UserModel = require(config.serverConfig.root + '/server/api/user/user.model');
describe('Logout View', function() {
var login = function(user) {
let promise = browser.get(config.baseUrl + '/login');
requi... | name: 'Test User',
email: 'test@example.com', |
<|file_name|>writer.rs<|end_file_name|><|fim▁begin|>use std::io::{ Write, Error, ErrorKind };
use super::super::classfile::*;
pub struct ClassWriter<'a> {
target: &'a mut Write
}
impl<'a> ClassWriter<'a> {
pub fn new<T>(target: &'a mut T) -> ClassWriter where T: Write {
ClassWriter { target: target }
... | self.write_u16(version.minor_version)
.and(self.write_u16(version.major_version))
}
|
<|file_name|>speed.py<|end_file_name|><|fim▁begin|>from colour import *
from cartesian import *
from timeit import *<|fim▁hole|> for i in range(1, 100000):
c = colour_create(.5, .5, .5, 0)
b = colour_add(b, c)
def test_cartesian():
b = cartesian_create(0, 0, 0)
for i in range(1, 50000):
... |
def test_colour():
b = colour_create(0, 0, 0, 0) |
<|file_name|>utility.rs<|end_file_name|><|fim▁begin|>use support::project;
<|fim▁hole|> let project = project("git-clean_removes").build();
let result = project.git_clean_command("-y")
.env("PATH", "")
.run();
assert!(!result.is_success(),
result.failure_message("command to fail... | #[test]
fn test_git_clean_checks_for_git_in_path() { |
<|file_name|>PyGdbDb.py<|end_file_name|><|fim▁begin|># coding=utf-8
import pymysql
import PyGdbUtil
class PyGdbDb:
# 初始化: 连接数据库
def __init__(self, host, port, dbname, user, passwd):
self.project = None
self.table_prefix = None
try:
self.connection = pymysql.connect(
... | def api_worst_stack_size(self, pid, tid):
pass
|
<|file_name|>trans_real.py<|end_file_name|><|fim▁begin|>"""Translation helper functions."""
import locale
import os
import re
import sys
import gettext as gettext_module
from cStringIO import StringIO
from django.utils.importlib import import_module
from django.utils.safestring import mark_safe, SafeData
f... | out.write(' _(%s) ' % fmatch)
|
<|file_name|>graphviz.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.apache.org/licens... | |
<|file_name|>opf_metrics_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial lice... | self.assertTrue (customEM.getMetric()["value"] == i+1) |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from pathlib import Path
import click
from git import Repo
from git.exc import InvalidGitRepositoryError
from logger import logger
from config import config
from utils import PairedObject, PairedProject, get_current_project, PathType
@click.group()
@click.option('-v... | param_hint=['directory'])
|
<|file_name|>experiment.py<|end_file_name|><|fim▁begin|>"""
Author: Seyed Hamidreza Mohammadi
This file is part of the shamidreza/uniselection software.
Please refer to the LICENSE provided alongside the software (which is GPL v2,
http://www.gnu.org/licenses/gpl-2.0.html).
This file includes the code for putting all ... | pm_name=corpus_path+'/pm/'+fname+'.pm'
##target_units = load_input(lab_name) |
<|file_name|>mess_manager.py<|end_file_name|><|fim▁begin|>#
# IIT Kharagpur - Hall Management System
# System to manage Halls of residences, Warden grant requests, student complaints
# hall worker attendances and salary payments
#
# MIT License
#
"""
@ authors: Madhav Datt, Avikalp Srivastava
"""
from ..database impo... | |
<|file_name|>smri_freesurfer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
================
sMRI: FreeSurfer
================
This script, smri_freesurfer.py, demonstrates the ability to call reconall on
a set of subjects and then make an average subject.
python smri_freesurfer.py
Import necessary mo... | Grab data |
<|file_name|>EventSourceServlet.java<|end_file_name|><|fim▁begin|>package dev.jee6demo.jspes;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;... | pw.flush();
try {
Thread.sleep(1000); |
<|file_name|>disk-tree.json.js<|end_file_name|><|fim▁begin|>define(
[
{
"value": 40,
"name": "Accessibility",
"path": "Accessibility"
},
{
"value": 180,
"name": "Accounts",
"path": "Accounts",
"children": [
{
"value": 76,
... | "path": "Extensions/AppleTopCase.kext/Contents"
} |
<|file_name|>2d.line.cap.butt.worker.js<|end_file_name|><|fim▁begin|>// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
// OffscreenCanvas test in a worker:2d.line.cap.butt
// Description:lineCap 'butt' is rendered correctly
// Note:
importScripts("/resources/testharness.js");
importScripts... | ctx.fillStyle = '#f00'; |
<|file_name|>L0MSBuildLocation.ts<|end_file_name|><|fim▁begin|>import ma = require('vsts-task-lib/mock-answer');
import tmrm = require('vsts-task-lib/mock-run');
import path = require('path');
import os = require('os');
let taskPath = path.join(__dirname, '..', 'xamarinios.js');
let tr: tmrm.TaskMockRunner = new tmrm.... | process.env['HOME']='/user/home'; //replace with mock of setVariable when task-lib has the support
tr.setInput('solution', 'src/project.sln'); //path
tr.setInput('configuration', 'Release'); |
<|file_name|>fix_cortex_topology.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
import argparse
import sys
from soma import aims
<|fim▁hole|>import highres_cortex.cortex_topo
def fix_cortex_topology_files(input_filename, output_filename,
filling_size, fclosing):
"""Call hig... | |
<|file_name|>zfs.py<|end_file_name|><|fim▁begin|>"""ZFS based backup workflows."""
import datetime
import shlex
import gflags
<|fim▁hole|>import lvm
import workflow
FLAGS = gflags.FLAGS
gflags.DEFINE_string('rsync_options',
'--archive --acls --numeric-ids --delete --inplace',
... | |
<|file_name|>version.go<|end_file_name|><|fim▁begin|>package storageimportexport
import "github.com/Azure/azure-sdk-for-go/version"
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Micro... | |
<|file_name|>case_index.rs<|end_file_name|><|fim▁begin|>use std::fmt::{self, Display, Formatter};
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct CaseIndex(usize);
impl CaseIndex {
pub fn next(self) -> CaseIndex {
CaseIndex(self.0 + 1)
}
pub fn start() -> CaseIndex ... | |
<|file_name|>fixtures.py<|end_file_name|><|fim▁begin|>"""All pytest-django fixtures"""
from __future__ import with_statement
import os
import warnings
import pytest
from . import live_server_helper
from .db_reuse import (monkey_patch_creation_for_db_reuse,
monkey_patch_creation_for_db_suffix)... | @pytest.fixture(scope='function')
def db(request, _django_db_setup, _django_cursor_wrapper):
"""Require a django test database
|
<|file_name|>Classifier_MaxEnt.java<|end_file_name|><|fim▁begin|>package org.melodi.learning.service;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import org.melodi.tools.dataset.DataSet_Corpora;
import o... | datafr)); |
<|file_name|>httpRequester.js<|end_file_name|><|fim▁begin|>var httpRequester = (function() {
var makeHttpRequest = function(url, type, data) {
var deferred = $.Deferred();
$.ajax({
url: url,
type: type,
contentType: 'application/json',
data: data,
... |
return { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.