prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Copyright (c) 2013 the BabelFish authors. All rights reserved. # Use of this source code is governed by the 3-clause BSD license # that can be found in the LICENSE file. # import sys if sys.version_info[0] >= 3: basestr = str else: ...
from .country import country_converters, COUNTRIES, COUNTRY_MATRIX, Country from .exceptions import Error, LanguageConvertError, LanguageReverseError, CountryConvertError, CountryReverseError from .language import language_converters, LANGUAGES, LANGUAGE_MATRIX, Language from .script import SCRIPTS, SCRIPT_MATRIX, Scri...
<|file_name|>Equation.java<|end_file_name|><|fim▁begin|>package org.adastraeducation.liquiz.equation; import java.util.*; import java.util.regex.*; import org.adastraeducation.liquiz.*; /** * Present equations with random variables. * It has two ways to parse the equations in string[]. One is in infix, and the othe...
this.func = func;
<|file_name|>relacher_gouvernail.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -* # Copyright (c) 2013 LE GOFF Vincent # 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...
# this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software
<|file_name|>ChickenBurger.java<|end_file_name|><|fim▁begin|>public class ChickenBurger extends Burger { @Override public float price() { return 50.5f; }<|fim▁hole|> @Override public String name() { return "Chicken Burger"; } }<|fim▁end|>
<|file_name|>action_noise.py<|end_file_name|><|fim▁begin|># Copyright 2018 The dm_control 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/LICENS...
<|file_name|>record.go<|end_file_name|><|fim▁begin|>package daemon import ( "log" "time" "github.com/Cloakaac/cloak/models" ) type RecordDaemon struct{} func (r *RecordDaemon) tick() { total := models.GetOnlineCount() err := models.AddOnlineRecord(total, time.Now().Unix()) if err != nil { log.Fatal(err)<|fi...
<|file_name|>Generic.py<|end_file_name|><|fim▁begin|># This file is part of pybliographer # # Copyright (C) 1998-2004 Frederic GOBRY # Email : gobry@pybliographer.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 t...
return table, skeys
<|file_name|>NSCFBackgroundDownloadTask.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright (c) 2015 Bartosz Janda # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the...
if value: return "finished" return None
<|file_name|>Component.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react'; import { connect } from 'react-redux'; import * as Actions from './Actions'; import { ITrackHistoryState } from './ITypes'; let Dropzone = require('react-dropzone'); interface IProps extends ITrackHistoryState { dispatch: Functio...
const reader = new FileReader();
<|file_name|>uploadedOn.pipe.ts<|end_file_name|><|fim▁begin|>import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'uploadedOn' }) export class UploadedOnPipe implements PipeTransform { transform(value: any, args?: any): any {<|fim▁hole|><|fim▁end|>
return 'Uploaded On: ' + value; } }
<|file_name|>JwtTokenError.ts<|end_file_name|><|fim▁begin|>/* tslint:disable */ /* eslint-disable */ /** * OpenCraft Instance Manager * API for OpenCraft Instance Manager * * The version of the OpenAPI document: api * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). ...
<|file_name|>download.rs<|end_file_name|><|fim▁begin|>use std::fmt::{self, Display, Formatter}; use uuid::Uuid; /// Details of a package for downloading. #[derive(Deserialize, Serialize, PartialEq, Eq, Debug, Clone)] pub struct Package { pub name: String, pub version: String } impl Display for Package { ...
Failed, Finished
<|file_name|>submittion2_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you ...
# distributed under the License is distributed on an "AS IS" BASIS,
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod effects; pub mod formats; #[macro_use] mod forward; use core::geometry::Position; use core::geometry::M44; use core::resource::ResourceLoader; use std::clone::Clone; use cgmath; use frontend::render::forward::PrimitiveIndex; use frontend::render::forward::Vertex; u...
} fn draw_quad(&mut self, style: Option<Style>, transform: M44, ratio: f32, appearance: Appearance) { let v = vec![
<|file_name|>list1.py<|end_file_name|><|fim▁begin|>資料 = [1, 2, 3, 4, 5] ''' program: list1.py ''' print(資料[:3]) print(資料[2:]) print(資料[1:2]) a = [3, 5, 7, 11, 13] for x in a: if x == 7: print('list contains 7')<|fim▁hole|> for 索引 in range(-5, 6, 2): print(索引) squares = [ x*x for x in range(0, 11) ] p...
break print(list(range(10)))
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|># coding: utf-8<|fim▁hole|>from django.test import TestCase from django.db import IntegrityError from datetime import datetime from eventex.subscriptions.models import Subscription class SubscriptionTest(TestCase): def setUp(self): self.obj = Subscr...
<|file_name|>ex40.py<|end_file_name|><|fim▁begin|>class Song(object): def __init__(self, lyrics): self.lyrics = lyrics def sing_me_a_song(self): for line in self.lyrics: print line happy_bday = Song(["Happy birthday to you", "I don't want to get sued",<|fim▁hole...
"So I'll stop right here"])
<|file_name|>component_fixture.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {ChangeDetectorRef, ComponentRef, DebugElement,...
changeDetectorRef: ChangeDetectorRef;
<|file_name|>WriterUtils.cpp<|end_file_name|><|fim▁begin|>//===- WriterUtils.cpp ----------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2...
writeUleb128(os, offset, "offset");
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import { clamp, mean, isNaN, get, isArray } from 'lodash'; import update from 'immutability-helper'; import { helpers } from 'veritone-redux-common'; const { createReducer } = helpers; export const PICK_START = 'PICK_START'; export const PICK_END = 'PICK_END'; export ...
...state[id], state: 'uploading', progressPercentByFileKey: {},
<|file_name|>typeck-default-trait-impl-cross-crate-coherence.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-AP...
struct B;
<|file_name|>mesos.rs<|end_file_name|><|fim▁begin|>use crate::{common::ui::UI, error::Result}; use std::ffi::OsString; // It would be more consistent naming to use "export mesos" instead of "mesoize", but for backwards // compatibility we keep "mesoize" const EXPORT_CMD_ENVVAR: &str = "HAB_PKG_MESOSIZE_BIN...
EXPORT_CMD).await }
<|file_name|>frontend-results.py<|end_file_name|><|fim▁begin|>@app.route('/job/<name>') def results(name): job = saliweb.frontend.get_completed_job(name, flask.request.args.get('passwd')) # Determine whether the job completed successfully<|fim▁hole|> template ...
if os.path.exists(job.get_path('output.pdb')): template = 'results_ok.html' else:
<|file_name|>console.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> * 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::Bindings::ConsoleBinding; use dom::bindings::codegen::Bindings::ConsoleBinding::ConsoleMetho...
/* This Source Code Form is subject to the terms of the Mozilla Public
<|file_name|>cell_renderer.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2015, The Gtk-rs 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> use ffi; use cast::GTK_CELL_RENDER...
unsafe { ffi::gtk_cell_renderer_get_preferred_width(GTK_CELL_RENDERER(self.unwrap_widget()), widget.unwrap_widget(), minimum_size, natural_size) }
<|file_name|>canvasrenderingcontext2d.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 canvas_traits::canvas::{Canvas2dMsg, Can...
Point2D::new(x as f32,
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>// ============================= // Email: info@ebenmonney.com // www.ebenmonney.com/templates // ============================= import { Component, ViewEncapsulation, OnInit, OnDestroy, ViewChildren, AfterViewInit, QueryList, ElementRef } from '@angular/core';...
<|file_name|>thummer.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Copyright 2011-2018 Matt Austin # # 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/...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from searchv2.tests.test_models import * from searchv2.tests.test_utils import * from searchv2.tests.test_views import *<|fim▁end|>
from searchv2.tests.test_builders import *
<|file_name|>sha256_bench.rs<|end_file_name|><|fim▁begin|>#![cfg_attr(all(feature = "nightly", test), feature(test))] #![cfg(all(feature = "nightly", test))] extern crate test; extern crate cxema; #[cfg(test)] use cxema::sha2::{Sha256};<|fim▁hole|>use cxema::digest::Digest; use test::Bencher; #[bench] pub fn sha256...
<|file_name|>List.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # CTK: Cherokee Toolkit # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2010-2014 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of th...
self.id = self.props['id']
<|file_name|>app.reducers.ts<|end_file_name|><|fim▁begin|>import * as fromShoppingList from '../shopping-list/store/shopping-list.reducers'; import * as fromAuth from '../auth/store/auth.reducers';<|fim▁hole|>export interface AppState { shoppingList: fromShoppingList.State; auth: fromAuth.State; } export const red...
import {ActionReducerMap} from '@ngrx/store';
<|file_name|>info-pane.js<|end_file_name|><|fim▁begin|>(function ($) { function FewbricksDevHelper() { var $this = this; /** * */ this.init = function() { $this.cssClassFull = 'fewbricks-info-pane--full'; if(!$this.initMainElm()) { ...
return style && style.replace(/height[^;]+;?/g, ''); });
<|file_name|>004-280565a54124-add_custom_head_tags.py<|end_file_name|><|fim▁begin|># This file is a part of MediaDrop (http://www.mediadrop.net), # Copyright 2009-2015 MediaDrop contributors # For the exact contribution history, see the git revision log. # The source code contained in this file is licensed under the GP...
'key': inline_literal(key), 'value': inline_literal(value), }) )
<|file_name|>access.py<|end_file_name|><|fim▁begin|>import base64 import os import time from gluon import portalocker from gluon.admin import apath from gluon.fileutils import read_file # ########################################################### # ## make sure administrator is on localhost or https # ################...
('default/index', 'default/user', 'plugin_jqmobile/index', 'plugin_jqmobile/about')):
<|file_name|>test_prune.ts<|end_file_name|><|fim▁begin|>import { expect } from 'chai'; import { prune } from 'src/util/prune'; describe('unit/utils/prune', () => { it('returns string if string is shorter than limit', () => { const expected = 'this is some text'; const actual = prune(expected, 50); expe...
const actual = prune(text____, 30); expect(actual).to.equal(expected);
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function import logging log = logging.getLogger(__name__) from .trajectories import Trajectories <|...
try: # pragma: no cover from . import draw __all__ = ['Trajectories', 'draw']
<|file_name|>housing_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright(C) 2018 Phyks # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, e...
from weboob.capabilities.base import empty
<|file_name|>kitten-static-T.cpp<|end_file_name|><|fim▁begin|>#include <cstdio> template<typename T> auto kitten(T x) __attribute__((noinline)); template<class T> auto kitten(T t) { static T x = 0;<|fim▁hole|>int main() { printf("%d\n", kitten(1)); printf("%g\n", kitten(3.14)); }<|fim▁end|>
return (x += 1) + t; }
<|file_name|>make-stat.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on Mon Mar 24 11:17:25 2014 @author: kshmirko """ import pandas as pds import numpy as np def seasons(x): month = x.month ret = None if month in [12,1,2]: ret = "Winter" elif month...
ax.set_xlim((0,40)) ax.set_ylim((0,6))
<|file_name|>index.tsx<|end_file_name|><|fim▁begin|>import React from 'react' import { MutationFunction as MutationFn, useMutation, useQuery, } from '@apollo/client' import { Form, Field } from 'react-final-form' import { ApolloError, PureQueryOptions } from '@apollo/client' import { unescape } from 'underscore' ...
<|file_name|>ScriptLoader.java<|end_file_name|><|fim▁begin|>package logbook.data; import java.io.BufferedReader; import java.io.Closeable; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import java.nio.charset.StandardCharsets; import ja...
* * @param script スクリプト * @return スクリプトにより実装されたEventListener、スクリプトエンジンが見つからない、もしくはコンパイル済み関数がEventListenerを実装しない場合null
<|file_name|>timesheet.py<|end_file_name|><|fim▁begin|>import xml.etree.ElementTree as ET import datetime import sys import openpyxl import re import dateutil def main(): print 'Number of arguments:', len(sys.argv), 'arguments.' #DEBUG print 'Argument List:', str(sys.argv) #DEBUG Payrate = raw_input("Enter your ...
<|file_name|>tryclient.py<|end_file_name|><|fim▁begin|># This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it ...
<|file_name|>DeleteEventsByEventTypeRequestProtocolMarshaller.java<|end_file_name|><|fim▁begin|><|fim▁hole|> * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 *...
/* * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. *
<|file_name|>Radio.js<|end_file_name|><|fim▁begin|>'use strict'; var _get = require('babel-runtime/helpers/get')['default']; var _inherits = require('babel-runtime/helpers/inherits')['default']; var _createClass = require('babel-runtime/helpers/create-class')['default']; var _classCallCheck = require('babel-runtime...
value: function getValue() {
<|file_name|>GroovyService.java<|end_file_name|><|fim▁begin|>/** * Cerberus Copyright (C) 2013 - 2017 cerberustesting * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This file is part of Cerberus. * * Cerberus is free software: you can redistribute it and/or modify * it under the terms of the...
import org.codehaus.groovy.control.CompilerConfiguration;
<|file_name|>pet.js<|end_file_name|><|fim▁begin|>// inheritientence!! function Pet() { this.animal = ""; this.name=""; this.setAnimal = function(newAnimal){ this.animal = newAnimal; } this.setName = function(newName){ this.name = newName; } } var myCat = new Pet(); myCat.setAnimal = "cat"; myCat.s...
} }
<|file_name|>javascriptExamples.js<|end_file_name|><|fim▁begin|>define(["widgetjs/widgetjs", "lodash", "jquery", "prettify", "code", "bootstrap"], function(widgetjs, lodash, jQuery, prettify, code) { var examples = {}; examples.modals = code({ group: "Modals", label: "Modals", links: [...
group: "Collapse",
<|file_name|>CWE134_Uncontrolled_Format_String__char_connect_socket_fprintf_82a.cpp<|end_file_name|><|fim▁begin|>/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE134_Uncontrolled_Format_String__char_connect_socket_fprintf_82a.cpp Label Definition File: CWE134_Uncontrolled_Format_String.label.xml Template File: sourc...
{ *replace = '\0'; } }
<|file_name|>contenttype.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2003-2005 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the...
<|file_name|>list_from_json.py<|end_file_name|><|fim▁begin|># Copyright 2015 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.apache.org/lice...
<|file_name|>pattern_generator.py<|end_file_name|><|fim▁begin|># # This file is part of GreatFET # from ..interface import GreatFETInterface class PatternGenerator(GreatFETInterface): """ Class that supports using the GreatFET as a simple pattern generator. """ def __init__(self, board, sample_r...
""" Sends a collection of fixed samples to the board, and then instructs it to repeatedly """
<|file_name|>SPixelPerfectSprite.java<|end_file_name|><|fim▁begin|>package ir.abforce.dinorunner.custom; import com.makersf.andengine.extension.collisions.entity.sprite.PixelPerfectSprite; import com.makersf.andengine.extension.collisions.opengl.texture.region.PixelPerfectTextureRegion; import ir.abforce.dinorunner.m...
/** * Created by Ali Reza on 9/4/15.
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls.defaults import * urlpatterns = patterns('member.views', url(r'^$', 'login', name='passport_index'), url(r'^register/$', 'register', name='passport_register'), url(r'^login/$', 'login', name='passport_login'), url(r'^logout/$', 'lo...
url(r'^profile/$', 'profile', name='passport_profile'),
<|file_name|>test_handlers.py<|end_file_name|><|fim▁begin|>"""Tests for UnauthenticatedReddit class.""" from __future__ import print_function, unicode_literals from mock import patch from praw import handlers from random import choice from six.moves import cStringIO from .helper import PRAWTest, betamax, replace_hand...
def setUp(self): super(HandlerTest, self).setUp() self.cache_store = cStringIO()
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># vim: set fileencoding=utf-8 : """python-opscripts setup """ # Standard library from __future__ import absolute_import, division, print_function<|fim▁hole|>import os.path import re import site import sys import glob # Third-party from setuptools import find_package...
<|file_name|>gr-message-scores_test.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright (C) 2016 The Android Open Source Project * * 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 ...
});
<|file_name|>SwingDatePropertyEditor.java<|end_file_name|><|fim▁begin|>/* * Debrief - the Open Source Maritime Analysis Application * http://debrief.info * * (C) 2000-2014, PlanetMayo Ltd * * This library is free software; you can redistribute it and/or * modify it under the terms of the Ec...
import java.awt.event.ActionEvent; import java.awt.event.ActionListener;
<|file_name|>fanhaorename.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python """ fanhaorename.py """ import os import os.path import logging import fileorganizer from fileorganizer import _helper from fileorganizer.replacename import _replacename __author__ = "Jack Chang <wei0831@gmail.com>" <|fim▁hole|> """ r...
def _tagHelper(tag): """ TODO
<|file_name|>svm_classifier.py<|end_file_name|><|fim▁begin|>from oct2py import octave from cvxopt import matrix, solvers from cvxpy import * import numpy as np def svm_classifier(X, y,mode): [num_sample,d]=X.shape mode_control=np.ones((num_sample,1)) for i in range(num_sample): if(mode==1): if(y[i]==-1): ...
if(mode==2): if(y[i]==1): mode_control[i]=0; if(mode==4):
<|file_name|>KColorChooserMode.py<|end_file_name|><|fim▁begin|># encoding: utf-8 # module PyKDE4.kdeui # from /usr/lib/python3/dist-packages/PyKDE4/kdeui.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import PyKDE4.kdecore as __PyKDE4_kdecore import PyQt4.QtCore as __PyQt4_QtCore import PyQt4....
<|file_name|>stepwise_test.go<|end_file_name|><|fim▁begin|>package userpass import ( "fmt" "reflect" "testing" "github.com/hashicorp/vault/api" "github.com/hashicorp/vault/sdk/helper/policyutil" "github.com/hashicorp/vault/sdk/testing/stepwise" dockerEnvironment "github.com/hashicorp/vault/sdk/testing/stepwise...
func testAccStepwiseReadUser(t *testing.T, name string, policies string) stepwise.Step { return stepwise.Step{ Operation: stepwise.ReadOperation,
<|file_name|>util_stub.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************** The Dark Mod GPL Source Code This file is part of the The Dark Mod Source Code, originally based on the Doom 3 GPL Source Code as published in 2011. The Dark...
Project: The Dark Mod (http://www.thedarkmod.com/)
<|file_name|>acf-pro-input.css.js<|end_file_name|><|fim▁begin|>/******/ (function() { // webpackBootstrap /******/ "use strict"; /******/ /******/ <|fim▁hole|><|fim▁end|>
/******/ })() ;
<|file_name|>test_minerstat.py<|end_file_name|><|fim▁begin|>from twisted.trial import unittest from minerstat.service import MinerStatService from minerstat.rig import Rig from minerstat.remote import MinerStatRemoteProtocol, Command from minerstat.utils import Config from minerstat.miners.claymore import EthClaymoreMi...
yield self.service.stopService() self.service.rig.stop.assert_called_with()
<|file_name|>net.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import logging import re import salt.client from netaddr import IPNetwork, IPAddress log = logging.getLogger(__name__) def ping(cluster = None, exclude = None, **kwargs): """ Ping all addresses from all addresses on all minions. If cl...
avg = sum( results[host].get('avg') for host in results) / len(results)
<|file_name|>hr_contract.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistr...
'date_end': fields.date('End Date'), 'trial_date_start': fields.date('Trial Start Date'),
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal<|fim▁hole|> Transaction, ) class TransactionTestCase(TestCase): def test_unicode(self): trans = self.factory.make_one( Transaction, memo=u'Sublime purchase', date=datetime.date(...
from django_factory import TestCase from financial_transactions.models import (
<|file_name|>default_settings.py<|end_file_name|><|fim▁begin|>#from django.conf import settings<|fim▁hole|> NOTICE_FROM_ANONYMOUS = 1<|fim▁end|>
<|file_name|>endpoint.ts<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2017 TypeFox and others. * * 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 ...
protected get httpScheme() { if (this.options.httpScheme) {
<|file_name|>list.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 Jeremy Letang. // 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...
match repo_repo::list_for_user_id(db, &*ctx.user.id) { Ok(l) => responses::ok(serde_json::to_string(&l).unwrap()),
<|file_name|>KVBase.cpp<|end_file_name|><|fim▁begin|>/*************************************************************************** $Id: KVBase.cpp,v 1.57 2009/04/22 09:38:39 franklan Exp $ kvbase.cpp - description ------------------- begin : Thu...
<|file_name|>generateTOC.js<|end_file_name|><|fim▁begin|>function nextLevel(nodeList, startIndex, hlevel, prefix, tocString) { var hIndex = 1; var i = startIndex; while (i < nodeList.length) { var currentNode = nodeList[i]; if (currentNode.tagName != "H"+hlevel) bre...
if (id.length > 0) {
<|file_name|>fileUpload.js<|end_file_name|><|fim▁begin|>(function () { 'use strict';<|fim▁hole|> .service('fileUpload', Service); Service.$inject = ['$http']; function Service($http) { this.uploadFile = uploadFile; //////////////// function uploadFile(file, url, done) { ...
angular .module('app.web')
<|file_name|>helper.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import print_function # python standard library from socket import socket import sys, os, re, stat, math, time, datetime import importlib # third party modules try: # unicode monkeypatch for windoze i...
# open connection def open(self, target, port=9100):
<|file_name|>_pyflakes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- try: # The 'demandimport' breaks pyflakes and flake8._pyflakes from mercurial import demandimport except ImportError: pass else: demandimport.disable() import os import pep8 import pyflakes import pyflakes.checker <|fim▁hole...
<|file_name|>js_3YI8rlQtCphHC8k7Vs22nkB6_u47OqwXcD7P8Jm9QQg_BHuNkXbS1MEkV6lGkimSfQE6366BcKxzYtd8U65iUpM.js<|end_file_name|><|fim▁begin|>/** * @file * Provides Ajax page updating via jQuery $.ajax. * * Ajax is a method of making a request via JavaScript while viewing an HTML * page. The request returns an array of ...
// Let the server know when the IFRAME submission mechanism is used. The // server can use this information to wrap the JSON response in a // TEXTAREA, as per http://jquery.malsup.com/form/#file-upload.
<|file_name|>api.py<|end_file_name|><|fim▁begin|>from django.core.exceptions import MultipleObjectsReturned from django.shortcuts import redirect from django.urls import reverse, path from wagtail.api.v2.router import WagtailAPIRouter from wagtail.api.v2.views import PagesAPIViewSet, BaseAPIViewSet from wagtail.images...
class OpenStaxImagesAPIViewSet(ImagesAPIViewSet): meta_fields = BaseAPIViewSet.meta_fields + ['tags', 'download_url', 'height', 'width']
<|file_name|>ir_ula.py<|end_file_name|><|fim▁begin|>#---------------------------------------------- # ir_ula.py # # Intermediate representation for the ula (unconventional language) # By Mitch Myburgh (MYBMIT001) # 24 09 2015 #---------------------------------------------- from llvmlite import ir from ctypes ...
<|file_name|>INaviEdgeListener.java<|end_file_name|><|fim▁begin|>/* Copyright 2011-2016 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.apache.org/li...
<|file_name|>exports.util.js<|end_file_name|><|fim▁begin|>function util() { <|fim▁hole|> Object.beget = function (o) { var F = function () {}; F.prototype = o; return new F(); }; } }; exports.util = new util();<|fim▁end|>
var self = this; if (typeof Object.beget !== 'function') {
<|file_name|>0005_auto_20141127_1436.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|> class Migration(migrations.Migration): dependencies = [ ('computing', '0004_auto_20141127_1425'), ] operations = [ migrations.CreateModel( name='Subnet', fields...
from __future__ import unicode_literals from django.db import models, migrations
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig <|fim▁hole|>class InstaappConfig(AppConfig): name = 'instaapp'<|fim▁end|>
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright The OpenTelemetry 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 ...
API --- """ import enum
<|file_name|>uniprot_core.py<|end_file_name|><|fim▁begin|># reads uniprot core file and generates core features from features_helpers import score_differences def build_uniprot_to_index_to_core(sable_db_obj): uniprot_to_index_to_core = {} for line in sable_db_obj: tokens = line.split() try: ...
canonical_absolute = 0 if prot in uniprot_to_index_to_core: c1_count = score_differences(uniprot_to_index_to_core, prot, sstart, start)
<|file_name|>service.go<|end_file_name|><|fim▁begin|>package dataflow import ( "context" "strconv" "time" "go-common/app/interface/main/app-interface/conf" "go-common/library/log" "go-common/library/log/infoc" ) // Service is search service type Service struct { c *conf.Config infoc *infoc.Infoc<|fim▁hol...
<|file_name|>oph_res_users.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- #=============================================================================== # Custom res_users object # Add an CAFAT ID for use in New Caledonia #=============================================================================== from o...
<|file_name|>autotools_test.py<|end_file_name|><|fim▁begin|>import os from conan.tools.files.files import save_toolchain_args from conan.tools.gnu import Autotools from conans.test.utils.mocks import ConanFileMock from conans.test.utils.test_files import temp_folder def test_source_folder_works(): folder = temp_...
save_toolchain_args({ "configure_args": "-foo bar",
<|file_name|>cache.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Alexander Bredo # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the # following conditions are met: # # 1. Redistributions of source code must retain the ...
"flowDurationMilliseconds": 300 }
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lice...
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2008-2013 by # Erwin Marsi and Tilburg University # This file is part of the Pycornetto package. # Pycornetto is free software; you can redistribute it and/or modify # it under the terms of th...
if opts.pretty_print is None:
<|file_name|>ToolbarControlWebViewActivity.java<|end_file_name|><|fim▁begin|>/* * Copyright 2014 Soichiro Kashima * * 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.apa...
@Override public void onScrollChanged(int scrollY, boolean firstScroll, boolean dragging) { }
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals __author__ = ", ".join(["Shyue Ping Ong", "Anubhav Jain", "Geoffroy Hautier", "William Davidson Richard", "Stephen Dacek", "Sai Jayaraman", "Michael Kocher", "Dan Gunter", ...
#Useful aliases for commonly used objects and modules.
<|file_name|>file_test.go<|end_file_name|><|fim▁begin|>package client import ( "bytes"<|fim▁hole|> "sort" "strings" "testing" "time" "github.com/grafana/loki/pkg/loghttp" "github.com/grafana/loki/pkg/logproto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestFileClient_Q...
"errors" "io"
<|file_name|>test_export_tasks.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import json import logging import os import pickle import sys import uuid from unittest.mock import Mock, PropertyMock, patch, MagicMock, ANY import celery import yaml from billiard.einfo import ExceptionInfo from django.conf impor...
projection=out_projection, boundary=selection, warp_params=ANY,
<|file_name|>stdout.rs<|end_file_name|><|fim▁begin|>use opentelemetry::{ sdk::export::trace::stdout, sdk::trace::{self, Sampler}, trace::Tracer, }; fn main() { // Install stdout exporter pipeline to be able to retrieve collected spans. // For the demonstration, use `Sampler::AlwaysOn` sampler to sa...
tracer.in_span("operation", |_cx| {});
<|file_name|>swell_foop_.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 """ Sandbox for "swell-foop" command """ import glob import os import signal import sys import network_mod import subtask_mod class Main: """ Main class """ def __init__(self) -> None: try: self.conf...
<|file_name|>token.rs<|end_file_name|><|fim▁begin|>#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] pub struct Token(pub usize); use slab; impl Token {<|fim▁hole|> #[inline] pub fn as_usize(self) -> usize { let Token(inner) = self; inner } } impl slab::Index for Token { fn from_usize...
<|file_name|>util.py<|end_file_name|><|fim▁begin|><|fim▁hole|> COMP_ID = 'layer' _ = trstring_factory(COMP_ID)<|fim▁end|>
from ..i18n import trstring_factory