prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>_configuration_async.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 information. # Code ...
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_polic...
<|file_name|>abilities.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2018 Chef Software Inc. and/or applicable contributors // // Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|>// You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless req...
// you may not use this file except in compliance with the License.
<|file_name|>hedgewars_ar.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="fr"> <context> <name>AmmoSchemeModel</name> <message> <source>new</source> <translation>جديد</translation> </message> <message> <source>copy ...
</message> <message>
<|file_name|>detect_test.go<|end_file_name|><|fim▁begin|>package multigz import ( "os" "testing" ) func TestIsMultiGzip(t *testing.T) { f, err := os.Open("testdata/divina.txt.gz") if err != nil { t.Fatal(err) } defer f.Close() if IsProbablyMultiGzip(f, DefaultPeekSize) { t.Error("divina.txt.gz detected as...
f2, err := os.Open("testdata/divina2.txt.gz") if err != nil { t.Fatal(err)
<|file_name|>NameEmitter.java<|end_file_name|><|fim▁begin|>/* * Copyright 2015 Alexey Andreev. * * 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/licen...
interface NameEmitter {
<|file_name|>dailylog.go<|end_file_name|><|fim▁begin|>// Copyright 2013 Ibrahim Ghazal. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "github.com/qedus/nds" "golang.org/x/net/context" "google.golang.org/appengine" ...
log.Errorf(c, "Could not parse form: %s", err) renderError(w, r, http.StatusInternalServerError) return
<|file_name|>SimpleAction.java<|end_file_name|><|fim▁begin|>package br.com.caelum.rest.server; import javax.servlet.http.HttpServletRequest; public class SimpleAction implements Action { public String getUri() { return uri; } public String getRel() { return rel; } private final String uri; private final ...
public SimpleAction(String rel, HttpServletRequest request, String uri) {
<|file_name|>HandDetails.py<|end_file_name|><|fim▁begin|>from triple_draw_poker.model.Pot import Pot class HandDetails: def __init__(self): self.pot = Pot() self.raised = 0 self.street = 0 self.number_of_streets = 4 self.in_draw = False self.hands = [] self....
self.street += 1 def changeInDraw(self): self.in_draw = not self.in_draw
<|file_name|>de.js<|end_file_name|><|fim▁begin|>H5PEditor.language.core = { missingTranslation: '[Fehlende Übersetzung :key]', loading: 'Lädt :type, bitte warten...', selectLibrary: 'Auswählen der Bibliothek, die für den Inhalt verwendet werden soll.', unknownFieldPath: '":path" kann nicht gefunden werden.', ...
enterVideoUrl: 'URL der Videodatei oder YouTube-Link eingeben',
<|file_name|>systemjs.config.js<|end_file_name|><|fim▁begin|><|fim▁hole|>(function (global) { System.config({ paths: { // paths serve as alias 'npm:': 'lib/' }, // map tells the System loader where to look for things map: { // our app is within the...
/** * System configuration for Angular 2 samples * Adjust as necessary for your application needs. */
<|file_name|>tweet.go<|end_file_name|><|fim▁begin|>package twitterstream type Hashtag struct { Text string `json:"text"` Indices IndexPair `json:"indices"` } type Size struct { Width int `json:"w"` Height int `json:"h"` Resize string `json:"resize"` } type Sizes struct { Large S...
<|file_name|>traits.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity 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...
}
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse from .models import * import requests import json user_id = '139169754@N02' api_key = '41dd3aff041c00c52febdef9786a9ca0' api_secret = '0f5a3b5047f760f7' def index(request):...
response = json.loads(response.text)
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # b3j0f.sync documentation build configuration file, created by # sphinx-quickstart on Sun Jun 14 17:29:14 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration v...
#'figure_align': 'htbp', }
<|file_name|>test_therm.py<|end_file_name|><|fim▁begin|>import RPi.GPIO as GPIO import time import utils import therm GPIO.setmode(GPIO.BOARD) #pwr = utils.PSU(13, 15) #pwr.on() #pwr.off() adresses = therm.get_adr() samples = 5 therms = [] now = time.time() t_amb = therm.Therm('28-000004e08693') t_c_b = therm.Therm...
print temp_row therms.append(temp_row) print time.time() - now
<|file_name|>bridge_default.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os import os.path from StringIO import StringIO from time import time __all__ = ['Parser', 'IncrementalParser', 'DispatchParser'] import xml.dom as xd import xml.dom.minidom as xdm import xml.sax as xs import xml.sax.handler a...
self.__serialize_element(child, ns_map)
<|file_name|>oc_pvc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # pylint: disable=too-many-lines # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ |...
else: self.put(PersistentVolumeClaim.access_modes_path, [inc_mode])
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import setuptools import os # This will add the __version__ to the globals with open("src/lsi/__init__.py") as f: exec(f.read()) setuptools.setup( name='lsi', version=__version__, author="Narrative Science",<|fim▁hole|> author_email="anelson@narrat...
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity 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 versi...
}
<|file_name|>video-works.server.models.js<|end_file_name|><|fim▁begin|>'use strict'; var mongoose = require('mongoose'), Schema = mongoose.Schema; var videoWorksSchema = new Schema ({ title: { type: String }, directedBy: { type: [String] }, editedBy: { type: [String] }, cast: { t...
});
<|file_name|>bala.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- # Pilas engine - A video game framework. # # Copyright 2010 - Hugo Ruscitti # License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html) # # Website - http://www.pilas-engine.com.ar from pilasengine.actores.actor import Actor class Bala(Ac...
<|file_name|>tgen-dram-ctrl.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property r...
<|file_name|>managers.py<|end_file_name|><|fim▁begin|>import re import random import hashlib from django.db import models SHA1_RE = re.compile('^[a-f0-9]{40}$') class RegistrationManager(models.Manager): """Custom manager for the ``RegistrationProfile`` model. The methods defined here provide shortcuts for a...
""" def activate_user(self, activation_key):
<|file_name|>tcplog_test.go<|end_file_name|><|fim▁begin|>package tcplog import ( "net" "strings" "sync" "testing" "github.com/stretchr/testify/assert" "github.com/vektra/cypress" "github.com/vektra/neko" ) type TestFormatter struct{} func (tf *TestFormatter) Format(m *cypress.Message) ([]byte, error) { retu...
assert.Equal(t, one, l.PumpDropped) } })
<|file_name|>model_resource_groups.go<|end_file_name|><|fim▁begin|>/* * CLOUD API * * An enterprise-grade Infrastructure is provided as a Service (IaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to perform a variety of man...
toSerialize := map[string]interface{}{} if o.Id != nil {
<|file_name|>jsdocTemplateClass.ts<|end_file_name|><|fim▁begin|>// @allowJs: true // @checkJs: true<|fim▁hole|>// @Filename: templateTagOnClasses.js /** * @template T * @typedef {(t: T) => T} Id */ /** @template T */ class Foo { /** @typedef {(t: T) => T} Id2 */ /** @param {T} x */ constructor (x) { ...
// @noEmit: true
<|file_name|>sync-colorselector.js<|end_file_name|><|fim▁begin|>$(function() { // column select dw.backend.on('sync-option:base-color', sync); function sync(args) { var chart = args.chart, vis = args.vis, theme_id = chart.get('theme'), labels = getLabels(), ...
$('.select', $body).show();
<|file_name|>jewels-and-stones_test.go<|end_file_name|><|fim▁begin|>package leetcode import "testing" func TestNumJewelsInStones(t *testing.T) { if numJewelsInStones("aA", "aAAbbbb") != 3 { t.Fatal() }<|fim▁hole|><|fim▁end|>
if numJewelsInStones("z", "ZZ") != 0 { t.Fatal() } }
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Zinc, the bare metal stack for rust. // Copyright 2014 Ben Gamari <bgamari@gmail.com> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at /...
<|file_name|>quadview.cpp<|end_file_name|><|fim▁begin|>/*********************************************************************************** * * * Voreen - The Volume Rendering Engine * * ...
tgt::MouseEvent::MOUSE_BUTTON_LEFT, tgt::MouseEvent::DOUBLECLICK, tgt::MouseEvent::MODIFIER_NONE) , mouseMoveEventProp_("mouseEvent.move", "Move Event", this, &QuadView::mouseMove, tgt::MouseEvent::MOUSE_BUTTON_NONE, tgt::MouseEvent::MOTION | tgt::MouseEvent::CLICK | tgt::MouseEvent::ENTER_EXIT, tgt...
<|file_name|>markers.py<|end_file_name|><|fim▁begin|>#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/charts/markers.py """ This modules defines a collection of markers used in charts. The m...
"Make a filled square marker."
<|file_name|>you.create-user.js<|end_file_name|><|fim▁begin|>if (Meteor.isServer) { var //// A lookup-table whose keys are generated each time an ‘you.register’ form is rendered using the `babelslug()` method. //// The key is a babelslug, followed by hyphen, followed by a Meteor connection ID (like...
<|file_name|>pagerank.rs<|end_file_name|><|fim▁begin|>// extern crate rand; // extern crate time; // extern crate columnar; // extern crate timely; // extern crate differential_dataflow; // // use std::mem; // // use std::hash::Hash; // use timely::example_shared::*; // use timely::example_shared::operators::*; // use ...
// // let mut round = 0 as u32; // // let mut changes = Vec::new(); // // while computation.step() {
<|file_name|>fn-trait-formatting.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...
//~| expected () //~| found box
<|file_name|>hooks.go<|end_file_name|><|fim▁begin|>/* Copyright 2019 The Knative 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 requi...
}
<|file_name|>utf8-string.cpp<|end_file_name|><|fim▁begin|>// -*- coding: us-ascii-unix -*- // Copyright 2012 Lukas Kemmer // // 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....
}
<|file_name|>DiseaseOverview.java<|end_file_name|><|fim▁begin|>/** * **************************************************************************** * Copyright 2014 Virginia Polytechnic Institute and State University * <p/> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file...
obj.put("leaf", "false"); } return obj; }
<|file_name|>Sheet.java<|end_file_name|><|fim▁begin|>package com.lj.learning.dao; // THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS // KEEP INCLUDES - put your custom includes here // KEEP INCLUDES END /** * Entity mapped to table "SHEET". */ public class Sheet implements java.io.Serializa...
private Long id;
<|file_name|>transpose_op.cc<|end_file_name|><|fim▁begin|>/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/...
if (library_ == framework::LibraryType::kPlain && platform::CanMKLDNNBeUsed(ctx)) { library_ = framework::LibraryType::kMKLDNN; layout_ = framework::DataLayout::kMKLDNN;
<|file_name|>associated-types-projection-bound-in-supertraits.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// run-pass #![allow(unused_variables)] // Test that we correctly handle projection bounds appearing in the // supertrait list (and in conjunction with overloaded operators). In // this case, the `Result=Self` bind...
<|file_name|>p_roc.py<|end_file_name|><|fim▁begin|>"""Contains the drivers and interface code for pinball machines which use the Multimorphic R-ROC hardware controllers. This code can be used with P-ROC driver boards, or with Stern SAM, Stern Whitestar, Williams WPC, or Williams WPC95 driver boards. Much of this code...
async def get_hw_switch_states(self) -> Dict[str, bool]: """Read in and set the initial switch state.
<|file_name|>trackModel.js<|end_file_name|><|fim▁begin|>var WO = WO || {}; WO.Track = Backbone.Model.extend({ urlRoot: '/api/tracks', idAttribute: '_id', defaults: { notes: "", title: 'Acoustic Piano', isMuted: false, solo: false, octave: 4, volume: 0.75, instrument: "", type: '...
that.set('mRender', mRender); return that; });
<|file_name|>solution.py<|end_file_name|><|fim▁begin|>class Solution(object): def combinationSum(self, candidates, target): """ :type candidates: List[int] :type target: int :rtype: List[List[int]] """ def recurhelper(nums,res,path,target,start): if target...
candidates.sort() recurhelper(candidates,res,[],target,0)
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>#include "GameCtrl.h" char title[16][30]= { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,1,1,1,1,1,0,1,0,0,0,1,0,0,1,1,0,0,0,1,0,0,1,0,1,1,1,1,1,0}, {0,1,0,0,0,0,0,1,1,0,0,1,0,1,0,...
<|file_name|>vmovdqu8.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode}; use ::RegType::*; use ::instruction_def::*; use ::Operand::*; use ::Reg::*; use ::RegScale::*; fn vmovdqu8_1() { run_test(&Instruction { mnemonic: Mnemonic::VMOVDQ...
fn vmovdqu8_24() { run_test(&Instruction { mnemonic: Mnemonic::VMOVDQU8, operand1: Some(Indirect(RDI, Some(OperandSize::Zmmword), None)), operand2: Some(Direct(ZMM19)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[98, 225, 127, 72, ...
<|file_name|>lazytox.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 """ Lazy 'tox' to quickly check if branch is up to PR standards. This is NOT a tox replacement, only a quick check during development. """ import os import asyncio import sys import re import shlex from collections import namedtuple try: ...
<|file_name|>template.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package base import ( "container/list" "encoding/json" "fmt" "html/template" "runtime" "strings" ...
<|file_name|>generic-crud-service.ts<|end_file_name|><|fim▁begin|>namespace shared {<|fim▁hole|> private mongoDb: any; private collectionName: string private mongo: any; constructor(collectionName: string) { this.mongo = require('mongodb'); this.collectionName = ...
export class GenericCrudService<T> { private server: any;
<|file_name|>SignalAbstract.js<|end_file_name|><|fim▁begin|>define(["require", "exports", "./SignalConnection"], function (require, exports, SignalConnection_1) { "use strict"; var Task = (function () { function Task(fn) { this.next = null; this.fn = fn; } return ...
<|file_name|>pci.cc<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2014 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall * not be construed as granting a license to any other intellectual * property including but not limited to intellectual property rela...
intrPost(); }
<|file_name|>values.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/. */ //! Helper types and traits for the handling of CSS values. u...
// to write the separator next time we produce output again. self.inner.prefix = Some(self.separator);
<|file_name|>redis.go<|end_file_name|><|fim▁begin|>package redis // Copyright (c) Microsoft and contributors. 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 // htt...
resp, err := client.ListSender(req) if err != nil {
<|file_name|>types.rs<|end_file_name|><|fim▁begin|>use services::anoncreds::types::{PublicKey, RevocationPublicKey}; use utils::json::{JsonEncodable, JsonDecodable}; use services::ledger::constants::{ NODE, NYM, ATTRIB, SCHEMA, GET_ATTR, GET_DDO, GET_NYM, GET_SCHEMA, CLAIM_DEF, G...
pub _type: String, pub data: String }
<|file_name|>writer.py<|end_file_name|><|fim▁begin|>import cbor import hashlib import logging import zlib from .common import * # NOQA LOG = logging.getLogger(__name__) default_hashalgo = 'sha256' state_bos = 0 state_metadata = 1 state_data = 2 state_eos = 3 class MuxError(Exception): pass class InvalidSta...
self._write_block(blktype_metadata, metadata=self.metadata)
<|file_name|>src.js<|end_file_name|><|fim▁begin|>import { connecting, connected, reconnecting, connectionFailed } from './actions'; export default uri => store => { let ws; let hasEverConnected = false; const RECONNECT_TIMEOUT_MS = 2000; const ACTION = 'ACTION'; const connec...
ws.send(serverAction); } return next(action); };
<|file_name|>run.py<|end_file_name|><|fim▁begin|>import os import sys import drivecasa import logging import shlex import shutil import subprocess import yaml import glob casa = drivecasa.Casapy(log2term=True, echo_to_stdout=True, timeout=24*3600*10) CONFIG = os.environ["CONFIG"]<|fim▁hole|>OUTPUT = os.environ["OUTPU...
INPUT = os.environ["INPUT"]
<|file_name|>config.js<|end_file_name|><|fim▁begin|>/** * Update: 15-5-11 * Editor: qihongye */ var fs = require('fs'); var path = require('path'); var fis = require('../lib/fis.js'); var _ = fis.file; var defaultSettings = (require('../lib/config.js')).DEFALUT_SETTINGS; var expect = require('chai').expect; var u =...
properties: {name: 'prod'},
<|file_name|>manage.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "drf_ember.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)<|fim...
<|file_name|>0002_auto_20160912_2314.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-09-13 04:14 from __future__ import unicode_literals from django.db import migrations, models <|fim▁hole|> dependencies = [ ('rii_Api', '0001_initial'), ] operations = [ ...
class Migration(migrations.Migration):
<|file_name|>utils.rs<|end_file_name|><|fim▁begin|>use iso8601::{Date, DateTime, Time}; use xml::escape::escape_str_pcdata; use std::borrow::Cow; use std::fmt::Write; /// Escape a string for use as XML characters. /// /// The resulting string is *not* suitable for use in XML attributes, but XML-RPC doesn't use those....
"{:04}{:02}{:02}T{:02}:{:02}:{:02}", year, month, day, hour, minute, second
<|file_name|>common.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # 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/...
running. target (str):
<|file_name|>classes.py<|end_file_name|><|fim▁begin|>"""Defines the SMEFT class that provides the main API to smeftrunner."""<|fim▁hole|>from . import rge from . import io from . import definitions from . import beta from . import smpar import pylha from collections import OrderedDict from math import sqrt import numpy...
<|file_name|>search.controller.js<|end_file_name|><|fim▁begin|>(function() { 'use strict'; angular.module('columbyApp') .controller('SearchCtrl', function($log,$rootScope, $scope, SearchSrv) { /* ---------- SETUP ----------------------------------------------------------------------------- */ $scope.c...
SearchSrv.query({ text: $scope.search.searchTerm, limit: $scope.pagination.itemsPerPage }).then(function (response) {
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2015 Trustcode - www.trustcode.com.br # ...
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::int; use std::comm::stream; use std::comm::Port; use std::comm::Chan; type MaybeInt = Option<int>; fn fib_generator(max: int, chan: &Chan<MaybeInt>) { let mut a = 0; let mut b = 1; loop { let next = a + b; if next > max { ...
None => break, };
<|file_name|>setup.py<|end_file_name|><|fim▁begin|><|fim▁hole|> from setuptools import setup, find_packages import amqpy if sys.version_info < (3, 2): raise Exception('amqpy requires Python 3.2 or higher') name = 'amqpy' description = 'an AMQP 0.9.1 client library for Python >= 3.2.0' keywords = ['amqp', 'rabbit...
#!/usr/bin/env python3 import sys import os
<|file_name|>Class_LabExperimBased.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Class_LabExperimBased provides functionalities for data handling of data obtained in lab experiments in the field of (waste)water treatment. Copyright (C) 2016 Chaim De Mulder This program is free software: you can redistrib...
""" calculates the slope of the selected columns Parameters
<|file_name|>widget-footer.js<|end_file_name|><|fim▁begin|>/** * Widget Footer Directive */ angular<|fim▁hole|>function rdWidgetFooter() { var directive = { requires: '^rdWidget', transclude: true, template: '<div class="widget-footer" ng-transclude></div>', restrict: 'E' }; ...
.module('Home') .directive('rdWidgetFooter', rdWidgetFooter);
<|file_name|>D.js<|end_file_name|><|fim▁begin|>package test0438; <|fim▁hole|>class D { }<|fim▁end|>
import test0438_a.W;
<|file_name|>dev.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- """ DEV SCRIPT This is a hacky script meant to be run mostly automatically with the option of interactions. dev.py is supposed to be a developer non-gui interface into the IBEIS software. dev.py runs experiments and serv...
<|file_name|>curry.spec.ts<|end_file_name|><|fim▁begin|>import { expect } from 'chai'; import { Curry } from './curry'; describe('curry', () => { it('should curry the method with default arity', () => { class MyClass { @Curry() add(a: any, b?: any) { return a + b; } } const my...
expect(add5).to.be.an.instanceOf(Function); expect(add5(10)).to.equal(15);
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: david@reciprocitylabs.com # Maintained By: miha@reciprocitylabs.com import datetime import json ...
def as_json(obj, **kwargs):
<|file_name|>dispatcher.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap; use std::collections::hash_map::Entry; use std::io::{self, Cursor}; use std::net::SocketAddr; use std::thread; use bip_handshake::{DiscoveryInfo, InitiateMessage, Protocol}; use bip_util::bt::PeerId; use chrono::{DateTime, Duration}...
/// Yields the current timeout id if one is set. pub fn timeout_id(&self) -> Option<Timeout> {
<|file_name|>20.d.ts<|end_file_name|><|fim▁begin|>import * as React from "react"; import { CarbonIconProps } from "../../"; declare const FlowData20: React.ForwardRefExoticComponent< CarbonIconProps & React.RefAttributes<SVGSVGElement><|fim▁hole|>export default FlowData20;<|fim▁end|>
>;
<|file_name|>test_nova.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Copyright (c) 2017 Hewlett Packard Enterprise, L.P. # Copyright (c) 2013 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 ...
<|file_name|>moin_migration_cleanup.py<|end_file_name|><|fim▁begin|>import re from waliki.signals import page_saved from optparse import make_option from django.core.management.base import BaseCommand, CommandError from waliki.models import Page from django.utils.translation import ugettext_lazy as _ from django.utils....
page=page, author=None, message=options['message'], form_extra_data={})
<|file_name|>implem_iterative_no_stack.cpp<|end_file_name|><|fim▁begin|>#include <algorithm> #include <iterator> #include <vector> #include "ihanoi.hpp" #include "aim.hpp" // Algorithm to be tested template <int from, int other, int to> struct ApplyMapping { std::pair<std::size_t, std::size_t> operator()(std::pa...
void hanoi(IHanoi& tower) { if (tower.height_of(0) == 0)
<|file_name|>util_test.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*- """ @author: Rinze de Laat Copyright © 2013 Rinze de Laat, Delmic This file is part of Odemis. Odemis is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by t...
<|file_name|>vaspdata.py<|end_file_name|><|fim▁begin|>""" Classes:: VASPData -- A collection of functions that wrap bash code to extract data from VASP output into managable .dat (.txt) files. """ import numpy as np<|fim▁hole|>from subprocess import call, check_output from ast import literal_eval class VASPData...
<|file_name|>feature.py<|end_file_name|><|fim▁begin|># # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache L...
"""
<|file_name|>writeback.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/licen...
MethodCall::expr(e.id)); match e.node { ast::ExprClosure(_, _, ref decl, _) |
<|file_name|>nevergrad.py<|end_file_name|><|fim▁begin|>import logging import pickle from typing import Dict, Optional, Union, List, Sequence from ray.tune.result import DEFAULT_METRIC from ray.tune.sample import Categorical, Domain, Float, Integer, LogUniform, \ Quantized from ray.tune.suggest.suggestion import UN...
if points_to_evaluate is None: self._points_to_evaluate = None
<|file_name|>moderator.py<|end_file_name|><|fim▁begin|># Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/...
class EmailDraftHandler(base.BaseHandler): """Provide default email templates for moderator emails."""
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import { NlpjsNlu, NlpjsNluConfig } from './NlpjsNlu'; declare module '@jovotech/framework/dist/types/Extensible' {<|fim▁hole|> interface ExtensiblePluginConfig { NlpjsNlu?: NlpjsNluConfig; } interface ExtensiblePlugins { NlpjsNlu?: NlpjsNlu; } } expo...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! # The Standard Library //! //! This module defines the standard libary used when evaluating Robin expressions //! Most of this module contains code for converting Robin functions to special-case JS constructs mod stdlib_names; use itertools::{join, Itertools}; use...
"non-list given to lambda expression", ))),
<|file_name|>clean002.py<|end_file_name|><|fim▁begin|>self.description = "CleanMethod = KeepCurrent" sp = pmpkg("dummy", "2.0-1") self.addpkg2db("sync", sp) sp = pmpkg("bar", "2.0-1") self.addpkg2db("sync", sp) sp = pmpkg("baz", "2.0-1") self.addpkg2db("sync", sp)<|fim▁hole|>lp = pmpkg("bar", "2.0-1") self.addpkg2db...
lp = pmpkg("dummy", "1.0-1") self.addpkg2db("local", lp)
<|file_name|>normalize.py<|end_file_name|><|fim▁begin|><|fim▁hole|> def zero_mean_normalize_image_data(data, axis=(0, 1, 2)): return np.divide(data - data.mean(axis=axis), data.std(axis=axis)) def foreground_zero_mean_normalize_image_data(data, channel_dim=4, background_value=0, tolerance=1e-5): data = np.cop...
import numpy as np
<|file_name|>course_structure_spec.js<|end_file_name|><|fim▁begin|>define([ 'jquery', 'underscore', 'common/js/spec_helpers/template_helpers', 'js/spec/edxnotes/helpers', 'js/edxnotes/collections/notes', 'js/edxnotes/collections/tabs', 'js/edxnotes/views/tabs/course_structure', 'js/spec/edxnotes/custom_matc...
identifier: 'view-course-structure', icon: 'fa fa-list-ul', is_active: true, is_closable: false,
<|file_name|>orbitalWidget.py<|end_file_name|><|fim▁begin|>class orbitalWidget(QGroupBox): def __init__(self): super(QGroupBox, self).__init__() self.initUI() def initUI(self): table= orbitalTable(0, 3) table.horizontalHeader().setResizeMode(QHeaderView.Stretch) <|fim▁hole|> ...
<|file_name|>test_contexts.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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....
"collectLogs": False, "collectArtifacts": False,
<|file_name|>check_print.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistr...
self.localcontext.update({ 'time': time, 'get_lines': self.get_lines,
<|file_name|>embed.py<|end_file_name|><|fim▁begin|>''' Provide functions to embed Bokeh models (e.g., plots, widget, layouts) in various different ways. There are a number of different combinations of options when embedding Bokeh plots. The data for the plot can be contained in the document, or on a Bokeh server, or i...
template (Template, optional) : HTML document template (default: FILE) A Jinja2 Template, see bokeh.templates.FILE for the required template parameters template_variables (dict, optional) : variables to be used in the Jinja2
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals import datetime import re import sys from unittest import skipIf import warnings from xml.dom.minidom import parseString try: import pytz except ImportError: pytz = None from django.core import serializers from django....
self.assertQuerysetEqual( Event.objects.datetimes('dt', 'day'), [datetime.datetime(2011, 1, 1, 0, 0, 0, tzinfo=EAT)], transform=lambda d: d)
<|file_name|>BlobObject.java<|end_file_name|><|fim▁begin|>package com.elderbyte.josc.api; import com.elderbyte.josc.core.BlobObjectUtils; import java.time.Instant; import java.util.Map; import java.util.Optional; /** * Represents a blob object */ public interface BlobObject { /** * Gets the bucket name w...
* Slashes are interpreted as virtual directory indicators. * * @return Returns the last part after the last '/', if no '/' is found returns the input string. */
<|file_name|>twistedtools.py<|end_file_name|><|fim▁begin|>""" Twisted integration ------------------- This module provides a very simple way to integrate your tests with the Twisted_ event loop. You must import this module *before* importing anything from Twisted itself! Example:: from nose.twistedtools import re...
def errback(failure): # Retrieve and save full exception info try: failure.raiseException()
<|file_name|>device.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals def device_from_request(request): """ Determine's the device name from the request by first looking for an overridding cookie, and if not found then matching the user agent. Used at both the template level for ...
try: user_agent = user_agent.decode("utf-8") except AttributeError: pass
<|file_name|>index.py<|end_file_name|><|fim▁begin|>from flask import Flask from flask import render_template from .. import app @app.route('/') def index(): user = {'first_name': 'Lance', 'last_name': 'Anderson'} return render_template('index.html', user=user) @app.route('/user/<user_id>/board/<board_id>') @...
user = {'first_name': 'Lance', 'last_name': 'Anderson'} return render_template('board.html', user=user)
<|file_name|>plot_feature_distributions.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ''' Plot distribution of each feature, conditioned on its bfeature type ''' import argparse import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from common import * from information import ut...
<|file_name|>DoubleRangeParameter.java<|end_file_name|><|fim▁begin|>/* * Copyright 2006-2020 The MZmine Development Team * * This file is part of MZmine. * * MZmine 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...
<|file_name|>setup_test.go<|end_file_name|><|fim▁begin|>package sign import ( "testing" "github.com/coredns/caddy" ) func TestParse(t *testing.T) { tests := []struct { input string shouldErr bool exp *Signer }{ {`sign testdata/db.miek.nl miek.nl { key file testdata/Kmiek.nl.+013+59725 }`,...
}