prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>index_reader.go<|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/. package biglog import ( "errors" "fmt" "io" "sync" "s...
// check byte limit if is.Size+NdFO-dFO > maxBytes {
<|file_name|>t_Mixture_std.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python from openturns import * TESTPREAMBLE() RandomGenerator.SetSeed(0) try: # Instanciate one distribution object dimension = 3 meanPoint = NumericalPoint(dimension, 1.0) meanPoint[0] = 0.5 meanPoint[1] = -0.5 sigma ...
<|file_name|>outwardslip-page.js<|end_file_name|><|fim▁begin|>/**<|fim▁hole|>//JS page for outwardslip page Polymer({ is: "outwardslip-page", ready:function() { //Showing customerinfo page as the initial page in outwardslip page localStorage.setItem("curr_sess_saveflag","false"); if(sessionStorage.get...
* Created by praba on 2/13/2016. */
<|file_name|>PawnBuildPath.py<|end_file_name|><|fim▁begin|>import json import sublime import sublime_plugin from .edit import Edit class PawnBuildPathCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().show_input_panel( "Working directory that contains pawncc.exe", ...
"cmd": [ "pawncc.exe", "$file", "-o$file_path/$file_base_name",
<|file_name|>methodoverride.go<|end_file_name|><|fim▁begin|>// A method override middleware for [rkgo/web](https://github.com/rkgo/web) // // app := web.New() // app.Use(methodoverride.Middleware()) // package methodoverride import ( "strings" "github.com/rkgo/web" ) const ( overrideFormField = "_method" overr...
case "PUT", "PATCH", "DELETE": ctx.Req().Method = method } }
<|file_name|>vendor.browser.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> // Angular 2 import '@angular/platform-browser'; import '@angular/platform-browser-dynamic'; import '@angular/core'; import '@angular/common'; import '@angular/forms'; import '@angular/http'; import '@angular/router'; // AngularClass import '@ang...
// For vendors for example jQuery, Lodash, angular2-jwt just import them here unless you plan on // chunking vendors files for async loading. You would need to import the async loaded vendors // at the entry point of the async loaded file. Also see custom-typings.d.ts as you also need to // run `typings install x` wher...
<|file_name|>context.rs<|end_file_name|><|fim▁begin|>use alloc::boxed::Box; use collections::string::{String, ToString}; use arch::context; use fs::{KScheme, Resource, Url, VecResource}; use system::error::Result; pub struct ContextScheme; impl KScheme for ContextScheme { fn scheme(&self) -> &str { "c...
fn open(&mut self, _: Url, _: usize) -> Result<Box<Resource>> { let mut string = format!("{:<6}{:<6}{:<8}{:<8}{:<8}{:<6}{:<6}{:<6}{}\n", "PID", "PPID",
<|file_name|>cleanup_data.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt #!/usr/bin/python # This script is for cleaning up of all data from system including # all transactions and masters (excludes def...
# initial state. # This script can be executed from lib/wnf.py using # lib/wnf.py --cleanup-data
<|file_name|>PlottingHandler.py<|end_file_name|><|fim▁begin|>""" Plotting Service generates graphs according to the client specifications and data """ __RCSID__ = "$Id$" import os import hashlib from types import DictType, ListType from DIRAC import S_OK, S_ERROR, rootPath, gConfig, gLogger, gMonitor from DIRAC....
if not result['OK']:
<|file_name|>formatter.go<|end_file_name|><|fim▁begin|>package logger import ( "fmt" "github.com/sirupsen/logrus" "github.com/vpnht/desktop/packages/service/colorize" "sort" "time" ) var ( blueArrow = colorize.ColorString("▶", colorize.BlueBold, colorize.None) whiteDiamond = colorize.ColorString("◆", colori...
<|file_name|>workload_client.go<|end_file_name|><|fim▁begin|>/* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0...
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>""" Created on Thu Jan 31 2018 Unit tests for the Balance game @author: IvanPopov """ <|fim▁hole|>from game import Game class GameTest(unittest.TestCase): def test_game_loads(self): g=Game() self.assertEqual(g.c.title(), "Balance")<|fim▁end|>
import unittest
<|file_name|>flap_limits.py<|end_file_name|><|fim▁begin|># Copyright 2020 Makani Technologies LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
for i in range(len(_SERVOS))] return {_SERVOS[i]: (servo_limits[i]['ref_model_min_position_limit'], servo_limits[i]['ref_model_max_position_limit'])
<|file_name|>nav.py<|end_file_name|><|fim▁begin|># Copyright (C) 2011, Endre Karlson # 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, either version 3 of the License, or #...
<|file_name|>reportico.js<|end_file_name|><|fim▁begin|>reportico_jquery = jQuery.noConflict(); var reportico_ajax_script = "index.php"; /* ** Reportico Javascript functions */ function setupDynamicGrids() { if (typeof reportico_dynamic_grids === 'undefined') { return; } if ( reportico_j...
return false; })
<|file_name|>32.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
export { WatsonHealthCircleMeasurement32 as default } from "../../../";
<|file_name|>test_functable.cpp<|end_file_name|><|fim▁begin|>// // Created by 王耀 on 2017/11/14. // #include <gtest/gtest.h> #include "functable.h" TEST(FuncTableTest, FuncTableTest_OPERATION_Test) {<|fim▁hole|> Func func1(2, 3, 5, 9); FuncTable table; EXPECT_EQ(0, table.getSize()); table.append(func1);...
<|file_name|>test_terrain.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # <Lettuce - Behaviour Driven Development for python> # Copyright (C) <2010-2012> Gabriel Falcão <gabriel@nacaolivre.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Pu...
@step('append 1 in world all steps')
<|file_name|>NodeTypePostProcessor.java<|end_file_name|><|fim▁begin|>package alien4cloud.tosca.parser.postprocess; import static alien4cloud.utils.AlienUtils.safe; import javax.annotation.Resource; import org.alien4cloud.tosca.model.types.NodeType; import org.springframework.stereotype.Component; /** * Post proces...
public void process(NodeType instance) { safe(instance.getCapabilities()).forEach(capabilityDefinitionPostProcessor); safe(instance.getRequirements()).forEach(requirementDefinitionPostProcessor);
<|file_name|>eulers_sum_of_powers_conjecture.rs<|end_file_name|><|fim▁begin|>// http://rosettacode.org/wiki/Euler's_sum_of_powers_conjecture const MAX_N: u64 = 250; fn eulers_sum_of_powers() -> (usize, usize, usize, usize, usize) { let pow5: Vec<u64> = (0..MAX_N).map(|i| i.pow(5)).collect(); let pow5_to_n = |p...
panic!(); }
<|file_name|>basic_response.js<|end_file_name|><|fim▁begin|>/** * Created by kobi on 5/15/14. */ exports.welcome = function(req,res){<|fim▁hole|><|fim▁end|>
res.json({message:'welcome to Money Map API'}); }
<|file_name|>hsibackend.py<|end_file_name|><|fim▁begin|># -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2002 Ben Escoto <ben@emerose.org> # Copyright 2007 Kenneth Loafman <kenneth@loafman.com> # # This file is part of duplicity. # # Duplicity is free software; you can redistribute it and/or modif...
def _get(self, remote_filename, local_path): commandline = '%s "get %s : %s%s"' % (hsi_command, local_path.name, self.remote_prefix, remote_filename) self.subprocess_popen(commandline)
<|file_name|>e-field-detector-arrow.js<|end_file_name|><|fim▁begin|>define(function(require) { 'use strict'; var _ = require('underscore'); var PIXI = require('pixi'); var ArrowView = require('common/v3/pixi/view/arrow'); var Constants = require('constants'); var EFieldDetectorArrowView...
}; var label = new PIXI.Text(this.label, textStyle);
<|file_name|>pe1.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python3 # encoding: utf-8 ''' http://projecteuler.net/problem=1 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. ''...
# Almost as fast as v2 def v3(): return sum( i for i in range(n) if not i%a or not i%b )
<|file_name|>capability_list.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2017 David Renshaw and contributors // // 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, in...
marker: PhantomData<T>, } impl<'a, T> ::traits::Owned<'a> for Owned<T> where T: FromClientHook {
<|file_name|>Reactor_test06.cc<|end_file_name|><|fim▁begin|>#include <muduo/net/EventLoop.h> #include <muduo/net/EventLoopThread.h> #include <stdio.h> using namespace muduo; using namespace muduo::net; void runInThread() { printf("runInThread(): pid = %d, tid = %d\n", getpid(), CurrentThread::tid());<|fim...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licens...
} }).collect();
<|file_name|>ServiceConfigActionableDynamicQuery.java<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under<|fim▁hole|> * This library is distributed in the hope that it will be useful, but WI...
* the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. *
<|file_name|>datify.py<|end_file_name|><|fim▁begin|>import csv import re import datetime import string import collections def get_nr_data(): ''' returns a list of lists each entry represents one row of NiceRide data in form -- [[11/1/2015, 21:55], '4th Street & 13th Ave SE', '30009', [11/1/2015, 22:05], ...
elif month == 'oct': return 10
<|file_name|>SDRDeviceInfo.cpp<|end_file_name|><|fim▁begin|>#include "SDRDeviceInfo.h" SDRDeviceInfo::SDRDeviceInfo() : name(""), serial(""), available(false) { } std::string SDRDeviceInfo::getDeviceId() { std::string deviceId; deviceId.append(getName()); deviceId.append(" :: "); deviceId.appen...
}
<|file_name|>qdesktopservices_qws.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of th...
qWarning("QDesktopServices::storageLocation %d not implemented", type); return QString(); }
<|file_name|>dispatcher.go<|end_file_name|><|fim▁begin|>package testing import ( v2net "github.com/v2ray/v2ray-core/common/net" "github.com/v2ray/v2ray-core/transport/ray" ) type TestPacketDispatcher struct { LastPacket chan v2net.Packet Handler func(packet v2net.Packet, traffic ray.OutboundRay) } func NewTes...
} close(traffic.OutboundOutput()) } }
<|file_name|>SlackHTTP.js<|end_file_name|><|fim▁begin|>import querystring from 'querystring' import SlackRTM from './SlackRTM' import FetchService from 'shared/FetchService' import userStore from 'stores/user/userStore' import accountStore from 'stores/account/accountStore' import { remote, ipcRenderer } from 'electron...
/** * Gets the unread info from the server
<|file_name|>render_alphabetsoup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ''' Copyright (C) 2001-2002 Matt Chisholm matt@theory.org Copyright (C) 2008 Joel Holdsworth joel@airwebreathe.org.uk for AP This program is free software; you can redistribute it and/or modify it under the terms of the GNU Gen...
return None, 0, 0
<|file_name|>TextAreaAdapter.test.js<|end_file_name|><|fim▁begin|>import React from "react"; import { mount } from "enzyme"; import { TextArea as VanillaTextArea } from "hig-vanilla"; import TextAreaAdapter from "./TextAreaAdapter"; describe("TextAreaAdapter", () => { it("implements the hig interface", () => { e...
}); });
<|file_name|>matchinfo.py<|end_file_name|><|fim▁begin|>##################################################### # # A library for getting match information for a given team at a given event # out of the Blue Alliance API # # Authors: Andrew Merrill and Jacob Bendicksen (Fall 2014) # # Requires the blueapi.py library #####...
def getMatchBlueTeams(matchNumber,eventKey): return blueapi.getEventMatches(eventKey)[matchNumber]['alliances']['blue']['teams']
<|file_name|>json_serializer.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mirantis, 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/lice...
def dump_as_bytes(self, obj): return jsonutils.dump_as_bytes(obj, default=self._default, encoding=self._encoding)
<|file_name|>issue-3121.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<|fim▁hole|>// http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apac...
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding=utf-8 from webapp.web import Application from handlers.index import IndexHandler from handlers.register import RegisterHandler from handlers.user import UserHandler from handlers.signin import SigninHandler from handlers.signout import Si...
("/upload", "UploadHandler"), ("/avatar/(.*)", "AvatarHandler"), ("/error", "ErrorHandler"), ("/pwdchange", "PasswordHandler"),
<|file_name|>servicegroup_servicegroupentitymonbindings_binding.py<|end_file_name|><|fim▁begin|># # Copyright (c) 2008-2015 Citrix Systems, 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 Lice...
@property def state(self) :
<|file_name|>path.d.ts<|end_file_name|><|fim▁begin|>declare module 'path/posix' { import path = require('path'); export = path; } declare module 'path/win32' { import path = require('path'); export = path; } /** * The `path` module provides utilities for working with file and directory paths. * It can...
*/
<|file_name|>mv.cpp<|end_file_name|><|fim▁begin|>#include <iostream> #include <unistd.h> #include <sys/wait.h> #include <sys/types.h><|fim▁hole|>#include <wait.h> #include <string.h> #include <string> #include <vector> #include <cstdlib> #include <stdlib.h> #include <stdio.h> #include <boost/tokenizer.hpp> #include <bo...
#include <sys/stat.h>
<|file_name|>myid.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import config from metodos import * from mensagens import myid def my_id(msg): chat_id = msg['chat']['id'] try: user = '@' + msg['from']['username'] except:user = " " if msg['text'] == '/id': if msg['chat']['type'] == '...
<|file_name|>ForExpressions.rs<|end_file_name|><|fim▁begin|>fn main() { for item in 0..10 {} for item in 0 .. 10 {}; for item in 0..10 {println!("Foo")} for item in 0..10 {println!("Foo")}; for item in 0..10 {println!("Foo");}<|fim▁hole|><|fim▁end|>
for item in 0..10 {println!("Foo");}; for item in 0..10 {break; continue; break}; }
<|file_name|>ndvi_difference.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 """Example of server-side computations used in global forest change analysis. In this example we will focus on server side computation using NDVI and EVI data. This both metrics are computed bands created by third party companies or d...
<|file_name|>sslutils.py<|end_file_name|><|fim▁begin|># Copyright 2013 IBM Corp. # # 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....
<|file_name|>scrollview.rs<|end_file_name|><|fim▁begin|>use render::*; use crate::scrollbar::*; #[derive(Clone)] pub struct ScrollView{ pub view:View, pub scroll_h:Option<ScrollBar>, pub scroll_v:Option<ScrollBar>, } impl ScrollView{ pub fn proto(cx: &mut Cx) -> Self { Self { view...
self.view.view_will_redraw(cx) } pub fn handle_scroll_bars(&mut self, cx: &mut Cx, event: &mut Event) -> bool {
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.views.generic import DetailView from entries.models import Entry class EntryView(DetailView): model = Entry<|fim▁hole|> slug_field = 'sname' slug_url_kwarg = 'entry_sname'<|fim▁end|>
template_name = "entry.html" context_object_name = 'entry'
<|file_name|>SimulationException.java<|end_file_name|><|fim▁begin|><|fim▁hole|> super(s); } }<|fim▁end|>
package cellsociety_team05; public class SimulationException extends Exception { public SimulationException(String s) {
<|file_name|>example.py<|end_file_name|><|fim▁begin|>class HighScores(object): def __init__(self, scores):<|fim▁hole|> return self.scores[-1] def personal_best(self): return max(self.scores) def personal_top_three(self): return sorted(self.scores, reverse=True)[:3]<|fim▁end|>
self.scores = scores def latest(self):
<|file_name|>api.py<|end_file_name|><|fim▁begin|>from tastypie.authentication import ApiKeyAuthentication from tastypie.authorization import Authorization from tastypie.resources import NamespacedModelResource, fields, ALL, ALL_WITH_RELATIONS from django.contrib.auth.models import User #BUG: Import the correct user obj...
authentication = ApiKeyAuthentication()
<|file_name|>test_learning.cpp<|end_file_name|><|fim▁begin|>/* Copyright 2013-present Barefoot Networks, 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...
LearnEngine::list_id_t list_id = 1; size_t max_samples = 1;
<|file_name|>step.py<|end_file_name|><|fim▁begin|>from __future__ import print_function from bose_einstein import bose_einstein from constant import htr_to_K, htr_to_meV, htr_to_eV import argparser import norm_k import numpy as np import scf import system args = argparser.read_argument('Evaluate step-like feature in e...
for energy_meV in np.arange(0.0, args.energy, 0.5):
<|file_name|>test_application_scope_data.py<|end_file_name|><|fim▁begin|>''' Precondition successfully pass a users test. ''' from datetime import datetime, timedelta import time import pytest import requests from kii import AccountType, exceptions as exc, results as rs from kii.data import BucketType, clauses as...
<|file_name|>factories.py<|end_file_name|><|fim▁begin|>""" Factories for Program Enrollment tests. """ from __future__ import absolute_import from uuid import uuid4 import factory from factory.django import DjangoModelFactory from opaque_keys.edx.keys import CourseKey from lms.djangoapps.program_enrollments import m...
PROGRAM_COURSE_ENROLLMENT_DEFAULT_COURSE_KEY = (
<|file_name|>wizard.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Interactive wizard to guide user to set up EFB and modules. Since newer version of pip (>=9.0), which checks Python version prior to installation, is already widespread, we are dropping Python version check in wizard script, and assuming u...
# Check installations of modules modules_err = _("You may want to visit the modules repository to find a list of " "available modules to install.\n"
<|file_name|>FieldInstanceNumberField.java<|end_file_name|><|fim▁begin|>/* * #! * Ontopoly Editor * #- * Copyright (C) 2001 - 2013 The Ontopia Project * #- * 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...
@Override protected String resourceKeyInvalidValue() { return "validators.RegexValidator.number"; }
<|file_name|>renamedcoin_pt_BR.ts<|end_file_name|><|fim▁begin|><TS language="pt_BR" version="2.1"> <context> <name>AboutDialog</name> <message> <source>About Renamedcoin Core</source> <translation>Sobre o Renamedcoin Core</translation> </message> <message> <source>&lt;b&gt;Rename...
<|file_name|>lib.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/. */ // For simd (currently x86_64/aarch64) #![cfg_attr(any(target_os ...
// Private painting modules mod paint_context; #[deny(unsafe_code)]
<|file_name|>xinfo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import subprocess import gdb import pwndbg.arch import ...
<|file_name|>multiraft_test.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The Cockroach 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/licens...
config := &Config{ Transport: transport, Storage: storage,
<|file_name|>test_slic.py<|end_file_name|><|fim▁begin|>import itertools as it import warnings import numpy as np from numpy.testing import assert_equal, assert_raises from skimage.segmentation import slic def test_color_2d(): rnd = np.random.RandomState(0) img = np.zeros((20, 21, 3)) img[:10, :10, 0] = 1 ...
img[img > 1] = 1
<|file_name|>expectations.js<|end_file_name|><|fim▁begin|>/** * @license Copyright 2017 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/lice...
}, }, },
<|file_name|>building.py<|end_file_name|><|fim▁begin|>import os import sys import string from SCons.Script import * from utils import _make_path_relative BuildOptions = {} Projects = [] Rtt_Root = '' Env = None class Win32Spawn: def spawn(self, sh, escape, cmd, args, env): # deal with the cmd build-in co...
group_path = '' for g in Projects: if g['name'] == name:
<|file_name|>file_manager.rs<|end_file_name|><|fim▁begin|>use redox::{self, env, BMPFile}; use redox::event::{self, EventOption, MouseEvent}; use redox::fs::file::File; use redox::io::{Read, Seek, SeekFrom}; use redox::orbital::Window; use redox::time::{self, Duration}; use redox::vec::Vec; use redox::string::{String, ...
y: 0, left_button: false, middle_button: false,
<|file_name|>assist-state.service.spec.ts<|end_file_name|><|fim▁begin|>import { TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { LocalStorageModule } from 'angular-2-local-storage';<|fim▁hole|>import { HttpClientTestingModule } from '@angular/common/http/te...
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os from setuptools import setup, find_packages def read_file(filename): """Read a file into a string""" path = os.path.abspath(os.path.dirname(__file__)) filepath = os.path.join(path, filename) try: return open(filepath).read() excep...
version = __import__('cookiesession').get_version().replace(' ', '-'),
<|file_name|>bitcoinrpc.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "init.h" #include "ut...
else if (nStatus == HTTP_BAD_REQUEST) cStatus = "Bad Request";
<|file_name|>functional_test.rs<|end_file_name|><|fim▁begin|>use std::collections::HashSet; use rand::thread_rng; use schema::*; use Index; use Searcher; use rand::distributions::{IndependentSample, Range}; fn check_index_content(searcher: &Searcher, vals: &HashSet<u64>) { assert!(searcher.segment_readers().len()...
} }
<|file_name|>Rules.d.ts<|end_file_name|><|fim▁begin|>import React from 'react';<|fim▁hole|><|fim▁end|>
import { ViewProps } from '../primitives/View'; export declare const HR: React.ComponentType<ViewProps>;
<|file_name|>entrenarFannNormalizado.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- ''' Created on: 2015 Author: Mizael Martinez ''' from pyfann import libfann from login import Login from escribirArchivo import EscribirArchivo import inspect, sys, os sys.path.append("../model") from baseDatos import...
self.__red=None self.__error_real=0
<|file_name|>TemplatesListsStyle.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2004 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing templates for the documentation generator (lists style). """ from __future__ import unicode_literals ############################...
returnTypesTemplate = \
<|file_name|>lap_kb_mutasi_common.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2018 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import models, fields, api from openerp import tools class LapKbMutasiCommon(models.AbstractModel): _name =...
<|file_name|>subnet.py<|end_file_name|><|fim▁begin|># Copyright 2014 Isotoma Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
elif self.runner.get_plan( self.resource.network_acl
<|file_name|>shopcontroller.js<|end_file_name|><|fim▁begin|><|fim▁hole|> .controller('ShopController', function($scope, Item){ $scope.allItems; $scope.getAll = function () { Item.getAll().success(function(data){ $scope.allItems = data }); }; $scope.getAll(); });<|fim▁end|>
angular.module('africaXpress')
<|file_name|>cpuidle.py<|end_file_name|><|fim▁begin|># Copyright 2014-2015 ARM Limited # # 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 # ...
<|file_name|>get_courses_file.py<|end_file_name|><|fim▁begin|>import sys import os import traceback from django import db sys.path.append('/root/wisely/wisely_project/') os.environ['DJANGO_SETTINGS_MODULE'] = 'wisely_project.settings.production' from django.db.models import F, Q from django.utils import timezone fro...
<|file_name|>test_quote.py<|end_file_name|><|fim▁begin|>from sqlalchemy import * from sqlalchemy import sql, schema from sqlalchemy.sql import compiler from test.lib import * class QuoteTest(fixtures.TestBase, AssertsCompiledSQL): __dialect__ = 'default' @classmethod def setup_class(cls): # TODO: ...
class Custom(compiler.IdentifierPreparer): def __init__(self, dialect):
<|file_name|>dist_async_kvstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # 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 th...
# to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance
<|file_name|>string_generator.rs<|end_file_name|><|fim▁begin|>#![feature(std_misc)] pub mod string_generator { use std::collections::HashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; pub struct StrGen { counter: HashMap<String, u64> } impl StrGen { pub fn generate(&...
format!("{}{}", prefix, count)
<|file_name|>0002_auto_20170425_0010.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-04-25 00:10 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import filer.fields.file cla...
model_name='expenseitem',
<|file_name|>service.py<|end_file_name|><|fim▁begin|># Copyright 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 # # http://w...
@admin_context def index(self, req, tenant_id):
<|file_name|>test_delete_deposit.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of CERN Analysis Preservation Framework. # Copyright (C) 2017 CERN. # # CERN Analysis Preservation Framework is free software; you can redistribute # it and/or modify it under the terms of the GNU General Publ...
<|file_name|>ObservationStatusEnumFactory.java<|end_file_name|><|fim▁begin|>package org.hl7.fhir.dstu3.model.codesystems; /* Copyright (c) 2011+, HL7, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following ...
public String toCode(ObservationStatus code) { if (code == ObservationStatus.REGISTERED) return "registered";
<|file_name|>test_suggestions.py<|end_file_name|><|fim▁begin|># coding: utf-8 from .common import CommonTestCase class SuggestionsTest(CommonTestCase): def test_suggestion_url(self): client = self.client # self.assertEqual(client.suggestions.address.url, "https://suggestions.dadata.ru/suggestions/...
<|file_name|>dispatcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3 # Copyright (C) 2015 Bitquant Research Laboratories (Asia) Limited # Released under the Simplified BSD License import my_path import time import zmq.green as zmq import pprint import algobroker import msgpack class Dispatcher(algobroker.Broke...
if (data['cmd'] == "log"): self.warning(pprint.pformat(data)) elif (data['cmd'] == 'alert' and
<|file_name|>example.local_settings.py<|end_file_name|><|fim▁begin|># coding: utf-8 """ Wheel will try to read configurations from environment variables so you dont need this local_settings.py file if you have env vars. 1. You can set as a file export WHEEL_SETTINGS='/path/to/settings.py' 2. You can set individual ...
MONGODB_USERNAME = None MONGODB_PASSWORD = None
<|file_name|>error_response.go<|end_file_name|><|fim▁begin|>/* * API * * API * * API version: 1.0.0 * Contact: you@your-company.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)<|fim▁hole|>type ErrorResponse struct { Errors []ModelError `json:"errors,omitempty"` }<|fim▁en...
*/ package stores
<|file_name|>Utils.js<|end_file_name|><|fim▁begin|>/** * Slices arrays. * @param array * @param pos * @returns {string} */ var arraySlicer = function (array, pos) { return array.slice(0, pos).concat(array.slice(pos + 1, array.length)); }; /** * https://en.wikipedia.org/wiki/Cosine_similarity * https://en.w...
for (var i = 0; i < arr1.length && i < arr2.length; i++) {
<|file_name|>UserInfo.tsx<|end_file_name|><|fim▁begin|>import React from 'react' import { User } from '../../lib/accounts/users' import styled from '../../lib/styled' import MdiIcon from '@mdi/react' import { mdiAccount } from '@mdi/js' import { SectionPrimaryButton } from './styled' import { useTranslation } from 'rea...
const Container = styled.div` margin-bottom: 8px;
<|file_name|>compute_window_score.py<|end_file_name|><|fim▁begin|>from epic.utils.helper_functions import lru_cache from numpy import log from scipy.stats import poisson @lru_cache() def compute_window_score(i, poisson_parameter): # type: (int, float) -> float # No enrichment; poisson param also average ...
return window_score
<|file_name|>toys.py<|end_file_name|><|fim▁begin|>from minieigen import * from woo.dem import * import woo.core, woo.models from math import * import numpy class PourFeliciter(woo.core.Preprocessor,woo.pyderived.PyWooObject): '''Showcase for custom packing predicates, and importing surfaces from STL.''' _clas...
S.pre=pre.deepcopy()
<|file_name|>compat.py<|end_file_name|><|fim▁begin|># -*- test-case-name: twisted.test.test_compat -*- # # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Compatibility module to provide backwards compatibility for useful Python features. This is mainly for use of internal Twisted code. We ...
@raise UnicodeError: The input string is not ASCII encodable/decodable. @raise TypeError: The input is neither C{bytes} nor C{unicode}. """
<|file_name|>kernel.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 SUSE Linux GmbH. All rights reserved. # # This file is part of kiwi. # # kiwi 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 ve...
<|file_name|>associated-types-normalize-in-bounds-binding.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-APACH...
<|file_name|>cli.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright 2012 Lee Verberne <lee@blarg.org> # # 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 version 3 of the Licen...
# Try to figure out what hat we're using here hat = ubik.hats.hatter(args, config, options) if hat:
<|file_name|>testcaseGenerator.js<|end_file_name|><|fim▁begin|>var sound = require("models/sound.js"); var command = require("models/command.js"); var testcase = require("models/testcase.js");<|fim▁hole|>var soundScript = require("models/soundScript.js"); var config = require("config.js"); var Log = require("logger.js"...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2020, DjaoDjin 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: # # 1. Redistributions of source code must retain the abov...
<|file_name|>sample1.js<|end_file_name|><|fim▁begin|><|fim▁hole|> 'use strict'; window.console.log("Sample A"); } sampleA(); /** * Sample content to test the concat and minify grunt plugins. */ function sampleB() { 'use strict'; window.console.log("Sample B"); } sampleB();<|fim▁end|>
/** * Sample content to test the concat and minify grunt plugins. */ function sampleA() {
<|file_name|>global.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/. */ //! Abstractions for global scopes. //! //! This module contai...
/// A stack-based rooted reference to a global object. pub enum GlobalRoot {