prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>server.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import json
from flask import Flask, abort, jsonify, request, g, url_for
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.httpauth import HTTPBasicAuth
from passlib.apps import custom_app_context as pwd_context
from itsdange... | def get_colors():
print(colors) |
<|file_name|>accordion.component.spec.ts<|end_file_name|><|fim▁begin|>import { Type } from '@angular/core';
import { ComponentFixture } from '@angular/core/testing';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { KEYS } from '@terminus/ngx-tools/keycodes';
import {
createCompone... | key: { get: () => KEYS.ENTER.code },
});
trigger1.dispatchEvent(spaceEvent); |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/*! Buefy v0.8.16 | MIT License | github.com/buefy/buefy */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = globa... | computedClasses: function computedClasses() {
var _ref; |
<|file_name|>nightmare.js<|end_file_name|><|fim▁begin|>import test from 'ava';
import Nightmare from 'nightmare';
const nightmare = new Nightmare({
show: process.env.SHOW
});
test('food', async t => {
await nightmare
.goto('http://localhost:3333');
const visible = await nightmare
.click('#food')
.w... | .click('#food')
.wait(1000) |
<|file_name|>argument_parser_wrapper.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2011 Vikraman Choudhury <vikraman.choudhury@gmail.com>
# Copyright 2012 G. Gaydarov <ggaydarov@gmail.com>
#
# Distributed under the terms of the GNU General Public License v2 or later
from __future__ import print_f... | Prints a usage message incorporating the message to stderr and
exits.
Argparse.py says: |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>(function() {
//###########################################################################################################
var CND, Multimix, alert, badge, debug, dec, decG, echo, help, hex, hexG, info, isa, log, name, nameO, nameOG, rpr, type_of, types, urge, vali... | case 'plain': |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use ::{CATCH_STRUCT_PREFIX, CATCH_FN_PREFIX, CATCHER_ATTR};
use parser::ErrorParams;
use utils::*;
use syntax::codemap::{Span};
use syntax::ast::{MetaItem, Ident, TyKind};
use syntax::ext::base::{Annotatable, ExtCtxt};
use syntax::tokenstream::TokenTree;
use syntax::p... | output
} |
<|file_name|>mongo-test.js<|end_file_name|><|fim▁begin|>var config = require('./config.console'),
mongoose = require('mongoose'),
chalk = require('chalk'),
http = require('http'),
fs = require('fs');
var db = mongoose.connect(config.db, function(err) {
if (err) {
console.error(chalk.red('Could not connect to M... | console.log('Do something here'); |
<|file_name|>HaxeMultiplicativeExpressionImpl.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2014-2015 AS3Boyan
* Copyright 2014-2014 Elias Ku
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Lice... | @Nullable
public HaxeTryStatement getTryStatement() { |
<|file_name|>Portal2StatsTest.java<|end_file_name|><|fim▁begin|>/**
* This code is free software; you can redistribute it and/or modify it under
* the terms of the new BSD License.
*
* Copyright (c) 2008-2011, Sebastian Staudt
*/
package com.github.koraktor.steamcondenser.steam.community;
import static com.githu... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>"""Copyright 2009 Chris Davis
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
Unless required by ap... | return json_response_for(request, matches, jsonp=jsonp) |
<|file_name|>locustfile.py<|end_file_name|><|fim▁begin|>"""Configuration for a load testing using Locust.
To start load testing, run `make server` and `make test-load`.
"""
import random
from json.decoder import JSONDecodeError
from django.urls import reverse
from locust import HttpLocust, TaskSet, task
class Solvin... | |
<|file_name|>BrunchDiningOutlined.js<|end_file_name|><|fim▁begin|>import * as React from 'react';
import createSvgIcon from './utils/createSvgIcon';
<|fim▁hole|> <path d="M2 21.5c0 .28.22.5.49.5h13.02c.27 0 .49-.22.49-.5V20H2v1.5zM15.5 16H11v-2H7v2H2.5c-.28 0-.5.22-.5.5V18h14v-1.5c0-.28-.22-.5-.5-.5zm4.97-.55c.99-1.07... | export default createSvgIcon( |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | pub mod add_activity; |
<|file_name|>group-header-pane.js<|end_file_name|><|fim▁begin|>import React from 'react';
import Reflux from 'reflux';
import ChatActions from '../events/chat-actions';
import ChatStore from '../events/chat-store';
import classNames from 'classnames';
import {deepEqual} from '../events/chat-store-utils';
import {Dropdo... | <div id="group-header" className={followedClass}>{groupHeader}
{star}
{dropDown}
</div> |
<|file_name|>pattern.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use super::super::scope;
#[allow(missing_copy_implementations)]
pub struct Pattern {
pub regex: regex::Regex,
}
impl super::Validator for Pattern {
fn validate(&self, val: &Value, path: &str, _scope: &scope::Scope) -> super::ValidationState {
... | use regex;
use serde_json::Value;
use super::super::errors; |
<|file_name|>telly.py<|end_file_name|><|fim▁begin|>import robot_util
def sendSettings(ser, args):
if args.right_wheel_forward_speed is not None:
robot_util.sendSerialCommand(ser, "rwfs " + str(args.right_wheel_forward_speed))
if args.right_wheel_backward_speed is not None:
robot_util.sendSer... | if args.straight_delay is not None: |
<|file_name|>html_view.py<|end_file_name|><|fim▁begin|>from osv import osv, fields
class html_view(osv.osv):
_name = 'html.view'<|fim▁hole|> 'name': fields.char('Name', size=128, required=True, select=True),
'comp_id': fields.many2one('res.company', 'Company', select=1),
'bank_ids': fields.o... | _columns = { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016, Matt Layman<|fim▁hole|><|fim▁end|> | '''Storage services which use the file system to store data''' |
<|file_name|>PreShutdownEventTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2012 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package test.org.jboss.forge.furnace.lifecycle;
import org.jboss.arqu... | |
<|file_name|>hlp.py<|end_file_name|><|fim▁begin|>"""
Microsoft Windows Help (HLP) parser for Hachoir project.
Documents:
- Windows Help File Format / Annotation File Format / SHG and MRB File Format
written by M. Winterhoff (100326.2776@compuserve.com)
found on http://www.wotsit.org/
Author: Victor Stinner
Creati... | |
<|file_name|>hello.py<|end_file_name|><|fim▁begin|>import requests, urllib, httplib, base64
from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
@app.route("/")
def hello():
return render_template("index.html")
@app.route("/search", methods=['POST', 'GET'])
def callAPI():
error = None... | |
<|file_name|>sample.ts<|end_file_name|><|fim▁begin|>/// <reference path="../../typings/tsd.d.ts" />
import {Component, View, DynamicComponentLoader, ElementRef} from 'angular2/angular2';
import {RouteParams} from 'angular2/router';
import {DemoCarousel} from './carousel/demo-carousel';
import {DocCarousel, SourceHt... | })
export class Sample {
|
<|file_name|>s3.py<|end_file_name|><|fim▁begin|>import logging
import boto3
import io
<|fim▁hole|>log = logging.getLogger(__name__)
def includeme(config):
Settings = slovar(config.registry.settings)
S3.setup(Settings)
class S3(fs.FS):
def __init__(self, ds, create=False):
path = ds.ns.split('/')
... | from slovar import slovar
from prf import fs
|
<|file_name|>routing.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
karaoke_routing = [
route("websocket.connect", party_connected, path=r"^/party/(?P<party_id>[a-zA-Z0-9_-]+)"),
route("websocket.receive", party_message),
route("websocket.disconnect", party_disconnected)
]<|fim▁end|> | from channels.routing import route
from .consumer import party_connected, party_disconnected, party_message |
<|file_name|>test_flex.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Flex compatibility tests.
@since: 0.1.0
"""
import unittest
import pyamf
from pyamf import flex, util, amf3, amf0
from pyamf.tests.util import EncoderMixIn
class A... | flex.ArrayCollection(('a', 'b', 'b')),
['a', 'b', 'b'] |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod allocator;
mod array;
mod module;
#[macro_use]
mod packed_func;
mod graph;
#[cfg(target_env = "sgx")]
#[macro_use]
pub mod sgx;
mod threading;
mod workspace;
use std::os::raw::c_char;
pub use self::{array::*, graph::*, module::*, packed_func::*, threading::*, works... | |
<|file_name|>LoggersImpl.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* jkl
*/
package com.microsoft.... | } |
<|file_name|>FlickrFeed.java<|end_file_name|><|fim▁begin|>package com.malak.yaim.model;
import java.util.List;
public class FlickrFeed {
private String title;
private String link;
private String description;
private String modified;
private String generator;
private List<Item> items = null;
public Str... | this.generator = generator; |
<|file_name|>container.go<|end_file_name|><|fim▁begin|>package main
import (
"encoding/json"
"fmt"
"github.com/codegangsta/cli"
"github.com/olekukonko/tablewriter"
"github.com/zero-os/0-core/base/pm"
"gopkg.in/yaml.v2"
"os"
"sort"
"strconv"
"strings"
)
type containerData struct {
Container struct {
Argum... | sort.Ints(ids)
for _, id := range ids { |
<|file_name|>test_delivery_trip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import erpnext
import unittest
from frappe.utils import nowdate, add_days
from erpnext.tes... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import logging
logging.basicConfig()
from enum import Enum
logger = logging.getLogger('loopabull')
logger.setLevel(logging.INFO)
class Result(Enum):
runfinished = 1
runerrored = 2
unrouted = 3
error = 4<|fim▁hole|>
# vim: set expandtab sw=4 sts=4... | |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django.db.models import Q
from django.forms.fields import CharField, MultiValueField
from django.forms.widgets import MultiWidget, TextInput
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django_filters.filters impor... | # na implementação, não havia regras a implementar para orgao
return queryset |
<|file_name|>userEditor.js<|end_file_name|><|fim▁begin|>$(document).ready(function(){
$("#inc_tab #tb1").removeClass();
$("#inc_tab #tb4").addClass("active");<|fim▁hole|> $(this).val(user_name);
if (user_name.length==0){
$(this).parent().find("#user_name_null_warn").show();
$(this).parent().find("#user_nam... |
$("#user_name").blur(function(){
var user_name = $.trim($(this).val()); |
<|file_name|>objpools.rs<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2016-2017, Robert Ou <rqou@robertou.com>
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 ret... | |
<|file_name|>type.py<|end_file_name|><|fim▁begin|># type command prints file contents
from lib.utils import *
def _help():
usage = '''
Usage: type (file)
Print content of (file)
Use '%' in front of global
vars to use value as file<|fim▁hole|>name.
'''
print(usage)
def main(argv):
if len(argv) < 1 or ... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup<|fim▁hole|> 'beautifulsoup4'
]
setup(
name='urbandefinition',
install_requires=install_requires,
version=0.3,
description='Get Urban Dictionary definitions from the terminal',
author='Asad Dhamani',
author_email=... |
install_requires = [
'requests', |
<|file_name|>massage-box.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
import sys
g = {}<|fim▁hole|> (n1, n2, p, q, t, tg, x) = line.strip().split(' ')
t = int(t)
x = float(x)
key = ' '.join((n1,n2,p,q))
if not key in n:
n[key] = 0
g[key] = 0
n[key] += t
g[key] +... | n = {}
for line in sys.stdin: |
<|file_name|>core.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)]
use std::collections::HashMap;
use std::fs::File;
use std::io::prelude::*;
//use std::num::ToPrimitive;
use num::traits::ToPrimitive;
use time;
use types::{MalVal,MalRet,err_val,err_str,err_string,
_nil,_true,_false,_int,string,
... | fn prn(a: Vec<MalVal>) -> MalRet {
println!("{}", printer::pr_list(&a, true, "", "", " "));
Ok(_nil()) |
<|file_name|>testrunner.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import print_function
import argparse
import os
from falafel import findout_terminal_width
from falafel import test_list
from falafel.runners import FalafelTestRunner
from falafel.loaders import FalafelTestLoader
parser = ... | '--logdirectory. If the logdirectory does not exist '
'it gets automatically.')
parser.add_argument("-d", "--logdirectory",
help="log directory [default=%(default)s]", |
<|file_name|>MenuItem.ts<|end_file_name|><|fim▁begin|>/// <reference path="Primitives/MenuBase.ts" />
module Fayde.Controls {
export class MenuItem extends Fayde.Controls.HeaderedItemsControl {
ParentMenuBase: Primitives.MenuBase;
Click = new RoutedEvent<RoutedEventArgs>();
static C... | OnKeyDown (e: Input.KeyEventArgs) {
if (!e.Handled && Input.Key.Enter === e.Key) {
this.OnClick();
|
<|file_name|>loss.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | |
<|file_name|>pipelines.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class WebofknowledgePipeline(object):
def process_item(self, item, ... | return item |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 Karl Cheng, other contributors and third parties.
// Licensed under the GNU General Public License, version 3 or later.
// See the COPYRIGHT.md file at the top-level directory of this
// distribution, or go to http://www.gnu.org/licenses/.
#![crate_ty... | #[cfg(target_os="macos")]
pub extern "system" fn NP_Initialize(bFuncs: *mut NPNetscapeFuncs) -> NPError {
return init(bFuncs);
} |
<|file_name|>cachequery.py<|end_file_name|><|fim▁begin|>import click
import pickle
from build import Build
@click.group()
def cli():
pass
@cli.command()
@click.option('--cache-file', default='test-cache')
@click.option('--query')
def query(cache_file, query):
with open(cache_file, 'rb') as f:
key, ... |
cli() |
<|file_name|>subscribers.py<|end_file_name|><|fim▁begin|>##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, facul... | # This program is free software: you can redistribute it and/or modify |
<|file_name|>DebugConfigurationsGroup.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2012-2018 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* ... | private void fillActions() {
removeAll();
for (DebugConfiguration configuration : configurationsManager.getConfigurations()) { |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
{
'name': "Better validation for Attendance",
'summary': """
Short (1 phrase/line) summary of the module's purpose, used as
subtitle on modules listing or apps.openerp.com""",
'description': """
Long d... | ],
# only loaded in demonstration mode
'demo': [
'demo.xml', |
<|file_name|>authorizer_test.go<|end_file_name|><|fim▁begin|>package authorization
import (
"net"
"net/url"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/authelia/authelia/v4/internal/configuration/schema"
)
type Authorize... | func NewAuthorizerTester(config schema.AccessControlConfiguration) *AuthorizerTester {
fullConfig := &schema.Configuration{
AccessControl: config, |
<|file_name|>CMap.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a c... | # whenever node is deleted. search iterators
# for any iterator that becomes invalid.
|
<|file_name|>app.main.ts<|end_file_name|><|fim▁begin|>import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';<|fim▁hole|>
ProdConfig();
if (module['hot']) {
module['hot'].accept();
}
platformBrowserDynamic().bootstrapModule(BrooklynAppModule);<|fim▁end|> | import { ProdConfig } from './blocks/config/prod.config';
import { BrooklynAppModule } from './app.module'; |
<|file_name|>angular2.ts<|end_file_name|><|fim▁begin|>export * from './core';
export * from './profile';<|fim▁hole|>export * from './lifecycle_hooks';
export * from './bootstrap';<|fim▁end|> | |
<|file_name|>0009_add_last_read_mm_auto.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding ... | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
<|file_name|>adt-tuple-struct.rs<|end_file_name|><|fim▁begin|>// Unit test for the "user substitutions" that are annotated on each
// node.
struct SomeStruct<T>(T);
fn no_annot() {
let c = 66;
SomeStruct(&c);
}
<|fim▁hole|>
fn annot_reference_any_lifetime() {
let c = 66;
SomeStruct::<&u32>(&c);
}
fn ... | fn annot_underscore() {
let c = 66;
SomeStruct::<_>(&c);
} |
<|file_name|>postgres.py<|end_file_name|><|fim▁begin|>import os
import sys
import tempfile
from fabric.api import run, sudo, env, local, hide, settings
from fabric.contrib.files import append, sed, exists, contains
from fabric.context_managers import prefix
from fabric.operations import get, put
from fabric.context_ma... | self.install_package()
|
<|file_name|>test_plus_1_array.py<|end_file_name|><|fim▁begin|>import unittest<|fim▁hole|>from katas.beta.plus_1_array import up_array
class UpArrayTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(up_array([2, 3, 9]), [2, 4, 0])
def test_equals_2(self):
self.assertEqual(up... | |
<|file_name|>about_method_bindings.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
def function():
return "pineapple"
def function2():
return "tractor"
class Class(object):
def method(self):
return "parrot"
class AboutMethodBindings(Ko... | |
<|file_name|>query_and_dump_data.py<|end_file_name|><|fim▁begin|>import httplib
import shlex
from datetime import datetime
#from pytz import timezone
import csv
import sys
import math
from time import time
from multiprocessing import Process
#finland = timezone('Europe/Helsinki')
server_dns = "121.78.237.160" #"ke... | read_data(conn,id)
|
<|file_name|>test_prepared_report.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies and Contributors
# License: MIT. See LICENSE
import frappe
import unittest
import json
class TestPreparedReport(unittest.TestCase):
def setUp(self):
self.report = frappe.get_doc({
... | self.assertTrue(self.prepared_report_doc.report_start_time) |
<|file_name|>add-get.steps.js<|end_file_name|><|fim▁begin|>/*jshint unused:false*/
var chai = require('chai'),
expect = chai.expect;
var request = require('supertest');
module.exports = function() {
'use strict';
this.Then(/^The JSON is returned by issuing a "GET" at the specified uri:$/, function(json, call... | }; |
<|file_name|>debug.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 Mozilla
//
// 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
// Unless required ... | |
<|file_name|>pygletbackend.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2018 Jonathan Peirce
# Distributed under the terms of the GNU General Public License (GPL).
"""A Backend class defines the core low-level functions required by a Wind... | defDisp = pyglet.window.get_platform().get_default_display()
allScrs = defDisp.get_screens() |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Piston Cloud Computing, Inc.
# Copyright 2012 Cloudscal... |
class TimestampMixin(object):
created_at = Column(DateTime, default=lambda: timeutils.utcnow())
updated_at = Column(DateTime, onupdate=lambda: timeutils.utcnow()) |
<|file_name|>tenacious.py<|end_file_name|><|fim▁begin|># Copyright (C) 2020 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
from collections im... | |
<|file_name|>cleanup.rs<|end_file_name|><|fim▁begin|>// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0.
use crate::storage::mvcc::{
metrics::{MVCC_CONFLICT_COUNTER, MVCC_DUPLICATE_CMD_COUNTER_VEC},
ErrorInner, Key, MvccTxn, ReleasedLock, Result as MvccResult, SnapshotReader, TimeStamp,
};
use c... | // related to TTL check should be covered by other test cases.
let engine = TestEngineBuilder::new().build().unwrap();
// Shorthand for composing ts. |
<|file_name|>install.js<|end_file_name|><|fim▁begin|>var install = function () {
var step = $('body').find('[data-step]').first();
var progress = $('.progress');
var label = $('#label');
label.text(step.data('step'));
$.ajax({
url: step.data('action'),
success: function () {
... |
install(); |
<|file_name|>DrivingSys.java<|end_file_name|><|fim▁begin|>package org.usfirst.frc.team5518.robot.subsystems;
import org.usfirst.frc.team5518.robot.RobotMap;
import org.usfirst.frc.team5518.robot.commands.ArcadeDriveJoystick;
import edu.wpi.first.wpilibj.GenericHID;
import edu.wpi.first.wpilibj.Joystick;
import edu.wp... | robotDrive.arcadeDrive(moveStick, moveAxis, rotateStick, rotateAxis);
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# Daniel Campos (danielcampos@avanzosc.es) Date: 07/10/2014
#
# This program is free software: you can redistribute it and/or modify
# it under the te... | |
<|file_name|>typings.d.ts<|end_file_name|><|fim▁begin|>/**
* Executable object
*/
interface Executable {<|fim▁hole|><|fim▁end|> | command: string
args: string[]
} |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main<|fim▁hole|> "io/ioutil"
"os"
"os/exec"
"os/signal"
"strings"
"time"
log "github.com/Sirupsen/logrus"
)
var (
username string
password string
binaryPath string = "openvpn"
)
// Read a traditional OpenVPN credential file and pull the username ... |
import (
"fmt"
"io" |
<|file_name|>CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memcpy_82_bad.cpp<|end_file_name|><|fim▁begin|>/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_memcpy_82_bad.cpp
<|fim▁hole|>Template File: sources-sink-82_bad.tmpl.cpp
*/
/*
* @description
... | Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE805.label.xml
|
<|file_name|>runtime_test.py<|end_file_name|><|fim▁begin|>"""Unit test for treadmill.runtime.
"""
import errno
import socket
import unittest
import mock
import treadmill
import treadmill.rulefile
import treadmill.runtime
from treadmill import exc
class RuntimeTest(unittest.TestCase):
"""Tests for treadmill.ru... | @mock.patch('socket.socket.bind', mock.Mock()) |
<|file_name|>VNA_module.py<|end_file_name|><|fim▁begin|>import numpy as np
from pycqed.analysis import measurement_analysis as ma
from pycqed.analysis_v2 import measurement_analysis as ma2
from pycqed.measurement import sweep_functions as swf
from pycqed.measurement import detector_functions as det
MC_instr = None
VNA... | """
list_freq_ranges is a list that contains the arays defining all the ranges of interest.
"""
for idx, range_array in enumerate(list_freq_ranges): |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2007 Google 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/licens... | |
<|file_name|>AMQPConnectionFactory.cpp<|end_file_name|><|fim▁begin|>/////////////////////////////////////////////////////////////////////////
//
// © University of Southampton IT Innovation Centre, 2013
//
// Copyright in this software belongs to University of Southampton
// IT Innovation Centre of Gamma House, Enterpr... |
#include "stdafx.h" |
<|file_name|>tfutils.py<|end_file_name|><|fim▁begin|># -*- coding:utf8 -*-
# File : tfutils.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 1/31/17
#
# This file is part of TensorArtist.
import re
import tensorflow as tf
class TArtGraphKeys:
PLACEHOLDERS = 'placeholders'
TART_VARIABLE... | except tf.errors.FailedPreconditionError: |
<|file_name|>schema.rs<|end_file_name|><|fim▁begin|>table! {
__diesel_schema_migrations (version) {
version -> VarChar,
run_on -> Timestamp,
}
}
pub struct NewMigration<'a>(pub &'a str);
use backend::Backend;<|fim▁hole|>impl<'update: 'a, 'a, DB> Insertable<__diesel_schema_migrations::table, DB... | use expression::AsExpression;
use expression::helper_types::AsExpr;
use persistable::{Insertable, ColumnInsertValue, InsertValues};
|
<|file_name|>ExpoCLI.ts<|end_file_name|><|fim▁begin|>import path from 'path';
import process from 'process';
import spawnAsync from '@expo/spawn-async';
import { EXPO_DIR } from './Constants';
type Options = {
cwd?: string;
root?: string;
stdio?: 'inherit' | 'pipe' | 'ignore';
};
export async function runExpoC... | stdio: options.stdio || 'inherit',
env: {
...process.env,
EXPO_NO_DOCTOR: 'true', |
<|file_name|>bigtable_table_service.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go.
// source: google.golang.org/cloud/bigtable/internal/table_service_proto/bigtable_table_service.proto
// DO NOT EDIT!
package google_bigtable_admin_table_v1
import proto "github.com/golang/protobuf/proto"
import... | return nil, err
} |
<|file_name|>_fine_cal.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Authors: Eric Larson <larson.eric.d@gmail.com>
# License: BSD (3-clause)
import numpy as np
from ..utils import check_fname, _check_fname
def read_fine_calibration(fname):
"""Read fine calibration information from a .dat file.
... | # with field widths (e.g., %.6f) chosen to match how Elekta writes
# them out
cal_line = np.concatenate([calibration['locs'][ci], |
<|file_name|>35. Search Insert Position.py<|end_file_name|><|fim▁begin|>class Solution(object):
def searchInsert(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
O(logn)<|fim▁hole|> return low
if target > nums[high]:
return... | """
low = 0
high = len(nums) - 1
if target <= nums[low]: |
<|file_name|>treeprettyprinter.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Natural Language Toolkit: ASCII visualization of NLTK trees
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Andreas van Cranenburgh <A.W.vanCranenburgh@uva.nl>
# Peter Ljunglöf <peter.ljunglof@gu.se>
# URL: <http://nltk.... | |
<|file_name|>editor.ts<|end_file_name|><|fim▁begin|>/*
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
*/
/*
Top-level react component for editing MediaWiki documents
*/
import { createEditor } from "../frame-tree/editor";
import... | ]), |
<|file_name|>request.go<|end_file_name|><|fim▁begin|>package registration
import "encoding/json"<|fim▁hole|> ClientName string `json:"client_name"`
ClientUri string `json:"client_uri"`
LogoUri string `json:"logo_uri"`
Contacts s... |
type Request struct { |
<|file_name|>outcomes.py<|end_file_name|><|fim▁begin|>"""
Helper functions for managing interactions with the LTI outcomes service defined
in LTI v1.1.
"""
from hashlib import sha1
from base64 import b64encode
import logging
import uuid
from lxml import etree
from lxml.builder import ElementMaker
from oauthlib.oauth1... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""heroku_blog URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlp... | url(r'^logout', logout, name='logout'),
url(r'^admin/', include(admin.site.urls)), |
<|file_name|>bulk_import_drug_tariff.py<|end_file_name|><|fim▁begin|>"""Bulk importer for manually-prepared tariff CSV.
This probably won't be used again following initial data load, so
could be deleted after that.
"""
import csv
import logging
from datetime import datetime
from django.core.management.base import B... | if 'Category A' in row['DT Cat']:
tariff_category = 1 |
<|file_name|>compose.js<|end_file_name|><|fim▁begin|>"use strict";
let Ci = Components.interfaces;
let Cc = Components.classes;
let Cu = Components.utils;
let Cr = Components.results;
var loader = Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader);
loader.loadSubScript("resource://emic/... | |
<|file_name|>key_manager.rs<|end_file_name|><|fim▁begin|>use rand::rngs::OsRng;
use std::fs::File;
use std::io::Write;
#[allow(unreachable_code, unused_variables)]<|fim▁hole|> let keypair: &[u8] = { todo!() };
let secret_file = std::env::current_dir().unwrap().join("bootstrap_secret");
let mut file = File:... | fn main() {
let csprng = OsRng {}; |
<|file_name|>fodtitalicsheets.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Combine SVG Images of Italic Practice Sheets into an OpenDocument Document
# Written in 2014 by Jordan Vaughan
#
# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to ... | <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
<style:paragraph-properties fo:break-before="page"/>
</style:style>
<style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics"> |
<|file_name|>addTagPermission.js<|end_file_name|><|fim▁begin|>import { extend } from 'flarum/extend';
import PermissionGrid from 'flarum/components/PermissionGrid';
<|fim▁hole|> extend(PermissionGrid.prototype, 'moderateItems', items => {
items.add('tag', {
icon: 'fas fa-tag',
label: app.translator.tra... | export default function() { |
<|file_name|>WayPointDeserializer.java<|end_file_name|><|fim▁begin|>/*
(c) winniehell (2012)
This file is part of the game Battle Beavers.
Battle Beavers 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 Foundatio... | return null;
}
|
<|file_name|>cube.py<|end_file_name|><|fim▁begin|>"""
This page is in the table of contents.
The xml.py script is an import translator plugin to get a carving from an Art of Illusion xml file.
An import plugin is a script in the interpret_plugins folder which has the function getCarving. It is meant to be run from th... | __credits__ = 'Nophead <http://hydraraptor.blogspot.com/>\nArt of Illusion <http://www.artofillusion.org/>'
__date__ = '$Date: 2008/21/04 $'
__license__ = 'GPL 3.0'
|
<|file_name|>main.js<|end_file_name|><|fim▁begin|>var debug = false;
var isStatsOn = false;
var authWindow;
var app;
var runLoop = function() {
app.update();
app.draw();
}<|fim▁hole|> app = new App({}, document.getElementById('canvas'));
window.addEventListener('resize', app.resize, false);
document.addEventLis... | var initApp = function() {
if (app!=null) { return; } |
<|file_name|>EconHook.java<|end_file_name|><|fim▁begin|>package com.simplyian.superplots;
import java.util.logging.Level;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.plugin.RegisteredServiceProvider;
public class EconHook {<|fim▁hole|>
public EconHook(SuperPlotsPlugin main) {
this.main ... | private final SuperPlotsPlugin main;
private Economy economy = null; |
<|file_name|>allTests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.<|fim▁hole|># This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included ... | # |
<|file_name|>estriangulo_prueba.py<|end_file_name|><|fim▁begin|>def estriangulo(a,b,c):
print("el primer argumento es:",a)
print("el segundo argumento es:",b)
print("el tercer argumento es:",c)
return a+b>c and a+c>b and c+b>a
def espitagorico(a,b,c):
return a**2+b**2==c**2 or a**2+c**2==b**2 or b*... | return a==b or a==c or b==c
print(estriangulo(int(input("numero? ")),4,5)) |
<|file_name|>weather.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
import html5lib
import urllib2
from numpy import median, array
from xml_icd import parseICD
from html5lib import treebuilders
def salt():
wx = {}
try:
tcs = parseICD("http://icd.salt/xml/salt-tcs-icd.xml")
... | else:
print "No information received." |
<|file_name|>person-list.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnDestroy, OnInit, Self } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { Subscription, combineLatest } from 'rxjs';
import { switchMap, scan } from 'rxjs/operators';
import * as moment from 'moment... | GeneralPhoneNumber: x, |
<|file_name|>HelpBot.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
############################# Copyright ################################
# Author: GHOSTnew # 2014 #
########################################################################
#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.