prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>DialupNetwork.py<|end_file_name|><|fim▁begin|># coding=utf-8
from blueman.services.meta import SerialService<|fim▁hole|>
class DialupNetwork(SerialService):
__group__ = 'serial'
__svclass_id__ = DIALUP_NET_SVCLASS_ID
__icon__ = "modem"
__priority__ = 50<|fim▁end|> | from blueman.Sdp import DIALUP_NET_SVCLASS_ID
|
<|file_name|>32.d.ts<|end_file_name|><|fim▁begin|>import { WatsonHealthEdgeEnhancement_0132 } from "../../../";
<|fim▁hole|><|fim▁end|> | export = WatsonHealthEdgeEnhancement_0132; |
<|file_name|>plot_johnson_lindenstrauss_bound.py<|end_file_name|><|fim▁begin|>r"""
=====================================================================
The Johnson-Lindenstrauss bound for embedding with random projections
=====================================================================
The `Johnson-Lindenstraus... | plt.legend(["n_samples = %d" % n for n in n_samples_range], loc="upper right") |
<|file_name|>generator-desc.rs<|end_file_name|><|fim▁begin|>// edition:2018
#![feature(async_closure)]
use std::future::Future;
async fn one() {}
async fn two() {}
fn fun<F: Future<Output = ()>>(f1: F, f2: F) {}
fn main() {
fun(async {}, async {});
//~^ ERROR mismatched types<|fim▁hole|> //~^ ERROR mismatc... | fun(one(), two()); |
<|file_name|>entity-extract-store.js<|end_file_name|><|fim▁begin|>import {observable, runInAction, computed, action, reaction, autorun} from "mobx";
import LynlpApi from "../common/lynlp-api"
import _ from "lodash";
class EntityExtractStore {
@observable isFetching = false;
@observable currentItem = '图形展示';
@observ... | |
<|file_name|>API.py<|end_file_name|><|fim▁begin|># kate: replace-tabs on; indent-width 4; remove-trailing-spaces all; show-tabs on; newline-at-eof on;
# -*- coding:utf-8 -*-
'''
Copyright (C) 2014 Peter Urbanec
All Right Reserved
License: Proprietary / Commercial - contact enigma.licensing (at) urbanec.net
'''
import... | return True
except sockerror as ex:
print "[IceTV] Can not connect to IceTV server:", str(ex)
return False |
<|file_name|>server_exp2.py<|end_file_name|><|fim▁begin|>import os
import random
import time
import json
from locust import HttpLocust, TaskSet, task
from lib.baseTaskSet import baseTaskSet
# TODO - make these config-driven
from lib.openstack.keystone import get_auth_token
from lib.openstack.nova import list_servers... | self.auth_token, self.tenant_id, self.service_catalog = get_auth_token(self)
|
<|file_name|>PROC_A_SUBJECT_D002015.py<|end_file_name|><|fim▁begin|>#coding=UTF-8
from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext
from pyspark.sql.types import *
from datetime import date, datetime, timedelta
import sys, re, os
st = datetime.now()
conf = SparkConf().setAppName('PROC_A_SUBJECT... | ACRM_A_TARGET_D002015.cache()
nrows = ACRM_A_TARGET_D002015.count()
ACRM_A_TARGET_D002015.write.save(path=hdfs + '/' + dfn, mode='overwrite')
ACRM_A_TARGET_D002015.unpersist() |
<|file_name|>test_timeseries.py<|end_file_name|><|fim▁begin|>import os
from pvfactors.geometry.timeseries import TsPointCoords, TsLineCoords
from pvfactors.geometry.pvrow import TsPVRow
from pvfactors.geometry.pvground import TsGround, TsGroundElement
import pandas as pd
import numpy as np
from pvfactors.geometry.pvrow... | [[[0], [0]], [[2], [0]]], |
<|file_name|>response_container_paged_recent_traces_search.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Wavefront REST API Documentation
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operati... | |
<|file_name|>test_primitive_base.py<|end_file_name|><|fim▁begin|>from datetime import datetime
import numpy as np
import pandas as pd
from pytest import raises
from featuretools.primitives import Haversine, IsIn, IsNull, Max, TimeSinceLast
from featuretools.primitives.base import TransformPrimitive
def test_call_ag... | |
<|file_name|>issue-33174-restricted-type-in-public-interface.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 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-AP... |
pub struct Shell<T> {
pub(crate) creature: T,
} |
<|file_name|>ja.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/<|fim▁hole|> btnUpload: 'サーバーに送信',
button2Img: '選択したボタンを画像に置き換えますか?',
hSpace: '横間隔',
img2Button: '選択した画像をボタンに置き換えますか?',
infoT... | CKEDITOR.plugins.setLang( 'image', 'ja', {
alertUrl: 'イメージのURLを入力してください。',
alt: '代替テキスト',
border: 'ボーダー', |
<|file_name|>class5.py<|end_file_name|><|fim▁begin|><|fim▁hole|>class A(object):
pass
class A(x.y()):
pass
class A(B, C):
pass<|fim▁end|> | class A(B):
pass |
<|file_name|>version.go<|end_file_name|><|fim▁begin|>package features
import "github.com/Azure/azure-sdk-for-go/version"
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) Au... | }
|
<|file_name|>test_spark.py<|end_file_name|><|fim▁begin|># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
import json
import os
from string import Template
from uuid impor... | 'build_id': '20160801074053',
'filename': uuid4()
}
dimensions.update(kwargs) |
<|file_name|>pand.py<|end_file_name|><|fim▁begin|>#http://pandas.pydata.org/pandas-docs/stable/tutorials.html
#file='pand.py'
#exec(compile(open(file).read(), file, 'exec'))
from pandas import DataFrame, read_csv
import matplotlib.pyplot as plt
import pandas as pd
#import sys
#import matplotlib
names = ['Bob','Jess... | df.to_csv('births1880.csv',index=False,header=False)
|
<|file_name|>mod.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/LI... | |
<|file_name|>test_exports.py<|end_file_name|><|fim▁begin|>"""Test the csv/json export functionality."""
import binascii
import textwrap
import dnstwister.tools
import patches
from dnstwister.core.domain import Domain
def test_csv_export(webapp, monkeypatch):
"""Test CSV export"""
monkeypatch.setattr(
... | xn--a-sfa.com,Various,xn--wwa-cla.com,999.999.999.999,False
xn--a-sfa.com,Various,xn--www-a-vqa.com,999.999.999.999,False
xn--a-sfa.com,Various,xn--wwwa-3na.com,999.999.999.999,False |
<|file_name|>data_exportor.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# @date 161103 - Export excel with get_work_order_report function
"""
Data exportor (Excel, CSV...)
"""
import io
import math
from datetime import datetime
from xlsxwriter.workbook import Workbook
import tablib
from utils.tools imp... | |
<|file_name|>hir-res-hygiene.rs<|end_file_name|><|fim▁begin|>// check-pass
// edition:2018
// aux-build:not-libstd.rs
// Check that paths created in HIR are not affected by in scope names.
extern crate not_libstd as std;
<|fim▁hole|> async {}.await;
}
fn main() -> Result<(), ()> {
for i in 0..10 {}
for j ... | async fn the_future() { |
<|file_name|>Final_P4_1and2.py<|end_file_name|><|fim▁begin|>#Final Exam Problem 4-2
import random, pylab
# You are given this function
def getMeanAndStd(X):
mean = sum(X)/float(len(X))
tot = 0.0
for x in X:
tot += (x - mean)**2
std = (tot/len(X))**0.5
return mean, std
# You are given this... | the trials. There should be 10 bins in the histogram |
<|file_name|>multiclass_sklearn.py<|end_file_name|><|fim▁begin|>import deepchem as dc
import numpy as np
import sklearn
from sklearn.ensemble import RandomForestClassifier
N = 100
n_feat = 5
n_classes = 3
X = np.random.rand(N, n_feat)
y = np.random.randint(3, size=(N,))<|fim▁hole|>dataset = dc.data.NumpyDataset(X, y)
... | |
<|file_name|>static_symbol.d.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. 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
*/
/**
* A token representing the a reference to a static ... | export declare class StaticSymbolCache {
private cache;
get(declarationFile: string, name: string, members?: string[]): StaticSymbol; |
<|file_name|>dialogflow_generated_dialogflow_v2beta1_participants_list_suggestions_async.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... | |
<|file_name|>nstimer.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... | option_.count = True
option_.filter = filter_
response = obj.getfiltered(client, option_)
if response : |
<|file_name|>fields.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from .settings import MARTOR_ENABLE_LABEL
from .widgets import MartorWidget
class MartorFormField(forms.CharField):
def __init__(self, *args, **kwargs):
# to set... | super(MartorFormField, self).__init__(*args, **kwargs) |
<|file_name|>0005_auto_20160518_0031.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('reddit', '0004_auto_20160518_0017'),
... | name='user', |
<|file_name|>collection.go<|end_file_name|><|fim▁begin|>package ebpf
import (
"errors"
"fmt"
"math"
"reflect"
"strings"
"github.com/cilium/ebpf/asm"
"github.com/cilium/ebpf/internal"
"github.com/cilium/ebpf/internal/btf"
)
// CollectionOptions control loading a collection into the kernel.
//
// Maps and Prog... | }
func assignValues(to interface{}, valueOf func(reflect.Type, string) (reflect.Value, error)) error {
type structField struct { |
<|file_name|>pmx_datum_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3<|fim▁hole|>@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
from scs_core.data.datetime import LocalizedDatetime
from scs_core.data.json import JSONify
from scs_core.particulate.pmx_datum import PMxDatum
# -------------... |
"""
Created on 18 Sep 2016
|
<|file_name|>0063_auto_20210511_2343.py<|end_file_name|><|fim▁begin|># Generated by Django 3.2 on 2021-05-11 13:43
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('stock', '0062_auto_20210511_2151'),
]
operations = [
migrations.RemoveField(
... | |
<|file_name|>landing-page-feature-list.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
@Component({
selector: 'uxd-landing-page-feature-list',
template: '<ng-content></ng-content>',
styles: [':host { display: block; }'],<|fim▁hole|> 'class': 'row'
}
})
export... | host: { |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>/* -----------------------------------------------
/* How to use? : Check the GitHub README
/* ----------------------------------------------- */
/* To load a config file (particles.json) you need to host this demo (MAMP/WAMP/local)... */
/*
particlesJS.load('particles-... | "anim": {
"enable": false,
"speed": 40, |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for SysuLesson project.<|fim▁hole|>For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Sys... |
It exposes the WSGI callable as a module-level variable named ``application``.
|
<|file_name|>VXObject.ts<|end_file_name|><|fim▁begin|>export class TObject {
private _tag: any;
/**
* Stores a value as a part of a component.
* Tag has no predefined meaning. The Tag property can store any additional value for the convenience of developers.
*
*/
public get Tag(): any {
... | * @function
*/
export function isFunction(func): boolean { |
<|file_name|>mode-tex.js<|end_file_name|><|fim▁begin|>ace.define("ace/mode/tex_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var lang = require("../lib/lang");
var TextHig... | var Mode = function(suppressHighlighting) { |
<|file_name|>issue-6458-2.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-M... | // file at the top-level directory of this distribution and at |
<|file_name|>ModelDisplay.java<|end_file_name|><|fim▁begin|>import java.awt.Graphics;
/**
* Interface to used to communicate between a model
* and its display
*
* Copyright Georgia Institute of Technology 2004
* @author Barb Ericson ericson@cc.gatech.edu
*/
public interface ModelDisplay
{
/** method to notify... | /**
* Method that returns the graphics context |
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>// instanciando módulos
var gulp = require('gulp');
var watch = require('gulp-watch');
var del = require('del');
var shell = require('gulp-shell');
var connect = require('gulp-connect');
gulp.task('run:pelican', shell.task([
'pelican content -s pelicanconf.py'
])... | gulp.task('connect', function(){
connect.server({
root: ['output'],
port: 1337, |
<|file_name|>parallel.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/. */
//! Implements parallel traversals over the DOM and flow tre... | proxy.push(WorkUnit {
fun: top_down_func,
data: (box chunk.iter().cloned().collect(), 0),
}); |
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>import { OutroModelo } from './modelos/outro-modelo.model';
import { Armario } from './modelos/armario.model';
import { Component } from '@angular/core';
@Component({<|fim▁hole|> templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
exp... | selector: 'app-root', |
<|file_name|>jquery.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for jQuery 1.10.x / 2.0.x
// Project: http://jquery.com/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Christian Hoffmeister <https://github.com/choffmeister>, Steve Fenton <https://github.com/Steve-Fenton>, Diullei Gomes <h... | |
<|file_name|>session.py<|end_file_name|><|fim▁begin|>import math
import unicodedata as uda
from binascii import unhexlify, hexlify
from torba.rpc.jsonrpc import RPCError
from torba.server.hash import hash_to_hex_str
from torba.server.session import ElectrumX
from torba.server import util
from lbry.schema.result impor... | async def claimtrie_getclaimssignedbynthtoname(self, name, n):
claim = self.claimtrie_getnthclaimforname(name, n)
if claim and 'claim_id' in claim: |
<|file_name|>zabbix.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# (c) 2013, Greg Buehler
#
# 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 ... |
Tested with Zabbix Server 2.0.6 and 3.2.3. |
<|file_name|>chrome_render_frame_observer_browsertest.cc<|end_file_name|><|fim▁begin|>// Copyright 2016 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.
#include "chrome/renderer/chrome_render_frame_observer.h"
#include ... |
TEST_F(ChromeRenderFrameObserverTest, SkipCapturingSubFrames) {
base::HistogramTester histogram_tester;
LoadHTML( |
<|file_name|>atoi.py<|end_file_name|><|fim▁begin|>"""
Implement atoi() in Python (given a string, return a number).
Assume all the strings are always valid.
"""
import unittest
def atoi(string):
l = len(string)
t = 0
v = 10 ** (l - 1)
for ch in string:
t += v * int(ch)
v /= 10
ret... |
def atoi2(string): |
<|file_name|>IgnoredExceptionsTest.py<|end_file_name|><|fim▁begin|>##########################################################################
#
# Copyright (c) 2010, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... | unittest.main() |
<|file_name|>units.py<|end_file_name|><|fim▁begin|>import re
import quantities as pq
from numbers import NumberService
class ConversionService(object):
__exponents__ = {
'square': 2,
'squared': 2,
'cubed': 3
}
def _preprocess(self, input):
def handleExponents(input):
... | |
<|file_name|>list_file.py<|end_file_name|><|fim▁begin|># This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program... | console.config["prefix"] = "Match: "
# console.print_help()
flow.actors.append(console) |
<|file_name|>bitcounter-range.py<|end_file_name|><|fim▁begin|>from microbit_stub import *
while True:
if button_a.is_pressed():
for i in range(5):<|fim▁hole|> else:
display.set_pixel(i, 0, 9)
sleep(200)
break
elif button_b.is_pressed():
... | if display.get_pixel(i, 0):
display.set_pixel(i, 0, 0)
sleep(10) |
<|file_name|>processes.py<|end_file_name|><|fim▁begin|># stdlib
from collections import namedtuple
# project
from resources import (
agg,
ResourcePlugin,
SnapshotDescriptor,
SnapshotField,
)
from utils.subprocess_output import get_subprocess_output
class Processes(ResourcePlugin):
RESOURCE_KEY =... | self.end_snapshot(group_by=self.group_by_family)
def flush_snapshots(self, snapshot_group):
self._flush_snapshots(snapshot_group=snapshot_group, |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>import sched, time
s = sched.scheduler(time.time, time.sleep)
def print_time():
print ("From print_time", time.time())
<|fim▁hole|> s.enter(5, 1, print_time, ())
s.enter(10, 1, print_time, ())
s.run()
print (time.time())
print_some_times()<|... |
def print_some_times():
print (time.time())
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.utils.translation import ugettext as _<|fim▁hole|>
class Superhero(ModelBase):
name = models.CharField(max_length=256, editable=False)
class Meta:
verbose_name_plural = _("Superheroes")<|fim▁end|> | from django.db import models
from jmbo.models import ModelBase |
<|file_name|>publish-docker.ts<|end_file_name|><|fim▁begin|>import { cd, exec } from 'shelljs';
import * as inquirer from 'inquirer';
import * as semver from 'semver';
const prompt = inquirer.createPromptModule();
async function release() {
cd(`${__dirname}/docker`);
const { channel } = await prompt([{
... | throw new Error(`Invalid version: ${version}`)
} |
<|file_name|>3_prime_palindrome.py<|end_file_name|><|fim▁begin|>import math
def is_palindrome(n):
s = str(n)
return s == s[::-1]
def is_prime(n):
if n <= 1:
return False
if n % 2 == 0 and n != 2:
return False
if n == 2:<|fim▁hole|> while i <= root:
if n % i == 0:
... | return True
root = math.sqrt(n)
i = 3 |
<|file_name|>makinframe.py<|end_file_name|><|fim▁begin|>from PySide import QtCore, QtGui
class MakinFrame(QtGui.QFrame):
mousegeser = QtCore.Signal(int,int)
def __init__(self,parent=None):
super(MakinFrame,self).__init__(parent)
self.setMouseTracking(True)
def setMouseTracking(self, flag):
def recursive_set(... | |
<|file_name|>issue-24780.rs<|end_file_name|><|fim▁begin|>// Verify that '>' is not both expected and found at the same time, as it used
// to happen in #24780. For example, following should be an error:<|fim▁hole|>// expected one of ..., `>`, ... found `>`.
fn foo() -> Vec<usize>> { //~ ERROR expected one of `!`, `+`,... | |
<|file_name|>1.0.0_Player.js<|end_file_name|><|fim▁begin|>/* *************************
* "CLASS": Player
* *************************/
function Player(x, y){
/* ### ATTRIBUTES ### */
Entity.call(this, x, y);
this.vx = 0;
this.vy = 0;
this.currentMaxHealth = 2;
this.health = 2;
this.sprite = new Sprite('res/s... | |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>document.getElementById('input_search').onfocus = function () {<|fim▁hole|> document.getElementById('search').classList.add('activeSearch');
};
document.getElementById('input_search').onblur = function () {
document.getElementById('search').classList.remove('activeSearc... | |
<|file_name|>object_safety.rs<|end_file_name|><|fim▁begin|>// Copyright 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/l... | violations
}
fn supertraits_reference_self<'tcx>(tcx: &ty::ctxt<'tcx>, |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>;(function() {
var ValueDirective = function() {
};
_.extend(ValueDirective.prototype, {
matcher: function($el) {
return $el.data('value');
},
run: function($el) {
$el.html($el.data('value'));
}
... |
_.extend(app, { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Linguistic and other taggers.
Tagging each token in a sentence with supplementary information,
such as its part-of-speech (POS) tag, and named entity (NE) tag.
"""
__all__ = [
"PerceptronTagger",
"pos_tag",
"pos_tag_sents",
... | from pythainlp.tag.chunk import chunk_parse |
<|file_name|>inputs.py<|end_file_name|><|fim▁begin|>import numpy as np
import tensorflow as tf
import os
def get_inputs(split, config):
split_dir = config['split_dir']
data_dir = config['data_dir']
dataset = config['dataset']
split_file = os.path.join(split_dir, dataset, split + '.lst')
filename_q... |
def get_filename_queue(split_file, data_dir):
with open(split_file, 'r') as f: |
<|file_name|>golangDepsUpdate.py<|end_file_name|><|fim▁begin|>#!/bin/python
# -*- coding: utf-8 -*-
# ####################################################################
# gofed-ng - Golang system
# Copyright (C) 2016 Fridolin Pokorny, fpokorny@redhat.com
#
# This program is free software; you can redistribute it and... | |
<|file_name|>push.go<|end_file_name|><|fim▁begin|>package distribution // import "github.com/tiborvass/docker/distribution"
import (
"bufio"
"compress/gzip"
"context"
"fmt"
"io"
"github.com/docker/distribution/reference"
"github.com/tiborvass/docker/distribution/metadata"
"github.com/tiborvass/docker/pkg/prog... | |
<|file_name|>validator.py<|end_file_name|><|fim▁begin|>import os
from zeroinstall.injector import namespaces
from zeroinstall.injector.reader import InvalidInterface, load_feed
from xml.dom import minidom, Node, XMLNS_NAMESPACE
import tempfile
from logging import warn, info
group_impl_attribs = ['version', 'version-mo... | except InvalidInterface, ex: |
<|file_name|>log.py<|end_file_name|><|fim▁begin|>def read_logfile_by_line(logfile):
"""generator function that yields the log file content line by line"""
with open(logfile, 'r') as f:
for line in f:
yield line
yield None
def parse_commands(log_content):
"""
parse cwl commands... | in_command = True
if in_command:
command.append(line.strip('\\').rstrip(' '))
if not line.endswith('\\'): |
<|file_name|>sale_order.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# © 2017 Comunitea
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api, _
from odoo.tools import float_compare
from lxml import etree
class SaleOrderLineTemplate(models.Model):
_name ... | template_product = self.env['product.template'].browse(vals['product_template'])
if template_product.display_name == line_vals['name']:
product_vals = self.env['product.product'].browse( |
<|file_name|>lookup_util.cc<|end_file_name|><|fim▁begin|>/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/lic... | return; |
<|file_name|>VirtualMachineScaleSetBootDiagnosticsTests.java<|end_file_name|><|fim▁begin|>// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.resourcemanager.compute;
import com.azure.core.http.HttpPipeline;
import com.azure.resourcemanager.compute.fluent.... | .withExistingResourceGroup(rgName)
.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0)
.withExistingPrimaryNetworkSubnet(network, "subnet1") |
<|file_name|>globalProperties.ts<|end_file_name|><|fim▁begin|>import {app} from 'electron'
import * as os from 'os'
/**
* creates string with path to folder, depending on OS
* @todo add other OSs
*/<|fim▁hole|> return 'C:\\Users\\' + os.userInfo().username + '\\AppData\\Roaming\\ToDoElectron\\'
case 'darwin':
/... | export const getPath = () => {
switch (process.platform) {
case 'win32': |
<|file_name|>subprod-render.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SubprodRenderComponent } from './subprod-render.component';
describe('SubprodRenderComponent', () => {
let component: SubprodRenderComponent;
let fixture: C... | declarations: [ SubprodRenderComponent ]
})
.compileComponents();
})); |
<|file_name|>rasterizer.cc<|end_file_name|><|fim▁begin|>/* Copyright 2020 The TensorFlow 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
Unle... | {GL_FLOAT_MAT3x4, std::make_tuple(3, 4, glUniformMatrix3x4fv)}, |
<|file_name|>hooks.tsx<|end_file_name|><|fim▁begin|>import { useCallback, useState, useEffect } from 'react';
import { KeyStore } from './keystore';
import type { Accounts, Hooks as HooksType } from './../types';
<|fim▁hole|> const [error, setError] = useState<string>();
useEffect(() => {
async function ge... | export const Hooks = {
useKeyStore: () => {
const [accounts, setAccounts] = useState<Accounts>(); |
<|file_name|>event_creation.rs<|end_file_name|><|fim▁begin|>//! Endpoints for creating events.
use std::convert::TryInto;
use bodyparser;
use diesel::{Connection, ExecuteDsl, insert};
use diesel::pg::PgConnection;
use iron::{Chain, Handler, IronError, IronResult, Plugin, Request, Response, status};
use router::Router... | |
<|file_name|>weather.py<|end_file_name|><|fim▁begin|>__author__ = 'Alexandre Menai amenai@amenai.net'
'''
The weather module intends to grab pilot weather from the aviation weather services in the USA
'''
#TODO put the following global parameters into a configuration file later on
WEAHTER_HOSTNAME="aviationweather.gov"... |
def grab_airfield_weather(self, airfield='KBED', hours_before_now=1): |
<|file_name|>api_dispatch.rs<|end_file_name|><|fim▁begin|>/*#[cfg(feature = "window")]
pub use api::x11::{Window, WindowProxy, MonitorID, get_available_monitors, get_primary_monitor};
#[cfg(feature = "window")]
pub use api::x11::{WaitEventsIterator, PollEventsIterator};*/
use std::collections::VecDeque;
use std::sync:... | |
<|file_name|>textbox.js<|end_file_name|><|fim▁begin|>/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This 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 ... | * @addnode elements
*
* @inherits apf.StandardBinding |
<|file_name|>raytracer_test.go<|end_file_name|><|fim▁begin|>//Copyright (c) 2014 Michael Heier 8311689, Patrick Dahlke 2458357
package main
import (
"de/vorlesung/projekt/raytracer/Helper"
scene "de/vorlesung/projekt/raytracer/Raytracing"
objects "de/vorlesung/projekt/raytracer/SceneObjects"
"image/color/palette"... | |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, t... | |
<|file_name|>topology_util.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2013 cloudysunny14.
#
# 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... | self.ports = {}
self.linked_ports = LinkedPorts()
|
<|file_name|>general.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
def python_print(*values, sep=' '):
joined = sep.join((str(v) for v in values))
print(joined)
def python_list(*args):
return args
def error(text=''):
raise RuntimeError(text)<|fim▁end|> | def python_evaluate(text):
return eval(str(text)) |
<|file_name|>test_metric.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 Apa... | def test_metrics():
check_metric('acc', axis=0) |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>def test1():
SINK(SOURCE)
def test2():
s = SOURCE
SINK(s)
def source():
return SOURCE
def sink(arg):
SINK(arg)
def test3():
t = source()
SINK(t)
def test4():
t = SOURCE
sink(t)
def test5():
t = source()
sink(t)
def test... | SANITIZE(s)
SINK(s) |
<|file_name|>issue_9123.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/lice... |
#![crate_type = "lib"]
pub trait X { |
<|file_name|>resourcetool.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (C) 2017
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.<|fim▁hole|># The LOFAR software suite is free software: you can re... | |
<|file_name|>ArraySave.py<|end_file_name|><|fim▁begin|>#/*##########################################################################
# Copyright (C) 2004-2012 European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
#
# This fil... | if (ndata > 10):
print("Saved image %d of %d" % (i + 1, ndata))
elif mcaindex == 1:
for i in range(ndata): |
<|file_name|>qdbusconnectioninterface.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part o... | /*!
\internal
*/
QDBusConnectionInterface::~QDBusConnectionInterface() |
<|file_name|>comment_result.py<|end_file_name|><|fim▁begin|>from pykintone.result import Result
from pykintone.comment import RecordComment, Mention
class CreateCommentResult(Result):
<|fim▁hole|> serialized = response.json()
if "id" in serialized:
self.comment_id = int(serializ... | def __init__(self, response):
super(CreateCommentResult, self).__init__(response)
self.comment_id = -1
if self.ok: |
<|file_name|>edit_instance_vmware.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
def command():
return "edit-instance-vmware"
<|fim▁hole|> parser.add_argument("--instance-type", required=True)
parser.add_argument("--key-name", required=True)
parser.add_argument("--compute-resource", required=Tr... | def init_argument(parser):
parser.add_argument("--instance-no", required=True) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# ____________
# ___/ | \_____________ _ _ ___
# / ___/ | _ __ _ _| | ___ __ _ __| | \
# / \___/ ______/ | '_ \ || | |__/ _ \/ _` / _` | \
# \ ◯ | | .__/\_, |____\_... | |
<|file_name|>clean.rs<|end_file_name|><|fim▁begin|>use std::collections::HashSet;
use std::fs::{read_dir, read_link, remove_file, metadata};
use std::io::{self, stdout, stderr};
use std::ffi::OsStr;
use std::path::Path;
use std::str::FromStr;
use std::time::{SystemTime, UNIX_EPOCH, Duration};
use std::os::unix::fs::Met... |
fn global_clean_unused(wrapper: &Wrapper, duration: Duration, |
<|file_name|>VerticalTextAlign.java<|end_file_name|><|fim▁begin|>/*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
* Foundation.
*
* You should have received a copy of the GNU Lesser... | }
if ( this.id.equals( VerticalTextAlign.SUB.id ) ) {
return VerticalTextAlign.SUB;
} |
<|file_name|>translation_simba.rs<|end_file_name|><|fim▁begin|>use simba::simd::SimdValue;
use crate::base::allocator::Allocator;
use crate::base::dimension::DimName;
use crate::base::{DefaultAllocator, VectorN};
use crate::Scalar;
use crate::geometry::Translation;
impl<N: Scalar + SimdValue, D: DimName> SimdValue f... | #[inline]
fn splat(val: Self::Element) -> Self {
VectorN::splat(val.vector).into() |
<|file_name|>MissingAuthorizationDtoTest.java<|end_file_name|><|fim▁begin|>/*
* Camunda BPM REST API
* OpenApi Spec for Camunda BPM REST API.
*
* The version of the OpenAPI document: 7.13.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generat... | |
<|file_name|>test_forms_field.py<|end_file_name|><|fim▁begin|>#:coding=utf-8:
from django.test import TestCase as DjangoTestCase
from django.forms import Form
from beproud.django.commons.forms import EmailField
__all__ = (<|fim▁hole|>
class EmailTestForm(Form):
email = EmailField(label="email")
class EmailFi... | 'EmailFieldTest',
'JSONFormFieldTest',
'JSONWidgetTest',
) |
<|file_name|>syscall_linux_arm.go<|end_file_name|><|fim▁begin|>// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build arm,linux
package unix
import (
"syscall"
"unsafe"
)
func setTimespec(sec, nsec in... | return setrlimit(resource, &rl)
}
func (r *PtraceRegs) PC() uint64 { return uint64(r.Uregs[15]) } |
<|file_name|>clustering4.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# script find clusters of small RNA reads in the genome
# version 3 - 24-12-2013 evolution to multiprocessing
# Usage clustering.py <bowtie input> <output> <bowtie index> <clustering_distance> <minimum read number per cluster to be outputed> <co... | downstream_coord = cluster[-1]
readcount = Instance.readcount(upstream_coord=upstream_coord, downstream_coord=downstream_coord) |
<|file_name|>test_strports.py<|end_file_name|><|fim▁begin|># Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.application.strports}.
"""
from twisted.trial.unittest import TestCase
from twisted.application import strports
from twisted.application import internet
... | [self.test_serviceDeprecatedUnqualified])
self.assertEquals(warnings[0]['category'], DeprecationWarning)
self.assertEquals(
warnings[0]['message'], |
<|file_name|>NimManager.py<|end_file_name|><|fim▁begin|>from Tools.HardwareInfo import HardwareInfo
from Tools.BoundFunction import boundFunction
from config import config, ConfigSubsection, ConfigSelection, ConfigFloat, \
ConfigSatlist, ConfigYesNo, ConfigInteger, ConfigSubList, ConfigNothing, \
ConfigSubDict, Conf... | udc = int(currLnb.uncommittedDiseqcCommand.value)
if udc > 0: |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.