prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>Rx.js<|end_file_name|><|fim▁begin|>"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var rx_1 = require("rx"); /* tslint:enable */ function cache(callback) { var cached$ = this.replay(undefined, 1); var subscription = cached$.connect();<|fim▁hole|>rx_1.Observable.prototyp...
callback(function () { return subscription.dispose(); }); return cached$; }
<|file_name|>fetch_test.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The rkt 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-...
func (h *serverHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
<|file_name|>test.sql.js<|end_file_name|><|fim▁begin|>if (typeof require != 'undefined' || !jsyrup) var jsyrup = require('../../../jsyrup'); describe('when creating', function() { var ds, modelClass, callback; beforeEach(function() { ds = new jsyrup.SQLDataSource(); callback = jasmine.crea...
});
<|file_name|>client.py<|end_file_name|><|fim▁begin|>#-*-coding: utf-8-*- from tornado import gen from tornado.httpclient import AsyncHTTPClient, HTTPError, HTTPRequest from tornado.options import options from functools import wraps from tornado import escape import tornado.ioloop import base64 import time import datet...
@gen.coroutine def update_file(gist_url, filename, data):
<|file_name|>Bills.py<|end_file_name|><|fim▁begin|>import time from Facturacion.Objects.Bill import Bill, ItemLine from Facturacion.Controllers.ControlDB import BillsController from Facturacion.Collections.Vendors import Vendors from Facturacion.Collections.Clients import Clients from Facturacion.Collections.Items impo...
return 1 return max(cls.facturas, key=int) + 1 @classmethod
<|file_name|>server.js<|end_file_name|><|fim▁begin|>// EXPRESS SERVER HERE // // BASE SETUP var express = require('express'), app = express(), bodyParser = require('body-parser'), cookieParser = require('cookie-parser'), session = require('express-session'), methodOverride = require('method-overrid...
app.use(serveStatic('app', {'index': 'true'})); // Set to True or False if you want to start on Index or not app.use('/bower_components', express.static(__dirname + '/bower_components'));
<|file_name|>0003_auto_20160921_1608.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models def forwards(apps, schema_editor): """Create Peers group.""" Group = apps.get_model('auth', 'Group') Group.objects.create(name='Pee...
operations = [ migrations.RunPython(forwards, backwards)
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- { 'name': 'test-import-export', 'version': '0.1', 'category': 'Tests', 'description': """A module to test import/export.""", 'author': 'OpenERP SA', 'maintainer': 'OpenERP SA', 'website': 'http://www.openerp.com...
'data': ['ir.model.access.csv'], 'installable': True,
<|file_name|>Scope.java<|end_file_name|><|fim▁begin|>package ru.mephi.interpreter; import org.antlr.v4.runtime.tree.ParseTree; import java.math.BigInteger; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @author Anton_Chkadua */ public class Scope { static Scope GLOBAL = new Scope...
} }
<|file_name|>test_trace.py<|end_file_name|><|fim▁begin|># Testing the line trace facility. from test import test_support import unittest import sys import difflib # A very basic example. If this fails, we're in deep trouble. def basic(): return 1 basic.events = [(0, 'call'), (1, 'line'), ...
pass
<|file_name|>publish.js<|end_file_name|><|fim▁begin|>module.exports = publish var url = require('url') var semver = require('semver') var Stream = require('stream').Stream var assert = require('assert') var fixer = require('normalize-package-data').fixer var concat = require('concat-stream') var ssri = require...
// If 409, then GET and merge, try again. // If other error, then fail.
<|file_name|>http_config.go<|end_file_name|><|fim▁begin|>// Copyright 2020 Huawei Technologies Co.,Ltd. // // 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 ownersh...
<|file_name|>char.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/L...
// pretty-expanded FIXME #23616 pub fn main() {
<|file_name|>client.cpp<|end_file_name|><|fim▁begin|>#include <onyxudp/udpclient.h> #include <stdio.h> #include <string.h> #include <assert.h> /* This test just makes sure the client library compiles and doens't crash on start. */ void on_error(udp_client_params_t *client, UDPERR code, char const *name) {<|fim▁hol...
<|file_name|>laogong21.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python #coding=utf-8 ''' @author: sheng @license: ''' <|fim▁hole|> SPELL=u'láogōng' CN=u'劳宫' NAME=u'laogong21' CHANNEL='pericardium' CHANNEL_FULLNAME='PericardiumChannelofHand-Jueyin' SEQ='PC8' if __name__ == '__main__': pass<|fim▁end|>
<|file_name|>grid_world_3D_env.py<|end_file_name|><|fim▁begin|>import numpy as np from .base import Env from rllab.spaces import Discrete from rllab.envs.base import Step from rllab.core.serializable import Serializable MAPS = { "chain": [ "GFFFFFFFFFFFFFSFFFFFFFFFFFFFG" ], "4x4_safe": [ "S...
now= np.array(list(self.desc)) #now=np.array(list(map(list, self.desc))) #print(now)
<|file_name|>translate-provider.js<|end_file_name|><|fim▁begin|>'use strict'; var storageKey = 'VN_TRANSLATE'; // ReSharper disable once InconsistentNaming function Translate($translate, $translatePartialLoader, storage, options, disableTranslations) { this.$translate = $translate; this.$translatePartialLoader = $t...
this.setPreferredLanguage(options.lang); } this.options = options;
<|file_name|>glm_poisson_example.py<|end_file_name|><|fim▁begin|># Used swedish insurance data from smalldata instead of MASS/insurance due to the license of the MASS R package. import h2o from h2o.estimators.glm import H2OGeneralizedLinearEstimator h2o.init() h2o_df = h2o.import_file("http://h2o-public-test-data.s3.a...
<|file_name|>webpack.config.js<|end_file_name|><|fim▁begin|>var ExtractTextPlugin = require("extract-text-webpack-plugin"); var HtmlWebpackPlugin = require("html-webpack-plugin"); var path = require("path"); var webpack = require("webpack"); var projectTemplatesRoot = "../../ppb/templates/"; module.exports = { con...
{ test: /\.less$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader") },
<|file_name|>KxDesktopServices.cpp<|end_file_name|><|fim▁begin|>#include "KxDesktopServices.h" #include <QDesktopServices> #include <QUrl> KxDesktopServices::KxDesktopServices(QObject *parent) : QObject(parent) { } <|fim▁hole|>void KxDesktopServices::openUrl(const QString &url) { QDesktopServices::openUrl(QU...
<|file_name|>SynchronizerDeadlock.java<|end_file_name|><|fim▁begin|>/* * Copyright 2005 Sun Microsystems, Inc. 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 General Public L...
} }
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from django.core.exceptions import ValidationError from django.db.models.fields.related import ForeignObject try: from django.db.models.fields.related_descriptors import ForwardManyToOneDescriptor except ImportError: from django.db...
# Handle the locality. try: locality_obj = Locality.objects.get(name=locality, state=state_obj)
<|file_name|>TestPathTool.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> * # * * # * ...
<|file_name|>StreamInfo.java<|end_file_name|><|fim▁begin|>package chatty.util.api; import chatty.Helper; import chatty.util.DateTime;<|fim▁hole|>import java.util.logging.Logger; /** * Holds the current info (name, viewers, title, game) of a stream, as well * as a history of the same information and stuff like when ...
import java.util.LinkedHashMap; import java.util.Locale;
<|file_name|>TestUtils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- from numpy.testing import assert_approx_equal, assert_allclose, assert_array_equal from UliEngineering.SignalProcessing.Utils import * from parameterized import parameterized import concurrent.futures import numpy as n...
l2 = LinRange(0., 100., 100, endpoint=False) l3 = LinRange(0., 100., 100, endpoint=True) self.assertTrue(l1 == l2)
<|file_name|>article_server.py<|end_file_name|><|fim▁begin|># coding=utf-8 from __init__ import * from dao.dbArticle import SolutionArticle from dao.dbTag import Tag def generate_tags(data): tag_list = [] for tag in data: if tag == '': continue has_tag = Tag.query.filter(Tag.name ==...
def delete_by_id(sid): SolutionArticle.query.filter(SolutionArticle.id == sid).with_lockmode('update').delete() db.session.commit()
<|file_name|>ContactTest.java<|end_file_name|><|fim▁begin|>package fr.eurecom.senml.entity; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; import com.google.appengine.api.datastore.Key...
<|file_name|>0011_auto_20171114_1543.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10 on 2017-11-14 21:43 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('recipe', '0010_auto_20171114_1443...
<|file_name|>example_test.go<|end_file_name|><|fim▁begin|>package anydata_test import ( "bufio" "fmt" "strings" "github.com/pbnjay/anydata" ) // List matching lines from a species taxonomy inside a remote tarball.<|fim▁hole|> ftch, err := anydata.GetFetcher(taxNames) if err != nil { panic(err) } // downloa...
func Example_usage() { // get a Fetcher for names.dmp in the the NCBI Taxonomy tarball taxNames := "ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz#names.dmp"
<|file_name|>InvokersTest.java<|end_file_name|><|fim▁begin|>package net.distilledcode.httpclient.impl.metatype.reflection; import org.apache.http.client.config.RequestConfig; import org.junit.Test; import java.util.Map; import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.hasItem; i...
<|file_name|>EventNetLookup.java<|end_file_name|><|fim▁begin|>/* Copyright 2011 Anton Kraievoy akraievoy@gmail.com This file is part of Holonet. Holonet 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...
<|file_name|>TimeseriesShowController.js<|end_file_name|><|fim▁begin|>'use strict'; let TimeseriesShowController = function($scope, $controller, $timeout, NpolarApiSecurity, NpolarTranslate, npdcAppConfig, Timeseries, TimeseriesModel, TimeseriesCitation, google, Sparkline) { 'ngInject'; let ctrl = this; ...
<|file_name|>form_arrayrun.js<|end_file_name|><|fim▁begin|>if (typeof FormTarget === 'undefined') { FormTarget = {}; } FormTarget.arrayrun = (function($) { /* * Expected config { * isAdmin: boolean, * instruments: array * } */ return { getUserManualUrl: function() { return Urls.exte...
<|file_name|>test_pxe_service_catalogs.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import fauxfactory import pytest from widgetastic.utils import partial_match from cfme import test_requirements from cfme.infrastructure.provider import InfraProvider from cfme.infrastructure.provider.rhevm import RHEVMProvi...
pytestmark = [ pytest.mark.meta(server_roles="+automate"),
<|file_name|>merkletree.rs<|end_file_name|><|fim▁begin|>use errors::prelude::*; use services::ledger::merkletree::proof::{Lemma, Proof}; use services::ledger::merkletree::tree::{LeavesIntoIterator, LeavesIterator, Tree, TreeLeafData}; use utils::crypto::hash::{Hash, HASHBYTES}; /// A Merkle tree is a binary tree, with...
/// Returns the root hash of Merkle tree pub fn root_hash(&self) -> &Vec<u8> {
<|file_name|>read.go<|end_file_name|><|fim▁begin|>// Copyright 2017 ETH Zurich // // 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 // // Unl...
// Processing/parsing callback type type pktParser func() error
<|file_name|>publikacja.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ################################################ ## Aplikacja wspomagajaca tworzenie bazy publikacji naukowych wpsółpracujaca z Google Scholar ## Copyright (C) 2013 Damian Baran ## ## This program is free software: you can redis...
################################################### ## Metody
<|file_name|>weather.routes.ts<|end_file_name|><|fim▁begin|>import { Routes, RouterModule } from '@angular/router'; import { WeatherComponent } from './weather.component'; const routes: Routes = [ { path: '', component: WeatherComponent } ];<|fim▁hole|><|fim▁end|>
export const routing = RouterModule.forChild(routes);
<|file_name|>board.rs<|end_file_name|><|fim▁begin|>use std::process::Command; use common::*; use archive::Step; fn clear_screen() { let mut child = Command::new("clear").spawn().unwrap(); child.wait().unwrap(); } pub struct Board { points: Vec<Vec<StoneType>>, } impl Board { pub fn new() -> Board { ...
if x + inc < BOARD_SIZE && self.points[x+inc][y] == color { serial_count += 1; } else {
<|file_name|>DeviceStore.java<|end_file_name|><|fim▁begin|>/* * Copyright 2012-2013 eBay Software Foundation and ios-driver committers * * 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 * * ...
private final Set<String> uuidWhitelist;
<|file_name|>snapshots_client.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 #<|fim▁hole|># http://www.apache.org/licenses/LICENSE-2.0 # # U...
<|file_name|>prog13.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # programme qui demande un nombre et affiche les 10 triples successifs<|fim▁hole|>nombre = int(chaine) triple = nombre compteur=1 while(compteur<=10): triple=triple*3 print(triple) compteur=compteur+1<|fim▁end|>
chaine = input("donne un nombre : ")
<|file_name|>WeaponType.java<|end_file_name|><|fim▁begin|>package jpelc.learning.designpatterns.factorymethod; public enum WeaponType { SHORT_SWORD("short sword"), SPEAR("spear"), AXE("axe"), UNDEFINED(""); private String title; WeaponType(String title) { this.title = title; }<|fim▁hole|> ...
<|file_name|>save-case.component.ts<|end_file_name|><|fim▁begin|>import { ChangeDetectionStrategy, Component, HostBinding, Input, OnDestroy, OnInit } from '@angular/core'; import { animate, style, transition, trigger } from '@angular/animations'; import { select, Store } from '@ngrx/store'; import { ICasesState, select...
const animations: any[] = [
<|file_name|>email_template_preview.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 Sharoon Thomas # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp....
<|file_name|>test_trajectories.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function from nose.tools import assert_raises from nose.tools import assert_dict_equal fr...
[-9.253860446235523, 11.345550876585719, 22.118203258275745, 0.0]]
<|file_name|>MonteCarlo_ParticleState.cpp<|end_file_name|><|fim▁begin|>//---------------------------------------------------------------------------// //! //! \file MonteCarlo_ParticleState.cpp //! \author Alex Robinson //! \brief Basic particle state class definition. //! //-----------------------------------------...
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import logging logger = logging.getLogger("sikteeri.views") from django.conf import settings<|fim▁hole|>from django.template import RequestContext from django.utils.translation import ugettext_lazy as _ from sikteeri.version import VERSION d...
from django.shortcuts import render_to_response, redirect
<|file_name|>napalm_get_model.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ Ex 1. Construct a script that retrieves NAPALM facts from two IOS routers, two Arista switches, and one Junos device. pynet-rtr1 (Cisco IOS) 184.105.247.70 pynet-rtr2 (Cisco IOS) 184.105.247.71 pynet-sw1 (Arista EOS) 184.10...
from __future__ import unicode_literals
<|file_name|>pwf2.py<|end_file_name|><|fim▁begin|>import numpy as np from ase import Hartree from gpaw.aseinterface import GPAW from gpaw.lcao.overlap import NewTwoCenterIntegrals from gpaw.utilities import unpack from gpaw.utilities.tools import tri2full, lowdin from gpaw.lcao.tools import basis_subset2, get_bfi2 fro...
self.P_aqwi = calc.wfs.P_aqMi
<|file_name|>cookie.py<|end_file_name|><|fim▁begin|>import json from django.conf import settings from django.contrib.messages.storage.base import BaseStorage, Message from django.http import SimpleCookie from django.utils.crypto import salted_hmac, constant_time_compare from django.utils.safestring import SafeData, ma...
def _hash(self, value): """
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2 """ Plugins with amsn2 will be a subclass of the aMSNPlugin() class. When this module is initially imported it should load the plugins from the last session. Done in the init() proc. Then the GUI should call plugins.loadPlugin(name) or plugins...
<|file_name|>oauth_app.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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; eith...
from oauth2_provider.models import Application as OauthApplication from storageadmin.models import (OauthApp, User) from storageadmin.serializers import OauthAppSerializer
<|file_name|>testalchemy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from sqlalchemy import create_engine, and_, or_ from sqlalchemy.orm.session import sessionmaker from rts2.db import Targets,Grb Session = sessionmaker() engine = create_engine('postgresql://petr:petr@localhost/stars',echo='debug')<|fim▁hol...
<|file_name|>entities.js<|end_file_name|><|fim▁begin|>game.PlayerEntity = me.Entity.extend ({ //builds the player class init: function(x, y, settings){ this.setSuper(x, y); this.setPlayerTimer(); this.setAttributes(); this.type="PlayerEntity"; this.setFlags(); me.game.viewport.follow(this.pos, me.game.view...
if(xdif > 0){
<|file_name|>manager.py<|end_file_name|><|fim▁begin|># Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import logging import os import shutil from pants.backend.jvm.subsystems.scoverage_platform import ScoveragePlatform from pants.backen...
# We need to fingerprint this even though it nominally UI-only affecting option since the # presence of this option alone can implicitly flag on `--coverage`.
<|file_name|>event_bridge_test.py<|end_file_name|><|fim▁begin|># Bulletproof Arma Launcher # Copyright (C) 2016 Sascha Ebert # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This ...
<|file_name|>task_03.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """Module copies data module Variable DIRECTIONS""" from data import DIRECTIONS<|fim▁hole|><|fim▁end|>
DIRECTIONS = DIRECTIONS[0:3]+('West',)
<|file_name|>float_fast_math.rs<|end_file_name|><|fim▁begin|>#![feature(core_intrinsics)]<|fim▁hole|>#[inline(never)] pub fn test_operations(a: f64, b: f64) { // make sure they all map to the correct operation unsafe { assert_eq!(fadd_fast(a, b), a + b); assert_eq!(fsub_fast(a, b), a - b); ...
use std::intrinsics::{fadd_fast, fsub_fast, fmul_fast, fdiv_fast, frem_fast};
<|file_name|>featured_thumbnail.js<|end_file_name|><|fim▁begin|>function featured_thumb(){ jQuery('ul.thumbnails').each(function(index, element) { var get_class=jQuery(this).attr('class'); var get_parent=jQuery(this).closest('div'); var wt=jQuery(this).closest('div').width();//width total var col=jQuery(this)....
get_parent.find('ul.thumbnails li').css({'max-width':wa+'px','margin':mg+'px','padding':'0'}); get_parent.find('ul.thumbnails li h5').css({'font-size':ft_size+'px','font-weight':'bold','padding':'0 0 5px','margin':'0'}); get_parent.find('ul.thumbnails li img').css({'height':wa+'px','margin':'0'});
<|file_name|>0007_freebasicscontroller_postgres_db_url.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models <|fim▁hole|> dependencies = [ ('freebasics', '0006_change_site_url_field_type'), ] operations = [ ...
class Migration(migrations.Migration):
<|file_name|>angular-paginate.js<|end_file_name|><|fim▁begin|>/** * Angular Paginate * @homepage https://github.com/darthwade/angular-paginate * @author Vadym Petrychenko https://github.com/darthwade * @license The MIT License (http://www.opensource.org/licenses/mit-license.php) * @copyright 2014 Vadym Petrychenko...
provider.$get = function() { var wrapper = function(options) {
<|file_name|>chan_track.py<|end_file_name|><|fim▁begin|>""" Track channel ops for permissions checks Requires: server_info.py """ import gc import json import logging import weakref from collections import Mapping, Iterable, namedtuple from contextlib import suppress from numbers import Number from operator import att...
"""
<|file_name|>MysqlUserDetailsServiceTest.java<|end_file_name|><|fim▁begin|>package com.imrenagi.service_auth.service.security; import com.imrenagi.service_auth.AuthApplication; import com.imrenagi.service_auth.domain.User; import com.imrenagi.service_auth.repository.UserRepository; import org.junit.Before; import org....
userDetailsService.loadUserByUsername(anyString()); fail();
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import logging from requests_oauthlib import OAuth1Session from django.http import HttpResponse, HttpResponseRedirect from django.conf import settings from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response from .model...
@login_required def request_oauth_token(request): # We'll require a refresh in the blue dot cache if BLUE_DOT_CACHE_KEY in request.session:
<|file_name|>poz.py<|end_file_name|><|fim▁begin|>""" POZ Development Application. """ import numpy as np # import cv2 import pozutil as pu import test_util as tpu <|fim▁hole|> def perspective_test(_y, _z, _ele, _azi): print "--------------------------------------" print "Perspective Transform t...
<|file_name|>url.py<|end_file_name|><|fim▁begin|>import re from fir_artifacts.artifacts import AbstractArtifact class URL(AbstractArtifact): key = 'url' display_name = 'URLs' regex = r""" (?P<search> ((?P<scheme>[\w]{2,9}):\/\/)? ([\S]*\:[\S]*\@)? (?P<hostname>(<|fim...
<|file_name|>ITree.java<|end_file_name|><|fim▁begin|>package com.jwetherell.algorithms.data_structures.interfaces;<|fim▁hole|>/** * A tree can be defined recursively (locally) as a collection of nodes (starting at a root node), * where each node is a data structure consisting of a value, together with a list of node...
<|file_name|>test_openvswitch_port.py<|end_file_name|><|fim▁begin|>import pytest import salt.states.openvswitch_port as openvswitch_port from tests.support.mock import MagicMock, patch @pytest.fixture def configure_loader_modules(): return {openvswitch_port: {"__opts__": {"test": False}}} def test_present(): ...
"old": "No port named salt present.", }, },
<|file_name|>gists.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 <Jaume Devesa (jaumedevesa@gmail.com)> # # 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...
parser_fork.add_argument("gist_id", help=GIST_ID_MSG) parser_fork.add_argument("-u", "--user", help=USER_MSG) parser_fork.set_defaults(handle_args=handle_fork, func=fork,
<|file_name|>twitterapi.go<|end_file_name|><|fim▁begin|>package main import ( "bufio" "bytes" "encoding/json" "errors" "fmt" oauth "github.com/akrennmair/goauth" goconf "github.com/akrennmair/goconf" "io/ioutil" "log" "net/http" "strconv" "strings" "time" ) type Timeline struct { Tweets []*Tweet } type...
<|file_name|>0005_auto_20151119_2224.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations <|fim▁hole|> class Migration(migrations.Migration): dependencies = [ ('forum', '0004_topic_update_index_date'), ] database_...
<|file_name|>ManifestSource.ts<|end_file_name|><|fim▁begin|>export enum ManifestSource { TEXT = 'text',<|fim▁hole|><|fim▁end|>
ARTIFACT = 'artifact', }
<|file_name|>p421.cpp<|end_file_name|><|fim▁begin|>#include <iostream> #include <vector> using namespace std; typedef long long int64; #define FOR(i, a, b) for (int _end_ = (b), i = (a); i <= _end_; ++i) template <typename T> T gcd(T x, T y) { for (T t; x; t = x, x = y % x, y = t); return y; } int64 fpm(int64 b, ...
int y = 15 / g; int e = 1;
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from collections import OrderedDict from django import forms from django.conf import settings from django.db import transaction from django.utils.translation import ugettext_lazy as _ from oioioi.base.utils.input_with_generate import TextInputWithGenerate from oioioi....
self.initial.update({'file_name': ''})
<|file_name|>Communicator.cpp<|end_file_name|><|fim▁begin|>#include "synchronization/Communicator.hpp" namespace Synchronization { <|fim▁hole|> _numManagedFmus(0) { } size_type Synchronization::Communicator::addFmu(FMI::AbstractFmu* in, vector<FMI::InputMapping> & valuePacking) { ...
Communicator::Communicator() : _numManagedCons(0),
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse def hello_world(request):<|fim▁hole|><|fim▁end|>
return HttpResponse("Hello, world.")
<|file_name|>urdf_remove_pedestal.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2014-2015, Dataspeed Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the fo...
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
<|file_name|>netaddress.go<|end_file_name|><|fim▁begin|>package lnwire import ( "fmt" "net" "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/wire" ) // NetAddress represents information pertaining to the identity and network // reachability of a peer. Information stored includes the node's identity // ...
// Address is the IP address and port of the node. This is left
<|file_name|>sortedLastIndex.js<|end_file_name|><|fim▁begin|>var baseSortedIndex = require('./_baseSortedIndex'); /**<|fim▁hole|> * @static * @memberOf _ * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @returns {number} Returns the index at which `...
* This method is like `_.sortedIndex` except that it returns the highest * index at which `value` should be inserted into `array` in order to * maintain its sort order. *
<|file_name|>string-lit.rs<|end_file_name|><|fim▁begin|>// rustfmt-force_format_strings: true // Long string literals fn main() -> &'static str { let str = "AAAAAAAAAAAAAAaAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAaAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAa"; let str = "AAAAAAAAAAAAAAaAAAAAAAAAAAAAAAAAAAAAAAAA...
funktion("yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"); let unicode = "a̐éö̲\r\n";
<|file_name|>base.js<|end_file_name|><|fim▁begin|>var doNothing = function () {} /** * The `Base` log defines methods that transports will share. */ var Base = module.exports = function (config, defaults) { var cedar = require('../../cedar') // A log is a shorthand for `log.log`, among other things. var log...
Base.setMethods = function () {
<|file_name|>context.go<|end_file_name|><|fim▁begin|>package models import ( "koding/db/mongodb/modelhelper" "net" "socialapi/config"<|fim▁hole|> "github.com/koding/logging" ) // Client holds the contextual requester/client info type Client struct { // Account holds the requester info Account *Account // IP i...
"socialapi/request"
<|file_name|>UCMmap.java<|end_file_name|><|fim▁begin|>/** * <copyright> * </copyright> * * $Id$ */ package ucm.map; import core.COREModel; import org.eclipse.emf.common.util.EList; import urncore.IURNDiagram; import urncore.UCMmodelElement; /** * <!-- begin-user-doc --> * A representation of the model object ...
<|file_name|>mainForCommandline.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 <|fim▁hole|>import argparse import math<|fim▁end|>
import os, sygnal, sys
<|file_name|>trait-path-type-error-once-implemented.rs<|end_file_name|><|fim▁begin|>#![feature(generic_associated_types)]<|fim▁hole|>trait X { type Y<'a>; } const _: () = { fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {} //~^ ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments ...
<|file_name|>configuration.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # king_phisher/configuration.py # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of ...
""" def __init__(self, configuration_file, prefix=''): """
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// // George 'papanikge' Papanikolaou 2014-2018 // tail + head = tead // // This was originally written in an ancient form of rust. // Rewritten for rust 1.22. // extern crate getopts; use getopts::Options; // use extra::getopts::{optopt, optflag, getopts}; // renamed ...
// call tead here } else { println!("temp - lines: {}", lines);
<|file_name|>generic-derived-type.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.apach...
}
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>var fs = require('fs'); var path = require('path'); var gulp = require('gulp'); var sass = require('gulp-sass'); // Load all gulp plugins automatically // and attach them to the `plugins` object var plugins = require('gulp-load-plugins')(); // Temporary solution...
dot: true
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
__author__ = 'teresah'
<|file_name|>test.js<|end_file_name|><|fim▁begin|>'use strict' var test = require('tap').test var strip = require('./') test('stripFalsy', function(t) { t.plan(5) t.deepEqual(strip(null), {}) t.deepEqual(strip('test'), {}) t.deepEqual(strip(13), {}) t.deepEqual(strip(), {}) <|fim▁hole|> a: false , b: 0...
var input = {
<|file_name|>fpsmeter.min.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1<|fim▁hole|><|fim▁end|>
oid sha256:e1af4eb3952e50a1690c1d45f20c988b688e49f11938afc9f62e5384f71aaebb size 7470
<|file_name|>TemplatesModel.js<|end_file_name|><|fim▁begin|>Class('TemplatesModel', { views: { empty: { name: 'empty', label: 'Empty' }, ListView: { name: 'ListView', label: 'List View', subviews: ['ListItemView'] } }<|fim▁hole|><|fim▁end|>
});
<|file_name|>entities_to_cascades.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 nu from __future__ import (unicode_literals, absolute_import, division, print_function) import logging from django.core.management.base import BaseComman...
<|file_name|>scan-stills2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3 from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from sklearn.cluster import KMeans from sklearn import datasets from PIL import Image, ImageChops from scipy.spatial.distance...
straight_line = a - b if (straight_line < 1):
<|file_name|>trait-alias.rs<|end_file_name|><|fim▁begin|>// run-pass #![feature(trait_alias)] pub trait Foo {}<|fim▁hole|><|fim▁end|>
pub trait FooAlias = Foo; fn main() {}
<|file_name|>0003_auto_20160717_1943.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations <|fim▁hole|> dependencies = [ ('basicviz', '0002_auto_20160717_1939'), ] operations = [ migrations.AlterField( ...
class Migration(migrations.Migration):
<|file_name|>html-spec-reporter.ts<|end_file_name|><|fim▁begin|>import { Configuration } from "./configuration"; import { ConfigurationParser } from "./configuration-parser"; import { CustomReporterResult } from "./custom-reporter-result"; import { ExecutionDisplay } from "./execution-display"; import { ExecutionMetric...
<|file_name|>workerStatistics.d.ts<|end_file_name|><|fim▁begin|>/** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ import Page = require('../../../../../base/Page'); import Response = require('../../../../../http/response'); import V1 = require('../../.....
*/ toJSON(): any; }