prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>render.rs<|end_file_name|><|fim▁begin|>use std::any::Any; use viewport::Viewport; use { GenericEvent, RENDER }; /// Render arguments #[derive(Copy, Clone, PartialEq, Debug)] pub struct RenderArgs { /// Extrapolated time in seconds, used to do smooth animation. pub ext_dt: f64, /// The width o...
pub draw_width: u32,
<|file_name|>assign4.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import pwd for p in pwd.getpwall():<|fim▁hole|> print(p[0])<|fim▁end|>
if p.pw_shell.endswith('/bin/bash'):
<|file_name|>pagerun.js<|end_file_name|><|fim▁begin|>var pagerun = require('pagerun'); // set for debug // pagerun.modulesRoot = '../'; pagerun.mode = 'test'; // pagerun.loadNpmPlugin('httpresponse'); pagerun.loadNpmPlugin('httpsummary'); pagerun.loadNpmPlugin('httperror'); pagerun.loadNpmPlugin('htmlhint'); pagerun....
process.send(result);
<|file_name|>yaml.py<|end_file_name|><|fim▁begin|># (c) 2017, Brian Coca # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or<|fim▁ho...
<|file_name|>using-interfaces-and-generic-classes-for-services.feature.ts<|end_file_name|><|fim▁begin|>// std import { deepStrictEqual } from 'assert'; // 3p import * as request from 'supertest'; // FoalTS import { controller, createApp, Dependency, Get, HttpResponseOK, IAppController, ServiceManager } from '@foal/co...
});
<|file_name|>account_db.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity 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 ...
// You should have received a copy of the GNU General Public License // along with Parity. If not, see <http://www.gnu.org/licenses/>. //! DB backend wrapper for Account trie
<|file_name|>extract_and_upload_iris_classifier.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Load common imports and system envs to build the core object import sys, os # Load the Environment: os.environ["ENV_DEPLOYMENT_TYPE"] = "JustRedis" from src.common.inits_for_python import * #####################...
lg(upload_results["Error"], 6) lg("", 6)
<|file_name|>0066_auto_20150821_1131.py<|end_file_name|><|fim▁begin|><|fim▁hole|> from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('lizard_efcis', '0065_auto_20150818_1521'), ] operations = [ migrations.AlterField( model_name='...
# -*- coding: utf-8 -*- from __future__ import unicode_literals
<|file_name|>UIEvent.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2001 Peter Kelly (pmk@post.com) * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved. * * This libr...
const AtomicString& UIEvent::interfaceName() const { return EventNames::UIEvent;
<|file_name|>metadata_provider_anidb.py<|end_file_name|><|fim▁begin|>""" Copyright (C) 2015 Quinn D Granfor <spootdev@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. ...
async def com_net_anidb_save_title_data_to_db(self, title_file='./cache/anidb_titles.gz'): """
<|file_name|>trafficgraphwidget.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <qt/trafficgraphwidget.h> #include <interfaces/nod...
nLastBytesOut = clientModel->node().getTotalBytesSent(); }
<|file_name|>assetmanager.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Anthony Schmieder # Use of this source code is governed by the 2-clause BSD license that # can be found in the LICENSE.txt file. """Loads and manages art assets""" import pyglet import os _ASSET_PATHS = ["res"] _ASSET_FILE_NAMES = [ "...
<|file_name|>auth.d.ts<|end_file_name|><|fim▁begin|>/** * Credential is a generic exported credential. */ export declare type Credential = ServiceAccountKey | ExternalAccount; /** * ServiceAccountKeyCredential is an exported credential for a service account key. */ export declare type ServiceAccountKey = { type...
* base64-encoded. *
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>"""Shared pytest fixtures and test data.""" import copy import uuid import pytest from django.contrib.auth import get_user_model from onfido.models import Applicant, Check, Event, Report APPLICANT_ID = str(uuid.uuid4()) CHECK_ID = str(uuid.uuid4()) IDENTITY_REPOR...
"telephone_database": {"result": "clear", "properties": {}}, "voting_register": {"result": "clear", "properties": {}},
<|file_name|>segy.py<|end_file_name|><|fim▁begin|>"""segy.py - read and write SEG-Y files From command line: python segy.py <path-to-segy-file> """ from collections import OrderedDict from pprint import pprint import numpy as np from sacker import Sacker # SEG-Y spec: http://www.tritonimaginginc.com/site/conte...
h binary_gain_recovered h amplitude_recovery_method
<|file_name|>EventController.js<|end_file_name|><|fim▁begin|>angular .module('platoon.event', []) .controller('EventController', ['$scope', '$location', '$filter', function($scope, $location, $filter) { $scope.eventTypes = [{ label: 'Private', type: 'private' },{ label: 'Company',<|fim▁hole...
type: 'company' },{
<|file_name|>poster.py<|end_file_name|><|fim▁begin|>import simplejson as json import urllib import urllib2 import time server = "" def GET(uri, params): params = urllib.urlencode(params) req = urllib2.Request(server + uri + "?" + params , headers={'Accept': 'application/json'}) return json.loads(urllib2.u...
<|file_name|>Stepper.test.js<|end_file_name|><|fim▁begin|>import React from 'react' import { mount, shallow, render } from 'enzyme' import { Stepper } from './Stepper' import Step from './Stepper.Step' import { StepUI, StepperUI } from './Stepper.css' const mockSteps = [ { id: 'Id1', title: 'Test Title 1', ...
<Stepper onChange={onChangeSpy} steps={mockSteps} currentIndex={1} />
<|file_name|>fns.rs<|end_file_name|><|fim▁begin|>#[repr(C)] pub struct Fns { noArgs: fn(), anonymousArg: fn(i32), returnsNumber: fn() -> i32, namedArgs: fn(first: i32, snd: i16) -> i8, namedArgsWildcards: fn(_: i32, named: i16, _: i64) -> i8, } #[no_mangle]<|fim▁hole|>pub extern "C" fn no_return() -> ! { ...
pub extern "C" fn root(_fns: Fns) {} #[no_mangle]
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main import ( "flag" "io/ioutil" "log" "os" "os/signal" "strconv" "syscall" "code.cloudfoundry.org/cflager" "code.cloudfoundry.org/lager" "code.cloudfoundry.org/route-registrar/config" "code.cloudfoundry.org/route-registrar/healthchecker" "code.clo...
logger.Fatal(
<|file_name|>build.js<|end_file_name|><|fim▁begin|>(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(...
} /** * Create a dashed prefix
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate rustc_serialize; pub mod rep; pub use rep::{Context, Payload}; use std::io::{self, Read, Write}; use rustc_serialize::{Decodable, Encodable, json}; fn exec<E: Encodable, D: Decodable>( handler: fn(Context, Payload<D>) -> E ) { // } <|fim▁hole|>}<|f...
#[test] fn it_works() {
<|file_name|>GeofenceProxy.js<|end_file_name|><|fim▁begin|>module.exports = { initialize: function (success, fail, args, env) { GeofenceComponent.GeofenceTrigger.register(); success && success(); }, addOrUpdate: function (success, fail, args, env) { args.forEach(function (geo) { ...
geoN.radius = geo.radius; geoN.notificationText = geo.notification.text;
<|file_name|>etcd.rs<|end_file_name|><|fim▁begin|>extern crate serde; extern crate serde_json; extern crate hyper; extern crate openssl; use std::time::Duration; use std::thread; use hyper::Error; use hyper::status::StatusCode; use serde_json::Value; pub use common::etcd::SSLOptions; use common::etcd::etcd_https_cl...
if let Ok(response) = client.get(&health_url).send() { if response.status != StatusCode::Ok {
<|file_name|>routing.go<|end_file_name|><|fim▁begin|>package dht import ( "sync" context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context" key "github.com/ipfs/go-ipfs/blocks/key" notif "github.com/ipfs/go-ipfs/notifications" inet "github.com/ipfs/go-ipfs/p2p/net" peer "github.com/ipfs/go...
return pi, nil
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # zambiaureport documentation build configuration file, created by # sphinx-quickstart. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this #...
master_doc = 'index'
<|file_name|>en.js<|end_file_name|><|fim▁begin|>export default {<|fim▁hole|><|fim▁end|>
hello : "hello" };
<|file_name|>csrf_token_error_handler_urls.py<|end_file_name|><|fim▁begin|>urlpatterns = [] <|fim▁hole|><|fim▁end|>
handler404 = 'csrf_tests.views.csrf_token_error_handler'
<|file_name|>test_loading.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import unittest from test.basetestcases import PluginLoadingMixin class StatisticsLoadingTest (PluginLoadingMixin, unittest.TestCase): def getPluginDir(self): """ Должен возвращать путь до папки с тестируемым плаги...
def getPluginName(self): """ Должен возвращать имя плагина, по которому его можно
<|file_name|>chunker.go<|end_file_name|><|fim▁begin|>package golf import ( "errors" "io" "math" "github.com/google/uuid" ) <|fim▁hole|>} func newChunker(w io.Writer, chunkSize int) (*chunker, error) { if chunkSize < 13 { return nil, ErrChunkTooSmall } c := &chunker{ chunkSize: chunkSize, buff: mak...
type chunker struct { chunkSize int buff []byte w io.Writer
<|file_name|>tubular-highcharts-bundle.js<|end_file_name|><|fim▁begin|>/** * highcharts-ng * @version v0.0.13 - 2016-10-04 * @link https://github.com/pablojim/highcharts-ng * @author Barry Fitzgerald <> * @license MIT License, http://www.opensource.org/licenses/MIT */ if (typeof module !== 'undefined' && typeof ...
} else { chartSeries.setData(angular.copy(s.data), false); }
<|file_name|>Issue.java<|end_file_name|><|fim▁begin|>package edu.xored.tracker; <|fim▁hole|> import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; public class Issue { private String hash; private String summary; priva...
import com.fasterxml.jackson.annotation.JsonIgnore;
<|file_name|>fibonacci.rs<|end_file_name|><|fim▁begin|>use std::cmp; /// Returns a vector containing the fibonacci sequence, up to n numbers. fn fib(n: u32) -> Vec<u32> { let mut n2 = n; let mut f = vec![]; if n == 0 { return f; } while n2 > cmp::max(n-2, 0) { f.push(1); n...
f.push(a+b);
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!-*- coding:utf-8 -*- import time def retries(times=3, timeout=1): """对未捕获异常进行重试""" def decorator(func): def _wrapper(*args, **kw): att, retry = 0, 0 while retry < times: retry += 1 try: ...
if retry < times: time.sleep(att)
<|file_name|>source.hpp<|end_file_name|><|fim▁begin|>/****************************************************************************** * ____ _ _____ * * / ___| / \ | ___| C++ * * | | ...
void add_consumer(caf::actor consumer);
<|file_name|>metadata_tests.cpp<|end_file_name|><|fim▁begin|>/* * ****************************************************************************** * Copyright 2014-2016 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file e...
error = ds3_put_object_request(client, request, file, ds3_read_from_file); ds3_request_free(request);
<|file_name|>templates.js<|end_file_name|><|fim▁begin|>'use strict'; /** * @ngdoc function * @name freshcardUiApp.controller:TemplatesCtrl * @description * # TemplatesCtrl * Controller of the freshcardUiApp */ angular.module('freshcardUiApp') .controller('TemplatesCtrl', function ( $scope, $rootScope, $localS...
}, 5000 );
<|file_name|>DataUtils.java<|end_file_name|><|fim▁begin|>package org.buildmlearn.toolkit.flashcardtemplate.data; import org.w3c.dom.Document; import org.xml.sax.SAXException;<|fim▁hole|> import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurat...
import java.io.File; import java.io.IOException;
<|file_name|>test_issue_064.py<|end_file_name|><|fim▁begin|><|fim▁hole|> from nose.util import is_generator, isgenerator<|fim▁end|>
def test_is_generator_alias():
<|file_name|>RemoteJMXAttributes.java<|end_file_name|><|fim▁begin|>/* * Copyright 2015 Red Hat, Inc. and/or its affiliates * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License...
.addFlag(AttributeAccess.Flag.RESTART_RESOURCE_SERVICES) .build();
<|file_name|>ip.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/LIC...
1 => Some(Ipv6MulticastScope::InterfaceLocal), 2 => Some(Ipv6MulticastScope::LinkLocal),
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate rustc_serialize; use std::fs::File; use std::io::prelude::*; use rustc_serialize::hex::{FromHex, ToHex}; fn xor_hex_strings(str1: &str, str2: &str) -> Option<String> { if str1.len() != str2.len() { None } else { let bytes1 = str1.f...
let lines: Vec<&str> = content.lines().collect();
<|file_name|>post.js<|end_file_name|><|fim▁begin|>import React, { PureComponent } from "react"; import { graphql } from 'gatsby' import Link from "gatsby-link"; import path from "ramda/src/path"; import ScrollReveal from "scrollreveal"; import Layout from "../components/Layout"; import "prismjs/themes/prism.css"; impo...
<Layout> <header className="article-header">
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014, Fundacion Dr. Manuel Sadosky # 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 re...
# 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation
<|file_name|>IOrdersManager.java<|end_file_name|><|fim▁begin|>package com.senla.bolkunets.autoservice.api.managers; import java.util.Comparator; import java.util.Date; import java.util.List; import com.senla.bolkunets.autoservice.api.beans.IOrder; import com.senla.bolkunets.autoservice.api.enums.OrderStatus; public...
List<IOrder> getSortedListAllOrders(Comparator<IOrder> orderComparator);
<|file_name|>rate_limit_transport.go<|end_file_name|><|fim▁begin|>// Copyright 2016-2019 The Libsacloud 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.apach...
r.once.Do(func() { r.rateLimit = ratelimit.New(r.RateLimitPerSec)
<|file_name|>Connection.cpp<|end_file_name|><|fim▁begin|>/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/events/model/Connection.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json;...
<|file_name|>bitcoin_gl.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="gl" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About YEScoin</source> <translation type="unfinished"...
<|file_name|>upload-subtitle.py<|end_file_name|><|fim▁begin|>from builtins import str from builtins import object import httplib2 import MySQLdb import json import os import sys import time import config from apiclient.discovery import build from oauth2client.file import Storage from oauth2client.client import OAuth2W...
<|file_name|>MyViewportViewModel.js<|end_file_name|><|fim▁begin|>/* * File: app/view/MyViewportViewModel.js * * This file was generated by Sencha Architect version 3.1.0. * http://www.sencha.com/products/architect/ *<|fim▁hole|> * * This file will be auto-generated each and everytime you save your project. * * ...
* This file requires use of the Ext JS 5.0.x library, under independent license. * License of Sencha Architect does not include license for Ext JS 5.0.x. For more * details see http://www.sencha.com/license or contact license@sencha.com.
<|file_name|>pygenlib2.py<|end_file_name|><|fim▁begin|>import os, sys ########### def verbose_print(msg): print msg ########### def linetrim(s): return s.replace('\r', '').replace('\n','') ### def sublast(s, s2): return s[s.find(s2)+len(s2):] def parse_package(fpath): #p = fpath[:fpath.rfind('/')] p = fpath ...
f = open(fname, 'w')
<|file_name|>OrthographicCamera.js<|end_file_name|><|fim▁begin|>'use strict'; import { gl } from './Context'; import { mat4 } from 'gl-matrix'; import Camera from './Camera'; class OrthographicCamera extends Camera { constructor( { path, uniforms, background, translucence, ...
<|file_name|>main.js<|end_file_name|><|fim▁begin|><|fim▁hole|> * SPDX-License-Identifier: Apache-2.0 */ goog.provide('Main'); // Core // Either require 'Blockly.requires', or just the components you use: goog.require('Blockly'); goog.require('Blockly.geras.Renderer'); goog.require('Blockly.VerticalFlyout'); // Blocks...
/** * @license * Copyright 2019 Google LLC
<|file_name|>time.rs<|end_file_name|><|fim▁begin|>use std::marker::PhantomData;<|fim▁hole|> use chrono; use super::Module; use crate::{Color, Powerline, Style}; pub struct Time<S: TimeScheme> { time_format: &'static str, scheme: PhantomData<S>, } pub trait TimeScheme { const TIME_BG: Color; const TIM...
<|file_name|>schema-helper.js<|end_file_name|><|fim▁begin|>import Mirage from 'ember-cli-mirage'; import Schema from 'ember-cli-mirage/orm/schema'; import Model from 'ember-cli-mirage/orm/model'; import Db from 'ember-cli-mirage/db'; <|fim▁hole|> setup() { let db = new Db(); this.schema = new Schema(db); ...
export default {
<|file_name|>dft_pitch.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of AudioLazy, the signal processing Python package. # Copyright (C) 2012-2014 Danilo de Jesus da Silva Bellini # # AudioLazy is free software: you can redistribute it and/or modify # it under the ter...
# Window (Tk init), text label and button tk = tkinter.Tk() tk.title(__doc__.strip().splitlines()[0])
<|file_name|>ip.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 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/LIC...
impl fmt::Show for IpAddr {
<|file_name|>codegen.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2013-2015 Sandstorm Development Group, Inc. and contributors // Licensed under the MIT License: // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software")...
return Branch(vec!(Line(format!("pub fn get_{}(&self) -> {}::Pipeline {{",
<|file_name|>index.test.js<|end_file_name|><|fim▁begin|>'use strict'; const assert = require('assert'); const app = require('../../../src/app'); describe('authority service', function() {<|fim▁hole|> it('registered the authorities service', () => { assert.ok(app.service('authorities')); }); });<|fim▁end|>
<|file_name|>test_resampling.py<|end_file_name|><|fim▁begin|>import unittest import numpy as np from numpy.testing import assert_array_equal from dgw.evaluation.resampling import extend_point, shrink_to_a_single_point class TestExtending(unittest.TestCase): def test_extend_point(self): a = np.array([0, 1...
assert_array_equal(ans, shrink_to_a_single_point(a, 3, 4))
<|file_name|>actionendpoint.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Copyright 2015 Comcast Cable Communications Management, 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 # ...
<|file_name|>PublicMementoControl.java<|end_file_name|><|fim▁begin|>package controllers; import play.mvc.*; public class PublicMementoControl extends Controller { public static Result getRandomMemento(String lang) { /** @TODO */ return TODO; } public static Result getMemento(Long mid) { /** @TODO *...
}
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use std::fmt; use std::error::Error; use super::Rule; #[derive(Debug, PartialEq, Clone)] pub struct ParseError { pub line: usize, pub col: usize, pub expected: Vec<Rule>, } <|fim▁hole|>impl fmt::Display for ParseError { fn fmt(&self, f: &mut fmt::Form...
<|file_name|>protractor.conf.js<|end_file_name|><|fim▁begin|>var path = require('path'), HtmlReporter = require('protractor-html-screenshot-reporter'); exports.config = { chromeDriver: 'node_modules/chromedriver/bin/chromedriver', // seleniumAddress: 'http://localhost:4444/wd/hub', // Boolean. If true,...
return path.join(dateString, capabilities.caps_.browserName, descriptions.join('-')); } }));
<|file_name|>sparse.py<|end_file_name|><|fim▁begin|># Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache L...
dtype = src_array.dtype
<|file_name|>funcoes.js<|end_file_name|><|fim▁begin|>// Global Vars to set var musicas = new Array(11); musicas[0] = 0; // Wheel A musicas[1] = 0; // Whell B musicas[2] = "0;"; // A1 musicas[3] = "0;"; // A2 musicas[4] = "0;"; // A3 musicas[5] = "0;"; // A4 musicas[6] = "0;"; // B1 musicas[7] = "0;"...
$('body').queryLoader2( { onLoadComplete: ativa_anima() } );
<|file_name|>services.py<|end_file_name|><|fim▁begin|>from model.flyweight import Flyweight from model.static.database import database class Service(Flyweight): def __init__(self,service_id): #prevents reinitializing if "_inited" in self.__dict__: return self._inited = None<|fim...
#prevents reinitializing self.service_id = service_id
<|file_name|>flaskApp.py<|end_file_name|><|fim▁begin|>from flask import Flask, jsonify, request, render_template, make_response from datetime import datetime from elasticsearch import Elasticsearch<|fim▁hole|> @app.route('/') def hello_world(): return render_template( 'index.html' ) @app.route('/buscar...
es = Elasticsearch() app = Flask(__name__)
<|file_name|>HTMLTextAreaElement.js<|end_file_name|><|fim▁begin|>"use strict"; const conversions = require("webidl-conversions"); const utils = require("./utils.js"); const HTMLElement = require("./HTMLElement.js"); const impl = utils.implSymbol; function HTMLTextAreaElement() { throw new TypeError("Illegal constru...
for (let i = 0; i < module.exports.mixedInto.length; ++i) {
<|file_name|>vec.rs<|end_file_name|><|fim▁begin|>#[no_std]; #[no_core]; use zero; pub trait OwnedVector<T> { unsafe fn push_fast(&mut self, t: T); unsafe fn len(&self) -> uint; unsafe fn set_len(&mut self, newlen: uint); unsafe fn as_mut_buf<U>(&self, f: &fn(*mut T, uint) -> U) -> U; unsafe fn dat...
pub struct Vec<T> {
<|file_name|>lzw.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import sys stderr = sys.stderr ## LZWDecoder ## class LZWDecoder(object): debug = 0 def __init__(self, fp): self.fp = fp self.buff = 0 self.bpos = 8 self.nbits = 9 self.table = None self.prevbuf = None return ...
print >>stderr, ('nbits=%d, code=%d, output=%r, table=%r' %
<|file_name|>checker.py<|end_file_name|><|fim▁begin|># Create your views here. import socket from pyasn1.error import PyAsn1Error import requests from .heartbleed import test_heartbleed from .models import Check try: from OpenSSL.SSL import Error as SSLError except ImportError: # In development, we might not h...
admin_found = '"id_username"' in data and ("csrfmiddlewaretoken" in data or "Django" in data or "__admin_media_prefix__" in data) return (admin_found, self._response_used_https(response))
<|file_name|>step3.rs<|end_file_name|><|fim▁begin|>extern crate lisp; mod eval; use lisp::eval::env; use lisp::util::interner::Interner; #[test] fn env() { let ref mut interner = Interner::new(); let ref mut env = env::default(interner); eval::eq("(+ 1 2)", "3", env, interner); eval::eq("(/ (- (+ 5 ...
eval::eq("(def! x 4)", "4", env, interner); eval::eq("(let* (z 9) z)", "9", env, interner); eval::eq("(let* (x 9) x)", "9", env, interner);
<|file_name|>dynamicQueriesRule.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Replacement, RuleFailure, Rules} from 'tslint...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate syn; #[macro_use] extern crate quote; extern crate proc_macro; use proc_macro::TokenStream; use std::iter; use syn::*; use quote::Tokens; struct Context { location_ident: Ident, location_expr: Expr, location_type: Ty, deref_self_expr: Exp...
ty.bounds.push(bound.clone());
<|file_name|>cards.py<|end_file_name|><|fim▁begin|>import functools from . import ( constants, utils, ) class Card(): def __init__(self, kind=None, strength=None, value=None, verbose=None, **kwargs): if kind is None: raise(TypeError("Missing required 'kind' argument.")) sel...
def __str__(self):
<|file_name|>mouse-dragdrop-cursor.component.ts<|end_file_name|><|fim▁begin|>/* * @license * Copyright Hôpitaux Universitaires de Genève. All Rights Reserved. * * Use of this source code is governed by an Apache-2.0 license that can be * found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components...
<|file_name|>serialization.py<|end_file_name|><|fim▁begin|>from __future__ import division, print_function import json from collections import Iterable, OrderedDict, namedtuple import numpy as np from six import string_types def isnamedtuple(obj): """Heuristic check if an object is a namedtuple.""" return i...
def serialize(data): if data is None or isinstance(data, (bool, int, float, str, string_types)): return data
<|file_name|>asymmetric.spec.js<|end_file_name|><|fim▁begin|>var axios = require("axios"); var expect = require("chai").expect; var MockAdapter = require("../src"); describe("MockAdapter asymmetric matchers", function () { var instance; var mock; beforeEach(function () { instance = axios.create(); mock...
});
<|file_name|>cluster.py<|end_file_name|><|fim▁begin|>""" Run on cluster """ import argparse import os import itertools import networkx as nx import pandas as pd from . import compare_cases def generate_run(graph, iterations, epsilon_control, epsilon_damage, out_dir, nodes=None, mem=6000, runtime=...
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from couchpotato.core.downloaders.base import Downloader, StatusList from couchpotato.core.helpers.encoding import tryUrlencode, ss from couchpotato.core.helpers.variable import cleanHost, mergeDicts from couchpotato.core.logger import CPLog from couchpotato.environment...
'timeleft': item['timeleft'] if not queue['paused'] else -1,
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity 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...
<|file_name|>testcases.js<|end_file_name|><|fim▁begin|>"use strict"; /* global describe it before */ const { assert } = require("chai"); const Database = require("./lib/database"); const testcases = (env) => { describe("Basic operations", () => { before(async () => { await Database.start(); ...
<|file_name|>ckeyboard.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ This file is part of coffeedatabase. coffeedatabase 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 ...
# Find Id in pricesF for rowId in pricesF: if rowId[0] == row[0]:
<|file_name|>Vector4.js<|end_file_name|><|fim▁begin|>/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2019 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ // Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji // and [vecmath](h...
<|file_name|>dbscanplot.py<|end_file_name|><|fim▁begin|>import requests import time import dblayer from sklearn.cluster import DBSCAN import plotly<|fim▁hole|>import plotly.graph_objs as go import pandas as pd import numpy as np import random import testfile # Create random colors in list color_list = [] def genera...
<|file_name|>resourcetiming-decompression.js<|end_file_name|><|fim▁begin|>// // resourcetiming-decompression.js // // Decompresses ResourceTiming data compressed via resourcetiming-compression.js. // // See http://nicj.net/compressing-resourcetiming/ // // https://github.com/nicjansma/resourcetiming-compression.js // (...
<|file_name|>query_list.ts<|end_file_name|><|fim▁begin|>import {ListWrapper, MapWrapper} from 'angular2/src/facade/collection'; import {getSymbolIterator} from 'angular2/src/facade/lang'; import {Observable, EventEmitter} from 'angular2/src/facade/async'; /** * An unmodifiable list of items that Angular keeps up to ...
/** * @internal */ reset(res: T[]): void { this._results = res; }
<|file_name|>VelocityDriver.java<|end_file_name|><|fim▁begin|>package io.github.dantesun.petclinic.data.velocity; <|fim▁hole|>import org.apache.ibatis.mapping.BoundSql; import org.apache.ibatis.mapping.MappedStatement; import org.apache.ibatis.mapping.SqlSource; import org.apache.ibatis.parsing.XNode; import org.apache...
import org.apache.ibatis.executor.parameter.ParameterHandler;
<|file_name|>bitboard.rs<|end_file_name|><|fim▁begin|>// use std::num::Int; pub type Bitboard = u32; pub trait BitMove { fn up_left(&self) -> Self; fn up_right(&self) -> Self; fn down_left(&self) -> Self; fn down_right(&self) -> Self; fn is(&self) -> bool; } pub const S: [Bitboard; 32] = [ ...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># # adapters/tensorflow/imagenet/__init__.py - a service adapter for the tensorflow ImageNet pre-trained graph # # Copyright (c) 2018 SingularityNET # # Distributed under the MIT software license, see LICENSE file. # import base64 import logging import os from path...
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>// Karma configuration // http://karma-runner.github.io/0.12/config/configuration-file.html // Generated on 2015-05-11 using // generator-karma 0.8.3 module.exports = function(config) { 'use strict'; config.set({ // enable / disable watching file and exe...
// Start these browsers, currently available: // - Chrome
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Execute the tests for bs_tools. The golden test outputs are generated by the script generate_outputs.sh. You have to give the root paths to the source and the binaries as arguments to the program. These are the paths to the directory tha...
program=path_to_casbar,
<|file_name|>axum.rs<|end_file_name|><|fim▁begin|>use axum::{ body::{boxed, Full}, handler::Handler, http::{header, StatusCode, Uri}, response::{Html, IntoResponse, Response}, routing::{get, Router}, }; use mime_guess; use rust_embed::RustEmbed; use std::net::SocketAddr; #[tokio::main] async fn main() { //...
match Asset::get(path.as_str()) { Some(content) => { let body = boxed(Full::from(content.data));
<|file_name|>sqrt.rs<|end_file_name|><|fim▁begin|>use {Style, Sign, Float}; impl Float { pub fn sqrt(mut self) -> Float { self.debug_assert_valid(); let prec = self.prec; match self.style { Style::NaN => Float::nan(prec), Style::Infinity => { match s...
signif: sqrt, style: Style::Normal,
<|file_name|>progressLinear.js<|end_file_name|><|fim▁begin|>/*! * Angular Material Design * https://github.com/angular/material * @license MIT * v1.1.0-rc3-master-30e6657 */ (function( window, angular, undefined ){ "use strict"; /** * @ngdoc module * @name material.components.progressLinear * @description Line...
} function postLink(scope, element, attr) {
<|file_name|>connections.py<|end_file_name|><|fim▁begin|>""" This module implements connections for MySQLdb. Presently there is only one class: Connection. Others are unlikely. However, you might want to make your own subclasses. In most cases, you will probably override Connection.default_cursor with a non-stand...
<|file_name|>frontend.py<|end_file_name|><|fim▁begin|># -*-Python-*- ################################################################################ # # File: frontend.py # RCS: $Header: $ # Description: frontend: # responsibility: # init backend # init proce...
# (c) Copyright 2013, Staal Vinterbo, all rights reserved.
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # agile-analytics documentation build configuration file, created by # sphinx-quickstart on Fri Jun 17 13:58:53 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configurat...
# serve to show the default.
<|file_name|>marker_selection_test.js<|end_file_name|><|fim▁begin|>jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 50; // 50 seconds describe('marker_selection_test', function () { it('all_aml', function (done) { var dataset; var referenceDataset; var promises = []; promises.push(morpheus.DatasetUtil.read('...
Promise.all(promises).then(function () { var project = new morpheus.Project(dataset);