prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'
const Buffer = require('safe-buffer').Buffer
const crypto = require('crypto')
const Transform = require('stream').Transform
const SPEC_ALGORITHMS = ['sha256', 'sha384', 'sha512']
const BASE64_REGEX = /^[a-z0-9+/]+(?:=?=?)$/i
const SRI_REGEX = /^([^-]+)... | } else {
return Integrity.prototype.toString.call(obj, opts) |
<|file_name|>plugins.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 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... | // mounts correctly. It will be replaced and expanded on by future
// SecurityContext work.
GetRootContext() string |
<|file_name|>net.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LI... | let cx = uvll::get_data_for_uv_handle(handle);
let cx = &mut *(cx as *mut UdpRecvCtx); |
<|file_name|>gen.py<|end_file_name|><|fim▁begin|>from datetime import timedelta, date
def daterange(start_date, end_date):
for n in range(int ((end_date - start_date).days)):
yield start_date + timedelta(n)
start_date = date(2017, 9, 30)<|fim▁hole|> print './pos_runner.sh', single_date.strftime("%Y-%m-... | end_date = date(2017, 10, 23)
for single_date in daterange(start_date, end_date):
print './neg_runner.sh', single_date.strftime("%Y-%m-%d") |
<|file_name|>kernel_stats.hh<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2004-2005 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met: redistribut... | #include "kern/kernel_stats.hh"
namespace SparcISA { |
<|file_name|>runtest.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 The Rust Project Developers. See the
// COPYRIGHT file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/li... | args += split_maybe_args(config.rustcflags);
args += split_maybe_args(props.compile_flags);
return ProcArgs {prog: prog.to_str(), args: args}; |
<|file_name|>googlecode_upload.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# !!!!!!!!! WARNING !!!!!!!!!!!!!!!
# This Script was bastardized To Read Password From /home/bspaans/.googlecode
#
#
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Scrip... | # Try to load username/password from svn config for first try. |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>export { default as EthereumTx } from './EthereumTx';
export { default as Ethereum } from './Ethereum';<|fim▁hole|><|fim▁end|> | export { default as EthereumParams } from './EthereumParams'; |
<|file_name|>test_alive_users.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# T... | self.assertEquals(1, len(expired_users))
self.assertEquals(session_id1, expired_users[0]) |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for tcp-ping 0.1
// Project: https://github.com/wesolyromek/tcp-ping
// Definitions by: JUNG YONG WOO <https://github.com/stegano>
// rymate1234 <https://github.com/rymate1234>
// Definitions: https://github.com/DefinitelyTyped/Def... | }
export interface Results { |
<|file_name|>episode.ts<|end_file_name|><|fim▁begin|>'use strict';
import cheerio = require('cheerio');
import fs = require('fs');
import mkdirp = require('mkdirp');
import my_request = require('./my_request');
import path = require('path');
import subtitle from './subtitle/index';
import vlos from './vlos';
import vid... | log.dispEpisode(fileName, 'Fetching...', false);
downloadSubtitle(config, page, player, filePath, (errDS) =>
{
if (errDS) |
<|file_name|>TestTruncate.cpp<|end_file_name|><|fim▁begin|>/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2000,2007 Oracle. All rights reserved.
*
* $Id: TestTruncate.cpp,v 12.5 2007/05/17 15:15:57 bostic Exp $
*/
/*
* Do some regression tests for constructors.
* Run normally (wi... | #include <iostream.h>
int main(int argc, char *argv[]) |
<|file_name|>legacy.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import logging
import struct
import six
from six.moves import xrange
import kafka.common
import kafka.protocol.commit
import kafka.protocol.fetch
import kafka.protocol.message
import kafka.protocol.metadata
import kafka.proto... | MessageSize => int32 |
<|file_name|>multicast.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later ver... | class ReceiveMulticastTest(Test): |
<|file_name|>test_table.py<|end_file_name|><|fim▁begin|>import unittest
from datetime import date
from binder.col import *
from binder.table import Table, SqlCondition, SqlSort, AND, OR
from bindertest.tabledefs import Foo, Bar
class TableTest(unittest.TestCase):
def test_init_2_AutoIdCols(self):
# Tab... |
def test_auto_id_col(self): |
<|file_name|>(open).js<|end_file_name|><|fim▁begin|>(function (root, undefined) {<|fim▁hole|><|fim▁end|> | "use strict"; |
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
use crate::{
client_extensions::CLIENT_EXTENSION_DIRECTIVE_NAME,
connec... | |
<|file_name|>ctdav_n_auv.py<|end_file_name|><|fim▁begin|>"""
@package mi.dataset.parser
@file marine-integrations/mi/dataset/parser/ctdav_n_auv.py
@author Jeff Roy
@brief Parser and particle Classes and tools for the ctdav_n_auv data
Release notes:
initial release
"""
__author__ = 'Jeff Roy'
__license__ = 'Apache 2.0... | message_map) |
<|file_name|>to_bits.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::logic::traits::{BitAccess, SignificantBits};
use malachite_nz::integer::Integer;<|fim▁hole|>pub fn to_bits_asc_naive(n: &Integer) -> Vec<bool> {
let mut bits = Vec::new();
if *n == 0 {
return bits;
}
for i in 0..n.sign... | |
<|file_name|>glm.py<|end_file_name|><|fim▁begin|>"""Interface to rpy2.glm
Copyright 2012 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
import rpy2.robjects as robjects
r = robjects.r
def linear_model(model, print_flag=True):
"""Submits model to r.lm and returns the result."""
mo... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
Gauged
https://github.com/chriso/gauged (MIT Licensed)
Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com>
"""
from urlparse import urlparse, parse_qsl
from urllib import unquote
from .mysql import MySQLDriver
from .sqlite import SQLiteDriver
from .postgresql ... | if 'unix_socket' in kwargs:
kwargs['host'] = kwargs.pop('unix_socket')
elif host:
kwargs['host'] = host |
<|file_name|>template-param-usage-6.rs<|end_file_name|><|fim▁begin|>#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct DoesNotUseTemplateParameter {
pub x: ::std::os::raw::c_int,<|fim▁hole|>pub type DoesN... | } |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>//main.js
// const greeter = require('./Greeter.js');
// document.querySelector("#root").appendChild(greeter());
import React from 'react';
import {render} from 'react-dom';
import Greeter from './Greeter';<|fim▁hole|>import './main.css';//使用require导入css文件
render(<G... | |
<|file_name|>E0663.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/... | asm!("xor %eax, %eax" |
<|file_name|>0003_emailvalidationtoken.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-16 21:51
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
<|fim▁hole|>
class Migration... | |
<|file_name|>sudoku_solver_level_3_1.py<|end_file_name|><|fim▁begin|># https://www.codewars.com/kata/sudoku-solver/train/python
def sudoku(puzzle):
import collections
print('=== in sudoku ===')
# Print arguments
print_board(puzzle)
# Count the numbers that are currently populated on the sudoku board
number_co... | |
<|file_name|>macro_parser.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.o... | use parse::parser::{LifetimeAndTypesWithoutColons, Parser};
use parse::token::{Token, EOF, Nonterminal};
use parse::token; |
<|file_name|>context_processors.py<|end_file_name|><|fim▁begin|>def settings(request):
"""
Add settings (or some) to the templates
"""
from django.conf import settings
<|fim▁hole|> tags['MAP_PROVIDER'] = settings.MAP_PROVIDER
if hasattr(settings, 'GOOGLE_ANALYTICS_KEY'):
tags['GOOGLE_ANAL... | tags = {}
tags['GOOGLE_MAPS_KEY'] = settings.GOOGLE_MAPS_KEY
tags['GOOGLE_ANALYTICS_ENABLED'] = getattr(settings, 'GOOGLE_ANALYTICS_ENABLED', True) |
<|file_name|>spacer.py<|end_file_name|><|fim▁begin|>#
# Race Capture App
#
# Copyright (C) 2014-2017 Autosport Labs
#
# This file is part of the Race Capture App
#
# This 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 Fo... |
class HorizontalSpacer(Widget): |
<|file_name|>LoginStatus.js<|end_file_name|><|fim▁begin|>import React, {PropTypes} from 'react'
import styles from './Form.css'
export default React.createClass({
propTypes: {
username: PropTypes.string.isRequired,
onLogout: PropTypes.func
},
render() {<|fim▁hole|> <section>
<label>当前用户... | return (
<div className={styles.forms}> |
<|file_name|>modeltest_runner.py<|end_file_name|><|fim▁begin|>import os
import glob
import subprocess
def expand_path(path):
return os.path.abspath(os.path.expandvars(os.path.expanduser(path)))<|fim▁hole|> if not path:
return False
if not os.path.isfile(path):
return False
return True
def arg_is_file(path):
... |
def is_file(path): |
<|file_name|>ToXmlUtils.java<|end_file_name|><|fim▁begin|>/*
* XAdES4j - A Java library for generation and verification of XAdES signatures.
* Copyright (C) 2010 Luis Goncalves.
*
* XAdES4j is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as publ... | *
* You should have received a copy of the GNU Lesser General Public License along
* with XAdES4j. If not, see <http://www.gnu.org/licenses/>. |
<|file_name|>event_test.go<|end_file_name|><|fim▁begin|>package dao<|fim▁hole|> "context"
"testing"
"go-common/app/admin/main/reply/model"
. "github.com/smartystreets/goconvey/convey"
)
func TestEvent(t *testing.T) {
var (
mid = int64(1)
sub = &model.Subject{}
rp = &model.Reply{Content: &model.Re... |
import ( |
<|file_name|>reflect_test.go<|end_file_name|><|fim▁begin|>package wire
import (
"bytes"
"fmt"
"reflect"
"testing"
"time"
. "github.com/eris-ltd/mint-client/Godeps/_workspace/src/github.com/tendermint/tendermint/common"
)
type SimpleStruct struct {
String string
Bytes []byte
Time time.Time
}
type Animal ... | if string(viper.Bytes) != "hizz" {
t.Errorf("Expected string(viper.Bytes) == 'hizz', got %v", string(viper.Bytes))
}
} else { |
<|file_name|>game.js<|end_file_name|><|fim▁begin|>document.addEventListener("DOMContentLoaded", function() {
"use_strict";
// Store game in global variable
const CASUDOKU = {};
CASUDOKU.game = (function() {
// Controls the state of the game
// Game UI
let uiStats = document.getElementById("gameStats")... | |
<|file_name|>bitcoin_da.ts<|end_file_name|><|fim▁begin|><TS language="da" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Højreklik for at redigere adresse eller mærkat</translation>
</message>
<message>
... | <message>
<source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source> |
<|file_name|>pow.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2012 Greg Reimer ( http://obadger.com/ )
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 li... | // center rays on a given element |
<|file_name|>solution.py<|end_file_name|><|fim▁begin|>from collections import deque
N = int(input())
d = deque()
i = 0<|fim▁hole|> command = input().split()
if command[0] == 'append':
d.append(command[1])
elif command[0] == 'appendleft':
d.appendleft(command[1])
elif command[0] == 'pop':... | while i < N: |
<|file_name|>test.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | zhangyu |
<|file_name|>mobilenet_tflite.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2021 Google LLC. 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|>Transponder.py<|end_file_name|><|fim▁begin|>from enigma import eDVBFrontendParametersSatellite, eDVBFrontendParametersCable, eDVBFrontendParametersTerrestrial
from Components.NimManager import nimmanager
def ConvertToHumanReadable(tp, type = None):
ret = { }
if type is None:
type = tp.get("tuner_type"... | ret["polarization"] = { |
<|file_name|>factory.js<|end_file_name|><|fim▁begin|>angular.module('factoria', ['firebase'])
.factory('fireService', ['$firebaseArray', function($firebaseArray){
var firebaseRef= "";
var setFirebaseSource = function(url){
firebaseRef= new Firebase(url);
};
var getFirebaseRoot = function(){
... | addData : addData,
getData : getData, |
<|file_name|>depthwise_conv_test.cc<|end_file_name|><|fim▁begin|>/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache... | template <typename T>
TfLiteStatus ValidateDepthwiseConvGoldens(
const T* expected_output_data, int output_length,
TfLiteDepthwiseConvParams* conv_params, float tolerance, int tensors_size, |
<|file_name|>_route_filter_rules_operations.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 informatio... | path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'),
'ruleName': self._serialize.url("rule_name", rule_name, 'str'), |
<|file_name|>update.ts<|end_file_name|><|fim▁begin|>import { CommandInstanceInfo, CommandLineInputs, CommandLineOptions, CommandMetadata, CommandPreRun } from '../../definitions';
import { input } from '../../lib/color';
import { CapacitorCommand } from './base';
export class UpdateCommand extends CapacitorCommand im... | description: ` |
<|file_name|>result_functions_file.py<|end_file_name|><|fim▁begin|>import os
import datetime
import lib.maglib as MSG
#这是一个对结果进行初步处理的库
#用来分离抓取结果,作者,发帖时间
#抓取结果应该储存在【用户端根目录】并以result命名
#在测试情况下,抓取结果文件为results.txt
#重要全局变量
PATH_SUFFIX = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
print(PATH... | DBCUR.execute(SEL) |
<|file_name|>f32-as-u32.rs<|end_file_name|><|fim▁begin|>fn main() {
let a: f32 = 42.42;
let frankentype: u32 = unsafe {
std::mem::transmute(a)<|fim▁hole|> println!("{:032b}", frankentype);
}<|fim▁end|> | };
|
<|file_name|>rest_api_test_course.py<|end_file_name|><|fim▁begin|>'''
Testing class for database API's course related functions.
Authors: Ari Kairala, Petteri Ponsimaa
Originally adopted from Ivan's exercise 1 test class.
'''
import unittest, hashlib
import re, base64, copy, json, server
from database_api_te... | for key, val in data.items():
db_item[trans_table[key]] = val
|
<|file_name|>page.py<|end_file_name|><|fim▁begin|>import os
import shutil
from jinja2 import Environment, PackageLoader
import html
import xml.etree.ElementTree as et
class moodle_module:
def __init__(self, **kwargs):
self.backup = kwargs['backup']
self.temp_dir = kwargs['temp_dir']
self.... | |
<|file_name|>KenLanguageModel.java<|end_file_name|><|fim▁begin|>package edu.stanford.nlp.mt.lm;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import edu.stanford.nlp.mt.util.IStr... | // private static final ThreadLocal<KenLMCache> threadLocalCache =
// new ThreadLocal<KenLMCache>(); |
<|file_name|>KittenRestService.java<|end_file_name|><|fim▁begin|>package fables.kotlin.jee.rest;
import fables.kotlin.jee.business.KittenBusinessService;
import fables.kotlin.jee.business.KittenEntity;
import javax.inject.Inject;
import javax.ws.rs.*;
/**
* JSON REST CRud service.
* JEE will first create one noarg... | public KittenRest find(
@PathParam("id") final int id
) {
return kittenBusinessService |
<|file_name|>IPhoneAddressView.java<|end_file_name|><|fim▁begin|>package com.rx.mvp.cn.view.iface;
import com.rx.mvp.cn.base.IBaseView;
import com.rx.mvp.cn.model.bean.AddressBean;
/**
* 手机归属地页面view接口
*
* @author ZhongDaFeng
*/<|fim▁hole|>
//显示结果
void showResult(AddressBean bean);
}<|fim▁end|> |
public interface IPhoneAddressView extends IBaseView { |
<|file_name|>provider.js<|end_file_name|><|fim▁begin|>/*
* provider.js: Abstraction providing an interface into pluggable configuration storage.
*
* (C) 2011, Nodejitsu Inc.
*
*/
var async = require('async'),
common = require('./common');
//
// ### function Provider (options)
// #### @options {Object} Option... | return err ? callback(err) : callback(null, response);
}); |
<|file_name|>animation.js<|end_file_name|><|fim▁begin|>goog.provide('ol.animation');
goog.require('ol');
goog.require('ol.PreRenderFunction');
goog.require('ol.ViewHint');
goog.require('ol.coordinate');
goog.require('ol.easing');
/**
* Generate an animated transition that will "bounce" the resolution as it
* appro... | return (
/** |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>(function(app, undefined) {
'use strict';
if(!app) throw new Error('Application "app" namespace not found.');
//----------------------------------------------------------------------------
console.log( 'hello world' );
console.log( 'Application Running...' )... | |
<|file_name|>client.py<|end_file_name|><|fim▁begin|>"""tcprocd client."""
from __future__ import unicode_literals, print_function, absolute_import
from tcprocd.protocol import Protocol
import socket
import select
import sys
if sys.version_info[0] < 3:
str_types = (str, unicode) # noqa
else:
str_types = (str,... | class SocketShell(object):
"""
A class to connect to a process's thread. |
<|file_name|>test_bigmem.py<|end_file_name|><|fim▁begin|>from test import test_support
from test.test_support import bigmemtest, _1G, _2G, _4G, precisionbigmemtest
import unittest
import operator
import string
import sys
# Bigmem testing houserules:
#
# - Try not to allocate too many large objects. It's ok... | self.assertEquals(s.count('0'), size * 2)
|
<|file_name|>control_tower_resources.py<|end_file_name|><|fim▁begin|>from collections import namedtuple
from model.flyweight import Flyweight
from model.static.database import database
class ControlTowerResource(Flyweight):
def __init__(self,control_tower_type_id):
#prevents reinitializing
if "_ini... | #prevents reinitializing
|
<|file_name|>pipeline_structure.ts<|end_file_name|><|fim▁begin|>/*
* Copyright 2021 ThoughtWorks, 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/lic... | for (const eachPipeline of eachGroup.pipelines()) {
if (eachPipeline.name().toLowerCase() === name.toLowerCase()) {
return eachPipeline;
} |
<|file_name|>MipsMCCodeEmitter.cpp<|end_file_name|><|fim▁begin|>//===-- MipsMCCodeEmitter.cpp - Convert Mips code to machine code ---------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.... | #include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSubtargetInfo.h" |
<|file_name|>angular-animate.js<|end_file_name|><|fim▁begin|>/**
* @license AngularJS v1.3.0-build.2480+sha.fb6062f
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, angular, undefined) {'use strict';
/* jshint maxlen: false */
/**
* @ngdoc module
* @name ngAnimate
* @descri... | * }
* @-webkit-keyframes enter_sequence { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | """ pyvalence
"""
__version__ = '0.0.1.3' |
<|file_name|>jinja_helper.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Dustin Doloff
# Licensed under Apache License v2.0
import jinja2
import os
MESSAGE_FILL = '`'
AUTO_GEN_MESSAGE = """
``````````````````````````````````````````````````````
``````````````````````````````````````````````````````
````````____... | out_file.write(auto_gen_message('<!--', '-', '-->')) |
<|file_name|>test_Sphere.py<|end_file_name|><|fim▁begin|>import batoid
import numpy as np
from test_helpers import timer, do_pickle, all_obj_diff, init_gpu, rays_allclose
@timer
def test_properties():
rng = np.random.default_rng(5)
for i in range(100):
R = rng.normal(0.0, 0.3) # negative allowed
... | for i in range(100):
R = 1./rng.normal(0.0, 0.3)
sphere = batoid.Sphere(R) |
<|file_name|>browserclient.ts<|end_file_name|><|fim▁begin|>/**
* MHub client library using native browser WebSocket.
*/
import * as events from "events";
import { BaseClient, BaseClientOptions, Connection } from "./baseclient";
import * as protocol from "./protocol";
const DEFAULT_PORT_WS = 13900;
const DEFAULT_POR... | const CLOSE_GOING_AWAY = 1001; // https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes
class WebSocketConnection extends events.EventEmitter implements Connection {
private _socket: WebSocket; |
<|file_name|>layout_debug.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/. */
//! Supports writing a trace file created during each la... | |
<|file_name|>context_tip_test.go<|end_file_name|><|fim▁begin|>// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENS... | }
payload := strings.NewReader(fmt.Sprintf(`{"topic":%q, "message": %q}`, topicName, "my_message")) |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>var path = require('path');
var ndir = require('ndir');
var express = require('express');
var MongoStore = require('connect-mongo')(express);
var ejs = require('ejs');
var routes = require('./routes');
var config = require('./config').config;
var adminFilter = req... | ndir.mkdir(config.upload_temp_dir, function(err) { // 建立上传文件目录
|
<|file_name|>rules.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/. */
//! Bindings for CSS Rule objects
use crate::counter_style::{... |
impl<'a> ToNsCssValue for &'a counter_style::SpeakAs {
fn convert(self, nscssvalue: &mut nsCSSValue) {
use crate::counter_style::SpeakAs::*; |
<|file_name|>MIDI_nl_NL.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="nl_NL">
<context>
<name>ConfigureMidiPlugin</name>
<message>
<location filename="common/configuremidiplugin.ui" line="14"/>
<source>Configure MIDI Plugin</sour... | <translation>Er is geen fout opgetreden.</translation> |
<|file_name|>depart.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2017 Chef Software Inc. and/or applicable contributors
//
// 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:... |
use butterfly::client::Client;
use common::ui::{Status, UI};
use hcore::crypto::SymKey; |
<|file_name|>diagnostics.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lic... | ```
fn main(){
let x = 3;
x = 5; // error, reassignment of immutable variable |
<|file_name|>DoInterestManager.py<|end_file_name|><|fim▁begin|>"""
The DoInterestManager keeps track of which parent/zones that we currently
have interest in. When you want to "look" into a zone you add an interest
to that zone. When you want to get rid of, or ignore, the objects in that
zone, remove interest in that... | self.stream.writeln("Ran %d test%s in %.3fs" % |
<|file_name|>cli_caller.py<|end_file_name|><|fim▁begin|>from api.callers.api_caller import ApiCaller
from exceptions import ResponseTextContentTypeError
from colors import Color
import os
from cli.arguments_builders.default_cli_arguments import DefaultCliArguments
import datetime
from cli.cli_file_writer import CliFile... | if output_path.startswith('/') is True: # Given path is absolute |
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>module.exports = function(grunt) {
// Initializing the configuration object
grunt.initConfig({
copy: {
main: {
files: [
// includes files within path
{
expand: true,
... | less: {
development: {
options: { |
<|file_name|>authorization_code.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# encoding: utf-8
from __future__ import absolute_import
from .base import AuthenticationMixinBase
from . import GrantFailed
# We need to get urlencode from urllib.parse in Python 3, but fall back to
# urllib in Python 2
try:
... | query['scope'] = scope
if redirect: |
<|file_name|>mucc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Multiple URL Command Client
#
# Combine a list of mv, cp, rm, and put commands on URLs into a single commit
#
# To read the help for this program, type python mucc.py --help
import os
from csvn.core import *
from csvn.repos import RemoteReposit... | parser.print_help()
sys.exit(1) |
<|file_name|>latlon-spherical.js<|end_file_name|><|fim▁begin|>/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* Latitude/longitude spherical geodesy formulae & scripts (c) Chris Veness 2002-2015 */
/* - www.movable-type.co.uk/scripts/latlong.html ... | * Returns a string representation of 'this' point, formatted as degrees, degrees+minutes, or
* degrees+minutes+seconds. |
<|file_name|>message_file_reader.cc<|end_file_name|><|fim▁begin|>// Copyright 2013 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 <limits.h>
#include <stddef.h>
#include <stdint.h>
#include "base/files/file_pa... | |
<|file_name|>to-oblivion-and-beyond.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
loop {
i += 1000;
print!("{}..", i);
if i % 10_000 == 0 {
print!{"\n"}
}
}
}<|fim▁end|> | fn main() {
let mut i: u16 = 0;
print!("{}..", i); |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from distutils.core import setup, Extension
poppler_install_path = '/usr'
import multivio
setup(
name='multivio',
version=multivio.__version__,
description='Multivio server.',
long_description='''Multivio is a project...''',
... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate serde_derive;
extern crate clap;
extern crate hyper;
extern crate reqwest;
extern crate serde_json;
mod json_response;
use crate::json_response::{BringResponse, ErrorConsignmentSet, Eventset, Packageset};
use clap::{App, AppSettings, Arg};
us... | }
async fn deserialize(buf: String) {
let deserialized: Result<BringResponse, serde_json::Error> = serde_json::from_str(buf.trim()); |
<|file_name|>WikidataInterfaceTest.java<|end_file_name|><|fim▁begin|>package com.formulasearchengine.mathosphere.mlp.text;
import com.google.common.collect.Lists;
import org.junit.Assert;
import org.junit.Test;
import java.io.File;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path... | "Q44432",
"Q44432",
"Q319913",
"Q12916", |
<|file_name|>kerio-api.js<|end_file_name|><|fim▁begin|>class Client {
constructor(http_client){
this.http_client = http_client
this.method_list = []
}
xyz() {
return this.http_client
}
}
function chainable_client () {<|fim▁hole|>
chainable_method = require('./chainable_method.js')
return chainable_method... | HttpClient = require('./http_client.js')
http_client = new HttpClient(arguments[0]) |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2014-2016 Thomas Jost and the Contributors
#
# This file is part of git-annex-remote-hubic.
#
# git-annex-remote-hubic is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License... | "python-swiftclient>=2.1.0",
"rauth>=0.7", |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2018 Benjamin Fry <benjaminfry@me.com>
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. This fi... | |
<|file_name|>database.hpp<|end_file_name|><|fim▁begin|>/*
* database.hpp
*
* Created on: Sep 22, 2016
* Author: dan
*/
#ifndef SRC_TURBO_BROCCOLI_DATABASE_HPP_
#define SRC_TURBO_BROCCOLI_DATABASE_HPP_
#include <boost/filesystem.hpp>
#include <turbo_broccoli/type/key.hpp>
#include <turbo_broccoli/type/valu... | else {
if(!fs::is_directory(path_)) { |
<|file_name|>recorder_window.js<|end_file_name|><|fim▁begin|>const { BrowserWindow } = require('electron');
const path = require('path');
class RecorderWindow {
constructor() {<|fim▁hole|> let htmlPath = 'file://' + path.join(__dirname, '..') + '/pages/recorder_window.html'
this.window = new BrowserWindow({
... | |
<|file_name|>dialogs_jy.py<|end_file_name|><|fim▁begin|># Copyright 2008-2015 Nokia Solutions and Networks
#
# 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/l... | self.component.requestFocusInWindow() |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md>
//! FFI bindings to difxapi.
#![no_std]
#![experimental]
extern crate winapi;
use winapi::*;
extern "system" {<|fim▁hole|><|fim▁end|> | } |
<|file_name|>embedder.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/. */
//! Implements the global methods required by Servo (not wi... | &mut self,
xr: &mut webxr::MainThreadRegistry,
_embedder_proxy: EmbedderProxy, |
<|file_name|>wav_to_mp3.py<|end_file_name|><|fim▁begin|># YouTube Video: https://www.youtube.com/watch?v=4E7N7W1lUkU
import os
import pydub
import glob<|fim▁hole|> mp3_file = os.path.splitext(wav_file)[0] + '.mp3'
sound = pydub.AudioSegment.from_wav(wav_file)
sound.export(mp3_file, format="mp3")
os.remov... |
wav_files = glob.glob('./*.wav')
for wav_file in wav_files: |
<|file_name|>get-site-comments.js<|end_file_name|><|fim▁begin|>import { createSelector } from '@automattic/state-utils';
import { filter, orderBy } from 'lodash';
import 'calypso/state/comments/init';
<|fim▁hole|>function filterCommentsByStatus( comments, status ) {
return 'all' === status
? filter(
comments,
... | |
<|file_name|>FnParameterisedHolderTest.py<|end_file_name|><|fim▁begin|>##########################################################################
#
# Copyright (c) 2008-2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permi... | self.assertEqual( hPlug.child( 1 ).asFloat(), -2 )
self.assertEqual( hPlug.child( 2 ).asFloat(), -3 ) |
<|file_name|>BeanValidatorComponentAutoConfiguration.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 lice... | |
<|file_name|>asyncInjectors.test.js<|end_file_name|><|fim▁begin|>/**
* Test async injectors
*/
import { memoryHistory } from 'react-router';
import { put } from 'redux-saga/effects';
import { fromJS } from 'immutable';
import configureStore from 'store';
import {<|fim▁hole|>
// Fixtures
const initialState = fromJ... | injectAsyncReducer,
injectAsyncSagas,
getAsyncInjectors,
} from '../asyncInjectors'; |
<|file_name|>facets_with_custom_projection.py<|end_file_name|><|fim▁begin|><|fim▁hole|>"""
FacetGrid with custom projection
================================
_thumb: .33, .5
"""
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
sns.set()
# Generate an example radial datast
... | |
<|file_name|>classgr__interleave.js<|end_file_name|><|fim▁begin|>var classgr__interleave =
[
[ "~gr_interleave", "classgr__interleave.html#ae342ba63322b78359ee71de113e41fc1", null ],
[ "check_topology", "classgr__interleave.html#ade74f196c0fc8a91ca4f853a2d1202e1", null ],
[ "work", "classgr__interleave.html... | ]; |
<|file_name|>swarm.go<|end_file_name|><|fim▁begin|>// package swarm implements a connection muxer with a pair of channels
// to synchronize all network communication.
package swarm
import (
"fmt"
"sync"
"time"
metrics "github.com/ipfs/go-ipfs/metrics"
inet "github.com/ipfs/go-ipfs/p2p/net"
addrutil "github.com/... | return wrapStreams(ps.StreamsWithGroup(p, s.swarm.Streams()))
} |
<|file_name|>test_console.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import io
import pytest
import re
from collections import namedtuple
from unittest import mock
from toot import console, User, App, http
from toot.exceptions import ConsoleError
from tests.utils import MockResponse
app = App('habunek.... |
assert "111111111111111111" in lines[-3] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.