prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>Interface.js<|end_file_name|><|fim▁begin|>/* ************************************************************************
<|fim▁hole|>
http://qooxdoo.org
Copyright:
2004-2008 1&1 Internet AG, Germany, http://www.1und1.de
License:
LGPL: http://www.gnu.org/licenses/lgpl.html
EPL: http:/... | qooxdoo - the new era of web development |
<|file_name|>basic-worker.js<|end_file_name|><|fim▁begin|>'use strict'
const getNamespace = require('continuation-local-storage').getNamespace
const Promise = require('bluebird')
const WorkerStopError = require('error-cat/errors/worker-stop-error')
const Ponos = require('../')
/**
* A simple worker that will publis... | }
const server = new Ponos.Server({
tasks: { |
<|file_name|>parallel_nanmeanGaussWeightedFilterOptimizedSize20.py<|end_file_name|><|fim▁begin|>import sys
sys.path.append("/mnt/moehlc/home/idaf_library")
#import mahotas
import vigra
import libidaf.idafIO as io
import numpy as np
from scipy import ndimage
from scipy.stats import nanmean
#import matplotlib.pyplot as p... | |
<|file_name|>lighthouse-report-viewer.js<|end_file_name|><|fim▁begin|>/**
* @license Copyright 2017 The Lighthouse 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 ht... | * Guaranteed context.querySelector. Always returns an element or throws if
* nothing matches query.
* @param {string} query
* @param {ParentNode} context |
<|file_name|>udp.py<|end_file_name|><|fim▁begin|>'''
Created on 9 jan. 2013
@author: sander
'''
from bitstring import BitStream, ConstBitStream, Bits
from ipaddress import IPv4Address, IPv6Address
from pylisp.packet.ip import protocol_registry
from pylisp.packet.ip.protocol import Protocol
from pylisp.utils import che... |
if lisp_data or only_data: |
<|file_name|>AnalysisWinPIRALog_LINUX.py<|end_file_name|><|fim▁begin|># coding=utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
"""
Name: AnalysisWinPIRALog_LINUX
Author: Andy Liu
Email : andy.liu.ud@hotmail.com
Created: 3/24/2015
Copyright: ... | elif isinstance(_expect_values, dict):
logging.debug('_expect_values is dict')
_key_word = _expect_values.get(self._key_word) |
<|file_name|>menu.component.ts<|end_file_name|><|fim▁begin|>import { Component, Input, Output, EventEmitter } from '@angular/core';
import { EventsService } from '../services/events.service';
import { Game } from '../models/game.model'
import { Store } from '@ngrx/store';
import * as MenuActions from './menu.actions'... |
ngOnInit() { |
<|file_name|>static.test.js<|end_file_name|><|fim▁begin|>import {
findPort,
killApp,
nextBuild,
nextStart,
renderViaHTTP,
File,
waitFor,
} from 'next-test-utils'
import webdriver from 'next-webdriver'
import { join } from 'path'
const appDir = join(__dirname, '../')
let appPort
let app
let browser
let ht... | runTests() |
<|file_name|>update_collector_profile.test.js<|end_file_name|><|fim▁begin|>/* eslint-disable promise/always-return */
import { runAuthenticatedQuery, runQuery } from "schema/v1/test/utils"
describe("UpdateCollectorProfile", () => {
it("updates and returns a collector profile", () => {
/* eslint-disable max-len *... | updateCollectorProfile(input: { professional_buyer: true, loyalty_applicant: true, self_reported_purchases: "trust me i buy art", intents: [BUY_ART_AND_DESIGN] }) {
id
name
email |
<|file_name|>threatfox.py<|end_file_name|><|fim▁begin|>import logging
from datetime import timedelta
from core import Feed
import pandas as pd
from core.observables import Ip, Observable
from core.errors import ObservableValidationError
class ThreatFox(Feed):
default_values = {
"frequency": timedelta(hou... | |
<|file_name|>jquery.thickbox.js<|end_file_name|><|fim▁begin|>/*
* Thickbox 3.1 - One Box To Rule Them All.
* By Cody Lindley (http://www.codylindley.com)
* Copyright (c) 2007 cody lindley
* Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*/
var tb_pathToImage = "images/loadin... | |
<|file_name|>cities.server.routes.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* Module dependencies
*/
var citiesPolicy = require('../policies/cities.server.policy'),
cities = require('../controllers/cities.server.controller');
module.exports = function (app) {<|fim▁hole|> .post(cities.create);
// Sin... | // City collection routes
app.route('/api/cities').all(citiesPolicy.isAllowed)
.get(cities.list) |
<|file_name|>lights.py<|end_file_name|><|fim▁begin|>import logging
import requests
HUE_IP = '192.168.86.32'
HUE_USERNAME = '7KcxItfntdF0DuWV9t0GPMeToEBlvHTgqWNZqxu6'
logger = logging.getLogger('hue')
def getLights():
url = 'http://{0}/api/{1}/lights'.format(HUE_IP, HUE_USERNAME)<|fim▁hole|> logger.error('Fai... |
try:
r = requests.get(url)
except: |
<|file_name|>CWE36_Absolute_Path_Traversal__wchar_t_file_fopen_45.cpp<|end_file_name|><|fim▁begin|>/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE36_Absolute_Path_Traversal__wchar_t_file_fopen_45.cpp
Label Definition File: CWE36_Absolute_Path_Traversal.label.xml
Template File: sources-sink-45.tmpl.cpp
*/
/*
* ... | |
<|file_name|>test_tracking_logger.py<|end_file_name|><|fim▁begin|>import logging
import pytest
def test_tracing_by_function_if_enable(track_logger, handler):
msg1 = 'TEST1'
msg2 = 'TEST2'
msg3 = 'TEST3'
track_logger.setLevel(logging.INFO)
track_logger.enable_tracking()
track_logger.d... | track_logger.info(msg2)
raise Exception
|
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>use std::fs;
use std::path;
use littletest;
use adapter::{Adapter};
pub struct RunOptions<'o> {
pub ignore_todo: bool,
pub engine: Box<Adapter + 'o>
}
pub struct TestCase<'o> {
pub input_path: path::PathBuf,
pub expected_path: path::PathBuf,
pub ... | None => false
}
}
} |
<|file_name|>turbulentIntensityKineticEnergyInletFvPatchScalarField.H<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / ... | class turbulentIntensityKineticEnergyInletFvPatchScalarField
:
public inletOutletFvPatchScalarField |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod eval_functions;
pub mod types;
mod env;
<|fim▁hole|>pub use self::eval_functions::*;
pub use self::env::RollerEnv;<|fim▁end|> | |
<|file_name|>base.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# Copyright (c) 2013, Theo Crevon
# Copyright (c) 2013, Greg Leclercq
#
# See the file LICENSE for copying permission.
from itertools import groupby
from swf.models.event import EventFactory, CompiledEventFactory
from swf.models.event.workflow ... | :rtype : swf.model.event.History |
<|file_name|>interface_c_p_event.js<|end_file_name|><|fim▁begin|>var interface_c_p_event =
[
[ "buttonNumber", "interface_c_p_event.html#a95f060acf8268fe7f3a16c42ea121466", null ],
[ "characters", "interface_c_p_event.html#a1bf8cbf0c017151070a99236c957fc94", null ],
[ "charactersIgnoringModifiers", "interfa... | [ "startPeriodicEventsAfterDelay:withPeriod:", "interface_c_p_event.html#a474ff767ceaf957fbde1a662d01b4788", null ],
[ "stopPeriodicEvents", "interface_c_p_event.html#a5071c8f5ce8fd7d8a08e6ae4756b1d2d", null ],
[ "timestamp", "interface_c_p_event.html#ab290762686ceda8bb462e0e989f62e04", null ], |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'requirements.txt')) as fp:
requires = fp.readlines()
setup(
name='cebulany manager',
version='0.0.4',
classifiers=[... | packages=find_packages(), |
<|file_name|>_virtual_router_peerings_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 infor... | :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2019_09_01.models.VirtualRouterPeeringListResult]
:raises: ~azure.core.exceptions.HttpResponseError
""" |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate hydromath;
#[test]
fn test_rmse() {
let test_obs = &[13., 17., 18., 20., 24.];
let test_sim = &[12., 15., 20., 22., 24.];
let result = hydromath::rmse(test_obs, test_sim);
assert_eq!(result, (2.6 as f64).sqrt());
}
#[test]
fn test_rmse_per... | let s = hydromath::kge(data, data);
assert_eq!(s, 1.0);
}
|
<|file_name|>config.py<|end_file_name|><|fim▁begin|>""" configuration module for awsu, contains two objects """
import boto3
import sqlite3
import logging
import getpass
import datetime
import configparser
import uuid
import requests
import json
from dateutil.tz import tzutc
from urllib.parse import urlencode, quote_pl... | |
<|file_name|>clipread.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
##Copyright (c) 2017 Benoit Valot and Panisa Treepong
##benoit.valot@univ-fcomte.fr
##UMR 6249 Chrono-Environnement, Besançon, France
##Licence GPL
from . import variables
class ClipRead():
"""Clip read object"""
... |
def getclippos(self): |
<|file_name|>item.ts<|end_file_name|><|fim▁begin|>export class Item {
constructor(public title: string) {
} <|fim▁hole|><|fim▁end|> | } |
<|file_name|>onesignal-mock.ts<|end_file_name|><|fim▁begin|>import { ParsedUrlQuery } from 'querystring';
import * as nock from 'nock';
import * as response from './response';
import {
APP1,
APP1_DEVICE1,
APP1_NOTIFICATION1,
APP1_SEGMENT1,
APP1_EXTERNAL_USER_ID1,
MOCKED_API_HOST,
MOCKED_FAILING_400_API_... | .get(APP1_VIEW_DEVICE1_PATH)
.query(expectAppIdInQuery(APP1.appId))
.reply(response.viewDeviceResponse['200OK'].status, response.viewDeviceResponse['200OK'].response)
.persist(); |
<|file_name|>svm.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) 2008-2015, Luis Pedro Coelho <luis@luispedro.org>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# License: MIT. See COPYING.MIT file in the milk distribution
from __future__ import division
from .classifier import normalisel... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
class Music(models.Model):
url = models.CharField('URL', max_length=255)
title = models.CharField('título', max_length=200, blank=True)<|fim▁hole|> file = models.FileField(upload_to='')<|fim▁end|> | artist = models.CharField('artista', max_length=200, blank=True)
genre = models.CharField('gênero', max_length=100, blank=True) |
<|file_name|>test_litemq.py<|end_file_name|><|fim▁begin|># Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
# pylint: disable=W0212,W0613
from twisted.internet.defer import Deferred, DeferredList
from twisted.python.failure import Failure
from twisted.trial.unittest import TestCase
import smar... | def _callback(m, p): |
<|file_name|>ls.go<|end_file_name|><|fim▁begin|>package cmd
import (
"errors"
"github.com/cretz/go-safeclient/client"
"github.com/spf13/cobra"
"log"
"os"
)
var lsShared bool
var lsCmd = &cobra.Command{
Use: "ls [dir]",
Short: "Fetch directory information",
RunE: func(cmd *cobra.Command, args []string) erro... | } |
<|file_name|>PojoCollectionArtifactProvider.java<|end_file_name|><|fim▁begin|>package at.jku.sea.cloud.rest.pojo.stream.provider;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
import com.fasterxml.jackson.annotation.JsonTypeName;<|fim▁hole|>import at.jku... | |
<|file_name|>bitcoin_es.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="es" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About CoinAwesome</source>
<translation>Acerca de Coi... | |
<|file_name|>nginx.py<|end_file_name|><|fim▁begin|>from flask import render_template
class NginxConfigRenderer():
def __init__(self, manifold):
self.manifold = manifold
self.app = manifold.app
def render(self, minions):
with self.app.app_context():
return render_template(... |
def write(self, minions): |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from pymongo import MongoClient
from dalmongo import configuration<|fim▁hole|>
# get the instance of MongoDB client
client = MongoClient(configuration.MONGODB_HOST, configuration.MONGODB_PORT)
# get the main application database
db = getattr(client, configuration.M... | |
<|file_name|>d3.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('aurea')
.directive('d3Bars', function ($window, $timeout, d3Service) {
return {
restrict: 'EA',
scope: {
data: '=',
onClick: '&'
},
link: function (s... | scope.$watch(function () {
return angular.element($window)[0].innerWidth;
}, function () {
scope.render(scope.data); |
<|file_name|>component_test.py<|end_file_name|><|fim▁begin|># Copyright 2020 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
#
#... |
def setUp(self):
super(ComponentTest, self).setUp()
|
<|file_name|>displayable_path.rs<|end_file_name|><|fim▁begin|>use std::fmt;
use std::path::PathBuf;
// Newtype to make a standard path buffer presentable (via the Display<|fim▁hole|>// trait), which is required for any type used in search/select mode.
pub struct DisplayablePath(pub PathBuf);
impl fmt::Display for Dis... | |
<|file_name|>calculate-element-wise.cc<|end_file_name|><|fim▁begin|>/*
* Medical Image Registration ToolKit (MIRTK)
*
* Copyright 2015-2017 Imperial College London
* Copyright 2015-2017 Andreas Schuh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in complia... | scalars_name = ARGUMENT;
cell_data = true;
} |
<|file_name|>wizard_report.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP module
# Copyright (C) 2010 Micronaet srl (<http://www.micronaet.it>) and the
# Italian OpenERP Community (<http://www.openerp-italia.c... |
else: # Summary report ################################################
#datas['department_id'] = wiz_proxy.department_id.id if wiz_proxy.department_id else False |
<|file_name|>moment-plugin.ts<|end_file_name|><|fim▁begin|>import * as $ from 'jquery';
import * as moment from 'moment';
/* tslint:disable:no-function-expression */
($.fn.DataTable as any).render.moment = function (from: string, to: string, locale: string): (d: any, type: string, row: any) => string {
/* tslint:enabl... | |
<|file_name|>getAllMatchers.test.js<|end_file_name|><|fim▁begin|>const getAllMatchers = require("./getAllMatchers");
describe("unit: getAllMatchers", () => {
let handler;
let matcherStore;
beforeEach(() => {
matcherStore = [{}, {}, {}];
handler = getAllMatchers(matcherStore);
});
test("it should r... | expect(handler()).toHaveProperty("status", 200);
});
}); |
<|file_name|>ftpDownloader-test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Sat May 21 16:43:47 2016
@author: Pratik
"""
from ftplib import FTP
import os
# login and download file from ftp site and retrieve file (use default params)
def ftpDownloader(filename, host="ftp.pyclass.com", user="... | os.chdir("/Users/Pratik/Documents/Pratik/Work/practice/py-data-analysis") # change directory
print(ftp.nlst()) # print list of all files in dir
with open(filename, 'wb') as file: # open file and w/r
ftp.retrbinary('RETR %s' % filename, file.write) # read contents of pdf and write t... |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![crate_name="otp"]
#![crate_type="lib"]
use std::time::{SystemTime, SystemTimeError};
use std::convert::TryInto;
use data_encoding::{BASE32_NOPAD, DecodeError};
use err_derive::Error;
use ring::hmac;
#[derive(Debug, Error)]
pub enum Error {
#[error(display="inval... | #[test]
fn hotp() { |
<|file_name|>pindel.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import logging
import argparse, os, shutil, subprocess, sys, tempfile, time, shlex, re
import datetime
from multiprocessing import Pool
import vcf
def execute(cmd, output=None):
import subprocess, sys, shlex
# function to execute a cmd ... | cmd = "samtools index %s" %(inputBamLink) |
<|file_name|>dodata.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#################### 本文件用于进行基本的 json urlencode 操作
import sys,re
import json
from jsonpath_rw import jsonpath, parse # pip2/pip3 install jsonpath_rw
from lxml import etree
import platform
sysstr = platform.system() ### 判断操作系统类型 ... | |
<|file_name|>ThresholdEvaluatorRelativeChange.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2007-2012 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2012 The OpenNMS Group, Inc.
*
... | return createBasicEvent(uei, date, dsValue, resource);
} else {
return null;
} |
<|file_name|>array-index-is-temporary.rs<|end_file_name|><|fim▁begin|>// Retagging (from Stacked Borrows) relies on the array index being a fresh
// temporary, so that side-effects cannot change it.
// Test that this is indeed the case.
unsafe fn foo(z: *mut usize) -> u32 {
*z = 2;
99
}
fn main() {
let mu... | x[y] = unsafe { foo(z) };
}
// END RUST SOURCE |
<|file_name|>PostActionButton.js<|end_file_name|><|fim▁begin|>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Button from 'react-bootstrap/lib/Button';
import Glyphicon from 'react-bootstrap/lib/Glyphicon';
import { post } from '../../api';
class PostActionButton extends Component... | {isWorking &&
<Glyphicon glyph="refresh" className="glyphicon-spin" />
} {renderChildren && children} |
<|file_name|>upload.controller.js<|end_file_name|><|fim▁begin|>var path = require('path');
var Q = require('q');
var fs = require('fs');
var mv = require('mv');
var Upload = require('./upload.model');
exports.upload = function (req, res) {
var tmpPath = req.files[0].path;
var newFileName = Math.random().toStri... | reason: err.toString()
});
}); |
<|file_name|>stubs.py<|end_file_name|><|fim▁begin|>import logging
import os
import time
from urllib2 import HTTPError, URLError
from djangoappengine.boot import PROJECT_DIR
from djangoappengine.utils import appid, have_appserver
REMOTE_API_SCRIPTS = (
'$PYTHON_LIB/google/appengine/ext/remote_api/handler.py',
... | break |
<|file_name|>Dashboard.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
import { experimentalStyled as styled } from '@material-ui/core/styles';
import CssBaseline from '@material-ui/core/CssBaseline';
import MuiDrawer from '@material-ui/core/Drawer';
import Box from '@material-ui/core/Box';
import MuiA... | </Box>
</Box> |
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>use tempdir;
use libxch;
mod util;
#[test]
fn test_success() {
let dir = tempdir::TempDir::new("test").expect("Could not create temporary directory");
let file1 = dir.path().join("file1");<|fim▁hole|> util::create_file_with_content(&file2, b"content2").expe... | let file2 = dir.path().join("file2");
util::create_file_with_content(&file1, b"content1").expect("Could not create file in tempdir"); |
<|file_name|>ApacheConnectionManagerFactoryTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2011-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the ... |
import com.amazonaws.ClientConfiguration; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from robottelo.decorators.func_shared.shared import ( # noqa
shared,
SharedFunctionError,<|fim▁hole|><|fim▁end|> | SharedFunctionException,
) |
<|file_name|>pl.js<|end_file_name|><|fim▁begin|>/*!
* FileInput Polish Translations
*
* This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or
* any HTML markup tags in the messages must not be converted or translated.
*
* @see http://github.com/kartik-v/bootstrap-fileinput
*
* NOTE:... | msgProgressError: 'Błąd',
msgValidationError: 'Błąd walidacji',
msgLoading: 'Wczytywanie pliku {index} z {files} …',
msgProgress: 'Wczytywanie pliku {index} z {files} - {name} - {percent}% zakończone.',
|
<|file_name|>configs-fn_return_indent-with_where_clause.rs<|end_file_name|><|fim▁begin|>// rustfmt-fn_return_indent: WithWhereClause
// Function return type indent
fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: Consectetur, adipiscing: Adipiscing) -> Elit where Ipsum: Eq {
// body<|fim▁hol... | } |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod resource;<|fim▁hole|>pub mod space;<|fim▁end|> | |
<|file_name|>graphs.py<|end_file_name|><|fim▁begin|># Copyright 2017 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.apache.org/licenses/LI... | labels = tf.expand_dims(tf.gather_nd(inputs.labels, indices), 1)
weights = tf.expand_dims(tf.gather_nd(inputs.weights, indices), 1)
else:
labels = inputs.labels |
<|file_name|>consulta_partidas_por_producto.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005-2008 Francisco José Rodríguez Bogado, #
# Diego Muño... | |
<|file_name|>test_annotations.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import matplotlib
# Force matplotlib to not use any Xwindows backend.
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from plotly.tests.utils import compare_dict
from plotly.tests.test_optional.optional_utils im... | |
<|file_name|>after.js<|end_file_name|><|fim▁begin|>var toInteger = require('./toInteger');
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* The opposite of `_.before`; this method creates a function that invokes
* `func` once it's called `n` or more ... | n = toInteger(n);
return function() {
if (--n < 1) {
return func.apply(this, arguments); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Worker implementation."""
from __future__ import absolute_import, unicode_literals
from .worker import WorkController
<|fim▁hole|>__all__ = ('WorkController',)<|fim▁end|> | |
<|file_name|>test_scene.py<|end_file_name|><|fim▁begin|>"""deCONZ scene platform tests."""
from copy import deepcopy
from asynctest import patch
from homeassistant.components import deconz
from homeassistant.setup import async_setup_component
import homeassistant.components.scene as scene
from .test_gateway import ... | data = deepcopy(DECONZ_WEB_REQUEST)
gateway = await setup_deconz_integration( |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>"use strict";
var responsive_window_1 = require("./responsive-window");<|fim▁hole|>];
//# sourceMappingURL=index.js.map<|fim▁end|> | exports.ResponsiveWindow = responsive_window_1.ResponsiveWindow;
exports.RESPONSIVEWINDOW_DIRECTIVE = [
responsive_window_1.ResponsiveWindow |
<|file_name|>ieem_sitelist_parser_browsertest.cc<|end_file_name|><|fim▁begin|>// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/browser_switcher/ieem_sitelist_parser.h"
#include ... | "e200.com/path1", |
<|file_name|>test_md.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2015 Stephen Warren
# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
import pytest
import u_boot_utils
@pytest.mark.buildconfigspec('cmd_memory')
def test_md(u_boot_console):
"""Test that md ... | using the mw command."""
ram_base = u_boot_utils.find_ram_base(u_boot_console)
addr = '%08x' % ram_base |
<|file_name|>status.rs<|end_file_name|><|fim▁begin|>use config::{Config, OutputFormat};
use utils::console::*;
use utils::output;
use clap::{App, Arg, ArgMatches, SubCommand};
use hyper::Client;
use serde_json;
use std::io::Read;
use std::str;
use webbrowser;
pub const NAME: &'static str = "status";
error_chain! {
... | (&Status::Okay, true) | (&Status::Warning, _) | (&Status::Failed, _) => { |
<|file_name|>variables_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 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.ap... | # See the License for the specific language governing permissions and
# limitations under the License. |
<|file_name|>remove_double_vertices_and_faces.py<|end_file_name|><|fim▁begin|>#-----------------------------------------------------------------------------
#remove duplicates v1.3
#best way to remove duplicates, just select the objects you want the duplicates removed, then run this scrpit
import bpy
for obj in bpy.c... | bpy.ops.object.mode_set(mode='EDIT', toggle=False) # set to Edit Mode AGAIN
bpy.ops.mesh.delete(type='FACE') # delete double faces
bpy.ops.mesh.select_all(action='SELECT') |
<|file_name|>PacketSocket.cpp<|end_file_name|><|fim▁begin|>#include <assert.h>
#include <stdint.h>
#include <OpenP2P/Buffer.hpp>
#include <OpenP2P/Stream/BinaryStream.hpp>
#include <OpenP2P/Event/Source.hpp>
#include <OpenP2P/Event/Wait.hpp>
#include <OpenP2P/RootNetwork/Endpoint.hpp>
#include <OpenP2P/RootNetwork/... | namespace OpenP2P {
namespace RootNetwork { |
<|file_name|>bitcoin_gu.ts<|end_file_name|><|fim▁begin|><TS version="2.1" language="gu">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation type="unfinished">સરનામું અથવા લેબલ બદલવા માટે જમણું-ક્લિક કરો</translation>
</message>... | |
<|file_name|>router.js<|end_file_name|><|fim▁begin|>define(['views/Index','views/Cart','views/CategoryEdit','views/Categories','views/Product','views/Products','views/ProductEdit','views/ProductDetail','views/admin/Index','models/Product','models/Category','models/CartCollection','models/ProductCollection','models/Cate... | var cid = categoryId || ''; |
<|file_name|>DynamicFormComponent.ts<|end_file_name|><|fim▁begin|>import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { DynamicFormConfig } from 'common/ui/dynamicform/DynamicFormConfig';
declare let ... | });
|
<|file_name|>default_test.js<|end_file_name|><|fim▁begin|>describe("", function() {
var rootEl;
beforeEach(function() {
rootEl = browser.rootEl;
browser.get("build/docs/examples/example-example100/index.html");
});
it('should format numbers', function() {
expect(element(by.id('number-defaul... | it('should update', function() {
element(by.model('val')).clear();
element(by.model('val')).sendKeys('3374.333');
|
<|file_name|>network.go<|end_file_name|><|fim▁begin|>package core
import (
"os";
"container/list";
"net";
"log";
"irc";
"runloop";
)
type Network struct {
name string;
server *server;
clients *list.List;
listen *listenConn;
}
func newNetwork(name string, serverConn net.Conn, listen net.Listener) *Netwo... | }; |
<|file_name|>_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.
# Code generated... | from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat |
<|file_name|>lib.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/. */
//! Servo, the mighty web browser engine from the future.
//!
//!... | if opts::get().sandbox { |
<|file_name|>yuzi.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { CheckboxModule } from './checkbox/checkbox.module';
import { ModalModule } from './modal/modal.module';
import { RadioModule } from './radio/radio.module';
import { SelectModule } from './select/select.module';
... | |
<|file_name|>4_6.py<|end_file_name|><|fim▁begin|><|fim▁hole|>l = list(range(1, 20 + 1, 2)) # this is wasteful in this program
for i in l:
print(i)<|fim▁end|> | |
<|file_name|>core.py<|end_file_name|><|fim▁begin|>import datetime
import logging
JRD_TYPES = ('application/json', 'application/xrd+json', 'text/json')
XRD_TYPES = ('application/xrd+xml', 'text/xml')
logger = logging.getLogger("rd")
def _is_str(s):
try:
return isinstance(s, basestring)
except NameErr... | if not isinstance(rels, (list, tuple)):
rels = (rels,)
for link in self.links:
if link.rel in rels: |
<|file_name|>ner.py<|end_file_name|><|fim▁begin|>import math
import gzip
import paddle.v2 as paddle
import paddle.v2.evaluator as evaluator
import conll03
import itertools
# init dataset
train_data_file = 'data/train'
test_data_file = 'data/test'
vocab_file = 'data/vocab.txt'
target_file = 'data/target.txt'
emb_file =... | |
<|file_name|>tour.es6.js<|end_file_name|><|fim▁begin|>/**
* @file
* Attaches behaviors for the Tour module's toolbar tab.
*/
(($, Backbone, Drupal, settings, document, Shepherd) => {
const queryString = decodeURI(window.location.search);
/**
* Attaches the tour's toolbar tab behavior.
*
* It uses the ... | *
* @return {Drupal.tour.views.ToggleTourView} |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from django.conf import settings
# Here, user contacts.profile will cause some 'mismatch' since contacts is also a module
from profile import ProfileView
from contacts import ContactsView
from authen import Authentica... | urlpatterns = patterns('',
url(r'^api/'+auth+'$', Authenticate.as_view()),
url(r'^api/(?P<'+strid+r'>\w{16})/$', ProfileView.as_view()),
url(r'^api/(?P<'+strid+r'>\w{16})/(?P<'+contact+r'>\d+)/$', ContactsView.as_view()), |
<|file_name|>config.py<|end_file_name|><|fim▁begin|><|fim▁hole|>class Config(object):
SPOTIPY_REDIRECT_URI = os.environ['SPOTIPY_REDIRECT_URI']
SPOTIPY_CLIENT_ID = os.environ['SPOTIPY_CLIENT_ID']
SPOTIPY_CLIENT_SECRET = os.environ['SPOTIPY_CLIENT_SECRET']
SPOTIFY_ACCESS_SCOPE = 'playlist-modify-public p... | import os
|
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// DO NOT EDIT !
// This file was generated automatically from 'src/mako/cli/main.rs.mako'
// DO NOT EDIT !
#![allow(unused_variables, unused_imports, dead_code, unused_mut)]
#[macro_use]
extern crate clap;
extern crate yup_oauth2 as oauth2;
extern crate yup_hyper_mock... | "Details at http://byron.github.io/google-apis-rs/google_adsensehost4d1_cli/associationsessions_start",
vec![
(Some(r##"product-code"##), |
<|file_name|>route53domains.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "route53domains")]
<|fim▁hole|>use rusoto::{DefaultCredentialsProvider, Region};
use rusoto::default_tls_client;
#[test]
fn should_list_operations() {
let credentials = DefaultCredentialsProvider::new().unwrap();
let client =
... | extern crate rusoto;
use rusoto::route53domains::{Route53Domains, Route53DomainsClient, ListOperationsRequest}; |
<|file_name|>private.py<|end_file_name|><|fim▁begin|>"""Project URLs for authenticated users"""
from django.conf.urls import patterns, url
from readthedocs.projects.views.private import AliasList, ProjectDashboard, ImportView
from readthedocs.projects.backends.views import ImportWizardView, ImportDemoView
urlpatter... | 'readthedocs.projects.views.private.project_versions',
name='projects_versions'), |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>class Config(dict):
def __init__ (self):<|fim▁hole|>
self['server'] = 'chat.freenode.com'
self['port'] = 6667
self['debug'] = False
self['verbose'] = False
self['web_host'] = '0.0.0.0'
self['web_port'] = 8080
d... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/**
* Created by Keerthikan on 29-Apr-17.<|fim▁hole|><|fim▁end|> | */
export {expenseSpyFactory} from './expense-spy-factory';
export {compensationSpyFactory} from './compensation-spy-factory'; |
<|file_name|>GlobalCallbacks.cpp<|end_file_name|><|fim▁begin|>#include "stdafx.h"
using namespace System::Linq;
namespace JsPie { namespace Scripting { namespace V8 {
GlobalCallbacks::GlobalCallbacks(IScriptEnvironment^ environment)
{
_pConsoleCallbacks = new ConsoleCallbacks();
auto controllerIds = Enumera... | _pControllerCallbacks[count] = NULL;
}
|
<|file_name|>main.go<|end_file_name|><|fim▁begin|>// -*- Mode: Go; indent-tabs-mode: t -*-
/*
* Copyright (C) 2014-2015 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Founda... | env, err := osutil.OSEnvironment()
if err != nil {
return err
} |
<|file_name|>problem002.py<|end_file_name|><|fim▁begin|>'''
Problem 2
19 October 2001
Each new term in the Fibonacci sequence is generated by adding the
previous two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
By considering the terms in the Fibonacci... | ----------------------------------------------------------
Created on 25.01.2012
|
<|file_name|>main.js<|end_file_name|><|fim▁begin|>console.log("J U I loaded");
var timer;
var timer2;
var timer3;
var counter;
var cell;
var curCount = 0;
var gameLost = false;
var multiUp = 0;
var total = 10;
var score = 0;
var points = 100;
var board = [ 0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,... |
var tickCell = function() { |
<|file_name|>settings_dev.py<|end_file_name|><|fim▁begin|>"""
Django settings for lark project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from .base import *... | 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' |
<|file_name|>setup_driver.py<|end_file_name|><|fim▁begin|>from distutils.core import setup
setup(
name = "cnccontrol-driver",
description = "CNC-Control device driver",<|fim▁hole|><|fim▁end|> | author = "Michael Buesch",
author_email = "m@bues.ch",
py_modules = [ "cnccontrol_driver", ],
) |
<|file_name|>uniqBy.js<|end_file_name|><|fim▁begin|>import _Set from './internal/_Set.js';
import _curry2 from './internal/_curry2.js';
/**
* Returns a new list containing only one copy of each element in the original
* list, based upon the value returned by applying the supplied function to
* each list element. P... | */
var uniqBy = _curry2(function uniqBy(fn, list) {
var set = new _Set(); |
<|file_name|>materializer.go<|end_file_name|><|fim▁begin|>/*
Copyright 2019 The Vitess 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
Unles... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>const Koa = require('koa')
const screenshot = require('./screenshot')
const app = new Koa()
app.use(async ctx => {
var url = ctx.query.url
console.log('goto:', url)
if (!/^https?:\/\/.+/.test(url)) {
ctx.body = 'url 不合法'
} else {
if (!isNaN(ctx.query.w... | let data = await screenshot(url, ctx.query.wait, ~~ctx.query.width)
if (ctx.query.base64) { |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"encoding/base32"
"encoding/hex"
"fmt"
"io"
"io/ioutil"
"net/url"
"os"
"strings"
)
func escape(encoding string) {
switch {
case strings.HasPrefix("query", encoding):
b, err := ioutil.ReadAll(os.Stdin)
if err != nil {
fmt.Fprintln... | fmt.Fprintf(os.Stderr, "unknown mode: %q\n", mode)
os.Exit(2) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.