prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>fktv.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( clean_html, determine_ext, js_to_json, ) class FKTVIE(InfoExtractor): IE_NAME = 'fernsehkritik.tv' _VALID_URL = r'http://(?:www\.)?fernsehkritik\.tv/fo...
'title': 'Folge 1 vom 10. April 2007', 'thumbnail': 're:^https?://.*\.jpg$', },
<|file_name|>ndarray.native.js<|end_file_name|><|fim▁begin|>/** * @license Apache-2.0 * * Copyright (c) 2020 The Stdlib Authors.<|fim▁hole|>* You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed un...
* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
<|file_name|>constant_op.py<|end_file_name|><|fim▁begin|># Copyright 2015 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 License at # # http://www.apache.org/licens...
<|file_name|>Bibliography.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ C.11.3 Bibliography and Citation (p208) """ import plasTeX, codecs from plasTeX.Base.LaTeX.Sectioning import chapter, section from plasTeX import Command, Environment from Lists import List log = plasTeX.Logging.getLogger() class b...
args = '[ text ] bibkeys:list:str' @property
<|file_name|>item_func.cc<|end_file_name|><|fim▁begin|>/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 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; version...
return check_float_overflow(atan2(value,val2)); }
<|file_name|>ppaux.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/licenses/...
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main import ( "encoding/json" "fmt" "net/url" "os" "time" "github.com/Sirupsen/logrus" "github.com/codegangsta/cli" "github.com/gin-gonic/gin" "github.com/gorilla/schema" "github.com/itsjamie/gin-cors" "github.com/moul/as-a-service" ) func main() {...
ret, err := fn(nil)
<|file_name|>JadbDevice.java<|end_file_name|><|fim▁begin|>package se.vidstige.jadb; import se.vidstige.jadb.managers.Bash; import java.io.*; import java.util.ArrayList; import java.util.List; public class JadbDevice { public enum State { Unknown, Offline, Device, Recovery, ...
public void push(File local, RemoteFile remote) throws IOException, JadbException { FileInputStream fileStream = new FileInputStream(local);
<|file_name|>issue-21221-2.rs<|end_file_name|><|fim▁begin|>pub mod foo { pub mod bar {<|fim▁hole|> } // imports should be ignored: use self::bar::T; } pub mod baz { pub use foo; pub use std::ops::{Mul as T}; } struct Foo; impl T for Foo { } //~^ ERROR cannot find trait `T` fn main() {}<|fim▁en...
// note: trait T is not public, but being in the current // crate, it's fine to show it, since the programmer can // decide to make it public based on the suggestion ... pub trait T {}
<|file_name|>empty-allocation-non-null.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<|fim▁hole|> //...
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms.
<|file_name|>nsd.go<|end_file_name|><|fim▁begin|>package main import ( "crypto/sha1" "encoding/hex" "encoding/json" "fmt" "net" "os" "os/exec" "text/template" "github.com/golang/glog" k8sexec "k8s.io/kubernetes/pkg/util/exec" ) const ( nsdTmpl = ` ` ) type record struct { name string ip net.IP } typ...
cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr
<|file_name|>na_to_nc.py<|end_file_name|><|fim▁begin|># Copyright (C) 2004 CCLRC & NERC( Natural Environment Research Council ). # This software may be distributed under the terms of the # Q Public License, version 1.0 or later. http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt """ na_to_nc.py ========...
print na_file_obj, type(na_file_obj) if type(na_file_obj) == type("string"):
<|file_name|>observer.py<|end_file_name|><|fim▁begin|># # This file is part of pysnmp software. # # Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pysnmp/license.html # from pysnmp import error class MetaObserver(object): """This is a simple facility for exposing internal...
if not self.__observers[execpoint]: del self.__observers[execpoint]
<|file_name|>auto_ml_client.go<|end_file_name|><|fim▁begin|>// 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 // // https://www.apache.org/licenses/LICENSE-...
client automlpb.AutoMlClient
<|file_name|>UUIDDirectoryStoreFilenameDecoder.java<|end_file_name|><|fim▁begin|>package org.apache.activemq.nob.filestore.uuiddir; import org.apache.activemq.nob.filestore.BrokerFilenameDecoder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.util.UUID; /** * Decoder of fi...
<|file_name|>borrowck-ref-mut-of-imm.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// 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 // h...
<|file_name|>initialise_variables.cpp<|end_file_name|><|fim▁begin|>//----------------------------------------------------------------------------- // // Vampire - A code for atomistic simulation of magnetic materials // // Copyright (C) 2009-2012 R.F.L.Evans // // Email:richard.evans@york.ac.uk // // This program i...
zlog << zTs() << "\t sim:applied-field-strength-increment = " << inc << std::endl; zlog << zTs() << "Minimum and maximum fields are both positive, but maximum > minimum with a negative increment, causing an infinite loop. Exiting." << std::endl; err::vexit();
<|file_name|>mbcsgroupprober.js<|end_file_name|><|fim▁begin|>/* * The Original Code is Mozilla Universal charset detector code. * * The Initial Developer of the Original Code is<|fim▁hole|> * Contributor(s): * António Afonso (antonio.afonso gmail.com) - port to JavaScript * Mark Pilgrim - port to Python * S...
* Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 2001 * the Initial Developer. All Rights Reserved. *
<|file_name|>tmpfs_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package provider_test import ( "github.com/juju/errors" "github.com/juju/names" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" "github.com/juju/juju/...
})
<|file_name|>update_roles.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of Django appschema released under the MIT license. # See the LICENSE for more information. from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand from d...
def update_perm_roles(self, perm, existing_perm): if existing_perm.roles.filter(name__in=perm['roles']).count() < len(perm['roles']):
<|file_name|>treatment_prescription.js<|end_file_name|><|fim▁begin|>var mongoose = require('mongoose'); var TreatmentPrescription = mongoose.model('TreatmentPrescription', require('../models/TreatmentPrescription').TreatmentPrescriptionSchema); function list(response, params){ TreatmentPrescription.find(params) .so...
<|file_name|>store_runtime.go<|end_file_name|><|fim▁begin|>package session import ( "container/list" "sync" "time" ) // MemProvider Implement the provider interface type RuntimeStore struct { lock *sync.RWMutex // locker sessions map[string]*list.Element // map in memory list *list.L...
<|file_name|>dynamic.py<|end_file_name|><|fim▁begin|>''' @Summary: Utility Methods for dynamic actions during program operation. @Author: devopsec ''' import os, sys, socket, inspect def getWorkingDirs(): ''' Returns project dir, parent dir, and current dir of calling script as dict''' project_dir, parent_di...
<|file_name|>TwissTrain9.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Sep 20 13:37:16 2017 Author: Peiyong Jiang : jiangpeiyong@impcas.ac.cn Function: 旋转使得变换。 """ import matplotlib.pyplot as plt import tensorflow as tf import numpy as np plt.close('all...
w2=tf.sin(w)
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2020 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 RPhilentropy(RPackage): """Computes 4...
<|file_name|>LarmorClipping.py<|end_file_name|><|fim▁begin|>#!/sw/bin/python2.7 import sys sys.path.append("..") from ucnacore.PyxUtils import * from math import * from ucnacore.LinFitter import * #from UCNAUtils import * from bisect import bisect from calib.FieldMapGen import * def clip_function(y,rho,h,R): sqd = ...
for seg in psplit[0::2]: c.stroke(seg,p.sty) else: c.stroke(p.p,p.sty+p.endsty)
<|file_name|>dynamo.py<|end_file_name|><|fim▁begin|>import logging import pendulum from pynamodb.attributes import (UnicodeAttribute, UTCDateTimeAttribute) from pynamodb.exceptions import DoesNotExist from pynamodb.models import Model from . import BaseLocker, Lock, LockAccessDenied log = logging.getLogger(__nam...
Use DynamoDB for locking.
<|file_name|>marketData.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import numpy as np from pandas import read_csv as importDB import pandas as pd database = r'\\UBSPROD.MSAD.UBS.NET\UserData\ozsanos\RF\Desktop\Black\stockData.csv' tickers = ['AAPL','ADBE','ADI','AMD','AXP','BRCM','C','GLD','GOOG',...
print simulate(dateRange[is2011][0], dateRange[is2011][1], symbolSet, weights)
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>fn hello() -> u8 { return 0; } fn main() { hello(); println!("Hello, world!");<|fim▁hole|>fn test_hello() { assert_eq!(0, hello()); }<|fim▁end|>
} #[test]
<|file_name|>gh-path.js<|end_file_name|><|fim▁begin|>import {helper} from 'ember-helper'; import {htmlSafe} from 'ember-string'; import ghostPaths from 'ghost-admin/utils/ghost-paths'; // Handlebars Helper {{gh-path}} // Usage: Assume 'http://www.myghostblog.org/myblog/' // {{gh-path}} or {{gh-path 'blog'}} for Ghost'...
switch (path.toString()) { case 'blog': base = paths.blogRoot;
<|file_name|>contact.py<|end_file_name|><|fim▁begin|>from sys import maxsize class Contact: def __init__(self, Firstname=None, Middlename=None, Lastname=None, Nickname=None, Title=None, Company=None, Address=None, Home=None, Mobile=None, Work=None, Fax=None, Email=None, Email2=None, Email3=N...
<|file_name|>qmodelindex.rs<|end_file_name|><|fim▁begin|>use types::*; extern "C" { fn dos_qmodelindex_create() -> DosQModelIndex; // DOS_API DosQModelIndex *DOS_CALL dos_qmodelindex_create_qmodelindex(DosQModelIndex *index); // DOS_API void DOS_CALL dos_qmodelindex_delete (DosQModelIndex *vptr); fn d...
// DOS_API void DOS_CALL dos_qmodelindex_assign (DosQModelIndex *l, const DosQModelIndex *r); }
<|file_name|>inctest_runme.py<|end_file_name|><|fim▁begin|><|fim▁hole|>try: a = inctest.A() except: print "didn't find A" print "therefore, I didn't include 'testdir/subdir1/hello.i'" error = 1 pass try: b = inctest.B() except: print "didn't find B" print "therefore, I didn't include 'testdir/subdir2/he...
import inctest error = 0
<|file_name|>UptoboxCom.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import re import urlparse from ..internal.misc import json from ..internal.XFSAccount import XFSAccount class UptoboxCom(XFSAccount):<|fim▁hole|> __status__ = "testing" __description__ = """Uptobox.com account plugin""" __li...
__name__ = "UptoboxCom" __type__ = "account" __version__ = "0.21"
<|file_name|>issue-3389.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/lice...
for vector.iter().advance |string| {
<|file_name|>stages.js<|end_file_name|><|fim▁begin|>/* * The MIT License (MIT) * * Copyright (c) 2015 maldicion069 * * 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...
/*var infoData = []; tabs[index].matrix.forEach(function(matrix, area) {
<|file_name|>chunk_test.go<|end_file_name|><|fim▁begin|>package minecraft import ( "testing" "vimagination.zapto.org/minecraft/nbt" ) func TestNew(t *testing.T) { biomes := make(nbt.ByteArray, 256) biome := int8(-1) blocks := make(nbt.ByteArray, 4096) add := make(nbt.ByteArray, 2048) data := make(nbt.ByteArra...
nbt.NewTag("TerrainPopulated", nbt.Byte(1)),
<|file_name|>DeleteNodeBST.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: node = parent = None def deleteNode(self, root: TreeNode, key: int) -> TreeNode: # search for the node and its pa...
root.left.left = TreeNode(2) root.left.right = TreeNode(8) root.left.right.left = TreeNode(7)
<|file_name|>Electric dipole field lines.py<|end_file_name|><|fim▁begin|>from __future__ import division #Para não truncar a divisão de inteiros from visual import * #Módulo com as funções gráficas do VPython from math import * scene_range = 15 scene.width = 1920 scene.height = 1080 scene.fullscreen = T...
for i in range(array_particulas_emf.size): #Se as particulas se afastarem consideravelmento do centro dos polos ou quando entrarem dentro do polo neg, são imobilizadas if ((mag(array_particulas_emf[i].pos) < scene_range) and (mag(array_particulas_emf[i].pos - polo_neg.pos) > polo_neg.rad...
<|file_name|>paper.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # -*- coding: utf-8 -*- ''' Created on May 12, 2014 Model Paper fields: conf year passcode paper id status title category1 category1 keywords @author: riccardo ''' class Paper(object): __conf="" __year="" __passco...
def set_keywords(self, value): self.__keywords = value
<|file_name|>GAPopulation.java<|end_file_name|><|fim▁begin|>package ga; import engine.*; import java.util.*; public class GAPopulation { /* Evolutionary parameters: */ public int size; // size of the population public int ngens; // total number of generations public int currgen; // current generation /* Cross...
max_fitness = new double[ngens]; avg_fitness = new double[ngens]; terminals = new double[ngens]; bigterminals = new double[ngens];
<|file_name|>ContextTest.py<|end_file_name|><|fim▁begin|>import rdflib from rdflib.term import URIRef, Variable from PyOpenWorm.dataObject import DataObject, InverseProperty from PyOpenWorm.context import Context from PyOpenWorm.context_store import ContextStore from .DataTestTemplate import _DataTest try: from uni...
graph = Mock() graph.store.triples.side_effect = [[((None, None, ctxid0), ())], []] ctx.conf = {'rdf.graph': graph}
<|file_name|>header.component.spec.ts<|end_file_name|><|fim▁begin|>/* tslint:disable:no-unused-variable */ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { DebugElement } from '@angular/core'; import { HeaderComponent } from './head...
<|file_name|>primitives_OBSERVED.py<|end_file_name|><|fim▁begin|>from astrodata.ReductionObjects import PrimitiveSet class OBSERVEDPrimitives(PrimitiveSet): astrotype = "OBSERVED" def init(self, rc): print "OBSERVEDPrimitives.init(rc)" return def typeSpecificPrimitive(self, rc): ...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public<|fim▁hole|> #[macro_use] extern crate quote; #[macro_use] extern crate syn; #[macro_use] extern crate synstructure; decl_derive!([JSTraceable] => js_traceable_derive); fn js_traceable_derive(s: syns...
* 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/. */
<|file_name|>ModuleImpl.java<|end_file_name|><|fim▁begin|>// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.module.impl; import com.intellij.configurationStore.RenameableStateStorag...
<|file_name|>editor-spec.js<|end_file_name|><|fim▁begin|>import React from "react"; import { expect } from "chai"; import { mount } from "enzyme"; import { Provider } from "react-redux"; import Editor from "../../../src/notebook/providers/editor"; import { dummyStore } from "../../utils"; import { UPDATE_CELL_SOURCE...
resolve();
<|file_name|>game.cpp<|end_file_name|><|fim▁begin|>/** * The Forgotten Server - a free and open-source MMORPG server emulator * Copyright (C) 2014 Mark Samman <mark.samman@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as ...
<|file_name|>pyramid.cpp<|end_file_name|><|fim▁begin|>/* contourlet - Implementation of the contourlet transform for image coding Copyright (C) 2005 Vivien Chappelier - IRISA/University of Rennes 1 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Pu...
(X) = (x) + (d); \
<|file_name|>mirroring.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import flask import functools import logging import requests from .. import storage from .. import toolkit from . import cache from . import config DEFAULT_CACHE_TAGS_TTL = 48 * 3600 logger = logging.getLogger(__name__) def is_mirror()...
logger.debug('Response: {0}\n{1}\n'.format(
<|file_name|>higher.rs<|end_file_name|><|fim▁begin|>//! This module contains functions that retrieves specifiec elements. #![deny(clippy::missing_docs_in_private_items)] use crate::{is_expn_of, match_def_path, paths}; use if_chain::if_chain; use rustc_ast::ast::{self, LitKind}; use rustc_hir as hir; use rustc_hir::{B...
if is_expn_of(fun.span, "vec").is_some(); if let Some(fun_def_id) = cx.qpath_res(qpath, fun.hir_id).opt_def_id(); then { return if match_def_path(cx, fun_def_id, &paths::VEC_FROM_ELEM) && args.len() == 2 {
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>namespace adoneTests.text { const { text } = adone; let str: string; let regExp: RegExp; let bool: boolean; let num: number; namespace escape { const { escape } = text; str = escape.regExpPatter...
str = escape.htmlSpecialChars("asd"); } namespace regexp {
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from django.test import TestCase from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.forms.models import modelformset_factory from django.forms.formsets import formset_factory from formsettesthelpers import * from forms...
<|file_name|>hello.js<|end_file_name|><|fim▁begin|>var task = function(request, callback, configuration){ var template = "helloParamterized.ejs"; var AWS = configuration.aws; var S3 = new AWS.S3(); callback(null, {template: template, params:{info:"Hello World from code!"}});<|fim▁hole...
}
<|file_name|>GlobalObjects.go<|end_file_name|><|fim▁begin|>package config import ( "github.com/griesbacher/nagflux/data" "sync" ) //PauseMap is a map to store if an target requested pause or not type PauseMap map[data.Target]bool //pauseNagflux is used to sync the state of the influxdb var pauseNagflux = PauseMap{...
result = true
<|file_name|>heroes.routes.ts<|end_file_name|><|fim▁begin|>import { RouterConfig } from '@angular/router'; import { HeroesComponent } from '../components/hero/heroes.component';<|fim▁hole|>import { HeroDetailComponent } from "../components/hero/./hero-detail.component";...
<|file_name|>historystore.rs<|end_file_name|><|fim▁begin|>/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This software may be used and distributed according to the terms of the * GNU General Public License version 2. */ use std::ops::Deref; use std::path::PathBuf; use anyhow::Result; use edenapi_typ...
/// `prefetch` API. pub trait RemoteHistoryStore: HgIdHistoryStore + Send + Sync { /// Attempt to bring the data corresponding to the passed in keys to a local store. ///
<|file_name|>limits.py<|end_file_name|><|fim▁begin|># Copyright 2010-2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at<|fim▁hole|># ...
# # http://www.apache.org/licenses/LICENSE-2.0 #
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig class DonateAppConfig(AppConfig): name = 'readthedocs.donate'<|fim▁hole|> def ready(self): import readthedocs.donate.signals # noqa<|fim▁end|>
verbose_name = 'Donate'
<|file_name|>unique-object-move.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....
// pretty-expanded FIXME #23616
<|file_name|>Hasher.js<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the license found in the LICENSE file in * the root directory of this source tree. * * @flow */ /** * Get a hash for the provider object. Hashes ar...
case 'number': return item; default: throw new Error('Unhashable object');
<|file_name|>TemporarySummon.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/><|fim▁hole|> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General P...
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*- from reportlab.lib.colors import Color from unittest import TestCase from xhtml2pdf.util import getCoords, getColor, getSize, getFrameDimensions, \ getPos, getBox from xhtml2pdf.tags import int_to_roman class UtilsCoordTestCase(TestCase...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import CoreClient from './CoreClient';<|fim▁hole|><|fim▁end|>
export default CoreClient;
<|file_name|>test_memory.py<|end_file_name|><|fim▁begin|># @Author: dileep # @Last Modified by: dileep import random import pytest from microbial_ai.regulation import Event, Action, Memory @pytest.fixture def random_action(): return Action(type='fixed', phi={'rxn1': (random.random(), '+')}) @pytest.fixture d...
memory.add_event(random_event) assert len(memory.memory) == memory.capacity
<|file_name|>hash-to-url.js<|end_file_name|><|fim▁begin|>const _parseHash = function (hash) { let name = ''; let urlType = ''; let hashParts = hash.split('_'); if (hashParts && hashParts.length === 2) { name = hashParts[1]; let type = hashParts[0]; // take off the "#" let finalType = type.slice(...
switch (finalType) {
<|file_name|>ns_css_value.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/. */ //! Little helpers for `nsCSSValue`. use gecko_bindings...
&*array } /// Sets LengthOrPercentage value to this nsCSSValue.
<|file_name|>base.py<|end_file_name|><|fim▁begin|>from copy import deepcopy from manager_utils import upsert class BaseSmartManager(object): def __init__(self, template): self._template = deepcopy(template) self._built_objs = set() @property def built_objs(self): return self._bui...
Builds an object using the upsert function in manager utils. If the object can be deleted
<|file_name|>Halos.js<|end_file_name|><|fim▁begin|>Clazz.declarePackage ("J.shape"); Clazz.load (["J.shape.AtomShape"], "J.shape.Halos", ["JU.BSUtil", "$.C"], function () { c$ = Clazz.decorateAsClass (function () { this.colixSelection = 2; this.bsHighlight = null; this.colixHighlight = 10; Clazz.instantialize (this, ar...
this.setShapeVisibility (this.atoms[i], isVisible); } }, "JU.BS"); Clazz.overrideMethod (c$, "getShapeState",
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>########################################################### # # Copyright (c) 2005-2009, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, t...
# or disclosed in any way without written permission. # # #
<|file_name|>camera.rs<|end_file_name|><|fim▁begin|>extern crate mithril; use std::f64; use std::num::Float; use self::mithril::math::{ Vector, Quaternion }; pub struct Camera { position: Vector, focus_point: Vector, up: Vector, field_of_view: f64, aspect_ratio: f64, far: f64, near: f64, ...
pub fn view_matrix(&self) -> [f32; 16] { let mut z_view = (self.position - self.focus_point).normalize(); let mut x_view = self.up.cross(z_view).normalize();
<|file_name|>PersistedElement.tsx<|end_file_name|><|fim▁begin|>/* Copyright 2018 New Vector Ltd. 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 Unle...
};
<|file_name|>GameCharacter.java<|end_file_name|><|fim▁begin|>package zyx.game.components.world.characters; import java.util.ArrayList; import org.lwjgl.util.vector.Matrix4f; import zyx.game.behavior.characters.CharacterAnimationBehavior; import zyx.game.behavior.player.OnlinePositionInterpolator; import zyx.game.compo...
info.name = vo.name; info.gender = vo.gender; info.type = vo.type; }
<|file_name|>config_unspecified.go<|end_file_name|><|fim▁begin|>// +build !suse,!ubuntu,!al2 // Copyright 2017-2018 Amazon.com, Inc. or its affiliates. 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. A copy o...
// express or implied. See the License for the specific language governing // permissions and limitations under the License. package config
<|file_name|>clothes_shop.py<|end_file_name|><|fim▁begin|>clouthes = ["T-Shirt","Sweater"] print("Hello, welcome to my shop\n") while (True): comment = input("Welcome to our shop, what do you want (C, R, U, D)? ") if comment.upper()=="C": new_item = input("Enter new item: ") clouthes.append(new_item.capitalize())...
for item in clouthes: if clouthes.index(item)<len(clouthes)-1: print(item,end=', ') else:
<|file_name|>MaterialeCorso_View.java<|end_file_name|><|fim▁begin|>/** ======================================================================== */ /** */ /** @copyright Copyright (c) 2010-2015, S2S s.r.l. */ /** @license http://www.gnu.org/l...
<|file_name|>plex.py<|end_file_name|><|fim▁begin|>""" homeassistant.components.media_player.plex ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides an interface to the Plex API. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.plex/ """ impor...
_LOGGER.error('Reading config file failed: %s', error) # This won't work yet return False
<|file_name|>_logger.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Custom module logger """ import logging module_name = 'moflow' logger = logging.getLogger(module_name) logger.addHandler(logging.NullHandler()) # best practice to not show anything def use_basic_config(level=logging.INFO, format=loggin...
logger.level = level if module_name not in [_.name for _ in logger.handlers]: formatter = logging.Formatter(format) handler = logging.StreamHandler()
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate util; pub mod constants; use std::i64; use std::io; use std::str::from_utf8; use std::u32; #[cfg(test)] use std::usize; use util::htonl; use constants::*; #[derive(Debug)] pub enum EncodeError { IOError(io::Error), OverflowError, } impl From<io:...
fn test_encode_i64() {
<|file_name|>issue-28927-2.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 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<|fim▁hole|>// option. This...
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
<|file_name|>types.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2015, Thomas Scholtes. # # 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 w...
mytypes[key] = library.DateType()
<|file_name|>proc_modis_qc.py<|end_file_name|><|fim▁begin|>############################################################################### # $Id$ # # Project: Sub1 project of IRRI # Purpose: Quality Assessment extraction from MODIS # Author: Yann Chemin, <yann.chemin@gmail.com> # ###################################...
# figure out intersection region tgw_ulx = max(t_ulx,self.ulx)
<|file_name|>server_usage.py<|end_file_name|><|fim▁begin|># Copyright 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 obtain # a copy of the License at # # http://www.apache.org/license...
LOG = logging.getLogger(__name__)
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#coding=utf-8 import unittest import HTMLTestRunner import time from config import globalparam from public.common import sendmail def run(): test_dir = './testcase' suite = unittest.defaultTestLoader.discover(start_dir=test_dir,pattern='test*.py') now = ti...
runner = HTMLTestRunner.HTMLTestRunner( stream=f, title='测试报告',
<|file_name|>const.py<|end_file_name|><|fim▁begin|>"""All constants related to the ZHA component.""" import enum import logging from typing import List import bellows.zigbee.application from zigpy.config import CONF_DEVICE_PATH # noqa: F401 # pylint: disable=unused-import import zigpy_cc.zigbee.application import zig...
return self._desc
<|file_name|>test_missing_function_pycode.py<|end_file_name|><|fim▁begin|>""" @brief test log(time=8s) @author Xavier Dupre """ import sys import os import unittest import shutil from contextlib import redirect_stdout from io import StringIO from pyquickhelper.pycode import ExtTestCase from pyquickhelper.pycod...
os.mkdir(os.path.join(temp, '_unittests')) f = StringIO() with redirect_stdout(f):
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from cStringIO import StringIO from struct import pack, unpack, error as StructError from .log import log from .structures import fields class DBFile(object): """ Base class for WDB and DBC files """ @classmethod def open(cls, file, build, structure, environment...
Delete every row in the file """ for k in self.keys(): # Use key, otherwise we get RuntimeError: dictionary changed size during iteration del self[k]
<|file_name|>DecimalRange.java<|end_file_name|><|fim▁begin|>/** * Copyright 2011-2017 Asakusa Framework Team. * * 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....
*/ public class DecimalRange implements ValuePredicate<BigDecimal> {
<|file_name|>dig.rs<|end_file_name|><|fim▁begin|>extern crate argparse; extern crate domain; extern crate tokio_core; use std::error; use std::result; use std::str::FromStr; use domain::bits::message::{MessageBuf, RecordSection}; use domain::bits::name::{DNameBuf, DNameSlice}; use domain::iana::{Class, Rtype}; use dom...
// -m // -p port#
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Sharing.settings") from django.core.management import execute_from_command_line<|fim▁hole|> execute_from_command_line(sys.argv)<|fim▁end...
<|file_name|>popup.js<|end_file_name|><|fim▁begin|>"use strict"; /** * @var jaegerhut [Object] Badge icons, one for each policy */ const jaegerhut = { 0: { name: "allowall", colour: "#D84A4A", text: chrome.i18n.getMessage("policyAllowAll") }, 1: { name: "relaxed", colour: "#559FE6", text: chrome.i18n....
*/ const nodeHost = document.createElement("div");
<|file_name|>0005_auto__add_field_schema_immutable.py<|end_file_name|><|fim▁begin|># encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Schema.immutabl...
'immutable': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) }, 'tardis_portal.dataset_file': {
<|file_name|>package.rs<|end_file_name|><|fim▁begin|>use std::cell::{Ref, RefCell}; use std::collections::HashMap; use std::fmt; use std::hash; use std::path::{Path, PathBuf}; use semver::Version; use core::{Dependency, Manifest, PackageId, SourceId, Target, TargetKind}; use core::{Summary, Metadata, SourceMap}; use ...
impl Encodable for Package { fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
<|file_name|>bmotion.integrated.js<|end_file_name|><|fim▁begin|>requirejs(['bmotion.config'], function() {<|fim▁hole|><|fim▁end|>
requirejs(['bms.integrated.root'], function() {}); });
<|file_name|>cli.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node // // cli.js // // Copyright (c) 2016-2017 Junpei Kawamoto<|fim▁hole|>// http://opensource.org/licenses/mit-license.php // const { start, crawl } = require("../lib/crawler"); const argv = require("yargs") .option("lang", { descri...
// // This software is released under the MIT License. //
<|file_name|>fuse.rs<|end_file_name|><|fim▁begin|>use core::pin::Pin; use futures_core::stream::{FusedStream, Stream}; use futures_core::task::{Context, Poll}; #[cfg(feature = "sink")] use futures_sink::Sink; use pin_utils::{unsafe_pinned, unsafe_unpinned}; /// Stream for the [`fuse`](super::StreamExt::fuse) method. #...
} /// Returns whether the underlying stream has finished or not.
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2017 https://github.com/ping # # This software is released under the MIT License. # https://opensource.org/licenses/MIT <|fim▁hole|><|fim▁end|>
__version__ = '0.3.9'
<|file_name|>DestinationFilterTest.java<|end_file_name|><|fim▁begin|>/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to ...
assertTrue("Filter did not match", filter.matches(new ActiveMQQueue("A.B")));
<|file_name|>queue_test.go<|end_file_name|><|fim▁begin|>// Copyright (C) 2014 The Syncthing Authors. // // 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/. package model...
if l := len(actual); l != 4 { t.Fatalf("Weird length %d returned from Jobs()", l)
<|file_name|>CCPlugin.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: UTF-8 -*- from abc import ABCMeta, abstractmethod<|fim▁hole|> """@Interface""" __metaclass__ = ABCMeta @abstractmethod def perform(self): pass @abstractmethod def __init__(self): self._path = None self._request = None ""...
from cloudclient import CCResponse class CCPlugin(object):