prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>directions.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
class Direction(Enum):
invalid = (0.0, 0.0)
up = (0.0, -1.0)
down = (0.0, 1.0)
left = (-1.0, 0.0)
right = (1.0, 0.0)
def x(self):
return self.value[0]
def y(self):
return self.value[1]
... | from enum import Enum
|
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import "time"
import "fmt"
import "os"
import "io/ioutil"
import "math/rand"
import "github.com/antonholmquist/jason"
var LOADED *jason.Object // global var to hold the entire json object from file
// loads from file into the jason.Object pointer.
func L... | total += roll
}
|
<|file_name|>publish_content.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at... | request.max_results = app.config.get('MAX_TRANSMIT_QUERY_LIMIT', 500)
# ensure we publish in the correct sequence |
<|file_name|>exec_commands.rs<|end_file_name|><|fim▁begin|>use arguments::{VERBOSE_MODE, JOBLOG};
use execute::command::{self, CommandErr};
use input_iterator::InputsLock;
use numtoa::NumToA;
use time::{self, Timespec};
use tokenizer::Token;
use verbose;
use super::pipe::disk::State;
use super::job_log::JobLog;
use sup... |
impl<IO: Read> ExecCommands<IO> { |
<|file_name|>test_bot.py<|end_file_name|><|fim▁begin|>import os
import json
import pytest
from .. import bot, PACKAGEDIR
EXAMPLE_TWEET = json.load(open(os.path.join(PACKAGEDIR, 'tests', 'examples', 'example-tweet.json'), 'r'))
EXAMPLE_RETWEET = json.load(open(os.path.join(PACKAGEDIR, 'tests', 'examples', 'retweeted-... | |
<|file_name|>compositor.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use compositor_layer::{CompositorData, CompositorLayer, Wa... |
fn pinch_zoom_level(&self) -> f32 {
self.viewport_zoom.get() as f32 |
<|file_name|>editor_subscribe_label_deleted.py<|end_file_name|><|fim▁begin|>"""
.. module:: editor_subscribe_label_deleted
The **Editor Subscribe Label Deleted** Model.
PostgreSQL Definition
---------------------
The :code:`editor_subscribe_label_deleted` table is defined in the MusicBrainz Server as:
.. code-block... | gid UUID NOT NULL, -- PK, references deleted_entity.gid
deleted_by INTEGER NOT NULL -- references edit.id |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone<|fim▁hole|>class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateMode... | import sentry.db.models.fields.gzippeddict
|
<|file_name|>update.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
"""
Deprecated. Use ``update-tld-names`` command instead.
"""
__title__ = 'tld.update'
__author__ = 'Artur Barseghyan'
__copyright__ = '2013-2015 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'
from tld.utils import update_t... | if __name__ == '__main__':
update_tld_names()
print(_("Local TLD names file has been successfully updated!")) |
<|file_name|>SubScreenContext.java<|end_file_name|><|fim▁begin|>package de.verygame.surface.screen.base;
import com.badlogic.gdx.InputMultiplexer;
import com.badlogic.gdx.graphics.g2d.PolygonSpriteBatch;
import com.badlogic.gdx.utils.viewport.Viewport;
import java.util.Map;
/**
* @author Rico Schrage
*
* Context ... | |
<|file_name|>test_parsing.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test functionality of coursera module.
"""
import json
import os.path
import pytest
from six import iteritems
from mock import patch, Mock, mock_open
from coursera import coursera_dl
# JSon Handling
@pytes... |
@pytest.mark.parametrize(
"filename,num_sections,num_lectures,num_resources,num_videos", [ |
<|file_name|>io.go<|end_file_name|><|fim▁begin|>package esl
import (
"io"
"errors"
"unicode/utf8"
)
// Buffer ...
type buffer []byte
// MemoryReader ...
type memReader [ ]byte
// MemoryWriter ...
type memWriter [ ]byte
// ErrBufferSize indicates that memory cannot be allocated to store data in a buffer.
var ErrBuf... | |
<|file_name|>dockerplugin.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go.
// source: dockerplugin.proto
// DO NOT EDIT!
package dockerplugin
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gengo/grpc-gateway/third_party/googleapis/google/... | |
<|file_name|>company-structure.java<|end_file_name|><|fim▁begin|>package test;
/**
scala> map
res6: java.util.HashMap[String,java.util.List[String]] = {AAA=[BBB, CCC, EEE], CCC=[DDD]}
scala> test.Test.printCompany(map)
-AAA
-BBB
-CCC
-DDD
-EEE
*/
import java.util.HashMap;
import java.util.HashSet;
import java.u... | HashSet<String> roots = new HashSet<String>();
for (String v : graph.keySet()) {
roots.add(v); |
<|file_name|>eap.py<|end_file_name|><|fim▁begin|># Copyright (c) 2003-2013 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# $Id$
#
# Description:
# EAP packets
#
# Author:
# A... | EAPOL_START = 0x01 |
<|file_name|>model.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
class Item(object):
def __init__(self, uid, name, time):
self._uid = uid
self._name = name
self._time = time
@property
def name(self):
return self._name
@property
def uid(self):
re... | self._list.append(item)
def is_over(self):
return self._iplay >= len(self._list) |
<|file_name|>build.ts<|end_file_name|><|fim▁begin|>/// <reference path="../custom_typings/ambient.d.ts" />
import * as gulp from "gulp";<|fim▁hole|>
/* Build task for deployment */
gulp.task("build:prod", done => build(["typescript:prod", "sass", "html"], done));
/* Build task for dev environment */
gulp.task("build:... | import * as runSequence from "run-sequence"; |
<|file_name|>d3d12.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Dmitry Roschin
// Licensed under the MIT License <LICENSE.md>
pub const D3D12_16BIT_INDEX_STRIP_CUT_VALUE: ::UINT = 0xffff;
pub const D3D12_32BIT_INDEX_STRIP_CUT_VALUE: ::UINT = 0xffffffff;
pub const D3D12_8BIT_INDEX_STRIP_CUT_VALUE: ::UINT = 0xff;... | |
<|file_name|>import.py<|end_file_name|><|fim▁begin|>import sys
from optparse import make_option<|fim▁hole|>from django.core.management.base import BaseCommand, CommandError
from django.db import IntegrityError, transaction
from django.contrib.auth.models import User
from annotate.models import *
class Command(BaseComm... | |
<|file_name|>io.rs<|end_file_name|><|fim▁begin|>use std::sync::Arc;
use std::collections::HashMap;
use std::ops::{Deref, DerefMut};
use serde_json;
use futures::{self, future, Future};
use calls::{RemoteProcedure, Metadata, RpcMethodSimple, RpcMethod, RpcNotificationSimple, RpcNotification};
use middleware::{self, Mi... | |
<|file_name|>calculator.rs<|end_file_name|><|fim▁begin|>// Calculator trait and a couple of basic implementations.
//
// Eli Bendersky [https://eli.thegreenplace.net]
// This code is in the public domain.
pub trait Calculator {
fn new() -> Self;
fn add(&self, a: u32, b: u32) -> u32;
}
pub struct Foo {}<|fim▁ho... | |
<|file_name|>Secure but True .cpp<|end_file_name|><|fim▁begin|>//
// Created by 孙启龙 on 2017/8/18.
//
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<ctime>
using namespace std;
typedef long long ll;
#define... | |
<|file_name|>get_model_evaluation_text_classification_sample.py<|end_file_name|><|fim▁begin|># Copyright 2020 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
#
# https://www.ap... | response = client.get_model_evaluation(name=name)
print("response:", response)
|
<|file_name|>ui.py<|end_file_name|><|fim▁begin|>import os
from sublime import active_window
from sublime import find_resources
from sublime import load_settings
from sublime import save_settings
import sublime_plugin
def _load_preferences():
return load_settings('Preferences.sublime-settings')
def _save_prefe... | for exclude in ['(SL)', 'Color Highlighter', 'tests']:
if exclude in color_scheme:
ignore = True |
<|file_name|>QuerySessionReportType.java<|end_file_name|><|fim▁begin|>/**
* SAHARA Scheduling Server
*
* Schedules and assigns local laboratory rigs.
*
* @license See LICENSE in the top level directory for complete license terms.
*
* Copyright (c) 2009, University of Technology, Sydney
* All rights rese... | throw new ADBException("requestor cannot be null!!");
}
this.requestor.serialize(new QName("", "requestor"), factory, xmlWriter);
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import chanutils.torrent
from chanutils import get_json, movie_title_year
from playitem import TorrentPlayItem, PlayItemList
_SEARCH_URL = 'https://yts.mx/api/v2/list_movies.json'
_FEEDLIST = [
{'title':'Latest', 'url':'https://yts.mx/api/v2/list_movies.json?lim... | data = get_json(_SEARCH_URL, params=params, proxy=True)
return _extract(data)
def _extract(data): |
<|file_name|>set_language.ts<|end_file_name|><|fim▁begin|>import {statementType} from "../_utils";
import * as Statements from "../../../src/abap/2_statements/statements";
const tests = [
"SET LANGUAGE SY-LANGU.",<|fim▁hole|>statementType(tests, "SET LANGUAGE", Statements.SetLanguage);<|fim▁end|> | ];
|
<|file_name|>subclassing.py<|end_file_name|><|fim▁begin|>"""=============================
Subclassing ndarray in python
=============================
Introduction
------------
Subclassing ndarray is relatively simple, but it has some complications
compared to other Python objects. On this page we explain the machine... | |
<|file_name|>fix_omp.cpp<|end_file_name|><|fim▁begin|>// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Cop... | |
<|file_name|>expr.rs<|end_file_name|><|fim▁begin|>use super::pat::{RecoverColon, RecoverComma, PARAM_EXPECTED};
use super::ty::{AllowPlus, RecoverQPath, RecoverReturnSign};
use super::{
AttrWrapper, BlockMode, ClosureSpans, ForceCollect, Parser, PathStyle, Restrictions, TokenType,
};
use super::{SemiColonMode, SeqS... | };
|
<|file_name|>wave_exact_sine.cc<|end_file_name|><|fim▁begin|>/* File produced by Kranc */
#define KRANC_C
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "GenericFD.h"
#include "Differ... | + SQR(ToReal(n2)) + SQR(ToReal(n3)))) + xL*ToReal(n1) +
yL*ToReal(n2) +
zL*ToReal(n3)))*INV(ToReal(periodicity))*sqrt(SQR(ToReal(n1)) +
SQR(ToReal(n2)) + SQR(ToReal(n3)))*ToReal(amplitude); |
<|file_name|>gameCtrl.js<|end_file_name|><|fim▁begin|>define(function() {
'use strict';
/* @ngInject */
var gameCtrl = function($scope, commoditySrvc, citySrvc, accountSrvc, gameSrvc, tutorialSrvc, $modal) {
//todo: find a better way to expose services to template
this.gameSrvc = gameSrvc;
this.commo... | gameCtrl.prototype.isCurrentCity = function(city) { |
<|file_name|>test_worker.py<|end_file_name|><|fim▁begin|># Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test for distributed trial worker side.
"""
import os
from cStringIO import StringIO
from zope.interface.verify import verifyObject
from twisted.trial.reporter import Test... | self.callNumber += 1
|
<|file_name|>tabs.py<|end_file_name|><|fim▁begin|># Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | template_name = constants.INFO_DETAIL_TEMPLATE_NAME
|
<|file_name|>cell_manhattan_inv.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Noise-rs Developers.
//
// 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/... | println!("\nGenerated cell2_manhattan_inv.png, cell3_manhattan_inv.png and cell4_manhattan_inv.png");
}
fn scaled_cell2_manhattan_inv(seed: &Seed, point: &Point2<f64>) -> f64 { |
<|file_name|>UpdateBodyClassSaga.ts<|end_file_name|><|fim▁begin|>import * as C from "../../actions/ActionCreators";
import * as Routing from "react-router-redux";
import { Effect } from "redux-saga/effects";
import { takeLatest } from "redux-saga";
/**
* Saga handler to load the strings<|fim▁hole|> let suffix:... | */
function* updateBodyClass(action: Routing.RouterAction): IterableIterator<Effect | any> {
if (document && document.body) { |
<|file_name|>ActionGrabFrame.cc<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2013 Edwin Velds
This file is part of Polka 2.
Polka 2 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 versio... | |
<|file_name|>impl[t]-foreign[t]-for-t.rs<|end_file_name|><|fim▁begin|>// compile-flags:--crate-name=test
// aux-build:coherence_lib.rs
extern crate coherence_lib as lib;
use lib::*;
use std::rc::Rc;
struct Local;
impl<T> Remote1<T> for T {<|fim▁hole|>fn main() {}<|fim▁end|> | //~^ ERROR type parameter `T` must be used as the type parameter for some local type
}
|
<|file_name|>cred-username.d.ts<|end_file_name|><|fim▁begin|>import { Cred } from './cred';
export class CredUsername {
/**
*
*
* @type {Cred}
* @memberof CredUsername
*/
parent: Cred;
/**
*
*
* @type {string}
* @memberof CredUsername
*/
username: strin... | |
<|file_name|>filters-test.js<|end_file_name|><|fim▁begin|>import filterReducer from "../filters";
describe("store/reducers/ui/filters", () => {
it("should return the initial state", () => {
const state = filterReducer(undefined, { type: "SOME_ACTION" });
expect(state).toEqual({ project: {} });
});
it("s... | |
<|file_name|>export_dynpro.ts<|end_file_name|><|fim▁begin|>import {Statement} from "./_statement";
import {verNot, str, seq, IStatementRunnable} from "../combi";
import {Source} from "../expressions";
import {Version} from "../../version";
export class ExportDynpro extends Statement {<|fim▁hole|> const ret = seq(st... |
public getMatcher(): IStatementRunnable { |
<|file_name|>bfe_sciencewise.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011 CERN.
##
## Invenio 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 Foundati... | |
<|file_name|>test_pyqt4.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloade... | for format in QtGui.QImageReader.supportedImageFormats()]) |
<|file_name|>connectors-bezier.js<|end_file_name|><|fim▁begin|>/*
* jsPlumb
*
* Title:jsPlumb 2.0.2
*
* Provides a way to visually connect elements on an HTML page, using SVG.
*
* This file contains the code for the Bezier connector type.
*
* Copyright (c) 2010 - 2015 jsPlumb (hello@jsplumbtoolkit.com)
*
... | var sp = p.sourcePos,
tp = p.targetPos,
_w = Math.abs(sp[0] - tp[0]),
_h = Math.abs(sp[1] - tp[1]), |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
Qizx Python API bindings
:copyright: (c) 2015 by Michael Paddon<|fim▁hole|> QizxNotFoundError, QizxAccessControlError, QizxXMLDataError,
QizxCompilationError, QizxEvaluationError, QizxTimeoutError,
QizxImportError, UnexpectedResponseError, Transactio... | :license: MIT, see LICENSE for more details.
"""
from .qizx import (
Client, QizxError, QizxBadRequestError, QizxServerError, |
<|file_name|>datatable.ts<|end_file_name|><|fim▁begin|>import {
NgModule, Component, ElementRef, AfterContentInit, AfterViewInit, AfterViewChecked, OnInit, OnDestroy, DoCheck, Input, ViewContainerRef, ViewChild,
Output, SimpleChange, EventEmitter, ContentChild, ContentChildren, Renderer, IterableDiffers, QueryL... | |
<|file_name|>AbstractAdmin.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 You under ... |
protected ClientSession clientSession; |
<|file_name|>gen_travis.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
from itertools import combinations, chain
from enum import Enum, auto
LINUX = 'linux'
OSX = 'osx'
WINDOWS = 'windows'
AMD64 = 'amd64'
ARM64 = 'arm64'
PPC64LE = 'ppc64le'
TRAVIS_TEMPLATE = """\
# This config file is generated by ./scri... | |
<|file_name|>TaskIDChangeMap.java<|end_file_name|><|fim▁begin|>package org.yawlfoundation.yawl.worklet.client;
import org.yawlfoundation.yawl.editor.ui.specification.SpecificationModel;
import org.yawlfoundation.yawl.engine.YSpecificationID;
import java.io.IOException;
import java.util.Map;
<|fim▁hole|> * @author Mic... | /** |
<|file_name|>xc.rs<|end_file_name|><|fim▁begin|>pub struct Something { pub x: isize }
pub trait A {
fn f(&self) -> isize;
fn g(&self) -> isize { 10 }
fn h(&self) -> isize { 11 }
fn lurr(x: &Self, y: &Self) -> isize { x.g() + y.h() }
}
impl A for isize {
fn f(&self) -> isize { 10 }
}
impl A for S... | fn test_neq(&self, rhs: &Self) -> bool { |
<|file_name|>pwd_go15_plan9.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build go1.5
// +build go1.5<|fim▁hole|>package plan9
import "syscall"
func fixwd() {
syscall... | |
<|file_name|>mainHandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# @author victor li nianchaoli@msn.cn
# @date 2015/10/07
import baseHandler
class MainHandler(baseHandler.RequestHandler):
<|fim▁hole|> self.redirect('/posts/last')<|fim▁end|> | def get(self): |
<|file_name|>ReportRowProvider.js<|end_file_name|><|fim▁begin|>function ReportRowProvider()
{
var that = this;
var mXHR = new XHR();
var mFetchListeners = [];
var mReportId = "";
var mCriteriaText = "";
this.addFetchListener = function(address) { mFetchListeners.push(address); };
this.getR... | var timeNow = new Date();
var result = "ReportRows.json?rep=" + mReportId; // time parameter no longer required, server now sends cache-control header
if(mCriteriaText !== null && mCriteriaText.length > 0) result += mCriteriaText;
|
<|file_name|>Utilisateur.py<|end_file_name|><|fim▁begin|>### Type Utilisateur
# username : string
# password : string
#
import EnsUtilisateurs
import EnsAdmins
import EnsReservation
import EnsEmprunt
class Utilisateur:
def __init__(self,user_id=None,username="",password="",abonnementValide=False,em... | |
<|file_name|>Yahoo.java<|end_file_name|><|fim▁begin|>package interviews;
public class Yahoo {
}
Run Length Encoding for byte array
Input byte array [10, 10, 10, 255, 255, 0, 10] ==> output byte array [3, 10, 2, 255, 1, 0, 1, 10]
Class ByteArrayEncodeDecode {
public byte[] encodeByteArray(byte[] input) {
... | out.add(prevByte); |
<|file_name|>test_v2v_ansible.py<|end_file_name|><|fim▁begin|>import fauxfactory
import pytest
from cfme import test_requirements
from cfme.fixtures.provider import rhel7_minimal
from cfme.infrastructure.provider.rhevm import RHEVMProvider
from cfme.infrastructure.provider.virtualcenter import VMwareProvider
from cfme... | post_playbook=retire_catalog.name,
)
# explicit wait for spinner of in-progress status card |
<|file_name|>Fridge.py<|end_file_name|><|fim▁begin|>import RPi.GPIO as GPIO
import datetime
import time
import pandas as pd
import logging
import logging.handlers
import sys
logger = logging.getLogger('fridge')
handler = logging.StreamHandler()
fHandler = logging.FileHandler('fridge.log')
formatter = logging.Formatter... | switchOn = True
else:
logger.debug(self.name + ' Unable to switch on. Min Off Time not met' )
elif self.on == True: |
<|file_name|>test_base_kanban_abstract.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo import models
from odoo.tests.common import SavepointCase
class BaseKanbanAbstractTester(models.TransientModel):
... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate scoped_pool;
#[macro_use]
extern crate log;
extern crate ansi_term;
extern crate env_logger;
extern crate pbr;
extern crate serde_derive;
extern crate term_painter;
#[macro_use]
extern crate clap;
extern crate anyhow;
extern crate glob;
extern crate num_cpu... | had_tabs, |
<|file_name|>vulkano_gralloc.rs<|end_file_name|><|fim▁begin|>// Copyright 2021 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//! vulkano_gralloc: Implements swapchain allocation and memory mapping
//! using Vulkano.... | |
<|file_name|>0002_auto_20160213_1225.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orders', '0001_initial'),
]
operations = [
migrations.A... | field=models.BooleanField(default=False), |
<|file_name|>xid.py<|end_file_name|><|fim▁begin|># Copyright (C) 2008-2009 Mark A. Matienzo
#
# This file is part of worldcat, the Python WorldCat API module.
#
# worldcat 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 F... | |
<|file_name|>fn-pattern-expected-type.rs<|end_file_name|><|fim▁begin|>// run-pass
pub fn main() {
let f = |(x, y): (isize, isize)| {
assert_eq!(x, 1);
assert_eq!(y, 2);
};
f((1, 2));<|fim▁hole|><|fim▁end|> | } |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from __future__ import division |
<|file_name|>test.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions, a... | ###
# Copyright (c) 2013, Nicolas Coevoet
# All rights reserved.
# |
<|file_name|>structofp12__experimenter__stats__header.js<|end_file_name|><|fim▁begin|>var structofp12__experimenter__stats__header =<|fim▁hole|> [ "exp_type", "structofp12__experimenter__stats__header.html#a460441be714bfea09fad329cbf887740", null ],
[ "experimenter", "structofp12__experimenter__stats__header.htm... | [ |
<|file_name|>bert_embeddings.py<|end_file_name|><|fim▁begin|>"""Contains function for calculating BERT embeddings"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import json
import re
import torch
from torch.utils.data import TensorDat... | examples = []
unique_id = 0
for a, in inp: |
<|file_name|>tr3.unregister.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
############################################################################
#
# MODULE: tr3.unregister
# AUTHOR(S): Soeren Gebbert
#
# PURPOSE: Unregister raster3d maps from space time raster3d data... | |
<|file_name|>input.rs<|end_file_name|><|fim▁begin|>use engine::components::{Movable, Move};
use engine::resources::{ReplayMode, Skip};
use engine::ActionInput;
use specs::prelude::*;
use specs::world::Index;
use scaii_defs::protos::Action as ScaiiAction;
#[derive(SystemData)]
pub struct InputSystemData<'a> {
mova... | if !sys_data.ids.is_alive(entity) {
continue;
}
|
<|file_name|>handler_test.go<|end_file_name|><|fim▁begin|>/*
* Copyright © 2015-2018 Aeneas Rekkas <aeneas+oss@aeneas.io>
*
* 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:/... | "context"
"encoding/json" |
<|file_name|>.eslintrc.js<|end_file_name|><|fim▁begin|>module.exports = {
"extends": "airbnb-base",
"plugins": [
"import"
],
"env": {
"browser": true,
"mocha": true,
"protractor": true,
"node": true
},
"globals": {
"expect": true
},
"rules": {
"semi": ["error", "never"],
"quotes":... | |
<|file_name|>test_migration.py<|end_file_name|><|fim▁begin|>import unittest
import os
from unittest.mock import patch
import migration
from configuration import Builder
import configuration
from tests import testhelper
<|fim▁hole|>class MigrationTestCase(unittest.TestCase):
def setUp(self):
self.rootfolder... | |
<|file_name|>bencher.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python3
# Suggest name to z3 binary based on it its sha
import sys
import words
import subprocess
import argparse
import os.path
import shutil
from pathlib import Path
import yaml
class Bencher(object):<|fim▁hole|> self._name = 'bencher'
... |
def __init__(self): |
<|file_name|>borrowck-multiple-captures.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... | same_var_after_borrow(); |
<|file_name|>page.rs<|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 Apach... | encoding: Encoding::PLAIN,
def_level_encoding: Encoding::RLE,
rep_level_encoding: Encoding::RLE,
statistics: Some(Statistics::int32(Some(1), Some(2), None, 1, true)), |
<|file_name|>redirect.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from httoop.status.types import StatusException
from httoop.uri import URI
class RedirectStatus(StatusException):
u"""REDIRECTIONS = 3xx
A redirection to other URI(s) which are set in the Location-header.<|fim▁hole|> def __init__(self, ... | """
location = None
|
<|file_name|>rain_mask_save_lat_lon_west_southern_indian_ocean.py<|end_file_name|><|fim▁begin|>import os, sys
import datetime
import iris
import iris.unit as unit
import iris.analysis.cartography
import numpy as np
from iris.coord_categorisation import add_categorised_coord
diag = 'avg.5216'
cube_name_explicit='str... | |
<|file_name|>orig_sig.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from pylab import *
# create some data to use for the plot
dt = 0.001
t = arange(0.0, 10.0, dt)
r = exp(-t[:1000]/0.05) # impulse response
x = randn(len(t))
s = convolve(x,r)[:len(x)]*dt # colored noise
# the main axes is subp... | #title('Impulse response')
#setp(a, xlim=(0,.2), xticks=[], yticks=[])
|
<|file_name|>tvec.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/L... | let count = elements_required(bcx, content_expr); |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>describe("setPathValues", function() {<|fim▁hole|> require("./expired.spec");
require("./branch.spec");
});<|fim▁end|> | require("./primitive.spec");
require("./atom.spec"); |
<|file_name|>image_copy_test.py<|end_file_name|><|fim▁begin|>import numpy as np
from menpo.image import Image, BooleanImage, MaskedImage
from menpo.shape import PointCloud
from menpo.testing import is_same_array
def test_image_copy():
pixels = np.ones([1, 10, 10])
landmarks = PointCloud(np.ones([3, 2]), copy... | im = Image(pixels, copy=False) |
<|file_name|>font-size.js<|end_file_name|><|fim▁begin|>window.BOLDGRID = window.BOLDGRID || {};
BOLDGRID.EDITOR = BOLDGRID.EDITOR || {};
BOLDGRID.EDITOR.CONTROLS = BOLDGRID.EDITOR.CONTROLS || {};
BOLDGRID.EDITOR.CONTROLS.GENERIC = BOLDGRID.EDITOR.CONTROLS.GENERIC || {};
( function( $ ) {
'use strict';
var self,
B... | slide: function( event, ui ) {
BG.Panel.$element.find( '.section.size .value' ).html( ui.value );
BG.Controls.addStyle( $el, 'font-size', ui.value );
} |
<|file_name|>vtk_io.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
__version__ = "who knows"
#
'''
I/O for VTK <https://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf>.
.. moduleauthor:: Nico Schlömer <nico.schloemer@gmail.com>
NOTE: Stolen from https://github.com/nschloe/meshio/blob/master/meshio/... | break
line = line.strip()
# pylint: disable=len-as-condition |
<|file_name|>operation_printer_test.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Facebook, Inc. and its affiliates.<|fim▁hole|> *
* @generated SignedSource<<c7c89fe9853f3412ef8e91f793903d25>>
*/
mod operation_printer;
use operation_printer::transform_fixture;
use fixture_tests::test_fixture;
#[test]
fn fiel... | *
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. |
<|file_name|>cddrevs.C<|end_file_name|><|fim▁begin|>/* cddrevs.C: Reverse Search Procedures for cdd.C
written by Komei Fukuda, fukuda@ifor.math.ethz.ch
Version 0.77, August 19, 2003
*/
/* cdd.C : C-Implementation of the double description method for
computing all vertices and extreme rays of the polyhedron ... | |
<|file_name|>build.js<|end_file_name|><|fim▁begin|>'use strict';
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
(function () {
function pushComponent(array, component... | });
fragment.appendChild(list);
document.getElementById('container').appendChild(fragment);
} |
<|file_name|>reader.py<|end_file_name|><|fim▁begin|>import feedparser
import logging
from rss import sources
from util import date, dict_tool, tags
log = logging.getLogger('app')
def parse_feed_by_name(name):
feed_params = sources.get_source(name)
if not feed_params:
raise ValueError('There is no fe... |
author_name = handle_default_param(
entry,
dict_tool.get_deep(entry, 'authors', 0, 'name'), |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""The auto-tuning module of tvm
This module includes:
* Tuning space definition API
* Efficient auto-tuners
* Tuning result and database support
* Distributed measurement to scale up tuning
"""
from . import database<|fim▁hole|>from . import tuner
from . impo... | from . import feature
from . import measure
from . import record
from . import task |
<|file_name|>ProductsListWindow.js<|end_file_name|><|fim▁begin|>var
// get util library
util = require("core/Util"),
// get product manager
ProductManager = require("core/ProductManager");
function ProductListWindow() {
var Window = Ti.UI.createWindow({
title : L("products"),
navBarHidden : f... | |
<|file_name|>mod.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/. */
//! Invalidation of element styles due to attribute or style chan... | pub mod collector;
pub mod element_wrapper;
pub mod invalidation_map; |
<|file_name|>events.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes 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.apache.org/licenses/... | import (
"fmt"
|
<|file_name|>dedent-tests.ts<|end_file_name|><|fim▁begin|>import * as dedent from 'dedent';
const lines: string = dedent`
first
second<|fim▁hole|> third
`;
const text: string = dedent(`
A test argument.
`);<|fim▁end|> | |
<|file_name|>合并字典方式二.py<|end_file_name|><|fim▁begin|>#coding=utf-8
#介紹:合併字典方式二
import pickle
<|fim▁hole|>hashdataS = {}
hashdataP = {}
def updata(self,hashdic):
dic = open(self, 'rb')
newdata = cPickle.load(dic)
hashdic.update(newdata)
def main(dict1,dict2,hashname,new):
try:
updata(... | import os
|
<|file_name|>q2.py<|end_file_name|><|fim▁begin|>test = {
'name': 'Question 2',
'points': 2,
'suites': [
{
'type': 'sqlite',
'setup': r"""
sqlite> .open hw1.db
""",
'cases': [
{
'code': r"""
sqlite> select * from colors;
red|primary
... | {
'code': r""" |
<|file_name|>version.py<|end_file_name|><|fim▁begin|>###################################################################
# Numexpr - Fast numerical array expression evaluator for NumPy.
#
# License: MIT
# Author: See AUTHORS.txt
#
# See LICENSE.txt and LICENSES/*.txt for details about copyright and
# righ... | |
<|file_name|>transaction.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, Igor Shaula
// Licensed under the MIT License <LICENSE or
// http://opensource.org/licenses/MIT>. This file
// may not be copied, modified, or distributed
// except according to those terms.
//! Structure for a registry transaction.
//! Part o... | );
if handle == handleapi::INVALID_HANDLE_VALUE {
return Err(io::Error::last_os_error()); |
<|file_name|>extra.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/lice... | |
<|file_name|>test_froms.py<|end_file_name|><|fim▁begin|>from sqlalchemy.testing import eq_, assert_raises, assert_raises_message
import operator
from sqlalchemy import *
from sqlalchemy import exc as sa_exc, util
from sqlalchemy.sql import compiler, table, column
from sqlalchemy.engine import default
from sqlalchemy.or... | |
<|file_name|>VFB2PhisXML.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
sys.path.append("../build/")
import phisSchema
import pyxb
import warnings
# Strategy:
# Perhaps cleanest would be to build a separate interface for data that may vary from VFB.
# This also allows separation of Jython code
# ... | |
<|file_name|>factory.py<|end_file_name|><|fim▁begin|># Copyright 2012 Kevin Ormbrek
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.<|fim▁hole|>#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | # You may obtain a copy of the License at |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.