prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>shipbonussupercarrierc2shieldresists.py<|end_file_name|><|fim▁begin|># shipBonusSupercarrierC2ShieldResists
#
# Used by:
# Ship: Wyvern
type = "passive"
<|fim▁hole|>def handler(fit, src, context):
fit.ship.boostItemAttr("shieldThermalDamageResonance", src.getModifiedItemAttr("shipBonusSupercarrierC2"),... | |
<|file_name|>record-pat.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/lice... | } |
<|file_name|>using_similarity.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from similaritymeasures import Similarity
def main():
""" main function to create Similarity class instance and get use of it """
measures = Similarity()
print measures.euclidean_distance([0,3,4,5],[7,6,3,-1])
print measures.j... | main() |
<|file_name|>ec2instanceinfo.py<|end_file_name|><|fim▁begin|>##############################################################################
#copyright 2013, Hamid MEDJAHED (hmedjahed@prologue.fr) Prologue #
#Licensed under the Apache License, Version 2.0 (the "License"); #
#you may not use this ... | <td class="cost" hour_cost="1.30">$1.30 per hour</td>
<td class="cost" hour_cost="1.61">$1.61 per hour</td>
</tr> |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Copyright (c) 2015, Philipp Klaus. All rights reserved.
License: GPLv3
"""
from distutils.core import setup
setup(name='netio230a',
version = '1.1.9',
description = 'Python package to control the Koukaam NETIO-230A',
lo... | packages = ['netio230a'],
scripts = ['scripts/netio230a_cli', 'scripts/netio230a_discovery', 'scripts/netio230a_fakeserver'], |
<|file_name|>static.py<|end_file_name|><|fim▁begin|>from django import template
from django.apps import apps
from django.utils.encoding import iri_to_uri
from django.utils.six.moves.urllib.parse import urljoin
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
return "<Pr... | |
<|file_name|>prune.rs<|end_file_name|><|fim▁begin|>use super::node::*;
use super::verification::{is_node_list_serial, is_node_serial};
use super::NodeCellRef;
use super::MIN_ENTRY_KEY;
use super::*;
use itertools::Itertools;
use std::borrow::Borrow;
use std::collections::{HashMap, HashSet};
use std::fmt::Debug;
use std... | left_node_len, |
<|file_name|>vecset.rs<|end_file_name|><|fim▁begin|>/**
* A set implemented as a binary vector.
*/
use std::cmp::Ordering;
use std::iter::{FromIterator, IntoIterator, range_step};
use std::default::Default;
use std::slice;
use std::fmt;
use test::Bencher;
/**
* A set implemented using a sorted vector. Due to memor... | |
<|file_name|>test_game.py<|end_file_name|><|fim▁begin|>from unittest2 import TestCase, main
from hadafuna.core.game import KoikoiGame
<|fim▁hole|> pass
if __name__ == '__main__':
main(verbosity=2)<|fim▁end|> | class KoikoiGameTest(TestCase): |
<|file_name|>python.py<|end_file_name|><|fim▁begin|>"""
A Python "serializer". Doesn't do much serializing per se -- just converts to
and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for
other serializers.
"""
from __future__ import unicode_literals
from collections import OrderedDict
... | data = OrderedDict([('model', force_text(model._meta))])
if not self.use_natural_primary_keys or not hasattr(obj, 'natural_key'):
data["pk"] = force_text(obj._get_pk_val(), strings_only=True) |
<|file_name|>model_spinnaker_plugin_info.go<|end_file_name|><|fim▁begin|>/*
* Spinnaker API
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: 1.0.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
pac... | Name string `json:"name,omitempty"`
Releases []SpinnakerPluginRelease `json:"releases"`
Id string `json:"id,omitempty"` |
<|file_name|>yaml.rs<|end_file_name|><|fim▁begin|>//! Conveniently read from a YAML file, e.g. for loading configs.
use std::io::Read;
use std::fs::File;
use std::path::Path;
use yaml_rust::{YamlLoader, Yaml};
/// Easily load a YAML file by filename.
pub fn load_from_yaml(fname: &str) -> Yaml {
let path = Path::n... | |
<|file_name|>htmlstyleelement.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 cssparser::{Parser as CssParser, ParserInput};
u... | let element = self.upcast::<Element>();
assert!(node.is_in_doc());
|
<|file_name|>update_interface_machine.py<|end_file_name|><|fim▁begin|># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor<|fim▁hole|># You may obtain a copy of the License at
#
# http://www.apache.org/licen... | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. |
<|file_name|>rule.ts<|end_file_name|><|fim▁begin|>import {Expression} from 'aurelia-binding';
export interface RuleProperty {
/**
* The property name. null indicates the rule targets the object itself.
*/
name: string|null;
/**
* The displayName of the property (or object).
*/<|fim▁hole|> property:... | displayName: string|null;
}
export interface Rule<TObject, TValue> { |
<|file_name|>game.py<|end_file_name|><|fim▁begin|>from merc.actor import Actor
from merc.collision import Collision
from merc.player import Player
from pprint import pprint
import sys
import json
import numpy
import itertools
from PIL import Image, ImageDraw, ImageColor
class Game:
NUM_TWEENS = 10
def __init__(sel... | continue
if not hasattr(component_actor.car, 'components'): |
<|file_name|>testing.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.
// Package testing provides support for automated testing of Go packages.
// It is intended to be used in c... | "strconv"
"strings" |
<|file_name|>Membership.LoginRequest.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>namespace Mervalito.Membership {
export interface LoginRequest extends Serenity.ServiceRequest {
Username?: string;
Password?: string;
}
}<|fim▁end|> | |
<|file_name|>net.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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/licens... | fn getaddrinfo(node: *const c_char, service: *const c_char,
hints: *const libc::addrinfo,
res: *mut *mut libc::addrinfo) -> c_int;
fn freeaddrinfo(res: *mut libc::addrinfo); |
<|file_name|>index-server.js<|end_file_name|><|fim▁begin|>// Run only by vendor node.
// In an ideal world this would be run in the same process/context of
// atom-shell but there are many hurdles atm, see
// https://github.com/atom/atom-shell/issues/533
// increase the libuv threadpool size to 1.5x the number of logi... | config.cwd = path.resolve(config.cwd || process.env.HOME);
var logger = require('fastlog')('', 'debug', '<${timestamp}>'); |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import sys
import pytest
py3 = sys.version_info[0] >= 3
class DummyCollector(pytest.collect.File):
def collect(self):<|fim▁hole|>
def pytest_pycollect_makemodule(path, parent):
bn = path.basename
if "py3" in bn and not py3 or ... | return []
|
<|file_name|>edit_detail.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ imp... | def dispatch(self, request, *args, **kwargs): |
<|file_name|>set.py<|end_file_name|><|fim▁begin|># set command to set global variables
from lib.utils import *
def _help():
usage = '''
Usage: set [options] (var) [value]
[options]:
-h Print this help.
-del (var) Delete variable
(var) if defined.
where (var) is a valid
g... | argv.pop(0) |
<|file_name|>pmi.py<|end_file_name|><|fim▁begin|># pylint: disable=C0103
"""Wrapper module for libpcp_import - Performace Co-Pilot Log Import API
#
# Copyright (C) 2012-2015 Red Hat.
#
# This file is part of the "pcp" module, the python interfaces for the
# Performance Co-Pilot toolkit.
#
# This program is free softwar... | # property definitions
path = property(read_path, None, None, None) |
<|file_name|>TimeShift.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to you under the... | * <p>a formatted date with the specified number of (seconds, minutes,
* hours, days or months ) added. Value is also saved in the variable for
* later re-use.
* |
<|file_name|>domparser.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::DOMParserBinding;
use dom::bind... |
use js::jsapi::{JSContext, JSObject, JSVal};
use js::glue::bindgen::{RUST_OBJECT_TO_JSVAL}; |
<|file_name|>wallet_listsinceblock.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2017 The Starwels developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the listsincelast RPC."""
from test_fra... | self.nodes[1].importprivkey(privkey) |
<|file_name|>ResponseCookiesTestCase.java<|end_file_name|><|fim▁begin|>/*
* JBoss, Home of Professional Open Source.
* Copyright 2019 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file excep... | * WITHOUT 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|>main.rs<|end_file_name|><|fim▁begin|>use rand::Rng;
use std::cmp::Ordering;
use std::io;
fn main() {
println!("Guess the number!");<|fim▁hole|> println!("The secret number is: {}", secret_number);
loop {
println!("Please input your guess.");
let mut guess = String::new();
... |
let secret_number = rand::thread_rng().gen_range(1..101);
|
<|file_name|>test_node.py<|end_file_name|><|fim▁begin|>import unittest
from golem.network.p2p.node import Node
def is_ip_address(address):
"""
Check if @address is correct IP address
:param address: Address to be checked
:return: True if is correct, false otherwise
"""
from ipaddress import ip... | node = Node()
node.collect_network_info() |
<|file_name|>sized_unsized_cast.rs<|end_file_name|><|fim▁begin|>use crate::structured_errors::StructuredDiagnostic;
use rustc_errors::{DiagnosticBuilder, DiagnosticId};
use rustc_middle::ty::{Ty, TypeFoldable};
use rustc_session::Session;
use rustc_span::Span;
pub struct SizedUnsizedCast<'tcx> {
pub sess: &'tcx Se... | } |
<|file_name|>test_presigned.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 SwiftStack, 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/LICENSE... | def _test_expiration_limits_v4(self): |
<|file_name|>milestone.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unle... | "regexp"
"sort"
"strings" |
<|file_name|>shared_settings.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Common/Shared code related to the Settings dialog
# Copyright (C) 2010-2018 Filipe Coelho <falktx@falktx.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of th... | self.ui.sb_ladish_jsdelay.setValue(settings.value(LADISH_CONF_KEY_DAEMON_JS_SAVE_DELAY, LADISH_CONF_KEY_DAEMON_JS_SAVE_DELAY_DEFAULT, type=int))
@pyqtSlot()
def slot_saveSettings(self): |
<|file_name|>TestPatternSetFilter.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2012 Ning, Inc.
*
* Ning licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* h... | import java.util.regex.Pattern;
public class TestPatternSetFilter |
<|file_name|>cpu_backend_threadpool_test.cc<|end_file_name|><|fim▁begin|>/* Copyright 2019 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://ww... | |
<|file_name|>others.rs<|end_file_name|><|fim▁begin|>use super::prelude::*;
use stencila_schema::*;
replaceable_struct!(Date, value);
patchable_struct!(
Organization,
// All properties except `id` (as at 2021-11-18)
// Commented out properties have types that do not yet have a `impl Patchable`.
//addr... | name,
telephone_numbers,
url |
<|file_name|>BooleanIndexingTest.java<|end_file_name|><|fim▁begin|>package org.nd4j.linalg.indexing;
import com.google.common.base.Function;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.nd4j.linalg.BaseNd4jTest;
import org.nd4j.linalg.api.ndarray.INDArray;
... |
assertFalse(BooleanIndexing.or(array, Conditions.greaterThan(6.0f)));
}
|
<|file_name|>package_bundles.py<|end_file_name|><|fim▁begin|>import os
import re
import shutil
import zipfile
import requests
import json
from shutil import copy2
from urllib.request import urlretrieve, urlopen
# Input parameters
version_param = os.environ.get('RELEASE_VERSION')
is_latest_param = True if version_param... | dist_dir = get_dist_dir_name()
for file in files:
with zipfile.ZipFile(file) as zip_file: |
<|file_name|>poi_flag_email.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
###
### in poiFlagEmail() below, write code that returns a boolean<|fim▁hole|>import sys
import reader
import poi_emails
def getToFromStrings(f):
f.seek(0)
to_string, from_string, cc_string = reader.getAddresses(f)
to_emails ... | ### indicating if a given emails is from a POI
###
|
<|file_name|>le.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
// pub trait FixedSizeArray<T> {
// /// Converts the array to immutable slice
// fn as_slice(&self) -> &[T];
// /// Converts the array to mutable slice
// fn as_mut_slice(&m... | // reason = "should ideally be implemented for all fixed-sized arrays")]
// impl<T> AsRef<[T]> for [T; $N] {
// #[inline] |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>"""
Authors: Tim Hessels
UNESCO-IHE 2016
Contact: t.hessels@unesco-ihe.org
Repository: https://github.com/wateraccounting/wa
Module: Collect/MOD17
Description:
This module downloads MOD17 GPP data from
http://e4ftl01.cr.usgs.gov/. Use the MOD17... | # -*- coding: utf-8 -*- |
<|file_name|>tabId.js<|end_file_name|><|fim▁begin|>/* -------------------------------------------------------------------------- */
/* Copyright 2002-2020, OpenNebula Project, OpenNebula Systems */
/* */<|fim▁hole|>/* Licensed und... | |
<|file_name|>security_related.py<|end_file_name|><|fim▁begin|># (C) Copyright 2016 Vit Mojzis, vmojzis@redhat.com
#
# This program is distributed under the terms of the GNU General Public License
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Li... | |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.auth.models
import django.utils.timezone
from django.conf import settings
import django.core.validators
import forum.models
class Mi... | ('down_vote', models.IntegerField(null=True, blank=True)), |
<|file_name|>feed_parse_extract17LiterarycornerWordpressCom.py<|end_file_name|><|fim▁begin|>def extract17LiterarycornerWordpressCom(item):
'''
Parser for '17literarycorner.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title']... |
return False |
<|file_name|>Declare.java<|end_file_name|><|fim▁begin|>package modulo0.tree;
public class Declare extends Stat {
public Declare(Var x, Expr e, Stat s) {
super("Declare", new M0Node[] { x, e, s });
}
@Override<|fim▁hole|> }
}<|fim▁end|> | protected Stat copy() {
return new Declare((Var) getChild(0), (Expr) getChild(1), (Stat) getChild(2)); |
<|file_name|>yeast.cpp<|end_file_name|><|fim▁begin|>/*
* yeast.cpp is part of Brewtarget, and is Copyright the following
* authors 2009-2014
* - marker5a
* - Philip Greggory Lee <rocketman768@gmail.com>
* - plut0nium
* - Samuel Östling <MrOstling@gmail.com>
*
* Brewtarget is free software: you can redistribute ... | * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
|
<|file_name|>EZModule.py<|end_file_name|><|fim▁begin|>####################################################################################################
# Copyright (C) 2016 by Ingo Keller, Katrin Lohan #
# <brutusthetschiepel@gmail.com> ... | # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
# See the GNU Affero General Public License for more details. # |
<|file_name|>bootstrap-collapse-3387a8b21abb7862bae6aac8337d6b26.js<|end_file_name|><|fim▁begin|>/* =============================================================
* bootstrap-collapse.js v2.3.2
* http://getbootstrap.com/2.3.2/javascript.html#collapse
* =============================================================
* ... | if (hasData && hasData.transitioning) return
actives.collapse('hide')
hasData || actives.data('collapse', null) |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
<|fim▁hole|> # Examples:
url(r'^$', 'index', name='index'),
# url(r'^api/user/$', 'api_user'),
url(r'^skin_config/$', 'skin_config', name='skin_config'),
url(r'^login/$', 'Login', name='login'),
... | urlpatterns = patterns('jumpserver.views', |
<|file_name|>SimpleCacheManager.java<|end_file_name|><|fim▁begin|>package com.icfcc.cache.support;
import com.icfcc.cache.Cache;
import java.util.Collection;
/**
* Simple cache manager working against a given collection of caches.
* Useful for testing or simple caching declarations.
*
* @author Costin Leau
* @... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>pub mod vk;<|fim▁end|> | #![feature(associated_consts)]
extern crate libc;
|
<|file_name|>Money.js<|end_file_name|><|fim▁begin|>/**
* @file
* Money is a value object representing a monetary value. It does not use
* floating point numbers, so it avoids rounding errors.
* The only operation that may cause stray cents is split, it assures that no
* cents vanish by distributing as evenly as po... | },
/** |
<|file_name|>Invocation.ts<|end_file_name|><|fim▁begin|>import * as _ from "lodash";
import * as common from "../Common/_all";
import { ICallContext, CallType, ProxyType } from "./ICallContext";
export enum InvocationType {
NONE, SETUP, EXECUTE
}
export abstract class BaseInvocation implements ICallContext {
... | toString(): string {
const objName = common.Utils.objectName(this.obj);
const res = _.isFunction(this.obj) ? `${objName}` : `${objName}.${this.name}`;
return res; |
<|file_name|>testing.py<|end_file_name|><|fim▁begin|>""" Mixins for setting up particular course structures (such as split tests or cohorted content) """
from datetime import datetime
from pytz import UTC
from openedx.core.djangoapps.course_groups.models import CourseUserGroupPartitionGroup
from openedx.core.djangoap... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from __future__ import absolute_import, unicode_literals
from qproject.celery import app as celery_app
__all__ = ['celery_app']<|fim▁end|> | |
<|file_name|>module3.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#coding:utf-8<|fim▁hole|>
print 'start to load...'
import sys
name = 42
def func(): pass
class kclass : pass
print 'done loading.'<|fim▁end|> | |
<|file_name|>get_keyword_feature.py<|end_file_name|><|fim▁begin|>#-------------------------------------------------------------------------------
# coding=utf8
# Name: 模块1
# Purpose:
#
# Author: zhx
#
# Created: 10/05/2016
# Copyright: (c) zhx 2016
# Licence: <your licence>
#----------------------... | content = sheet2.cell(row=r,column=3).value
time = sheet2.cell(row=r,column=11).value |
<|file_name|>gamekings.py<|end_file_name|><|fim▁begin|>import re
from .common import InfoExtractor
class GamekingsIE(InfoExtractor):
_VALID_URL = r'http://www\.gamekings\.tv/videos/(?P<name>[0-9a-z\-]+)'
_TEST = {
u"url": u"http://www.gamekings.tv/videos/phoenix-wright-ace-attorney-dual-destinies-rev... |
return { |
<|file_name|>epa.rs<|end_file_name|><|fim▁begin|>#[cfg(test)]
#[path="../../../../tests/collisions/detection/gjkepa/epa_test.rs"]
mod tests;
use {NEG_INFINITY, Scalar};
use maths::{ApproxEq, Approximations, CoordinateTransform, Vec3D};
use maths::_2d::Vec2D;
use utils::compute_surfaces_for_convex_hull;
use algorithms:... | .collect(); |
<|file_name|>redis_queues.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; only version 2 of the License is applicable.
#
# This program is distributed in the hope... | log_verbose('Invalid response: %r' % response)
return queue_lengths
|
<|file_name|>context.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2016 Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restr... | passed around to commands by passing in :attr:`Command.pass_context`.
|
<|file_name|>Adapter_PLC_Base.cc<|end_file_name|><|fim▁begin|>/*
Lehrstuhl fuer Energietransport und -speicherung
UNIVERSITAET DUISBURG-ESSEN
ef.Ruhr E-DeMa AP-2
Wissenschaftlicher Mitarbeiter:
Dipl.-Ing. Holger Kellerbauer
Das Linklayer-Paket "powerline" umfasst eine Sammlung von Modulen, die zur Simulation von Po... | // we only get here if transmission has finished successfully, without collision |
<|file_name|>eureka_test.go<|end_file_name|><|fim▁begin|>// Copyright 2020 The Prometheus 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... | <serviceUpTimestamp>1535444352472</serviceUpTimestamp> |
<|file_name|>fileRotate.js<|end_file_name|><|fim▁begin|>/*
* file.js: Transport for outputting to a local log file
*
* (C) 2010 Charlie Robbins
* MIT LICENCE
*
*/
var events = require('events'),
fs = require('fs'),
path = require('path'),
util = require('util'),
colors = require('colors'),
co... | self.emit('logged');
});
}; |
<|file_name|>Modal.js<|end_file_name|><|fim▁begin|>import React from 'react';
import { Gateway } from 'react-gateway';
import ReactModal2 from './ReactModal2';
import Icon from '../Icon';
import './Modal.scss';
/**
* This component is only created to facilitate the process of using react-modal2 with react gateway
*
... | |
<|file_name|>flatten_test.rs<|end_file_name|><|fim▁begin|>// @generated SignedSource<<f151ffe80d9e519322a823c1bbc24bae>>
mod flatten;
use flatten::transform_fixture;
use fixture_tests::test_fixture;
#[test]
fn flatten_multiple_conditions() {
let input = include_str!("flatten/fixtures/flatten-multiple-conditions.... | let expected = include_str!("flatten/fixtures/flattens-matching-fragment-types.expected");
test_fixture(transform_fixture, "flattens-matching-fragment-types.graphql", "flatten/fixtures/flattens-matching-fragment-types.expected", input, expected);
}
|
<|file_name|>jquery.tablesorter.js<|end_file_name|><|fim▁begin|>/**!
* TableSorter 2.17.7 - Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
* Copyright (c) 2007 Christian Bach
* Examples and docs at: http://tablesorter.com
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/lic... | x = dir ? a : b;
y = dir ? b : a;
// text sort function |
<|file_name|>flag.ts<|end_file_name|><|fim▁begin|>export class Flag {<|fim▁hole|> public sDescription: string,
public type: string,
public guiGroup: string
){}
}<|fim▁end|> |
constructor(
public sFlag: string,
public lFlag: string, |
<|file_name|>test_remote_runners.py<|end_file_name|><|fim▁begin|># Licensed to the StackStorm, Inc ('StackStorm') 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 ... | self.assertEquals(LIVEACTION_STATUS_FAILED,
FabricRunner._get_result_status(result, True)) |
<|file_name|>updateScale.ts<|end_file_name|><|fim▁begin|>import { PickScaleConfigWithoutType, ScaleConfigWithoutType } from './types/ScaleConfig';
import { DefaultThresholdInput, D3Scale, PickD3Scale } from './types/Scale';
import { StringLike, DefaultOutput } from './types/Base';
import scaleOperator, { ALL_OPERATORS ... | ThresholdInput extends DefaultThresholdInput = DefaultThresholdInput
>(
scale: PickD3Scale<'log', Output>,
config: PickScaleConfigWithoutType<'log', Output>, |
<|file_name|>greenlets.py<|end_file_name|><|fim▁begin|>import distutils.version
try:
import greenlet
getcurrent = greenlet.greenlet.getcurrent<|fim▁hole|> preserves_excinfo = (distutils.version.LooseVersion(greenlet.__version__)
>= distutils.version.LooseVersion('0.3.2'))
greenlet = greenlet... | GreenletExit = greenlet.greenlet.GreenletExit |
<|file_name|>services.py<|end_file_name|><|fim▁begin|># Copyright 2016 IBM Corp.
# 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<|fim▁hole|># a copy of the License at
#
# http://... | |
<|file_name|>helloworld.js<|end_file_name|><|fim▁begin|>// Generated by CoffeeScript 1.3.3
(function() {
var CMinion, Minion, port, restify, server;
restify = require("restify");
CMinion = require("../../minion");
Minion = new CMinion();
server = restify.createServer();
server.use(restify.queryParser()... |
server.listen(port, function() { |
<|file_name|>WagonManager.java<|end_file_name|><|fim▁begin|>package org.apache.maven.artifact.manager;
/*
* 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 ownersh... | import java.util.List; |
<|file_name|>db_test.go<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2017 Kagucho <kagucho.net@gmail.com>
This program 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, either version 3 of the License,... | t.Run(`QueryClub`, db.testQueryClub)
t.Run(`QueryClubName`, db.testQueryClubName)
t.Run(`QueryClubNames`, db.testQueryClubNames)
t.Run(`QueryClubs`, db.testQueryClubs) |
<|file_name|>multiple_cu_test.go<|end_file_name|><|fim▁begin|>///////////////////////////////////////////////////////////////////////////
// Copyright 2016 Siva Chandra
//
// 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|>utils.ts<|end_file_name|><|fim▁begin|>/**
* Assumes file is an Angular component if type is javascript/typescript
*/
export function isPathAngularComponent(path: string): boolean {
return /\.ts|js$/i.test(path);
}
/**
* Extract inline template from a component
*/
export function extractComponentInlin... | |
<|file_name|>ServiceInstanceBindingRepository.java<|end_file_name|><|fim▁begin|>package com.emc.ecs.servicebroker.repository;
import com.emc.ecs.servicebroker.exception.EcsManagementClientException;
import com.emc.ecs.servicebroker.service.s3.S3Service;
import com.emc.ecs.servicebroker.model.Constants;
import com.emc.... |
ServiceInstanceBinding removeSecretCredentials(ServiceInstanceBinding binding) {
Map<String, Object> credentials = binding.getCredentials(); |
<|file_name|>revision.py<|end_file_name|><|fim▁begin|>from mylibs.transform import *
from mylibs.online import *
from mylibs.index import *
import mylibs.myio
import mylibs.models
import paths
import pickle
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import GradientBoostingClassifier
fro... | print ' r\t',r
print ' f1\t',f1
#############################################3 |
<|file_name|>Bar.java<|end_file_name|><|fim▁begin|>/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apac... | |
<|file_name|>utils.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)]
use std::{cmp, io};
use bytes::{BufMut, BytesMut};
pub const SIZE: usize = 31;
#[derive(Serialize, Deserialize)]
pub struct Message {
pub message: &'static str,
}
pub struct Writer<'a>(pub &'a mut BytesMut);
impl<'a> io::Write for Writer<'... | let _ = writer.0.put_slice(b"&");
}
b'"' => {
let _ = writer.0.put_slice(b"""); |
<|file_name|>resize.js<|end_file_name|><|fim▁begin|>'use strict';
describe('Directive: resize', function () {
// load the directive's module
beforeEach(module('orderDisplayApp'));
var element,
scope;
beforeEach(inject(function ($rootScope) {
scope = $rootScope.$new();
}));
//TODO: Add unit tests
<|fim▁h... | /*it('should change height', inject(function ($compile, $window) {
element = angular.element('<resize></resize>');
element = $compile(element)(scope); |
<|file_name|>test_tooltool.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 contextlib
import copy
import hashlib
import json
impo... | self.make_manifest('manifest.tt', 'one', 'two')
with mock.patch('tooltool.fetch_file') as fetch_file:
fetch_file.side_effect = self.fake_fetch_file
eq_(tooltool.fetch_files('manifest.tt', self.urls, cache_folder='cache'), |
<|file_name|>column-manager-view.js<|end_file_name|><|fim▁begin|>define(function(require) {
'use strict';
var ColumnManagerView;
var _ = require('underscore');
var BaseView = require('oroui/js/app/views/base/view');
ColumnManagerView = BaseView.extend({
template: require('tpl!orodatagrid/t... | }); |
<|file_name|>buffer_tests.rs<|end_file_name|><|fim▁begin|>//! Tests for `IBuffer`.
use buffer::IBuffer;
use std::io::Read;
#[test]
fn read_from_string() {
let mut in_buf = IBuffer::from_str("Hello world");
let mut buf = [0u8; 6];
let res = in_buf.read(&mut buf);
assert_eq!(6, res.expect("read must b... | |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "iamhhb.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above impo... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate fringe;
extern crate tokio_core;
#[macro_use(task_local)]
extern crate futures;
use futures::Async;
use std::cell::{RefCell, UnsafeCell};
/// Convenient macro to suspend and retry async operation
/// just as it was blocking operation
#[macro_export]
macro... |
impl YielderRefStore {
unsafe fn new<'a>(y : &'a Yield) -> YielderRefStore {
YielderRefStore ( |
<|file_name|>app.routes.ts<|end_file_name|><|fim▁begin|>import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
import { LoginComponent } from './login/login.component';
import { MembersComponent } from './members/memb... | { path: 'stocklist', component: StocklistComponent, canActivate: [AuthGuard] },
{ path: 'chat', component: ChatComponent, canActivate: [AuthGuard] }
];
|
<|file_name|>runge_kutta_2a.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
<|fim▁hole|> xold = x0
told = t0
ret = []
while (told <= tf):
ret += [(told, xold)]
k1 = dX(xold, told)
k2 = dX(xold + h*k1, told+h)
xold = xold + h/2 * (k1+k2)
told = round(told + ... | from math import log, exp
def RungeKutta2aEDO (x0, t0, tf, h, dX): |
<|file_name|>view.py<|end_file_name|><|fim▁begin|>import logging
from flask import request, flash, abort, Response
from flask_admin import expose
from flask_admin.babel import gettext, ngettext, lazy_gettext
from flask_admin.model import BaseModelView
from flask_admin.model.form import wrap_fields_in_fieldlist
from f... | |
<|file_name|>SVGUnitTypes.java<|end_file_name|><|fim▁begin|>package org.w3c.dom.svg;
public interface SVGUnitTypes {
// Unit Types
public static final short SVG_UNIT_TYPE_UNKNOWN = 0;
public static final short SVG_UNIT_TYPE_USERSPACEONUSE = 1;
<|fim▁hole|><|fim▁end|> | public static final short SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2;
} |
<|file_name|>official_holiday_wizard.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# -*- encoding: utf-8 -*-
#############################################################################<|fim▁hole|># This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Ge... | #
# Copyright (c) 2007 Martin Reisenhofer <martin.reisenhofer@funkring.net>
# |
<|file_name|>DDLTablePerClassTestSuite.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 1998, 2013 Oracle and/or its affiliates, Frank Schwarz. All rights reserved.
* This program and the accompanying materials are made available unde... | * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
|
<|file_name|>logger.rs<|end_file_name|><|fim▁begin|>use log::{Level, LevelFilter, Log, Metadata, Record, SetLoggerError};
struct Logger {
log_level: Level,
}
impl Log for Logger {
fn enabled(&self, metadata: &Metadata) -> bool {
metadata.level() <= self.log_level
}
fn log(&self, record: &Reco... | }
}
fn flush(&self) {} |
<|file_name|>documentOrderUtils.ts<|end_file_name|><|fim▁begin|>import {
AttributeNodePointer,
ChildNodePointer,
isTinyNode,
NodePointer,
} from '../../domClone/Pointer';
import { ConcreteChildNode, ConcreteNode, ConcreteParentNode } from '../../domFacade/ConcreteNode';
import DomFacade from '../../domFacade/DomFac... |
const actualAncestorA = actualAncestorsA[y];
const actualAncestorB = actualAncestorsB[y]; |
<|file_name|>JustcoinWrapper.java<|end_file_name|><|fim▁begin|>package com.shinydev.wrappers;
import au.com.bytecode.opencsv.CSVReader;
import com.shinydev.justcoin.model.JustcoinTransaction;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
imp... | .filter(tx -> tx.getDateTime().isBefore(end)) |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[derive(Debug, PartialEq)]
pub enum CentrifugeError {
WrongProtocol,
ParsingError,
UnknownProtocol,
InvalidPacket,
}
pub mod prelude {
pub use crate::structs::raw::Raw::*;
pub use crate::structs::ether::Ether::*;
}
/// `Zero` - This... | |
<|file_name|>unused-attr.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/lic... |
#[foo] //~ ERROR unused attribute
struct Foo {
#[foo] //~ ERROR unused attribute |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.