prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>preprocess_data.py<|end_file_name|><|fim▁begin|># Adapted from: https://github.com/sussexwearlab/DeepConvLSTM __author__ = 'fjordonez, gchevalier' from signal_filtering import filter_opportunity_datasets_accelerometers import os import zipfile import argparse import numpy as np import cPickle as cp from...
args = parser.parse_args() # Assign args to variables
<|file_name|>draft-converter.js<|end_file_name|><|fim▁begin|>// Modified from https://github.com/dburrows/draft-js-basic-html-editor/blob/master/src/utils/draftRawToHtml.js 'use strict'; import { List } from 'immutable'; import * as InlineStylesProcessor from './inline-styles-processor'; import ApiDataInstance from '....
'header-one': `<h1>%content%</h1>`, 'header-two': `<h2>%content%</h2>`, 'header-three': `<h3>%content%</h3>`,
<|file_name|>runtests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # https://github.com/swistakm/django-rest-framework/blob/master/rest_framework/runtests/runtests.py import os import sys # fix sys path so we don't need to setup PYTHONPATH sys.path.append(os.path.join(os.path.dirname(...
return """ Usage: python runtests.py [UnitTestClass].[method]
<|file_name|>Utils.py<|end_file_name|><|fim▁begin|>import os <|fim▁hole|> exec(compile(open(filename).read(), filename, 'exec'))<|fim▁end|>
def run(name='test1.py'): filename = os.getcwd() + name
<|file_name|>const-block-item.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.or...
}; static BLOCK_FN_DEF: fn(usize) -> usize = {
<|file_name|>graphql-query.go<|end_file_name|><|fim▁begin|>/* * EliasDB * * Copyright 2016 Matthias Ladkau. All rights reserved. * * 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://mozil...
gqlquery["operationName"] = operationName }
<|file_name|>parser.py<|end_file_name|><|fim▁begin|># Copyright (C) 2010, 2011 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above...
conditions.append(trimmed[4:]) elif line.startswith('#endif') and conditions: conditions.pop()
<|file_name|>CanvasOGL.cpp<|end_file_name|><|fim▁begin|>/* Copyright (C) 2013-2014 by Kristina Simpson <sweet.kristas@gmail.com> This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permissi...
<|file_name|>EXTEND_Creep.js<|end_file_name|><|fim▁begin|>Creep.prototype.report = function(){ this.say(this.test_carryPercent().toFixed(1) + '%') } Creep.prototype.test_carryPercent = function(){ return (100*(_.sum(this.carry)/this.carryCapacity)) } Creep.prototype.test_energyPercent = function(){ retur...
<|file_name|>CacheManager.java<|end_file_name|><|fim▁begin|>/** * Copyright (C) 2015 The Gravitee team (http://gravitee.io) * * 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<|fim▁hole|> * ...
* * http://www.apache.org/licenses/LICENSE-2.0
<|file_name|>exer08.py<|end_file_name|><|fim▁begin|># Faça um Programa que pergunte quanto você ganha por hora # e o número de horas trabalhadas no mês. Calcule e mostre o # total do seu salário no referido mês. salarioXhoras = float(input('Quanto voce ganha por hora? ')) horas = float(input('Quantas horas trabalhadas...
print('Voce ganhará %2.f de salario esse mes' %(salario))
<|file_name|>file_metadata.py<|end_file_name|><|fim▁begin|><|fim▁hole|> from client.constants import FieldKeyword from metadata import Metadata class FileUrlMetadata(Metadata): def get_title(self, soup): image_url = self.prop_map[FieldKeyword.URL] return image_url.split('/')[-1] def get_file...
import collections
<|file_name|>sam_to_fastq.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.7 import sys for line in open(sys.argv[1]): cut=line.split('\t') if len(cut)<11: continue print ">"+cut[0] print cut[9]<|fim▁hole|><|fim▁end|>
print "+" print cut[10]
<|file_name|>davsturns.py<|end_file_name|><|fim▁begin|># da vs turns module import numpy as np from scipy import optimize import matplotlib.pyplot as pl import glob, sys, os, time from deskdb import SixDeskDB,tune_dir,mk_dir import matplotlib # ------------- basic functions ----------- def get_divisors(n): """finds t...
print('Error in RunDaVsTurns: turnstep must be integer values!') sys.exit(0)
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|>from django.test import SimpleTestCase class MaintenanceModeTestCase(SimpleTestCase): def test_maintenance_mode_enabled_home_page(self): with self.settings(MAINTENANCE_MODE=True): response = self.client.get("/", follow=True) s...
self.assertEqual(("http://testserver/", 302), response.redirect_chain[0]) self.assertNotIn("This service is down for maintenance", response.content)
<|file_name|>iri2uri.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """Converts an IRI to a URI.""" __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright 2006, Joe Gregorio"<|fim▁hole|>import urllib.parse # Convert an IRI to a URI following the rules in RFC 3987 # # The characters we ne...
__contributors__ = [] __version__ = "1.0.0" __license__ = "MIT"
<|file_name|>PrevioLex.java<|end_file_name|><|fim▁begin|>/* The following code was generated by JFlex 1.6.1 */ package com.jim_project.interprete.parser.previo; import com.jim_project.interprete.parser.AnalizadorLexico; /** * This class is a scanner generated by * <a href="http://www.jflex.de/">JFlex</a> 1.6.1 ...
/* numRead < 0 ==> end of stream */ return true;
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import sys import glob import numpy try: from setuptools import setup from setuptools import Extension except ImportError: from distutils.core import setup from distutils.extension import Extension # # Force `setup_requires` stuff like Cython to be ins...
cmdclass = {'build_ext': build_ext},
<|file_name|>treemap.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/license...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use chrono::{offset::Utc, DateTime}; use diesel::{self, pg::PgConnection}; mod password; use self::password::Password; pub use self::password::{ CreationError as PasswordCreationError, PlaintextPassword, ValidationError, VerificationError, }; use schema::local_auth...
fn create_local_auth() { with_connection(|conn| { with_unverified_user(conn, |user| { let password = "testpass";
<|file_name|>json.d.ts<|end_file_name|><|fim▁begin|>/// <reference path="../_import/_fibjs.d.ts" /> /** * @description json 编码与解码模块 * 引用方式:<|fim▁hole|> * ```JavaScript * var encoding = require('encoding'); * var json = encoding.json; * ``` * 或者 * ```JavaScript * var json = require('json'); * ``` * ...
<|file_name|>pkcs7.py<|end_file_name|><|fim▁begin|>import binascii import StringIO class PKCS7Encoder(object): ''' RFC 2315: PKCS#7 page 21 Some content-encryption algorithms assume the input length is a multiple of k octets, where k > 1, and let the application define a method for handling inputs ...
k k ... k k -- if l mod k = 0
<|file_name|>Ice.cpp<|end_file_name|><|fim▁begin|>// // Ice.cpp // Alchemy // // Created by Kyounghwan on 2014. 3. 1.. // 1206 Ice 2 - - 30 1 sq. - 마법 Slow 50% 확률로 3초간 Slow. 1102 1101 1 // #include "Ice.h" /* ALCHEMY PARAMETER */ #define DEFAULT_INDEX 0 #define LOOP 0 #define TWEEN_EASING_MAX_INDEX ...
{ Monster* obj; obj = m_pCollision->m_monsters_matrix[idx_x][i]; if(tower_box.intersectsRect(obj->getBoundingBox()))
<|file_name|>test_cfunctions.py<|end_file_name|><|fim▁begin|>from sympy import symbols, Symbol, exp, log, pi, Rational, S from sympy.codegen.cfunctions import ( expm1, log1p, exp2, log2, fma, log10, Sqrt, Cbrt, hypot ) from sympy.core.function import expand_log def test_expm1(): # Eval assert expm1(0) == ...
<|file_name|>sv.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="sv" version="2.1"> <context> <name>AboutDialog</name> <message> <source>About LMMS</source> <translation>Om LMMS</translation> </message> <message> <source>Version %1 (%2/%3, Qt %4, %...
<|file_name|>filter_operators.py<|end_file_name|><|fim▁begin|><|fim▁hole|>IN = 'in' OPERATOR_SEPARATOR = '__' REVERSE_ORDER = '-' ALL_OPERATORS = {EQUALS: 1, GT: 1, LT: 1, IN: 1} def split_to_field_and_filter_type(filter_name): filter_split = filter_name.split(OPERATOR_SEPARATOR) filter_type = filter_split[...
EQUALS = 'equals' GT = 'gt' LT = 'lt'
<|file_name|>kmpd.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Downloads kernel from http://kernel.ubuntu.com/~kernel-ppa/mainline/ # Requires: python-bs4 # Copyright (c) 2012 Savvas Radevic <vicedar@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
kernels.append(previous_href) if selk == -1: print "0 UPDATES" print rel
<|file_name|>morestack-address.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modifi...
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. //
<|file_name|>openbsd_pkg.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Patrik Lundin <patrik@sigterm.se> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__...
<|file_name|>rpcmining.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "main.h" #include "db....
<|file_name|>concordance.py<|end_file_name|><|fim▁begin|># System """Concordance Checking.""" import logging import os import functools # Third Party from sklearn.cluster import MiniBatchKMeans from scipy.stats import ks_2samp import numpy as np import pandas as pd # First Party from submission_criteria import common...
clusters = get_competition_variables(tournament, round_number, filemanager) P1, P2, P3 = get_submission_pieces(submission["submission_id"], tournament, round_number, db_manager, filemanager)
<|file_name|>OpenGLLayer.cpp<|end_file_name|><|fim▁begin|>#include <algorithm> #include <iostream> #include "RustyFist/DrawMe.h" #include "RustyFist/TouchSink.h" #include "OpenGLLayer.h" using namespace cocos2d; using namespace std; <|fim▁hole|>OpenGLLayer::~OpenGLLayer() { } bool OpenGLLayer::init() { return Layer:...
OpenGLLayer::OpenGLLayer() { }
<|file_name|>IndentOnTopLevel.after.py<|end_file_name|><|fim▁begin|>class C: def foo(self): x = 1 y = 2 x = 1<|fim▁hole|> pass<|fim▁end|>
def foo():
<|file_name|>timer.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/...
}; assert_eq!(rx.recv_opt(), Err(())); })
<|file_name|>game.js<|end_file_name|><|fim▁begin|>var score = 0; var scoreText; var map_x = 14; var map_y = 10; var game = new Phaser.Game(map_x * 16, map_y * 16, Phaser.AUTO, '', { preload: preload, create: create, update: update }); function preload() { // game.scale.maxWidth = 600; // game.scale.maxHeight...
} }
<|file_name|>arithmetic_ast.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate nom; use std::fmt; use std::fmt::{Display, Debug, Formatter}; use std::str; use std::str::FromStr; use nom::{IResult, digit, multispace}; pub enum Expr { Value(i64), Add(Box<Expr>, Box<Expr>), Sub(Box<Expr>, Box<Expr>)...
} pub enum Oper { Add,
<|file_name|>validate-changelog.ts<|end_file_name|><|fim▁begin|>#!/usr/bin/env ts-node import * as Path from 'path' import * as Fs from 'fs' import Ajv, { ErrorObject } from 'ajv' function handleError(error: string) { console.error(error) process.exit(-1) } function formatErrors(errors: ErrorObject[]): string {...
let additionalPropertyText = '' if (additionalProperty != null) {
<|file_name|>_error.route.ts<|end_file_name|><|fim▁begin|><%# Copyright 2013-2017 the original author or authors from the JHipster project. This file is part of the JHipster project, see https://jhipster.github.io/ for more information. Licensed under the Apache License, Version 2.0 (the "License"); you may not ...
<|file_name|>tree_test.go<|end_file_name|><|fim▁begin|>// Copyright 2019 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package repofiles import ( "testing" "code.gitea.io/gitea/models" api "code.gitea.io/gitea/module...
}, }, Truncated: false, Page: 1,
<|file_name|>Transactions.js<|end_file_name|><|fim▁begin|>/** * SIP Transactions module. */ (function(JsSIP) { var C = { // Transaction states STATUS_TRYING: 1, STATUS_PROCEEDING: 2, STATUS_CALLING: 3, STATUS_ACCEPTED: 4, STATUS_COMPLETED: 5, STATUS_TERMINATED: 6, STATUS_CO...
via += ' ' + request_sender.ua.configuration.via_host + ';branch=' + this.id; this.request.setHeader('via', via);
<|file_name|>p3.rs<|end_file_name|><|fim▁begin|>//! Find the k'th element of a list. (easy) ///# example ///``` ///use p99::p3::at; ///assert_eq!(at(3, &['a','b','c','d']), Some('c')); ///assert_eq!(at(3, &['a','b',]), None) ///``` pub fn at<T: Copy>(k: usize, list: &[T]) -> Option<T> { if list.len() >= k {<|fim▁h...
Some(list[k - 1]) } else {
<|file_name|>add_poem.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 """ Copyright 2015 Stefano Benvenuti <ste.benve86@gmail.com> 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:/...
Unless required by applicable law or agreed to in writing, software
<|file_name|>wall.js<|end_file_name|><|fim▁begin|>var icms = icms || {}; icms.wall = (function ($) { var self = this; this.add = function (parent_id) { var form = $('#wall_add_form'); if (typeof (parent_id) === 'undefined') { parent_id = 0; } $('#wall_widget #wa...
this.error = function(message){
<|file_name|>GetEmailStage.java<|end_file_name|><|fim▁begin|>package fi.helsinki.cs.okkopa.main.stage; import fi.helsinki.cs.okkopa.mail.read.EmailRead; import fi.helsinki.cs.okkopa.main.ExceptionLogger; import java.io.IOException; import java.io.InputStream;<|fim▁hole|>import javax.mail.MessagingException; import org...
import java.util.List; import javax.mail.Message;
<|file_name|>Calc_Angle.py<|end_file_name|><|fim▁begin|>""" MUSE -- A Multi-algorithm-collaborative Universal Structure-prediction Environment Copyright (C) 2010-2017 by Zhong-Li Liu This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as pu...
angle = np.arccos(angle)*180/math.pi
<|file_name|>match-implicit-copy-unique.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www...
// pretty-expanded FIXME #23616
<|file_name|>sysctl.py<|end_file_name|><|fim▁begin|>""" Linux kernel system control from Python.<|fim▁hole|><|fim▁end|>
"""
<|file_name|>network-task.js<|end_file_name|><|fim▁begin|>'use strict'; /** * Expose 'NetworkTask' */ module.exports = NetworkTask; /** * Module dependencies */ var networkObject = require('./network-object'); var readLine = require('readline'); var childProcess = require('child_process'); /** * Constants */ ...
if(tRes){
<|file_name|>KernelProxy.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2002-2018 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero Gen...
private static ObjectName createObjectName( String domain, Hashtable<String, String> properties, String beanName,
<|file_name|>regexs.rs<|end_file_name|><|fim▁begin|>extern crate regex; use self::regex::Regex; pub fn demo_regex() {<|fim▁hole|> let haystack = r#"regex = "0.2.5""#; let captures = semver.captures(haystack) .ok_or("semver regex should have matched").unwrap(); println!("regex captures...
let semver = Regex::new(r"(\d+)\.(\d+)\.(\d+)(-[-.[:alnum:]]*)?").unwrap();
<|file_name|>errors.py<|end_file_name|><|fim▁begin|>""" This module implements Exception classes<|fim▁hole|>class Error(StandardError): """ Base class for all driver error exceptions """ def __init__(self, err_id = None, err_msg = None): self._err_id = err_id or -1 self._err_msg = err_m...
http://www.python.org/dev/peps/pep-0249/ """
<|file_name|>Tests.py<|end_file_name|><|fim▁begin|># BridgeDB by Nick Mathewson. # Copyright (c) 2007-2009, The Tor Project, Inc. # See LICENSE for licensing information from __future__ import print_function import doctest import os import random import sqlite3 import tempfile import unittest import warnings import t...
for b in running: assert b not in expired
<|file_name|>cfgconstants.go<|end_file_name|><|fim▁begin|>package securenet const ( // PSPName .. PSPName string = "securenet" // CfgDeveloperID .. CfgDeveloperID string = "developer_id" // CfgPublicKey .. CfgPublicKey string = "public_key" // CfgSecureKey .. CfgSecureKey string = "secure_key" // CfgSecureNet...
CfgAppVersion string = "app_version" // CfgAPIEndpoint .. CfgAPIEndpoint string = "api_endpoint" // CfgHTTPProxy ..
<|file_name|>mutex.pass.cpp<|end_file_name|><|fim▁begin|>//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for ...
time_point t0 = Clock::now(); time_point t1; {
<|file_name|>_agent_pools_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 information. # Co...
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals import datetime import pytz import six ISO8601_DATE_FORMAT = '%Y-%m-%d' ISO8601_DATETIME_FORMAT = ISO8601_DATE_FORMAT + 'T' + '%H:%M:%S' def parse_iso8601(value): """ Parses a datetime as a UTC ISO86...
_format = ISO8601_DATETIME_FORMAT
<|file_name|>dogecall_test.go<|end_file_name|><|fim▁begin|>package main import ( "testing" ) func TestCheckPhoneNumber(t *testing.T) { numbers := []string{ "07700900390", "+447700900497", "202-555-0188",<|fim▁hole|> } for _, number := range numbers { check := checkNumber(number) if check != true { t....
"+1-202-555-0188",
<|file_name|>information.js<|end_file_name|><|fim▁begin|>/* http://fiidmi.fi/documentation/customer_order_history */ module.exports = { "bonus": { "type": "object", "properties": { "session_id": { "type": "string", "minLength": 2, "maxLength": 50 }, "restaurant_id": { "type": "string", "minLength"...
"session_id": { "type": "string", "minLength": 2, "maxLength": 50 }
<|file_name|>strategy_test.go<|end_file_name|><|fim▁begin|>/* Copyright 2019 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 ...
Spec: storage.CSIDriverSpec{ AttachRequired: &enabled, PodInfoOnMount: &enabled,
<|file_name|>JsonSimpleOrderedTest.java<|end_file_name|><|fim▁begin|>/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to Y...
<|file_name|>pages.module.js<|end_file_name|><|fim▁begin|>/** * Created by zura on 9/27/2016. */ (function () { 'use strict'; angular .module('app.pages', [ 'app.pages.auth.login' ]) .config(Config); /** @ngInject */ function Config(){ <|fim▁hole|><|fim▁end|>
} })();
<|file_name|>starter.py<|end_file_name|><|fim▁begin|>""" RESTx: Sane, simple and effective data publishing and integration. Copyright (C) 2010 MuleSoft Inc. http://www.mulesoft.com This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as publi...
import restx.logger as logger
<|file_name|>YoutubeBatch.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ 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 (at your opti...
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate nemo; #[macro_use] extern crate clap; extern crate bounded_spsc_queue as queue; use std::io::{stdin, stdout, Write}; use std::cell::RefCell; use std::sync::{Arc, Mutex}; use std::io; use std::io::prelude::*; use std::fs::File; use std::thread; use clap::{Ar...
fn main() { let matches = App::new("nemo") .version(crate_version!()) .author("Matthew S. <stanleybookowl@gmail.com>")
<|file_name|>imgt2fasta.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # Copyright 2014 Uri Laserson # # 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...
import vdj
<|file_name|>panel.js<|end_file_name|><|fim▁begin|>define('controllers/panel',['require','jquery','backbone','utils/metrics','utils/browser','utils/video-player','utils/pubsub','controllers/panel-display'],function(require) { var $ = require('jquery'), Backbone = require('backbone'), Metrics = requi...
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian // Licensed under the MIT License <LICENSE.md> fn main() {<|fim▁hole|>}<|fim▁end|>
println!("cargo:rustc-flags=-l thunk32");
<|file_name|>hsts.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 net::hsts::{HstsEntry, HstsList}; use net_traits::IncludeSu...
<|file_name|>fontconfig.py<|end_file_name|><|fim▁begin|>from _external import *<|fim▁hole|><|fim▁end|>
fontconfig = LibWithHeaderChecker('fontconfig', 'fontconfig/fontconfig.h', 'c')
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
export default function isNull(x) { return x === null; }
<|file_name|>noise_image.rs<|end_file_name|><|fim▁begin|>use crate::utils::color_gradient::Color; #[cfg(feature = "image")] use std::{self, path::Path}; const RASTER_MAX_WIDTH: u16 = 32_767; const RASTER_MAX_HEIGHT: u16 = 32_767; pub struct NoiseImage { size: (usize, usize), border_color: Color, map: Vec<...
<|file_name|>cython_special.py<|end_file_name|><|fim▁begin|>import re import numpy as np from scipy import special from .common import with_attributes, safe_import with safe_import(): from scipy.special import cython_special FUNC_ARGS = { 'airy_d': (1,), 'airy_D': (1,), 'beta_dd': (0.25, 0.75), ...
<|file_name|>custom.js<|end_file_name|><|fim▁begin|>$(document).ready(function () { console.log("ready!"); $("#subs").click(function () { var name = $('#name').val(); var email = $('#email').val(); if (name != '' && email != '') { $('#subs_err').html(''); var sub...
for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('=');
<|file_name|>rectangles.js<|end_file_name|><|fim▁begin|>// // This is only a SKELETON file for the 'Rectangles' exercise. It's been provided as a // convenience to get you started writing code faster. // export function count() {<|fim▁hole|>}<|fim▁end|>
throw new Error('Remove this statement and implement this function');
<|file_name|>kernel.cpp<|end_file_name|><|fim▁begin|>__global__ void /*{kernel_name}*/(/*{parameters}*/) { int _tid_ = threadIdx.x + blockIdx.x * blockDim.x; if (_tid_ < /*{num_threads}*/) { /*{execution}*/<|fim▁hole|><|fim▁end|>
_result_[_tid_] = /*{block_invocation}*/; } }
<|file_name|>coordinator-setup.js<|end_file_name|><|fim▁begin|>import Coordinator from '../models/coordinator';<|fim▁hole|> initialize: function() { let app = arguments[1] || arguments[0]; app.register("drag:coordinator",Coordinator); app.inject("component","coordinator","drag:coordinator"); } };<|fim▁en...
export default { name: "setup coordinator",
<|file_name|>mysql.py<|end_file_name|><|fim▁begin|>import pymysql from flask_restful import Resource from flask import abort ALLOWED_SHOW = ('processlist', 'databases', 'plugins', 'privileges') class Mysql(Resource): def __init__(self): self.connection = pymysql.connect(user='root') self.cursor =...
abort(400, e.args)
<|file_name|>test.js<|end_file_name|><|fim▁begin|>var assert = require('chai').assert var sendgrid = require('../lib/sendgrid'); describe('test_access_settings_activity_get', function () { this.timeout(30000); var API_KEY = 'SendGrid API Key' if(process.env.TRAVIS) { var TEST_HOST = process.env.MOCK_HOST }...
request.path = '/v3/mail_settings/address_whitelist' request.headers['X-Mock'] = 200 it('test_mail_settings_address_whitelist_get had the correct response code', function(done) {
<|file_name|>widgets.hpp<|end_file_name|><|fim▁begin|>// A shortcut header to get all widgets #include "guiengine/widgets/bubble_widget.hpp" #include "guiengine/widgets/button_widget.hpp" #include "guiengine/widgets/icon_button_widget.hpp" #include "guiengine/widgets/list_widget.hpp" #include "guiengine/widgets/dynami...
<|file_name|>KF.ts<|end_file_name|><|fim▁begin|>import { AccountManager } from "./AccountManager"; import { PersistentTabState } from "./PersistentTabState"; import { jsonrpcClient } from "./jsonrpcClient"; import { ConfigSyncManager } from "./ConfigSyncManager"; import { NetworkAuth } from "./NetworkAuth"; import { An...
resetBrowserActionColor() {
<|file_name|>data_export_script_new.py<|end_file_name|><|fim▁begin|>None #!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import os # simple json is a python 2.5 library you need to install import json # json comes bundled with python 2.6. use one or the other #import json def run(): print "startin...
all_schemas = FormDefModel.objects.filter(domain__name__iexact=domain) else: all_schemas = FormDefModel.objects.all()
<|file_name|>test_code_in_readme.rs<|end_file_name|><|fim▁begin|>use std::{ fs, fs::File, io::{Read, Write}, path::Path, }; use pulldown_cmark::{CodeBlockKind, Event, Parser, Tag}; use flapigen::{CppConfig, Generator, JavaConfig, LanguageConfig}; use tempfile::tempdir; #[test] fn test_code_in_readme()...
.with_pointer_target_width(64); swig_gen.expand("flapigen_test_c++", &rust_path_src, &rust_path_dst); } }
<|file_name|>ReadTimeoutStreamSourceConduit.java<|end_file_name|><|fim▁begin|>/* * JBoss, Home of Professional Open Source. * Copyright 2014 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this fil...
return timeout; }
<|file_name|>train.py<|end_file_name|><|fim▁begin|>from __future__ import division from itertools import chain from sklearn.feature_extraction.text import CountVectorizer import numpy as np import pandas as pd from fisher import pvalue import re import collections from nltk.stem.porter import PorterStemmer import math ...
current_speaker = s[i]['speaker'] lines.append(current_line)
<|file_name|>tee.rs<|end_file_name|><|fim▁begin|>//#![deny(warnings)] extern crate coreutils; use coreutils::ArgParser; use std::{process, env}; use std::io::{self, Read, Write}; const MAN_PAGE: &'static str = /* @MANSTART{tee} */ r#"<|fim▁hole|> tee [OPTION]... [FILE]... DESCRIPTION Copy standard input to e...
NAME tee - read from standard input and write to standard output and files SYNOPSIS
<|file_name|>eye.py<|end_file_name|><|fim▁begin|># Speak.activity # A simple front end to the espeak text-to-speech engine on the XO laptop # http://wiki.laptop.org/go/Speak # # Copyright (C) 2008 Joshua Minor # This file is part of Speak.activity # # Parts of Speak.activity are based on code from Measure.activity # C...
h = math.hypot(EYE_HHEIGHT * cosa, EYE_HWIDTH * sina) x = (EYE_HWIDTH * EYE_HHEIGHT) * cosa / h y = (EYE_HWIDTH * EYE_HHEIGHT) * sina / h
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig class CheckoutAppConfig(AppConfig): name = 'ecommerce.extensions.checkout' verbose_name = 'Checkout' def ready(self): super(CheckoutAppConfig, self).ready() <|fim▁hole|> import ecommerce.extensions.checkout...
# noinspection PyUnresolvedReferences
<|file_name|>call-closure-from-overloaded-op.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or<|fim▁hol...
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed
<|file_name|>mission.js<|end_file_name|><|fim▁begin|>define("view/mission", ["jquery", "laces.tie", "lodash", "view", "tmpl/joboutput", "tmpl/mission"], function($, Laces, _, View, tmpl) { "use strict"; return View.extend({ initialize: function(options) { this.mission = opt...
return this.$el;
<|file_name|>mark_tasks.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # 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 requi...
<|file_name|>deserialize.rs<|end_file_name|><|fim▁begin|>use serde::de::Deserializer; use serde::Deserialize; use std::time::Duration; pub fn deserialize_duration<'de, D>(deserializer: D) -> Result<Duration, D::Error> where D: Deserializer<'de>, { let ms: u64 = Deserialize::deserialize(deserializer)?; Ok(D...
pub fn deserialize_opt_duration<'de, D>(deserializer: D) -> Result<Option<Duration>, D::Error>
<|file_name|>utils.rs<|end_file_name|><|fim▁begin|>//! Various utilities /* use std::old_io::net::ip; /// Convert socket address to bytes in network order. pub fn netaddr_to_netbytes(addr: &ip::SocketAddr) -> Vec<u8> { match addr.ip { ip::Ipv4Addr(a, b, c, d) => vec![a, b, c, d, (addr.port >> ...
) )
<|file_name|>gce_pd_test.go<|end_file_name|><|fim▁begin|>/* Copyright 2014 The Kubernetes 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.org/lice...
plugMgr.InitPlugins(ProbeVolumePlugins(), volume.NewFakeVolumeHost("/tmp/fake", nil, nil)) plug, err := plugMgr.FindPersistentPluginByName("kubernetes.io/gce-pd") if err != nil {
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This software may be used and distributed according to the terms of the * GNU General Public License version 2. */ mod diff; mod iter; mod link; mod namecmp; mod store; #[cfg(any(test, feature = "for-tests...
match child { None => { must_insert = true;
<|file_name|>Nyaa.go<|end_file_name|><|fim▁begin|>package arn import ( "fmt" "regexp" "strings" ) type nyaaAnimeProvider struct{}<|fim▁hole|> // Nyaa anime provider (singleton) var Nyaa = new(nyaaAnimeProvider) var nyaaInvalidCharsRegex = regexp.MustCompile(`[^[:alnum:]!']`) var nyaaTVRegex = regexp.MustCompile(`...
<|file_name|>test_fan.py<|end_file_name|><|fim▁begin|>"""Tests for the Bond fan device.""" from datetime import timedelta from typing import Optional from bond_api import Action, DeviceType, Direction from homeassistant import core from homeassistant.components import fan from homeassistant.components.fan import ( ...
FAN_DOMAIN, SERVICE_TURN_OFF, {ATTR_ENTITY_ID: "fan.name_1"}, blocking=True,
<|file_name|>SummaryParser.java<|end_file_name|><|fim▁begin|>package com.zanghongtu.blog.util; /** * 摘要 */ public class SummaryParser { private static final int SUMMARY_LENGTH = 256; /** * 去除info里content 所有html字符 * 截取字符串长度256 * @param sourceStr 源字符串 * @return 截取后的字符串 */ public sta...
<|file_name|>test_with_rabbitmq.py<|end_file_name|><|fim▁begin|>import os from pymco.test import ctxt from . import base class RabbitMQTestCase(base.IntegrationTestCase): '''RabbitMQ integration test case.''' CTXT = { 'connector': 'rabbitmq', 'plugin.rabbitmq.vhost': '/mcollective', ...
'plugin.rabbitmq.pool.1.user': 'mcollective', 'plugin.rabbitmq.pool.1.password': 'marionette', }
<|file_name|>bg.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
MODX Evolution 1.0.5 = dace793f0e7de11aadc0ecf54e834d93
<|file_name|>kafka_to_mysql.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python ###################################################################### # # File: kafka_to_mysql.py # # Copyright 2015 TiVo Inc. All Rights Reserved. # ###################################################################### """ Usage: kafka_to_...
val = "0000-00-00 00:00:00"