prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>commandline.py<|end_file_name|><|fim▁begin|>from optparse import OptionParser import os,sys from oldowan.mitotype.matcher import HVRMatcher from oldowan.mitotype.prevalidate import prevalidate_submission def run_command(): """Perform automated human mtDNA haplotype identification.""" # Set up th...
# (1) load the fasta file # (2) use sequence passed on the command line working_text = '' if options.use_file:
<|file_name|>async_job.py<|end_file_name|><|fim▁begin|>__author__ = 'en0' from http import context from uuid import uuid4 from redis import Redis from gevent import spawn from functools import wraps class AsyncJob(object): def __init__(self, target): assert isinstance(context.db, Redis) self._tar...
self._db.set(_key, data) self._db.set(_status_key, 200) self._db.expire(_key, _expire_time)
<|file_name|>version.py<|end_file_name|><|fim▁begin|># Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible import __version__ from ansible.errors import AnsibleError from distutils.version import LooseVersion from operator import eq, ge, gt ...
u'compatability with Ansible {} -> {}. It is advisable to check for Trellis updates or ' u'downgrade your Ansible version.'.format(__version__, version_requirement, version_tested_max)) if eq(LooseVersion(__version__), LooseVersion('2.5.0')):
<|file_name|>color_space_10_8.py<|end_file_name|><|fim▁begin|>""" HLS and Color Threshold ----------------------- You've now seen that various color thresholds can be applied to find the lane lines in images. Here we'll explore this a bit further and look at a couple examples to see why a color space like HLS can be ...
plt.title("Threshold of ({}, {})".format(thresh[0], thresh[1])) f.add_subplot(size_x, size_y, 4)
<|file_name|>mock-ng2-localforage.service.spec.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core'; import { ReplaySubject, Subject } from 'rxjs/Rx'; @Injectable() export class MockNg2LocalforageService { item; list; constructor() { this.onInit(); } onInit() { this.item = new S...
} else { this.item.next(updateInput); this.item.complete();
<|file_name|>OSLImageUI.py<|end_file_name|><|fim▁begin|>########################################################################## # # Copyright (c) 2013-2014, John Haddon. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the foll...
for p in self.getPlug().children(): # TODO - this method for checking if a plug variesWithContext should probably live in PlugAlgo
<|file_name|>main.go<|end_file_name|><|fim▁begin|>// Copyright 2010 The Freetype-Go Authors. All rights reserved. // Use of this source code is governed by your choice of either the // FreeType License or the GNU General Public License version 2 (or // any later version), both of which can be found in the LICENSE file....
<|file_name|>pispi1.py<|end_file_name|><|fim▁begin|>import spi from time import sleep<|fim▁hole|>a = spi.SPI(0,0) print "PY: initisalising SPI mode ...\n"<|fim▁end|>
<|file_name|>let-else-if.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> let Some(_) = Some(()) else if true { //~^ ERROR conditional `else if` is not supported for `let...else` return; } else { return; }; }<|fim▁end|>
#![feature(let_else)] fn main() {
<|file_name|>utils.go<|end_file_name|><|fim▁begin|>package lineargo /* #include <stdlib.h> */ import "C" import "unsafe" func mapCDouble(in []float64) []C.double { out := make([]C.double, len(in), len(in))<|fim▁hole|>} func mapCInt(in []int) []C.int { out := make([]C.int, len(in), len(in)) for i, val := range in ...
for i, val := range in { out[i] = C.double(val) } return out
<|file_name|>types.go<|end_file_name|><|fim▁begin|>// Copyright 2016-2019 Authors of Cilium // // 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/LICENS...
// This is necessary to prevent callers from implicitly converting // the CtKey4Global type here into a local key type in the nested // TupleKey4Global field. func (k *CtKey4Global) ToNetwork() CtKey {
<|file_name|>Task.js<|end_file_name|><|fim▁begin|>/* Node-OpenDroneMap Node.js App and REST API to access OpenDroneMap. Copyright (C) 2016 Node-OpenDroneMap Contributors 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 So...
'odm_georeferencing', 'odm_texturing',
<|file_name|>mod.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/licens...
TokenAndSpan {
<|file_name|>HTMLUnescape.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################### # # HTMLUnescape # Replaces character entity names in the specified text with equivalent HTML markup characters. # # Python versions 2.6, 2.7, 3.x # # Copyri...
###############################################################################
<|file_name|>feerate.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <policy/feerate.h>...
if (nSize > 0) nSatoshisPerK = nFeePaid * 1000 / nSize; else
<|file_name|>h.js<|end_file_name|><|fim▁begin|><|fim▁hole|>// FILE H TWO module.exports = 2<|fim▁end|>
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration):<|fim▁hole|> dependencies = [ ] operations = [ migrations.CreateModel( name='Catego...
<|file_name|>el.js<|end_file_name|><|fim▁begin|>(function ($) { $.Redactor.opts.langs['el'] = { html: 'HTML', video: 'Εισαγωγή βίντεο...', image: 'Εισαγωγή εικόνας...', table: 'Πίνακας', link: 'Σύνδεσμος', link_insert: 'Εισαγωγή συνδέσμου...', link_edit: 'Edit link', unlink: 'Ακύρωση συνδέσμου', formatting: 'Μ...
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> *@author dgagarsky *@since 01.12.2016 */ package ru.job4j;<|fim▁end|>
* For JavaDocs.
<|file_name|>data.py<|end_file_name|><|fim▁begin|>from unicodecsv import DictReader class CSVImporter(object): """ A CSV-backed resource with the datas in it. """ def __init__(self, fh): self.reader = DictReader(fh) self.data = list(self.reader) @property def headers(self): h...
def __len__(self): return len(self.data)
<|file_name|>sequences.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, division from sympy.core.basic import Basic from sympy.core.mul import Mul from sympy.core.singleton import S, Singleton from sympy.core.symbol import Dummy, Symbol from sympy.core.compatibility import (range, integer_types, ...
<|file_name|>functions.js<|end_file_name|><|fim▁begin|>var slidedelay = $('#bannerslider').attr('data-delay'); var pauseonhover = $('#bannerslider').attr('data-pause'); var fadedelay = 2000; $(document).ready(function() { if ($('#bannerslider').hasClass("slide") && $('#bannerslider').hasClass("carousel")) { ...
<|file_name|>ChainPatternDemo.java<|end_file_name|><|fim▁begin|>package com.action.design.pattern.chain; /** * 创建不同类型的记录器。赋予它们不同的错误级别,并在每个记录器中设置下一个记录器。每个记录器中的下一个记录器代表的是链的一部分。 * Created by wuyunfeng on 2017/6/15. */ public class ChainPatternDemo { private static AbstractLogger getChainOfLoggers() { Abst...
return errorLogger;
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>ACCOUNT_NAME = 'Bosch'<|fim▁end|>
<|file_name|>HowMuch.rs<|end_file_name|><|fim▁begin|>fn how_much(mut m: i32, mut n: i32) -> Vec<(String, String, String)> { if m > n { std::mem::swap(&mut m, &mut n); } let mut result: Vec<(String, String, String)> = Vec::new(); let mut c: f32; let mut b: f32; for i in m..n+1 { ...
<|file_name|>foreign_trait.rs<|end_file_name|><|fim▁begin|>#![feature(negative_impls)] <|fim▁hole|><|fim▁end|>
pub trait ForeignTrait {} impl ForeignTrait for u32 {} impl !ForeignTrait for String {}
<|file_name|>entries.js<|end_file_name|><|fim▁begin|>"use strict"; const hamt = require('../hamt'); const assert = require('chai').assert; describe('entries', () => { it('should be empty for empty map', () => { const h = hamt.make(); const it = hamt.entries(h); let v = it.next(); ...
v = it.next();
<|file_name|>bitcoin_eo.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="eo" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About LitecoinDark</source...
<location line="+7"/> <source>Message verification failed.</source>
<|file_name|>distributedstorage_fetch_test.go<|end_file_name|><|fim▁begin|>/* * EliasDB * * Copyright 2016 Matthias Ladkau. All rights reserved. * * 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...
<|file_name|>fn-custom-6.rs<|end_file_name|><|fim▁begin|>// rustfmt-fn_args_layout: BlockAlways // rustfmt-where_indent: Inherit // rustfmt-fn_brace_style: PreferSameLine // Test different indents. fn foo(a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb) { foo(); } fn bar(a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb, c: Cccccccccccc...
} trait Test { fn foo(a: u8) {}
<|file_name|>interactive_interface.py<|end_file_name|><|fim▁begin|><|fim▁hole|># DBus interface for the interactive partitioning module # # Copyright (C) 2019 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of...
#
<|file_name|>BindableDouble.java<|end_file_name|><|fim▁begin|>package saberapplications.pawpads.databinding; import android.databinding.BaseObservable; import android.databinding.BindingAdapter; import android.databinding.BindingConversion; import android.text.Editable; import android.text.TextWatcher; import android....
public static String convertIntegerToString(BindableDouble value) {
<|file_name|>indentation_subsystem.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).<|fim▁hole|># Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals from pants....
<|file_name|>context.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 animation::Animation; use app_units::Au; use dom::OpaqueN...
pub screen_size_changed: bool,
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp'); var Path = require('path'); var compass = require('gulp-compass'); var minifyCss = require('gulp-minify-css'); var del = require('del'); var browserify = require('browserify'); var source = require('vinyl-source-stream'); var browserSync...
var outDir = 'out'; var packageDir = '.';
<|file_name|>TimerEntry.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from time import localtime, mktime, time, strftime from datetime import datetime from enigma import eEPGCache from Screens.Screen import Screen import ChannelSelection from ServiceReference import ServiceReference from Components.config i...
def handleKeyFileCallback(self, answer): if self["config"].getCurrent() in (self.channelEntry, self.tagsSet): self.keySelect()
<|file_name|>debug.py<|end_file_name|><|fim▁begin|># Based on Rapptz's RoboDanny's repl cog import contextlib import inspect import logging import re import sys import textwrap import traceback from io import StringIO from typing import * from typing import Pattern import discord from discord.ext import commands # i ...
async def eval(self, ctx: commands.Context, *, cmd: str): scope = {"_": self.last_eval, "last": self.last_eval} result, stdout, stderr = await self.run(ctx, cmd, use_exec=False, extra_scope=scope) self.last_eval = result
<|file_name|>_express_route_ports_locations_operations.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...
from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyIlmbase(AutotoolsPackage): """The P...
# https://github.com/AcademySoftwareFoundation/openexr/issues/336
<|file_name|>iscsi.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 appl...
from oslo_log import log as logging
<|file_name|>chaingen.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2012-2013 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <vector> #include <iostream> #include <sstream> #include "...
}
<|file_name|>test_redis.py<|end_file_name|><|fim▁begin|>from funtests import transport class test_redis(transport.TransportCase): transport = "redis" prefix = "redis" <|fim▁hole|> client = connection.channel().client client.info() def test_cant_connect_raises_connection_error(self): ...
def after_connect(self, connection):
<|file_name|>build.spec.ts<|end_file_name|><|fim▁begin|>import assert from 'assert'; import { describe, it } from 'mocha'; import { itsa, itsaField, ItsaSchema, itsaSchema } from "./itsa"; @itsaSchema() class IDog extends ItsaSchema { @itsaField(itsa.number().default(4)) legs:number; } @itsaSchema() class IUser ...
foo: itsa.object(), });
<|file_name|>client_test.go<|end_file_name|><|fim▁begin|>// Copyright 2016 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package metricsdebug_test import ( "errors" "time" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" basetesting "github.com/juju/juju/api/base/testin...
}
<|file_name|>s3table.py<|end_file_name|><|fim▁begin|>from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * import boto.exception import io import json import wizzat.kvtable from boto.s3.key import Key, compute_md5 __all__ = [ 'S3Table', ] class S3Table(wizzat...
<|file_name|>htmldatalistelement.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 dom::bindings::codegen::Bindings::HTMLDataLis...
} } impl HTMLDataListElement {
<|file_name|>CubeBsqHandler.cpp<|end_file_name|><|fim▁begin|>/** * @file * $Revision: 1.6 $ * $Date: 2008/09/03 16:21:02 $ * * Unless noted otherwise, the portions of Isis written by the USGS are * public domain. See individual third-party library and package descriptions * for intellectual property inform...
<|file_name|>AvroParser.java<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2009 Swedish Institute of Computer Science (SICS) Copyright (C) * 2009 Royal Institute of Technology (KTH) * * KompicsToolbox is free software; you can redistribute it and/or<|fim▁hole|> * * This program is distributed in the hope that it...
* 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) any later version.
<|file_name|>lib.ts<|end_file_name|><|fim▁begin|>import * as Q from 'q' <|fim▁hole|><|fim▁end|>
export {Q}
<|file_name|>OrTest.java<|end_file_name|><|fim▁begin|>/* * Copyright 2005 JBoss 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-2.0 ...
ksession.setGlobal("list", results);
<|file_name|>test_aggregate_image_properties_isolation.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Cisco Systems, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy o...
<|file_name|>insert_usage_mysql.rs<|end_file_name|><|fim▁begin|>use chrono::{offset::Utc, DateTime}; use rustorm::{pool, DbError, FromDao, Pool, ToColumnNames, ToDao, ToTableName}; /// Run using: /// ```sh /// cargo run --example insert_usage_mysql --features "with-mysql" /// ``` fn main() { mod for_insert { ...
let tom_hanks = for_insert::Actor {
<|file_name|>get_custom_fields_for_line_items.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the Li...
'CustomFieldService', version='v201808') # Create a statement to select custom fields. statement = (ad_manager.StatementBuilder(version='v201808')
<|file_name|>lunacy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from time import gmtime, strftime import ephem import wx.calendar # Test # here = ephem.Observer() # here.lat = '-17.576166667' # here.lon = '-149.618575000' class App(wx.App): def OnInit(self): self.frame = MyFrame("...
lat = f.readline(12)
<|file_name|>vtable_recursive_sig.rs<|end_file_name|><|fim▁begin|>#![allow( dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals )] #[repr(C)] pub struct Base__bindgen_vtable { pub Base_AsDerived: unsafe extern "C" fn(this: *mut Base) -> *mut Derived, } #[repr(C)] #[derive(Debug,...
impl Default for Derived {
<|file_name|>repository.sage.ts<|end_file_name|><|fim▁begin|>/// <reference path="../_references.d.ts" /> interface sage { id: number; name: string; username: string; email: string; dateOfBirth: Date; sayings?: saying[]; } interface repositorySage { getAll: () => ng.IPromise<sage[]>; ge...
var sage: sage;
<|file_name|>TagentEvent.js<|end_file_name|><|fim▁begin|>"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const Tevent_1 = require("../../../events/Tevent"); class TagentEvent extends Tevent_1.Tevent { <|fim▁hole|> constructor(type, eventData = null, cancelable = true) { super...
<|file_name|>RKTwu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3 # -*- coding: utf-8 -*- r"""Pychemqt, Chemical Engineering Process simulator Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Gen...
<|file_name|>parser.py<|end_file_name|><|fim▁begin|><|fim▁hole|> from HTMLParser import *<|fim▁end|>
from __future__ import absolute_import
<|file_name|>accretion.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # ----------------------------------------------------------------------------- # VORONOI.ACCRETION # Laura L Watkins [lauralwatkins@gmail.com] # - converted from IDL code by Michele Cappellari (bin2d_accretion) # -----------------------------...
# and whether the resulting S/N would get closer to targetsn if sqrt(mindist) > 1.2*pixelsize or roundness > 0.3 \
<|file_name|>ctaFollow.js<|end_file_name|><|fim▁begin|>"use strict"; var userUtils = require("../../lib/user-utils.js"); module.exports = function(core, config, store) { core.on("setstate", function(changes) { var future = store.with(changes), userId = future.get("user"), roomId = future.get("nav", "room"), ...
changes.app = changes.app || {};
<|file_name|>UsagePrinterJANI.java<|end_file_name|><|fim▁begin|>/**************************************************************************** ePMC - an extensible probabilistic model checker Copyright (C) 2017 This program is free software: you can redistribute it and/or modify it under the terms of ...
<|file_name|>convert_from_tensorflow.py<|end_file_name|><|fim▁begin|># Copyright (c) 2019 Guo Yejun # # This file is part of FFmpeg. # # FFmpeg is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # v...
<|file_name|>test_base_polling_async.py<|end_file_name|><|fim▁begin|>#-------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of t...
polling_method = AsyncLROBasePolling(0) poll = await async_poller(CLIENT, response, TestBasePolling.mock_outputs,
<|file_name|>app_originate.py<|end_file_name|><|fim▁begin|># AsteriskLint -- an Asterisk PBX config syntax checker # Copyright (C) 2018 Walter Doekes, OSSO B.V. # # 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 Sof...
# You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from ..base import E_APP_ARG_BADOPT, App, AppArg
<|file_name|>areEqual.js<|end_file_name|><|fim▁begin|>/** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATE...
} } } else {
<|file_name|>EBrowserView.java<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2014 The AppCan Open Source Project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either versi...
} } @Override
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Minimal Python 3 shim around PyQt5 and Pyside2 Qt bindings for QML applications. Forked from https://github.com/mottosso/Qt.py under MIT License. Copyright (c) 2016 Marcus Ottosson Changes * Dropped Python2 and Qt4 support * Focus on last Python 3 release * Fo...
# Qt.QtCompat.wrapInstance = _wrapinstance # Qt.QtCompat.getCppPointer = _getcpppointer
<|file_name|>controller.py<|end_file_name|><|fim▁begin|># Copyright 2011 Tsutomu Uchino # # 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...
def getImplementationName(self): return self.IMPLE_NAME
<|file_name|>nnet_lasagne.py<|end_file_name|><|fim▁begin|># code adapted from lasagne tutorial # http://lasagne.readthedocs.org/en/latest/user/tutorial.html import time import os from itertools import product import numpy as np from sklearn.cross_validation import KFold import theano from theano import tensor as T imp...
<|file_name|>test_MagneticField.py<|end_file_name|><|fim▁begin|>from unittest import TestCase from gnomon import MagneticField class MockG4ThreeVector(): x = 0 y = 0 z = 0 class TestWandsToroidField(TestCase): def setUp(self): self.field_minus = MagneticField.WandsToroidField('-') se...
<|file_name|>subtensor.py<|end_file_name|><|fim▁begin|>from copy import copy import sys from textwrap import dedent import warnings import logging import numpy from six.moves import xrange import theano from theano.compat import izip from six import integer_types from theano.gradient import DisconnectedType from thea...
warnings.warn( 'Although your current code is fine, please note that '
<|file_name|>SyntroCFS.cpp<|end_file_name|><|fim▁begin|>// // Copyright (c) 2014 Scott Ellis and Richard Barnett // // This file is part of SyntroNet // // SyntroNet 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...
// You should have received a copy of the GNU General Public License // along with SyntroNet. If not, see <http://www.gnu.org/licenses/>.
<|file_name|>cursor.rs<|end_file_name|><|fim▁begin|>use super::result::PgResult; use super::row::PgRow; /// The type returned by various [`Connection`] methods. /// Acts as an iterator over `T`. pub struct Cursor<'a> { current_row: usize, db_result: &'a PgResult, } impl<'a> Cursor<'a> { pub(super) fn new(...
<|file_name|>fixsessions.server.controller.js<|end_file_name|><|fim▁begin|>'use strict'; /** * Module dependencies. */ var errorHandler = require('./errors.server.controller'), db = require('../models/fixsession.server.model'), _ = require('lodash'), bluebird = require('bluebird'); /** * Create a F...
res.sendStatus(201); });
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>""" Django settings for sample project. Generated by 'django-admin startproject' using Django 1.10.1. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.d...
MIDDLEWARE = [
<|file_name|>androgui.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 '''Androguard Gui''' import argparse import sys from androguard.core import androconf from androguard.session import Session from androguard.gui.mainwindow import MainWindow from androguard.misc import init_print_colors from PySide import ...
<|file_name|>http.py<|end_file_name|><|fim▁begin|># coding=utf8 from cStringIO import StringIO import time import random from twisted.internet import reactor, task from twisted.internet.defer import ( inlineCallbacks, returnValue, Deferred, succeed, ) from twisted.internet.endpoints import TCP4ClientE...
def clear_cache(self):
<|file_name|>perf.go<|end_file_name|><|fim▁begin|>// Copyright © 2014 Terry Mao, LiuDing All rights reserved. // This file is part of gopush-cluster. // gopush-cluster 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 Fo...
if err := http.ListenAndServe(addr, pprofServeMux); err != nil {
<|file_name|>fold-real.cpp<|end_file_name|><|fim▁begin|>//===-- lib/Evaluate/fold-real.cpp ----------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0...
namespace Fortran::evaluate { template <int KIND>
<|file_name|>jspsych-categorize-animation.js<|end_file_name|><|fim▁begin|>/** * jspsych plugin for categorization trials with feedback and animated stimuli * Josh de Leeuw * * documentation: docs.jspsych.org **/ jsPsych.plugins["categorize-animation"] = (function() { var plugin = {}; jsPsych.pluginAPI.regi...
var img = new Image();
<|file_name|>0003_redirection.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2019-01-10 22:43<|fim▁hole|>from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dns', '0002_auto_20151228_0134'), ] operations = [ ...
from __future__ import unicode_literals
<|file_name|>BindingCustom.java<|end_file_name|><|fim▁begin|>package ahmad.aghazadeh.recyclerviewcardview.logic; import android.databinding.BindingAdapter; import android.databinding.BindingConversion; import android.graphics.Bitmap; import android.graphics.Typeface;<|fim▁hole|>import android.graphics.drawable.Drawabl...
import android.graphics.drawable.ColorDrawable;
<|file_name|>httpclient.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding: utf-8 """阻塞和非阻塞的 HTTP 客户端接口. 这个模块定义了一个被两种实现方式 ``simple_httpclient`` 和 ``curl_httpclient`` 共享的通用接口 . 应用程序可以选择直接实例化相对应的实现类, 或使用本模块提供的 `AsyncHTTPClient` 类, 通过复写 `AsyncHTTPClient.configure` 方法来选择一种实现 . 默认的实现是 ``simple_httpclient``, 这...
async_client_class = AsyncHTTPClient self._async_client = async_client_class(self._io_loop, **kwargs)
<|file_name|>authentication.component.ts<|end_file_name|><|fim▁begin|>import { Component } from "@angular/core"; @Component({ selector: 'app-authentication',<|fim▁hole|> <header class="row spacing"> <nav class="col-md-8 col-md-offset-2"> <ul class="nav nav-tabs"> ...
template: `
<|file_name|>text.py<|end_file_name|><|fim▁begin|><|fim▁hole|>def standard_text_from_block(block, offset, max_length): str = '' for i in range(offset, offset + max_length): c = block[i] if c == 0: return str else: str += chr(c - 0x30) return str def standard...
class CharacterSubstitutions(object): character_substitutions = dict()
<|file_name|>test_beadstructure_base.cc<|end_file_name|><|fim▁begin|>/* * Copyright 2009-2021 The VOTCA Development Team (http://www.votca.org) * * 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 Licen...
// H - O - H // TestBead testbead6;
<|file_name|>controllers.js<|end_file_name|><|fim▁begin|>angular.module('starter.controllers', []) // A simple controller that fetches a list of data from a service .controller('PetIndexCtrl', function($scope, PetService) { // "Pets" is a service returning mock data (services.js) $scope.pets = PetService.all(); }...
<|file_name|>showSubMenu.py<|end_file_name|><|fim▁begin|>import time from menu.ncolor import * from menu.showMainMenu import * from command.shell import * from write.dnsmasq_write import * class Sub_Menu(): dns_message = """ you can add a redirect entry in this menu or edit the dnsmasq configuration file lo...
<|file_name|>app.js<|end_file_name|><|fim▁begin|>/* some devices call home before accepting a wifi access point. Spoof those responses. */ var path = require('path'); exports.load = function(server, boatData, settings) { var endpointMap = [ {'route': '/kindle-wifi/wifiredirect.html', 'responseFile': 'k...
];
<|file_name|>autostart.py<|end_file_name|><|fim▁begin|># user.py is the autostart code for a ulnoiot node. # Configure your devices, sensors and local interaction here. # Always start with this to make everything from ulnoiot available. # Therefore, do not delete the following line. from ulnoiot import * # The follow...
# in the topic myroom/test1/button1. button("b1", d6, pullup=False, threshold=2)
<|file_name|>tcp.rs<|end_file_name|><|fim▁begin|>use std::io::{Read, Write}; use std::net::{self, SocketAddr}; use std::os::unix::io::{RawFd, FromRawFd, IntoRawFd, AsRawFd}; use libc; use net2::TcpStreamExt; use {io, Evented, Ready, Poll, PollOpt, Token}; use sys::unix::eventedfd::EventedFd; use sys::unix::io::set_n...
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Niklas Rosenstein # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation ...
# XXX Support all valid options and eventually parse the config file?
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from flask.ext.wtf import Form from flask.ext.wtf.html5 import EmailField from wtforms.validators import Required from wtforms.fields import ( TextAreaField, HiddenField ) <|fim▁hole|> class FeedbackForm(Form): feedback = TextAreaField('Your feedback', v...
class LoginForm(Form): email = EmailField('Email address', validators=[Required()]) next = HiddenField('next')
<|file_name|>matsa.go<|end_file_name|><|fim▁begin|>// Matsa Discovery Library // Copyright (C) 2015 by Todd Moses (todd@toddmoses.com) // Use of this source code is governed by an Apache // license that can be found in the LICENSE file. // version 0.0.1 package matsa type List_f64 []float64 type List_str []string /...
copy(out, list) return out }
<|file_name|>strategy.go<|end_file_name|><|fim▁begin|>/* Copyright 2014 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 Unles...
return generic.MergeFieldsSets(objectMetaFieldsSet, specificFieldsSet) }
<|file_name|>interfaces.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 Google LLC // // Use of this source code is governed by an MIT-style license that can be found // in the LICENSE file or at https://opensource.org/licenses/MIT. //! A handler and associated types for the interfaces action. //! //! The interfaces...
mod tests {
<|file_name|>EventTarget.js<|end_file_name|><|fim▁begin|>/** * @author Mat Groves http://matgroves.com/ @Doormat23 * @author Chad Engler https://github.com/englercj @Rolnaaba */ /** * Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob. * Currently takes inspiration from the nodejs E...
//if "stopImmediatePropagation" is called, stop calling sibling events if(data.stoppedImmediate) { return this;
<|file_name|>listadoCooperativa.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from "@angular/core"; import { Http } from "@angular/http"; import "rxjs/add/operator/map"; import {Observable} from "rxjs/Observable"; @Injectable() export class ListadoCooperativaService { constructor(private http: Http...
<|file_name|>viewportimagemap.go<|end_file_name|><|fim▁begin|>package viewer import ( "fmt" "image" "github.com/driusan/de/demodel" "github.com/driusan/de/renderer" ) type offsetImageMap struct { buf *demodel.CharBuffer visibleViewport image.Rectangle viewport *Viewport } func (v *Viewport...
im := i.viewport.Renderer.GetImageMap(i.buf, i.visibleViewport) if im == nil { return 0, fmt.Errorf("Renderer does not provide an image map.")