prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>monitor_test.go<|end_file_name|><|fim▁begin|>package command
import (
"strings"
"testing"
"time"
"github.com/hashicorp/nomad/api"
"github.com/hashicorp/nomad/nomad/structs"
"github.com/mitchellh/cli"
)
func TestMonitor_Update_Eval(t *testing.T) {
t.Parallel()<|fim▁hole|> mon := newMonitor(ui, nil... | ui := new(cli.MockUi) |
<|file_name|>csr.ts<|end_file_name|><|fim▁begin|>import { Pkcs10CertificateRequest } from "@peculiar/x509";
import * as graphene from "graphene-pk11";
import { Convert } from "pvtsutils";
import * as core from "webcrypto-core";
import { CryptoKey } from "../key";
import { Pkcs11Object } from "../p11_object";
import {... | |
<|file_name|>solution.py<|end_file_name|><|fim▁begin|>#!/bin/python3
<|fim▁hole|>
n = int(input().strip())
fct = fact(n)
print(fct)<|fim▁end|> | import sys
fact = lambda n: 1 if n <= 1 else n * fact(n - 1) |
<|file_name|>FTSRequest.py<|end_file_name|><|fim▁begin|>#############################################################################
# $HeadURL$
#############################################################################
""" ..mod: FTSRequest
=================
Helper class to perform FTS job submission and ... |
def __filesToSubmit( self ): |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "arsoft.web.crashupload.settings")
from django.core.management import execute_from_command_line<|fim▁hole|><|fim▁end|> |
execute_from_command_line(sys.argv) |
<|file_name|>notify_messages.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# =================================================================
# =================================================================
# NOTE: notify message MUST follow these rules:
#
# - Messages must be ... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
import {
Application
} from 'phosphor/lib/ui/application';
import {
ApplicationShell
} from './shell';
/**
* The type for all JupyterLab plugins.
*/
export
... | } |
<|file_name|>netconfig.py<|end_file_name|><|fim▁begin|>"""
Network Config
==============
Manage the configuration on a network device given a specific static config or template.
:codeauthor: Mircea Ulinic <ping@mirceaulinic.net> & Jerome Fleury <jf@cloudflare.com>
:maturity: new
:depends: napalm
:platform: uni... |
.. note::
This option is **not** supported on Windows.
attrs |
<|file_name|>bitcoin_es.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="es" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Klondikecoin</source... | <source>Catching up...</source>
<translation>Actualizando...</translation>
</message> |
<|file_name|>webroot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import json
import os
import re
import cherrypy
import mako
from girder import constants
from girder.models.setting import Setting
from girder.settings import SettingKey
from girder.utility import config
class WebrootBase:
"""
Serv... |
def PUT(self, **params):
raise cherrypy.HTTPError(405)
|
<|file_name|>numpy_pi.py<|end_file_name|><|fim▁begin|># file: numpy_pi.py
"""Calculating pi with Monte Carlo Method and NumPy.<|fim▁hole|>"""
from __future__ import print_function
import numpy #1
@profile
def pi_numpy(total): ... | |
<|file_name|>BaseDemographicForm.py<|end_file_name|><|fim▁begin|>from django import forms
from ..models import BaseDemographic<|fim▁hole|>
class BaseDemographicForm(forms.ModelForm):
class Meta:
model = BaseDemographic
fields = ['first_name','last_name','phone','dob']<|fim▁end|> | |
<|file_name|>OpeningHours.java<|end_file_name|><|fim▁begin|>package com.github.ypid.complexalarm;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;
import android.content.Context;
import android.content.res.AssetManager;
import android.util.Log;
import com.evgenii.jsevaluator.JsEvalua... | |
<|file_name|>check_for_currupt_references.py<|end_file_name|><|fim▁begin|>from engine.api import API
from engine.utils.printing_utils import progressBar
from setup.utils.datastore_utils import repair_corrupt_reference, link_references_to_paper
def remove_duplicates_from_cited_by():
print("\nRemove Duplicates")
... | if ref_paper.cited_by.count(paper.id) == 0:
print()
reference.paper_id = [] |
<|file_name|>metricsaccountant_suite_test.go<|end_file_name|><|fim▁begin|>package metricsaccountant_test
import (
. "github.com/onsi/ginkgo"<|fim▁hole|> . "github.com/onsi/gomega"
"testing"
)
func TestMetricsAccountant(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Metricsaccountant Suite")
}<|fim▁end|> | |
<|file_name|>test_light_sensor.py<|end_file_name|><|fim▁begin|>import unittest
import mock
from greenpithumb import light_sensor
class LightSensorTest(unittest.TestCase):
def setUp(self):
self.mock_adc = mock.Mock()
channel = 1
self.light_sensor = light_sensor.LightSensor(self.mock_adc,... | def test_light_50_pct(self):
"""Near midpoint light sensor value should return near 50."""
self.mock_adc.read_adc.return_value = 511
self.assertAlmostEqual(self.light_sensor.light(), 50.0, places=1) |
<|file_name|>print_mail.py<|end_file_name|><|fim▁begin|>import os
import sys
import glob
import json
import subprocess
from collections import defaultdict
from utils import UnicodeReader, slugify, count_pages, combine_pdfs, parser
import addresscleaner
from click2mail import Click2MailBatch
parser.add_argument("direc... | address['address2'] = lines[2]
address['address3'] = '' |
<|file_name|>HierarchicalModelType.java<|end_file_name|><|fim▁begin|>package dr.app.beauti.types;
/**<|fim▁hole|>public enum HierarchicalModelType {
NORMAL_HPM,
LOGNORMAL_HPM;
public String toString() {
switch (this) {
case NORMAL_HPM:
return "Normal";
... | * @author Marc A. Suchard
*/ |
<|file_name|>indicators.src.js<|end_file_name|><|fim▁begin|>/**
* @license Highstock JS v9.0.1 (2021-02-16)
*
* Indicator series type for Highstock
*
* (c) 2010-2021 Pawel Fus, Sebastian Bochan
*
* License: www.highcharts.com/license
*/
'use strict';
(function (factory) {
if (typeof module === 'object' && m... | return;
}
// Switch index for OHLC / Candlestick / Arearange
if (isArray(yVal[0])) { |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 OpenStack Foundation.
#
# 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... | OPENFLOW_MAX_PRIORITY = 65535
|
<|file_name|>dataarray.py<|end_file_name|><|fim▁begin|>import contextlib
import functools
import warnings
import numpy as np
import pandas as pd
from ..plot.plot import _PlotMethods
from . import indexing
from . import groupby
from . import ops
from . import utils
from . import variable
from .alignment import align
... | DataArray.equals
DataArray.identical |
<|file_name|>nrburst_pickle_preserve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2016 James Clark <james.clark@ligo.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
... | # You should have received a copy of the GNU General Public License along |
<|file_name|>feed_parse_extractToomtummootstranslationsWordpressCom.py<|end_file_name|><|fim▁begin|>def extractToomtummootstranslationsWordpressCom(item):
'''
Parser for 'toomtummootstranslations.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "p... | |
<|file_name|>topPost.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { TopPostComponent } from './TopPost.component';
import {Observable} from 'rxjs/Rx';
@Injectable()
export class TopPostservice {
constructor(private http: Htt... | getTopPlaces() : Observable<TopPostComponent[]> {
return this.http.get('http://localhost:3000/api/v1/places/top.json')
.map(res => (<Response>res).json().data) |
<|file_name|>implicit.js<|end_file_name|><|fim▁begin|>/*
* 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) AutoRest Code Generator.
* Changes may cause incorrect behavior... | }
} catch (defaultError) {
error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + |
<|file_name|>NullServlet.java<|end_file_name|><|fim▁begin|>/*
* SPDX-FileCopyrightText: 2006-2009 Dirk Riehle <dirk@riehle.org> https://dirkriehle.com
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package org.wahlzeit.servlets;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
/**
* A nu... | displayNullPage(request, response);
}
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! [tui](https://github.com/fdehau/tui-rs) is a library used to build rich
//! terminal users interfaces and dashboards.
//!
//! 
//!
//! # Get started
//!
//! ## Adding `tui` as a dependency
//!... | //! crossterm = "0.22"
//! ```
//! |
<|file_name|>adsbibtex_cache.py<|end_file_name|><|fim▁begin|>""" simple cache based on shelve
"""
import shelve
import time
def load_cache(cache_file):
cache = shelve.open(cache_file)
return cache
<|fim▁hole|>def read_key(cache, key, ttl):
""" Reads value from cache, if doesnt exist or is older than ttl... | |
<|file_name|>E0282.rs<|end_file_name|><|fim▁begin|>fn main() {<|fim▁hole|> let x = "hello".chars().rev().collect(); //~ ERROR E0282
}<|fim▁end|> | |
<|file_name|>shelterpro_dbf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import asm, datetime, os
"""
Import script for Shelterpro databases in DBF format
Requires my hack to dbfread to support VFP9 -
copy parseC in FieldParser.py and rename it parseV, then remove
encoding so it's just a binary string tha... | # on shelter after 2 years, add an adoption to an unknown owner
#asm.adopt_older_than(animals, movements, uo.ID, 365*2)
|
<|file_name|>http.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 RIPE NCC
#
# 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... | self.response_time = self.ensure("rt", float)
self.version = self.ensure("ver", str)
if not self.destination_address: |
<|file_name|>diagnostics.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>//! Diagnostics related methods for `TyS`.
use crate::ty::TyKind::*;
use crate::ty::{InferTy, TyCtxt, TyS};
use rustc_errors::{Applicability, DiagnosticBuilder};
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_hir::{QPath, TyKind, Where... | |
<|file_name|>core.rs<|end_file_name|><|fim▁begin|>//! High level wrapper of LMDB APIs
//!
//! Requires knowledge of LMDB terminology
//!
//! # Environment
//!
//! Environment is actually the center point of LMDB, it's a container
//! of everything else. As some settings couldn't be adjusted after
//! opening, `Environm... | /// Moves cursor to last item with the same key as current |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![feature(test)]
extern crate nalgebra as na;<|fim▁hole|>extern crate nalgebra_lapack as nl;
extern crate rand;
extern crate test;
mod linalg;<|fim▁end|> | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from distutils.core import setup
<|fim▁hole|> packages=['fetcher'])<|fim▁end|> | setup(
name='fetcher',
version='0.4',
install_requires=['pycurl==7.19.0.2'], |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>import os
import sys
from recommonmark.parser import CommonMarkParser
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'askomics'))
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon']
master_doc = 'index'
# The suffix of source filenames.
sour... | from sphinx.apidoc import main
parent_folder = os.path.join(os.path.dirname(__file__), '..')
cur_dir = os.path.abspath(os.path.dirname(__file__)) |
<|file_name|>focus.rs<|end_file_name|><|fim▁begin|>use dces::prelude::Entity;
use crate::{
prelude::*,
proc_macros::{Event, IntoHandler},
};
<|fim▁hole|>/// Used to request keyboard focus on the window.
#[derive(Event, Clone)]
pub enum FocusEvent {
RequestFocus(Entity),
RemoveFocus(Entity),
}
pub type... | |
<|file_name|>Juego.java<|end_file_name|><|fim▁begin|>package schoolprojects;
import java.util.Random;
import java.util.Scanner;
/**
* Piedra, papel o tijera es un juego infantil.
* Un juego de manos en el cual existen tres elementos.
* La piedra que vence a la tijera rompiéndola; la tijera que vencen al papel co... | /** |
<|file_name|>prism.py<|end_file_name|><|fim▁begin|>__author__ = 'jbellino'
import os
import csv<|fim▁hole|>import gdalconst
import zipfile as zf
import numpy as np
import pandas as pd
from unitconversion import *
prismGrid_shp = r'G:\archive\datasets\PRISM\shp\prismGrid_p.shp'
prismGrid_pts = r'G:\archive\datasets\PRI... | import gdal |
<|file_name|>body.js<|end_file_name|><|fim▁begin|>const test = require('tape')
const parse = require('../../parse').element('Body')
test('b(N+1,N+2)', function (t) {
const res = parse('b(N+1,N+2)')
t.equal(typeof res, 'object')
t.ok(res instanceof Array)
t.equal(res.length, 1)
t.end()
})
test('b(N+1,N+2)... | t.end() |
<|file_name|>segmentation.rs<|end_file_name|><|fim▁begin|>use core::fmt;
use shared::descriptor;
use shared::PrivilegeLevel;
/// Specifies which element to load into a segment from
/// descriptor tables (i.e., is a index to LDT or GDT table
/// with some additional flags).
///
/// See Intel 3a, Section 3.4.2 "Segment... | #[derive(Copy, Clone, Debug)]
#[repr(C, packed)]
pub struct SegmentDescriptor { |
<|file_name|>search_tutor.py<|end_file_name|><|fim▁begin|>##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, facu... | class TutorSearchForm(BaseSearchForm): |
<|file_name|>__main__.py<|end_file_name|><|fim▁begin|>import os
import sys
import textwrap
from collections import OrderedDict
from argparse import ArgumentParser, RawDescriptionHelpFormatter
from faice.tools.run.__main__ import main as run_main
from faice.tools.run.__main__ import DESCRIPTION as RUN_DESCRIPTION
from ... | |
<|file_name|>RhnQueueJob.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2009--2012 Red Hat, Inc.
*
* This software is licensed to you under the GNU General Public License,
* version 2 (GPLv2). There is NO WARRANTY for this software, express or
* implied, including the implied warranties of MERCHANTABILITY o... | try { |
<|file_name|>title_test.py<|end_file_name|><|fim▁begin|>from os.path import abspath, dirname, join
from unittest.mock import MagicMock, Mock, call<|fim▁hole|>from netflix.data.genre import NetflixGenre
from netflix.parsers.title import NetflixTitleParser
from netflix.utils import netflix_url
class TestNetflixTitlePa... |
from tests.common import NetflixTestFixture
|
<|file_name|>storage_data.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import absolute_import
from .base_model_ import Model
from datetime import date, datetime
from typing import List, Dict
from ..util import deserialize_model
class StorageData(Model):
"""
NOTE: This class is auto generat... | @comment.setter
def comment(self, comment):
""" |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import Image from 'next/image'
import styles from '../styles/Home.module.scss'
import About from '../components/About/About'
import Header from '../components/Header/Header'
import Photo from '../components/Photo/Photo'
import { HomeContextProvider } from '../contexts/... | />
</div> |
<|file_name|>Stack2.py<|end_file_name|><|fim▁begin|>"""
By Simon Harms.
Copyright 2015 Simon Harms, MIT LICENSE
Name: Stack2
Summary: Stack Version 2
"""
class Stack:
"""
Python Stack V2 with view and change.
"""
def __init__(self):
"""
Initialize the Stack.
"""
self._... | """
return len(self.__storage)
def get_stack(self): |
<|file_name|>97bbc733896c_create_oauthclient_tables.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"... | down_revision = '44ab9963e8cf'
branch_labels = ()
depends_on = '9848d0149abd' |
<|file_name|>TypeEqual.hh<|end_file_name|><|fim▁begin|>#ifndef LUCE_HEADER_TYPETRAIT_TYPEEQUAL_HH
#define LUCE_HEADER_TYPETRAIT_TYPEEQUAL_HH
#include <Luce/Configuration.hh>
#include <Luce/Utility/NonComparable.hh>
<|fim▁hole|> namespace TypeTrait
{
template<typename Lhs_, typename Rhs_>
struct TypeEqual L... | #include <Luce/Utility/NonCopyable.hh>
namespace Luce
{
|
<|file_name|>meeg.py<|end_file_name|><|fim▁begin|>"""
scitran.data.meeg
=================
Data format for M/EEG data using mne-python.
"""
import logging
import tempfile
import zipfile
import warnings
import os
from os import path as op
from datetime import datetime, date
import shutil
from mne.io import read_raw_f... |
@property |
<|file_name|>JsonOutput.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2012 by Pentaho : http://www.pentaho.com
*
*******************************************************************************
... | break;
case ValueMeta.TYPE_NUMBER:
jo.put(outputField.getElementName(), data.inputRowMeta.getNumber(row, data.fieldIndexes[i])); |
<|file_name|>element.rs<|end_file_name|><|fim▁begin|>use event;
use text;
use modifier;
/// A stream representing a single element.
#[derive(Debug)]<|fim▁hole|>impl<S> SingleElement<S> {
pub(crate) fn new(stream: S, event: event::Event) -> SingleElement<S> {
SingleElement {
state: modifier::St... | pub struct SingleElement<S> {
state: modifier::State<SingleElementState<S>>,
}
|
<|file_name|>day_05.rs<|end_file_name|><|fim▁begin|>pub fn first() {
let filename = "day05-01.txt";
let mut lines: Vec<String> = super::helpers::read_lines(filename)
.into_iter()
.map(|x| x.unwrap())
.collect();
lines.sort();
let mut max = 0;
for line in lines {
le... | let mut gap = max - min + 1;
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[cfg(feature = "backend_session")]
use std::cell::RefCell;
use std::os::unix::io::{AsRawFd, RawFd};
use std::path::PathBuf;
use std::sync::{atomic::AtomicBool, Arc};
use std::time::{Instant, SystemTime};
use calloop::{EventSource, Interest, Poll, PostAction, Readiness,... | DrmDeviceInternal::Legacy(dev) => dev.fd.as_raw_fd(),
} |
<|file_name|>BillingEntity.ts<|end_file_name|><|fim▁begin|>module BillForward {
export type EntityReference = string | BillingEntity;
export class BillingEntity {
protected _client:Client;
protected _exemptFromSerialization:Array<string> = ['_client', '_exemptFromSerialization', '_registeredEntities', '_r... | |
<|file_name|>background.py<|end_file_name|><|fim▁begin|>import tornado.web
from datetime import date
from sqlalchemy.orm.exc import NoResultFound
from pyprint.handler import BaseHandler
from pyprint.models import User, Link, Post
class SignInHandler(BaseHandler):
def get(self):
return self.background_ren... | tags = self.get_argument('tags', '').strip().split(',')
if not title or not content:
return self.redirect('/kamisama/posts/add')
|
<|file_name|>comment-douyu.py<|end_file_name|><|fim▁begin|>import socket
import time
import random
import threading
import re
import json
import sys
import os
import platform
import notify2
from urllib import request
g_rid= b'265352'
g_username= b'visitor42'
g_ip= b'danmu.douyutv.com'
g_port= 8601
g_gid= b'0'
g_exit= ... |
def notify(title, message):
if sysinfo == 'Linux':
os.system('notify-send {}'.format(': '.join([title, message]))) |
<|file_name|>app.e2e-spec.ts<|end_file_name|><|fim▁begin|>import { AppPage } from './app.po';<|fim▁hole|> let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to app!');
});... |
describe('avam-sp App', () => { |
<|file_name|>manipulating_objects.js<|end_file_name|><|fim▁begin|>// Manipulating JavaScript Objects
// I worked on this challenge: [by myself, with: ]
// There is a section below where you will write your code.
// DO NOT ALTER THIS OBJECT BY ADDING ANYTHING WITHIN THE CURLY BRACES!
var terah = {
name: "Terah",
... |
assert( |
<|file_name|>header.ts<|end_file_name|><|fim▁begin|>export class Header {
readonly title: string;
readonly link: string;
active: boolean;
viewing: boolean;
}
export enum HeaderTitles {
HOME = 'Home',
OUR_STORY = 'Our Story',
DETAILS = 'Details',
RSVP = 'RSVP',
MIAMI = 'Miami',
PHOTOS = 'Photos',
REGISTRY = ... | OUR_STORY = '/our-story', |
<|file_name|>mod.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/LI... | // except according to those terms.
//! Android-specific definitions |
<|file_name|>byte_vs_string_obj.py<|end_file_name|><|fim▁begin|>a = 'GeeksforGeeks'
# initialising a byte object
c = b'GeeksforGeeks'
# using encode() to encode the String
# encoded version of a is stored in d
# using ASCII mapping
d = a.encode('ASCII')
# checking if a is converted to bytes or not
if (d==c):
... | print ("Decoding successful") |
<|file_name|>jut_run_tests.py<|end_file_name|><|fim▁begin|>"""
basic set of `jut run` tests
"""
import json
import unittest
from tests.util import jut
BAD_PROGRAM = 'foo'
BAD_PROGRAM_ERROR = 'Error line 1, column 1 of main: Error: no such sub: foo'
class JutRunTests(unittest.TestCase):
def test_jut_run_synt... | points = json.loads(process.read_output())
process.expect_eof() |
<|file_name|>Map.Control.js<|end_file_name|><|fim▁begin|>L.Map.include({
addControl: function (control) {
control.addTo(this);
return this;
},
removeControl: function (control) {
control.removeFrom(this);
return this;
},
_initControlPos: function () {<|fim▁hole|> l = 'leaflet-',
container = th... | var corners = this._controlCorners = {}, |
<|file_name|>Paddle.js<|end_file_name|><|fim▁begin|>/*
* This class represent a game paddle
*/
'use strict';
import Vector from 'Vector.js';
export default class {
constructor(x, y, width, height, color = '#FFFFFF', speed = 3) {
this.width = width;
this.height = height;
this.color = color;
<|fim▁hole|... | |
<|file_name|>test_jsonrpc.py<|end_file_name|><|fim▁begin|>#
# This file is part of Gruvi. Gruvi is free software available under the
# terms of the MIT license. See the file "LICENSE" that was provided
# together with this source file for the licensing terms.
#
# Copyright (c) 2012-2017 the Gruvi authors. See the file ... | super(TestJsonRpcV2, self).setUp()
self.version = JsonRpcVersion.create('2.0')
def test_check_request(self): |
<|file_name|>GameObject.ts<|end_file_name|><|fim▁begin|>/// <reference path="Transform3D.ts" />
namespace zen {
export class GameObject extends Transform3D {
public name:string = "GameObject";
public tag:string = "";<|fim▁hole|>
private _guid:string = zen.guid.create();
public g... |
public layer:string = ""; |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Support for RESTful API sensors."""
import json
import logging
from xml.parsers.expat import ExpatError
import httpx
from jsonpath import jsonpath
import voluptuous as vol
import xmltodict
from homeassistant.components.sensor import DEVICE_CLASSES_SCHEMA, PLATFOR... | from homeassistant.const import (
CONF_AUTHENTICATION,
CONF_DEVICE_CLASS, |
<|file_name|>menu.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 Jeffery Olson
//
// Licensed under the 3-Clause BSD License, see LICENSE.txt
// at the top-level of this repository.
// This file may not be copied, modified, or distributed
// except according to those terms.
use std::vec::Vec;
use gfx::GameDis... | self.formatted_entries.push(formatted);
}
self.box_size = compute_text_box_bounds(
self.formatted_entries.as_slice(), ui_font, ui_box, self.text_gap); |
<|file_name|>component-info-header.component.ts<|end_file_name|><|fim▁begin|>/*!
* @license MIT
* Copyright (c) 2017 Bernhard Grünewaldt - codeclou.io
* https://github.com/cloukit/legal
*/
import { Component, Input } from '@angular/core';
import * as _ from 'lodash';<|fim▁hole|> template: `
<div class="info-head... |
@Component({
selector: 'app-component-info-header', |
<|file_name|>navController.js<|end_file_name|><|fim▁begin|>/* Copyright 2016 Devon Call, Zeke Hunter-Green, Paige Ormiston, Joe Renner, Jesse Sliter
This file is part of Myrge.
Myrge 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 S... | You should have received a copy of the GNU General Public License
along with Myrge. If not, see <http://www.gnu.org/licenses/>. */ |
<|file_name|>tables.py<|end_file_name|><|fim▁begin|>import logging
from django.utils.html import format_html
import django_tables2 as tables
from django_tables2.rows import BoundPinnedRow, BoundRow
logger = logging.getLogger(__name__)
# A cheat to force BoundPinnedRows to use the same rendering as BoundRows
# othe... | '<a class="alert-link" role="button" target="_blank" '
'href="{href}">View in Xero</a></span>',
href=record.get_xero_url()
) |
<|file_name|>ProxyStore.js<|end_file_name|><|fim▁begin|>/**
* ProxyStore is a superclass of {@link Ext.data.Store} and {@link Ext.data.BufferedStore}. It's never used directly,
* but offers a set of methods used by both of those subclasses.
*
* We've left it here in the docs for reference purposes, but unless you n... | for (i = 0, len = removed.length; i < len; ++i) { |
<|file_name|>radioInterface.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2008, 2009 Free Software Foundation, Inc.
*
* This software is distributed under the terms of the GNU Affero Public License.
* See the COPYING file in the main directory for details.
*
* This use of this software may be subject to additional re... | sendCursor,
&underrun, |
<|file_name|>launcher.rs<|end_file_name|><|fim▁begin|>extern crate foo;
use std::io::stdio::stdout;
use std::io::BufferedWriter;<|fim▁hole|>use foo::Template;
#[test]
fn test_execution_of_produce_file() {
foo::Template(&mut BufferedWriter::new(~stdout() as ~Writer), 4);
}
#[test]
fn test_parsing_and_execution() {
}... | |
<|file_name|>VectorEncoder.py<|end_file_name|><|fim▁begin|>#encoding=utf-8
#一大类特征
from scipy import sparse
import re
class VectorEncoder(object):
def __init__(self):
self.n_size = 0
self.idmap = {}
def fit(self, X):
for row in X:
units = re.split("\\s+", row)
for ... | |
<|file_name|>padding.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import o... | )
result = self._buffer[:finished_blocks * (self.block_size // 8)] |
<|file_name|>react-native-firebase.js<|end_file_name|><|fim▁begin|>export default {
analytics: () => {
return {
logEvent: () => {},
setCurrentScreen: () => {}
};
}<|fim▁hole|><|fim▁end|> | }; |
<|file_name|>tools.py<|end_file_name|><|fim▁begin|>import time
def import_grid(file_to_open):
grid = []
print(file_to_open)
with open(file_to_open) as file:
for i, line in enumerate(file):
if i == 0:
iterations = int(line.split(" ")[0])
delay =... | line = line.strip()
for item in line:
grid[i-1].append(int(item))
|
<|file_name|>issue22656.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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... | // min-lldb-version: 310 |
<|file_name|>configuration.go<|end_file_name|><|fim▁begin|>// Copyright © 2017 The Things Network. Use of this source code is governed by the MIT license that can be found in the LICENSE file.
package pktfwd
import (
"github.com/TheThingsNetwork/go-account-lib/account"
"github.com/TheThingsNetwork/go-utils/log"
"g... | return nil
}
func configureIndividualChannels(ctx log.Interface, conf util.Config) error { |
<|file_name|>genetic_modification.py<|end_file_name|><|fim▁begin|>import pytest
@pytest.fixture
def genetic_modification(testapp, lab, award):
item = {
'award': award['@id'],
'lab': lab['@id'],
'modified_site_by_coordinates': {
'assembly': 'GRCh38',
'chromosome': '1... | |
<|file_name|>test_sup.rs<|end_file_name|><|fim▁begin|>//! Encapsulate running the `hab-sup` executable for tests.
use std::{collections::HashSet,
env,
net::TcpListener,
path::{Path,
PathBuf},
process::{Child,
Command,
Stdi... | .expect("No process to kill!") |
<|file_name|>averageZeroSignalsWithinPeaks.py<|end_file_name|><|fim▁begin|>import sys
import argparse
from itertools import izip
import math
def parseArgument():
# Parse the input
parser = argparse.ArgumentParser(description = "Make regions with 0 signal the average of their surrounding regions")
parser.add_argumen... | elif (lastPeakIndex == lastLastPeakIndex) and (not math.isnan(lastLastSignal)): |
<|file_name|>imagefilter.rs<|end_file_name|><|fim▁begin|>//! MMX image filters
extern crate c_vec;
use std::mem;
use libc::{self,size_t, c_void, c_uint, c_int};
use ::get_error;
use c_vec::CVec;
mod ll {
/* automatically generated by rust-bindgen */
use libc::*;
extern "C" {
pub fn SDL_imageFilte... | }
/// Filter using ClipToRange: D = (S >= Tmin) & (S <= Tmax) S:Tmin | Tmax.
pub fn clip_to_range(src1: CVec<u8>, tmin: u8, tmax: u8) -> Result<CVec<u8>, String> { |
<|file_name|>hooks.py<|end_file_name|><|fim▁begin|>import os
def post_add(conf, name):
if "POST_ADD_HOOK" in conf:
if "NEW_PASSWORD_NAME" in os.environ:
del os.environ["NEW_PASSWORD_NAME"]<|fim▁hole|>
passwd_dir = os.path.expanduser(os.path.expandvars(conf["PASSWD_DIR"]))
hook_exec = os.path.expandvars(conf... | |
<|file_name|>client.rs<|end_file_name|><|fim▁begin|>// Copyright © 2014, Peter Atashian
use std::io::timer::sleep;
use std::io::{TcpStream};
use std::sync::Arc;
use std::sync::atomics::{AtomicUint, SeqCst};
use std::task::TaskBuilder;
use std::time::duration::Duration;
fn main() {
let count = Arc::new(AtomicUint:... | Ok(tcp) => tcp,
Err(_) => return, |
<|file_name|>files.cpp<|end_file_name|><|fim▁begin|>/*
* A small crossplatform set of file manipulation functions.
* All input/output strings are UTF-8 encoded, even on Windows!
*
* Copyright (c) 2017-2020 Vitaly Novichkov <admin@wohlnet.ru>
*
* Permission is hereby granted, free of charge, to any person obtainin... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup
setup(
name='captcha2upload',
packages=['captcha2upload'],
package_dir={'captcha2upload': 'src/captcha2upload'},
version='0.2',
install_requires=['requests'],
description='Upload your image and solve captche usi... | url='https://github.com/Mirio/captcha2upload',
download_url='https://github.com/Mirio/captcha2upload/tarball/0.1',
keywords=['2captcha', 'captcha', 'Image Recognition'],
classifiers=["Topic :: Scientific/Engineering :: Image Recognition"], |
<|file_name|>supplemental.min.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1<|fim▁hole|><|fim▁end|> | oid sha256:2624aaed17536733cabbaeeac1e3b7c75455924c253869c12a812940c3e1241f
size 1195 |
<|file_name|>setup-seafile-mysql.py<|end_file_name|><|fim▁begin|>#coding: UTF-8
'''This script would guide the seafile admin to setup seafile with MySQL'''
import sys
import os
import time
import re
import shutil
import glob
import subprocess
import hashlib
import getpass
import uuid
import warnings
import MySQLdb
f... | def validate(port): |
<|file_name|>authentication.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from oauth2 import Consumer, Client, Token
from httplib2 import ProxyInfo
from httplib2.socks import PROXY_TYPE_HTTP
from django.conf import settings
class Authentication(object):
def __init__(self, consumer_key, consumer_secre... | proxy_info = None |
<|file_name|>issue-88844.rs<|end_file_name|><|fim▁begin|>// Regression test for #88844.
struct Struct { value: i32 }
//~^ NOTE: similarly named struct `Struct` defined here
impl Stuct {
//~^ ERROR: cannot find type `Stuct` in this scope [E0412]
//~| HELP: a struct with a similar name exists<|fim▁hole|> Self { ... | fn new() -> Self { |
<|file_name|>lunet2.py<|end_file_name|><|fim▁begin|>import DeepFried2 as df
from .. import dfext
def mknet(mkbn=lambda chan: df.BatchNormalization(chan, 0.95)):
kw = dict(mkbn=mkbn)
net = df.Sequential(
# -> 128x48
df.SpatialConvolutionCUDNN(3, 64, (7,7), border='same', bias=None),
df... | |
<|file_name|>matrix.hpp<|end_file_name|><|fim▁begin|>/*
* MATRIX COMPUTATION FOR RESERVATION BASED SYSTEMS<|fim▁hole|> *
* Copyright (C) 2013, University of Trento
* Authors: Luigi Palopoli <palopoli@disi.unitn.it>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of th... | |
<|file_name|>auditTime.ts<|end_file_name|><|fim▁begin|>import {async} from '../scheduler/async';
import {Operator} from '../Operator';
import {Scheduler} from '../Scheduler';
import {Subscriber} from '../Subscriber';
import {Observable} from '../Observable';
import {Subscription} from '../Subscription';
/**
* Ignores... | clearThrottle(): void {
const { value, hasValue, throttled } = this; |
<|file_name|>pki_helpers_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 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.... | expectedIPAddresses: []string{"10.96.0.1", "1.2.3.4", "10.1.245.94", "10.1.245.95"}, |
<|file_name|>editeur.js<|end_file_name|><|fim▁begin|>$(document).ready(function () {
// Regex pour avoir les contenus des balises <amb>
// Exemple : L'<amb>avocat</amb> mange des <amb>avocats</amb>.
// Donne : $1 = avocat, puis $1 = avocats
var regAmb = new RegExp('<amb>(.*?)</amb>', 'ig');
// Rege... | |
<|file_name|>Resources_ja.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General... | "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0\u540D"}, //-srcprovidername
{"source.keystore.password", |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.