prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>node.py<|end_file_name|><|fim▁begin|>class node: def __init__(self): self.outputs=[] def set(self): for out in self.outputs: out.set() def clear(self): for out in self.outputs: out.clear() class switch: def __init__(self): self.outputs=[] self.state=False self.input=False def ...
a.set()
<|file_name|>reward.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import matplotlib.pyplot as plt import sys import numpy from math import floor def movingAverage(x, N): cumsum = numpy.cumsum(numpy.insert(x, 0, 0)) return (cumsum[N:] - cumsum[:-N])/N<|fim▁hole|> filename = sys.argv[1] with open(filename) as...
filename = "reports/configuration.confrewardRecordReport.txt" if (len(sys.argv) > 1):
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_django-nupages ------------ Tests for `django-nupages` models module. """ import os import shutil import unittest from django.utils import timezone from django.core.urlresolvers import reverse from django...
p = self.create_page() self.assertTrue(isinstance(p, models.Page)) self.assertEqual(p.__unicode__(), p.title) self.assertEqual(p.get_absolute_url(), reverse("nupages:detail", kwargs={'slug': p.slug}))
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.core.cache import cache from django.db import models from django.db.models.signals import post_save try: from django.db.transaction import atomic except I...
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import './stylus/app.styl' import VuetifyComponent from './components/Vuetify' import * as components from './components' import * as directives from './directives' import { VueConstructor } from 'vue'<|fim▁hole|>const Vuetify: VuetifyPlugin = { install (Vue: VueCons...
import { Vuetify as VuetifyPlugin, VuetifyUseOptions } from 'types'
<|file_name|>_each126.py<|end_file_name|><|fim▁begin|>from pycp2k.inputsection import InputSection class _each126(InputSection):<|fim▁hole|> def __init__(self): InputSection.__init__(self) self.Just_energy = None self.Powell_opt = None self.Qs_scf = None self.Xas_scf = None ...
<|file_name|>DotImpl.java<|end_file_name|><|fim▁begin|>/** * Copyright 2009-2016 Université Paris Ouest and Sorbonne Universités, Univ. Paris 06 - CNRS UMR 7606 (LIP6) * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License ...
* @generated
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate rouille; #[macro_use] extern crate serde_derive; #[macro_use] extern crate serde_json; extern crate handlebars; mod controller; mod data_type; use std::path::{Path, PathBuf}; use std::fs::File; use std::io::prelude::*; use handlebars::Handleb...
<|file_name|>E0283.rs<|end_file_name|><|fim▁begin|>trait Generator { fn create() -> u32; } struct Impl; impl Generator for Impl { fn create() -> u32 { 1 } } impl Impl { fn new() -> Self { Impl{} } } impl Into<u32> for Impl { fn into(self) -> u32 { 1 } }<|fim▁hole|> fn foo(bar: u32) {} s...
<|file_name|>ol_gmu.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ openload.io urlresolver plugin Copyright (C) 2015 tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either versi...
<|file_name|>xicidaili.py<|end_file_name|><|fim▁begin|>from pyquery import PyQuery as pq from proxypool.schemas.proxy import Proxy<|fim▁hole|>from loguru import logger BASE_URL = 'https://www.xicidaili.com/' class XicidailiCrawler(BaseCrawler): """ xididaili crawler, https://www.xicidaili.com/ """ ur...
from proxypool.crawlers.base import BaseCrawler
<|file_name|>UserService.java<|end_file_name|><|fim▁begin|>package pl.wavesoftware.examples.wildflyswarm.service.api; import pl.wavesoftware.examples.wildflyswarm.domain.User; import java.util.Collection; /** * @author Krzysztof Suszynski <krzysztof.suszynski@coi.gov.pl> * @since 04.03.16 */ public interface User...
* Retrieves a collection of active users * @return a collection with only active users */
<|file_name|>exp_quat_func.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Exponential and Quaternion code for Lab 6. Course: EE 106, Fall 2015 Author: Victor Shia, 9/24/15 This Python file is a code skeleton Lab 6 which calculates the rigid body transform given a rotation / translation and computes the twist...
<|file_name|>DebugRenderSystem.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2013 Triforce - in association with the University of Pretoria and Epi-Use <Advance/> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Soft...
{
<|file_name|>date.rs<|end_file_name|><|fim▁begin|>use std::fmt::{self, Show}; use std::str::FromStr; use time::Tm; use header::{Header, HeaderFormat}; use header::shared::util::from_one_raw_str; use header::shared::time::tm_from_str; // Egh, replace as soon as something better than time::Tm exists. /// The `Date` head...
}
<|file_name|>xnxx.py<|end_file_name|><|fim▁begin|># coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote class XNXXIE(InfoExtractor): _VALID_URL = r'https?://(?:video|www)\.xnxx\.com/video-?(?P<id>[0-9a-z]+)/'<|fim▁hole|> ...
_TESTS = [{ 'url': 'http://www.xnxx.com/video-55awb78/skyrim_test_video', 'md5': 'ef7ecee5af78f8b03dca2cf31341d3a0',
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from django.utils.six.moves import input # From https://stackoverflow.com/a/39257511/1157536 def ask_for_confirmation(question, default=None): """Ask for confirmation before proceeding. """ result = input('{} '.format(question)) if not result and defa...
return default
<|file_name|>IneffableTruth.js<|end_file_name|><|fim▁begin|>import React from 'react'; import SPELLS from 'common/SPELLS/index'; import { formatDuration } from 'common/format'; import StatisticBox, { STATISTIC_ORDER } from 'interface/others/StatisticBox'; import STATISTIC_CATEGORY from 'interface/others/STATISTIC_CATE...
<|file_name|>model_control_one_enabled_Anscombe_Lag1Trend_Seasonal_WeekOfYear_SVR.py<|end_file_name|><|fim▁begin|>import tests.model_control.test_ozone_custom_models_enabled as testmod<|fim▁hole|> testmod.build_model( ['Anscombe'] , ['Lag1Trend'] , ['Seasonal_WeekOfYear'] , ['SVR'] );<|fim▁end|>
<|file_name|>ObjectMetadataProvider.java<|end_file_name|><|fim▁begin|>/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. <|fim▁hole|> * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is dist...
* * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License.
<|file_name|>CooperationServer.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2010 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing the cooperation server. """ from __future__ import unicode_literals from PyQt5.QtCore import pyqtSignal from PyQt5.QtNetwork import...
class CooperationServer(QTcpServer): """ Class implementing the cooperation server.
<|file_name|>redis.py<|end_file_name|><|fim▁begin|>""" Redis Blueprint =============== **Fabric environment:** .. code-block:: yaml blueprints: - blues.redis settings: redis: # bind: 0.0.0.0 # Set the bind address specifically (Default: 127.0.0.1) """ import re from fabric.decorators i...
uploads = blueprint.upload(config, '/etc/redis/redis.conf', context) if uploads: if debian.lbs_release() >= '16.04':
<|file_name|>user_group_pill.js<|end_file_name|><|fim▁begin|>"use strict"; const {strict: assert} = require("assert"); const {zrequire} = require("../zjsunit/namespace"); const {run_test} = require("../zjsunit/test"); const user_groups = zrequire("user_groups"); const user_group_pill = zrequire("user_group_pill"); ...
const item = user_group_pill.create_item_from_group_name(group_name, current_items); assert.deepEqual(item, expected_item);
<|file_name|>profiles.service.spec.ts<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> * Copyright (C) 2016 - 2019 DataSwift Ltd - All Rights Reserved * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at h...
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use std::error::Error as StdError; use std::fmt::{self, Display}; /// An error that occurred while attempting to deal with the gateway. /// /// Note that - from a user standpoint - there should be no situation in which /// you manually handle these. #[derive(Clone, De...
<|file_name|>test_postgresql.py<|end_file_name|><|fim▁begin|>import unittest from collections import OrderedDict from pypika import ( Array, Field, JSON, QueryException, Table, ) from pypika.dialects import PostgreSQLQuery class InsertTests(unittest.TestCase): table_abc = Table("abc") de...
def test_distinct_on(self): q = PostgreSQLQuery.from_(self.table_abc).distinct_on("lname", self.table_abc.fname).select("lname", "id")
<|file_name|>tracker.py<|end_file_name|><|fim▁begin|>import cv2 import time import numpy as np MAX_TARGETS = 3 TOP = 0 BOTTOM = 1 LEFT = 0 RIGHT = 1 def __init_tracker(frame): running_average_image = np.float32(frame) running_average_in_display_color_depth = frame.copy() difference = frame.copy() la...
estimated_target_count = last_target_count + 1
<|file_name|>action.js<|end_file_name|><|fim▁begin|>var github = require('octonode'); var _ = require('lodash'); module.exports = { name:'action', description:'A command to show recent activity for all members of your org', example:'bosco action', cmd:cmd } function cmd(bosco) { getActivity(bosco); ...
<|file_name|>ex15_reading_files.py<|end_file_name|><|fim▁begin|># -- coding: utf-8 -- # Das Modul argv aus Packet sys wird importiert from sys import argv # Die Variablen script und filename werden entpackt # sie müssen dem Script als Argumente mitgegeben werden beim ausführen # z.B so: python ex15_reading_files.py e...
<|file_name|>bucket_test.go<|end_file_name|><|fim▁begin|>package kv_test import ( "context" "testing" "github.com/influxdata/influxdb" "github.com/influxdata/influxdb/kv" influxdbtesting "github.com/influxdata/influxdb/testing" ) func TestBoltBucketService(t *testing.T) { influxdbtesting.BucketService(initBolt...
func initBucketService(s kv.Store, f influxdbtesting.BucketFields, t *testing.T) (influxdb.BucketService, string, func()) {
<|file_name|>util.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # ----------------------------------------------------------------------------------- # Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of char...
def get_config(self, key): """Get configured value from configuration file according to specified key
<|file_name|>EnsayosConnection.js<|end_file_name|><|fim▁begin|><|fim▁hole|>var _graphqlRelay = require("graphql-relay"); var _EnsayoType = _interopRequireDefault(require("./EnsayoType"));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default = (0, _graphqlRelay.conne...
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
<|file_name|>matching.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use attr::{ParsedAttrSelectorOperation, AttrSelectorOperatio...
use parser::{Selector, SelectorImpl, SelectorIter, SelectorList}; use std::borrow::Borrow; use tree::Element;
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod tcp; pub use self::tcp::{TcpListener, TcpListenerBuilder, TcpStream}; #[inline]<|fim▁hole|>}<|fim▁end|>
pub fn init() { ::sys::net::init()
<|file_name|>Message.java<|end_file_name|><|fim▁begin|>package com.inmobi.messaging; /* * #%L * messaging-client-core * %% * Copyright (C) 2012 - 2014 InMobi * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtai...
* * @return {@link ByteBuffer} holding the data. */
<|file_name|>peer.py<|end_file_name|><|fim▁begin|>from utils import instrument from azove.utils import recursive_int_to_big_endian import mock @given(u'a packet') # noqa def step_impl(context): context.packet = context.packeter.dump_packet('this is a test packet') @when(u'peer.send_packet is called') # noqa d...
<|file_name|>FormatData_sr_ME.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU Gen...
* * Except as contained in this notice, the name of a copyright holder shall not * be used in advertising or otherwise to promote the sale, use or other * dealings in these Data Files or Software without prior written
<|file_name|>paginator.py<|end_file_name|><|fim▁begin|>class Paginator(object): def __init__(self, collection, page_number=0, limit=20, total=-1): self.collection = collection self.page_number = int(page_number) self.limit = int(limit) self.total = int(total) @property ...
def __build_url(self, page_num, url): import re
<|file_name|>fpu.rs<|end_file_name|><|fim▁begin|>#![allow(unused_imports)] <|fim▁hole|>use dynasmrt::DynasmApi; include!("gen_x64/fpu.rs.gen");<|fim▁end|>
use dynasmrt::dynasm;
<|file_name|>feature-gate.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/li...
<|file_name|>script2.js<|end_file_name|><|fim▁begin|><|fim▁hole|>// Second function function mySecondFunction(number1, number2){ return number1 + number2; }<|fim▁end|>
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import Http404 from rest_framework import generics, permissions from rest_framework.reverse import reverse from rest_framework.response import Response from rest_framework.views import APIView from core.utils import filter_files_by_n_slashes from .ser...
else: path = path.strip('/')
<|file_name|>FieldTransformer.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * Copyright (c) 1998, 2015 Oracle and/or its affiliates. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Ecli...
* This interface is used by the Transformation Mapping to build the value for a * specific field. The user must provide implementations of this interface to the
<|file_name|>javascript.js<|end_file_name|><|fim▁begin|>'use strict'; // Test dependencies are required and exposed in common/bootstrap.js require('../../common/bootstrap'); process.on('uncaughtException', function(err) { console.error(err.stack); }); var codeContents = 'console.log("testing deploy");'; var refere...
<|file_name|>fake.py<|end_file_name|><|fim▁begin|>class FakeFetcher(object): """ Used i.e. in Harvest tracker when we need credentials but don't fetcher """ def __init__(self, *args, **kwargs): pass def fetch_user_tickets(self, *args, **kwargs): pass<|fim▁hole|> def fetch_bugs_...
def fetch_all_tickets(self, *args, **kwargs): pass
<|file_name|>tablerow_test.py<|end_file_name|><|fim▁begin|>from sofi.ui import TableRow def test_basic(): assert(str(TableRow()) == "<tr></tr>") <|fim▁hole|> assert(str(TableRow("text", cl='abclass', ident='123', style="font-size:0.9em;", attrs={"data-test": 'abc'})) == "<tr id=\"123\" class=\"abclas...
def test_text(): assert(str(TableRow("text")) == "<tr>text</tr>") def test_custom_class_ident_style_and_attrs():
<|file_name|>middleware.py<|end_file_name|><|fim▁begin|>import time from importlib import import_module from django.conf import settings from django.contrib.sessions.backends.base import UpdateError from django.shortcuts import redirect from django.utils.cache import patch_vary_headers from django.utils.http import co...
if response.status_code != 500:
<|file_name|>client.js<|end_file_name|><|fim▁begin|>"use strict"; var echo = require('echo'), Authorization = require('./auth.js'), Packer = require('./packer.js'), Request = require('./request.js'), RequestOptions = require('./req-options.js'), portMatch = /:(\d+)$/, parse = function (host,...
var options = RequestOptions.createGET(this.host, this.port, path); this.request(options, undefined, done, fail); },
<|file_name|>bluetooth_server.py<|end_file_name|><|fim▁begin|>""" network/bluetooth_server.py Starts a bluetooth server with max 7 connections. Receives and sends data from/to paired client. PS3 controller: receive only Android App: receive/send """ import base64 from threading import Thread from bluetooth import * imp...
def __init__(self, apphandler, driver): super(BluetoothServer, self).__init__() self.daemon = True # if main is killed, this also gets killed self.apphandler = apphandler # pass apphandler object so we can pass control commands to it
<|file_name|>sortLayout.ts<|end_file_name|><|fim▁begin|>import { isSameDay } from '@proton/shared/lib/date-fns-utc'; import { CalendarViewEvent, CalendarViewEventTemporaryEvent } from '../../containers/calendar/interface'; const isAllDayPrio = (a: CalendarViewEvent, b: CalendarViewEvent) => { // If a is an all day...
};
<|file_name|>ex_dates.py<|end_file_name|><|fim▁begin|>""" Using dates with timeseries models """ import statsmodels.api as sm import numpy as np import pandas # Getting started # --------------- data = sm.datasets.sunspots.load() # Right now an annual date series must be datetimes at the end of the year. from datet...
<|file_name|>math.rs<|end_file_name|><|fim▁begin|>use cpu::Cpu; use cpu::addressing::*; use cpu::instructions::*; use cpu::instructions as instr; use bus::Bus; use cartridge::Cartridge; // ADD 8-bit tests #[test] fn add8_no_flags() { let mut cpu = Cpu::new(); let mut cartridge = Cartridge::from_vec(vec![0; 65...
cpu.regs.set_a(0x34); cpu.regs.set_f(0);
<|file_name|>util.py<|end_file_name|><|fim▁begin|>from functools import reduce class ScopedString (object): def __init__ (self): self._stack = [] def push (self, frame): self._stack.append (frame) def pop (self): frame = self._stack.pop() ...
def __getitem__ (self, key): for frame in self._stack:
<|file_name|>MissingPersonForm.py<|end_file_name|><|fim▁begin|>#------------------------------------------------------------------------------- # Name: MissingPersomForm.py # # Purpose: Create Missing Person Flyer from data stored in the Subject # Information data layer within MapSAR # # Author:...
txt.write("<</T(topmostSubform[0].Page1[0].Layer[0].Layer[0].MPF_HairColor[0])/V(" + str(Hair) + ")>>\n") txt.write("<</T(topmostSubform[0].Page1[0].Layer[0].Layer[0].MPF_EyeColor[0])/V(" + str(Eyes) + ")>>\n") txt.write("<</T(topmostSubform[0].Page1[0].Layer[0].Layer[0].MPF_OtherPhy[0])/V(" + str(Other) + ...
<|file_name|>base.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core'; import { Http, Headers, RequestOptions, Response } from '@angular/http'; import { Observable } from 'rxjs/Observable'; import * as _ from 'lodash'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/catch'; imp...
<|file_name|>getdevices.rs<|end_file_name|><|fim▁begin|>extern crate pcap; fn main() { // list all of the devices pcap tells us are available for device in pcap::Device::list().unwrap() {<|fim▁hole|> // get a packet from this capture let packet = cap.next(); println!("got a packet! {:?...
println!("Found device! {:?}", device); // now you can create a Capture with this Device if you want. let mut cap = device.open().unwrap();
<|file_name|>DeleteFolderRequestProtocolMarshaller.java<|end_file_name|><|fim▁begin|>/* * Copyright 2014-2019 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 of the...
package com.amazonaws.services.workdocs.model.transform; import javax.annotation.Generated;
<|file_name|>IDuck.hpp<|end_file_name|><|fim▁begin|>#ifndef IDUCK_HPP_124b1b04_74d3_41ae_b7ce_2a0bea79f1c7 #define IDUCK_HPP_124b1b04_74d3_41ae_b7ce_2a0bea79f1c7 #include "../strategy/IFly.hpp" /** \interface IDuck Interface for duck. It can fly, quack and rotate right. */ <|fim▁hole|>class IDuck { public: ...
<|file_name|>test_InT01.py<|end_file_name|><|fim▁begin|>""" Integration test: permit call """ import os import sys myPath = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, myPath + '/../../') import logging import nose from nose.tools import * import inte_testutils from telewall.core.model import Te...
'Das analoge Telefon sollte angerufen worden sein, aber es gab keinen "Ringing" Status.') call.stop()
<|file_name|>macro-multiple-items.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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....
<|file_name|>ssh.go<|end_file_name|><|fim▁begin|>package ssh_helper import ( "bytes" "os" "os/exec" "runtime" log "github.com/sirupsen/logrus"<|fim▁hole|> "golang.org/x/crypto/ssh" ) const ( readBufSz = 1024 * 512 ) // Util is a ssh utility to scp run and stream commands/files type Util interface { SetTimer(...
"github.com/hypersleep/easyssh" "github.com/xshellinc/tools/lib/help"
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup def readme(): with open('README.rst.example') as f: return f.read()<|fim▁hole|>setup(name='manifold_gui', version='0.1', description='GUI for a manifold technique', long_description=readme(), classifiers...
<|file_name|>forum.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from datetime import datetime import uuid from werkzeug.exceptions import Forbidden import logging import openerp from openerp import api, tools from openerp import SUPERUSER_ID from openerp.addons.website.models.website import slug from open...
<|file_name|>ProfileActivity.java<|end_file_name|><|fim▁begin|>package com.hackatoncivico.rankingpolitico; import android.content.SharedPreferences; import android.os.AsyncTask; import android.os.Bundle; import android.preference.PreferenceManager; import android.support.v4.util.LogWriter; import android.support.v7.ap...
private static final String TAG = "ProfileActivity";
<|file_name|>test_stats.py<|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/. from atmo.stats.models import Metric def test_metrics_record(no...
assert m.data == {"other-value": "test"}
<|file_name|>router.js<|end_file_name|><|fim▁begin|>/* Client-side router settings */ Router.configure({ layoutTemplate:"layout", notFoundTemplate:"page_not_found", loadingTemplate:"loading" }); <|fim▁hole|>Router.route("/", { name:"home", template:"home" }); Router.route("/profile", { name:"profile", t...
<|file_name|>mnist.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow 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/...
<|file_name|>Sessions.js<|end_file_name|><|fim▁begin|>/* * This file is part of ARSnova Mobile. * Copyright (C) 2011-2012 Christian Thomas Weber * Copyright (C) 2012-2017 The ARSnova Team * * ARSnova Mobile is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public Lice...
tabPanel.feedbackTabPanel.tab.show(); tabPanel.feedbackTabPanel.renew(); }
<|file_name|>AlwaysBeCasting.tsx<|end_file_name|><|fim▁begin|>import React from 'react'; import { t } from '@lingui/macro'; import SPELLS from 'common/SPELLS'; import { formatPercentage } from 'common/format'; import { SpellLink } from 'interface'; <|fim▁hole|>class AlwaysBeCasting extends CoreAlwaysBeCasting { get...
import CoreAlwaysBeCasting from 'parser/shared/modules/AlwaysBeCasting'; import { When, ThresholdStyle } from 'parser/core/ParseResults';
<|file_name|>hist_2d.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ## @package color_histogram.core.hist_2d # # Implementation of 2D color histograms.<|fim▁hole|> from color_histogram.core.color_pixels import ColorPixels from color_histogram.core.hist_common import colorCoordinates, colorDensities, rgbColors...
# @author tody # @date 2015/08/28 import numpy as np
<|file_name|>user.js<|end_file_name|><|fim▁begin|>/* eslint-disable no-underscore-dangle */ export default function ({ client, filterQuery, mustContain, busy, encodeQueryAsString, }) { return { listUsers(query) { const params = filterQuery( query, 'text', 'limit', '...
const params = { old,
<|file_name|>test_experiment_pages.py<|end_file_name|><|fim▁begin|>from ab_tool.tests.common import (SessionTestCase, TEST_COURSE_ID, TEST_OTHER_COURSE_ID, NONEXISTENT_TRACK_ID, NONEXISTENT_EXPERIMENT_ID, APIReturn, LIST_MODULES) from django.core.urlresolvers import reverse from ab_tool.models import (Experimen...
""" Tests that submit_edit_experiment does not change DB count but does change Experiment attribute""" experiment = self.create_test_experiment(name="old_name") experiment_id = experiment.id
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate log; extern crate ilc_base; extern crate chrono; use std::io::{BufRead, Write}; use std::borrow::{Cow, ToOwned}; use std::iter::Iterator; use ilc_base::event::{Event, Time, Type}; use ilc_base::format::{rejoin, strip_one}; use ilc_base::{Conte...
},
<|file_name|>test_FieldCollation.py<|end_file_name|><|fim▁begin|># (C) British Crown Copyright 2014 - 2017, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundat...
# Define a list of date-time tuples, which should remain both all # distinct and in ascending order when converted...
<|file_name|>buck_project.py<|end_file_name|><|fim▁begin|># Copyright 2018-present Facebook, 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/LICENS...
def save_buckd_version(self, version): write_contents_to_file(self.buckd_version_file, version) def save_buckd_pid(self, pid):
<|file_name|>Killable.js<|end_file_name|><|fim▁begin|>'use strict'; var Killable = artifacts.require('../contracts/lifecycle/Killable.sol'); require('./helpers/transactionMined.js');<|fim▁hole|> contract('Killable', function(accounts) { it('should send balance to owner after death', async function() { let killa...
<|file_name|>addr.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 // http://www.apache.org/licenses/L...
} impl PartialEq for SocketAddrV6 { fn eq(&self, other: &SocketAddrV6) -> bool {
<|file_name|>detail.controller.js<|end_file_name|><|fim▁begin|>(function() { angular.module('starter.controllers').controller('DetailController', DetailController); DetailController.$inject = ['CarService', '$stateParams']; function DetailController (CarService, $stateParams) { var vm = this; CarService....
); } })();
<|file_name|>hops.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Wrapper script for Java Conda packages that ensures that the java runtime # is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246...
<|file_name|>processes.py<|end_file_name|><|fim▁begin|>"""This module holds the ``Process``es for NER.""" from copy import deepcopy from dataclasses import dataclass from typing import Any, List from boltons.cacheutils import cachedproperty from cltk.core.data_types import Doc, Process from cltk.ner.ner import tag_n...
>>> output_doc = a_process.run(Doc(raw=text, words=tokens)) >>> output_doc.words[7].string
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import { all } from 'redux-saga/effects'; import WatchUsers from 'sagas/users'; export default function *WatchSagas() { yield all([ WatchUsers()<|fim▁hole|><|fim▁end|>
]); }
<|file_name|>ProjectViewDialog.tsx<|end_file_name|><|fim▁begin|>/* MIT License Copyright (c) 2021 Looker Data Sciences, Inc. 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 restrict...
project, onClose,
<|file_name|>problem.py<|end_file_name|><|fim▁begin|>from math import sqrt from collections import defaultdict, Counter from fractions import Fraction def reverse_erathos(n): d = defaultdict(set) for i in range(2, n + 1): if i not in d: j = 2 * i while j <= n: d[...
if Counter(str(i)) == Counter(str(tot)):
<|file_name|>app.py<|end_file_name|><|fim▁begin|>from flask import Flask, request import sendgrid import json import requests import os app = Flask(__name__) SENDGRID_USER = os.getenv('SENDGRID_USER') SENDGRID_PASS = os.getenv('SENDGRID_PASS') ONENOTE_TOKEN = os.getenv('ONENOTE_TOKEN')<|fim▁hole|># Make the WSGI inter...
<|file_name|>create_db_home_request_response.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License ...
<|file_name|>mod_power_of_2_add.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::basic::unsigneds::PrimitiveUnsigned; use malachite_base_test_util::bench::bucketers::triple_3_bucketer; use malachite_base_test_util::bench::{run_benchmark, BenchmarkType}; use malachite_base_test_util::generators::common::{GenConf...
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest import subprocess import tempfile import shutil import os import config import time import pymongo <|fim▁hole|>def mongod(request): subprocess.call(['pkill', '-f', 'mongod*tmp']) server = MongoServer() server.start() def stop(): ...
@pytest.fixture(scope='session')
<|file_name|>test_util.py<|end_file_name|><|fim▁begin|># # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
error = self.assertRaises(webob.exc.HTTPBadRequest, util.extract_json, '{"name": 1}',
<|file_name|>runner.rs<|end_file_name|><|fim▁begin|>use regex::Regex; use state::Cucumber; use event::request::{InvokeArgument, Request}; use event::response::{InvokeResponse, Response, StepMatchesResponse}; use definitions::registration::{CucumberRegistrar, SimpleStep}; use std::panic::{self, AssertUnwindSafe}; use s...
Request::BeginScenario(params) => { self.cuke.tags = params.tags; Response::BeginScenario
<|file_name|>pscrap.py<|end_file_name|><|fim▁begin|>from nct.utils.alch import Session, LSession from nct.domain.instrument import Instrument import random import functools import time from nct.deploy.deploy import Deployer import cProfile INSTRUMENTS = ['GOOGL.O', 'TWTR.N', 'GS.N', 'BAC.N', 'IBM.N'] def profile_meth...
instr_id = s.query(Instrument).filter_by(name=name).one().id for _ in range(10000): s.query(Instrument).get(instr_id)
<|file_name|>seralizr.d.ts<|end_file_name|><|fim▁begin|>// TODO: put this in the source files, and extract it, to preserve comments export interface Context { json: any; target: any; parentContext: Context; args: any; } export type Factory<T> = (context: Context) => T export interface PropSchema { ...
export function custom(serializer: (value: any) => any, deserializer: (jsonValue: any) => any): PropSchema;
<|file_name|>minidump_generator.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2008, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code...
actual_assert_info = &client_assert_info;
<|file_name|>benchmark.py<|end_file_name|><|fim▁begin|>import sys import numpy as np from scipy import stats import subprocess as sp<|fim▁hole|>import datetime import socket import os exec_name = sys.argv[1] max_t = int(sys.argv[2]) ntries = 5 tot_timings = [] for t_idx in range(1,max_t + 1): cur_timings = [] for...
<|file_name|>ExampleUnitTest.java<|end_file_name|><|fim▁begin|>package edu.pacificu.cs493f15_1.paperorplasticapp; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void additi...
}
<|file_name|>download_corpora.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """Downloads the necessary NLTK corpora for TextBlob. Usage: :: $ python -m textblob.download_corpora If you only intend to use TextBlob's default models, you can use the "lite" option: :: $ python -m...
""" import sys
<|file_name|>Favorites.react.js<|end_file_name|><|fim▁begin|>/* * Favorites * Favorites landing page */ import React, { Component } from 'react' import NavBar from '../NavBar.react' export default class Favorites extends Component { render() { return ( <div> <div className="p2 overflow-scroll ...
</div>
<|file_name|>StrengthTrait.java<|end_file_name|><|fim▁begin|>package playertraits.traits; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; public class StrengthTrait extends Trait { public StrengthTrait() {<|fim▁hole|> super("Strength"...
<|file_name|>_ParagraphPropertiesComplex.java<|end_file_name|><|fim▁begin|>/* * This file is part of the LibreOffice project. * * 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.or...
<|file_name|>appengine_v1_generated_instances_delete_instance_sync.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 Lic...
# [START appengine_v1_generated_Instances_DeleteInstance_sync] from google.cloud import appengine_admin_v1
<|file_name|>ember.js<|end_file_name|><|fim▁begin|>(function() { var define, requireModule; (function() { var registry = {}, seen = {}; define = function(name, deps, callback) { registry[name] = { deps: deps, callback: callback }; }; requireModule = function(name) { if (seen[name]) { return seen[name...