prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>factory.ts<|end_file_name|><|fim▁begin|>class ErrorFactory {<|fim▁hole|> errorMessages: any;
status: number;
constructor(msg: any) {
super(`${errorName}: ${msg.toString()}`);
if (!(msg instanceof String) && msg instanceof Array) {
... |
getError(errorName: string, status: number): any {
class NestedError extends Error { |
<|file_name|>trial.py<|end_file_name|><|fim▁begin|>#! /usr/python
'''
///////////////////////////////////////////////////////////
// Permission is hereby granted, free of charge,
// to any person obtaining a copy of
// this software and associated documentation files
// (the "Software"), to deal in the Software wi... | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
// IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
<|file_name|>TemporalConvolution.py<|end_file_name|><|fim▁begin|>import math
import torch
from .Module import Module
class TemporalConvolution(Module):
def __init__(self, inputFrameSize, outputFrameSize, kW, dW=1):
super(TemporalConvolution, self).__init__()
self.inputFrameSize = inputFrameSize
... | |
<|file_name|>autocomplete_match_unittest.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/autocomplete/autocomplete_match.h"
#include "base/b... |
AutocompleteMatch m1(NULL, 0, false, AutocompleteMatch::URL_WHAT_YOU_TYPED); |
<|file_name|>response.rs<|end_file_name|><|fim▁begin|>use rocket::http::Status;
use rocket::response::status;
use rocket::response::{Response, Responder};
use error::ApiError;
pub struct ApiResponse<T>(pub Status, pub T);
impl<'r, T: Responder<'r>> Responder<'r> for ApiResponse<T> {
fn respond(self) -> Result<Res... | status::Custom(self.0, self.1).respond()
}
} |
<|file_name|>karma-standalone.conf.js<|end_file_name|><|fim▁begin|>/* Karma configuration for standalone build */
'use strict';
module.exports = function (config) {
console.log();
console.log('Browser (Standalone) Tests');<|fim▁hole|>
config.set({
basePath: '.',
frameworks: ['mocha'],
files: [
... | console.log(); |
<|file_name|>luhn_test.go<|end_file_name|><|fim▁begin|>package luhn
import "testing"
var validTests = []struct {
n string
ok bool
}{<|fim▁hole|> {"8763", true},
{" ", false},
{"", false},
{"2323 2005 7766 3554", true},
}
var addTests = []struct{ raw, luhn string }{
{"123", "1230"},
{"873956", "8739567"},
... | {"738", false},
{"8739567", true},
{"1111", false}, |
<|file_name|>createFileName.ts<|end_file_name|><|fim▁begin|>import { CONFIG_FOLDER } from '../constants';<|fim▁hole|>import { FileType } from '../types';
export function createFileName(type: FileType, name: string, ext: string, suffix?: string): string {
// boost.js
let fileName = name;
// .boost.js
if (type === ... | |
<|file_name|>adt-nullary-enums.rs<|end_file_name|><|fim▁begin|>// Unit test for the "user substitutions" that are annotated on each
// node.
#![allow(warnings)]
use std::cell::Cell;
enum SomeEnum<T> {
SomeVariant(T),
SomeOtherVariant,
}
fn combine<T>(_: T, _: T) { }
fn no_annot() {
let c = 66;
comb... |
fn annot_reference_any_lifetime() { |
<|file_name|>plan.go<|end_file_name|><|fim▁begin|>package command
import (
"context"
"fmt"
"strings"
"github.com/hashicorp/errwrap"
"github.com/hashicorp/terraform/backend"
"github.com/hashicorp/terraform/config"
"github.com/hashicorp/terraform/config/module"
)
// PlanCommand is a Command implementation that ... | -var-file=foo Set variables in the Terraform configuration from
a file. If "terraform.tfvars" or any ".auto.tfvars"
files are present, they will be automatically loaded. |
<|file_name|>regions-infer-contravariance-due-to-decl.rs<|end_file_name|><|fim▁begin|>// Test that a type which is contravariant with respect to its region
// parameter yields an error when used in a covariant way.
//
// Note: see variance-regions-*.rs for the tests that check that the
// variance inference works in th... | marker: marker::PhantomData<&'a()>
}
fn use_<'short,'long>(c: Contravariant<'short>, |
<|file_name|>console.go<|end_file_name|><|fim▁begin|>package main
import (
"bufio"
"fmt"
"io"
"sort"
"strings"
"github.com/mauricioklein/text-search-engine/ranking"
"github.com/mauricioklein/text-search-engine/report"
)
// QuitSentence defines the sentence, read from the
// input stream, to quit the console
c... | c.ErrorStream.Flush() |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python3
import sys
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
includefiles = ['windows/libusb-1.0.dll',
('icons/buzzer.png', 'icons/buzzer.png'),
'... | |
<|file_name|>wordcount_debugging.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 ... |
A PTransform that converts a PCollection containing lines of text into a
PCollection of (word, count) tuples.
""" |
<|file_name|>operations.go<|end_file_name|><|fim▁begin|>package relay
// Copyright (c) Microsoft and contributors. 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
/... | func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { |
<|file_name|>utilitydialog.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2011-2014 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "utilitydialog.h"
#include "ui_helpmessagedialog.h"
#in... | |
<|file_name|>draft.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from xmodule.modulestore import Location, namedtuple_to_son
from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.modulestore.inheritance import own_metadata
from xmodule.exceptions import InvalidVersionError
from xmod... | |
<|file_name|>main.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import {HAMMER_GESTURE_CONFIG} from '@angular/platform-browser';
import {DemoApp} from './demo-app/demo-app';
import {HTTP_PROVIDERS} from '@angular/http';
import {ROUTER_PROVIDERS} from '@angular/router';
import {MdIconRegistry} from './components/icon/icon... | import {bootstrap} from '@angular/platform-browser-dynamic'; |
<|file_name|>GetStatusAndDocs.java<|end_file_name|><|fim▁begin|>/**
* @copyright Copyright (C) DocuSign, Inc. All rights reserved.
*
* This source code is intended only as a supplement to DocuSign SDK
* and/or on-line documentation.
*
* This sample is designed to demonstrate DocuSign features and is not intende... | response.sendRedirect(Utils.PAGE_GETSTATUS);
} else if (paramName.startsWith(Utils.NAME_DOWNLOAD)) {
// We want to download the specified envelope |
<|file_name|>jquery.app.js<|end_file_name|><|fim▁begin|>/**
* Themes: Velonic Admin theme
*
**/
! function($) {
"use strict";
/**
Sidebar Module
*/
var SideBar = function() {
this.$body = $("body"),
this.$sideBar = $('aside.left-panel'),
this.$navbarToggle = $(".navbar... | $(document).on("click",this.$portletCloser, function (ev) {
ev.preventDefault();
var $portlet = $(this).closest($this.$portletIdentifier); |
<|file_name|>aws_provider_bag_test.py<|end_file_name|><|fim▁begin|>import pytest
from mock import Mock<|fim▁hole|>
class TestOrchestrateServiceBag(object):
@pytest.fixture
def orchestrate_services(self):
return Mock()
def test_orchestrate_service_bag(self, orchestrate_services):
services = AwsProviderSe... |
from sigopt.orchestrate.services.aws_provider_bag import AwsProviderServiceBag |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding=utf-8<|fim▁hole|><|fim▁end|> | __author__ = u'Ahmed Şeref GÜNEYSU'
import ui |
<|file_name|>RenderTarget.cpp<|end_file_name|><|fim▁begin|>// Copyright NVIDIA Corporation 2012
// 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... | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
<|file_name|>base.py<|end_file_name|><|fim▁begin|>import numpy as np
from tfs.core.util import run_once_for_each_obj
from tfs.core.initializer import DefaultInit
from tfs.core.loss import DefaultLoss
from tfs.core.regularizers import DefaultRegularizer
from tfs.core.monitor import DefaultMonitor
from tfs.core.optimizer... |
self._regulization=None |
<|file_name|>de96b7a322c512a247dbf49cad92f67ae6c33fd6.js<|end_file_name|><|fim▁begin|>"use strict";var assert;module.watch(require('assert'),{default(v){assert=v}},0);var unhexArray;module.watch(require('./testutil'),{unhexArray(v){unhexArray=v}},1);var table;module.watch(require('../src/table'),{default(v){table=v}},2... | '0004 0000 0000 FFFF 0001 0003' + // hani lang sys
'0004 0000 0000 FFFF 0002 0003 0004' + // kana lang sys
'000A 0001 55524420 0016' + // Example 2 for latn
'0000 FFFF 0003 0000 0001 0002' + // DefLa... |
<|file_name|>youtubech.py<|end_file_name|><|fim▁begin|># coding=UTF-8
from datetime import timedelta
import resource
import time
import urllib
from django.core.exceptions import ObjectDoesNotExist
from snh.models.youtubemodel import *
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
imp... | logger.info(u"User harvest completed %s Mem:%s MB" % (harvester,unicode(getattr(usage, "ru_maxrss")/(1024.0))))
def update_video(snhuser, ytvideo): |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// use opentelemetry::trace::Tracer;
fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
// use tonic as grpc layer here.<|fim▁hole|> // // Traced app logic here...
// });
Ok(())
}<|fim▁end|> | // If you want to use grpcio. enable `grpc-sys` feature and use with_grpcio function here.
// let tracer = opentelemetry_otlp::new_pipeline().with_tonic().install_simple()?;
// tracer.in_span("doing_work", |cx| { |
<|file_name|>opening.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from hdf5handler import HDF5Handler
<|fim▁hole|>for i in range(100):
handler.put(i, 'numbers')
handler.close()<|fim▁end|> | handler = HDF5Handler('mydata.hdf5')
handler.open()
|
<|file_name|>slist_traits.hpp<|end_file_name|><|fim▁begin|>// Boost string_algo library slist_traits.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// ... | #ifndef BOOST_STRING_STD_SLIST_TRAITS_HPP |
<|file_name|>test_instance.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import print_function
from __future__ import absolute_import
import os
from . import spd
# K temps: [0.0, 100.0, 150.0, 200.0, 225.0, 250.0, 275.0, 300.0, 325.0, 350.0, 375.0, 400.0, 425.0, 450.0, 475.0, 500.0, 525.0, 550.... | |
<|file_name|>layerwidget_plugin.py<|end_file_name|><|fim▁begin|>###############################################################################
# volumina: volume slicing and editing library
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program ... | o1 = Layer() |
<|file_name|>calculatorService.java<|end_file_name|><|fim▁begin|>/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package services;
import FareCalculator.Calculate;
import java.util.ArrayList;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.UriInfo;
import ja... | import javax.xml.namespace.QName;
import localstorage.FaresType;
/** |
<|file_name|>migrated_0035.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | function f() { /* infinite */ while (true) { } /* bar */ var each; } |
<|file_name|>Registry.java<|end_file_name|><|fim▁begin|>// Copyright 2017 The Nomulus 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.ap... | checkArgument( |
<|file_name|>animal.ts<|end_file_name|><|fim▁begin|>export class Animal {
protected name: string;
<|fim▁hole|>
public say() {
this.out(this.name);
}
protected out(str: string) {
console.info(str);
}
}<|fim▁end|> |
constructor(name: string) {
this.name = name;
}
|
<|file_name|>codegen.rs<|end_file_name|><|fim▁begin|>use prolog_parser::ast::*;
use prolog::allocator::*;
use prolog::arithmetic::*;
use prolog::clause_types::*;
use prolog::fixtures::*;
use prolog::forms::*;
use prolog::indexing::*;
use prolog::instructions::*;
use prolog::iterators::*;
use prolog::machine::machine_i... | code.push(Line::Query(put_constant!(Level::Shallow, c.clone(), temp_v!(1)))); |
<|file_name|>download.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
import { NavController, NavParams, LoadingController, ToastController } from 'ionic-angular';
import { FilePath, Transfer } from 'ionic-native';
import { File } from '@ionic-native/file';
import { Http, Headers } from '@ang... | this.loading.dismissAll() |
<|file_name|>File_Avc_Duplicate.cpp<|end_file_name|><|fim▁begin|>// File__Duplicate - Duplication of some formats
// Copyright (C) 2007-2012 MediaArea.net SARL, Info@MediaArea.net
//
// This library is free software: you can redistribute it and/or modify it
// under the terms of the GNU Library General Public Licen... | Extra=1; //FLV
|
<|file_name|>interface.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/. */
//! Machinery to initialise interface prototype objects and... | // Step 5.2.
return Ok(false); |
<|file_name|>3a6b2ab00e3e_session_proposal_one.py<|end_file_name|><|fim▁begin|>"""Make session:proposal 1:1.
Revision ID: 3a6b2ab00e3e
Revises: 4dbf686f4380
Create Date: 2013-11-09 13:51:58.343243
"""
# revision identifiers, used by Alembic.
revision = '3a6b2ab00e3e'
down_revision = '4dbf686f4380'<|fim▁hole|>
from a... | |
<|file_name|>performancenavigationtiming.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindi... | |
<|file_name|>naive-seg.py<|end_file_name|><|fim▁begin|>import sys
sys.path.insert(0, r'../')
import os
import re
import numpy as np
import gensim
from collections import defaultdict
import argparse
from argparse import ArgumentParser
from utilities import readConll, writevec, writey, traversaltree
from data.dataprocess... | f=np.array([])
l=np.array([])
r=np.array([])
t=np.array([]) |
<|file_name|>supplier.js<|end_file_name|><|fim▁begin|>/******************************************************************************
* supplier.js
*
* Copyright 2016 Marcos Salomão
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Licens... | * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<|file_name|>DigitPipeline.java<|end_file_name|><|fim▁begin|>package xsierra.digitguesser.drawer.pipeline;
import java.awt.image.BufferedImage;
public interface DigitPipeline {
/**
* @param image An image that contains a drawed digit
* @return the guessed digit, a number between 0 - 9
*/<|fim▁hole... | byte imageGuessDigit(BufferedImage image);
} |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>(function(){
// Back to Top - by CodyHouse.co
var backTop = document.getElementsByClassName('js-cd-top')[0],
offset = 300, // browser window scroll (in pixels) after which the "back to top" link is shown
offsetOpacity = 1200, //browser window scroll (in pixels)... | //update back to top visibility on scrolling |
<|file_name|>twitter_server.py<|end_file_name|><|fim▁begin|>import tweepy
import os
from flask import Flask, make_response, jsonify
CONSUMER_KEY = os.environ['CATCHMEMEALL_TWITTER_CONSUMER_TOKEN']
CONSUMER_SECRET = os.environ['CATCHMEMEALL_TWITTER_CONSUMER_SECRET']
app = Flask(__name__)
auth = tweepy.OAuthHandler(CO... | try:
user = api.get_user(username)
except tweepy.TweepError:
return make_response(jsonify({'error': 'no username %s' % (username)}), 404) |
<|file_name|>bootstrap_interactive.go<|end_file_name|><|fim▁begin|>// Copyright 2016 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package commands
import (
"bufio"
"fmt"
"io"
"sort"
"strings"
"github.com/juju/errors"
jujucloud "github.com/juju/juju/cloud"
"github.com/juju/juju/c... | |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# © 2016 Elico Corp (www.elico-corp.com).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Membership Management - POS Membership',
'version': '8.0.1.0.2',
'category': 'Generic Modules',
'depe... | 'application': False, |
<|file_name|>Log.java<|end_file_name|><|fim▁begin|>package nl.jappieklooster;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Wraps arround the java.util.logging.Logger, just to save some typing time. & it makes all the
* loging go trough here so sutti... | public static void panic(String message) { |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import datetime
import os
import uuid
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.translation import ugettext_l... | self.state = Membership.STATE_ACCEPTED
self.save() |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for hapi-server-session 5.1
// Project: https://github.com/btmorex/hapi-server-session
// Definitions by: Avery Fay <https://github.com/btmorex>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { BinaryLike } from 'crypto... | |
<|file_name|>cholesky.rs<|end_file_name|><|fim▁begin|>use rulinalg::matrix::Matrix;
use rulinalg::matrix::decomposition::{Cholesky, Decomposition};
use test::Bencher;
#[bench]
fn cholesky_decompose_unpack_100x100(b: &mut Bencher) {
let n = 100;
let x = Matrix::<f64>::identity(n);
b.iter(|| {
// Ass... | // cholesky() has been removed.
let n = 500;
let x = Matrix::<f64>::identity(n);
b.iter(|| { |
<|file_name|>FindObjectMetadataFullyQualifiedGetHandler.java<|end_file_name|><|fim▁begin|>package org.vitrivr.cineast.api.rest.handlers.actions.metadata;
import io.javalin.http.Context;
import io.javalin.plugin.openapi.dsl.OpenApiBuilder;
import io.javalin.plugin.openapi.dsl.OpenApiDocumentation;
import java.util.Map;... | .pathParam(OBJECT_ID_NAME, String.class, param -> {
param.description("The object id");
})
.pathParam(DOMAIN_NAME, String.class, param -> { |
<|file_name|>run_hardcoded_tests.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
var tests = require("./hardcoded_tests.js");
var runTest = require(".//hardcoded_test_runner.js");
var colors = require("colors");
var parseArgs = require("minimist");
var failures = {};
var num_successes = 0;
var num_failures = 0;
v... | for (prop in tests) {
if (tests.hasOwnProperty(prop)) {
num_tests += tests[prop].length; |
<|file_name|>MidiPlayer.java<|end_file_name|><|fim▁begin|>package uk.ac.brighton.jamss;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.sound.midi.InvalidMidiDataException;
import javax.sound.midi.MidiSystem;
import javax.... | |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|>{
'name' : 'Signature templates for user emails',
'version' : '1.0.0',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3',
'category' : 'Social Network',
'website' : 'https://yelizariev.github.io',
'depends' : ['base'],... | 'security/ir.model.access.csv',
],
'installable': False |
<|file_name|>register.component.spec.ts<|end_file_name|><|fim▁begin|>import { ComponentFixture, TestBed, async, inject, tick, fakeAsync } from '@angular/core/testing';
import { Renderer, ElementRef } from '@angular/core';
import { Observable } from 'rxjs/Rx';
import { JhiLanguageService } from 'ng-jhipster';
import { M... | )
);
it('should notify of email existence upon 400/email address already in use', |
<|file_name|>bitcoin_sr.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="sr" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Heavycoin</source>
... | |
<|file_name|>uLispParser.py<|end_file_name|><|fim▁begin|>"""
BNF reference: http://theory.lcs.mit.edu/~rivest/sexp.txt
<sexp> :: <string> | <list>
<string> :: <display>? <simple-string> ;
<simple-string> :: <raw> | <token> | <base-64> | <hexadecimal> |
<quoted-string> ;
<display> :: "[" <simple-s... |
# extended definitions
decimal = Regex(r'-?0|[1-9]\d*').setParseAction(lambda t: int(t[0]))
real = Regex(r"[+-]?\d+\.\d*([eE][+-]?\d+)?").setParseAction(lambda tokens: float(tokens[0])) |
<|file_name|>enc_test.cc<|end_file_name|><|fim▁begin|>/*
* This file is part of RHexLib,
*
* Copyright (c) 2001 The University of Michigan, its Regents,
* Fellows, Employees and Agents. All rights reserved, and distributed as
* free software under the following license.
*
* Redistribution and use in source and... | |
<|file_name|>orienters.py<|end_file_name|><|fim▁begin|>from sympy.core.basic import Basic
from sympy import (sympify, eye, sin, cos, rot_axis1, rot_axis2,
rot_axis3, ImmutableMatrix as Matrix, Symbol)
from sympy.core.cache import cacheit
import sympy.vector
class Orienter(Basic):
"""
Super-... | N.i, then N.j, then N.k.
Therefore, |
<|file_name|>length_expr.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2015 Robert Clipsham <robert@octarineparrot.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at ... | // error-pattern: Only field names, constants, integers, basic arithmetic expressions (+ - * / %) and parentheses are allowed in the "length" attribute
#![feature(custom_attribute, plugin)]
#![plugin(pnet_macros_plugin)] |
<|file_name|>test_component.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import unittest
import datetime
from cwr.parser.encoder.dictionary import ComponentDictionaryEncoder<|fim▁hole|>"""
ComponentRecord to dictionary encoding tests.
The following cases are tested:
"""
__author__ = 'Bernardo Martínez Ga... | from cwr.work import ComponentRecord
|
<|file_name|>factories.py<|end_file_name|><|fim▁begin|>import factory
from .models import (FKDummyModel, O2ODummyModel, BaseModel, ManyToManyToBaseModel,
ForeignKeyToBaseModel, OneToOneToBaseModel, ClassLevel1, ClassLevel2, ClassLevel3,
ManyToManyToBaseModelWithRelatedName, ChildModel, SubClassOfBaseModel)
... | |
<|file_name|>svm_how_to.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, ... | |
<|file_name|>vgSound3DEntry.cpp<|end_file_name|><|fim▁begin|>#include <vgStableHeaders.h>
#include "vgentry/vgSound3DEntry.h"
#include <vgUIController/vgPropertyPage.h>
#include <vgUIController/vgUIController.h>
#include <vgKernel/vgkVec3.h>
#include <vgMesh/vgmMeshManager.h>
//#include <vgMath/vgfVector3.h>
#... | vgPropertiesViewBar* pageViewBar = vgUI::UIController::getSingleton().GetPropertiesViewBar();
s_ParamArray[0].label = "×ø±êÖµÉèÖÃ";
|
<|file_name|>special_math_ops_test.py<|end_file_name|><|fim▁begin|># Copyright 2016 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:/... | |
<|file_name|>connection.py<|end_file_name|><|fim▁begin|># Copyright 2009 Max Klymyshyn, Sonettic
# 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
... | std_in.write(data)
std_in.flush() |
<|file_name|>label.ts<|end_file_name|><|fim▁begin|>import { Component, Input } from 'angular2/core';
@Component({
selector: 'rio-label',
template: `
<label [id]="qaid">
<ng-content></ng-content><|fim▁hole|>export class RioLabel {
@Input() qaid: string;
};<|fim▁end|> | </label>
`
}) |
<|file_name|>packer-test.rs<|end_file_name|><|fim▁begin|>extern crate image;
extern crate texture_packer;
use std::path::Path;
use std::fs::File;
use texture_packer::texture::Texture;
use texture_packer::{ TexturePacker, TexturePackerConfig };
use texture_packer::importer::ImageImporter;
use texture_packer::exporter:... | |
<|file_name|>stream.py<|end_file_name|><|fim▁begin|># mhkutil - A utility for dealing with Mohawk archives
#
# mhkutil is the legal property of its developers, whose names
# can be found in the AUTHORS file distributed with this source
# distribution.
#
# mhkutil is free software; you can redistribute it and/or
# modif... | break
|
<|file_name|>0004_remove_extract_provider.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('finance', '0003_auto_20140929_0130'),
]
operations = [<|fi... | |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010-2013 by Yaco Sistemas <goinnn@gmail.com> or <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, ... | _(settings.INPLACEEDIT_EDIT_EMPTY_VALUE) or _('Doubleclick to edit'))
INPLACEEDIT_AUTO_SAVE = getattr(settings, 'INPLACEEDIT_AUTO_SAVE', False)
INPLACEEDIT_EVENT = getattr(settings, 'INPLACEEDIT_EVENT', 'dblclick')
INPLACEEDIT_DISABLE_CLICK = getattr(settings, 'INPLACEEDIT_DISABLE_CLICK'... |
<|file_name|>empty_dir.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unle... | |
<|file_name|>ai.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> fn consider(&mut self, board: &mut Board) -> Command;
}<|fim▁end|> | use reversi::*;
pub trait AI { |
<|file_name|>proxy.js<|end_file_name|><|fim▁begin|>import net from 'net';
import log from './log.js';
export default function(options, onConnect) {
// proxy server
let proxy = net.createServer(function(client) {
let server;
// Create a new connection to the target server
server = net.connect(options.p... | server.end(); |
<|file_name|>einstein.py<|end_file_name|><|fim▁begin|>from pyeda.inter import *
'''
The Englishman lives in the red house.
The Swede keeps dogs.
The Dane drinks tea.
The green house is just to the left of the white one.
The owner of the green house drinks coffee.
The Pall Mall smoker keeps birds.
The owner of the yell... | |
<|file_name|>normalize.py<|end_file_name|><|fim▁begin|># Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
import numbers
from torch.distributions.transforms import Transform
from pyro.ops.tensor_utils import safe_normalize
from .. import constraints
class Normalize(Transform):
... | |
<|file_name|>blkstoragetest.go<|end_file_name|><|fim▁begin|>/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package blkstoragetest
import (
"crypto/sha256"
"hash"
"io/ioutil"<|fim▁hole|> "path/filepath"
"testing"
"github.com/hyperledger/fabric-protos-go/common"
"github.com/h... | "os" |
<|file_name|>http_retry.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code genera... | header_parameters['Content-Type'] = 'application/json; charset=utf-8' |
<|file_name|>bitcoin_nl.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="nl" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="14"/>
<source>About AndroidToken</source>... | </message>
<message>
<location filename="../optionsdialog.cpp" line="191"/>
<source>Connect to the Bitcon network through a SOCKS4 proxy (e.g. when connecting through Tor)</source> |
<|file_name|>test_job.py<|end_file_name|><|fim▁begin|># Python
import pytest
import mock
from dateutil.parser import parse
from dateutil.relativedelta import relativedelta
from crum import impersonate
import datetime
# Django rest framework
from rest_framework.exceptions import PermissionDenied
from django.utils impor... | jobs.append(Job.objects.create(
job_template=job_template,
status='failed', |
<|file_name|>engine.io-tests.ts<|end_file_name|><|fim▁begin|>import engine = require('engine.io');
import http = require('http');
let serverOptions: engine.ServerOptions;
let server: engine.Server;
let httpServer: http.Server;
let attachOptions: engine.AttachOptions;
let serverAttachOptions: engine.ServerAttachOptions... | wsEngine: 'ws',
initialPacket: new Buffer([0, 1, 2, 3, 4, 5]),
allowRequest: (req, cb) => { |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>$(function() {
//搜索框交互
var
placeholder = window.INPUT_PLACEHOLDER || '请输入要搜索的关键词',
baiduUrl = 'http://www.baidu.com/s?wd=',
googleUrl = 'http://www.google.com.hk/search?q=',
searchEl = $('#search');
$('.butto... | $('#catalog,#website-map').on('click', '.website-list>li, .more-item', function(e) {
|
<|file_name|>test_cache.py<|end_file_name|><|fim▁begin|>import sys
from time import sleep
from cachey import Cache, Scorer, nbytes
def test_cache():
c = Cache(available_bytes=nbytes(1) * 3)
c.put('x', 1, 10)
assert c.get('x') == 1
assert 'x' in c
c.put('a', 1, 10)
c.put('b', 1, 10)
c.pu... | |
<|file_name|>config.py<|end_file_name|><|fim▁begin|># vim: set fileencoding=utf-8 ts=4 sw=4 expandtab fdm=marker:
"""
Small wrapper around the python ConfigParser module.
"""
import ConfigParser
CONFIG = ConfigParser.ConfigParser()
DEFAULTS = {
'patterns': {
'path' : '(?P<artist>\w+) - (?P<year>\... | } |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from ._excel import ExcelXlsTableWriter, ExcelXlsxTableWriter<|fim▁hole|>from ._sqlite import SqliteTableWriter<|fim▁end|> | from ._pandas import PandasDataFramePickleWriter |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from . import stock_move<|fim▁hole|><|fim▁end|> | from . import product_product |
<|file_name|>node.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless re... | |
<|file_name|>sctc.py<|end_file_name|><|fim▁begin|>import pyglet
import tkinter
WINDOW_WIDTH = 800 # x
WINDOW_HEIGHT = 600 # y
LEVEL = 6 # original was 4
X_SIZE = 2 * LEVEL
Y_SIZE = 3 * LEVEL
def get_resolution():
root = tkinter.Tk()
return root.winfo_screenwidth(), root.winfo_screenheight()<|fim▁hole|>
... | |
<|file_name|>keen.js<|end_file_name|><|fim▁begin|>(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,fu... | }; |
<|file_name|>trival.cc<|end_file_name|><|fim▁begin|>// -*- coding: utf-8 -*-
// Copyright (C) 2016 Laboratoire de Recherche et Developpement de
// l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
// Spot is free software; you can redistribute it and/or modify it
// under the terms of the GN... | // |
<|file_name|>gamepad.js<|end_file_name|><|fim▁begin|><|fim▁hole|> * This file is part of huborcid.
*
* huborcid is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
*... | /* |
<|file_name|>shim.rs<|end_file_name|><|fim▁begin|>use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_hir::lang_items::LangItem;
use rustc_middle::mir::*;
use rustc_middle::ty::query::Providers;
use rustc_middle::ty::subst::{InternalSubsts, Subst};
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_target::a... | |
<|file_name|>SpecialTautiMonsters.java<|end_file_name|><|fim▁begin|>package l2s.gameserver.ai;
import l2s.gameserver.model.Creature;
import l2s.gameserver.model.instances.NpcInstance;
import l2s.gameserver.model.instances.MonsterInstance;
/**
* @author Bonux
**/
public class SpecialTautiMonsters extends Fighter
{
p... |
}
} |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# sanpera documentation build configuration file, created by
# sphinx-quickstart2 on Sat May 12 21:24:07 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration value... | |
<|file_name|>posix_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
"""File used to unit test the pacifica archive interface."""
import unittest
import os
from stat import ST_MODE
from six import PY2
from pacifica.archiveinterface.archive_utils import bytes_type
from pacifica.archiveinterf... | filepath = '1234'
mode = 'w'
backend = PosixBackendArchive('/tmp/')
my_file = backend.open(filepath, mode) |
<|file_name|>fullscreen.rs<|end_file_name|><|fim▁begin|>#[cfg(target_os = "android")]
#[macro_use]
extern crate android_glue;
extern crate glutin;
use std::io;
mod support;
#[cfg(target_os = "android")]
android_start!(main);
#[cfg(not(feature = "window"))]
fn main() { println!("This example requires glutin to be c... |
monitor
}; |
<|file_name|>llvm_pr32379.rs<|end_file_name|><|fim▁begin|>pub fn pr32379(mut data: u64, f1: bool, f2: bool) -> u64 {<|fim▁hole|> if f2 { data |= 2; }
data
}<|fim▁end|> | if f1 { data &= !2; } |
<|file_name|>iconres.rs<|end_file_name|><|fim▁begin|>#include <windows.h><|fim▁hole|><|fim▁end|> | 1234 ICON "icon.ico" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.