prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>benchmark.array.js<|end_file_name|><|fim▁begin|>/** * @license Apache-2.0 * * Copyright (c) 2021 The Stdlib 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:/...
var min; var max; var f;
<|file_name|>gamepad.rs<|end_file_name|><|fim▁begin|>//! Gamepad utility functions. //! //! This is going to be a bit of a work-in-progress as gamepad input //! gets fleshed out. The `gilrs` crate needs help to add better //! cross-platform support. Why not give it a hand? //! //! TODO: All of this. use std::fmt; u...
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2012 Yoshihisa Tanaka # # 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/lice...
url='https://github.com/yosisa/pyfluent', description='A python client library for Fluentd',
<|file_name|>mba_exprs.py<|end_file_name|><|fim▁begin|>import unittest import operator import six from six.moves import range,reduce import arybo.lib.mba_exprs as EX from arybo.lib import MBA from pytanque import expand_esf_inplace, simplify_inplace class MBAExprsTest: def setUp(self): self.mba1 = MBA(1...
EX.ExprCst(1, 4)) self.exprEqual(E0, (self.x4+self.y4).rol(1)) E0 = EX.ExprRol(
<|file_name|>worker.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::Bindings::WorkerBinding; use dom::...
impl WorkerMessageHandler { pub fn new(addr: TrustedWorkerAddress, data: StructuredCloneData) -> WorkerMessageHandler {
<|file_name|>simple.js<|end_file_name|><|fim▁begin|>var test = require("tape") var mongo = require("continuable-mongo") var uuid = require("node-uuid") var setTimeout = require("timers").setTimeout var eventLog = require("../index") var client = mongo("mongodb://localhost:27017/colingo-group-tests") var collectionName...
, timeToLive: HOUR })
<|file_name|>express.js<|end_file_name|><|fim▁begin|>'use strict'; var express = require('express'), logger = require('morgan'), bodyParser = require('body-parser'), stylus = require('stylus'), cookieParser = require('cookie-parser'), session = require('express-session'), passport = require('passport'); mo...
return stylus(str).set('filename', path); }
<|file_name|>trim.js<|end_file_name|><|fim▁begin|>var castSlice = require('./_castSlice'), charsEndIndex = require('./_charsEndIndex'), charsStartIndex = require('./_charsStartIndex'), stringToArray = require('./_stringToArray'), toString = require('./toString'); /** Used to match leading and trailing ...
* @static
<|file_name|>test_module_tests.py<|end_file_name|><|fim▁begin|># Module tests # Copyright (c) 2014, Jouni Malinen <j@w1.fi> # # This software may be distributed under the terms of the BSD license. # See README for more details. import os import time import hostapd def test_module_wpa_supplicant(dev, apdev, params): ...
"""hostapd module tests"""
<|file_name|>TestCoordActionGetForStartJPAExecutor.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 licen...
resourceXmlName, 0); // Add extra attributes for action
<|file_name|>preselectButton.js<|end_file_name|><|fim▁begin|>import React from 'react'; import PropTypes from 'prop-types'; import Preselect from 'material-ui-icons/ThumbUp'; import IconWithTooltipButton from '../../common/iconWithTooltipButton'; import withApplicationStatusChange from '../../common/hoc/withApplication...
PreselectButton.propTypes = {
<|file_name|>macros.rs<|end_file_name|><|fim▁begin|>#[macro_export] #[doc(hidden)] macro_rules! path_to_cstring { ($x:expr) => { match $x { Some(x) => { let x = x.to_str().ok_or(::errors::CvError::InvalidPath(x.into()))?; Some(CString::new(x)?)<|fim▁hole|>} #[mac...
} None => None, }; };
<|file_name|>_unpacker.py<|end_file_name|><|fim▁begin|>def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__, '_unpacker.cp35-win32.pyd') __loader__ = None; del __bootstrap__, __loader__<|fim▁hole|><|fim▁end|>
imp.load_dynamic(__name__,__file__) __bootstrap__()
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import logging from logging.handlers import RotatingFileHandler from flask import Flask, render_template from flask_login import LoginManager from flask_restful import Api from flask_wtf.csrf import CsrfProtect from itsdangerous import URLSafeTimedSerializer from sq...
<|file_name|>stack.go<|end_file_name|><|fim▁begin|>package vm import ( "fmt" "math/big" ) func newStack() *stack { return &stack{} } type stack struct { data []*big.Int ptr int } func (st *stack) push(d *big.Int) { // NOTE push limit (1024) is checked in baseCheck stackItem := new(big.Int).Set(d) if len(st...
st.push(st.data[st.len()-n]) }
<|file_name|>product_characteristics.py<|end_file_name|><|fim▁begin|>from openerp.osv import osv, fields class attributes(osv.Model): _name = "product.attribute" def _get_float_max(self, cr, uid, ids, field_name, arg, context=None): result = dict.fromkeys(ids, 0) if ids: cr.execut...
for value in self.pool.get('product.attribute.line').browse(cr, uid, ids, context=context): if value.type == 'float': result[value.attribute_id.id] = True return result.keys()
<|file_name|>AsyncProxyTest.java<|end_file_name|><|fim▁begin|>/* * Copyright 2014 Space Dynamics Laboratory - Utah State University Research Foundation. * * 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 ...
package edu.usu.sdl.openstorefront.web.test.system; import edu.usu.sdl.openstorefront.core.api.LookupService;
<|file_name|>triplet.rs<|end_file_name|><|fim▁begin|>// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Ap...
// Get first row group
<|file_name|>schema.test.js<|end_file_name|><|fim▁begin|>'use strict'; var chai = require('chai') , Sequelize = require('../../../index') , expect = chai.expect , Support = require(__dirname + '/../support') , DataTypes = require(__dirname + '/../../../lib/data-types') , datetime = require('chai-datetime') ...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- # fakelcs - Waqas Bhatti (wbhatti@astro.princeton.edu) - Oct 2017 # License: MIT. See the LICENSE file for more details.<|fim▁hole|>- :py:mod:`astrobase.fakelcs.generation`: fake light curve generation and injection o...
'''This contains various modules that run variable star classification and characterize its reliability and completeness via simulating LCs:
<|file_name|>pipeTestServiceClient.py<|end_file_name|><|fim▁begin|># A Test Program for pipeTestService.py # # Install and start the Pipe Test service, then run this test # either from the same machine, or from another using the "-s" param. # # Eg: pipeTestServiceClient.py -s server_name Hi There # Should work. from w...
# Wait for all threads to finish. WaitForMultipleObjects(thread_waits, 1, INFINITE)
<|file_name|>export_common.rs<|end_file_name|><|fim▁begin|>use std::ffi::OsString; use crate::common::ui::UI; use crate::error::Result; pub async fn start(ui: &mut UI, args: &[OsString], export_cmd: &str, export_pkg_ident: &str, export_pkg_i...
use crate::{error::{Error, Result},
<|file_name|>timer.cpp<|end_file_name|><|fim▁begin|>/* ** Taiga ** Copyright (C) 2010-2017, Eren Okka ** ** 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 3 of the License, or *...
void Timer::Reset() {
<|file_name|>get_team.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright 2013 Google Inc. 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...
<|file_name|>BaseDirectorService.js<|end_file_name|><|fim▁begin|>'use strict'; const _ = require('lodash'); const utils = require('../common/utils'); const bosh = require('../data-access-layer/bosh'); const Agent = require('../data-access-layer/service-agent'); const logger = require('../common/logger'); const errors ...
<|file_name|>serve-challenge-with-flask.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # TODO: issues with new oauth2 stuff. Keep using older version of Python for now. # #!/usr/bin/env python import subprocess import praw import datetime import pyperclip from hashlib import sha1 from flask import Flask from flask...
<|file_name|>typeReferences.py<|end_file_name|><|fim▁begin|>def func(a1):<|fim▁hole|> """ Parameters: a1 (:class:`MyClass`): used to call :def:`my_function` and access :attr:`my_attr` Raises: :class:`MyException`: thrown in case of any error """<|fim▁end|>
<|file_name|>Logger.js<|end_file_name|><|fim▁begin|>function Logger () { } Logger.getBeats = function (attacker, defender) { return attacker.role.title + attacker.name + (attacker.weapon.name? '用' + attacker.weapon.name: '') + '攻击了' + defender.role.title + defender.name + ', '; }; Logger.getDetails = function (att...
flame: attacker.name + '受到' + extra.damage + '点火焰伤害, ' + attacker.name + '剩余生命:' + attacker.life, frozen: attacker.name + '冻得直哆嗦, 没有击中' + defender.name, faint: attacker.name + '晕倒了, 无法攻击, 眩晕还剩:' + --extra.remain + '轮'
<|file_name|>E0067.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. //<|fim▁hole|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://...
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
<|file_name|>sm.py<|end_file_name|><|fim▁begin|># ./darwinpush/xb/raw/sm.py # -*- coding: utf-8 -*- # PyXB bindings for NM:8eb48f8f0e727f488907a816c69d6ed98ba221c7 # Generated 2015-04-23 16:42:14.513978 by PyXB version 1.2.4 using Python 3.4.1.final.0 # Namespace http://www.thalesgroup.com/rtti/PushPort/StationMessages...
_ExpandedName = None _XSDLocation = pyxb.utils.utility.Location('/home/gberg/code/src/fstr/darwinpush/xsd/rttiPPTStationMessages_v1.xsd', 98, 2)
<|file_name|>serde.rs<|end_file_name|><|fim▁begin|>use std::convert::TryFrom; use serde::ser::{ Serialize, SerializeMap, SerializeSeq, SerializeStruct, SerializeStructVariant, SerializeTuple, SerializeTupleStruct, SerializeTupleVariant, Serializer, }; use crate::bson::{Array, Bson, Document, TimeStamp, UtcDat...
#[inline] fn serialize_char(self, value: char) -> EncoderResult<Bson> {
<|file_name|>itemgroup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part ...
from item import Item, Items
<|file_name|>wmi.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2009 SpringSource, Inc. * Copyright (c) 2009 VMware, 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 * * ...
{
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import copy from django.db.models.fields.related import ForeignKey, OneToOneField from rest_framework import mixins from rest_framework.generics import ( GenericAPIView, ListAPIView, ListCreateAPIView, RetrieveAPIView, RetrieveUpdateDestroyAPIView ) from api....
return ()
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>""" Django settings for infoneige project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths insi...
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', )
<|file_name|>verify_project.rs<|end_file_name|><|fim▁begin|>use crate::command_prelude::*; use std::collections::HashMap; use std::process; use cargo::print_json; pub fn cli() -> App { subcommand("verify-project") .about("Check correctness of crate manifest") .arg(opt("quiet", "No output printed ...
<|file_name|>tinyurl.py<|end_file_name|><|fim▁begin|>from ..base import BaseShortener from ..exceptions import ShorteningErrorException class Shortener(BaseShortener): """ TinyURL.com shortener implementation Example: >>> import pyshorteners >>> s = pyshorteners.Shortener() >>> s...
Returns: A string containing the shortened URL Raises:
<|file_name|>page-loader.ts<|end_file_name|><|fim▁begin|>/** * A function that loads an explicit page of results, given an ordinal page * number. */ export interface PageRequest<T> { (page: number): Promise<T[]>; } /** * A function that loads a page of results where the pagination is determined by * an optional...
<|file_name|>post_example_novel.py<|end_file_name|><|fim▁begin|>import argparse from nltk.corpus import brown import requests import arrow import json parser = argparse.ArgumentParser() parser.add_argument('host') args = parser.parse_args() def create_new_novel(): url = 'http://{host}/api/novel'.format(host=args...
<|file_name|>esup_activ_bo.ts<|end_file_name|><|fim▁begin|>'use strict'; import * as _ from 'lodash'; import * as fs from 'fs'; import * as xml2js from 'xml2js'; import * as Mustache from 'mustache'; import * as helpers from './helpers'; import * as utils from './utils'; import * as conf from './conf'; const parseStr...
async function _getCode(hashInfToValidate: Dictionary<string>): Promise<string> {
<|file_name|>dht.go<|end_file_name|><|fim▁begin|>package commands import ( "bytes" "errors" "fmt" "io" "time" key "github.com/ipfs/go-ipfs/blocks/key" cmds "github.com/ipfs/go-ipfs/commands" notif "github.com/ipfs/go-ipfs/notifications" path "github.com/ipfs/go-ipfs/path" ipdht "github.com/ipfs/go-ipfs/rout...
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>// Generated on 2014-11-07 using generator-angular 0.9.8 'use strict'; // # Globbing // for performance reasons we're only matching one level down: // 'test/spec/{,*/}*.js' // use this if you want to recursively match all subfolders: // 'test/spec/**/*.js' module...
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>fn main() { let mut total: i32 = 0; for i in 3..1000 { if (i % 3 == 0) || (i % 5 == 0) { total += i; } } println!("{}", total);<|fim▁hole|>}<|fim▁end|>
<|file_name|>stringLiteralTypesInImplementationSignatures2.ts<|end_file_name|><|fim▁begin|>// String literal types are only valid in overload signatures function foo(x: any);<|fim▁hole|>function foo(x: 'hi') { } class C { foo(x: string); foo(x: 'hi') { } } interface I { (x: 'a'); (x: 'hi'); foo(x...
<|file_name|>coot_utils_adapter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Allows functions from coot_utils to be imported""" # Copyright 2011, 2012 Kevin Keating # # Licensed under the Educational Community License, Version 2.0 (the # "License"); you may not use this file except in compliance with the ...
# or implied. See the License for the specific language governing
<|file_name|>HCStateMachine.java<|end_file_name|><|fim▁begin|>/* * TODO: license */ package ca.mbabic.headphonecontroller.statemachine; import java.lang.Thread.State; import java.util.concurrent.Semaphore; import android.util.Log; import ca.mbabic.headphonecontroller.services.MediaButtonListenerService; ...
<|file_name|>webpack.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp'); var g = require('gulp-load-plugins')({lazy: false}); var config = require('../config'); gulp.task('webpack', function () { g.webpack(config.webpack) .pipe(gulp.dest(config.js.dest)); }); <|fim▁hole|>gulp.task('webpack-dev', fu...
<|file_name|>_token.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators class TokenValidator(_plotly_utils.basevalidators.StringValidator):<|fim▁hole|> plotly_name=plotly_name, parent_name=parent_name, edit_type=kwargs.pop("edit_type", "calc"), no_blank=k...
def __init__(self, plotly_name="token", parent_name="area.stream", **kwargs): super(TokenValidator, self).__init__(
<|file_name|>sx1272LoraRegisters.go<|end_file_name|><|fim▁begin|>package sx1272 const ( SX1272_REG_LR_FIFO byte = 0x00 // Common settings SX1272_REG_LR_OPMODE = 0x01 SX1272_REG_LR_FRFMSB = 0x06 SX1272_REG_LR_FRFMID = 0x07 SX1272_REG_LR_FRFLSB = 0x08 // Tx settings SX1272_REG_LR_PACONFIG = 0x09 SX1272_REG_LR_P...
// Additional settings SX1272_REG_LR_AGCREF = 0x43 SX1272_REG_LR_AGCTHRESH1 = 0x44
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate log; extern crate env_logger; extern crate futures; extern crate getopts; extern crate librespot; extern crate tokio_core; extern crate tokio_signal; use env_logger::LogBuilder; use futures::{Future, Async, Poll, Stream}; use std::env; use std...
let audio_filter = mixer.get_audio_filter(); let backend = self.backend;
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] extern crate libc; pub mod hello; use hello::dval; <|fim▁hole|> #[test] fn test_dval() { let d = dval(5); assert_eq!(d, 10); }<|fim▁end|>
pub fn blah() { let _result = dval(5); }
<|file_name|>SkipLimitExceededException.java<|end_file_name|><|fim▁begin|>/** * */ package com.github.nicosensei.batch.elasticsearch; import org.apache.log4j.Level; <|fim▁hole|> /** * @author nicolas * */ public class SkipLimitExceededException extends BatchException { /** * */ private static final long ...
import com.github.nicosensei.batch.BatchException;
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>''' Scheduler essential class ''' import types, socket # vim: ft=python ts=4 sw=4 sta et sts=4 ai: job_state = ['waiting','running','error','finished'] queue_state = ['active', 'hold'] host_state = ['up', 'down', 'error'] class BaseScheduler(object) : ''' ...
<|file_name|>state.py<|end_file_name|><|fim▁begin|>"""Dirac notation for states.""" from __future__ import print_function, division from sympy import (cacheit, conjugate, Expr, Function, integrate, oo, sqrt, Tuple) from sympy.core.compatibility import range from sympy.printing.pretty.stringpict imp...
>>> n = 1 >>> L = 1
<|file_name|>sjisprober.rs<|end_file_name|><|fim▁begin|>use std::ops::Deref; use std::ops::DerefMut; use super::enums::MachineState; use super::mbcharsetprober::MultiByteCharsetProber; use super::charsetprober::CharsetProber; use super::enums::ProbingState; use super::codingstatemachine::CodingStateMachine; use super::...
m_context_analyzer: SJISContextAnalysis, } impl<'x> Deref for SJISProber<'x> {
<|file_name|>bytes.rs<|end_file_name|><|fim▁begin|>// These are tests specifically crafted for regexes that can match arbitrary // bytes. // A silly wrapper to make it possible to write and match raw bytes. struct R<'a>(&'a [u8]); impl<'a> R<'a> { fn as_bytes(&self) -> &'a [u8] { self.0 } } mat!(word_...
r"(?-u)^\xf7|4\xff\d\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a##########[] d\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a##########\[] #####\x80\S7|$",
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export {VotesComponent} from './votes.component.ts'; export {VoteComponent} from './vote.component.ts'; export {VoteService} from './vote.service.ts'; export {Vote} from './vote.ts';<|fim▁end|>
<|file_name|>test_day_of_nth_weekday.py<|end_file_name|><|fim▁begin|>import pytest from named_dates.named_dates import\ day_of_nth_weekday, NoNthWeekdayError # For reference throughout these tests, October 1, 2015 is # a Thursday (weekday = 3). def test_weekday_equals_first_of_month(): # Tests that day_of_nt...
<|file_name|>hidden-line.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. //<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apa...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2016 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).<|fim▁hole|><|fim▁end|>
from . import models
<|file_name|>gobgp.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go. DO NOT EDIT. // source: gobgp.proto /* Package gobgpapi is a generated protocol buffer package. It is generated from these files: gobgp.proto It has these top-level messages: GetNeighborRequest GetNeighborResponse Arguments...
Family uint32 `protobuf:"varint,2,opt,name=family" json:"family,omitempty"` Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` }
<|file_name|>johab.py<|end_file_name|><|fim▁begin|># # johab.py: Python Unicode Codec for JOHAB # # Written by Hye-Shik Chang <perky@FreeBSD.org><|fim▁hole|>import _multibytecodec as mbc codec = _codecs_kr.getcodec('johab') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class Incremen...
# import _codecs_kr, codecs
<|file_name|>variadicTuples1.js<|end_file_name|><|fim▁begin|>//// [variadicTuples1.ts] // Variadics in tuple types type TV0<T extends unknown[]> = [string, ...T]; type TV1<T extends unknown[]> = [string, ...T, number]; type TV2<T extends unknown[]> = [string, ...T, number, ...T]; type TV3<T extends unknown[]> = [stri...
ft(['a', 'b'], ['c', 'd']);
<|file_name|>pwm3.rs<|end_file_name|><|fim▁begin|>//! Output a PWM with a duty cycle of ~6% on all the channels of TIM3 #![deny(warnings)] #![feature(const_fn)] #![feature(used)] #![no_std] extern crate blue_pill; extern crate embedded_hal as hal;<|fim▁hole|> // version = "0.2.3" extern crate cortex_m_rt; // versio...
<|file_name|>from_form.rs<|end_file_name|><|fim▁begin|>use request::FormItems; /// Trait to create an instance of some type from an HTTP form. The /// [Form](struct.Form.html) type requires that its generic parameter implements /// this trait. /// /// This trait can be automatically derived via the /// [rocket_codegen...
/// cannot be parsed. fn from_form_items(form_items: &mut FormItems<'f>) -> Result<Self, Self::Error>;
<|file_name|>rustc.rs<|end_file_name|><|fim▁begin|>use std::path::Path; use util::{self, CargoResult, internal, ChainError}; pub struct Rustc { pub verbose_version: String, pub host: String, pub cap_lints: bool, } impl Rustc { /// Run the compiler at `path` to learn varioues pieces of information abo...
Ok(ret)
<|file_name|>is.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.<|fim▁hole|> toolbar: 'Prenta' } );<|fim▁end|>
For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'print', 'is', {
<|file_name|>AreaChartBuilderService.java<|end_file_name|><|fim▁begin|>package com.kodcu.service.extension.chart; import com.kodcu.controller.ApplicationController; import com.kodcu.other.Current; import com.kodcu.service.ThreadService; import javafx.scene.chart.*; import org.springframework.beans.factory.annotation.A...
/** * Created by usta on 31.03.2015.
<|file_name|>capture.rs<|end_file_name|><|fim▁begin|>extern crate rscam; extern crate image; use self::rscam::{Camera, Config}; use self::image::{ ImageBuffer, Rgba, Rgb, Luma, ConvertBuffer, GenericImage }; use std::sync::mpsc::Sender; use std::thread; use std::time; use std::path::Path; pub...
thread::spawn(move || { let frame = image::open(&Path::new(image.as_str())).unwrap();
<|file_name|>user_roles.go<|end_file_name|><|fim▁begin|>// Copyright 2012-2016 Aerospike, Inc. // // Portions may be licensed to Aerospike, Inc. under one or more contributor // license agreements. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance wi...
Roles []string
<|file_name|>build.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/. */ #[macro_use] extern crate lazy_static; #[cfg(feature = "bindgen...
match entry.path().extension().and_then(|e| e.to_str()) { Some("mako") | Some("rs") | Some("py") | Some("zip") => { println!("cargo:rerun-if-changed={}", entry.path().display());
<|file_name|>ExecutorRouteLFU.java<|end_file_name|><|fim▁begin|>package com.xxl.job.admin.core.route.strategy; import com.xxl.job.admin.core.route.ExecutorRouter; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.biz.model.TriggerParam; import java.util.*; import java.util.concurrent.ConcurrentHashMa...
public int compare(Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2) { return o1.getValue().compareTo(o2.getValue());
<|file_name|>test_basic.py<|end_file_name|><|fim▁begin|>from amqpstorm.management import ManagementApi from amqpstorm.message import Message from amqpstorm.tests import HTTP_URL from amqpstorm.tests import PASSWORD from amqpstorm.tests import USERNAME from amqpstorm.tests.functional.utility import TestFunctionalFramewo...
# Make sure the message was re-queued. self.assertTrue(api.basic.get(self.queue_name, requeue=False))
<|file_name|>structured.go<|end_file_name|><|fim▁begin|>package test import ( cryptoTest "github.com/tidepool-org/platform/crypto/test" imageStoreStructured "github.com/tidepool-org/platform/image/store/structured" imageTest "github.com/tidepool-org/platform/image/test" "github.com/tidepool-org/platform/pointer" ...
)
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin from eventex.core.models import Talk from eventex.core.models import Course from eventex.core.models import Speaker from eventex.core.models import Contact class ContactInline(admin.TabularInline): model = Contact extra = 1 ...
phone.short_description = 'Telefone'
<|file_name|>writer_test.go<|end_file_name|><|fim▁begin|>package gar import ( "archive/tar" "bytes" "io" "testing" ) func TestWriter(t *testing.T) { // Files used for testing. var files = []struct { Name, Body string }{ {"readme.txt", "This archive contains some text files."}, {"gopher.txt", "Gopher name...
hdr, err := tr.Next()
<|file_name|>validate-list-of-email-address-with-filter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import sys import re re_valid_email = re.compile(r'^[-_0-9a-zA-Z]+@[0-9a-zA-Z]+\.[0-9a-zA-Z]{1,3}$') def valid_email(s): return not (re_valid_email.search(s) == None) N = int(raw_input().strip()) A = []<|fi...
for i in range(N): A += [ str(raw_input().strip()) ]
<|file_name|>SHH_WT_models12702.py<|end_file_name|><|fim▁begin|>import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume...
mark=s.place_marker((9719.44, 3094.41, 731.581), (0.7, 0.7, 0.7), 803.065) if "particle_16 geometry" not in marker_sets:
<|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 AdzCoin</source> ...
<location line="+530"/> <source>AdzCoin</source> <translation>AdzCoin</translation> </message>
<|file_name|>variable_handlers.py<|end_file_name|><|fim▁begin|>""" This module provides methods that parse variables into one of the three base level variable types. We map the variable type names to methods that can handle them. Each method consumes a Request object 'rq' as the first positional argument, and does its ...
for name, value in values.items():
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import re from django.conf import settings from django.utils.html import strip_tags import amo from amo.helpers import absolutify from amo.urlresolvers import reverse from amo.utils import urlparams, epoch from tags.models import Tag from versions.compare import vers...
<|file_name|>messageTest.cpp<|end_file_name|><|fim▁begin|>// // VMime library (http://www.vmime.org) // Copyright (C) 2002-2013 Vincent Richard <vincent@vmime.org> // // 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 Fr...
<|file_name|>0013_auto__chg_field_socialaccount_uid__chg_field_socialapp_secret__chg_fie.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration)...
'token': ('django.db.models.fields.TextField', [], {}), 'token_secret': ('django.db.models.fields.TextField', [], {'blank': 'True'}) }
<|file_name|>test_recvline.py<|end_file_name|><|fim▁begin|># -*- test-case-name: twisted.conch.test.test_recvline -*- # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.conch.recvline} and fixtures for testing related functionality. """ import sys, os from twist...
def _assertBuffer(self, lines): receivedLines = str(self.recvlineClient).splitlines() expectedLines = lines + ([''] * (self.HEIGHT - len(lines) - 1))
<|file_name|>tsd.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> return plugins.shell.task([ 'tsd reinstall --clean', 'tsd link', 'tsd rebundle' ]); };<|fim▁end|>
export = function tsd(gulp, plugins) {
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 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...
extern crate syntax; #[macro_use]
<|file_name|>bitcoin_hu.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="hu" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Uro</source> ...
<context>
<|file_name|>oozie_setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under ...
Bundle.objects.get(name=bundle_root.get('name')) except Bundle.DoesNotExist: LOG.info(_("Installing bundle %s") % bundle_root.get('name')) LOG.debug("Bundle definition:\n%s" % bundle_xml)
<|file_name|>garment-intern-note.js<|end_file_name|><|fim▁begin|>var global = require('../../global'); module.exports = function (data, offset) { var items = data.items.map(invoiceNote => { var invoiceItem = invoiceNote.items.map(dataItem => { var _items = dataItem.items.map(item => { ...
pageSize: 'A5', pageOrientation: 'portrait', pageMargins: 20, content: [].concat(header, subHeader, table, subFooter, footer),
<|file_name|>creationdata.py<|end_file_name|><|fim▁begin|># Standard Library from builtins import str import os import zipfile from urllib.parse import quote_plus from urllib.request import urlopen # Third Party Stuff from django import template from django.conf import settings from django.contrib.auth.models import U...
tr_rec = TutorialResource.objects.get(Q(status = 1) | Q(status = 2), tutorial_detail = td, language__name = 'English') return tr_rec.id except:
<|file_name|>celeryconfig.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from datetime import timedelta import os BROKER_URL = 'redis://localhost:6379/0' celery = Celery('EOD_TASKS', broker=BROKER_URL) # Loads settings for Backend to store results of tweets celery.config_from_object('celeryconfig') CELERY_RESULT_BACKE...
# -*- coding: utf-8 -*- from celery import Celery
<|file_name|>su03-bean_counting.js<|end_file_name|><|fim▁begin|>function countBs(string) { return countChar(string, "B"); } function countChar(string, ch) { var counted = 0; for (var i = 0; i < string.length; i++) { if (string.charAt(i) == ch)<|fim▁hole|> console.log(countBs("BBC")); // -> 2 consol...
counted += 1; } return counted; }
<|file_name|>package.py<|end_file_name|><|fim▁begin|>############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, t...
<|file_name|>k2io.py<|end_file_name|><|fim▁begin|>"""Read in lightcurve files.""" import logging import numpy as np import astropy.io.ascii as at def read_single_aperture(filename): """Read in one of AMC's K2 light curves, inputs ------ filename: string should look like EPIC_205030103_xy_...
A flux and uncertainty array for each aperture in the file x_pos, y_pos, qual_flux: arrays
<|file_name|>shift.ts<|end_file_name|><|fim▁begin|>import { Data } from '../models'; export function shift(data: Data): Data { const placement = data.placement; const basePlacement = placement.split(' ')[0]; const shiftVariation = placement.split(' ')[1]; if (shiftVariation) { const { host, target } = dat...
const isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
<|file_name|>io.py<|end_file_name|><|fim▁begin|>from karld.loadump import dump_dicts_to_json_file <|fim▁hole|>from karld.loadump import ensure_dir from karld.loadump import ensure_file_path_dir from karld.loadump import i_get_csv_data from karld.loadump import is_file_csv from karld.loadump import i_get_json_data fro...
<|file_name|>ToolStripButton.java<|end_file_name|><|fim▁begin|>/* * SmartGWT Mobile * Copyright 2008 and beyond, Isomorphic Software, Inc. * * SmartGWT Mobile is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 3 * as published by the Free ...
} } }
<|file_name|>simpletz.cpp<|end_file_name|><|fim▁begin|>// SIMPLETZ.H // © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* Copyright (C) 1997-2013, International Business Machines Corporation and others. All Rights Reserved. * Modification History: * Da...
uint8 dayOfWeek, int32_t millis, UErrorCode & status) const { // Check the month before calling Grego::monthLength(). This // duplicates the test that occurs in the 7-argument getOffset(),
<|file_name|>mobile_uploader.py<|end_file_name|><|fim▁begin|># Copyright 2021 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/LICENSE-2.0 # ...
if len(destination_metadata) >=4 and len(destination_metadata[3]) > 0: app_id = destination_metadata[3]
<|file_name|>builder.rs<|end_file_name|><|fim▁begin|>use std::default::Default; use errors::*; use feed::{Feed, Author, Attachment}; use item::{Content, Item}; /// Feed Builder /// /// This is used to programmatically build up a Feed object, /// which can be serialized later into a JSON string pub struct Builder(Feed...