prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>transform.rs<|end_file_name|><|fim▁begin|>use std::fmt;
use Result;
/// A scale and an offset that transforms xyz coordinates.
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct Transform {
/// The scale.
pub scale: f64,
/// The offset.
pub offset: f64,
}
impl Transform {
/// Applies... | Err(Error::InverseTransform {
n,
transform: *self, |
<|file_name|>Vector3.java<|end_file_name|><|fim▁begin|>package math;
import util.IReplicable;
public class Vector3 implements IReplicable<Vector3> {
private static final float MIN_TOLERANCE = (float) 1E-9;
public float x;
public float y;
public float z;
public static Vector3 of(float x, float y, ... | |
<|file_name|>api.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you 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... | mapLayers["default"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
maxZoom: config.map.maxZoom, |
<|file_name|>DatabaseMigrationServiceClient.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License i... | #include <aws/dms/model/DescribeEndpointsRequest.h>
#include <aws/dms/model/DescribeEventCategoriesRequest.h>
#include <aws/dms/model/DescribeEventSubscriptionsRequest.h> |
<|file_name|>base.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
class TestCase(unittest.TestCase):
"""Test case base class for all unit tests."""<|fim▁end|> | import unittest
|
<|file_name|>hammer_gestures.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Inject, Injectable, OpaqueToken} from '@angular... | 'pinchstart': true,
'pinchmove': true,
'pinchend': true, |
<|file_name|>test_image.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2007-2021 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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 Softwa... | |
<|file_name|>XSValueTest.cpp<|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 th... | * |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Miscellaneous tools for concurrent programming.
//!
//! ## Atomics
//!
//! * [`AtomicCell`], a thread-safe mutable memory location.
//! * [`AtomicConsume`], for reading from primitive atomic types with "consume" ordering.
//!
//! ## Thread synchronization
//!
//! * [... | |
<|file_name|>suitrank.hpp<|end_file_name|><|fim▁begin|>#ifndef KONIG_SUITRANK_HPP
#define KONIG_SUITRANK_HPP
#include <cstdint>
#include <cassert>
#include <string>
#include <konig/core.hpp>
namespace konig {
class SuitRank {
public:
enum internal_enum {
seven = 7,
four = seven,
low_pip = se... | knight = 12,
queen = 13,
king = 14, |
<|file_name|>neb.py<|end_file_name|><|fim▁begin|>import math
import numpy
class NEB(object):
""" A Nudged Elastic Band implementation
This NEB implementation is based on http://dx.doi.org/10.1063/1.1323224
by Henkelman et al.
"""
def __init__(self, path, k):
""" Initialize the NEB... |
vm = Ri - Rm |
<|file_name|>encode_test.go<|end_file_name|><|fim▁begin|>// Copyright 2011 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.
package json
import (
"bytes"
"math"
"reflect"
"testing"
"unicode"
)
type Optionals struct {
Sr... | }
|
<|file_name|>ex3_nytimes.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This exercise shows some important concepts that you should be aware about:
- using codecs module to write unicode files<|fim▁hole|>To run this code locally you have to register at the NYTimes developer site
and ... | - using authentication with web APIs
- using offset when accessing web APIs
|
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2014 Didotech SRL (info at didotech.com)
# All Rights Reserved.
#
# WARNING: This program as such is intended to be... | #
# You should have received a copy of the GNU General Public License |
<|file_name|>binder.py<|end_file_name|><|fim▁begin|># Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
import httplib
import urllib
import time
import re
from tweepy.error import TweepError
from tweepy.utils import convert_to_utf8_str
from tweepy.models import Model
re_path_template = re.comp... | |
<|file_name|>note-editor.effects.spec.ts<|end_file_name|><|fim▁begin|>import { TestBed } from '@angular/core/testing';
import { provideMockActions } from '@ngrx/effects/testing';
import { Action, combineReducers, StoreModule } from '@ngrx/store';
import { ReplaySubject } from 'rxjs';
import { fastTestSetup } from '../.... | |
<|file_name|>ssh.rs<|end_file_name|><|fim▁begin|>/* Copyright (C) 2020 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hop... | |
<|file_name|>webapp.py<|end_file_name|><|fim▁begin|>import redis
import logging
import simplejson as json
import sys
from msgpack import Unpacker
from flask import Flask, request, render_template
from daemon import runner
from os.path import dirname, abspath
# add the shared settings file to namespace
sys.path.insert(... | return resp, 500
class App(): |
<|file_name|>TEncSbac.cpp<|end_file_name|><|fim▁begin|>/* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
*
* C... | for( UInt ui = 0; ui < uiRefNum; ++ui )
{
const UInt uiSymbol = ui == iRefFrame ? 0 : 1;
if( ui == 0 ) |
<|file_name|>storage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# 2015 Copyright (C) White
#
# 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, version 2 of the License.
#
# This program... | # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# |
<|file_name|>utils.js<|end_file_name|><|fim▁begin|>/*
* @param parseObject [ParseObject]
* @return [Object]
* */
export const convertBrand = (parseObject) => {<|fim▁hole|> const object = parseObject.toJSON();
ret.id = object.objectId;
ret.name = object.name;
ret.description = object.description;
ret.images... | const ret = {}; |
<|file_name|>timesheet.tsx<|end_file_name|><|fim▁begin|>import xania, { subscribe, call, expr, List, ModelRepository, Reactive as Re, RemoteDataSource, RemoteStore } from "../../src/xania"
import { View, UrlHelper } from "../../src/mvc"
import DataGrid, { TextColumn } from "../../src/data/datagrid"
import Html from '.... | </List>
</div>
</List>
</div> |
<|file_name|>photoMasking.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
## Download files from Amazon S3 (e.g. raw photos for 3D models)
## Andy Bevan 15-Jun-2014, updated 21-Nov-2014
## Daniel Pett updated 05-Jan-2016
__author__ = 'ahb108'
## Currently for Python 2.7.5 (tested on MacOSX 10.9.2) launched in a virtu... |
with open(outputFilename) as data_file:
jtasks = json.load(data_file)
|
<|file_name|>HttpServerDumper.py<|end_file_name|><|fim▁begin|>import http.server
import socketserver
import webbrowser as web
from urllib.parse import urlparse
import serial
import time
alertMsg = bytearray([2,0,0,0])
path = "C:\\code\\GpioPlayground\\UsbReadWrite\\" # need trailing slash
class GetHandler(http.server... | |
<|file_name|>headless_test_launcher.cc<|end_file_name|><|fim▁begin|>// Copyright 2016 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 <memory>
#include "base/bind.h"
#include "base/command_line.h"
#include "bas... | #endif // defined(OS_WIN)
|
<|file_name|>ckform.js<|end_file_name|><|fim▁begin|>/*
jquery±íµ¥ÑéÖ¤²å¼þ¡£last edit by rongrong 2011.03.29
*/
var __check_form_last_error_info = [];
var check_form = function (formname, opt) {
var formobj; //Ö¸¶¨µ±Ç°±íµ¥
var e_error = "";
var focus_obj = ""; //µÚÒ»¸ö³öÏÖ´íÎó¶ÔÏñ
var error = []... | function cf_ajax(obj, str) {
_temp_ajax = _temp_ajax.concat({obj: obj, str: str}); |
<|file_name|>app.module.ts<|end_file_name|><|fim▁begin|>import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";<|fim▁hole|>@NgModule({
declarations: [AppComponent],
bootstrap: [AppComponent],
imports: [NativeScriptModule],
schemas: [NO_ERRORS_SCHEMA],
})
export class AppModule {}<|fim▁end|> | import { NativeScriptModule } from "nativescript-angular/nativescript.module";
import { AppComponent } from "./app.component";
|
<|file_name|>sre_constants.py<|end_file_name|><|fim▁begin|>#
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for in... | |
<|file_name|>plugin.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1<|fim▁hole|><|fim▁end|> | oid sha256:c2c3856c7f168c79af5e259afd0648e280f99384ba53df89f67814f2bafd5c74
size 18348 |
<|file_name|>BigInt.cpp<|end_file_name|><|fim▁begin|>//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//----... | break;
} |
<|file_name|>scope.js<|end_file_name|><|fim▁begin|>"use strict";
var assert = require("assert");
var stringmap = require("stringmap");
var stringset = require("stringset");
var is = require("simple-is");
var fmt = require("simple-fmt");
var error = require("./error");
var UUID = 1;
function Scope(args) {
... | scope.decls.keys().forEach(function(name) {
|
<|file_name|>one_or_many.rs<|end_file_name|><|fim▁begin|>//use serde::de::Deserialize;
use super::super::link::HalLink;
use super::super::resource::OneOrMany;
use serde_json::{from_str, to_string};
use serde::*;
#[derive(Serialize, Deserialize)]
struct Boh
{
oom: OneOrMany<String>
}
#[test]
fn ensure_one_object_g... | |
<|file_name|>test_least_squares_loss.py<|end_file_name|><|fim▁begin|>import tensorflow as tf
import hyperchamber as hc
import hypergan as hg
import numpy as np
from hypergan.losses.least_squares_loss import LeastSquaresLoss
from hypergan.ops import TensorflowOps
from unittest.mock import MagicMock
from tests.mocks imp... | gan = mock_gan()
loss = LeastSquaresLoss(gan, loss_config)
d_loss, g_loss = loss.create() |
<|file_name|>linter.js.ts<|end_file_name|><|fim▁begin|>// Dependencies
import {join} from 'path';
import {APP_SRC, TOOLS_DIR} from '../config';
// Actual task implementation
export = function linterJs(gulp, plugins) {
return function() {
let src = [
join(APP_SRC, '**/*.js'),<|fim▁hole|> join(TOOLS_DIR... | |
<|file_name|>test_removeSign.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#!/usr/bin/env python2
##
# autosign
# https://github.com/leosartaj/autosign.git
#
# copyright (c) 2014 sartaj singh
# licensed under the mit license.
##
import unittest
import os, shutil
import helper
from autosign.main import removeSign, isSi... | |
<|file_name|>sparc-struct-abi.rs<|end_file_name|><|fim▁begin|>// Checks that we correctly codegen extern "C" functions returning structs.
// See issue #52638.
// compile-flags: -O --target=sparc64-unknown-linux-gnu --crate-type=rlib
// needs-llvm-components: sparc
#![feature(no_core, lang_items)]
#![no_core]
#[lang="... | trait Copy { } |
<|file_name|>connection.rs<|end_file_name|><|fim▁begin|>// rpc-perf - RPC Performance Testing
// Copyright 2015 Twitter, 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
//
// ... | pub fn reregister(&self, event_loop: &mut mio::EventLoop<Client>) { |
<|file_name|>cookmomcooks..component.spec.ts<|end_file_name|><|fim▁begin|>import {
beforeEachProviders,
describe,
expect,
it,
inject
} from '@angular/core/testing';
import { CookMomCooksAppComponent } from '../app/cookmomcooks.component';
<|fim▁hole|> inject([CookMomCooksAppComponent], (app: CookMomCooks... | beforeEachProviders(() => [CookMomCooksAppComponent]);
describe('App: CookMokCooks', () => {
it('should create the app', |
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>use std::io::Cursor;
use ast::*;
use parser::*;
use super::lexer::Lexer;
use target::Target;
use span::{Pos, Span};
fn span(sl: usize, so: usize, el: usize, eo: usize) -> Span
{
Span::new("", Pos::new(sl, so), Pos::new(el, eo))
}
pub fn th_expr(data: &str, target... | } |
<|file_name|>spacialized_cone.rs<|end_file_name|><|fim▁begin|>use na::{Translation, Norm, RotationMatrix, BaseFloat};
use na;
use math::{N, Vect, Matrix};
use bounding_volume::{BoundingVolume, BoundingSphere};
use math::{Scalar, Point, Vect};
// FIXME: make a structure 'cone' ?
#[derive(Debug, PartialEq, Clone, RustcE... | res.merge(other); |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Some utils
<|fim▁hole|>import hashlib
import uuid
def get_hash(data):
"""Returns hashed string"""
return hashlib.sha256(data).hexdigest()
def get_token():
return str(uuid.uuid4())<|fim▁end|> | |
<|file_name|>x86.rs<|end_file_name|><|fim▁begin|>use std::rc::Rc;
#[derive(PartialEq, Eq, Debug, Hash, Copy, Clone)]
pub enum Register {
Eax,
Ebx,
Ecx,
Edx,
Ebp,
Esp,
Esi,
Edi,
Ax,
Bx,
Cx,
Dx,
Al,
Ah,
Bl,
Bh,
Cl,
Ch,
Dl,
Dh,
}
#[derive(Pa... | |
<|file_name|>cookie.js<|end_file_name|><|fim▁begin|>var crypto = require("crypto"),
Request = require("./../request"),
Response = require("./../response");
module.exports = sessionCookie;
/**
* A middleware for storing and retrieving session data using HTTP cookies.
* The `options` may be any of the followi... | |
<|file_name|>dotsql.go<|end_file_name|><|fim▁begin|>// Package dotsql provides a way to separate your code from SQL queries.
//
// It is not an ORM, it is not a query builder.
// Dotsql is a library that helps you keep sql files in one place and use it with ease.
//
// For more usage examples see https://github.com/gch... |
dotsql := &DotSql{
queries: queries, |
<|file_name|>checks.py<|end_file_name|><|fim▁begin|>from discord.ext import commands
import discord.utils
def is_owner_check(ctx):
author = str(ctx.message.author)
owner = ctx.bot.config['master']
return author == owner
def is_owner():
return commands.check(is_owner_check)
def check_permissions(ctx, ... | def activeraidchannel():
def predicate(ctx): |
<|file_name|>sparsePRT.hpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License ... |
bool contains_card(RegionIdx_t region_id, CardIdx_t card_index) const {
return _next->contains_card(region_id, card_index);
} |
<|file_name|>test_box.py<|end_file_name|><|fim▁begin|>from math import isclose
import numpy as np
from pytest import fixture
from hoomd.box import Box
@fixture
def box_dict():
return dict(Lx=1, Ly=2, Lz=3, xy=1, xz=2, yz=3)
def test_base_constructor(box_dict):
box = Box(**box_dict)
for key in box_dict:... | def test_from_matrix(new_box_matrix_dict): |
<|file_name|>pygame_base_template.py<|end_file_name|><|fim▁begin|># Sample Python/Pygame Programs
# Simpson College Computer Science
# http://cs.simpson.edu
import pygame
# Define some colors
black = ( 0, 0, 0)
white = ( 255, 255, 255)
green = ( 0, 255, 0)
red = ( 255, 0, 0)
<|fim▁hole|># ... | pygame.init()
|
<|file_name|>ListAssetTransactions.ts<|end_file_name|><|fim▁begin|>import { ListAssetTransactions } from '../../src/Commands'
import { TestCommand } from '../test-helpers'
describe('/ListAssetTransactions', function() {
it(
'ListAssetTransactions() should return a properly configured JSON-RPC request',
funct... | |
<|file_name|>TwoDLRTreeSearcherConfig.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2013 Man YUAN <epsilon@epsilony.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either vers... | |
<|file_name|>missing-subscribe.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate jsonrpc_derive;
extern crate jsonrpc_core;
extern crate jsonrpc_pubsub;
#[rpc]
pub trait Rpc {
type Metadata;
// note that a subscribe method is missing
/// Unsubscribe from hello subscription.
#[pubsub(subscription = "hello... | fn main() {} |
<|file_name|>create_deployment_test.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/LICE... | assert.True(t, ok) |
<|file_name|>detector.py<|end_file_name|><|fim▁begin|>from __future__ import print_function<|fim▁hole|>import numpy as np
from timeit import default_timer as timer
from dataset.testdb import TestDB
from dataset.iterator import DetIter
class Detector(object):
"""
SSD detector which hold a detection network and ... | import mxnet as mx |
<|file_name|>cursor.py<|end_file_name|><|fim▁begin|># MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like... | self._next_row = 0
def _handle_resultset(self):
(self._rows, eof) = self._connection.get_rows() |
<|file_name|>tic_tac_toe.py<|end_file_name|><|fim▁begin|># This example requires the 'message_content' privileged intent to function.
from typing import List
from discord.ext import commands
import discord
# Defines a custom button that contains the logic of the game.
# The ['TicTacToe'] bit is for type hinting purpo... | await interaction.response.edit_message(content=content, view=view)
# This is our actual board View |
<|file_name|>borrowck-lend-flow-loop.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.ap... | break; |
<|file_name|>component.cpp<|end_file_name|><|fim▁begin|>#include "component.h"
#include "entity.h"
namespace entity {
Component::Component(Entity* parent) : QObject(parent) {
if (parent != NULL) {
parent->addComponent(this);
}
}
}
uint qHash(entity::HashableComponent* key, uint seed) {
... | return key == 0 ? 0 : key->hash(seed);
} |
<|file_name|>FbxModelBehavior.ts<|end_file_name|><|fim▁begin|>import 'element-behaviors'
import {reactive, autorun, stringAttribute} from '@lume/element'
import {FBXLoader} from 'three/examples/jsm/loaders/FBXLoader.js'
import {disposeObjectTree} from '../../utils/three.js'
import {Events} from '../../core/Events.js'
i... | this.#cleanupModel()
this.#version++
this.#loadModel() |
<|file_name|>generate.py<|end_file_name|><|fim▁begin|>import random, sys
if len(sys.argv)!= 2:
print "Usage: python generate.py <how many instructions you want>"
sys.exit()
<|fim▁hole|> output += random.choice(choices)
f = open("randout", "w")
f.write(output)
f.close
print "Created an instruction set t... | choices = ("(", ")")
output = ""
for x in range(int(sys.argv[1])): |
<|file_name|>RSStacy.py<|end_file_name|><|fim▁begin|>import textacy.texts as ttx
import textacy.preprocess as pre
import feedparser as fp
class FeedCorpus(ttx.TextCorpus):
"""
Extends textacy TextCorpus with methods for feeds
"""
def from_feed(self, url):
fdict = fp.parse(url)
for entr... | |
<|file_name|>bitcoin_lt.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="lt" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Ducats</source>
... | |
<|file_name|>notes_spec.js<|end_file_name|><|fim▁begin|>define([
'js/spec/edxnotes/helpers', 'js/edxnotes/collections/notes'
], function(Helpers, NotesCollection) {
'use strict';
describe('EdxNotes NotesCollection', function() {
var notes = Helpers.getDefaultNotes();<|fim▁hole|> beforeEach(fu... | |
<|file_name|>tag-align-dyn-variants.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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://ww... | fn variant_data_is_aligned<A,B>(amnt: uint, u: &a_tag<A,B>) -> bool {
match u { |
<|file_name|>test_file_content_procedures.py<|end_file_name|><|fim▁begin|>import difflib
import shutil
__author__ = 'Adam'
import unittest
import os
import useful
class TestFileContentProcedures(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.test_dir = "./tests/data/"
cls.text_fi... | "ScriptFile_Diff_Test.py")
|
<|file_name|>issue-18464.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// run-pass
#![deny(dead_code)]
const LOW_RANGE: char = '0';
const HIGH_RANGE: char = '9';
fn main() {
match '5' {
LOW_RANGE..=HIGH_RANGE => (),
_ => ()
};
}<|fim▁end|> | |
<|file_name|>filters.rs<|end_file_name|><|fim▁begin|>use color::Color;
use utils::datastructures::Matrix;
use scene::ScreenPoint;
use super::{Image, Pixel};
use super::samplers::Sample;
use super::utils::from_uniform;
use super::config::{FilterConfig, FilterFunctionConfig};
pub struct Filter {
extent: ScreenPoint... | (-alpha * (x * x)).exp()
};
gauss(x) * gauss(y) |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>/**
Copyright (c) 2014, Nathan Carver
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
1. Redistributions of source code must retain the above copyrigh... | |
<|file_name|>docgen.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
#[allow(unused_imports)]
use log::{debug, info, warn};
use codespan::{ByteIndex, Span};
use itertools::Itertools;
use move_model::{
ast::{ModuleName, SpecBlockInfo, SpecBlockTarge... | }
}
// If there is a references_file, append it's content to each generated output. |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""tifis_platform URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to ur... | |
<|file_name|>lvbRequester.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import object
import requests
import types<|fim▁hole|>from pprint import pformat
import urllib.r... | from datetime import datetime, timedelta |
<|file_name|>esri.ts<|end_file_name|><|fim▁begin|>/// <reference path="openlayers.d.ts" />
import Q = require("q");
export = esri;
module esri {
export class Request {
/**
* Perform a JSONP style get request.
*/
static GET(url:string, params:any): Q.Promise<any> {
... | var callback_name = "callback_" + new Date().toISOString().replace(/[-:TZ\.]/g, ''); |
<|file_name|>__init.test.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
/**
* __init.test.js is run before every test case.
*/
window.debug = true;
var AScene = require('aframe').AScene;
beforeEach(function () {
this.sinon = sinon.sandbox.create();
// Stub to not create a WebGL context since Travis CI runs headless... | /* global sinon, setup, teardown */ |
<|file_name|>perik.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | showWord(["n. ","Fo cheve. Madan Benwa mete perik.<br>"]) |
<|file_name|>rollup-aot.config.js<|end_file_name|><|fim▁begin|>/* eslint no-console: 0 */
'use strict';
const fs = require('fs');
const mkdirp = require('mkdirp');
const rollup = require('rollup');
const nodeResolve = require('rollup-plugin-node-resolve');
const commonjs = require('rollup-plugin-commonjs');
const ug... | if (mkdirpErr) return reject(mkdirpErr);
return true; |
<|file_name|>dummy_variables.rs<|end_file_name|><|fim▁begin|>use std::default::Default;
use std::marker::PhantomData;
use variable::GetVariable;
/// Struct that implement [`Index`],
/// used to fake variables when don't needed in expressions.
///
/// Prefer using this container with the [`DummyVariable`] fake type.
//... | DummyVariables(PhantomData::default())
} |
<|file_name|>releaseOct2021.py<|end_file_name|><|fim▁begin|>"""
Conversion pack for October 2021 release
"""<|fim▁hole|>
CONVERSIONS = {
# Renamed items
"Quafe Zero": "Quafe Zero Classic",
"Exigent Sentry Drone Navigation Mutaplasmid": "Exigent Sentry Drone Precision Mutaplasmid",
}<|fim▁end|> | |
<|file_name|>output.py<|end_file_name|><|fim▁begin|>#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.<|fim▁hole|>'''
... | #----------------------------------------------------------------------------- |
<|file_name|>linter.js<|end_file_name|><|fim▁begin|>var jshint = require('jshint').JSHINT,
colors = require('colors');
module.exports = function(code) {
var options = {
devel: true,
node: true,
predef: ['expect', 'done'],
undef: true
},
isValid = jshint(code, options);
if (!isV... | var errorsByLineNumber = {}; |
<|file_name|>user-following.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
export default Ember.Component.extend({
tagName : '',
item : null,
isFollowing : false,<|fim▁hole|> if (this.get('application.places.length') > 0) {
this.set('isFollowing', !!this.get('application.places').findBy('id'... | isLoggedIn : false,
init() {
this.set('isLoggedIn', !!this.get('application.user.login')); |
<|file_name|>Logger.cc<|end_file_name|><|fim▁begin|>#include "Logger.hh"
namespace Core
{
/****************
* Old Logger implementation
*/
Logger::Logger(const std::string & LogPrefix,int indentlvl, int indentwidth)
: _indentlvl(indentlvl), _indentwidth(indentwidth),_logprefix(LogPrefix)
{
_consoleLog ... | } // Core |
<|file_name|>test_neutronv2.py<|end_file_name|><|fim▁begin|># Copyright 2012 OpenStack Foundation
# 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
#
# ht... | |
<|file_name|>wfs.py<|end_file_name|><|fim▁begin|>"""
An implementation of OGC WFS 2.0.0 over the top of Django. This module requires that OGR be installed and that you use
either the PostGIS or Spatialite backends to GeoDjango for the layers you are retrieving. The module provides a
generic view, :py:class:WFS that pr... | def get_feature_descriptions(self, request, *types):
raise OperationNotSupported.at('GetFeatureDescription', 'Implementor should return list of FeatureDescriptions')
|
<|file_name|>pow.go<|end_file_name|><|fim▁begin|>package pow
type PoW interface {
Search(block Block, stop <-chan struct{}) (uint64, []byte)
Verify(block Block) bool<|fim▁hole|> GetHashrate() int64
Turbo(bool)
}<|fim▁end|> | |
<|file_name|>Callouts.js<|end_file_name|><|fim▁begin|>import s from './Callouts.css';
import React, { PropTypes } from 'react';
import numbro from 'numbro';
function diversityAtParityOrGreater(conf) {
return conf.diversityPercentage >= 50;
}
function confFromCurrentYear(conf) {
return conf.year == (new Date()).ge... | |
<|file_name|>instr_vshuff32x4.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
use ::test::run_test;
#[test]
fn vshuff32x4_1() {
run_test(&... | #[test]
fn vshuff32x4_5() {
run_test(&Instruction { mnemonic: Mnemonic::VSHUFF32x4, operand1: Some(Direct(ZMM15)), operand2: Some(Direct(ZMM9)), operand3: Some(IndirectScaledDisplaced(RDX, Eight, 375963431, Some(OperandSize::Zmmword), None)), operand4: Some(Literal8(88)), lock: false, rounding_mode: None, merge_mod... |
<|file_name|>expression_parser.rs<|end_file_name|><|fim▁begin|>//! expression parser for generator expressions
use std::collections::HashMap;
use std::convert::TryFrom;
use std::fmt::{Display, Formatter};
use anyhow::anyhow;
use itertools::Itertools;
use log::error;
use serde::{Deserialize, Serialize};
use serde_json... | }
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
LeBLEU - Letter-edit / Levenshtein BLEU
"""
import logging
#__all__ = []
__version__ = '0.0.1'
__author__ = 'Stig-Arne Gronroos'
__author_email__ = "stig-arne.gronroos@aalto.fi"
_logger = logging.getLogger(__name__)
def get_version():... | def eval(*args, **kwargs):
lb = LeBLEU(**kwargs)
return lb.eval(*args) |
<|file_name|>Many.js<|end_file_name|><|fim▁begin|>/**
* Icon based on ion-ios-paper-outline
*/
import React, { Component } from 'react';
class Many extends Component {
render() {
return (
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"<|fim▁hole|> <g>
<... | width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512"> |
<|file_name|>no-mixed-requires.js<|end_file_name|><|fim▁begin|>/**
* @fileoverview Rule to enforce grouped require statements for Node.JS
* @author Raphael Pigulla
* @deprecated in ESLint v7.0.0
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//... |
// "var async = require('async');"
return REQ_MODULE; |
<|file_name|>wrapping-int-api.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.or... | |
<|file_name|>Task.ts<|end_file_name|><|fim▁begin|>import data from '../tasks/all.json';
interface TaskData {
question: string;
answer: string;
}
class Task implements TaskData {
question: string;<|fim▁hole|> answer: string;
constructor(data: TaskData) {
this.question = data.question;
this.answer = data.answe... | |
<|file_name|>WNHashSetTests.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2022, WNProject 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 "WNContainers/inc/WNHashSet.h"
#include "executable_test/inc/WNTestHarness.h"
tem... | set.erase(it); |
<|file_name|>MeasureAccuray.py<|end_file_name|><|fim▁begin|>from keras.models import model_from_json
import theano.tensor as T
from utils.readImgFile import readImg
from utils.crop import crop_detection
from utils.ReadPascalVoc2 import prepareBatch
import os
import numpy as np
def Acc(imageList,model,sample_number=5... | if(left < 0): left = 0
if(right > 448): right = 447 |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>import cProfile
import unittest
import pstats
<|fim▁hole|>
def runtests():
# set verbosity to 2 to see each test
unittest.TextTestRunner(verbosity=1, buffer=True).run(suite)
cProfile.run(
'runtests()', filename='test_cprofile_results.lo... | if __name__ == '__main__':
suite = unittest.TestLoader().discover('.') |
<|file_name|>paste.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright(C) 2011 Laurent Bachelier
#
# This file is part of weboob.
#
# weboob 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 Foundati... | |
<|file_name|>LongLongLongLongVertexInputFormat.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 t... | "Couldn't get vertex from line " + line, e);
}
}
} |
<|file_name|>lights_on.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import lifx
<|fim▁hole|><|fim▁end|> | lifx.set_power(lifx.BCAST, True) |
<|file_name|>notify.py<|end_file_name|><|fim▁begin|>from builtins import str
from builtins import object
import smtplib
import email.utils<|fim▁hole|>if sys.version < '3':
from email.MIMEText import MIMEText
else:
from email.mime.text import MIMEText
class Notify(object):
"""
Send notifications
""... | from biomaj.workflow import Workflow
import logging
import sys |
<|file_name|>constellation_msg.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 high-level interface from script to constel... | E,
F,
G, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>__all__ = ["melfilterbank", "windowing", "spectrogram", "resample"]<|fim▁hole|>import melfilterbank
import windowing
import spectrogram
import resample<|fim▁end|> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.