prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>slicer.ts<|end_file_name|><|fim▁begin|>import times from 'lodash/times';
import { Slicer } from '@terascope/job-components';
import { SimpleReaderConfig } from './interfaces';
import SimpleClient from '../simple-connector/client';
export default class TestSlicer extends Slicer<SimpleReaderConfig> {
cl... |
// @ts-ignore |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>// Copyright 2017, Google, Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unl... | scores.getLeaderboard().then(scores => {
res.render('leaderboard.pug', { |
<|file_name|>ser.rs<|end_file_name|><|fim▁begin|>use std::io;
use rmp_serialize::decode::Error;
use rmp_serialize::{Encoder, Decoder};
use rustc_serialize::{Encodable, Decodable};
pub fn decode<R: Decodable>(inp: Vec<u8>) -> Result<R, Error> {
let mut decoder = Decoder::new(&inp[..]);
Decodable::decode(&mut de... |
pub fn encode<R: Encodable>(data: R) -> Result<Vec<u8>, io::Error> {
let mut buf = Vec::<u8>::new();
match data.encode(&mut Encoder::new(&mut buf)) { |
<|file_name|>store_pointcloud_state.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import rospy
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxySubscriberCached
from sensor_msgs.msg import PointCloud2
class StorePointcloudState(EventState):
'''
Stores the latest pointcloud of ... |
#> pointcloud PointCloud2 The received pointcloud. |
<|file_name|>bitcoin_es_UY.ts<|end_file_name|><|fim▁begin|><TS language="es_UY" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Clic derecho para editar dirección o etiqueta</translation>
</message>
<messa... | <source>&Show / Hide</source> |
<|file_name|>ssd1306.py<|end_file_name|><|fim▁begin|>#----------------------------------------------------------------------
# ssd1306.py from https://github.com/guyc/py-gaugette
# ported by Guy Carpenter, Clearwater Software
#
# This library works with
# Adafruit's 128x32 SPI monochrome OLED http://www.adafruit.co... | |
<|file_name|>evemit.js<|end_file_name|><|fim▁begin|>/**
* @name Evemit
* @description Minimal and fast JavaScript event emitter for Node.js and front-end.
* @author Nicolas Tallefourtane <dev@nicolab.net>
* @link https://github.com/Nicolab/evemit
* @license MIT https://github.com/Nicolab/evemit/blob/master/LICENSE... | |
<|file_name|>server.js<|end_file_name|><|fim▁begin|>const express = require('express');
const mongodb = require('mongodb')
const request = require('request');
const app = express();
const server = require('http').createServer(app)
const io = require('socket.io').listen(server)
const mongo_url = 'mongodb://localhost:2... | }
} |
<|file_name|>webglobject.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/. */
// https://www.khronos.org/registry/webgl/specs/latest/1.... | |
<|file_name|>lv.js<|end_file_name|><|fim▁begin|>/*
* PLUGIN LoginMGR<|fim▁hole|> *
* Author:
*/
theUILang.accLogin = "Login";
theUILang.accPassword = "Password";
theUILang.accAccounts = "Accounts";
theUILang.accAuto = "Autologin";
theUILang.acAutoNone = "None";
theUILang.acAutoDay = "Every day";
theU... | *
* Latvian language file. |
<|file_name|>Ui_player_create.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/stuart/src/kdevelop projects/tennis/player_create.ui'
#
# Created: Mon Nov 3 22:00:23 2014
# by: PyQt4 UI code generator 4.10.2
#
# WARNING! All changes made in this f... | brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern) |
<|file_name|>root.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::arithmetic::traits::{
CeilingRoot, CeilingRootAssign, CheckedRoot, FloorRoot, FloorRootAssign,
};
use malachite_base::num::conversion::traits::ExactFrom;
use malachite_base_test_util::bench::{run_benchmark, BenchmarkType};
use malachite_base... | ) { |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>let express = require('express');
let path = require('path');
let logger = require('morgan');
let bodyParser = require('body-parser');
let index = require('./routes/index');
let semanticui = require('./routes/semanticui');
let foundation = require('./routes/foundation');... | // view engine setup |
<|file_name|>loader.py<|end_file_name|><|fim▁begin|># Copyright 2019 Apex.AI, 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
#
# Unles... | def wrapper(**kwargs):
fn_args = inspect.getfullargspec(launch_description_fn) |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "projects_morelab.settings")
from django.core.management import execute_from_command_line
<|fim▁hole|> execute_from_command_line(sys.argv... | |
<|file_name|>pso.py<|end_file_name|><|fim▁begin|>"""
Copyright (C) 2012 Alan J Lockett
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 without restriction, including without limitation the rights ... | self._positions = np.minimum(self._positions, upper)
if initialize: |
<|file_name|>formatscript.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Fri Jun 09 10:36:56 2017
@author: Nzix
"""
import urllib,urllib2,re,datetime,time,random,xlrd,xlwt,os
cookie = ""
def ticketcheck(membercode,serial_code_1,serial_code_2):
timeout = 3
global cookie
if ... |
sheet1.col(0).width = 256 * 8
sheet1.col(1).width = 256 * 14
sheet1.col(2).width = 256 * 14 |
<|file_name|>reflect.go<|end_file_name|><|fim▁begin|>// Copyright 2012 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
... | if runtime.GOOS == "windows" {
// Windows won't execute a program unless it has a ".exe" suffix.
progBinary += ".exe" |
<|file_name|>pd.py<|end_file_name|><|fim▁begin|>##
## This file is part of the libsigrokdecode project.<|fim▁hole|>##
## Copyright (C) 2012 Iztok Jeras <iztok.jeras@gmail.com>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published ... | |
<|file_name|>actions.js<|end_file_name|><|fim▁begin|>const debug = require('ghost-ignition').debug('api:v2:utils:serializers:output:actions');
const mapper = require('./utils/mapper');
module.exports = {
browse(models, apiConfig, frame) {
debug('browse');
frame.response = {
actions: mo... | }; |
<|file_name|>Required.js<|end_file_name|><|fim▁begin|>// ----------------------------------------------- imports
var Declare = require('tui/base/Declare');
var IValidator = require('tui/validation/IValidator');
// ----------------------------------------------- class
<|fim▁hole|>
validate : function(value, options)... | var Require = Declare({
extends : IValidator, |
<|file_name|>menu.js<|end_file_name|><|fim▁begin|>'use strict';
var menu = angular.module('irc.views.menu', [
'irc.networks',
'irc.views.menu.directives',
]);
menu.controller(
'MenuCtrl', [
'$scope',
'$timeout',
'$state',
'networks',
function MenuCtrl(
$scope,
... | |
<|file_name|>glue.js<|end_file_name|><|fim▁begin|>/*
* Glue - Robust Go and Javascript Socket Library
* Copyright (C) 2015 Roland Singer <roland.singer[at]desertbit.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published... | |
<|file_name|>components.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Note: this file is part of some nnet3 config-creation tools that are now deprecated.
from __future__ import print_function
import os
import argparse
import sys
import warnings
import copy
from operator import itemgetter
def GetSumDescript... | component_nodes.append("component-node name={0}_affine component={0}_affine input={1}".format(name, input['descriptor'])) |
<|file_name|>server_trait.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 ThetaSinner
//
// This file is part of Osmium.
// Osmium is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the L... | type Request;
type Response;
fn process(&self, request: Self::Request, handle: Box<&mut ConnectionHandle>) -> Self::Response; |
<|file_name|>iRowNodeStage.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for @ag-grid-community/core v25.1.0
// Project: http://www.ag-grid.com/
// Definitions by: Niall Crosby <https://github.com/ag-grid/>
import { RowNode } from "../entities/rowNode";
import { ChangedPath } from "../utils/changedPath";
import... | rowNodeTransaction?: RowNodeTransaction | null;
rowNodeTransactions?: RowNodeTransaction[] | null; |
<|file_name|>cainteoir_document_index.cpp<|end_file_name|><|fim▁begin|>/* A GTK+ wrapper around the cainteoir::ref_entry class.
*
* Copyright (C) 2015 Reece H. Dunn
*
* This file is part of cainteoir-gtk.
*
* cainteoir-gtk is free software: you can redistribute it and/or modify
* it under the terms of the GNU Ge... | if (priv->index.empty()) |
<|file_name|>test_iterators_main.cpp<|end_file_name|><|fim▁begin|>/* Boost.MultiIndex test for iterators.
*
* Copyright 2003-2008 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See... | |
<|file_name|>address_template.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2016, Frappe Technologies and contributors
// For license information, please see license.txt
frappe.ui.form.on('Address Template', {
refresh: function(frm) {
if(frm.is_new() && !frm.doc.template) {
// set default template via js so t... | |
<|file_name|>steps.py<|end_file_name|><|fim▁begin|>from holmium.core import (
Page, Element, Locators, Elements, ElementMap, Section, Sections
)
from holmium.core.cucumber import init_steps
init_steps()
class TestSection(Section):
el = Element(Locators.NAME, "el")
els = Elements(Locators.NAME, "els")
... | return args, kwargs |
<|file_name|>decisiontree.py<|end_file_name|><|fim▁begin|># Natural Language Toolkit: Decision Tree Classifiers
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
A classifier model that decides which label to ass... | return best_stump
@staticmethod |
<|file_name|>geo_utils.py<|end_file_name|><|fim▁begin|>from django.contrib.gis.geos import GEOSGeometry, GeometryCollection
from arches.app.utils.betterJSONSerializer import JSONSerializer, JSONDeserializer
<|fim▁hole|>class GeoUtils(object):
def create_geom_collection_from_geojson(self, geojson):
geoms =... | |
<|file_name|>GPXParser.java<|end_file_name|><|fim▁begin|>/*
* GPXParser.java
*
* Copyright (c) 2012, AlternativeVision. All rights reserved.
*
* This library 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 So... | private Integer getNodeValueAsInteger(Node node) {
Integer val = null;
try {
val = Integer.parseInt(node.getFirstChild().getNodeValue());
|
<|file_name|>test_euler.py<|end_file_name|><|fim▁begin|>from __future__ import division, absolute_import
import numpy as np
from .. import EulerDeconv, EulerDeconvEW, EulerDeconvMW, sphere
from ...mesher import Sphere
from ... import utils, gridder
model = None
xp, yp, zp = None, None, None
inc, dec = None, None
struc... | windows=[10, 10], size=(1000, 1000), keep=0.2)
euler.fit()
for b in euler.baselevel_:
assert (base - b) / base <= precision, \ |
<|file_name|>virtex.d.ts<|end_file_name|><|fim▁begin|>declare module Virtex {
interface IOptions {
ambientLightColor: number;
cameraZ: number;
directionalLight1Color: number;
directionalLight1Intensity: number;
directionalLight2Color: number;
directionalLight2Intensit... | declare var requestAnimFrame: any;
declare module Virtex {
class Viewport { |
<|file_name|>policy_assignment.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... | :type type: str
:param name: The name of the policy assignment.
:type name: str |
<|file_name|>select-like.py<|end_file_name|><|fim▁begin|># select the data using the like API
# use the python 3.5 as default
import sqlite3
def select_data(db_name, table_name, condition):
"find all the data with the same kind"
with sqlite3.connect(db_name) as db:
cursor = db.cursor()
cursor.... | print(result)
table_name = ("film", "genre") |
<|file_name|>_helper.js<|end_file_name|><|fim▁begin|>var AiOS_HELPER = {
init: function () {
this.prefInterface = Components.interfaces.nsIPrefBranch;
this.prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
this.prefBran... | |
<|file_name|>ping.node.js<|end_file_name|><|fim▁begin|>/* eslint-env mocha */
'use strict'
const chai = require('chai')
chai.use(require('dirty-chai'))
const expect = chai.expect
const parallel = require('async/parallel')
const createNode = require('./utils/create-node.js')
const echo = require('./utils/echo')
descr... |
it('should be able to ping another node', (done) => {
nodeA.ping(nodeB.peerInfo, (err, ping) => { |
<|file_name|>structs.rs<|end_file_name|><|fim▁begin|>struct Point {
x: usize,
y: usize<|fim▁hole|><|fim▁end|> | } |
<|file_name|>c_windows.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licen... |
pub mod compat {
use std::intrinsics::{atomic_store_relaxed, transmute};
use std::iter::Iterator; |
<|file_name|>pipelines.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from scrapy.conf import settings
import pymongo
from datetime import dat... | record.question_type = q['question_type']
record.question_annex = q['question_annex']
record.question_url = q['question_url']
record.question_text = q['question_text'] |
<|file_name|>testfilestat.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
tr... | 'unused': 0,
'max': 4835852
} |
<|file_name|>JarWriter.java<|end_file_name|><|fim▁begin|>package com.github.hadoop.maven.plugin;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import java.util.jar.Attributes;
impor... | target.closeEntry(); |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|>########################################################################
#
# University of Southampton IT Innovation Centre, 2011
#
# Copyright in this library belongs to the University of Southampton
# University Road, Highfield, Southampton, UK, SO17 1BJ
#
# This sof... |
padding = 4
frame = options["frame"] |
<|file_name|>store.go<|end_file_name|><|fim▁begin|>// Copyright 2018 The Terraformer 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/LIC... | |
<|file_name|>king.user.js<|end_file_name|><|fim▁begin|>/***** Ajax login script ******/
var $ = jQuery;
$(document).ready(function(){
$('#king-form>.btn-login').click(function(){
$('#king-form p.status').show().text(ajax_user_object.loadingmessage);
$.ajax({
url: ajax_user_object.ajaxurl,
data: $('#ki... | }
}
});
});
|
<|file_name|>language.js<|end_file_name|><|fim▁begin|><|fim▁hole|> return state;
};<|fim▁end|> | export default function reducer (state = {}, action) { |
<|file_name|>listdeploymentinstancesrequest.cpp<|end_file_name|><|fim▁begin|>/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws 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 Fou... | * <b>Deployment configuration</b>: A set of deployment rules and deployment success and failure conditions used by AWS
* CodeDeploy during a
*
* deployment> </li> <li> |
<|file_name|>qa_hier_block2.py<|end_file_name|><|fim▁begin|>#
# Copyright 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import time
from gnuradio import gr_unittest, blocks, gr, analog
from gnuradio.gr.hier_block2 import _multiple_endpoints, _... | |
<|file_name|>dbstate.py<|end_file_name|><|fim▁begin|>"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with t... | if config is not None: |
<|file_name|>ContextFactory.java<|end_file_name|><|fim▁begin|>package bence.prognyelvek.contexts;
import java.util.List;
/**
* @param <T> Input token type.
* @param <O> Output token type.
*/
public interface ContextFactory<T, O> {
Context<T, O> getInstance(List<T> tokens);<|fim▁hole|><|fim▁end|> | } |
<|file_name|>TypeCastManager.java<|end_file_name|><|fim▁begin|>package org.lua.commons.customapi.javafunctions.handlers;
import org.lua.commons.baseapi.LuaThread;
import org.lua.commons.baseapi.extensions.LuaExtension;
import org.lua.commons.baseapi.types.LuaObject;
import org.lua.commons.customapi.javafunctions.handl... |
public Object castFrom(LuaThread thread, LuaObject obj, Type expected);
|
<|file_name|>laf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
LucasArts Font parser.
Author: Cyril Zorin
Creation date: 1 January 2007
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet,
UInt8, UInt16, UInt32, GenericVector)
from lib.hachoir_core.endian impo... | "description" : "LucasArts Font" |
<|file_name|>metrics_test.go<|end_file_name|><|fim▁begin|>package server
import (
"math/rand"
"testing"<|fim▁hole|> "github.com/stretchr/testify/assert"
)
func TestStorageMetrics_initAdd(t *testing.T) {
rng := rand.New(rand.NewSource(0))
serverSL := &fixedSL{stored: make(map[string][]byte)}
sm1 := newStorageMet... |
"github.com/drausin/libri/libri/librarian/api"
prom "github.com/prometheus/client_golang/prometheus"
dto "github.com/prometheus/client_model/go" |
<|file_name|>lifetime-elision-return-type-requires-explicit-lifetime.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 <LI... | x: &'a isize,
} |
<|file_name|>MobSpawnerAbstract.java<|end_file_name|><|fim▁begin|>package net.minecraft.server;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
// CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.entity.Creature... | SpawnerSpawnEvent event = CraftEventFactory.callSpawnerSpawnEvent(entity2, this.b(), this.c(), this.d());
if (event.isCancelled()) {
continue; |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>const { app, BrowserWindow } = require('electron');
const {ipcMain} = require('electron');
// shared to-do list data
global.sharedData = {
itemList: [<|fim▁hole|> id: 0,
text: "First meet up with David Lau on 5th July",
isComplete... | { |
<|file_name|>ngram_nskip.py<|end_file_name|><|fim▁begin|>import os
import glob
#####################################################
######Init the files##################################
#####################################################
os.remove("a0.txt")
os.remove("a1.txt")
os.remove("a2.txt")
os.remove("a3.tx... | index = index + 1
to_write = format_n[index] |
<|file_name|>HGEventCollisionScripter.cpp<|end_file_name|><|fim▁begin|>/**
* @file HGEventCollisionScripter.cpp
* @brief EventCollision script adapter implementation
*
* @author Master.G (MG), mg@snsteam.com
*
* @internal
* Created: 2013/02/21
* Company: SNSTEAM.inc
* (C) Copyright 2013 SNSTEAM.... | EventCollision* event = NULL; |
<|file_name|>fn-bare-spawn.rs<|end_file_name|><|fim▁begin|>// run-pass
// This is what the signature to spawn should look like with bare functions
fn spawn<T:Send>(val: T, f: fn(T)) {
f(val);<|fim▁hole|> assert_eq!(i, 100);
}
pub fn main() {
spawn(100, f);
}<|fim▁end|> | }
fn f(i: isize) { |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
pygments.plugin
~~~~~~~~~~~~~~~
Pygments setuptools plugin interface. The methods defined
here also work if setuptools isn't installed but they just
return nothing.
lexer plugins::
[pygments.lexers]
... | return |
<|file_name|>server.py<|end_file_name|><|fim▁begin|># ===============================================================================
# Copyright 2016 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | ('SetHome', manager.set_home),
('StopDrive', manager.stop_drive), |
<|file_name|>context.py<|end_file_name|><|fim▁begin|>import sdl2 as sdl
class Context(object):
def __init__(self, major, minor, msaa=2):<|fim▁hole|> self.context = None
self._window = None
sdl.SDL_GL_SetAttribute(sdl.SDL_GL_DOUBLEBUFFER, 1)
sdl.SDL_GL_SetAttribute(sdl.SDL_GL_CONTEX... | self.major = major
self.minor = minor
self.msaa = msaa
|
<|file_name|>go19.go<|end_file_name|><|fim▁begin|>// +build go1.9
package iris
import (
"github.com/kataras/iris/context"
"github.com/kataras/iris/core/host"
"github.com/kataras/iris/core/router"
"github.com/kataras/iris/mvc"
)
type (
// Context is the midle-man server's "object" for the clients.
//
// A New ... | // the "github.com/kataras/iris/mvc" as well.
C = mvc.C
// Response completes the `mvc/activator/methodfunc.Result` interface.
// It's being used as an alternative return value which |
<|file_name|>f32.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://www.apache.org/licens... | pub const FRAC_2_SQRT_PI: f32 = 1.12837916709551257389615890312154517_f32; |
<|file_name|>DisableKeyboardService.java<|end_file_name|><|fim▁begin|>/* Copyright 2017 Braden Farmer
*
* 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/licen... | |
<|file_name|>synth.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | # See the License for the specific language governing permissions and
# limitations under the License. |
<|file_name|>OpenVPNConfig.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# 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/
from __future__ import division, absolute... | except Exception as e:
print('WARNING:', filename, 'is not valid json.', e, file=sys.stderr)
continue
if 'meta' in data: |
<|file_name|>conversion.js<|end_file_name|><|fim▁begin|>suite('Conversion', function() {
var myp5;
setup(function(done) {
new p5(function(p) {
p.setup = function() {
myp5 = p;
done();
};
});
});
teardown(function() {
myp5.remove();
});
var result;
suite('p5.prot... | assert.strictEqual(result, false);
});
test('should convert "true" to true', function() { |
<|file_name|>-date-base.js<|end_file_name|><|fim▁begin|>import { run } from '@ember/runloop';
import Helper from '@ember/component/helper';
export default Helper.extend({
disableInterval: false,
compute(value, { interval }) {
if (this.disableInterval) {
return;
}<|fim▁hole|> this.clearTimer();
... | |
<|file_name|>simple-generic-tag.rs<|end_file_name|><|fim▁begin|>// run-pass
#![allow(dead_code)]
#![allow(non_camel_case_types)]
<|fim▁hole|>enum clam<T> { a(T), }
pub fn main() { }<|fim▁end|> | // pretty-expanded FIXME #23616
|
<|file_name|>run.go<|end_file_name|><|fim▁begin|>// run.go: Part of the Antha language
// Copyright (C) 2015 The Antha authors. All rights reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Fou... | bundleWithOutputs.TestOpt = expected |
<|file_name|>github_issue_maker.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import os
import sys
import json
if __name__=='__main__':
SRC_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(SRC_ROOT)
from datetime import datetime
import requests
from j... | redmine_name = redmine_issue_dict.get('assigned_to', {}).get('name', None)
if redmine_name is None: |
<|file_name|>rustup-init.rs<|end_file_name|><|fim▁begin|>//! The main rustup commandline application
//!
//! The rustup binary is a chimera, changing its behavior based on the
//! name of the binary. This is used most prominently to enable
//! rustup's tool 'proxies' - that is, rustup itself and the rustup
//! proxies ... | match name {
Some("rustup") => rustup_mode::main(), |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>__version__ = '0.8.1'
__author__ = "Massimiliano Pippi & Federico Frenguelli"<|fim▁hole|>
VERSION = __version__ # synonym<|fim▁end|> | |
<|file_name|>AddressbookTest.java<|end_file_name|><|fim▁begin|>package chatty;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import sta... | |
<|file_name|>ThinOut_Detections.java<|end_file_name|><|fim▁begin|>/*-
* #%L
* Fiji distribution of ImageJ for the life sciences.
* %%
* Copyright (C) 2007 - 2017 Fiji developers.
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
... |
import ij.gui.GenericDialog; |
<|file_name|>encoder_test.go<|end_file_name|><|fim▁begin|>package idxfile<|fim▁hole|>import (
"bytes"
"io/ioutil"
"github.com/src-d/go-git-fixtures"
"gopkg.in/src-d/go-git.v4/plumbing"
. "gopkg.in/check.v1"
)
func (s *IdxfileSuite) TestEncode(c *C) {
expected := &Idxfile{}
expected.Add(plumbing.NewHash("4bfc7... | |
<|file_name|>spec_guis.py<|end_file_name|><|fim▁begin|>"""
#;+
#; NAME:
#; spec_guis
#; Version 1.0
#;
#; PURPOSE:
#; Module for Spectroscopy Guis with QT
#; These call pieces from spec_widgets
#; 12-Dec-2014 by JXP
#;-
#;------------------------------------------------------------------------------
"""
f... | |
<|file_name|>workerglobalscope.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::Bindings::Funct... | );
report_pending_exception(self.runtime.cx(), true); |
<|file_name|>ServerUpdatedTexturePacketEvent.java<|end_file_name|><|fim▁begin|>package com.missingeye.pixelpainter.events.network.texture;
import com.missingeye.pixelpainter.common.PixelMetadata;<|fim▁hole|> *
* @auhtor Samuel Agius (Belpois)
*/
public class ServerUpdatedTexturePacketEvent extends UpdatedTexturePack... | import net.minecraft.util.ResourceLocation;
/**
* Created on 1/17/2015. |
<|file_name|>rect_stylus.py<|end_file_name|><|fim▁begin|>from enable.api import ColorTrait
from .base_patch_stylus import BasePatchStylus
class RectangleStylus(BasePatchStylus):
""" A Flyweight object for drawing filled rectangles.
"""
edge_color = ColorTrait('black')
fill_color = ColorTrait('yello... |
def draw(self, gc, rect):
with gc:
gc.set_stroke_color(self.edge_color_) |
<|file_name|>mini.js<|end_file_name|><|fim▁begin|>const nest = require('depnest')
const { h, Value } = require('mutant')
exports.needs = nest({
'app.sync.goTo': 'first',
'message.html.backlinks': 'first',
'message.html.author': 'first',
'message.html.meta': 'map',
'message.html.timestamp': 'first'
})
export... | h('section.meta', {}, api.message.html.meta(msg, { rawMessage })), |
<|file_name|>apptemplateloader.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# adaped from https://www.djangosnippets.org/snippets/1376/
from os.path import abspath, dirname, isdir, join
from django.apps import apps
from django.core.exceptions import ImproperlyConfigured
from django.template import TemplateD... | def _get_template_vars(self, template_name): |
<|file_name|>test_verifier.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import unittest
import json
from api_health.verifier import Verifier
class JsonVerifier(unittest.TestCase):
def test_constructor_should_be_smart_about_params(self):
simple_json = u'{ "foo": "bar" }'
json_dict = json... | v1 = Verifier(simple_json)
v2 = Verifier(json_dict)
except:
self.fail('Verifier() constructor should deal with both ' |
<|file_name|>texture.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Gfx-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/licenses/LICE... | fn from(c: [f32; 4]) -> PackedColor { |
<|file_name|>actions.py<|end_file_name|><|fim▁begin|># coding: utf-8
# Module: actions
# Created on: 27.07.2015
# Author: Roman Miroshnychenko aka Roman V.M. (romanvm@yandex.ua)
# Licence: GPL v.3: http://www.gnu.org/copyleft/gpl.html
import os
import xbmcgui
import xbmcplugin
from simpleplugin import Plugin
import js... | |
<|file_name|>query_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required... | checkQuery(t, "first empty string", sConn, cConn, &sqltypes.Result{
Fields: []*querypb.Field{
{
Name: "name", |
<|file_name|>issue-9957.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lice... | |
<|file_name|>chrome_native_app_window_views_aura.cc<|end_file_name|><|fim▁begin|>// Copyright 2015 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/ui/views/apps/chrome_native_app_window_views_aur... | widget);
#if defined(OS_CHROMEOS) |
<|file_name|>filters.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: MIT
"""
Commonly useful filters for `attr.asdict`.
"""
from __future__ import absolute_import, division, print_function
from ._compat import isclass
from ._make import Attribute
<|fim▁hole|>def _split_what(what):
"""
Returns a t... | |
<|file_name|>single_client_live_themes_sync_test.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2011 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 "base/basictypes.h"
#include "chrome/browser/sync/profile_sy... | |
<|file_name|>CopyFiles.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from Components.Task import PythonTask, Task, Job, job_manager as JobManager
from Tools.Directories import fileExists
from enigma import eTimer
from os import path
from shutil import rmtree, copy2, move
class DeleteFolderTask(... | def __init__(self, srcfile, destfile, name):
Job.__init__(self, _("Moving files"))
cmdline = 'mv -f "%s" "%s"' % (srcfile, destfile) |
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>//
// Copyright 2021 The Project Oak 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/LI... | assert!(
elapsed < Duration::from_millis(5),
"elapsed time: {:.0?}", |
<|file_name|>test_view.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import httplib as http
import mock
from nose.tools import * # noqa
from boto.exception import S3ResponseError
from framework.auth import Auth
from tests.base import get_default_metaschema
from tests.factories import ProjectFactory, AuthUs... | registration = self.project.register_node(
get_default_metaschema(), Auth(self.user), '', ''
)
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
r"""A simple, fast, extensible JSON encoder and decoder
JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
simplejson exposes an API famil... | |
<|file_name|>import_whisper.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2016 Criteo
#
# 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/license... | |
<|file_name|>iflytek.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# iflytek.py ---
#
# Filename: iflytek.py
# Description:
# Author: Werther Zhang
# Maintainer:
# Created: Thu Sep 14 09:01:20 2017 (+0800)
#
# Change Log:
#
#
import time
from ctypes import *
from io import BytesIO
... | tmpFile = _tmpFile + '.tmp'
with contextlib.closing(wave.open(tmpFile , 'w')) as f: |
<|file_name|>settings-global-edit-form.component.ts<|end_file_name|><|fim▁begin|>import { FormState} from '../settings-global-form/settings-global-form.component';
import {
FormGroup,
Validators
} from "@angular/forms";
import { Component, OnInit } from "@angular/core";
import { DialogRef } from "angular2-modal";
i... | this.dialog.close();
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.