prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>connectionService.js<|end_file_name|><|fim▁begin|>/*! * speedt * Copyright(c) 2015 speedt <13837186852@qq.com> * BSD 3 Licensed */ 'use strict'; var utils = require('speedt-utils'); var Service = function(app){ var self = this; // TODO self.serverId = app.getServerId(); self.connCount = 0; self....
<|file_name|>debug_view_handler.py<|end_file_name|><|fim▁begin|># Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Request handler to display the debug view for a Failure.""" import jinja2 import os impor...
def _ImagePath(url): return '/image?file_path=%s' % url data['expected'] = _ImagePath(expected_path)
<|file_name|>test_dg_input_advection.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import input_name = '../examples/dg/advection_2D.py' output_name = 'advection_sol.msh' from tests_basic import TestInput class Test( TestInput ):<|fim▁hole|><|fim▁end|>
pass
<|file_name|>clean.py<|end_file_name|><|fim▁begin|>from gitcd.interface.cli.abstract import BaseCommand from gitcd.git.branch import Branch from gitcd.app.clean import Clean as CleanHelper class Clean(BaseCommand): updateRemote = True def run(self, branch: Branch): helper = CleanHelper() ...
for branchToDelete in branchesToDelete:
<|file_name|>EntityEvokerPet.java<|end_file_name|><|fim▁begin|>/* * This file is part of EchoPet. * * EchoPet 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 * (at you...
} public EntityEvokerPet(World world){
<|file_name|>sse_spider.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- __author__ = 'tyler' import urllib2 import scrapy from scrapy import log import demjson '''class AutoSpider(scrapy.Spider): name = "sse" allowed_domains = ["query.sse.com.cn"] preurl='http://data.eastmoney.com/stock';...
rdep = re.compile(ur'\s+\(\d\)') rout=re.compile(ur'^\s?$') for tmp in loop: print tmp
<|file_name|>PasteSites.py<|end_file_name|><|fim▁begin|># Copright (C) 2015 Eric Skoglund # # 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 2 of the License, or # (at your option)...
import sys class NotSupported(Exception): def __init__(self, value):
<|file_name|>xrm.d.ts<|end_file_name|><|fim▁begin|>declare namespace Xrm { interface EntityDefinition { EntitySetName: string; } namespace Attributes { interface LookupAttribute { getLookupTypes(): LookupValue[]; } } namespace Controls { interface Control { getAttribute(): Xrm.Att...
Internal: XrmInternal; }
<|file_name|>SnapshotUtils.java<|end_file_name|><|fim▁begin|>/* * Copyright 2019 Frederic Thevenet * * 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.ap...
<|file_name|>mathsquiz-step2.py<|end_file_name|><|fim▁begin|># this function will print a welcome message to the user def welcome_message(): print("Hello! I'm going to ask you 10 maths questions.") print("Let's see how many you can get right!") # this function will ask a maths question and return the points aw...
# display welcome message
<|file_name|>knn_binary.py<|end_file_name|><|fim▁begin|>""" kNN digit classifier, converting images to binary before training and classification. Should (or should allow for) reduction in kNN object size. """ <|fim▁hole|>from utils import classifier as cs from utils import knn from utils import mnist class Kn...
import cv2
<|file_name|>jquery-ui.searchflyout.js<|end_file_name|><|fim▁begin|>/*global console: false, creatis_carpenterStorage_replaceContentFromStorage: false */ $(function () { function initDesktop() { $("#accordion").accordion({ collapsible: true, active: localStorage.selectedCarpenter ...
$('#div_text').css('display', 'none');
<|file_name|>20160603120209_c9218e757bc_rename_admin_role_from_ggrc_admin_to_.py<|end_file_name|><|fim▁begin|># Copyright (C) 2017 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """ Rename admin role from gGRC Admin to Administra...
)
<|file_name|>0038_merge.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-03-22 14:09 from __future__ import unicode_literals from django.db import migrations <|fim▁hole|>class Migration(migrations.Migration): dependencies = [ ('eighth', '0036_eighthscheduledacti...
<|file_name|>fox_and_snake.py<|end_file_name|><|fim▁begin|>a, b = map(int,raw_input().split()) i=0 while(i<a): j=0 c=[] if(i%2==0): while(j<b): c.append('#') j=j+1 print (''.join(c)) else: k = int(i/2) if (k%2==0): while(j<(b-1)): c.append(".")<|fim▁hole|> else: c.append('#') while(j<(b-...
j=j+1 c.append("#") print (''.join(c))
<|file_name|>test_callisto.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Author: Florian Mayer <florian.mayer@bitsrc.org> from __future__ import absolute_import import shutil from tempfile import mkdtemp from datetime import datetime import pytest import os import glob import numpy as np from numpy.testi...
<|file_name|>ReloadingClassLoader.java<|end_file_name|><|fim▁begin|>/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to Yo...
* the listener to notify upon class change
<|file_name|>interface.go<|end_file_name|><|fim▁begin|>/* Copyright 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 Unless re...
<|file_name|>pr7.js<|end_file_name|><|fim▁begin|>function isPrime(n) { if (n === 2) { return true; } if (n % 2 === 0 || n === 1) { return false; } for (var i = 3; i <= Math.sqrt(n); i += 2) { if (n % i === 0) { return false; } } return true; } function nthPri...
return i; }
<|file_name|>databases.py<|end_file_name|><|fim▁begin|>from troveclient import base from troveclient.common import check_for_exceptions from troveclient.common import limit_url from troveclient.common import Paginated import urlparse class Database(base.Resource): """ According to Wikipedia, "A database is a ...
def create(self, instance_id, databases):
<|file_name|>graph.ts<|end_file_name|><|fim▁begin|>import Vue from 'vue'; import * as Chart from 'chart.js'; import { Component, Prop, Watch } from 'vue-property-decorator'; import { date } from '../../vue/filters/date'; import { ThemeState, ThemeStore } from '../theme/theme.store'; // Try to match site styling. cons...
this.data.labels.push(date(row[0], 'MMM DD')); } dataset.data.push(row[1]);
<|file_name|>cloudformation.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "cloudformation")] extern crate rusoto_core; extern crate rusoto_cloudformation; use rusoto_cloudformation::{CloudFormation, CloudFormationClient, ListStacksInput}; use rusoto_core::Region; #[test] fn should_list_stacks() {<|fim▁hole|> l...
let client = CloudFormationClient::new(Region::UsEast1);
<|file_name|>p2p_fingerprint.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2017-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test various fingerprinting protections. ...
node.send_message(msg) # Send a getheaders request for a given single block hash def send_header_request(self, block_hash, node):
<|file_name|>GabLoggingLayer.js<|end_file_name|><|fim▁begin|><|fim▁hole|> * * @return LoggingLayer class (extends CartoDBLayerClass) */ define(['abstract/layer/CartoDBLayerClass'], function(CartoDBLayerClass) { 'use strict'; var GabLoggingLayer = CartoDBLayerClass.extend({ options: { sql: "SELE...
/** * The Logging layer module.
<|file_name|>placessidebar.rs<|end_file_name|><|fim▁begin|>// This file is part of rgtk. // // rgtk is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your opti...
ffi::to_gboolean(show_connect_to_server)) } }
<|file_name|>models.py<|end_file_name|><|fim▁begin|>#encoding=utf-8 """ 26. Invalid models This example exists purely to point out errors in models. """ from __future__ import unicode_literals from django.db import connection, models class FieldErrors(models.Model): charfield = models.CharField() charfield...
class UnicodeForeignKeys(models.Model): """Foreign keys which can translate to ascii should be OK, but fail if they're not.""" good = models.ForeignKey('FKTarget')
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![feature(iter_arith)] #[macro_use] extern crate libeuler; // Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over // five-thousand first names, begin by sorting it into alphabetical order. Then working out the // alphabetical va...
// // For example, when the list is sorted into alphabetical order, COLIN, which is worth 3 + 15 + 12 // + 9 + 14 = 53, is the 938th name in the list. So, COLIN would obtain a score of 938 × 53 = // 49714.
<|file_name|>test_logger.py<|end_file_name|><|fim▁begin|>from io import StringIO from coaster.logger import RepeatValueIndicator, filtered_value, pprint_with_indent def test_filtered_value(): """Test for filtered values.""" # Doesn't touch normal key/value pairs assert filtered_value('normal', 'value') =...
<|file_name|>decoder.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/li...
let explicit_self_doc = reader::get_doc(item, tag_item_trait_method_explicit_self);
<|file_name|>keyword_plan_campaign_error.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go. DO NOT EDIT. // source: google/ads/googleads/v1/errors/keyword_plan_campaign_error.proto package errors // import "google.golang.org/genproto/googleapis/ads/googleads/v1/errors" import proto "github.com/gol...
var _ = proto.Marshal
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- # Copyright 2009-2019 Rumma & Ko Ltd # License: GNU Affero General Public License v3 (see file COPYING for details) from django.conf import settings from django.utils.encoding import force_str from django.db import models from django.utils.tr...
alert=_("Success"))
<|file_name|>bitcoin_te.ts<|end_file_name|><|fim▁begin|><TS language="te" version="2.1"> <context> <name>AddressBookPage</name> <message> <source>Right-click to edit address or label</source> <translation>చిరునామా లేదా లేబుల్ సవరించడానికి రైట్-క్లిక్ చేయండి</translation> </message> <mess...
</context> <context> <name>AskPassphraseDialog</name>
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>##################################################################################### # # Copyright (C) Tavendo GmbH # # Unless a separate license agreement exists between you and Tavendo GmbH (e.g. you # have purchased a commercial license), the license terms be...
#####################################################################################
<|file_name|>SourceCodeResource.java<|end_file_name|><|fim▁begin|>/** * jetbrick-template * http://subchen.github.io/jetbrick-template/ * * Copyright 2010-2014 Guoqiang Chen. All rights reserved. * Email: subchen@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use thi...
* You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0
<|file_name|>0012_auto_20160212_1210.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('characters', '0011_auto_20160212_1144'), ] operations = [ ...
model_name='spellinfo', name='parent',
<|file_name|>server.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap; use std::cmp::max; use iron::{Iron, Chain}; use router::Router; use persistent::State; use chrono::{Duration, NaiveDate, NaiveDateTime}; use serde_json::builder::ObjectBuilder; use serde_json::Value; use serde; use SERVER_ADDRESS; use ...
router.get("/info", Info::handler); router.post("/data", Data::handler);
<|file_name|>MergeBU.java<|end_file_name|><|fim▁begin|>package com.algorithms.sorting; public class MergeBU { public static void sort(Comparable[] a) { Comparable[] aux = new Comparable[a.length]; int N = a.length; for (int size = 1; size < N; size = size*2) { for (int i = 0;...
assert isSorted(a, lo, mid); assert isSorted(a, mid+1, hi); for (int i = lo; i < hi; i++) aux[i] = a[i];
<|file_name|>partner.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # # Author: Nicolas Bessi. Copyright Camptocamp SA # Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com> # Ignacio Ibeas <ignacio@acysos.com> # Alejandro Santana <alejandrosantana@anubia.es>...
<|file_name|>as_unsigned.rs<|end_file_name|><|fim▁begin|>#![feature(core)] extern crate core; #[cfg(test)] mod tests { use core::slice::IntSliceExt; // pub trait IntSliceExt<U, S> { // /// Converts the slice to an immutable slice of unsigned integers with the same width. // fn as_unsigned<'a>(...
// } // macro_rules! impl_int_slice {
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|>""" drslib exceptions<|fim▁hole|> """ class TranslationError(Exception): pass<|fim▁end|>
<|file_name|>clean-page.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export function navigate(args) { frame.topmost().goBack(); }<|fim▁end|>
import * as frame from '@nativescript/core/ui/frame';
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>// #docregion import { Component } from '@angular/core';<|fim▁hole|> @Component({ selector: 'my-app', template: ` <router-outlet></router-outlet> <div ng-view></div> `, }) export class AppComponent { }<|fim▁end|>
<|file_name|>route.py<|end_file_name|><|fim▁begin|>import numpy as np from definition import states_by_id import pyproj as prj class Route: """ A class of Breeding Bird Survey (BBS) route Each Route includes the following members: id - id number of the route name - name of the rout...
i = i + 1 self.path2 = self.to_lonlat(self.path)
<|file_name|>house.py<|end_file_name|><|fim▁begin|>parts = (('house', 'Jack built'), ('malt', 'lay in'), ('rat', 'ate'), ('cat', 'killed'), ('dog', 'worried'), ('cow with the crumpled horn', 'tossed'), ('maiden all forlorn', 'milked'...
return '{}\nthat {}'.format(parts[n][0],parts[n][1]) if n != 0 else '{} that {}'.format(parts[n][0],parts[n][1]) def rhymes(v = 11): if v == 0:
<|file_name|>to_limbs.rs<|end_file_name|><|fim▁begin|>use itertools::Itertools; use malachite_base::num::basic::traits::Zero; use malachite_base::num::conversion::traits::ExactFrom; use malachite_base_test_util::generators::unsigned_gen_var_5; use malachite_nz::natural::Natural; use malachite_nz_test_util::generators::...
let limb_count = usize::exact_from(n.limb_count()); assert_eq!(n.limbs().size_hint(), (limb_count, Some(limb_count))); });
<|file_name|>ResourceManagerTest.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...
@Test public void testResourceManager() { DMRResourceType type = new DMRResourceType(new ID("resType"), new Name("resTypeName"));
<|file_name|>compress_fragment_two_pass.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)] use super::backward_references::kHashMul32; //use super::super::alloc::{SliceWrapper, SliceWrapperMut}; use super::bit_cost::BitsEntropy; use super::brotli_bit_stream::{BrotliBuildAndStoreHuffmanTreeFast, BrotliStoreHuffmanTree...
prev_hash = HashBytesAtOffset(input_bytes, 0i32, shift, min_match); table[(prev_hash as (usize))] = ip_index.wrapping_sub(3usize) as (i32); prev_hash = HashBytesAtOffset(input_bytes, 1i32, shift, min_match); table[(prev_hash as (usize))] = ip_index.wrapping_sub(2u...
<|file_name|>OptRuntime.java<|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 org.mozilla.javascript.optimizer; import org.m...
<|file_name|>words.service.spec.ts<|end_file_name|><|fim▁begin|>import { inject, TestBed } from '@angular/core/testing'; import { Component } from '@angular/core'; import { BaseRequestOptions, ConnectionBackend, Http<|fim▁hole|>} from '@angular/http'; import { MockBackend } from '@angular/http/testing'; impo...
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use std::error::Error as StdError; use std::string; use std::{fmt, io}; /// The errors that can arise while parsing a JSON stream. #[derive(Clone, Copy, PartialEq)] pub enum ErrorCode { InvalidSyntax, InvalidNumber, EOFWhileParsingObject, EOFWhileParsi...
<|file_name|>test_scripts.py<|end_file_name|><|fim▁begin|>""" Test plugin views. """<|fim▁hole|>from django.utils import simplejson as json from django.conf import settings from django.test.client import Client from django.contrib.auth.models import User from ocradmin.core.tests import testutils from nodetree import s...
import os import glob from django.test import TestCase
<|file_name|>from-email-address.js<|end_file_name|><|fim▁begin|>Fox.define('views/email/fields/from-email-address', 'views/fields/link', function (Dep) {<|fim▁hole|> listTemplate: 'email/fields/from-email-address/detail', detailTemplate: 'email/fields/from-email-address/detail', }); });<|fim▁end|...
return Dep.extend({
<|file_name|>threeSum2.cpp<|end_file_name|><|fim▁begin|>// Time Complexity: O(n^2) // Space Complexity: O(1) class Solution { public: vector<vector<int> > threeSum(vector<int> &num) { vector<vector<int> > ans; const int target = 0; sort(num.begin(), num.end()); ...
--c;
<|file_name|>PathCommand.java<|end_file_name|><|fim▁begin|>package seedu.jobs.logic.commands; import java.io.IOException; import com.google.common.eventbus.Subscribe; import seedu.jobs.commons.core.EventsCenter; import seedu.jobs.commons.events.storage.SavePathChangedEventException; /* Change save path */ //@@auth...
<|file_name|>p3_backward_test.py<|end_file_name|><|fim▁begin|>import unittest from stomp import backward3 class TestBackward3(unittest.TestCase): def test_pack_mixed_string_and_bytes(self): lines = ['SEND', '\n', 'header1:test', '\u6771'] self.assertEqual(backward3.encode(backward3.pack(l...
def test_encode(self):
<|file_name|>VariantShortcuts.hpp<|end_file_name|><|fim▁begin|>// ArduinoJson - arduinojson.org // Copyright Benoit Blanchon 2014-2019 // MIT License #pragma once #include "../Array/ArrayShortcuts.hpp" #include "../Object/ObjectShortcuts.hpp" namespace ARDUINOJSON_NAMESPACE { <|fim▁hole|> pub...
template <typename TVariant> class VariantShortcuts : public ObjectShortcuts<TVariant>,
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/* <|fim▁hole|> */ if(OS_IOS){ // NappSlideMenu var NappSlideMenu = require('dk.napp.slidemenu'); var drawerIphone = NappSlideMenu.createSlideMenuWindow({ centerWindow: $.navWindow, leftWindow: Alloy.createController('menu').getView(), leftLedge: 50 }); //...
------ IOS ------
<|file_name|>invalid.go<|end_file_name|><|fim▁begin|><|fim▁hole|>import "vend/x/invalid/vendor/foo"<|fim▁end|>
package invalid
<|file_name|>eventtarget.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::callback::CallbackContainer; use dom::...
_ => false, }
<|file_name|>hp_procurve_ssh.py<|end_file_name|><|fim▁begin|>from __future__ import print_function from __future__ import unicode_literals import re import time import socket from netmiko.cisco_base_connection import CiscoSSHConnection class HPProcurveSSH(CiscoSSHConnection): def session_preparation(self): ...
def cleanup(self):
<|file_name|>RKeyListener.java<|end_file_name|><|fim▁begin|>package org.rosuda.deducer.widgets.event; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; public class RKeyListener extends RListener implements KeyListener{ public void keyPressed(KeyEvent arg0) { eventOccured(arg0,"keyPressed"); } ...
public void keyTyped(KeyEvent arg0) {
<|file_name|>Viewer.cpp<|end_file_name|><|fim▁begin|>#include "Viewer.h" #include "Scene_draw_interface.h" Viewer::Viewer(QWidget* parent, bool antialiasing) : QGLViewer(parent), scene(0), antialiasing(antialiasing), twosides(false), m_isInitialized(false) { setBackgroundColor(::Qt::white); } void...
{
<|file_name|>properties_extra.py<|end_file_name|><|fim▁begin|>''' Ohm's law is a simple equation describing electrical circuits. It states that the voltage V through a resistor is equal to the current (I) times the resistance: V = I * R The units of these are volts, ampheres (or "amps"), and ohms, respectively. In re...
Also, we've made a design decision that a Resistor cannot change its resistance value once created:
<|file_name|>e405.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, Di...
filename='/data/dk3810/ukdale.h5', appliances=[ ['fridge freezer', 'fridge', 'freezer'], 'hair straighteners',
<|file_name|>index.spec.js<|end_file_name|><|fim▁begin|>import HomeRoute from 'routes/Home'; describe('(Route) Home', () => { let _component; beforeEach(() => { _component = HomeRoute.component(); }); it('Should return a route configuration object', () => { expect(typeof HomeRoute).to...
<|file_name|>BlockEvent.java<|end_file_name|><|fim▁begin|>package com.skcraft.plume.event.block; import com.google.common.base.Functions; import com.google.common.base.Predicate; import com.skcraft.plume.event.BulkEvent; import com.skcraft.plume.event.Cause; import com.skcraft.plume.event.DelegateEvent; import com.skc...
}
<|file_name|>fake_infortrend_nas_data.py<|end_file_name|><|fim▁begin|># Copyright (c) 2019 Infortrend Technology, 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 Lic...
<|file_name|>all.rs<|end_file_name|><|fim▁begin|>#![deny(warnings)] #![feature(io, path_ext, convert)] extern crate cargo_registry; extern crate conduit_middleware; extern crate conduit_test; extern crate rustc_serialize; extern crate conduit; extern crate curl; extern crate git2; extern crate time; extern crate url; ...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import os import re from django.conf import global_settings, settings from django.contrib.sites.models import Site, RequestSite from django.contrib.auth.models import User from django.core import mail from django.core.exceptions import SuspiciousOperation from django....
self.assertEqual(response.status_code, 302) self.assertTrue(good_url in response['Location'],
<|file_name|>bokwcs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env/python import sys import argparse from bokpipe.bokastrom import scamp_solve parser = argparse.ArgumentParser() parser.add_argument("image",type=str, help="input FITS image") parser.add_argument("catalog",type=str, ...
help="single pass") args = parser.parse_args()
<|file_name|>taskdb.py<|end_file_name|><|fim▁begin|>import json, time from pyspider.database.base.taskdb import TaskDB as BaseTaskDB from .couchdbbase import SplitTableMixin class TaskDB(SplitTableMixin, BaseTaskDB): collection_prefix = '' def __init__(self, url, database='taskdb', username=None, password=No...
collection_name = self._get_collection_name(project) self.create_database(collection_name) # create index
<|file_name|>storage_policy.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
""" Represents a storage policy of type 'replication'. Default storage policy class unless otherwise overridden from swift.conf.
<|file_name|>PyShell.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python3 import getopt import os import os.path import re import socket import subprocess import sys import threading import time import tokenize import traceback import types import linecache from code import InteractiveInterpreter try: from tk...
self.breakpoints.remove(lineno) except: pass
<|file_name|>default_config.py<|end_file_name|><|fim▁begin|>"""Default website configurations, used only for testing. """ from donut import environment # Public Test Database TEST = environment.Environment( db_hostname="localhost", db_name="donut_test",<|fim▁hole|> testing=True, secret_key="1234567890"...
db_user="donut_test", db_password="public", debug=True,
<|file_name|>ccg_editor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Author: Ben Wing <ben@666.com> # Date: April 2006 ############################################################################# # # # ccg...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2015 Alex Brandt # # 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...
<|file_name|>register.py<|end_file_name|><|fim▁begin|># Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from pants.backend.jvm.artifact import Artifact from pants.backend.jvm.ossrh_publication_metadata import ( Developer, License,...
task(name="scalafix", action=ScalaFixCheck).install("lint")
<|file_name|>huge-largest-array.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>// 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://...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>const Card = require('./src/main'); Card.install = function(Vue) { Vue.component(Card.name, Card); }; <|fim▁hole|>module.exports = Card;<|fim▁end|>
<|file_name|>package.py<|end_file_name|><|fim▁begin|>############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, t...
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License (as # published by the Free Software Foundation) version 2.1, February 1999.
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub(crate) mod file; pub(crate) mod dir; pub(crate) mod vfat; pub(crate) mod ebpb; pub(crate) mod error;<|fim▁hole|>pub(crate) mod entry; pub(crate) mod metadata; pub(crate) mod cache; pub(crate) mod shared; pub use self::ebpb::BiosParameterBlock; pub use self::file::Fi...
pub(crate) mod cluster; pub(crate) mod fat;
<|file_name|>generate.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import json import time<|fim▁hole|>content = u"""\n type cmdConf struct { name string argDesc string group string readonly bool } """ def json_to_js(json_path, js_path): """Convert `commands.json` to `commands.js`...
import sys import os from collections import OrderedDict as dict
<|file_name|>redhat_subscription.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # James Laska (jlaska@redhat.com) # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA =...
<|file_name|>PublisherManager.java<|end_file_name|><|fim▁begin|>/** * vertigo - simple java starter * * Copyright (C) 2013-2017, KleeGroup, direction.technique@kleegroup.com (http://www.kleegroup.com) * KleeGroup, Centre d'affaire la Boursidiere - BP 159 - 92357 Le Plessis Robinson Cedex - France * * Licensed und...
* @author pchretien, npiedeloup */
<|file_name|>models.py<|end_file_name|><|fim▁begin|>""" Data models used for Blockstore API Client """ from datetime import datetime from uuid import UUID import attr import six def _convert_to_uuid(value): if not isinstance(value, UUID): return UUID(value) return value @attr.s(frozen=True) class ...
@attr.s(frozen=True) class DraftLinkDetails(LinkDetails):
<|file_name|>app-evented.js<|end_file_name|><|fim▁begin|>var Counter = require('./counterEvented.js'); var c = new Counter(1); c.increment(); <|fim▁hole|>});<|fim▁end|>
c.on('even', function(){ console.log('even! ' + c.count); return;
<|file_name|>pipeline.py<|end_file_name|><|fim▁begin|>from pymuse.pipelinestages.pipeline_stage import PipelineStage from pymuse.utils.stoppablequeue import StoppableQueue from pymuse.signal import Signal from pymuse.constants import PIPELINE_QUEUE_SIZE class PipelineFork(): """ This class is used to fork a P...
""" shutdowns every child thread (PipelineStage)""" self._shutdown(self._stages)
<|file_name|>RenderTextureSystem.ts<|end_file_name|><|fim▁begin|>import { System } from '../System'; import { Rectangle } from '@pixi/math'; import { BUFFER_BITS } from '@pixi/constants'; import type { Renderer } from '../Renderer'; import type { RenderTexture } from './RenderTexture'; import type { BaseRenderTexture ...
let baseTexture: BaseRenderTexture;
<|file_name|>0003_votetoken.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-08-28 17:08 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration):<|fim▁hole|> ('voting', '0002_au...
dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
export { Clock } from './Clock';
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>export { IMediumSelectedEvent } from './IMediumSelectedEvent'; export { IMediumAddedEvent } from './IMediumAddedEvent'; export { IReaderSelectedEvent } from './IReaderSelectedEvent'; export { IServerMessage } from './IServerMessage';<|fim▁hole|>export { IStats } from '...
export { IAcl } from './IAcl'; export { IComponentData } from './IComponentData'; export { IWorldCatEntry, IMediaEntry } from './IWorldCat_extern';
<|file_name|>model.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division """ TR-55 Model Implementation A mapping between variable/parameter names found in the TR-55 document and variables used in this prog...
""" A function to find the cutoff between precipitation/curve number pairs that have zero runoff by definition, and those that do not.
<|file_name|>function_name_property_function_expressions.js<|end_file_name|><|fim▁begin|>function test() { return (function foo(){}).name === 'foo' &&<|fim▁hole|>if (!test()) throw new Error("Test failed");<|fim▁end|>
(function(){}).name === ''; }
<|file_name|>mkeventd.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / ...
<|file_name|>embedErrorStyles.ts<|end_file_name|><|fim▁begin|>/** * @copyright 2009-2019 Vanilla Forums Inc. * @license GPL-2.0-only */ import { styleFactory } from "@library/styles/styleUtils"; import { useThemeCache } from "@library/styles/themeCache"; import { flexHelper } from "@library/styles/styleHelpers"; im...
});
<|file_name|>object_detector_dataloader.py<|end_file_name|><|fim▁begin|># Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # h...
<|file_name|>bp_user_metadata_game_system.py<|end_file_name|><|fim▁begin|>from common import common_global from common import common_pagination_bootstrap from sanic import Blueprint blueprint_user_metadata_game_system = Blueprint('name_blueprint_user_metadata_game_system', ...
request.ctx.session['search_page'] = 'meta_game_system' db_connection = await request.app.db_pool.acquire() pagination = common_pagination_bootstrap.com_pagination_boot_html(page, url='/user/user_meta_game',
<|file_name|>config.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python """ Variables that are shared between modules """ import sys import codecs version = "" scriptPath = "" scriptName = "" mediaInfoExe = "" mets_ns = "" mods_ns = "" premis_ns = "" ebucore_ns = "" xlink_ns = "" xsi_ns = "" isolyzer_ns = "" cdInf...
warnings = 0
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
'fallback': 'private-address' }, ADMIN: { 'config': 'os-admin-network',
<|file_name|>multimedia.py<|end_file_name|><|fim▁begin|>from django.contrib import messages from django.http import Http404, HttpResponse from django.shortcuts import render from corehq.apps.app_manager.dbaccessors import get_app from corehq.apps.app_manager.decorators import require_deploy_apps, \ require_can_edit...