prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>ServiceOperatorRepository.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2012-2016 52°North Initiative for Geospatial Open Source
* Software GmbH
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as publishe... | |
<|file_name|>test_set_start_page01.py<|end_file_name|><|fim▁begin|>###############################################################################
#
# Tests for XlsxWriter.<|fim▁hole|># Copyright (c), 2013, John McNamara, jmcnamara@cpan.org
#
import unittest
import os
from ...workbook import Workbook
from ..helperfunc... | # |
<|file_name|>slope.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import numpy as np
import sys
import scipy
from scipy import stats
data_file = sys.argv[1]
data = np.loadtxt(data_file)
slope, intercept, r_value, p_value, std_err = stats.linregress(data[499:2499,0], data[499:2499,1])
nf = open('linear_reg.dat', 'w')
... | #!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
|
<|file_name|>EnterPwdActivity.java<|end_file_name|><|fim▁begin|>package mobilesafe.dda.com.activity;
import android.app.Activity;
import android.content.Intent;<|fim▁hole|>import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import com.dda.mobilesafe.utils.UIUtils;
... | import android.os.Bundle;
import android.text.InputType;
import android.view.View; |
<|file_name|>evmctl-tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later... | |
<|file_name|>settings.tsx<|end_file_name|><|fim▁begin|>import Form from './reuse/form';
import Input from './reuse/input';
import { BreadCrumb } from './reuse/breadcrumb';
import { GET_SETTINGS, GfycatClientSettingsFromRender, SETTINGS_CHANGED, RETURN_SETTINGS } from '../settingsHandler';
import * as React from 'react'... | this.updateState({...event, password: this.state.password, apiSecret: this.state.apiSecret}); |
<|file_name|>check_duplicate_key.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import six.moves.cPickle as pickle
import os
import sys
import theano
from six import iteritems, itervalues
DISPLAY_DUPLICATE_KEYS = False
DISPLAY_MOST_FREQUENT_DUPLICATE_CCODE = False
dirs = []
if len(sys.argv) >... | f = open(path)
mod = f.read()
f.close()
mods.setdefault(mod, ()) |
<|file_name|>PCommand.java<|end_file_name|><|fim▁begin|><|fim▁hole|>import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.comman... | package com.gmail.nossr50.commands.party;
|
<|file_name|>DemoBase.java<|end_file_name|><|fim▁begin|>package com.xsing.demo;
import android.graphics.Typeface;<|fim▁hole|>
/**
* Baseclass of all Activities of the Demo Application.
*
* @author Philipp Jahoda
*/
public abstract class DemoBase extends FragmentActivity {
protected String[] mMonths = new Str... | import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity; |
<|file_name|>example.rs<|end_file_name|><|fim▁begin|>use std::iter::FromIterator;
pub struct SimpleLinkedList<T> {
head: Option<Box<Node<T>>>,
len: usize,
}
struct Node<T> {
data: T,
next: Option<Box<Node<T>>>,
}
impl<T> SimpleLinkedList<T> {
pub fn new() -> Self {
SimpleLinkedList { head... | } |
<|file_name|>regex.js<|end_file_name|><|fim▁begin|>/**
* Regex patterns used through keigai
*
* `url` was authored by Diego Perini
*
* @namespace regex
* @private<|fim▁hole|> after_space: /\s+.*/,
allow: /^allow$/i,
allow_cors: /^access-control-allow-methods$/i,
and: /^&/,
args: /\((.*)\)/,
auth: /\/\/(.*)\@... | * @type {Object}
*/
let regex = { |
<|file_name|>fs.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LIC... | |
<|file_name|>feature_uacomment.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the -uacomment option."""
from test_fra... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
# Copyright 2016-2017 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
from lino_xl.lib.tickets.models import *
from lino.api import _
Ticket.hide_elements('closed')
# class Ticket(Ticket):
# class Meta(Ticket.Meta):
# ... | description:30 comments.CommentsByRFC:30 skills.DemandsByDemander #working.SessionsByTicket:20 |
<|file_name|>5.0-parity_test.go<|end_file_name|><|fim▁begin|><|fim▁hole|>package epi
import (
"testing"
"github.com/stretchr/testify/assert"
)
// Write a function to calculate the parity
// returns 1 if odd number of bits
// return 0 if even number of bits
func parity(n uint64) int {
count := 0
for i := 0; i < 6... | |
<|file_name|>test.ts<|end_file_name|><|fim▁begin|>/*
* @license Apache-2.0
*
* Copyright (c) 2020 The Stdlib 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.... | |
<|file_name|>history.py<|end_file_name|><|fim▁begin|>def plotHistory(plot_context, axes):
"""
@type axes: matplotlib.axes.Axes
@type plot_config: PlotConfig
"""
plot_config = plot_context.plotConfig()
if (
not plot_config.isHistoryEnabled()
or plot_context.history_data is None
... | color=style.color,
alpha=style.alpha,
marker=style.marker, |
<|file_name|>create.rs<|end_file_name|><|fim▁begin|>static LOREM_IPSUM: &'static str =
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.... | Ok(_) => println!("successfully wrote to {}", display),
}
} |
<|file_name|>view_attributes.py<|end_file_name|><|fim▁begin|>'''
These classes specify the attributes
that a view object can have when editing views
'''
__author__ = 'William Emfinger'
__copyright__ = 'Copyright 2016, ROSMOD'
__credits__ = ['William Emfinger', 'Pranav Srinivas Kumar']
__license__ = 'GPL'
__version__ =... |
def __init__(self, value): |
<|file_name|>logHist.py<|end_file_name|><|fim▁begin|>import matplotlib.pyplot as plt
import numpy as np
def logHist(X, N=30,fig=None, noclear=False, pdf=False, **kywds):
'''
Plot logarithmic histogram or probability density function from
sampled data.
Args:
X (numpy.ndarray): 1-D array of samp... | (or matplotlib.pyplot.semilogx if pdf is True)
|
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.utils.translation import ugettext
from django.contrib.auth.decorators import... | |
<|file_name|>array.js<|end_file_name|><|fim▁begin|>var nextTick = null;
if (process) {
if ('nextTick' in process) {
nextTick = process.nextTick;
if (typeof module !== 'undefined') {
if ('exports' in module)
module.exports = Array;
}
}
}
if (!nextTick) {
// For support general browser, using setTimeout... | if (workerCount == 0 && completed >= total) {
if (complete)
complete(); |
<|file_name|>unittest_strings.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015-2018, 2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2016 Derek Gustafson <degustaf@gmail.com>
# Copyright (c) 2018 Lucas Cimon <lucas.cimon@gmail.com>
# Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
# Copyright (c) 201... | 'RF"X"',
) |
<|file_name|>testfuncs.py<|end_file_name|><|fim▁begin|>import sys, re
if sys.version_info < (3, 0):
import testcase
import modules.cssfuncs as funcs
else:
from . import testcase
from ..modules import cssfuncs as funcs
class TestFunctions(testcase.TestCase):
title = "CSS Functions"
def test_functions(self):
... | return """
/*
* @box-shadow = box-shadow(0 0 4px #ff0) |
<|file_name|>group__spi__interface__gr.js<|end_file_name|><|fim▁begin|>var group__spi__interface__gr =
[
[ "Status Error Codes", "group__spi__execution__status.html", "group__spi__execution__status" ],
[ "SPI Events", "group__SPI__events.html", "group__SPI__events" ],
[ "SPI Control Codes", "group__SPI_... | [ "busy", "group__spi__interface__gr.html#a50c88f3c1d787773e2ac1b59533f034a", null ],
[ "data_lost", "group__spi__interface__gr.html#a9675630df67587ecd171c7ef12b9d22a", null ],
[ "mode_fault", "group__spi__interface__gr.html#aeaf54ec655b7a64b9e88578c5f39d4e3", null ],
[ "reserved", "group__sp... |
<|file_name|>icon.go<|end_file_name|><|fim▁begin|>// Copyright 2016-2020 The Libsacloud Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|>// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agr... | // you may not use this file except in compliance with the License. |
<|file_name|>platform.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class Platform(object):
"""The platform that the target browser is running on.
Provides a limi... | possible.
"""
def GetSurfaceCollector(self, trace_tag): |
<|file_name|>el.js<|end_file_name|><|fim▁begin|>/*
* CKFinder
* ========
* http://ckfinder.com
* Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved.
*
* The software, this file and its contents are subject to the CKFinder
* License. Please read the license.txt file before using, i... |
dir : 'ltr', // MISSING
HelpLang : 'en',
LangCode : 'el',
|
<|file_name|>0003_auto_20170118_1901.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>
from django.db import migrations, models
import django.forms.widgets
class Migration(migrations.Migration):
dependencies = [
('sshcomm', '0002_auto_20170118_1702'),
]
operations = [
m... | # Generated by Django 1.10.4 on 2017-01-18 18:01
from __future__ import unicode_literals |
<|file_name|>Utils.py<|end_file_name|><|fim▁begin|>__author__ = 'Tony Beltramelli - www.tonybeltramelli.com'
import string
import random
class Utils:
@staticmethod
def get_random_text(length_text=10, space_number=1, with_upper_case=True):
results = []
while len(results) < length_text:
... | @staticmethod |
<|file_name|>BitSightForSecurityPerformanceManagement_test.py<|end_file_name|><|fim▁begin|>import demistomock as demisto
from CommonServerPython import BaseClient
import BitSightForSecurityPerformanceManagement as bitsight
from datetime import datetime
def test_get_companies_guid_command(mocker):
# Positive Scena... | _, outputs, _ = bitsight.get_company_details_command(client, inp_args)
assert outputs.get('name') == 'abc'
|
<|file_name|>modelDB.py<|end_file_name|><|fim▁begin|>r"""
Used to configure the main parameters for each implemented model.
.. currentmodule:: compmech.conecyl.modelDB
"""
import numpy as np
from scipy.sparse import coo_matrix
from clpt import *
from fsdt import *
db = {
'clpt_donnell_bc1': {
... | elif model == 'clpt_sanders_bc4':
k0edges = fk0edges(m1, m2, n2, r1, r2, L,
cc.kuBot, cc.kuTop,
cc.kvBot, cc.kvTop, |
<|file_name|>key_index.go<|end_file_name|><|fim▁begin|>// Copyright 2015 CoreOS, 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-2.0
... |
n := g.walk(f)
if n != -1 { |
<|file_name|>oncoprintheaderview.ts<|end_file_name|><|fim▁begin|>import OncoprintModel from "./oncoprintmodel";
import menuDotsIcon from "../img/menudots.svg";
import svgfactory from "./svgfactory";
import $ from "jquery";
import ClickEvent = JQuery.ClickEvent;
import {CLOSE_MENUS_EVENT as TRACK_OPTIONS_VIEW_CLOSE_MENU... | option.onClick && option.onClick(trackGroupIndex); |
<|file_name|>BaseSharedNewConcernImpl.java<|end_file_name|><|fim▁begin|>//#############################################################################
//# #
//# Copyright (C) <2014> <IMS MAXIMS> #
//# ... | |
<|file_name|>validate.go<|end_file_name|><|fim▁begin|>// Copyright ©2015 The gonum 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 functions
import (
"math"
"testing"
"gonum.org/v1/gonum/diff/fd"
"gonum.org/v1/gonum/flo... | Global bool |
<|file_name|>LevelBasedHierarchyImpl.java<|end_file_name|><|fim▁begin|>/**
* <copyright>
* </copyright>
*
* $Id$
*/
package orgomg.cwm.analysis.olap.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.ecli... | * <!-- begin-user-doc -->
|
<|file_name|>Mutex.java<|end_file_name|><|fim▁begin|>/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* ... | private static class Sync extends AbstractQueuedSynchronizer {
public boolean isHeldExclusively() { return getState() == 1; } |
<|file_name|>base.py<|end_file_name|><|fim▁begin|># Copyright (C) 2018 Red Hat, 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/licen... | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations |
<|file_name|>RuleBuilder.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2016 William Van Woensel
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... | public String getId() {
return id; |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var config = require('../config'),
mongoose = require('mongoose'),
fixtures = require('node-mongoose-fixtures'),
Q = require('q');
<|fim▁hole|>
defer.promise.then(function() {
console.log('Done');
process.exit(0);
});<|fim▁end|> | // Connect to database
mongoose.connect(config.mongo.uri, config.mongo.options);
var defer = Q.defer(); |
<|file_name|>EnqueueActivity.java<|end_file_name|><|fim▁begin|>package com.gmail.altakey.ray;
import android.app.Activity;
import android.os.Bundle;
import android.os.Parcelable;
import android.net.Uri;
import android.content.Intent;
import android.widget.Toast;
import android.util.Log;
import android.net.http.Androi... | Toast.makeText(EnqueueActivity.this, "Sent to remote playlist.", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(EnqueueActivity.this, "Cannot send to remote playlist", Toast.LENGTH_SHORT).show();
} |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use num::Integer;<|fim▁hole|>use rand::Rng;
pub mod constants;
pub fn get_random_bool() -> bool {
let mut rnd = rand::thread_rng();
rnd.gen()
}
pub fn get_rand_from_range<T>(min: T, max: T) -> T
where T: Integer + SampleUniform {
let mut rnd = rand::thread_rng... | use rand::distributions::uniform::SampleUniform; |
<|file_name|>vsphere_session.go<|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/.
package vim
import (
"net/http"
"github.com/cloudesca... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from snowball.utils import SnowMachine
from snowball.climate import WeatherProbe
# Note: multiline import limits line length
from snowball.water.phases import (
WaterVapor, IceCrystal, SnowFlake
)
def let_it_snow():
"""
Makes it snow, using a SnowMachine... | <snowball.water.phases.SnowFlake object at 0x101dbc310>]
""" |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![feature(collections)]
extern crate collections;
pub mod parser {
use collections::fmt::{Formatter, Result};
use std::fmt::Debug;
use collections::str::Chars;
use std::collections::BTreeMap;
use std::string;
pub enum Json {
String(st... | |
<|file_name|>repo_pool.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# 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... |
# add member to ip list ? |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the ... | |
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|>from datetime import datetime
import listenbrainz_spark.stats.utils as stats_utils
from listenbrainz_spark.path import LISTENBRAINZ_DATA_DIRECTORY
from listenbrainz_spark import utils
from listenbrainz_spark.tests import SparkTestCase
from listenbrainz_spark.stat... | self.assertEqual(rows[0]['listened_at'], offset_days(from_date, 5, shift_backwards=False))
self.assertEqual(rows[1]['listened_at'], offset_days(to_date, 5))
def test_get_last_monday(self): |
<|file_name|>SSAO.js<|end_file_name|><|fim▁begin|>/**
* This Control enables to render a Scene with a Screen Space Ambient Occlusion (SSAO) effect.
*
* @namespace GIScene
* @class Control.SSAO
* @constructor
* @extends GIScene.Control
*/
GIScene.Control.SSAO = function() {
//inherit
GIScene.Control.call(thi... |
//define passes
scenePass = new THREE.RenderPass( this.scene.root, this.scene.camera ); |
<|file_name|>initial_work.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
def start_service():
subprocess.Popen("ipy start_srv.py", stdout=subprocess.PIPE)
return 0
def close_service():
os.system("taskkill /im ipy.exe /f")<|fim▁end|> | import subprocess
import os
|
<|file_name|>_common.py<|end_file_name|><|fim▁begin|>import abc
import random
import fudge
from contextlib import contextmanager
from ..support.models import *
class BackendTestCaseMixin(object):
__metaclass__ = abc.ABCMeta
@abc.abstractproperty # pragma: no cover
def backend_class(self):
"""ba... | |
<|file_name|>test_file_handling_popup.py<|end_file_name|><|fim▁begin|>import unittest
from GUI.PopUps.FileHandlerPopUp import FileHandlerPopUp
from Constants.FileHandlingMode import *
<|fim▁hole|> self.callbackbuttontext = "button"
self.path = "test_path"
self.filters = ["*.jpg", "*.test"]
... | class TestFileHandlingPopUp(unittest.TestCase):
def setUp(self):
self.title = "test" |
<|file_name|>open_close.rs<|end_file_name|><|fim▁begin|>extern crate xiapi_sys;
extern crate libc;
use xiapi_sys::xiapi;
use libc::c_void;
use std::mem;
use std::ffi::CString;
fn run() -> Result<(),String> {
let mut numDevices = 0u32;
unsafe {
let result = xiapi::xiGetNumberDevices(&mut numDevices);
... |
let handle: xiapi::PHANDLE = libc::malloc(mem::size_of::<xiapi::PHANDLE>() as libc::size_t) as xiapi::PHANDLE;
let open_result = xiapi::xiOpenDevice( wIndex, handle);
|
<|file_name|>fail-simple.rs<|end_file_name|><|fim▁begin|>// -*- rust -*-
// 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://ww... | |
<|file_name|>0004_auto_20180313_1052.py<|end_file_name|><|fim▁begin|># Generated by Django 2.0.2 on 2018-03-13 02:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cc', '0003_auto_20180228_1145'),
]
operations = [
migrations.AlterField... | ),
] |
<|file_name|>compose.spec.js<|end_file_name|><|fim▁begin|>const curry = require('../../curry');
const compose = require('..');
describe('Compose', () => {<|fim▁hole|> const prefixDr = curry((prefix, name) => `${prefix} ${name}`)('Dr');
const suffixBatchelor = curry((suffix, name) => `${name} ${suffix}`)('BSc');... | test('should compose name', () => { |
<|file_name|>compat_handler.py<|end_file_name|><|fim▁begin|>"""Backwards compatible tunnel handler for
phpsploit v1 backdoors, aka:
<?php eval(base64_decode($_POST[%%PASSKEY%%])); ?>
"""
__all__ = ["Request_V1_x"]
from . import handler
from .exceptions import BuildError
class Request_V1_x(handler.Request):
<|fim... | def __init__(self):
"""Force default method to POST, because only this one
was supported on phpsploit v1 versions.
""" |
<|file_name|>conversion.py<|end_file_name|><|fim▁begin|># Developed for module tiericide, this script will quickly print out a market
# conversion map based on patch notes, as well as database conversion mapping.
import argparse
import os.path
import sqlite3
import sys
# Add eos root path to sys.path so we can import... | Alumel Magnetometric ECCM Sensor Array I is being converted to Alumel-Wired Enduring Sensor Booster |
<|file_name|>test_zip.py<|end_file_name|><|fim▁begin|>import io<|fim▁hole|>from waterbutler.core import streams
from waterbutler.core.utils import AsyncIterator
from tests import utils
class TestZipHandler(utils.HandlerTestCase):
HOOK_PATH = 'waterbutler.server.api.v0.zip.ZipHandler._send_hook'
@testing.ge... | import zipfile
from tornado import testing
|
<|file_name|>TrialParamValue.java<|end_file_name|><|fim▁begin|>package org.adligo.tests4j.system.shared.trials;
import org.adligo.tests4j.shared.common.ClassMethods;
import org.adligo.tests4j.shared.xml.I_XML_Builder;
public class TrialParamValue implements I_TrialParamValue {
public static final String TAG_NAME = "... | builder.endLine(); |
<|file_name|>ScreenLockLandscapeOutlined.js<|end_file_name|><|fim▁begin|>"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _createSvgIcon = _interopRequireDefault(require("... | }), 'ScreenLockLandscapeOutlined');
exports.default = _default; |
<|file_name|>probebus.py<|end_file_name|><|fim▁begin|>###############################################################################
# This file is part of openWNS (open Wireless Network Simulator)
# _____________________________________________________________________________
#
# Copyright (C) 2004-2007
# Chair of Co... | |
<|file_name|>history_delete_history.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os, sys
sys.path.insert( 0, os.path.dirname( __file__ ) )<|fim▁hole|>try:
assert sys.argv[2]
except IndexError:
print 'usage: %s key url [purge (true/false)] ' % os.path.basename( sys.argv[0] )
sys.exit( 1 )
tr... | from common import delete
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
histo... | tests_require=test_requirements
) |
<|file_name|>filesystem_test.py<|end_file_name|><|fim▁begin|>import sys
from mock import (
patch, Mock
)
from pytest import raises
from ..test_helper import argv_kiwi_tests
import kiwi
from kiwi.exceptions import KiwiFileSystemSetupError
from kiwi.builder.filesystem import FileSystemBuilder
class TestFileSyste... | self.setup.export_package_verification.assert_called_once_with(
'target_dir'
) |
<|file_name|>test_task.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
import nose
from nose.tools import assert_equal
from pyomni.object.task import OmniTask
class TestOmniTask(object):
def test_get_xml(self):<|fim▁hole|> nose.main(argv=['nosetests', '-s', '-v'], defaultTest=__file__... | return
if __name__ == '__main__': |
<|file_name|>MyLinksDAOITUtil.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2000 - 2021 Silverpeas
*
* 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
*... | static void assertCategoryIds(final List<Integer> actualIds, final Integer... expectedIds) {
if (expectedIds.length == 0) {
assertThat(actualIds, empty());
} else { |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from rest_framework import generics, permissions, views, response,status
from .models import Account
from .serializers import AccountCreateSerializer, AccountSerializer, AuthenticateSerializer, \<|fim▁hole|> UpdateAccountSerializer, AccountRetrieveSerializer
# Cre... | |
<|file_name|>test_dynamicfields.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import unittest
import mock<|fim▁hole|>
class DynamicFieldsMixinTestCase(unittest.TestCase):
"""Test functionality of the DynamicFieldsMixin class."""
def test_restrict_dynamic_fields(self):<|fim▁end|> | |
<|file_name|>leftMenuAutosize.ts<|end_file_name|><|fim▁begin|>/// <reference path="../../config/config.ts" />
/// <reference path="../interfaces/directives/IDirective.ts" />
declare var angular:any;
//Directive responsible for manipulating left (top) menu icons area when available size change
module Directives {
... | |
<|file_name|>Pascal's Triangle.py<|end_file_name|><|fim▁begin|>class Solution(object):
def generate(self, numRows):
"""
:type numRows: int
:rtype: List[List[int]]
"""
pascal = []
if numRows >= 1:
pascal.append([1])
for i in range(1, numRows):... | pascal[-1].append(pascal[-2][-1]) |
<|file_name|>getopts.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/li... | Err(f) => check_fail_type(f, OptionDuplicated_),
_ => fail2!() |
<|file_name|>hookqueue_test.go<|end_file_name|><|fim▁begin|>// Copyright 2012, 2013 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package relation_test
import (
stdtesting "testing"
"time"
"github.com/juju/charm/hooks"
gc "launchpad.net/gocheck"
"github.com/juju/juju/state/api/para... | func fullTest(summary string, steps ...checker) hookQueueTest {
return hookQueueTest{summary, &relation.State{21345, nil, ""}, steps}
} |
<|file_name|>HighOven.java<|end_file_name|><|fim▁begin|>package com.blamejared.compat.tcomplement.highoven;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.blamejared.ModTweaker;
import com.blamejared.compat.mantle.RecipeMatchIIngredient;
import com... | }
}
@SubscribeEvent |
<|file_name|>QXmppVCardManager.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2008-2014 The QXmpp developers
*
* Author:
* Manjeet Dahiya
*
* Source:
* https://github.com/qxmpp-project/qxmpp
*
* This file is a part of QXmpp library.
*
* This library is free software; you can redistribute it and/or
* ... | return QStringList() << ns_vcard;
}
|
<|file_name|>LikeOperatorConversion.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
*... | import org.apache.calcite.rex.RexNode;
import org.apache.calcite.sql.SqlOperator; |
<|file_name|>dmd.hpp<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2014, Sam Schetterer, Nathan Kutz, University of Washington
Authors: Sam Schetterer
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. ... | }
template<class matrix> |
<|file_name|>call_chain.rs<|end_file_name|><|fim▁begin|>// CITA
// Copyright 2016-2017 Cryptape Technologies LLC.
// This program is free software: you can redistribute it
// and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation,
// either version 3 of the L... | use util::{H256, H160};
use util::KeyValueDB;
|
<|file_name|>test_prototype_module_export.py<|end_file_name|><|fim▁begin|># #############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2010 - 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is fre... | ##############################################################################
import io
import zipfile
|
<|file_name|>test_clientmanager.py<|end_file_name|><|fim▁begin|># Copyright 2012-2013 OpenStack, 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/... |
def test_singleton(self): |
<|file_name|>SessionDocumentModel.js<|end_file_name|><|fim▁begin|>import {observable} from 'mobx';
export default class SessionDocumentModel {
@observable id;
@observable sessionID;
@observable studentID;
@observable filename;<|fim▁hole|> @observable CreatorId;
@observable archived;
constru... | |
<|file_name|>ccScmStatus.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export const enum ccScmStatus {
MODIFIED = 1,
UNTRACKED = 2
}<|fim▁end|> | |
<|file_name|>permissions.py<|end_file_name|><|fim▁begin|>from rest_framework.permissions import BasePermission, SAFE_METHODS
class IsOwnerOrReadOnly(BasePermission):
"""<|fim▁hole|>
"""
def has_object_permission(self, request, view, obj):
return request.method in SAFE_METHODS or view.get_stream().... | Check if request is safe or authenticated user is owner. |
<|file_name|>ftl_util.py<|end_file_name|><|fim▁begin|># Copyright 2017 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/licenses/L... | "phase": 1,
"key": key,
"hit": hit |
<|file_name|>WindowsInputService.cpp<|end_file_name|><|fim▁begin|>#ifdef WINDOWS_PLATFORM
#include "WindowsInputService.hpp"
#include "WindowsMouseInterface.hpp"
#include "WindowsKeyboardInterface.hpp"
namespace MPACK
{
namespace Input
{
WindowsInputService::WindowsInputService()
{
m_pMouse = new WindowsMou... | }
}
#endif |
<|file_name|>backends.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.message import sanitize_address
from django.conf import settings
import requests
import logging
logger = logging.getLogger(__name__)
class Newsletter2GoEm... | |
<|file_name|>32.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>
export = ServiceDesk32;<|fim▁end|> | import { ServiceDesk32 } from "../../"; |
<|file_name|>ICMS.java<|end_file_name|><|fim▁begin|>package br.com.caelum.designpatterns.decorator.imposto;
import br.com.caelum.designpatterns.modelo.Orcamento;
public class ICMS extends Imposto{
public ICMS(Imposto outroImposto) {
super(outroImposto);
}
public ICMS() {
}
public double calcula(Orcamento... | } |
<|file_name|>FillHeapLocalMethodOnStack.java<|end_file_name|><|fim▁begin|>package com.dev9.crash.bad;
import com.dev9.crash.AbstractBadThing;
import org.springframework.stereotype.Service;
@Service
public class FillHeapLocalMethodOnStack extends AbstractBadThing {
public String getBadThingDescription() {
... | return "Fill Up The Heap On The Stack";
}
|
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>//-----------------------------------------------------------------------
//
// mod parser::atom TEST
//
//-----------------------------------------------------------------------
use super::Status;
use super::{parse_dot, parse_eof, parse_literal, parse_match, MatchRul... | assert_eq!(status_end.pos.row, 0); |
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... | c_uint8_ptr(data),
c_size_t(len(data)))
if result:
raise ValueError("Error %d while instantiating MD2" |
<|file_name|>meta.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
from pybrain.rl.learners.learner import Learner
class MetaLearner(Learner):
""" Learners that make use of other Learners, or learn how to learn. """<|fim▁end|> | __author__ = 'Tom Schaul, tom@idsia.ch' |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from django_revision.modeladmin_mixin import ModelAdminRevisionMixin
from edc_base.modeladmin_mixins import (
ModelAdminNextUrlRedirectMixin, ModelAdminFormInstructionsMixin,
ModelAdminFormAutoNumberMixin,
ModelAdminReadOnl... |
@admin.register(InnerContainer, site=edc_map_admin) |
<|file_name|>test_subliminal.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import shutil
from unittest import TestCase, TestSuite, TestLoader, TextTestRunner
from babelfish import Language
from subliminal import list_subtitles, download_s... | videos = [MOVIES[0]]
languages = {Language('por', 'BR')}
subtitles = list_subtitles(videos, languages)
self.assertEqual(len(subtitles), len(videos)) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | """passlib tests""" |
<|file_name|>agilentBase8590A.py<|end_file_name|><|fim▁begin|>"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2013-2017 Alex Forencich
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 ... |
self._identity_description = "Agilent 8590 series IVI spectrum analyzer driver"
self._identity_supported_instrument_models = ['8590A', '8590B', '8591A', '8592A', '8592B',
'8593A', '8594A', '8595A'] |
<|file_name|>status.go<|end_file_name|><|fim▁begin|>/*
*
* Copyright 2017 gRPC 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-... | "errors"
"fmt" |
<|file_name|>validator_operator.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use diem_global_constants::OPERATOR_KEY;
use diem_management::{config::ConfigPath, constants, error::Error, secure_backend::SharedBackend};
use structopt::StructOpt;
#[der... | }
impl ValidatorOperator {
pub fn execute(self) -> Result<String, Error> { |
<|file_name|>CommonDBConfiguration.java<|end_file_name|><|fim▁begin|>/**
* <pre>
* Project: cargo-itest Created on: 26 nov. 2014 File: fCommonDBConfiguration.java
* Package: nl.tranquilizedquality.itest.configuration
*
* Copyright (c) 2014 Tranquilized Quality www.tr-quality.com All rights
* reserved.
*
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.