prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>test_TurtleSVGMachine.py<|end_file_name|><|fim▁begin|>from turtlelsystem.TurtleSVGMachine import TurtleSVGMachine
from nose.tools import assert_almost_equal
<|fim▁hole|> assert_almost_equal(turtle.x, 20.0)
def test_backward():
turtle = TurtleSVGMachine(width = 20, height = 20)
turtle.do_command... | def test_forward():
turtle = TurtleSVGMachine(width = 20, height = 20)
turtle.do_command("FORWARD 10") |
<|file_name|>httpserver_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
from tornado import netutil
from tornado.escape import json_decode, json_encode, utf8, _unicode, recursive_unicode, native_str
from tornado import gen
fro... | self.stream.connect(('127.0.0.1', self.get_http_port()), self.stop) |
<|file_name|>_trustregion_ncg.py<|end_file_name|><|fim▁begin|>"""Newton-CG trust-region optimization."""
from __future__ import division, print_function, absolute_import
import math
import numpy as np
import scipy.linalg
from ._trustregion import (_minimize_trust_region, BaseQuadraticSubproblem)
__all__ = []
def _... | Minimization of scalar function of one or more variables using |
<|file_name|>parse_fdr.py<|end_file_name|><|fim▁begin|>'''
Parse execution data log stream.
Allows access to selected parts of program memory at the time of recorded events.
'''
# Copyright (c) 2012-2013 Wladimir J. van der Laan
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this ... | RECTYPE_SPEC = struct.Struct(ENDIAN + RECTYPE_CHAR)
HDR_SPEC = struct.Struct(ENDIAN + MAGIC_CHAR + WORD_CHAR)
WORD_SPEC = struct.Struct(ENDIAN + WORD_CHAR)
ADDR_SPEC = struct.Struct(ENDIAN + ADDR_CHAR) |
<|file_name|>trimetrics.cpp<|end_file_name|><|fim▁begin|>#include "trimetrics.hpp"
#include <math.h>
void Metric2DTri::draw(int /*xwin*/, int /*ywin*/ )
{
// draw metric information
glCallList(drawingList);
// draw moused point
glBegin(GL_POINTS);
glPointSize(5.0);
glColor3f(0.0,0.0,0.0);
glVertex3f(curr... | glEnd();
} |
<|file_name|>find_anon_type.rs<|end_file_name|><|fim▁begin|>use rustc_hir as hir;
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc_hir::Node;
use rustc_middle::hir::map::Map;
use rustc_middle::middle::resolve_lifetime as rl;
use rustc_middle::ty::{self, Region, TyCtxt};
/// This function calls t... | fn visit_lifetime(&mut self, lifetime: &hir::Lifetime) {
match (self.tcx.named_region(lifetime.hir_id), self.bound_region) {
// the lifetime of the TyPath! |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Support for GTFS (Google/General Transport Format Schema)."""
from __future__ import annotations
import datetime
import logging
import os
import threading
from typing import Any, Callable
import pygtfs
from sqlalchemy.sql import text
import voluptuous as vol
fro... |
BICYCLE_ALLOWED_DEFAULT = STATE_UNKNOWN
BICYCLE_ALLOWED_OPTIONS = {1: True, 2: False} |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
## Zap-History Browser by AliAbdul
from Components.ActionMap import ActionMap
from Components.config import config, ConfigInteger, ConfigSelection, ConfigSubsection, getConfigListEntry
from Components.ConfigList import ConfigListScreen
from Com... | from Components.MenuList import MenuList |
<|file_name|>XmlAttribute.java<|end_file_name|><|fim▁begin|>package org.polyglotted.xpathstax.model;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
import org.codehaus.stax2.XMLStreamReader2;
import org.polyglotted.xpathstax.data.Value;
import javax.annotation.concurrent.ThreadSaf... | |
<|file_name|>test_botparse.py<|end_file_name|><|fim▁begin|>from boten.core import BaseBot
import payloads
class TestBot(BaseBot):
def command_arg_bot(self, user_name):
yield "hello {}".format(user_name)
def command_no_arg_bot(self):
yield "hello"
<|fim▁hole|> def command_two_message_bot(s... | def command_optional_arg_bot(self, optional="default"):
yield "hello {}".format(optional)
|
<|file_name|>LDBDClient.py<|end_file_name|><|fim▁begin|>"""
The LDBDClient module provides an API for connecting to and making requests of
a LDBDServer.
This module requires U{pyGlobus<http://www-itg.lbl.gov/gtg/projects/pyGlobus/>}.
This file is part of the Grid LSC User Environment (GLUE)
GLUE is free software: y... | self.__silent = 0
return ret
|
<|file_name|>CheckboxBinding.js<|end_file_name|><|fim▁begin|>import Binding from 'virtualdom/items/Element/Binding/Binding';
import handleDomEvent from 'virtualdom/items/Element/Binding/shared/handleDomEvent';
var CheckboxBinding = Binding.extend({
name: 'checked',
render: function () {
var node = this.element.no... |
getValue: function () { |
<|file_name|>gridded_mappable_point.py<|end_file_name|><|fim▁begin|>import unittest
import transaction
import os
import csv
from pyramid import testing
from thesis.models import DBSession
from sqlalchemy import create_engine
from thesis.models import (
Base,
GriddedMappablePoint,
Layer
)
class TestGrid... | result = q.all()
# self.assertEqual(result[0].locations, '{"type":"MultiPoint","coordinates":[[20,10]]}')
# self.assertEqual(result[1].locations, '{"type":"MultiPoint","coordinates":[[30,10]]}') |
<|file_name|>generated_content.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! The generated content assignment phase.
//!
//!... | accumulator.push(static_representation(list_style_type))
} |
<|file_name|>layout_aligned_opaque.rs<|end_file_name|><|fim▁begin|>#[repr(packed, C)]
pub struct PackedStruct {
pub arg1: usize,
pub arg2: *mut u8,
}
#[repr(packed, C)]
pub union PackedUnion {
pub variant1: usize,
pub variant2: *mut u8,
}
// Opaque because aligned_n is not defined.
#[repr(align(1), C)... | #[repr(align(4), C)] |
<|file_name|>light.py<|end_file_name|><|fim▁begin|>"""Support for Hive light devices."""
from datetime import timedelta
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_COLOR_TEMP,
LightEntity,
)
from ho... | """Brightness of the light (an integer in the range 1-255)."""
return self.device["status"]["brightness"]
@property |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! aobench: Ambient Occlusion Renderer benchmark.
//!
//! Based on [aobench](https://code.google.com/archive/p/aobench/) by Syoyo
//! Fujita.
#![deny(warnings, rust_2018_idioms)]
#![allow(non_snake_case, non_camel_case_types)]
#![cfg_attr(
feature = "cargo-clippy",
... | clippy::many_single_char_names,
clippy::similar_names,
clippy::cast_precision_loss,
clippy::inline_always, |
<|file_name|>RegistryClient.java<|end_file_name|><|fim▁begin|>/***
*Sensap contribution
* @author George
*
*/
package eu.sensap.farEdge.dataRoutingClient.registry;
import java.io.IOException;
import java.util.UUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jack... | |
<|file_name|>spi_dummy.rs<|end_file_name|><|fim▁begin|>///! A dummy SPI client to test the SPI implementation
use sam4l;
use hil::gpio;
use hil::spi_master::{self, SpiMaster};
#[allow(unused_variables,dead_code)]
pub struct DummyCB {
val: u8
}
pub static mut FLOP: bool = false;
pub static mut buf1: [u8; 8] = [0, 0... | // input it recieves from the slave on peripheral 1 continuously.
// |
<|file_name|>dialog.py<|end_file_name|><|fim▁begin|>import pygame
def arrow_image(color):
img = pygame.Surface((7, 6))
img.fill((226, 59, 252))
img.set_colorkey((226, 59, 252), pygame.RLEACCEL)
pygame.draw.polygon(img, color, ((0, 0), (3, 3), (6, 0)))
return img
class Menu(object):
def __... | pygame.draw.rect(self.image, self.border_color,
(0, 0, self.size[0]-1, self.size[1]-1), 1)
def progress(self): |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>fn function() {<|fim▁hole|> println!("called `function()`");
}
// A module named `my`
mod my {
// A module can contain items like functions
#[allow(dead_code)]
fn function() {
println!("called `my::function()`");
}
// Modules can be neste... | |
<|file_name|>api.rs<|end_file_name|><|fim▁begin|>//! Use this module to interact with Bitstamp exchange.
//! Please see examples for more informations.
use hyper_native_tls::NativeTlsClient;
use hyper::Client;
use hyper::header::ContentType;
use hyper::net::HttpsConnector;
use serde_json::Value;
use serde_json::valu... | let mut counter = 0;
loop {
api.set_burst(false); |
<|file_name|>LatchDemo_1.java<|end_file_name|><|fim▁begin|>package com.andyadc.concurrency.latch;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.*;
/**
* @author andaicheng
* @version 2017/3/10
*/
public class LatchDemo_1 {
public static void... | begin.await();
|
<|file_name|>unix.rs<|end_file_name|><|fim▁begin|>use futures::future::{self, Either, FutureExt};
use log::info;
use std::io;
use tokio::signal::unix::{signal, SignalKind};
/// Create a monitor future for signals
///
/// It will exit when received `SIGTERM` or `SIGINT`.
pub async fn create_signal_monitor() -> io::Resu... | |
<|file_name|>cloudlet_edge_redirector.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# Very basic script template. Use this to build new
# examples for use in the api-kickstart repository
#
""" Copyright 2015 Akamai Technologies, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the ... | endpoint_result = httpCaller.getResult("/cloudlets/api/v2/group-info") |
<|file_name|>EFA19C34C9DC95F7511AF979CAD72884A6746A3B.js<|end_file_name|><|fim▁begin|>this.NesDb = this.NesDb || {};
NesDb[ 'EFA19C34C9DC95F7511AF979CAD72884A6746A3B' ] = {
"$": {
"name": "Arkanoid",
"altname": "アルカノイド",
"class": "Licensed",
"subclass": "3rd-Party",
"catalog": "TFC-AN-5400-10",
"publisher... | {
"name": "Player 1 start at level 25",
"codes": [
[ |
<|file_name|>htmlmetaelement.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::attr::Attr;
use crate::dom::bindings... | if let Some(ref name) = element.get_name() {
let name = name.to_ascii_lowercase(); |
<|file_name|>request.go<|end_file_name|><|fim▁begin|>package model
import (
"time"
)
type Request struct {
Id uint32
MailingListId uint32
FirstName string
LastName string<|fim▁hole|> Email string
IpAddress string
ApprovalStatus string
CreationDate time.Time
}<|fim▁end|> | Room string |
<|file_name|>const.py<|end_file_name|><|fim▁begin|>"""Define constants for the Ambient PWS component."""
DOMAIN = "ambient_station"
ATTR_LAST_DATA = "last_data"<|fim▁hole|>
CONF_APP_KEY = "app_key"
DATA_CLIENT = "data_client"
TOPIC_UPDATE = "update"
TYPE_BINARY_SENSOR = "binary_sensor"
TYPE_SENSOR = "sensor"<|fim▁e... | |
<|file_name|>helpers.rs<|end_file_name|><|fim▁begin|>// Copyrighttape Technologies 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/LICENSE-2.0
//... | let genesis_path = Path::new(SCRIPTS_DIR).join("config_tool/genesis/genesis.json");
let mut data_path = tempdir.clone(); |
<|file_name|>AllocateDatabaseServerV4RequestToDBStackConverterTest.java<|end_file_name|><|fim▁begin|>package com.sequenceiq.redbeams.converter.stack;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.ass... | allocateRequest.setCloudPlatform(AWS_CLOUD_PLATFORM);
allocateRequest.setTags(new HashMap<>()); |
<|file_name|>test_item_info.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Item Info')<|fim▁h... |
class TestItemInfo(unittest.TestCase):
pass |
<|file_name|>telepathy-web.js<|end_file_name|><|fim▁begin|>'use strict';
require('should');
describe('index.html', () => {
beforeEach(() => {
browser.url('/');
// browser.localStorage('DELETE') does not work in PhantomJS
browser.execute(function() {
delete window.localStorage;
window.localS... | $('#password').getValue() == 'V{fvC^YRi('
);
}); |
<|file_name|>inspector.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! Liberally derived from the [Firefox JS implementation]
... | } |
<|file_name|>_instrumentedTheme.js<|end_file_name|><|fim▁begin|>import {normalize} from '../lib/themeUtils'
const unused = new Set()
const freeze = Object.freeze
const createAccessors = (object, path = '') => {
for (const key of Object.keys(object)) {
const value = object[key]
const keyPath = path ? `${path... | Object.freeze = freeze
export default theme
export {normalized as normalizedTheme} |
<|file_name|>master.py<|end_file_name|><|fim▁begin|># coding=utf8
# Copyright © 2015-2017 Cask Data, 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/LI... | print('Running: ' + label) |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _index = require('../../isSameWeek/index.js');
var _index2 = _interopRequireDefault(_index);
var _index3 = require('../_lib/convertToFP/index.js');
var _index4 = _interopRequireDefa... | |
<|file_name|>model.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Nokia, 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.apach... | '''echoes class, id, & reproducible representation in the REPL'''
return '{}, {}'.format(super(ObjBase, self).__repr__(), self.__dict__)
|
<|file_name|>about_iteration.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutIteration(Koan):
def test_iterators_are_a_type(self):
it = iter(range(1,6))
total = 0
for num in it:
total += num
self.ass... | iterator = filter(is_big_name, names)
try:
name = next(iterator)
except StopIteration: |
<|file_name|>globals.py<|end_file_name|><|fim▁begin|>"""
bamboo.globals
~~~~~~~~~~~~~
"""
from peak.util.proxies import CallbackProxy
from bamboo.context import context<|fim▁hole|><|fim▁end|> |
db = CallbackProxy(lambda: context["db"]) |
<|file_name|>ps_parser.py<|end_file_name|><|fim▁begin|>from .utils import ShellParser
class Parser(ShellParser):
"""Extract text from postscript files using ps2ascii command.
"""<|fim▁hole|><|fim▁end|> |
def extract(self, filename, **kwargs):
stdout, _ = self.run(['ps2ascii', filename])
return stdout |
<|file_name|>3734300868bc_add_account_id.py<|end_file_name|><|fim▁begin|>"""add account id
Revision ID: 3734300868bc
Revises: 3772e5bcb34d
Create Date: 2013-09-30 18:07:21.729288
"""
# revision identifiers, used by Alembic.
revision = '3734300868bc'
down_revision = '3772e5bcb34d'
from alembic import op
import sqlal... | |
<|file_name|>shell_plus.py<|end_file_name|><|fim▁begin|>import os
import sys
import time
import traceback
from optparse import make_option
import six
from django.conf import settings
from django.core.management.base import NoArgsCommand
from django_extensions.management.shells import import_objects
from django_extens... | return
shell() |
<|file_name|>sched_score.cpp<|end_file_name|><|fim▁begin|>// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the F... | |
<|file_name|>io.py<|end_file_name|><|fim▁begin|>"""Some classes to support import of data files
"""
import os, glob
import numpy
import time
try:
import ConfigParser as configparser #gets rename to lowercase in python 3
except:
import configparser
class _BaseDataFile(object):
"""
"""
def __init__... | |
<|file_name|>test_system_wrappers.py<|end_file_name|><|fim▁begin|>"""Проверки модуля system_wrappers."""
from logging import INFO
from unittest import TestCase
from unittest.mock import Mock, call, patch
from codestyle import system_wrappers
from codestyle.system_wrappers import (
ExitCodes,
check_output,
... | self.assertTupleEqual((), args)
self.assertDictEqual({}, kwargs)
@patch( |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use alloc::boxed::Box;
use arch::intex::Intex;
use collections::string::{String, ToString};
use collections::vec::Vec;
use common::event::Event;
use common::time::Duration;
use arch::context::ContextManager;
use fs::{KScheme, Resource, Scheme, VecResource, Url};
us... | for mut scheme in self.schemes.lock().iter_mut() { |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! A pmem-resident log file.
//! This is useful for programs like databases that append frequently to a log file.
//!
//! > This is **not** an official port of the NVM Library.
//! >
//! > The official **libpmemlog** documentation can be found at: [http://pmem.io/nvml/l... |
pub mod log;
|
<|file_name|>swagger.go<|end_file_name|><|fim▁begin|>package rest
import (
restful "github.com/emicklei/go-restful"
swagger "github.com/emicklei/go-restful-swagger12"
)<|fim▁hole|>// ConfigureSwagger configures the swagger documentation for all endpoints in the container
func ConfigureSwagger(apiDocPath string, cont... | |
<|file_name|>api.go<|end_file_name|><|fim▁begin|>package telebot
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"mime/multipart"
"net/http"
"os"
"strconv"
"strings"
"time"
)
// Raw lets you call any method of Bot API manually.
// It also handles API errors, so you only need to unwrap
// res... |
url := b.URL + "/bot" + b.Token + "/" + method
|
<|file_name|>tst_FieldGraphItem.cpp<|end_file_name|><|fim▁begin|>//-----------------------------------------------------------------------------
// File: tst_FieldGraphItem.cpp
//-----------------------------------------------------------------------------
// Project: Kactus 2
// Author: Esko Pekkarinen
// Date: 1... | |
<|file_name|>find_epd.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
'''
Recursively looks for EPD
Writes to STDOUT and STDERR the found library and the found include directory. In this way,
this script can be executed within CMAKE and the Python Libraries and Includes can be set to the STDOUT and STDERR strea... | found = False |
<|file_name|>bossanova.py<|end_file_name|><|fim▁begin|>from __future__ import division
"""
These functions are for BOSSANOVA (BOss Survey of Satellites Around Nearby Optically obserVable milky way Analogs)
"""
import numpy as np
from matplotlib import pyplot as plt
import targeting
def count_targets(hsts, verbose=... | |
<|file_name|>IngredientDbHelper.java<|end_file_name|><|fim▁begin|>package com.example.profbola.bakingtime.provider;
import android.database.sqlite.SQLiteDatabase;
import com.example.profbola.bakingtime.provider.RecipeContract.IngredientEntry;
import static com.example.profbola.bakingtime.utils.RecipeConstants.Ingred... | = "CREATE INDEX " + INGREDIENT_RECIPE_ID_IDX + " ON " + IngredientEntry.TABLE_NAME + " ( " + IngredientEntry.COLUMN_RECIPE_ID + " );";
db.execSQL(SQL_CREATE_INGREDIENTS_TABLE);
db.execSQL(SQL_CREATE_INDEX); |
<|file_name|>compress.rs<|end_file_name|><|fim▁begin|>use std::fs::File;
use std::io::Write;
use std::path::{Path, PathBuf};
use ::image;
use ::image::GenericImage;
use dct;
use quantize;
use color_space;
use compressed_image;
use protobuf::Message;
use flate2::Compression;
use flate2::write::ZlibEncoder;
pub ... | output_filename.push(file_stem);
output_filename.set_extension("msca");
compress_file_to_output(input_filename, output_filename.as_path()); |
<|file_name|>gapcoin_lt.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="lt" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<source>About Gapcoin Core</source>
<translation type="unfinished"/>
</message>
<message>
<source><b>Gapc... | <source>Other</source>
<translation>Kita</translation>
</message> |
<|file_name|>indexsubscriber.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2021 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package indexers
import (
"context"
"fmt"
"sync"
"sync/atomic"
"github.com/decred/dcrd/blockchain/v4/interna... | // If the subscription has a prerequisite, find it and remove the |
<|file_name|>iterator_ops_test.py<|end_file_name|><|fim▁begin|># Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www... | |
<|file_name|>content.js<|end_file_name|><|fim▁begin|>jQuery( document ).ready(function() {
jQuery( '.pane-bundle-widget-sketch span' ).click(function() {
jQuery( '.pane-bundle-widget-sketch .container' ).toggle( 'slide' );
});<|fim▁hole|>});<|fim▁end|> | |
<|file_name|>VideoSyncDRM.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2005-2014 Team XBMC
* http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either ve... | |
<|file_name|>MultiReader.java<|end_file_name|><|fim▁begin|>package org.targettest.org.apache.lucene.index;
/**
* 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 owner... | }
}
|
<|file_name|>0004_auto_20160306_1424.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('badges', '0003_badgedesign_bg_c... | # Generated by Django 1.9.4 on 2016-03-06 13:24 |
<|file_name|>peewee.py<|end_file_name|><|fim▁begin|># May you do good and not evil
# May you find forgiveness for yourself and forgive others
# May you share freely, never taking more than you give. -- SQLite source code
#
# As we enjoy great advantages from the inventions of others, we should be glad
# of an opportun... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup
version = '1.4'
testing_extras = ['nose', 'coverage']
docs_extras = ['Sphinx']
setup(
name='WebOb',
version=version,
description="WSGI request and response object",
long_description="""\
WebOb provides wrappers around th... | packages=['webob'],
zip_safe=True,
test_suite='nose.collector', |
<|file_name|>forward_messagebuffer.cpp<|end_file_name|><|fim▁begin|>/*
This source file is part of KBEngine
For the latest info, see http://www.kbengine.org/
Copyright (c) 2008-2016 KBEngine.
KBEngine is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public L... | |
<|file_name|>tree-test.js<|end_file_name|><|fim▁begin|>var vows = require("vows"),
load = require("../load"),
assert = require("../assert");
var suite = vows.describe("d3.layout.tree");
suite.addBatch({
"tree": {<|fim▁hole|> assert.deepEqual(t.nodes({
name: "1",
children: [
{n... | topic: load("layout/tree").expression("d3.layout.tree"),
"computes a simple tree layout": function(tree) {
var t = tree(); |
<|file_name|>gyptest-bare.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies actions which are not depended on by other targets get executed.
"""
... |
test.run_gyp('bare.gyp', chdir='src')
test.relocate('src', 'relocate/src') |
<|file_name|>window.rs<|end_file_name|><|fim▁begin|>use ::game::*;
use ::ncurses::*;
use std::ascii::AsciiExt;
use std::char;
use std::env;
use std::fs::File;
use std::io::BufReader;
use std::io::prelude::*;
use std::mem;
use std::iter::repeat;
use ::itertools::Itertools;
use ::consts::*;
pub struct NCursesWindow;
... | |
<|file_name|>inlinequeryresultcachedmpeg4gif.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2018
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or m... | |
<|file_name|>scanresources.py<|end_file_name|><|fim▁begin|># -- coding: utf-8 --
# ===========================================================================
# eXe
# Copyright 2010-2011, Pedro Peña Pérez
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General P... | for match in matches_final:
url.addLink( match )
url.addRLink( str(match.url) ) |
<|file_name|>train.py<|end_file_name|><|fim▁begin|># Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Li... | val_data = os.path.join(data_dir, AVAZU['test'])
get_avazu_data(data_dir, AVAZU['train'], AVAZU['url'])
get_avazu_data(data_dir, AVAZU['test'], AVAZU['url']) |
<|file_name|>PearsonsCorrelationCoefficeint.ts<|end_file_name|><|fim▁begin|>import * as indicators from "../";
export class PearsonsCorrelationCoefficeint
extends indicators.AbstractIndicator<number> {
static INDICATOR_NAME: string = "CORREL";
static INDICATOR_DESCR: string = "Pearson's Correlation Coeffi... | |
<|file_name|>CommentsMenu.tsx<|end_file_name|><|fim▁begin|>import React, { useState } from 'react';
import { registerComponent, Components } from '../../../lib/vulcan-lib';
import MoreVertIcon from '@material-ui/icons/MoreVert';
import Menu from '@material-ui/core/Menu';
import { useCurrentUser } from '../../common/wit... | }
})
|
<|file_name|>space3d.py<|end_file_name|><|fim▁begin|>import abc
from typing import Optional, Callable
from math import fabs
import itertools
from copy import copy
import numbers
from array import array
from .space2d import Point2D, Segment2D
from ...orientations.orientations import *
from ...mathematics.statistic... | |
<|file_name|>boxed_queries_require_selectable_expression_for_order.rs<|end_file_name|><|fim▁begin|>extern crate diesel;
use diesel::pg::Pg;
use diesel::*;
table! {
users {
id -> Integer,
name -> VarChar,
}
}
table! {
posts {
id -> Integer,
title -> VarChar,
}<|fim▁hole... | } |
<|file_name|>cross-crate-name-hiding-2.rs<|end_file_name|><|fim▁begin|>// Check that an identifier from a 2.0 macro in another crate cannot be
// resolved with an identifier that's not from a macro expansion.
// aux-build:use_by_macro.rs
extern crate use_by_macro;<|fim▁hole|>
use use_by_macro::*;
my_struct!(define);... | |
<|file_name|>AbstractParallelSlave.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2014,
* Charles Prud'homme (TASC, INRIA Rennes, LINA CNRS UMR 6241),
* Jean-Guillaume Fages (COSLING S.A.S.).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modifi... | public void run() { |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Copyright (c) 2010 by Yaco Sistemas <pmartin@yaco.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version ... | |
<|file_name|>km.d.ts<|end_file_name|><|fim▁begin|>import { CustomLocale } from "../types/locale";<|fim▁hole|> th?: CustomLocale | undefined;
tr?: CustomLocale | undefined;
ar?: CustomLocale | undefined;
at?: CustomLocale | undefined;
az?: CustomLocale | undefined;
be?: CustomLocale | undefined;
... | export declare const Khmer: CustomLocale;
declare const _default: {
default?: CustomLocale | undefined;
hr?: CustomLocale | undefined; |
<|file_name|>test_classes.py<|end_file_name|><|fim▁begin|>"""Test inter-conversion of different polynomial classes.
This tests the convert and cast methods of all the polynomial classes.
"""
from __future__ import division, absolute_import, print_function
import operator as op
from numbers import Number
import pyte... |
def test_degree(Poly):
p = Poly.basis(5)
assert_equal(p.degree(), 5) |
<|file_name|>Badge.d.ts<|end_file_name|><|fim▁begin|>/**
* The `Badge` component represents a user/discussion badge, indicating some
* status (e.g. a discussion is stickied, a user is an admin).
*
* A badge may have the following special attrs:
*
* - `type` The type of badge this is. This will be used to give the... | * |
<|file_name|>hintrc.js<|end_file_name|><|fim▁begin|>{
// environment
"browser": true,
"node": true,
"globals": {
"L": true,
"define": true,
"map":true,
"jQuery":true
// "drawnItems":true
},
"strict": false,
// code style
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,<|fim▁hole|>... | "forin": false, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>__author__ = 'shahbaz'
# ###############################################################################
# Utility functions #
# ############################################################################... | :param other: |
<|file_name|>project_manager.py<|end_file_name|><|fim▁begin|># ===============================================================================
# Copyright 2016 ross
#
# 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 c... | |
<|file_name|>sorting_impl.rs<|end_file_name|><|fim▁begin|>use std::cmp::Ordering;
use sorting::*;
impl<T: Ord + Clone> Sort for [T] {
fn adv_sort_mut(&mut self, algo: SortingAlgorithmn) {
match algo {
SortingAlgorithmn::Bubble => bubble_sort_mut(self),
SortingAlgorithmn::Quick => qu... | }
}
} |
<|file_name|>console.ts<|end_file_name|><|fim▁begin|>const consoleFilters = [
/^The above error occurred in the <.*?> component:/, // error boundary output
/^Error: Uncaught .+/ // jsdom output
]
function suppressErrorOutput() {
const originalError = console.error
const error = (...args: Parameters<typeof ori... | } catch {
// falling back in the case that process.env.RHTL_DISABLE_ERROR_FILTERING cannot be accessed (e.g. browser environment) |
<|file_name|>documents.test.js<|end_file_name|><|fim▁begin|>const { assign, set } = require('lodash')
const { renderDocuments } = require('../documents')
describe('Contacts documents controller', () => {
beforeEach(() => {
this.breadcrumbStub = sinon.stub().returnsThis()
this.resMock = assign({}, globalRes,... | set(this.resMock, 'locals.contact.archived_documents_url_path', '')
renderDocuments(this.reqMock, this.resMock, this.nextSpy) |
<|file_name|>session.py<|end_file_name|><|fim▁begin|># Copyright (C) 2008, Red Hat, Inc.
#
# 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) ... | elif self._logout_mode == self.MODE_REBOOT:
pm.Reboot(True)
except: |
<|file_name|>osm.py<|end_file_name|><|fim▁begin|>"""Handles downloading and importing OSM Data"""
import os
import subprocess
import tempfile
import requests
from celery.utils.log import get_task_logger
from django.conf import settings
from django.db import connection
from datasources.models import OSMData, OSMData... | utm_projection = c.fetchone()[0] |
<|file_name|>bioc_collection.py<|end_file_name|><|fim▁begin|>__all__ = ['BioCCollection']
from meta import _MetaInfons, _MetaIter
from compat import _Py2Next
class BioCCollection(_Py2Next, _MetaInfons, _MetaIter):
def __init__(self, collection=None):
self.infons = dict()<|fim▁hole|> self.source ... | |
<|file_name|>serf.go<|end_file_name|><|fim▁begin|>package lib
import (
"github.com/hashicorp/serf/serf"
)
// SerfDefaultConfig returns a Consul-flavored Serf default configuration,<|fim▁hole|>func SerfDefaultConfig() *serf.Config {
base := serf.DefaultConfig()
// This effectively disables the annoying queue depth... | // suitable as a basis for a LAN, WAN, segment, or area. |
<|file_name|>static_images.py<|end_file_name|><|fim▁begin|>import json
import requests
import key
API_key = key.getAPIkey()
#load all champion pictures
def load_champion_pictures(champion_json):
print len(champion_json['data'])
version = champion_json['version']
print "version: " + version
for champion in champi... | del champion_json['data']['MonkeyKing']
except ValueError as e: |
<|file_name|>issue-13853.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lic... |
use std::marker::MarkerTrait;
trait Node : MarkerTrait { |
<|file_name|>feature-detection.ts<|end_file_name|><|fim▁begin|>export interface DetectedFeatures {
draggable:boolean;
dragEvents:boolean;
userAgentSupportingNativeDnD:boolean;
}
export function detectFeatures():DetectedFeatures {
let features:DetectedFeatures = {
dragEvents: ("ondragstart" in ... | }
// tslint:disable-next-line:no-empty
catch( e ) {
} |
<|file_name|>DbaccMain.cpp<|end_file_name|><|fim▁begin|>/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
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; versio... | goto conf;
} |
<|file_name|>bitsnoop.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Author: Gonçalo M. (aka duramato/supergonkas) <supergonkas@gmail.com>
#
# This file is part of Medusa.
#
# Medusa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... | # so that proxies work.
download_url = row.enclosure['url'] |
<|file_name|>ops_config.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# 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
# the Free Software Foundation, either version 3 of the License, or
# (at ... | responses:
description: The set of responses from issuing the commands on the device
retured: when not check_mode
type: list |
<|file_name|>symbols.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# -*- coding: utf-8 -*-
################################################################################
# DChars Copyright (C) 2012 Suizokukan
# Contact: suizokukan _A.T._ orange dot fr
#
# This file is part of DChars.
# DChars is free... | from dchars.utilities.name2symbols import Name2Symbols
#...............................................................................
# symbols used by Latin |
<|file_name|>bootstrap-datetimepicker.ms.js<|end_file_name|><|fim▁begin|>/**
* Malay translation for bootstrap-datetimepicker
* Ateman Faiz <noorulfaiz@gmail.com><|fim▁hole|> $.fn.datetimepicker.dates['ms'] = {
days: ["Ahad", "Isnin", "Selasa", "Rabu", "Khamis", "Jumaat", "Sabtu", "Ahad"],
daysShor... | */
;(function ($) { |
<|file_name|>NodeGlyphInterface.ts<|end_file_name|><|fim▁begin|>import { Selection } from "d3-selection";
import { DynamicGraph } from "../model/DynamicGraph";<|fim▁hole|>export interface NodeGlyphShape {
readonly shapeType: string;
init(location: Selection<any, {}, any, {}>): Selection<any, {}, any, {}>;
initDraw(l... | import { SVGAttrOpts } from "./DGLOsSVG";
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.