prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>// Karma configuration // Generated on Tue Sep 09 2014 13:58:24 GMT-0700 (PDT) 'use strict'; var browsers = ['Chrome', 'PhantomJS']; if ( /^win/.test(process.platform) ) { browsers = ['IE']; } if (process.env.TRAVIS ) { browsers = ['PhantomJS']; } module.exp...
<|file_name|>UpdateRequestProcessorChain.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 fil...
UpdateRequestProcessorFactory factory = chain[i];
<|file_name|>app.settings.js<|end_file_name|><|fim▁begin|>"use strict"; var http_1 = require("@angular/http"); var AppSettings = (function () { function AppSettings() { } Object.defineProperty(AppSettings, "API_OPTIONS", { get: function () { var headers = new http_1.Headers({ 'Content-Ty...
enumerable: true, configurable: true }); return AppSettings;
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals from django.apps import AppConfig class SystemConfig(AppConfig):<|fim▁hole|><|fim▁end|>
name = 'system'
<|file_name|>pairs.rs<|end_file_name|><|fim▁begin|>// Lumol, an extensible molecular simulation engine // Copyright (C) Lumol's contributors — BSD license use toml::value::{Table, Value}; use lumol::sys::System; use lumol::units; use lumol::energy::{BondPotential, PairInteraction, PairPotential}; use lumol::energy::{...
<|file_name|>JSONArray.java<|end_file_name|><|fim▁begin|>package framework.org.json; /* Copyright (c) 2002 JSON.org 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, includ...
* than the length of the JSONArray, then null elements will be added as * necessary to pad it out. * * @param index
<|file_name|>clause.rs<|end_file_name|><|fim▁begin|>//! Clauses //! //! See: [6.5 Clauses](http://erlang.org/doc/apps/erts/absform.html#id88135) use ast; use ast::expr; use ast::guard; use ast::pat; #[derive(Debug, Clone)] pub struct Clause { pub line: ast::LineNum, pub patterns: Vec<pat::Pattern>, pub gua...
body: Vec<expr::Expression>, ) -> Self {
<|file_name|>extract_i18n_plugin.js<|end_file_name|><|fim▁begin|>"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // @ignoreDep @angular/compiler-cli const ts = require("typescript"); const path = require("path"); const fs = require("fs"); const { __NGTOOLS_PRIVATE_API_2, VERSION } = require...
<|file_name|>user_follow.js<|end_file_name|><|fim▁begin|>var mongoose = require('mongoose'); var BaseModel = require("./base_model"); var Schema = mongoose.Schema;<|fim▁hole|>var ObjectId = Schema.ObjectId; var UserFollowSchema = new Schema({ user_id: { type: ObjectId }, kind: { type: String }, object_id: {...
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>from rest_framework import serializers as ser from api.base.utils import absolute_reverse from api.base.serializers import JSONAPISerializer, LinksField, RelationshipField, ShowIfVersion, DevOnly class PreprintProviderSerializer(JSONAPISerializer): filter...
})
<|file_name|>barrier.rs<|end_file_name|><|fim▁begin|>use std::sync::{Mutex,Condvar,Arc}; use std::thread; struct Barrier { threshold: usize, state: Mutex<BarrierState>, open: Condvar, } impl Barrier { fn new(threshold: usize) -> Self { Barrier { threshold: threshold, op...
}
<|file_name|>value.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 Serde Developers // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // 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 ...
<|file_name|>datauris.py<|end_file_name|><|fim▁begin|>import base64 import re import os URL_FINDER = re.compile('url\(.*?\)') STRIP_URL = re.compile('url\(|\)|\'|"') file_extensions_to_types = { "png": "image/png", "jpg": "image/jpg", "gif": "image/gif", } def _extract_image_urls_from_css(css): retur...
"png"
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup # Dummy setup.py to install libtorrent for python 2.7 using pip setup(<|fim▁hole|> version='1.0.9', packages=['libtorrent',], data_files=[('Lib', ['libtorrent/libtorrent.pyd']),], ) # Install in "editable mode" for developmen...
name='libtorrent',
<|file_name|>EmailService.java<|end_file_name|><|fim▁begin|>/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ package org.elasti...
private static final Setting.AffixSetting<Boolean> SETTING_SMTP_SEND_PARTIAL = Setting.affixKeySetting("xpack.notification.email.account.", "smtp.send_partial",
<|file_name|>BzCollectionOrderDto.java<|end_file_name|><|fim▁begin|>package itaf.WsCartItemService; import java.math.BigDecimal; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>bzCollectionOrderDto complex typeµÄ Ja...
* &lt;complexType name="bzCollectionOrderDto"> * &lt;complexContent>
<|file_name|>tdrvg.cpp<|end_file_name|><|fim▁begin|>#include <vector> #include <iostream> #include <iomanip> #include "drvg.hpp" #include "random.hpp" #include "timer.hpp" using namespace std; using namespace wat; <|fim▁hole|>{ T ge(prob.begin(), prob.end()); std::vector<int> sum(prob.size()); timer ti; ...
template<typename T> void test(const vector<double>& prob, int number)
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""djangochat URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/<|fim▁hole|> 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r...
Examples: Function views
<|file_name|>applicationdescription.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2014 Christophe Chapuis <chris.chapuis@gmail.com> * Copyright (C) 2013 Simon Busch <morphis@gravedo.de> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public Lic...
<|file_name|>XEH_PREP.hpp<|end_file_name|><|fim▁begin|>PREP(initCBASettings);<|fim▁hole|><|fim▁end|>
PREP(postInit);
<|file_name|>promisify.js<|end_file_name|><|fim▁begin|>+(function (factory) { if (typeof exports === 'undefined') { factory(webduino || {}); } else { module.exports = factory; } }(function (scope) { 'use strict'; // source: // https://raw.githubusercontent.com/twistdigital/es6-promisify/release/2....
// Default callback function - rejects on truthy error, otherwise resolves function callback(ctx, err, result) { if (typeof ctx.custom === 'function') {
<|file_name|>01-enum.ts<|end_file_name|><|fim▁begin|>enum Operator { ADD, SUB, DIV, MUL } module A { /*@ compute :: (o: number, a: number, b: { v: number | ((o = 2) => (v != 0))} ) => { number | [(o = 0) => (v = a + b); ...
return a - b; else if (op === Operator.MUL) return a * b;
<|file_name|>buildconfig.js<|end_file_name|><|fim▁begin|>({ // for an explanation of these fields, you should go through // https://github.com/jrburke/r.js/blob/master/build/example.build.js baseUrl: '${basedir}/src/main/webapp/js', inlineText: true, useStrict: false, name: '../../scripts/almon...
<|file_name|>PlayerOne.java<|end_file_name|><|fim▁begin|>package com.mikesantiago.mariofighter; import static com.mikesantiago.mariofighter.GlobalVariables.PPM; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.ba...
<|file_name|>watcher_group.go<|end_file_name|><|fim▁begin|>// Copyright 2016 The etcd 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/LICE...
} continue
<|file_name|>BackboneDrawable.js<|end_file_name|><|fim▁begin|>// Copyright 2013-2022, University of Colorado Boulder /** * A DOM drawable (div element) that contains child blocks (and is placed in the main DOM tree when visible). It should * use z-index for properly ordering its blocks in the correct stacking order....
// no stitch necessary if there are no change intervals if ( firstChangeInterval === null || lastChangeInterval === null ) { assert && assert( firstChangeInterval === null );
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>''' utils.py: helper functions for DLP api <|fim▁hole|> 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 lim...
Copyright (c) 2017 Vanessa Sochat
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>import json import os import avasdk from zipfile import ZipFile, BadZipFile from avasdk.plugins.manifest import validate_manifest from avasdk.plugins.hasher import hash_plugin from django import forms from django.core.validators import ValidationError from .validato...
<|file_name|>reports.go<|end_file_name|><|fim▁begin|>package response import "CitySourcedAPI/data" // ============================================================================================================================== // Reports // ======================================...
TicketSLA string `json:"TicketSla" xml:"TicketSla"` Comments Comments `json:"Comments,omitempty" xml:"Comments,omitempty"` }
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
"""Features modules"""
<|file_name|>array.rs<|end_file_name|><|fim▁begin|>#[repr(C)] enum Foo { A([f32; 20]) }<|fim▁hole|><|fim▁end|>
#[no_mangle] pub extern "C" fn root(a: Foo) {}
<|file_name|>test_multiarray.py<|end_file_name|><|fim▁begin|>from __future__ import division, absolute_import, print_function import collections import tempfile import sys import shutil import warnings import operator import io import itertools if sys.version_info[0] >= 3: import builtins else: import __builti...
assert_equal(np.partition(a, 0, axis=axis), np.zeros_like(a, dtype=np.intp), msg) msg = 'test empty array argpartition with axis=None' assert_equal(np.partition(a, 0, axis=None),
<|file_name|>auracite_worker.rs<|end_file_name|><|fim▁begin|>#![feature(plugin)] #![plugin(dotenv_macros)] extern crate auracite; extern crate dotenv; extern crate select; extern crate reqwest; use std::io::Read; use auracite::lodestone::NewsItem; use auracite::storage::{connect_redis, push_news}; use dotenv::dotenv...
<|file_name|>core.js<|end_file_name|><|fim▁begin|>var RocketBoots = { isInitialized : false, readyFunctions : [], components : {}, loadedScripts: [], version: {full: "0.7.0", major: 0, minor: 7, patch: 0, codeName: "sun-master"}, _autoLoadRequirements: true, _initTimer : null, _MAX_ATTEMPTS : 300, _BOOTING_EL...
getComponentByName: function (componentName) { var o = this;
<|file_name|>metrics.py<|end_file_name|><|fim▁begin|># ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # ...
<|file_name|>templates_zh_HK.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.1" language="zh_HK" sourcelanguage="en_US"> <context> <name>XmlStrings</name> <message> <source>Address labels</source> <translation type="unfinished">地址標籤</translatio...
</message>
<|file_name|>dyndlg.py<|end_file_name|><|fim▁begin|># dyndlg.py # contributed by Curt Hagenlocher <chi@earthlink.net> # Dialog Template params: # Parameter 0 - Window caption # Parameter 1 - Bounds (rect tuple) <|fim▁hole|># Parameter 6 - Window class # Dialog item params: # Parameter 0 - Window class # Parame...
# Parameter 2 - Window style # Parameter 3 - Extended style # Parameter 4 - Font tuple # Parameter 5 - Menu name
<|file_name|>plexonio.py<|end_file_name|><|fim▁begin|>from neo.io.basefromrawio import BaseFromRaw from neo.rawio.plexonrawio import PlexonRawIO class PlexonIO(PlexonRawIO, BaseFromRaw): """ Class for reading the old data format from Plexon acquisition system (.plx) Note that Plexon now use a new for...
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import sys if __name__ == "__main__":<|fim▁hole|> execute_from_command_line(sys.argv)<|fim▁end|>
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "TootList.settings.local") from django.core.management import execute_from_command_line
<|file_name|>is.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'blockquote', 'is', {<|fim▁hole|><|fim▁end|>
toolbar: 'Inndráttur' } );
<|file_name|>marked.min.js<|end_file_name|><|fim▁begin|>/** * marked - a markdown parser * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/chjj/marked */ (function () { var block = { newline: /^\n+/, code: /^( {4}[^\n]+\n*)+/, fences: noop, hr: /...
} throw e
<|file_name|>generator-yielding-or-returning-itself.rs<|end_file_name|><|fim▁begin|>#![feature(generator_trait)] #![feature(generators)] // Test that we cannot create a generator that returns a value of its // own type.<|fim▁hole|>use std::ops::Generator; pub fn want_cyclic_generator_return<T>(_: T) where T: Gene...
<|file_name|>map-observation.js<|end_file_name|><|fim▁begin|><|fim▁hole|> _export('getMapObserver', getMapObserver); function getMapObserver(taskQueue, map) { return ModifyMapObserver.create(taskQueue, map); } return { setters: [function (_coreJs) { core = _coreJs['default']; }, function (_m...
System.register(['core-js', './map-change-records', './collection-observation'], function (_export) { var core, getChangeRecords, ModifyCollectionObserver, _classCallCheck, _inherits, mapProto, ModifyMapObserver;
<|file_name|>middleware_test.go<|end_file_name|><|fim▁begin|>package deliver import ( "testing" "net/http" "net/http/httptest" "reflect" ) func TestMiddlewareBasic(t *testing.T) { d := New() d.Use(MiddlewareHandlerFunc(func(res Response, req *Request, next func()) { res.Send("Hello") })) response, body :=...
response, _ := testMiddleware(t, d) expect(t, content, "Hello")
<|file_name|>walk2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ Demonstrate use of pysnmp walks """ import sys<|fim▁hole|> cmdGen = cmdgen.CommandGenerator() devip = sys.argv.pop(1) errorIndication, errorStatus, errorIndex, varBindTable = cmdGen.nextCmd( cmdgen.CommunityData('server', 'galileo', 1),...
import re from pysnmp.entity.rfc3413.oneliner import cmdgen
<|file_name|>network.py<|end_file_name|><|fim▁begin|>import zmq from crpropa import Module class SendCandidateProperties( Module ): """ Sends candidate proporties given by the function ```extract_func( candidate )``` over the network<|fim▁hole|> """ def __init__( self, ip_port, extract_func ): ...
to the server on ```ip_port```
<|file_name|>collection.py<|end_file_name|><|fim▁begin|>from sqlalchemy import Column, ForeignKey, Integer, String, Text, DateTime, Table from sqlalchemy.orm import relationship, backref from models import DecBase from models.document import Document from models.keyword import Keyword from jsonschema import * from json...
latest_version = self.version_list.order_by(CollectionVersion.collection_version.desc()).first() if latest_version is None: return 0 else:
<|file_name|>scan.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys from datetime import datetime import portage import gentoolkit.pprinter as pp from gentoolkit.query import Query from gentoolkit.package import Package from euscan import CONFIG, BLACKLIST_PACKAGES from eusc...
def parse_src_uri(uris):
<|file_name|>build.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp'); var runSequence = require('run-sequence'); var to5 = require('gulp-babel'); var plumber = require('gulp-plumber'); var sourcemaps = require('gulp-sourcemaps'); var sass = require('gulp-sass'); var notify = require('gulp-notify'); var paths =...
<|file_name|>get_list.go<|end_file_name|><|fim▁begin|>package lists // This file is generated by methodGenerator. // DO NOT MOTIFY THIS FILE. import ( "net/url" "github.com/kawaken/go-rtm/methods" )<|fim▁hole|>func GetList() *methods.Method { name := "rtm.lists.getList" p := url.Values{} p.Add("method", name) ...
// GetList returns "rtm.lists.getList" method instance.
<|file_name|>case2_observations_processing20.py<|end_file_name|><|fim▁begin|><|fim▁hole|>plot_data.apply(transform_utm_to_wgs, axis=1)<|fim▁end|>
<|file_name|>t3g1.py<|end_file_name|><|fim▁begin|># Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. <|fim▁hole|> from iptest.assert_util import * add_clr_ass...
<|file_name|>ShapeAnalysisModule.py<|end_file_name|><|fim▁begin|>import os, sys import unittest import vtk, qt, ctk, slicer from slicer.ScriptedLoadableModule import * import logging import csv from slicer.util import VTKObservationMixin import platform import time import urllib import shutil from CommonUtilities impor...
regtemplate_dir = os.path.split(regtemplate_filepath)[0] regtemplate_rootname = os.path.split(regtemplate_filepath)[1].split(".")[0] regtemplate_filename = os.path.split(regtemplate_filepath)[1] regtemplate_model = MRMLUtility.loadMRMLNode(regtemplate_rootname, regtemplate_dir, r...
<|file_name|>manager_test.go<|end_file_name|><|fim▁begin|>// Copyright 2016 Google 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....
m := NewManager(r, mgrs)
<|file_name|>students_t.rs<|end_file_name|><|fim▁begin|>use {Result, StatsError}; use distribution::{Continuous, Distribution, Univariate}; use function::{beta, gamma}; use rand::Rng; use rand::distributions::{IndependentSample, Sample}; use statistics::*; use std::f64; /// Implements the [Student's /// T](https://en....
}
<|file_name|>39.go<|end_file_name|><|fim▁begin|>package main import . "fmt" import . "net/http" import "time" const ADDRESS = ":1024" const SECURE_ADDRESS = ":1025" func main() { message := "hello world" HandleFunc("/hello", func(w ResponseWriter, r *Request) { w.Header().Set("Content-Type", "text/plain") ...
) } func Spawn(f ...func()) {
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! A generic filesystem with disk and in-memory implementations. //! //! # Reason for existence //! //! The [`std::fs`] module provides functions to manipulate the filesytem, and these functions are //! good. However, if you have code that uses `std::fs`, it is difficul...
//! [`rsfs::GenFS`]: trait.GenFS.html //! [`rsfs::disk::FS`]: disk/struct.FS.html //! [`rsfs::mem`]: mem/index.html
<|file_name|>krate2.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.<|fim▁hole|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://op...
// // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
<|file_name|>zero-sized-tuple-struct.rs<|end_file_name|><|fim▁begin|>// run-pass #![allow(unused_braces)] #![allow(unused_assignments)] // Make sure that the constructor args are codegened for zero-sized tuple structs <|fim▁hole|> Foo({ a = 2 }); assert_eq!(a, 2); }<|fim▁end|>
struct Foo(()); fn main() { let mut a = 1;
<|file_name|>uvmapper.cpp<|end_file_name|><|fim▁begin|>#include <algorithm> #include "GI/uvmapper.h" UVMapper::UVMapper( glm::ivec2 size) : m_size(size), m_scale(0.f), m_border(glm::vec2(1.)/glm::vec2(size)) {} UVMapper::~UVMapper() {} void UVMapper::computeLightmapPack(std::vector<Object*> &obj) { m...
*(q.p4) += offset; return n; }
<|file_name|>unboxed-closure-sugar-region.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://w...
<|file_name|>deep_copy_generated.go<|end_file_name|><|fim▁begin|>/* Copyright 2015 The Kubernetes 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....
out.SecretFile = in.SecretFile if in.SecretRef != nil {
<|file_name|>NotificationFragment.java<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2012 Todoroo Inc * * See the file "LICENSE" for the full license governing this code. */ package com.todoroo.astrid.reminders; import android.app.Dialog; import android.content.Intent; import android.view.View; import android.w...
<|file_name|>Class3_Sub28.java<|end_file_name|><|fim▁begin|>class Class3_Sub28 extends Class3 { static Class94[] aClass94Array2566 = new Class94[200]; static int anInt2567 = -1; private static Class94 aClass94_2568 = Class3_Sub4.buildString("Started 3d Library"); long aLong2569; Class3_Sub28 aClas...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod error; mod context; mod event; mod command; mod backend; #[allow(module_inception)] mod cache; mod handle; mod frontend;<|fim▁hole|>pub use self::frontend::CacheFrontend;<|fim▁end|>
pub use self::error::{CacheError, CacheResult}; pub use self::cache::Cache; pub use self::handle::{CacheHandle, init_cache};
<|file_name|>test.py<|end_file_name|><|fim▁begin|>""" This config file runs the simplest dev environment using sqlite, and db-based sessions. Assumes structure: /envroot/ /db # This is where it'll write the database file /edx-platform # The location of this repo /log # Where we're going to ...
CC_PROCESSOR['CyberSource2']['SECRET_KEY'] = RANDOM_SHARED_SECRET CC_PROCESSOR['CyberSource2']['ACCESS_KEY'] = "0123456789012345678901" CC_PROCESSOR['CyberSource2']['PROFILE_ID'] = "edx" CC_PROCESSOR['CyberSource2']['PURCHASE_ENDPOINT'] = "/shoppingcart/payment_fake"
<|file_name|>sanitize.py<|end_file_name|><|fim▁begin|>""" NBConvert Preprocessor for sanitizing HTML rendering of notebooks. """ from bleach import ( ALLOWED_ATTRIBUTES, ALLOWED_STYLES, ALLOWED_TAGS, clean, ) from traitlets import ( Any, Bool, List, Set, Unicode, ) from .base import...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2015 Daniel Grunwald // // 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 ...
<|file_name|>ivy_utils.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import json import logging import ...
:param ref an IvyModuleRef to start traversing the ivy dependency graph
<|file_name|>process.rs<|end_file_name|><|fim▁begin|>use crate::error::Error; use librespot_playback::player::PlayerEvent; use log::info; use std::{ collections::HashMap, io::{self, Read, Write}, process::{Command, ExitStatus, Stdio}, }; /// Blocks while provided command is run in a subprocess using the pr...
env.insert("PLAY_REQUEST_ID", play_request_id.to_string()); }
<|file_name|>test_sysmeta.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
<|file_name|>dis.go<|end_file_name|><|fim▁begin|>package dis func Rearrange(s string, k int) string { hm := make([]int, 26) valid := make([]int, 26) var id, maxF, numOfMaxF int for _, c := range s { id = int(c - 'a') hm[id]++ if hm[id] > maxF { maxF, numOfMaxF = hm[id], 1 } else if hm[id] == maxF { n...
<|file_name|>instr_vsqrtps.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::*; use ::test::run_test; #[test] fn vsqrtps_1() { run_test(&Instru...
run_test(&Instruction { mnemonic: Mnemonic::VSQRTPS, operand1: Some(Direct(XMM7)), operand2: Some(IndirectScaledIndexedDisplaced(RAX, RBX, Four, 1343205735, Some(OperandSize::Xmmword), None)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None...
<|file_name|>lulzvm.rs<|end_file_name|><|fim▁begin|>extern crate ctrlc; extern crate lulzvm; #[macro_use] extern crate log; extern crate env_logger; #[macro_use] extern crate clap; use clap::{ArgGroup, ArgMatches, App}; use lulzvm::vm::VM; use std::env; use std::fs::File; use std::io::{stdin, stdout, Read, Result};...
<|file_name|>shared_lock.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ //! Different objects protected by the same lock use cr...
/// Same guard for all origins pub fn same(guard: &'a SharedRwLockReadGuard<'a>) -> Self {
<|file_name|>copy.go<|end_file_name|><|fim▁begin|>// +build linux package overlay import ( "fmt" "io" "os" "path/filepath" "syscall" "github.com/docker/docker/pkg/system" ) type copyFlags int const ( copyHardlink copyFlags = 1 << iota ) func copyRegular(srcPath, dstPath string, mode os.FileMode) error { s...
return err }
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url from django.contrib import admin from django.contrib import auth admin.autodiscover() urlpatterns = patterns('stepup.views', # Examples: # url(r'^$', 'volunteer.views.home', name='home'), # url(r'^blog/'...
# comments url(r'^comments/', include('django.contrib.comments.urls')),
<|file_name|>factory_object_mapping.go<|end_file_name|><|fim▁begin|>/* Copyright 2016 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/LICE...
pod, numPods, err := GetFirstPod(clientset.Core(), namespace, selector.String(), timeout, sortBy) if err != nil {
<|file_name|>galois-field.test.js<|end_file_name|><|fim▁begin|>const test = require('tap').test const GF = require('core/galois-field') test('Galois Field', function (t) { t.throw(function () { GF.log(0) }, 'Should throw for log(n) with n < 1') for (let i = 1; i < 255; i++) { t.equal(GF.log(GF.exp(i)), i, 'lo...
t.equal(GF.mul(1, 0), 0, 'Should return 0 if second param is 0') t.equal(GF.mul(0, 0), 0, 'Should return 0 if both params are 0')
<|file_name|>test_help_the_bookseller.py<|end_file_name|><|fim▁begin|>import unittest from katas.kyu_6.help_the_bookseller import stock_list class StockListTestCase(unittest.TestCase): def setUp(self): self.a = ['ABAR 200', 'CDXE 500', 'BKWR 250', 'BTSQ 890', 'DRTY 600'] self.b = ['A', 'B'] <|fim...
def test_equals(self): self.assertEqual(stock_list(self.a, self.b), '(A : 200) - (B : 1140)') def test_equals_2(self):
<|file_name|>test_instruction_set.py<|end_file_name|><|fim▁begin|>import unittest import instruction_set class TestInstructionSet(unittest.TestCase): def test_generate(self): self.assertIsInstance(instruction_set.generate(), list) self.assertEqual(len(instruction_set.generate()), 64) sel...
self.assertEqual(len(children[0]), len(parent1)) self.assertEqual(len(children[1]), len(parent1))
<|file_name|>smartHomeV3.js<|end_file_name|><|fim▁begin|>var express = require('express'); var hsv = require("hsv-rgb"); var fs = require('fs'); var profile = require('../modules/profile'); var milight = require('../modules/milight-controller.js'); var harmony = require('../modules/harmony-controller.js'); var tplink ...
res.json(response);
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from lib.testdata import CourseTestCase from exercise.cache.content import CachedContent from exercise.cache.points import CachedPoints from .models import Threshold class ThresholdTest(CourseTestCase): class MockCachedPoints: def __init__(self, total_d...
<|file_name|>task_executor.py<|end_file_name|><|fim▁begin|># (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation...
break
<|file_name|>driver_mgmt.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ''' Created on 2013-3-8 @author: m00147039 ''' import sqlite3 #=============================================================================== # DB Data struct #==========================================================================...
dm.show_drivers()
<|file_name|>Redis.cpp<|end_file_name|><|fim▁begin|>#include "Common.h" #include "CacheAdapters/Redis.h" #include "SSEConfig.h" #include "SSEEvent.h" #include <string> #include <vector> #include <iostream> #include <boost/asio/io_service.hpp> #include <boost/asio/ip/address.hpp> using namespace std; extern int stop; ...
} }
<|file_name|>hook-gadfly.py<|end_file_name|><|fim▁begin|># ------------------------------------------------------------------ # Copyright (c) 2020 PyInstaller Development Team. # # This file is distributed under the terms of the GNU General Public # License (version 2.0 or later). # # The full license is available in L...
<|file_name|>clean.go<|end_file_name|><|fim▁begin|>package main import ( "github.com/mkideal/cli" ) var _ = app.Register(&cli.Command{ Name: "clean", Desc: "Clean build data", Argv: func() interface{} { return new(cleanT) }, Fn: clean, }) type cleanT struct { cli.Helper Recursion bool `cli:"R,recursion" usa...
return nil }
<|file_name|>notifier_tests.py<|end_file_name|><|fim▁begin|>""" Test notifiers """ import unittest from sickchill.oldbeard import db from sickchill.oldbeard.notifiers.emailnotify import Notifier as EmailNotifier from sickchill.oldbeard.notifiers.prowl import Notifier as ProwlNotifier from sickchill.tv import TVEpiso...
print("######################################################################") SUITE = unittest.TestLoader().loadTestsFromTestCase(NotifierTests)
<|file_name|>histogram_logscale.py<|end_file_name|><|fim▁begin|>""" ================================================================================ Logscaled Histogram ================================================================================ | Calculates a logarithmically spaced histogram for a data map. | Wri...
def _add_subparser(cls, subparsers, parent): r"""
<|file_name|>admin_script_builder.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 use anyhow::Result; use diem_framework::compile_script; use diem_types::{ account_address::AccountAddress, account_config::diem_root_address, transaction::{Sc...
use tempfile::NamedTempFile;
<|file_name|>Cluster.java<|end_file_name|><|fim▁begin|>/* * Copyright 2008-2013 LinkedIn, 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/LICEN...
return numberOfPartitionIds; }
<|file_name|>nntplib.py<|end_file_name|><|fim▁begin|>"""An NNTP client class based on RFC 977: Network News Transfer Protocol. Example: >>> from nntplib import NNTP >>> s = NNTP('news') >>> resp, count, first, last, name = s.group('comp.lang.python') >>> print 'Group', name, 'has', count, 'articles, range', first, 't...
last = words[3] if n > 4: name = words[4].lower() return resp, count, first, last, name
<|file_name|>mocktracks_rss_scenario_one.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Author: Timm Linder, linder@cs.uni-freiburg.de # # Publishes fake tracked persons and the corresponding detections (if not occluded) at # /spencer/perception/tracked_persons and /spencer/perception/detected_persons. import...
x: 27.5
<|file_name|>hello.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core'; import { SharedModule } from '../shared/shared.module'; import { HelloRoutingModule } from './hello-routing.module';<|fim▁hole|>import { HelloComponent } from './hello.component'; @NgModule({ imports: [ SharedMod...
<|file_name|>capa_problem.py<|end_file_name|><|fim▁begin|># # File: capa/capa_problem.py # # Nomenclature: # # A capa Problem is a collection of text and capa Response questions. # Each Response may have one or more Input entry fields. # The capa problem may include a solution. # """ Main module which shows problems ...
<|file_name|>issue-5917.rs<|end_file_name|><|fim▁begin|>struct T (&'static [isize]); static STATIC : T = T (&[5, 4, 3]);<|fim▁hole|><|fim▁end|>
pub fn main () { let T(ref v) = STATIC; assert_eq!(v[0], 5); }
<|file_name|>strip.py<|end_file_name|><|fim▁begin|>from . animation import Animation from .. layout import strip class Strip(Animation): LAYOUT_CLASS = strip.Strip LAYOUT_ARGS = 'num', def __init__(self, layout, start=0, end=-1, **kwds): super().__init__(layout, **kwds)<|fim▁hole|> self._...
<|file_name|>test.js<|end_file_name|><|fim▁begin|>'use strict'; var assert = require('power-assert'); var resetStorage = require('./'); var dbName = 'test-item'; describe('#localStorage', function () { beforeEach(function (done) { localStorage.clear(); done(); }); it('should save value', function () { ...
<|file_name|>setup.tsx<|end_file_name|><|fim▁begin|><|fim▁hole|>import React from 'react'; import { JSDOM } from 'jsdom'; import { render } from '@testing-library/react'; declare global { interface Window { // eslint-disable-next-line @typescript-eslint/no-explicit-any result?: any; } } export function se...