prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>db.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from google.appengine.api import datastore, datastore_types, datastore_errors
from google.appengine.datastore import datastore_query, datastore_rpc
from google.appengine.api import memcache
from google.appengine.api import search
from server.config... | if conf["viur.db.caching" ]>0:
if isinstance( entities, Entity ): #Just one: |
<|file_name|>webhdfs.js<|end_file_name|><|fim▁begin|>'use strict';
var fs = require('fs');
var demand = require('must');
var sinon = require('sinon');
var WebHDFS = require('../lib/webhdfs');
var WebHDFSProxy = require('webhdfs-proxy');
var WebHDFSProxyMemoryStorage = require('webhdfs-proxy-memory');
describe('WebHD... | demand(err).be.null(); |
<|file_name|>basetest_pgt.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
im... | def make_agent(self, env, gpu):
model = self.make_model(env) |
<|file_name|>0007_contact_recruiter.py<|end_file_name|><|fim▁begin|># Generated by Django 2.0.4 on 2018-04-24 21:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contacts', '0006_auto_20180423_1629'),
]
operations = [
migrations.AddFi... | model_name='contact',
name='recruiter', |
<|file_name|>Reconciler.java<|end_file_name|><|fim▁begin|>// The MIT License (MIT)
//
// Copyright (c) 2016 Tim Jones
//
// 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 restriction... | toClear.setCleared(true);
tableModel.queueAdd(tableModel.getBeanCount()-1, toClear);
} |
<|file_name|>apprun-dev-tools.js<|end_file_name|><|fim▁begin|>var _a;
import app from './app';
import toHTML from './vdom-to-html';
import { _createEventTests, _createStateTests } from './apprun-dev-tools-tests';
app['debug'] = true;
window['_apprun-help'] = ['', () => {
Object.keys(window).forEach(cmd => {
... | }
}
}); |
<|file_name|>ftp.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import os
from ftplib import FTP
def place_file(ftp, filename):
ftp.storbinary('STOR ' + filename,open(filename, 'rb'))
if __name__ == '__main__':
url = 'ftp.k-bits.com'
ftp = FTP(url)
user = 'usuario1@k-bits.com'
passw = 'happy1234'
... | from __future__ import print_function |
<|file_name|>Rain_Water_Trapping.py<|end_file_name|><|fim▁begin|># Rain_Water_Trapping
def trappedWater(a, size) :
# left[i] stores height of tallest bar to the to left of it including itself
left = [0] * size
# Right [i] stores height of tallest bar to the to right of it including itself
... | # filling left (list/array)
left[0] = a[0]
for i in range( 1, size):
left[i] = max(left[i-1], a[i])
|
<|file_name|>TimespanSpecifier.py<|end_file_name|><|fim▁begin|>import abjad
from abjad.tools import abctools
class TimespanSpecifier(abctools.AbjadValueObject):
### CLASS VARIABLES ###
__slots__ = (
'_forbid_fusing',
'_forbid_splitting',
'_minimum_duration',
)
### INITIA... | return self._minimum_duration |
<|file_name|>fsu-moves-and-copies.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.... |
struct MoveFoo { copied: int, moved: Box<int>, }
impl MoveFoo {
fn new(x:int,y:int) -> MoveFoo { MoveFoo { copied: x, moved: box y } } |
<|file_name|>Generator.py<|end_file_name|><|fim▁begin|>import collections
from sets import Set
from Drawer import Drawer
class Cultivar():
def __init__(self, id, name, year):
self.id = id
self.name = name
self.year = year
self.parent1 = None
self.parent2 = None
# row index starts from 0
... | |
<|file_name|>util.py<|end_file_name|><|fim▁begin|># encoding: utf-8
#
#<|fim▁hole|># Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from pyLibrary.dot import wrap
def es_query_template():
output = wrap... | # 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/.
# |
<|file_name|>lib.go<|end_file_name|><|fim▁begin|><|fim▁hole|>
func M() int { return 42 }<|fim▁end|> | package lib |
<|file_name|>DigestIntro.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import styled from 'styled-components';
import Color from 'color';
import { Community } from 'types';
import { communityUrl } from 'utils/canonicalUrls';
import { formatDate } from 'utils/dates';
import { Icon } from 'client/component... | <SpanStyle>
<Icon icon="pulse" />
</SpanStyle>
<span>View latest activity</span> |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from .gaussian_process import RandomFeatureGaussianProcess, mean_field_logits
from .spectral_normalization import SpectralNormalization |
<|file_name|>list-log-streams.rs<|end_file_name|><|fim▁begin|>/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use aws_config::meta::region::RegionProviderChain;
use aws_sdk_cloudwatchlogs::{Client, Error, Region, PKG_VERSION};
use structopt::StructOp... | /// * `-g LOG-GROUP` - The name of the log group.
/// * `[-r REGION]` - The Region in which the client is created.
/// If not supplied, uses the value of the **AWS_REGION** environment variable.
/// If the environment variable is not set, defaults to **us-west-2**. |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3.4<|fim▁hole|><|fim▁end|> | # -*- coding: utf-8 -*- |
<|file_name|>IndividualQcUtilsTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015-2020 OpenCB
*
* 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... | * See the License for the specific language governing permissions and
* limitations under the License. |
<|file_name|>locks.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 will... | % (self, access, self.owners)) |
<|file_name|>gruntfile.js<|end_file_name|><|fim▁begin|>'use strict';
var _ = require('lodash');
var webpack = require('webpack');
var mergeWebpackConfig = function (config) {
// Load webpackConfig only when using `grunt:webpack`
// load of grunt tasks is faster
var webpackConfig = require('./webpack.config');
... | |
<|file_name|>Vec2Type.java<|end_file_name|><|fim▁begin|>//
// Ce fichier a été généré par l'implémentation de référence JavaTM Architecture for XML Binding (JAXB), v2.2.8-b130911.1802
// Voir <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Toute modification apportée à ce fichier sera perdu... | * </restriction>
* </complexContent>
* </complexType> |
<|file_name|>exception.py<|end_file_name|><|fim▁begin|>class ShirtsioError(Exception):<|fim▁hole|> self.http_body = http_body and http_body.decode('utf-8')
self.http_status = http_status
self.json_body = json_body
class APIError(ShirtsioError):
pass
class APIConnectionError(ShirtsioError)... | def __init__(self, message=None, http_body=None, http_status=None, json_body=None):
super(ShirtsioError, self).__init__(message) |
<|file_name|>decoder.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from ErrorsHandler import *
from string import strip, find, split, lower, rjust, atoi, atof, replace, digits, zfill, join
from tools import cleanlist, which, filecopy, mkdirtree, touch, listmatch, rm, escapedfil... | file.close()
samplerate = mpeg3info.mpeg.samplerate
command = "(%s --stereo -s \"%s\" | sox -t raw -r %d -w -s -c 2 - -r 44100 -t wav \"%s\") 2>&1" % (mpg123_command, escapedfilename(filename), samplerate, escapedfilename(target))
elif (lower(filename[-4:]) =... |
<|file_name|>CacheAbstractJdbcStore.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 ... | |
<|file_name|>queueoftwostacks.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8; mode:python -*-
"""
Implements a queue efficiently using only two stacks.
"""
from helpers import SingleNode
from stack import Stack
class QueueOf2Stacks:
def __init__(self):
self.stack_1 = Stack()
self.stack_2 = S... | while self.stack_1:
self.stack_2.push(self.stack_1.pop()) |
<|file_name|>threatcrowd.py<|end_file_name|><|fim▁begin|>import datetime
import json
import logging
import requests
from core.analytics import OneShotAnalytics
from core.errors import ObservableValidationError
from core.observables import Hostname, Email, Ip, Hash
class ThreatCrowdAPI(object):
"""Base class for... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtailsearch import urls as wagtail... | # For anything not caught by a more specific rule above, hand over to |
<|file_name|>sample_test.go<|end_file_name|><|fim▁begin|>package tddbc<|fim▁hole|> "github.com/stretchr/testify/assert"
"testing"
)
func TestSay(t *testing.T) {
actual := Say("Wow!")
expected := "Wow! TDD BootCamp!!"
if actual != expected {
t.Errorf("actual=%s, expect=%s", actual, expected)
}
}
func TestSay_t... |
import ( |
<|file_name|>funcReacLotkaVolterra.py<|end_file_name|><|fim▁begin|>#########################################################################
## This program is part of 'MOOSE', the
## Messaging Object Oriented Simulation Environment.
## Copyright (C) 2013 Upinder S. Bhalla. and NCBS
## It is made available un... | |
<|file_name|>VideoPlayer.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2005-2015 Team Kodi
* http://kodi.tv
*
* 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 vers... |
bool CVideoPlayer::OpenRadioRDSStream(CDVDStreamInfo& hint)
{
if (!m_VideoPlayerRadioRDS->CheckStream(hint)) |
<|file_name|>servers.go<|end_file_name|><|fim▁begin|>package events
import "encoding/json"
// User is the format for the user command.
type User struct {
User string `json:"user"`
Name string `json:"name"`
}
// Nick is the format for the nick command.
type Nick struct {
Nick string `json:"nick"`
}
// Quit is the... | |
<|file_name|>compat.py<|end_file_name|><|fim▁begin|>"""
The `compat` module provides support for backwards compatibility with older
versions of Django/Python, and compatibility wrappers around optional packages.
"""
# flake8: noqa
from __future__ import unicode_literals
import inspect
import django
from django.apps ... | except ImportError:
django_filters = None
|
<|file_name|>kekule.localize.widget.zh.js<|end_file_name|><|fim▁begin|>/** @ignore */
Kekule.LOCAL_RES = true;
Kekule.Localization.setCurrModule("widget");
Kekule.Localization.addResource("zh", "WidgetTexts",
{
"CAPTION_OK": "确定",
"CAPTION_CANCEL": "取消",
"CAPTION_YES": "是",
"CAPTION_NO": "否",
"CAPTIO... | "HINT_MOL_DISPLAY_TYPE": "改变分子显示样式",
"HINT_SKELETAL": "以键线式显示",
"HINT_CONDENSED": "以缩写式显示", |
<|file_name|>generate.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""Utility to generate files to benchmark"""
# Copyright Abel Sinkovics (abel@sinkovics.hu) 2016.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/L... | )
parser.add_argument(
'--out',
dest='out_dir', |
<|file_name|>basepolygon.C<|end_file_name|><|fim▁begin|>// Copyright (C) 1999-2021
// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
// For conditions of distribution and use, see copyright notice in "copyright"
#include "basepolygon.h"
#include "fitsimage.h"
BasePolygon::BasePolygon(Base* p, const Vector&... | if (h < 5) {
Vector s1 = v * bckMatrix();
Vector s2 = bckMap(handle[h-1],Coord::CANVAS); |
<|file_name|>Install.py<|end_file_name|><|fim▁begin|># Install.py -- File system installation commands
# Copyright (C) 2007-2013 CEA
#
# This file is part of shine
#
# 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 S... |
class Install(Command): |
<|file_name|>DsReplicaObjMetaData2Ctr.py<|end_file_name|><|fim▁begin|># encoding: utf-8
# module samba.dcerpc.drsuapi
# from /usr/lib/python2.7/dist-packages/samba/dcerpc/drsuapi.so
# by generator 1.135
""" drsuapi DCE/RPC """
# imports
import dcerpc as __dcerpc
import talloc as __talloc<|fim▁hole|>class DsReplicaObjM... | |
<|file_name|>test_book.py<|end_file_name|><|fim▁begin|>from quanthistling.tests import *
class TestBookController(TestController):
def test_index(self):
response = self.app.get(url(controller='book', action='index'))<|fim▁hole|><|fim▁end|> | # Test response... |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>'use strict'
const { describe, it, beforeEach, afterEach } = require('mocha')
const Helper = require('hubot-test-helper')
const { expect } = require('chai')
const mock = require('mock-require')
const http = require('http')
const sleep = m => new Promise(resolve => set... | 'http://localhost:8080/info-rut?name=perez&type=empresa' |
<|file_name|>napalm_get_facts.py<|end_file_name|><|fim▁begin|>"""
(c) 2020 Kirk Byers <ktbyers@twb-tech.com>
(c) 2016 Elisa Jasinska <elisa@bigwaveit.org>
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
t... | for getter in filter_list:
getter_function = "get_{}".format(getter) |
<|file_name|>01c_quick_example.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate clap;
fn main() {
// This example shows how to create an application with several arguments using macro builder.
// It combines the simplicity of the from_usage methods and the performance of the Builder Pattern.
//
... | // - A version flag (automatically generated by clap)
// + Uses "-V" or "--version" (Only autogenerated if you do NOT specify your own "-V" or "--version")
// - A subcommand "test" (subcommands behave like their own apps, with their own arguments
// + Used by "$ myapp test" with the ... |
<|file_name|>instr_mulps.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};<|fim▁hole|>use ::Reg::*;
use ::RegScale::*;
use ::test::run_test;
#[test]
fn mulps_1() {
run_test(&Instruction { mnemonic: Mnemonic::MULPS, operand1: Some(Direc... | use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*; |
<|file_name|>3160-spec.ts<|end_file_name|><|fim▁begin|>import { Chart } from '../../src';
import { createDiv, removeDom } from '../util/dom';
describe('#3160', () => {
const div = createDiv();
const chart = new Chart({
container: div, // 指定图表容器 ID
height: 300, // 指定图表高度
autoFit: true,
});
chart.coo... | .color('type')
.label('type', { layout: { type: 'pie-spider' } })
.adjust('stack'); |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>"""The base command."""
from datetime import datetime
from json import dumps
from watches.util import ESClientProducer
class Base(object):
"""A base command."""
TEXT_PLAIN = 'plain/text'
JSON_APPLICATION = 'application/json'
TRANSFORM_PARAM = '--tr... | :return:
""" |
<|file_name|>logs.js<|end_file_name|><|fim▁begin|>var util = require( '../../utils/util.js' )
Page( {
data: {
projects: [ { name: 'FinalScheduler(终极排班系统)', git: "https://github.com/giscafer/FinalScheduler" },
{ name: 'MoveSite(电影狙击手)', git: "https://github.com/giscafer/moviesite" },
{ name: 'Ponitor(价... | console.log( "## 其他项目 ##" ) |
<|file_name|>test-garbage.js<|end_file_name|><|fim▁begin|>const times = require('lodash/times');
const {GameEngine} = require('../../lib/common/engine');
const {R, G, B, _} = require('../../lib/common/panel-league/util');
module.exports.testAdd = ((test) => {
const game = new GameEngine();
game.addEvent({
tim... | |
<|file_name|>baseAnimationNode.py<|end_file_name|><|fim▁begin|>from RGT.XML.SVG.basicSvgNode import BasicSvgNode
from RGT.XML.SVG.Attribs.conditionalProcessingAttributes import ConditionalProcessingAttributes
from RGT.XML.SVG.Attribs.xlinkAttributes import XlinkAttributes
from RGT.XML.SVG.Attribs.animationTimingAttr... | ATTRIBUTE_EXTERNAL_RESOURCES_REQUIRED = 'externalResourcesRequired'
|
<|file_name|>jquery.storage-manager.js<|end_file_name|><|fim▁begin|>;(function (window, document) {
'use strict';
/**
* Global storage manager
*
* The storage manager provides a unified way to store items in the localStorage and sessionStorage.
* It uses a polyfill that uses cookies as a fa... | |
<|file_name|>ConsumerMovieRibbonApplication.java<|end_file_name|><|fim▁begin|>package com.jack.cloud.movie;
<|fim▁hole|>import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClie... | import com.jack.cloud.config.TestConfiguration;
import org.springframework.boot.SpringApplication; |
<|file_name|>templates.js<|end_file_name|><|fim▁begin|>(function()
{
const MAX_LINE_CHARS = 4000;
const RE_WS = /^\s*$/;
this.search_panel = function(search, type, handler)
{
return (
[
['div',
this['advanced_' + type + '_search'](search),
'class', 'advanced-search-controls'],
... | }
if (script.line_offsets_length[i] &&
script.line_offsets[i] + script.line_offsets_length[i] > script.get_line_length(line)) |
<|file_name|>ip.go<|end_file_name|><|fim▁begin|>package packngo
import "fmt"
const ipBasePath = "/ips"
// IPService interface defines available IP methods
type IPService interface {
Assign(deviceID string, assignRequest *IPAddressAssignRequest) (*IPAddress, *Response, error)
Unassign(ipAddressID string) (*Response... | return nil, nil, err |
<|file_name|>relayUnstableBatchedUpdates.js<|end_file_name|><|fim▁begin|><|fim▁hole|>/**
* Copyright 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule relayUnstableBatchedUpdates
*
* @fo... | |
<|file_name|>select.py<|end_file_name|><|fim▁begin|>"""
Functions to spot hemy regions
"""
import os.path as op
import datetime
from collections import defaultdict, Counter
from tabulate import tabulate
from scipy import stats
import numpy as np
<|fim▁hole|>import vcf
from bcbio.distributed.transaction import file_tr... | import pybedtools
import pysam |
<|file_name|>Bubble Sort.cpp<|end_file_name|><|fim▁begin|>/*
This file is part of White - Storm: Lightning (alpha).
Copyright 2012 Christopher Augustus Greeley
White - Storm: Lightning (alpha) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publ... | { |
<|file_name|>CSS2DRenderer.js<|end_file_name|><|fim▁begin|>/**
* @author mrdoob / http://mrdoob.com/
*/
THREE.CSS2DObject = function ( element ) {
THREE.Object3D.call( this );
this.element = element;
this.element.style.position = 'absolute';
this.addEventListener( 'removed', function ( event ) {
... | var domElement = document.createElement( 'div' );
domElement.style.overflow = 'hidden';
this.domElement = domElement;
|
<|file_name|>imagedata.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 https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::ImageDataBind... | height: u32,
#[ignore_malloc_size_of = "mozjs"] |
<|file_name|>KubeMonitorJob.java<|end_file_name|><|fim▁begin|>package app.monitor.job;
import core.framework.internal.log.LogManager;
import core.framework.json.JSON;
import core.framework.kafka.MessagePublisher;
import core.framework.log.message.StatMessage;
import core.framework.scheduler.Job;
import core.framework.... | boolean ready = true;
for (KubePodList.ContainerStatus status : pod.status.containerStatuses) { |
<|file_name|>matrix.ones.js<|end_file_name|><|fim▁begin|>function ones(rows, columns) {
columns = columns || rows;
if (typeof rows === 'number' && typeof columns === 'number') {
const matrix = [];
for (let i = 0; i < rows; i++) {
matrix.push([]);
for (let j = 0; j < colum... | }
throw new TypeError('Matrix dimensions should be integers.'); |
<|file_name|>RF_Sensor.py<|end_file_name|><|fim▁begin|># Core imports
import copy
import Queue
import thread
import time
# Package imports
from ..core.Threadable import Threadable
from ..reconstruction.Buffer import Buffer
from ..settings import Arguments
from Packet import Packet
from TDMA_Scheduler import TDMA_Sched... | needs to know its own location for the "rssi_broadcast" and the |
<|file_name|>raft_handlers.go<|end_file_name|><|fim▁begin|>package main
import (
"encoding/json"
"github.com/coreos/go-raft"
"net/http"
)
//-------------------------------------------------------------
// Handlers to handle raft related request via raft server port
//-----------------------------------------------... | // Response to the name request
func NameHttpHandler(w http.ResponseWriter, req *http.Request) {
debugf("[recv] Get %s/name/ ", r.url) |
<|file_name|>recipes.py<|end_file_name|><|fim▁begin|># Copyright (C) 2018 Henrique Pereira Coutada Miranda, Alejandro Molina Sanchez, Alexandre Morlet, Fulvio Paleari
#
# All rights reserved.
#
# This file is part of yambopy
#
#
import os
from operator import itemgetter
from collections import OrderedDict
from yambopy ... | def analyse_bse(folder,var,numbexc,intexc,degenexc,maxexc,text,draw,verbose=False):
""" |
<|file_name|>test_auth.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from sentry.testutils import AcceptanceTestCase
class AuthTest(AcceptanceTestCase):
def enter_auth(self, username, password):
# disable captcha as it makes these tests flakey (and requires waiting
# on e... | def test_invalid_credentials(self): |
<|file_name|>main.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>enableProdMode();
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);<|fim▁end|> | import { platformBrowser } from '@angular/platform-browser';
import { enableProdMode } from '@angular/core';
import { AppModuleNgFactory } from '../../../temp/app/navigationbar/keyboardnavigation/app.module.ngfactory';
|
<|file_name|>skip_logic.ts<|end_file_name|><|fim▁begin|>import {Registry} from "../src/registry";
import {expect} from "chai";
import {SkipLogic} from "../src/skip_logic";
import {MemoryFile} from "../src/files/memory_file";
import {Config} from "../src/config";
describe("Skip logic", () => {
it("normal interface, ... | "ENDCLASS.\n" +
"CLASS /ABC/CL_Z_ABAPGIT_TEST_MPC IMPLEMENTATION.\n" +
"ENDCLASS."; |
<|file_name|>test_driver_copy.py<|end_file_name|><|fim▁begin|>import pytest
from tests.utils.targetdriver import TargetDriver, if_feature
from tests.utils.testdriver import TestDriver
def get_services():
return TargetDriver('rep1'), TestDriver('rep2')
@pytest.fixture(autouse=True)
def _(module_launcher_launch)... | d_target, d_test = module_launcher.get_services('rep1', 'rep2') |
<|file_name|>image.go<|end_file_name|><|fim▁begin|>package images // import "github.com/tiborvass/docker/daemon/images"
import (
"fmt"
"github.com/pkg/errors"
"github.com/docker/distribution/reference"
"github.com/tiborvass/docker/errdefs"
"github.com/tiborvass/docker/image"
specs "github.com/opencontainers/im... | |
<|file_name|>call.go<|end_file_name|><|fim▁begin|>package introspect
import (
"encoding/xml"
"strings"
"github.com/godbus/dbus/v5"
)
// Call calls org.freedesktop.Introspectable.Introspect on a remote object
// and returns the introspection data.
func Call(o dbus.BusObject) (*Node, error) {
var xmldata string
v... | }
err = xml.NewDecoder(strings.NewReader(xmldata)).Decode(&node) |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LI... | |
<|file_name|>ex14.py<|end_file_name|><|fim▁begin|>from sys import argv
script, user_name = argv
prompt = '> '
print "Hi %s, I'm the %s script." % (user_name, script)
print "I'd like to ask you a few questions."
print "Do you like me %s?" % user_name
likes = raw_input(prompt)
print "Where do you live %s?" % user_name... | print "What kind of computer do you have?"
computer = raw_input(prompt)
print """ |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use crate::context::Context;
use crate::error::RenderError;
use crate::json::value::ScopedJson;
use crate::output::Output;
use crate::registry::Registry;
use crate::render::{do_escape, Helper, RenderContext};
pub use self::helper_each::EACH_HELPER;
pub use self::helper_... | |
<|file_name|>roles.py<|end_file_name|><|fim▁begin|>"""
Classes used to model the roles used in the courseware. Each role is responsible for checking membership,
adding users, removing users, and listing members
"""
import logging
from abc import ABCMeta, abstractmethod
from collections import defaultdict
<|fim▁hole|>f... | from django.contrib.auth.models import User
from opaque_keys.edx.django.models import CourseKeyField
|
<|file_name|>default.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... | const_nonmatching: false,
combine_substructure: combine_substructure(|a, b, c| {
default_substructure(a, b, c) |
<|file_name|>volume.go<|end_file_name|><|fim▁begin|>package set
import (
"encoding/json"
"errors"
"fmt"
"io"
"os"
"path"
"strings"
"github.com/golang/glog"
"github.com/spf13/cobra"
kapi "k8s.io/kubernetes/pkg/api"
apierrs "k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/api/meta"
kresource "k8s... | } |
<|file_name|>auth.py<|end_file_name|><|fim▁begin|>AUTHENTICATION_BACKENDS = (
# Needed to login by username in Django admin, regardless of `allauth`
'django.contrib.auth.backends.ModelBackend',
# `allauth` specific authentication methods, such as login by e-mail
'allauth.account.auth_backends.Authentic... | ACCOUNT_LOGOUT_ON_GET = True
ACCOUNT_PASSWORD_MIN_LENGTH = 10 |
<|file_name|>space2comment.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.LOW
def dependencies():
pass
def tamper(payload, ... | elif payload[i] == '\'':
quote = not quote
|
<|file_name|>Main.java<|end_file_name|><|fim▁begin|>/*
* Author: Minho Kim (ISKU)
* Date: March 3, 2018
* E-mail: minho.kim093@gmail.com
*
* https://github.com/ISKU/Algorithm
* https://www.acmicpc.net/problem/13169
*/
import java.util.*;
public class Main {
private static long[] array;
private static int N;... | Scanner sc = new Scanner(System.in);
N = sc.nextInt();
|
<|file_name|>bugsnag.js<|end_file_name|><|fim▁begin|>import { Meteor } from 'meteor/meteor';
import bugsnag from 'bugsnag';
import { settings } from '../../../settings';
import { Info } from '../../../utils';
settings.get('Bugsnag_api_key', (key, value) => {
if (value) {
bugsnag.register(value);
}
});
const noti... | bugsnag.notify(error, options);
};
|
<|file_name|>0039_remove_contest_is_external.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-09 22:56
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('judge', '0038_profile_pr... | |
<|file_name|>test_input.py<|end_file_name|><|fim▁begin|>from .. utils import TranspileTestCase, BuiltinFunctionTestCase
<|fim▁hole|>class InputTests(TranspileTestCase):
pass
# FIXME: This test can't run without a redirection for stdin.
# class BuiltinInputFunctionTests(BuiltinFunctionTestCase, TranspileTestCase):... | |
<|file_name|>service.py<|end_file_name|><|fim▁begin|>from flow.commands.service import ServiceCommand
from flow.configuration.inject.broker import BrokerConfiguration
from flow.configuration.inject.redis_conf import RedisConfiguration
from flow.configuration.inject.service_locator import ServiceLocatorConfiguration
fro... | ServiceLocatorConfiguration,
] |
<|file_name|>kbill.ts<|end_file_name|><|fim▁begin|><!DOCTYPE TS><TS>
<context>
<name>KBill</name>
<message><|fim▁hole|> </message>
<message>
<source>New game</source>
<translation>FOO</translation>
</message>
<message>
<source>Pause game</source>
<translation>FOO</... | <source>kBill</source>
<translation>FOO</translation> |
<|file_name|>Subheader.js<|end_file_name|><|fim▁begin|>'use strict';
import React, {PureComponent} from 'react';
import {StyleSheet, View, Text} from 'react-native';
import withMaterialTheme from './styles/withMaterialTheme';
import {withMeasurementForwarding} from './util';
import * as typo from './styles/typo';
impor... | {text} |
<|file_name|>CalendarTableModel.java<|end_file_name|><|fim▁begin|>package bronz.accounting.bunk.ui.model;
import java.util.Calendar;
import java.util.GregorianCalendar;
import javax.swing.table.AbstractTableModel;
import bronz.accounting.bunk.ui.panel.CalendarPanel;
import bronz.utilities.custom.CustomCalendar;
impo... | } |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
Compatibility module.
This module contains duplicated code from Python itself or 3rd party
extensions, which may be included for the following reasons:
<|fim▁hole|>"""
import _inspect
import py3k
from _inspect import getargspec, formatargspec
from py3k ... |
* compatibility
* we may only need a small subset of the copied library/module
|
<|file_name|>driver.go<|end_file_name|><|fim▁begin|>package dbfiles
import (
"encoding/csv"
"io"
"github.com/juju/errgo"
)
type Driver interface {
Extention() string
Write(io.Writer, []string) error
Read(io.Reader) ([][]string, error)
}
type CSV struct{}
func (driver CSV) Extention() string {
return "csv"
}... | if err != nil { |
<|file_name|>uniforms_storage.rs<|end_file_name|><|fim▁begin|>use std::cell::RefCell;
use RawUniformValue;
use smallvec::SmallVec;
use gl;
use Handle;
use context::CommandContext;
use version::Version;
use version::Api;
pub struct UniformsStorage {
values: RefCell<SmallVec<[Option<RawUniformValue>; 16]>>,
un... | Handle::Id(id) => unsafe { |
<|file_name|>CustomTableRow.spec.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import { createShallow } from '@material-ui/core/test-utils';
import { CustomTableRow } from '../components/common/CustomTableRow';
describe('CustomTextField component', () => {
let shallow;
beforeAll(() => {
... | });
}); |
<|file_name|>service_offerings.go<|end_file_name|><|fim▁begin|>package egoscale
// ServiceOffering corresponds to the Compute Offerings
//
// A service offering correspond to some hardware features (CPU, RAM).
//
// See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/latest/service_offerings.h... | |
<|file_name|>GetAllMarketsResponse.java<|end_file_name|><|fim▁begin|>/**
* GetAllUsersResponse.java
* Created by pgirard at 2:07:29 PM on Aug 19, 2010
* in the com.qagwaai.starmalaccamax.shared.services.action package
* for the StarMalaccamax project
*/
package com.qagwaai.starmalaccamax.client.service.actio... | |
<|file_name|>pyre_node.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015-2020 Contributors as noted in the AUTHORS file
#
# 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.... | ev = Event()
self.request_events[request['req_id']] = (ev, limit_peers)
|
<|file_name|>quicksorts.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# quicksorts.py (C) myke, 2015
# 2015-11-08 1.1
# various versions of quicksort alogo
import random
TIMES = 10
SIZE = 10
RANGE = 10
# -----------------------------------------------
def qs1 (al):
""" Algo qui... | for x in array:
if x < pivot: |
<|file_name|>dummy_service_pb_service.ts<|end_file_name|><|fim▁begin|>// package: dummy
// file: dummy/dummy_service.proto
import * as dummy_dummy_service_pb from "../dummy/dummy_service_pb";
export class DummyService {
static serviceName = "dummy.DummyService";
}
export namespace DummyService {
export class Creat... | static readonly requestStream = false;
static readonly responseStream = false;
static readonly requestType = dummy_dummy_service_pb.CreateGameRequest;
static readonly responseType = dummy_dummy_service_pb.CreateGameResponse; |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>from test_support import *<|fim▁hole|><|fim▁end|> | do_flow(opt=["--mode=flow"]) |
<|file_name|>route.js<|end_file_name|><|fim▁begin|>"use strict";
/** @module router
* A module that defines a class for routing
* http requests to handler functions
*/
module.exports = {
Router: Router
};
var url = require('url');
function Router(db) {
this.db = db;
this.routeMap = {
get: [],
post: ... | if(resource.update) this.post(route + '/:id', function(req, res) {resource.update(req, res, db)});
if(resource.destroy) this.get(route + '/:id/destroy', function(req, res) {resource.destroy(req, res, db)});
} |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/**
* Created by huangyao on 14-10-1.
*/
var _ = require('lodash');
var color =require('colors');
var fs =require('fs');
var config = require('../config.js');
var path = require('path');
var mongoose = require("mongoose");
var lcommon = require('lush').common;
consol... | // var m = lcommon.literat(item);
// console.log('loading and use ',m,' model');
// exports[m] = mongoose.model(m); |
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>// require(d) gulp for compatibility with sublime-gulp.
var gulp = require('gulp');
const { src, dest, series, parallel } = require('gulp');
const clean = require('gulp-clean');
const eslint = require('gulp-eslint');
const csso = require('gulp-csso');
const rename ... | } |
<|file_name|>server_test.go<|end_file_name|><|fim▁begin|>// Copyright 2019 The Serviced 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/LICE... | servicedVersion := fmt.Sprintf("SERVICED_VERSION=%s ", servicedversion.Version)
servicedNoRegistry := fmt.Sprintf("SERVICED_NOREGISTRY=%s", o.env["SERVICED_NOREGISTRY"])
servicedServiceImage := fmt.Sprintf("SERVICED_SERVICE_IMAGE=%s", image) |
<|file_name|>object_picktest.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
#Copyright (c) 2016, Buti Al Delail
#All rights reserved.
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are met:
#
#* Redistributions of source ... | self.done = False
self.x = x
self.y = y
self.z = z |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (C) 2016 Job Snijders <job@instituut.net>
#
# This file is part of rtrsub
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redi... | 'License :: OSI Approved :: BSD License', |
<|file_name|>table_datablock.py<|end_file_name|><|fim▁begin|>import attr
import struct
import math
import re
import copy
from datablock import Datablock
from record import Record
from rowid import Rowid
@attr.s
class TableDatablock(Datablock):
header = attr.ib(default=[])
records = attr.ib(default=[])
de... | return [record]
elif(field == 'description'):
if(record.description == value and not record.deleted):
found_records.append(record) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.