prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># Python script to perform consistency analysis on metabolic models
# Copyright (C) 2015 Miguel Ponce de Leon
# Contact: miguelponcedeleon@gmail.com
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public ... | |
<|file_name|>app.e2e-spec.ts<|end_file_name|><|fim▁begin|>import { NgLandingPage } from './app.po';
describe('ng-landing App', () => {
let page: NgLandingPage;
beforeEach(() => {
page = new NgLandingPage();<|fim▁hole|> page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to app!');
});... | });
it('should display welcome message', () => { |
<|file_name|>0019_auto__del_likedcomment__del_comment__add_field_node_abs_parent__chg_fi.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm)... | ('score', self.gf('django.db.models.fields.IntegerField')(default=0)),
('user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='comments', to=orm['forum.User'])),
('deleted_at', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
|
<|file_name|>api.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.7
# Copyright 2010 Google 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 License at
#
# http://www.... | else:
owner_domain = _DEFAULT_OWNER_DOMAIN
self.SetTemplateValue('ownerDomain', owner_domain) |
<|file_name|>p2p-segwit.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2016 The PlanBcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test segwit transactions and blocks on P2P network."""
... | p2sh_txs[3].wit.vtxinwit[0].scriptWitness.stack = [pad, pad, pad, scripts[3]]
self.std_node.test_transaction_acceptance(p2sh_txs[3], True, False, b'bad-witness-nonstandard')
self.test_node.test_transaction_acceptance(p2sh_txs[3], True, True)
|
<|file_name|>images_client.py<|end_file_name|><|fim▁begin|># Copyright 2012 OpenStack Foundation
# 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
#
# ht... | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
|
<|file_name|>plugin_stop.py<|end_file_name|><|fim▁begin|># coding:utf8
class Plugin(object):
__doc__ = '''Плагин предназначен для остановки бота.
Для использования необходимо иметь уровень доступа {protection} или выше
Ключевые слова: [{keywords}]
Использование: {keyword}<|fim▁hole|> name = 'stop'
... | Пример: {keyword}'''
|
<|file_name|>hd_keychain.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2013-2016 John Connor (BM-NC49AxAjcqVcF5jNPu85Rb8MJ2d9JqZt)
*
* This file is part of vcash.
*
* vcash is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License with
* additiona... | (path[i + 2] < '0') || (path[i + 2] > '9') |
<|file_name|>default.py<|end_file_name|><|fim▁begin|># -*- coding: cp1254 -*-
# please visit http://www.iptvxtra.net<|fim▁hole|>icondir = xbmc.translatePath("special://home/addons/plugin.audio.radio7ulm/icons/")
plugin_handle = int(sys.argv[1])
def add_video_item(url, infolabels, img=''):
listitem = xbmcgui.ListIt... |
import xbmc,xbmcgui,xbmcplugin,sys |
<|file_name|>call.go<|end_file_name|><|fim▁begin|>/*
*
* Copyright 2014, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain... | |
<|file_name|>stack.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Buildable;
use Container;
use StackTransitionType;
use Widget;
use ffi;<|fim▁hole|>use glib::Value;
use glib::object::Downcast;... | use glib;
use glib::StaticType; |
<|file_name|>asdf.rs<|end_file_name|><|fim▁begin|>// compiler switches
#![allow(
unused_imports,
unused_variables,
)]
// libraries
extern crate matasano;
// imports
use std::collections::BTreeMap;
// local imports
use matasano::bytes::*;
<|fim▁hole|> let blocks = blockify( &bytes, 5);
for block in blocks {
prin... | fn main(){
let bytes : Bytes = (0..80).collect(); |
<|file_name|>Sentence_Terminal-code-points.js<|end_file_name|><|fim▁begin|>// All code points with the `Sentence_Terminal` property as per Unicode v9.0.0:
[
0x21,
0x2E,
0x3F,
0x589,
0x61F,
0x6D4,
0x700,
0x701,
0x702,
0x7F9,
0x964,
0x965,
0x104A,
0x104B,
0x1362,
0x1367,
0x1368,
0x166E,
0x1735,
0x1736... | 0x3002, |
<|file_name|>client.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 obtain a copy of the License at
#
# http://www.apache.org/licenses/... | |
<|file_name|>hub_api.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/.
//! Implementation of the Philips Hue API
//!
//! This module is... | structs::parse_json(&res).unwrap() // TODO no unwrap
}
|
<|file_name|>region-object-lifetime-5.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://... | |
<|file_name|>bcp.py<|end_file_name|><|fim▁begin|>import utils
import os
import shutil
import sys
def go( boost_root ):
OUTPUT = "src/third_party/boost"
if os.path.exists( OUTPUT ):
shutil.rmtree( OUTPUT )
cmd = [ "bcp" , "--scan" , "--boost=%s" % boost_root ]
src = utils.getAllSource... | |
<|file_name|>test_keyboard_interrupt.py<|end_file_name|><|fim▁begin|># Copyright 2016 Red Hat, 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/licenses/LICE... |
# isort: LOCAL |
<|file_name|>mod.rs<|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... | |
<|file_name|>index.rtr.js<|end_file_name|><|fim▁begin|>(function (angular) {
angular.module("rmApp", ["ui.router", "rmApp.templates", "rmApp.controllers"])
.config(["$stateProvider", "$urlRouterProvider", "$locationProvider", function ($stateProvider, $urlRouterProvider, $locationProvider) {
$ur... | controller: "rmCtrl"
}).state("spinner2", { |
<|file_name|>mock-server.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright 2015, 2016 Endless Mobile, Inc.
# This file is part of eos-event-recorder-daemon.
#
# eos-event-recorder-daemon is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as ... | |
<|file_name|>RonnyView.java<|end_file_name|><|fim▁begin|>package de.baleipzig.iris.ui.playground;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener;
import com.vaadin.spring.annotation.SpringView;
import com.vaadin.spring.annotation.UIScope;
import com.vaadin.ui.Label;
import com.vaadin.... |
import javax.annotation.PostConstruct; |
<|file_name|>constants.rs<|end_file_name|><|fim▁begin|>//! Defines some usefull constants
/// Properties names constant for HTTP headers
<|fim▁hole|> pub const ACCEPT: &'static str = "Accept";
pub const DATE: &'static str = "Date";
pub const LOCATION: &'static str = "Location";
}
/// Mime types constants
pu... | pub mod properties {
pub const CONTENT_LENGTH: &'static str = "Content-Length";
pub const CONTENT_TYPE: &'static str = "Content-Type";
|
<|file_name|>RunHill.py<|end_file_name|><|fim▁begin|>"""
AUTHOR: Peter Collins, 2005.
This software is Copyright (C) 2004-2008 Bristol University
and is released under the GNU General Public License version 2.
MODULE: RunHill
PURPOSE:
A sample setup and configuration for the normalization algorithms.
NOTES:
See ... | config["run_normal_form_python"] = True |
<|file_name|>cre.locate_sample.py<|end_file_name|><|fim▁begin|>#!/hpf/largeprojects/ccmbio/naumenko/tools/bcbio/anaconda/bin/python
"""
Looks for a specific sample
"""
import re
import sys
import os
import os.path
sample = sys.argv[1]
family,sample_only = sample.split("_")
match = re.match('\d*',family)
if match:... | report_path = prefix+'x/'+family
|
<|file_name|>credential-types.strings.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
let t = this.t;
let ns = this.credential_types;
ns.deleteCredentialType = {
CREDENTIAL_TYPE_IN_USE: t.s('This credential type is currently being used by one or more credentials. Credentials that use this credential ... | function CredentialTypesStrings (BaseString) {
BaseString.call(this, 'credential_types'); |
<|file_name|>bookmarkletSource.js<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2005-2013 University of Sydney
*
* Licensed under the GNU License, Version 3.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.gnu.org/licenses/gpl... | * @subpackage !!!subpackagename for file such as Administration, Search, Edit, Application, Library
*/
|
<|file_name|>TestYamlConfigReader.java<|end_file_name|><|fim▁begin|>/*
* (C) Copyright 2017 Netcentric AG.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http:... | super.setupAuthorizableBean(authorizableConfigBean, currentPrincipalDataMap, authorizableId, isGroupSection);
((TestAuthorizableConfigBean) authorizableConfigBean).setAssertedExceptionString(getMapValueAsString(
currentPrincipalDataMap, ASSERTED_EXCEPTION));
} |
<|file_name|>account_document_tax.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# 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... | |
<|file_name|>StringData.js<|end_file_name|><|fim▁begin|>/**
* Data that contains a string.
* @param {string} value
* @param {boolean} [isValid=true]
* @constructor
*/
function StringData(value, isValid) {
Data.call(this, Data.types.string, value, isValid);
}<|fim▁hole|> * If the value could represent a number, it... | StringData.prototype = Object.create(Data.prototype);
StringData.prototype.constructor = StringData;
/** |
<|file_name|>chooser.js<|end_file_name|><|fim▁begin|>function(modal) {
function ajaxifyLinks (context) {
$('a.address-choice', context).click(function() {
modal.loadUrl(this.href);
return false;
});
$('.pagination a', context).click(function() {
v... | data: formdata,
|
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>import os<|fim▁hole|> os.environ['DJANGO_SETTINGS_MODULE'] = 'flooding.windows'
from django.core import management
if __name__ == '__main__':
management.execute_from_command_line()<|fim▁end|> |
if not 'DJANGO_SETTINGS_MODULE' in os.environ: |
<|file_name|>plotfs_detec.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import vtktools
import sys
import math
import re
import matplotlib.pyplot as plt
import getopt
from scipy.special import erf
from numpy import poly1d
from matplotlib.pyplot import figure, show
from numpy import pi, sin, linspace
from ma... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The GLFW-RS Developers. For a full listing of the authors,
// refer to the AUTHORS file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compli... | pub unsafe fn GetIntegerv(pname: GLenum, params: *GLint) {
glGetIntegerv(pname, params)
}
|
<|file_name|>missing-return.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified,... | // 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.
// |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! **Canonicalization** is the key to constructing a query in the
//! middle of type inference. Ordinarily, it is not possible to store
//! types from type inference in query keys, because they contain
//! references to inference variables whose lifetimes are too short
... | use crate::infer::{ConstVariableOrigin, ConstVariableOriginKind};
use crate::infer::{InferCtxt, RegionVariableOrigin, TypeVariableOrigin, TypeVariableOriginKind}; |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use bitmap::Image;
// see read_ppm implementation in the bitmap library
pub fn main() {<|fim▁hole|> // read a PPM image, which was produced by the write-a-ppm-file task
let image = Image::read_ppm("./test_image.ppm").unwrap();
println!("Read using nom pars... | |
<|file_name|>compressor.rs<|end_file_name|><|fim▁begin|>/*
* Copyright 2021 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 obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.... | |
<|file_name|>limits.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# 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://ww... | quotas = QUOTAS.get_project_quotas(context, project_id,
usages=False)
abs_limits = dict((k, v['limit']) for k, v in quotas.items())
rate_limits = req.environ.get("nova.limits", []) |
<|file_name|>intrinsic-return-address.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://... | extern "rust-intrinsic" {
fn return_address() -> *const u8; |
<|file_name|>qgsnewnamedialog.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
qgsnewnamedialog.cpp
-------------------
begin : May, 2015
copyright : (C) 2015 Radim Blazek
email ... | QgsDebugMsg( "entered" ); |
<|file_name|>config.go<|end_file_name|><|fim▁begin|>package main
type FluxConfig struct {
Iam string `toml:"iam"`
Url string `toml:"url"`
Port int `toml:"port"`
Logdir string `toml:"logdir"`
Balancer FluxCluster `toml:"cluster"`
//Jwts []JwtAuth `toml:"jwt"`
}
type J... | DecryptionSecret string `toml:"secret"`
} |
<|file_name|>FacetFilter.js<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2005-2015 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco 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 Softwar... | this.applied = false;
}, |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse
from django.core.servers.basehttp import FileWrapper
from django.contrib.auth.models import User
from django.shortcuts import render_to_response, redirect, get_object_or_404
from requests import get
from urllib import urlretrieve
... | repo = get_object_or_404(Repository, owner=owner, name=repo_name)
collaborators = repo.collaborators.all() |
<|file_name|>lightbot.js<|end_file_name|><|fim▁begin|><|fim▁hole|>// var Spark = require("spark-io");
var Spark = require("../");
var five = require("johnny-five");
var Sumobot = require("sumobot")(five);
keypress(process.stdin);
var board = new five.Board({
io: new Spark({
token: process.env.SPARK_TOKEN,
d... | var keypress = require("keypress"); |
<|file_name|>b.js<|end_file_name|><|fim▁begin|>function almostPerfect() {<|fim▁hole|>
for(var i = 0; i < 10; i++)
almostPerfect();<|fim▁end|> | console.log("Hello, world!");
}; |
<|file_name|>instance_pit_of_saron.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2005-2011 MaNGOS <http://www.getmangos.com/>
*
* Copyright (C) 2008-2011 Trinity <http://www.trinitycore.org/>
*
* Copyright (C) 2006-2011 ScriptDev2 <http://www.scriptdev2.com/>
*
* Copyright (C) 2010-2011 VoragineCore <http:... | break;
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from pivoteer import *<|fim▁hole|><|fim▁end|> | from pivotEngine import *
from pivotUtils import * |
<|file_name|>LabeledStatementTransformer.ts<|end_file_name|><|fim▁begin|>import { inject, injectable, } from 'inversify';
import { ServiceIdentifiers } from '../../container/ServiceIdentifiers';
import * as estraverse from '@javascript-obfuscator/estraverse';
import * as ESTree from 'estree';
import { TNodeWithLexica... | } |
<|file_name|>792_number-of-matching-subsequences.py<|end_file_name|><|fim▁begin|>import bisect
class Solution:
def numMatchingSubseq(self, S: str, words):
d = {}
for i, x in enumerate(S):
if x not in d: d[x] = [i]
else: d[x].append(i)<|fim▁hole|> ans = []
for w... | |
<|file_name|>cksum.rs<|end_file_name|><|fim▁begin|>#![crate_name = "uu_cksum"]
/*
* This file is part of the uutils coreutils package.
*
* (c) Michael Gehring <mg@ebfe.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
#[macro_... | static LONG_HELP: &'static str = "";
|
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use alloc::boxed::Box;
use collections::string::String;
use core::fmt::{self, Debug, Display};
use core::marker::{Send, Sync, Reflect};
/// Base functionality for all errors in Rust.
//#[stable(feature = "rust1", since = "1.0.0")]
pub trait Error: Debug + Display + Re... | |
<|file_name|>text.ts<|end_file_name|><|fim▁begin|>export function escapeText(text: string) {
// http://www.javascriptkit.com/jsref/escapesequence.shtml
// \b Backspace.
// \f Form feed.
// \n Newline.
// \O Nul character.
// \r Carriage return.
// \t Horizontal tab.
// \v Vertical tab.
// \' Single qu... | |
<|file_name|>StructureScopedBinder.ts<|end_file_name|><|fim▁begin|>import {ScopedStructure} from "./../../../../structures";
import {Scope} from "./../../../../definitions";
import {ScopedBinder} from "./../../../base";
export class StructureScopedBinder extends ScopedBinder {
constructor(private readonly structu... | |
<|file_name|>Target.py<|end_file_name|><|fim▁begin|>'''
Kurgan AI Web Application Security Analyzer.
http://www.kurgan.com.br/
Author: Glaudson Ocampos - <glaudson@vortexai.com.br>
Created in May, 11th 2016.
'''
import requests
import config
import sys
import warnings
import validators
sys.path.append('../')
class ... | return self.baseUrl
|
<|file_name|>test_Sexp.py<|end_file_name|><|fim▁begin|>import unittest
import copy
import gc
import rpy2.rinterface as rinterface
rinterface.initr()<|fim▁hole|>
x = "a"
self.assertRaises(ValueError, rinterface.Sexp, x)
def testNew(self):
sexp = rinterface.baseenv.get("letters")
sex... |
class SexpTestCase(unittest.TestCase):
def testNew_invalid(self): |
<|file_name|>vision-gen.go<|end_file_name|><|fim▁begin|>// Package vision provides access to the Cloud Vision API.
//
// See https://cloud.google.com/vision/
//
// Usage example:
//
// import "google.golang.org/api/vision/v1"
// ...
// visionService, err := vision.New(oauthHttpClient)
package vision // import "go... | if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath} |
<|file_name|>container_linux.go<|end_file_name|><|fim▁begin|>// +build linux
package libcontainer
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strings"
"sync"
"syscall"
"github.com/Sirupsen/logrus"
"github.com/docker/libcontainer/cgroups"
"github.com/docker/libcontainer/conf... | break |
<|file_name|>lib.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/. */
//! This module contains shared types and messages for use by dev... | /// One CSS "px" in the root coordinate system for the content document.
/// |
<|file_name|>generated.rs<|end_file_name|><|fim▁begin|>// =================================================================
//
// * WARNING *
//
// This file is generated!
//
// Changes made to this file will be overwritten. If changes are
// required to the generated code... | .unwrap_or_else(|| "Unknown"),
};
// message can come in either "message" or "Message" |
<|file_name|>DateValueSortFunction.java<|end_file_name|><|fim▁begin|>import com.google.common.base.Function;
import javax.annotation.Nullable;
/**
* Created by ckale on 10/29/14.
*/
public class DateValueSortFunction implements Function<PojoDTO, Long>{
@Nullable
@Override<|fim▁hole|><|fim▁end|> | public Long apply(@Nullable final PojoDTO input) {
return input.getDateTime().getMillis();
}
} |
<|file_name|>PropertiesFileMergerTask.java<|end_file_name|><|fim▁begin|>/* **********************************************************************
/*
* NOTE: This copyright does *not* cover user programs that use Hyperic
* program services by normal system calls through the application
* program interfaces provided a... | * details. |
<|file_name|>test_cache_manager.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
... | def __init__(self, tmpdir):
InvalidationCacheManager.__init__(self, AppendingCacheKeyGenerator(), tmpdir, True, None)
|
<|file_name|>ExampleUnitTest.java<|end_file_name|><|fim▁begin|>package wanghaisheng.com.yakerweather;
import org.junit.Test;
import static org.junit.Assert.*;<|fim▁hole|>/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addi... | |
<|file_name|>test_onset.py<|end_file_name|><|fim▁begin|>'''
Unit tests for mir_eval.onset
'''
import numpy as np
import json
import mir_eval
import glob
import warnings
import nose.tools
A_TOL = 1e-12
# Path to the fixture files
REF_GLOB = 'data/onset/ref*.txt'
EST_GLOB = 'data/onset/est*.txt'
SCORES_GLOB = 'data/on... |
def test_onset_functions(): |
<|file_name|>http_loader.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 resource_task::{Metadata, Payload, Done, LoadResponse... | }
|
<|file_name|>redisstore.go<|end_file_name|><|fim▁begin|>package gocaptcha
import (
"bytes"
"crypto/md5"
"encoding/gob"
"encoding/hex"
"fmt"
"log"
"strconv"
"strings"
"time"
"gopkg.in/redis.v2"
)
func init() {
RegisterStore(storeName, CreateCaptchaRedisStore)
}
const (
captchaKeyFormat = "captcha:text:%s... | func (this *CaptchaRedisStore) encodeCaptchaInfo(captcha *CaptchaInfo) ([]byte, error) { |
<|file_name|>test_operator.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 A... | # check_dropout_ratio(0.25, shape, cudnn_off=False)
check_passthrough(0.5, shape)
check_passthrough(0.0, shape) |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
<|fim▁hole|>
def reqs(*f):
return list(filter(None, [strip_comments(l) for l in open(
os.path.join(os.getcwd(), *f)).readlines()]))
def get_version(version_tuple):
if not ... | def strip_comments(l):
return l.split('#', 1)[0].strip() |
<|file_name|>ODLv21Listener.py<|end_file_name|><|fim▁begin|># Generated from java-escape by ANTLR 4.5
from antlr4 import *
# This class defines a complete listener for a parse tree produced by ODLv21Parser.
class ODLv21Listener(ParseTreeListener):
# Enter a parse tree produced by ODLv21Parser#label.
def enter... | def enterAssignment_stmt(self, ctx): |
<|file_name|>alerter.py<|end_file_name|><|fim▁begin|>from amon.apps.alerts.checkers.system import system_alerts
from amon.apps.alerts.checkers.process import process_alerts
from amon.apps.alerts.checkers.plugin import plugin_alerts
from amon.apps.alerts.checkers.healthcheck import healthcheck_alert_checker
from amon.ap... | if len(rules) + len(process_data_dict) > 0:
for rule in rules:
process_id = rule['process'] |
<|file_name|>MethodNative_string_isEmpty.java<|end_file_name|><|fim▁begin|>package org.bds.lang.nativeMethods.string;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import org.bds.lang.Parameters;
import org.bds.lang.Type;
import org.bds.lang.TypeList;
import org.bds.lang.nativeMethods... | import org.bds.task.Task; |
<|file_name|>sapi51.rs<|end_file_name|><|fim▁begin|>// Copyright © 2017 winapi-rs developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// All files in the ... | LangID: WORD, |
<|file_name|>test_settings.py<|end_file_name|><|fim▁begin|>import os
import django
TEST_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'tests')
COMPRESS_CACHE_BACKEND = 'locmem://'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INST... | SECRET_KEY = "iufoj=mibkpdz*%bob952x(%49rqgv8gg45k36kjcg76&-y5=!"
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.UnsaltedMD5PasswordHasher', |
<|file_name|>fMatrices.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
#-*- coding: utf-8 -*-
def absMat(matrice):
'''Renvoie la matrice avec la valeur absolue de tous ses coefficients. Renvoie False si échec.
- matrice
- complexe
'''
if type(matrice) is not list:
raise Exception("absMat... | colonne = int(colonne) |
<|file_name|>quota_admission.go<|end_file_name|><|fim▁begin|>package imageapis
import (
"fmt"
"time"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kutilerrors "k8s.io/apimachinery/pkg/util/errors"
kapi "k8s.io/kubernetes/pkg/apis/core"
g "github.com/onsi/ginkgo"
o "gith... | _, err = oc.InternalAdminKubeClient().Core().ResourceQuotas(oc.Namespace()).Update(rq)
if err != nil {
return nil, err
} |
<|file_name|>angular2.webpack.config.js<|end_file_name|><|fim▁begin|>const path = require( 'path' );
const pkg = require( './package.json' );
const webpack = require( 'laxar-infrastructure' ).webpack( {
context: __dirname,
resolve: {
extensions: [ '.js', '.jsx', '.ts', '.tsx' ]
},
module: {
rul... | ]; |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
import glob
import sys
#VERSION="2.1dev4"
VERSION="2.6dev5"
# Taken from kennethreitz/requests/setup.py
package_directory = os.path.realpath(os.path.dirname(__file__))
def get_file_conten... | |
<|file_name|>TransportSearchCountAction.java<|end_file_name|><|fim▁begin|>/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* t... | |
<|file_name|>label.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2015, The Rust-GNOME Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
<|fim▁hole|>
use ffi;
use glib::{to_boo... | use libc::{c_int, c_double};
use glib::translate::{from_glib_none, ToGlibPtr}; |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for central_service project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build path... | 'rest_framework.permissions.IsAdminUser',
] |
<|file_name|>model.py<|end_file_name|><|fim▁begin|># The content of this file was generated using the Python profile of libCellML 0.2.0.
from enum import Enum
from math import *
__version__ = "0.3.0"
LIBCELLML_VERSION = "0.2.0"
STATE_COUNT = 1
VARIABLE_COUNT = 2
class VariableType(Enum):
VARIABLE_OF_INTEGRATI... | variables[1] = 3.0*variables[0] |
<|file_name|>statemachine.py<|end_file_name|><|fim▁begin|># $Id: statemachine.py 6314 2010-04-26 10:04:17Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A finite state machine specialized for regular-expression-based text filters,
this module de... | |
<|file_name|>test_constants.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import unittest
from wechatpy.constants import WeChatErrorCode
class WeChatErrorCodeTestCase(unittest.TestCase):
"""ensure python compatibility"""
def test_error_code(self):
self.assertEqual(-1000, WeChatErrorCode.SY... | |
<|file_name|>animate-path-animation-qQ-tT-inverse.js<|end_file_name|><|fim▁begin|>description("Test path animation where coordinate modes of start and end differ. You should see PASS messages");
createSVGTestCase();
// Setup test document
var path = createSVGElement("path");
path.setAttribute("id", "path");
path.setAt... | window.clickY = 70;
var successfullyParsed = true; |
<|file_name|>populate_auto.py<|end_file_name|><|fim▁begin|>import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'esite.settings')
import django
django.setup()
from auto.models import Car
#
def add_car(make, model, km, year, color, eng, drive,trans, icolor):
c = Car.objects.get_or_create(make=make, model=mod... | |
<|file_name|>Test.js<|end_file_name|><|fim▁begin|>describe("Test", function () {
function testRegex(regexText, text, expectedResult, allTextMatched = true) {
let textArray;
if (Array.isArray(text)) {
textArray = text;
} else {
textArray = [text];
}
co... | |
<|file_name|>baseFilter.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for ag-grid-community v20.2.0
// Project: http://www.ag-grid.com/
// Definitions by: Niall Crosby <https://github.com/ag-grid/>
import { Component } from "../widgets/component";
import { IFilterOptionDef, IDoesFilterPassParams, IFilterComp, I... | getNullableModel(): M | CombinedFilter<M>;
setModel(model: M | CombinedFilter<M>): void; |
<|file_name|>update-downloads.rs<|end_file_name|><|fim▁begin|>#![deny(warnings)]
extern crate cargo_registry;
extern crate postgres;
extern crate semver;
extern crate time;
use std::env;
use std::collections::HashMap;
use time::Duration;
use cargo_registry::{VersionDownload, Version, Model};
static LIMIT: i64 = 100... | |
<|file_name|>ObjectReference2.cpp<|end_file_name|><|fim▁begin|>/*
* ObjectReference2.cpp
*
* Created on: Oct 16, 2015
* Author: kfulks
*/
#include "../../Concept/Reference/ObjectReference2.h"
#include <iostream>
namespace gitux {
using namespace std;
ObjectReference2::ObjectReference2() :
myRef() {
/... | cout << "ObjectReference2 value is " << *myRef << endl;
}
|
<|file_name|>HttpClientExample.java<|end_file_name|><|fim▁begin|>package components;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.... | HttpPost post = new HttpPost(url);
post.setHeader("User-Agent", USER_AGENT);
List<NameValuePair> urlParameters = new ArrayList<NameValuePair>(); |
<|file_name|>snake_agent.py<|end_file_name|><|fim▁begin|># Przykladowy agent do zadania 'zagubiony Wumpus'. Agent porusza sie wezykiem.
import random
from action import Action
# nie zmieniac nazwy klasy
class Agent:
# nie zmieniac naglowka konstruktora, tutaj agent dostaje wszystkie informacje o srodowisku
d... | |
<|file_name|>function_statement.hh<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2019 ScyllaDB
*/
/*
* This file is part of Scylla.
*
* Scylla is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, e... | mutable std::vector<data_type> _arg_types;
static shared_ptr<cql_transport::event::schema_change> create_schema_change( |
<|file_name|>train.py<|end_file_name|><|fim▁begin|>'''
Training file with functions for
1) Taking in the inputs
2) Defining the model
3) Reading the input and generating batches
4) Defining the loss, learning rate and optimization functions
5) Running multiple epochs on training and testing
'''
import argparse
from re... | |
<|file_name|>static-methods-crate.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.
//<|fim▁hole|>// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. Th... | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
<|file_name|>source.js<|end_file_name|><|fim▁begin|>'use strict';
module.exports = Source;
const inherits = require('util').inherits;
const Stream = require('../stream');
const Chunk = require('../chunk');
const Compose = require('../through/compose');
const Break = require('../through/break');
const Filter = require... | Source.prototype.filter = function filter(fn, async){
return this.pipe(new Filter(fn, async)); |
<|file_name|>ixio.py<|end_file_name|><|fim▁begin|>import logging
import re
from datetime import datetime
from typing import List, Any, Dict, Union, Pattern
from pastehunter.common import base62_decode, base62_encode
from pastehunter.inputs.base_input import BasePasteSite
logger = logging.getLogger('pastehunter')
cl... | page.append({'pid': item_id, 'date': created_at})
last_item_id = item_id |
<|file_name|>action_handler.js<|end_file_name|><|fim▁begin|>/**
@module ember
@submodule ember-runtime
*/
import Ember from 'ember-metal/core';
import { Mixin } from 'ember-metal/mixin';
import { get } from 'ember-metal/property_get';
import { deprecateProperty } from 'ember-metal/deprecate_property';
/**
`Ember.Act... | }
} |
<|file_name|>utility-classes.js<|end_file_name|><|fim▁begin|>(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else {
var a = factory();
... | /************************************************************************/
/******/ ({
|
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>"""Unittests that do not require the server to be running an common tests of responses.
The TestCase here just calls the functions that provide the logic to the ws views with DummyRequest
objects to mock a real request.
The functions starting with `check_...` are cal... | pf = push_failure(request)
check_push_failure_response(self, pf) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.