prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>test_lagrange_polynomials.py<|end_file_name|><|fim▁begin|>import chaospy
import numpy
import pytest
@pytest.fixture
def samples(joint):
return joint.sample(10, rule="sobol")
@pytest.fixture
def evaluations(model_solver, samples):
return numpy.array([model_solver(sample) for sample in samples.T]... |
@pytest.fixture
def lagrange_approximation(evaluations, expansion): |
<|file_name|>jquery-ui.js<|end_file_name|><|fim▁begin|>/*! jQuery UI - v1.10.3 - 2013-05-03
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.ef... | originalPosition: ui.originalPosition, |
<|file_name|>comparator.rs<|end_file_name|><|fim▁begin|>// rust way of ord
use std::cmp::Ordering;
pub trait Comparator<T> {
fn compare(&self, v: &T, w: &T) -> Ordering;
fn less(&self, v: &T, w: &T) -> bool {
self.compare(v, w) == Ordering::Less
}<|fim▁hole|> (*self)(v, w)
}
}
pub fn... | }
impl<T, F> Comparator<T> for F where F: Send + Sync + Fn(&T, &T) -> Ordering {
fn compare(&self, v: &T, w: &T) -> Ordering { |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from django.test import TestCase
from django import forms
from django.forms.models import ModelForm
import unittest
from employee.forms import *
from django.test import Client
class TestBasic(unittest.TestCase):
"Basic tests"
def test_basic(self):
... | def test_employee_report(self):
c = Client()
resp = c.get('/portal/staff/')
self.assertEqual(resp.status_code, 302) |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
import errno, socket, sel... | part += cur
escape = False
continue
if quote: |
<|file_name|>shell_options.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# encoding: UTF-8
"""
This file is part of Commix Project (http://commixproject.com).
Copyright (c) 2014-2017 Anastasios Stasinopoulos (@ancst).
This program is free software: you can redistribute it and/or modify
it under the terms of t... | reverse_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE)
return go_back, go_back_again |
<|file_name|>stat.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licen... | let path = dir.path().join("file"); |
<|file_name|>test_air_quality.py<|end_file_name|><|fim▁begin|>"""Test the Dyson air quality component."""
import json
from unittest import mock
import asynctest
from libpurecool.dyson_pure_cool import DysonPureCool
from libpurecool.dyson_pure_state_v2 import DysonEnvironmentalSensorV2State
import homeassistant.compon... | return {dyson_parent.DOMAIN: { |
<|file_name|>marisa-build.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2010-2013, Susumu Yata
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// - Redistributions of source code must re... | }
return build(cmdopt.argv + cmdopt.optind, cmdopt.argc - cmdopt.optind);
} |
<|file_name|>feeds.py<|end_file_name|><|fim▁begin|>"""(Re)builds feeds for categories"""
import os
import datetime
import jinja2
from google.appengine.api import app_identity
import dao
import util
def build_and_save_for_category(cat, store, prefix):
"""Build and save feeds for category"""
feed = build_feed(... | def feed_size(category): |
<|file_name|>index.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2014 Couchbase, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.... | func (im *IndexMappingImpl) mappingForType(docType string) *DocumentMapping { |
<|file_name|>bitcoin_es_DO.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="es_DO" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About PieCoin</source>
<translation type="unfin... | </message>
<message>
<location line="+3"/> |
<|file_name|>phobia.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from generator import Generator
import logging
class Phobia(Generator):
""" Define a phobia to be used in your game """
def __init__(self, redis, features={}):
Generator.__init__(self, redis, features... | # Double parse the template to fill in templated template values.
|
<|file_name|>composedquery.py<|end_file_name|><|fim▁begin|>## begin license ##
#
# "Meresco Lucene" is a set of components and tools to integrate Lucene into Meresco
#
# Copyright (C) 2013-2016, 2019-2021 Seecr (Seek You Too B.V.) https://seecr.nl
# Copyright (C) 2013-2014 Stichting Bibliotheek.nl (BNL) http://www.bibl... | kwargs = {'composedQuery': self} |
<|file_name|>district-demographic-estimate-controller.js<|end_file_name|><|fim▁begin|>/*
* This program was produced for the U.S. Agency for International Development. It was prepared by the USAID | DELIVER PROJECT, Task Order 4. It is part of a project which utilizes code originally licensed under the terms of the Mo... |
DistrictDemographicEstimateController.resolve = {
|
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.conf.urls import url
from . import views
urlpatterns = [
url(r"^$", views.home, name="board"),
url(r"^/all$", views.all_feed, name="board_all"),
url(r"^/course/(?P<course_id>.*)?$", views.course_feed, name="board_cours... | |
<|file_name|>new_blog.rs<|end_file_name|><|fim▁begin|>// Common routines and constants for creating a new silica site
use ::logger::{log_err, log_info};
use std::fs::{self, File};
use std::io::Write;
use git2::Repository;
use cmdline::{CUR_CONFIG_NAME, SITE_EXISTS, NOT_SILICA_SITE};
use chrono::*;
use ::errors::*;
//... | |
<|file_name|>browser_host.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 browser::{self, ServoCefBrowserExtensions};
use euti... | |
<|file_name|>suffix.js<|end_file_name|><|fim▁begin|>// support CommonJS, AMD & browser
/* istanbul ignore next */<|fim▁hole|> define(function() { return (window.riot = riot) })
else
window.riot = riot
})(typeof window != 'undefined' ? window : void 0);<|fim▁end|> | if (typeof exports === T_OBJECT)
module.exports = riot
else if (typeof define === 'function' && define.amd) |
<|file_name|>process_data.py<|end_file_name|><|fim▁begin|>import cPickle
import numpy as np
import sys
from collections import OrderedDict
def format_chars(chars_sent_ls):
max_leng = max([len(l) for l in chars_sent_ls])
to_pads = [max_leng - len(l) for l in chars_sent_ls]
for i, to_pad in enumerate(to_pads... | """
For words that occur in at least min_df documents, create a separate word vector. |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># --------------------------------------------------------
# TensorFlow for Dragon<|fim▁hole|># Copyright(c) 2017 SeetaTech
# Written by Ting Pan
# --------------------------------------------------------<|fim▁end|> | |
<|file_name|>config.py<|end_file_name|><|fim▁begin|># Author: Drone
import web
from app.helpers import utils
from app.helpers import formatting
projectName = 'Remote Function Trainer'
listLimit = 40
# connect to database
db = web.database(dbn='mysql', db='rft', user='root', passwd='1234')
t = db.transaction()
#t.c... | # template global functions
globals = utils.get_all_functions(formatting) |
<|file_name|>tenants_test.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2017 VMware, Inc. All Rights Reserved.
//
// This product is licensed to you under the Apache License, Version 2.0 (the "License").
// You may not use this product except in compliance with the License.
//
// This product may include a number of... | cleanTenants(client)
server.Close()
})
|
<|file_name|>hipchat.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import json
from tornado import httpclient as hc
from tornado import gen
from graphite_beacon.handlers import LOGGER, AbstractHandler
class HipChatHandler(AbstractHandler):
name = 'hipchat'
# Default options
defaults = {
'url': '... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod load_model;<|fim▁hole|><|fim▁end|> | mod model;
pub use self::load_model::LoadModelError;
pub use self::model::ModelError; |
<|file_name|>migrant.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import argparse
import binascii
import datetime
import gzip
import json
import magic
import os
import pymongo
import sys
def read_gzip(filename):<|fim▁hole|> content = file.read()
return content
def read_plain(filename):
with... | with gzip.open(filename) as file: |
<|file_name|>data.js<|end_file_name|><|fim▁begin|>//<|fim▁hole|>// window.onload = function() {
// var data = {username:'52200', password:'123', remember:52200};
// fetch('/api/users/getUser?id=1').then(function(res) {
// console.log("请求的数据是", res);
// if (res.ok) {
// alert('Submitt... | |
<|file_name|>AllSessionUrlsForBuildAreAlikeTest.java<|end_file_name|><|fim▁begin|><|fim▁hole|>/**
* JBoss, Home of Professional Open Source.
* Copyright 2014-2020 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* yo... | |
<|file_name|>PrivateChannel.js<|end_file_name|><|fim▁begin|>"use strict";
const Channel = require("./Channel");
const Collection = require("../util/Collection");
const Endpoints = require("../rest/Endpoints");
const Message = require("./Message");
const OPCodes = require("../Constants").GatewayOPCodes;
const User = re... |
module.exports = PrivateChannel; |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>extern crate peg;
<|fim▁hole|><|fim▁end|> | fn main() {
peg::cargo_build("src/glop.rustpeg");
} |
<|file_name|>livebargraph.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 25 21:11:45 2017
@author: hubert
"""
import numpy as np
import matplotlib.pyplot as plt
class LiveBarGraph(object):
"""
"""
def __init__(self, band_names=['delta', 'theta', 'al... | |
<|file_name|>second.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
name = raw_input("please enter your name:")<|fim▁hole|>print "my name is {} and i live in {}".format(name,address)<|fim▁end|> | address = raw_input("please enter your address:") |
<|file_name|>forgot_username.py<|end_file_name|><|fim▁begin|>from cornflake.exceptions import ValidationError
from flask import Response
from radar.api.serializers.auth import ForgotUsernameSerializer
from radar.api.views.generics import ApiView, request_json
from radar.auth.exceptions import UserNotFound
from radar.a... | |
<|file_name|>AfterNew15-out.java<|end_file_name|><|fim▁begin|>import java.io.File;
import java.io.FilenameFilter;<|fim▁hole|>
class A {
{
new java.io.File("aaa").list(new FilenameFilter() {
public boolean accept(File dir, String name) {
<selection>return false; //To change body of implemented... | |
<|file_name|>client_updater.py<|end_file_name|><|fim▁begin|>import sys
import time
import logging
from socketio import socketio_manage
from socketio.mixins import BroadcastMixin
from socketio.namespace import BaseNamespace
from DataAggregation.webdata_aggregator import getAvailableWorkshops
logger = logging.getLogg... | logger.addHandler(std_out_logger)
|
<|file_name|>contributors.js<|end_file_name|><|fim▁begin|>var utils = require('./utils')
, request = require('request')
;
module.exports = {
fetchGithubInfo: function(email, cb) {
var githubProfile = {};
var api_call = "https://api.github.com/search/users?q="+email+"%20in:email";
var options = { u... | request(options, function(err, res, body) { |
<|file_name|>var-captured-in-nested-closure.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 b... | // Copyright 2013-2014 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|>window.rs<|end_file_name|><|fim▁begin|>use std::ops::{Bound, Range, RangeBounds};
/// A owned window around an underlying buffer.
///
/// Normally slices work great for considering sub-portions of a buffer, but
/// unfortunately a slice is a *borrowed* type in Rust which has an associated
/// lifetime. Wh... | }
impl<T: AsRef<[u8]>> Window<T> {
/// Creates a new window around the buffer `t` defaulting to the entire |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/*
*
* UI reducer
*
*/
import { fromJS } from 'immutable';
import {
SET_PRODUCT_QUANTITY_SELECTOR,
} from './constants';
const initialState = fromJS({
product: {
quantitySelected: 1,
},
});
function uiReducer(state = initialState, action) {
switch (a... | case SET_PRODUCT_QUANTITY_SELECTOR:
return state.setIn(['product', 'quantitySelected'], action.quantity);
default:
return state; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>use binary_podman::{BinaryTrait, PodmanBinary};
use buildpack::{
eyre::Report,
libcnb::{
build::{BuildContext, BuildResult, BuildResultBuilder},
detect::{DetectContext, DetectResult, DetectResultBuilder},<|fim▁hole|> Buildpack, Error, Resul... | generic::{GenericMetadata, GenericPlatform}, |
<|file_name|>filtermanager.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the... | def tracker_error_filter(torrent_ids, values): |
<|file_name|>test_executor.py<|end_file_name|><|fim▁begin|>import unittest
from mock import Mock, patch<|fim▁hole|>from concurrent.futures import ThreadPoolExecutor
import re
class TestExecutor(unittest.TestCase):
output = 'TestExecutor output'
outputs = ['TestExecutor 1', 'TestExecutor 2']
def test_run... | from expyrimenter import Executor
from expyrimenter.runnable import Runnable
from subprocess import CalledProcessError |
<|file_name|>ToggleTableViewModeCompactAction.java<|end_file_name|><|fim▁begin|>/*
* This file is part of trolCommander, http://www.trolsoft.ru/en/soft/trolcommander
* Copyright (C) 2014-2016 Oleg Trifonov
*
* trolCommander is free software; you can redistribute it and/or modify
* it under the terms of the GNU Gen... | }
|
<|file_name|>profile-status.js<|end_file_name|><|fim▁begin|>Vue.http.options.emulateJSON = true;
var profile_status = new Vue({
el: '#profile-status',<|fim▁hole|> isSuggestShow: 0,
suggest: [
{text: 'Предложение оплаты услуг, вирт за деньги, проституция, мошенничество, шантаж, спам', sty... | data: { |
<|file_name|>sinker.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 ASMlover. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributio... | # distribution.
# |
<|file_name|>tumblr.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class TumblrIE(InfoExtractor):
_VALID_URL = r'http://(?P<blog_name>.*?)\.tumblr\.com/(?:post|video)/(?P<id>[0-9]+)(?:$|[/?#])'
_TESTS = [{
'... | 'md5': 'bf348ef8c0ef84fbf1cbd6fa6e000359',
'info_dict': { |
<|file_name|>ComposedSQL.java<|end_file_name|><|fim▁begin|>package org.blendee.jdbc;
/**<|fim▁hole|> */
public interface ComposedSQL extends ChainPreparedStatementComplementer {
/**
* このインスタンスが持つ SQL 文を返します。
* @return SQL 文
*/
String sql();
/**
* {@link PreparedStatementComplementer} を入れ替えた新しい {@link Comp... | * プレースホルダを持つ SQL 文と、プレースホルダにセットする値を持つものを表すインターフェイスです。
* @author 千葉 哲嗣 |
<|file_name|>create.rs<|end_file_name|><|fim▁begin|>//
// imag - the personal information management suite for the commandline
// Copyright (C) 2015, 2016 Matthias Beyer <mail@beyermatthias.de> and contributors
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU L... | |
<|file_name|>small-enum-range-edge.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.apac... | assert_eq!(CLu as u8, Eu::Lu as u8);
assert_eq!(CHu as u8, Eu::Hu as u8);
assert_eq!(CLs as i8, Es::Ls as i8);
assert_eq!(CHs as i8, Es::Hs as i8); |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* @ngdoc function
* @name sbAdminApp.controller:MainCtrl
* @description
* # MainCtrl
* Controller of the sbAdminApp
*/
angular.module('sbAdminApp')
.controller('MainCtrl', function($scope,$position) {
})
.controller('StoreCtrl',['$scope'... | for (var j = 0; j < item.length; j++) { |
<|file_name|>Array.prototype.es6.js<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule Array.prototype.es6
* @polyfill
* @nolint
*/
/* es... | |
<|file_name|>project.ts<|end_file_name|><|fim▁begin|>import {LoggerContext} from "../logging/logger-context";
import {ParameterContainer} from "../core/parameter-container";<|fim▁hole|>}<|fim▁end|> |
export class Project {
private loggerContext = new LoggerContext();
private parameterContainer = new ParameterContainer(); |
<|file_name|>hdfs.py<|end_file_name|><|fim▁begin|>"""File system module."""
# Copyright 2014 Cloudera Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/L... | |
<|file_name|>LassoLarsIC.py<|end_file_name|><|fim▁begin|># Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | from utils import InputData, InputTypes
#Internal Modules End--------------------------------------------------------------------------------
class LassoLarsIC(ScikitLearnBase): |
<|file_name|>event.rs<|end_file_name|><|fim▁begin|>use system::memory;
<|fim▁hole|>
pub fn set_event_cancel(b: bool) {
memory::write(0x803BD3A3, b);
}<|fim▁end|> | pub fn event_cancel() -> bool {
memory::read(0x803BD3A3)
} |
<|file_name|>owner.go<|end_file_name|><|fim▁begin|>package pod
import (
"fmt"
"strings"
lru "github.com/hashicorp/golang-lru"
"github.com/rancher/norman/api/access"
"github.com/rancher/norman/types"
"github.com/rancher/norman/types/values"
"github.com/rancher/rancher/pkg/controllers/managementagent/workload"
... | SubContext string
Namespace string |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | def test_write_desc(self): |
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>// #docregion pt1
import {Component} from 'angular2/core';
// #docregion hero-class-1
export class Hero {
id: number;
name: string;
}
// #enddocregion hero-class-1
@Component({
selector: 'my-app',
template:`
<h1>{{title}}</h1><|fim▁hole|> <div>... | <h2>{{hero.name}} details!</h2> |
<|file_name|>media_queries.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/. */
//! Gecko's media-query device and expression represent... | /// Parse a media expression of the form:
///
/// ``` |
<|file_name|>event.rs<|end_file_name|><|fim▁begin|>use events;
pub fn vkeycode_to_element(code: u16) -> Option<events::VirtualKeyCode> {
Some(match code {
0x00 => events::VirtualKeyCode::A,
0x01 => events::VirtualKeyCode::S,
0x02 => events::VirtualKeyCode::D,
0x03 => events::Virtual... | 0x15 => events::VirtualKeyCode::Key4,
0x16 => events::VirtualKeyCode::Key6, |
<|file_name|>grift.go<|end_file_name|><|fim▁begin|>package grift
import (
"fmt"
"io"
"log"
"os"
"sort"
"sync"
"time"
)
var CommandName = "grift"
var griftList = map[string]Grift{}
var descriptions = map[string]string{}
var lock = &sync.Mutex{}
type Grift func(c *Context) error
// Add a grift. If there is alr... | return Run(name, c)
}
return nil |
<|file_name|>isset-unset.js<|end_file_name|><|fim▁begin|>var expect = require('chai').expect,
Model = require('../lib/model');
describe('attribute initial state', function () {
var ModelClass, NestedClass;
before(function () {
NestedClass = Model.inherit({
attributes: {
... | it('should change value to default', function () {
var model = new ModelClass({
a: 'a-1'
}); |
<|file_name|>sliplink.py<|end_file_name|><|fim▁begin|># Copyright (c) 2007-2017 Joseph Hager.
#
# Copycat is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License,<|fim▁hole|># WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY... | # as published by the Free Software Foundation.
#
# Copycat is distributed in the hope that it will be useful, but |
<|file_name|>channel_collection_type_manager.hh<|end_file_name|><|fim▁begin|>/**
\file "Object/inst/channel_collection_type_manager.hh"
Template class for instance_collection's type manager.
$Id: channel_collection_type_manager.hh,v 1.3 2007/04/15 05:52:17 fang Exp $
*/
#ifndef __HAC_OBJECT_INST_CHANNEL_COLLECTI... | must_be_collectibly_type_equivalent(const this_type&) const;
|
<|file_name|>size.rs<|end_file_name|><|fim▁begin|>use internal;
#[repr(C)]
#[derive(Debug, PartialEq, PartialOrd, Copy, Clone)]
#[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))]
pub struct Size {
pub width: f32,
pub height: f32,
}
impl From<Size> for internal::YGSize {
fn from(s: Size) -> inte... | |
<|file_name|>unique_list.hh<|end_file_name|><|fim▁begin|>// {{{ GPL License
// This file is part of gringo - a grounder for logic programs.
// Copyright (C) 2013 Roland Kaminski
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as publishe... | const_iterator begin() const { return const_iterator(_front); }
const_iterator end() const { return const_iterator(); }
iterator begin() { return iterator(_front); } |
<|file_name|>Utils.java<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> * Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writ... | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License, |
<|file_name|>negative_log_likelihood.rs<|end_file_name|><|fim▁begin|>//! TODO: DOC
//!
use capnp_util::*;
use co::{IBackend, ITensorDesc, SharedTensor};
use layer::*;
use juice_capnp::negative_log_likelihood_config as capnp_config;
use util::{ArcLock, native_backend};
#[derive(Debug, Clone)]
#[allow(missing_copy_impl... | let batch_size = Self::batch_size(input_data[0].desc());
let num_classes = self.num_classes;
let native = native_backend(); |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>import sys
import pigpio
import time
from colorama import Fore, Back, Style
def set_speed(lspeed, rspeed):
pi.hardware_PWM(left_servo_pin, 800, int(lspeed)*10000)
pi.hardware_PWM(right_servo_pin, 800, int(rspeed)*10000)
pi = pigpio.pi()
left_servo_pin = 13
ri... | die_distance = 8
ls = 100
rs = 100
print("start") |
<|file_name|>publish_queue.js<|end_file_name|><|fim▁begin|>'use strict';
var openUrl = require('./utils').open;
module.exports = new PublishQueue();
function PublishQueue() {
this.openPublishQueue = function() {
openUrl('/#/publish_queue');
};
this.getRow = function(rowNo) {
return eleme... | |
<|file_name|>visited.rs<|end_file_name|><|fim▁begin|>extern crate maze;<|fim▁hole|>#[test]
#[should_panic]
fn should_panic_if_index_out_of_range_for_visited() {
let vis = Visited::new(5, 7);
vis.visited(5, 7);
}
#[test]
fn should_have_initial_visited_state_of_false() {
let vis = Visited::new(10, 10);
f... |
use maze::visited::{Visited};
use maze::square_maze::{WallDirection};
|
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"regexp"
"strconv"
"strings"
<|fim▁hole|> // Third party code for routing
"github.com/gorilla/mux"
)
func main() {
router := mux.NewRouter().StrictSlash(true)
... | |
<|file_name|>syncengine.py<|end_file_name|><|fim▁begin|># Copyright (C) 2016-2020 Matthias Klumpp <matthias@tenstral.net>
#
# Licensed under the GNU Lesser General Public License Version 3
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public Lice... | from laniakea.msgstream import EventEmitter
class SyncEngine: |
<|file_name|>QuestionaireOutlineTreeProvider.java<|end_file_name|><|fim▁begin|>/**
* generated by Xtext
*/
package dk.itu.smdp.group2.ui.outline;
import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider;<|fim▁hole|>/**
* Customization of the default outline structure.
*
* see http://www.eclipse... | |
<|file_name|>search.js<|end_file_name|><|fim▁begin|>import { get } from '../get'
export function getSearchData(page, cityName, category, keyword) {
const keywordStr = keyword ? '/' + keyword : ''
const result = get('/api/search/' + page + '/' + cityName + '/' + category + keywordStr)<|fim▁hole|>}<|fim▁end|> | return result |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Assignment operators (`+=`, `-=`, `*=`, etc) traits
//!
//! Note that no operator sugar is provided, i.e. `x += y` won't use these traits.
//!
//! This crate is only a convenience for me, as I've the need of using these traits as bounds in
//! some of my libraries, ... | pub trait AddAssign<Rhs=Self> {
/// `a += b` -> `AddAssign::add_assign(&mut a, b)`
fn add_assign(&mut self, Rhs);
} |
<|file_name|>toptips.service.ts<|end_file_name|><|fim▁begin|>import { DOCUMENT } from '@angular/common';
import { ApplicationRef, ComponentFactoryResolver, Inject, Injectable, Injector } from '@angular/core';
import { BaseService } from 'ngx-weui/core';
import { ToptipsComponent, ToptipsType } from './toptips.component... | } |
<|file_name|>elasticsearch.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""
Collect the elasticsearch stats for the local node
#### Dependencies
* urlib2
"""
import urllib2
import re
try:
import json
json # workaround for pyflakes issue #13
except ImportError:
import simplejson as json
import dia... | metrics['cache.filter.size'] = cache['filter_size_in_bytes']
self._add_metric(metrics, 'cache.id.size', cache, |
<|file_name|>model_box.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# File: model_box.py
import numpy as np
from collections import namedtuple
import tensorflow as tf
from tensorpack.tfutils.scope_utils import under_name_scope
from config import config
@under_name_scope()
def clip_boxes(boxes, window, n... | image: NCHW
boxes: nx4, x1y1x2y2 |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>var successCount = 0;
for each (arg in args) {
if (process(arg)) {
successCount++;
}
}
write(successCount + " out of " + args.length + " benchmarks passed the test", "test.result");
exit();
function process(name) {
log = name + ".result";
s = ""... | } |
<|file_name|>faceTriangulation.C<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 3.2
\\ / A nd | Web: ... |
if (size <= 2)
{
WarningIn |
<|file_name|>las.rs<|end_file_name|><|fim▁begin|>//! Sink points into a las file.
use std::io::{Write, Seek};
use std::path::Path;
use las;
use Result;
use error::Error;
use point::{Point, ScanDirection};
use sink::{FileSink, Sink};
impl<W: Write + Seek> Sink for las::writer::OpenWriter<W> {
fn sink(&mut self, ... | point_format = 0
auto_offsets = true |
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>"""
Serializers for Video Abstraction Layer
Serialization is usually sent through the VideoSerializer which uses the
EncodedVideoSerializer which uses the profile_name as it's profile field.
"""
from rest_framework import serializers
from django.core.exceptions ... | model = Subtitle
lookup_field = "id"
fields = ( |
<|file_name|>vmware_dvswitch.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.com>
# 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
__metaclas... | local_action: |
<|file_name|>neptune.py<|end_file_name|><|fim▁begin|>import math
class Neptune:
"""
NEPTUNE - VSOP87 Series Version C
HELIOCENTRIC DYNAMICAL ECLIPTIC AND EQUINOX OF THE DATE
Rectangular (X,Y,Z) Coordinates in AU (Astronomical Units)
Series Validity Span: 4000 BC < Date < 8000 AD
... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use anyhow::Context;
use argh::FromArgs;
use engine::{Config, Processor};
use tokio::{fs::File, io::AsyncReadExt};
use tracing::{event, instrument, Level};
use tracing_subscriber::EnvFilter;
<|fim▁hole|>/// A simple site generator :)
struct Args {
#[argh(switch)]
... | #[derive(FromArgs)] |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url, include
import spirit.comment.bookmark.urls
import spirit.comment.flag.urls
import spirit.comment.history.urls
import spirit.comment.like.urls
from . import views
urlp... |
url(r'^upload/$', views.image_upload_ajax, name='image-upload-ajax'),
url(r'^bookmark/', include(spirit.comment.bookmark.urls, namespace='bookmark')), |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.utils import six
from sortedone2many.fields import SortedOneToManyField
def inject_extra_field_to_model(from_model, field_name, field):
if not isinstance(from_model, six.string_types):
field.contribute_to_class(from_mo... | # # TODO: `add_field` is never called. `class_prepared` already fired or never fire??
# class_prepared.connect(add_field) |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/*
* Panopticon - A libre disassembler
* Copyright (C) 2014, 2015 Panopticon authors
*
* 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, eit... | extern crate lazy_static; |
<|file_name|>MainActivity.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) by Michał Niedźwiecki 2016
* Contact: nkg753 on gmail or via GitHub profile: dzwiedziu-nkg
*
* This file is part of Bike Road Quality.
*
* Bike Road Quality is free software; you can redistribute it and/or modify
* it under the terms ... | import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView; |
<|file_name|>proxy.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/licenses/L... | |
<|file_name|>app_config.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _<|fim▁hole|>
class ContactsAppConfig(AppConfig):
name = 'apps.contacts'
verbose_name = _('Contacts')<|fim▁end|> | |
<|file_name|>test_oggspeex.py<|end_file_name|><|fim▁begin|>import os
import shutil
from mutagen._compat import cBytesIO
from mutagen.ogg import OggPage
from mutagen.oggspeex import OggSpeex, OggSpeexInfo, delete
from tests import add
from tests.test_ogg import TOggFileType
from tempfile import mkstemp
class TOggSpeex... | self.scan_file()
self.failIf(OggSpeex(self.filename).tags)
|
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import locale
from atom.ext.guardian.views import RaisePermissionRequiredMixin
from braces.views import (
FormValidMessageMixin,
LoginRequiredMixin,
SelectRelatedMixin,
UserFormKwargsMixin,
)
from cached_property import cached_property
from dateutil.re... | def get_subcomponents(self): |
<|file_name|>production.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
Production Configurations
- Use djangosecure
- Use mailgun to send emails
- Use redis
'''
from __future__ import absolute_import, unicode_literals
from django.utils import six
from .common import * # noqa
# SECRET CONFIGURATION
# -... | # ------------------------------------------------------------------------------
DEFAULT_FROM_EMAIL = env('DJANGO_DEFAULT_FROM_EMAIL',
default='{{cookiecutter.project_name}} <noreply@{{cookiecutter.domain_name}}>') |
<|file_name|>helpdesk.js<|end_file_name|><|fim▁begin|>/**
* Heldesks' code (Zendesk, etc..)
*/
App.helpdesk = {
init: function () {
// fetch template content from the extension
if (window.location.hostname.indexOf('zendesk.com') !== -1) {
App.helpdesk.zendesk.init();
}
},
... | document.body.removeChild(script);
}; |
<|file_name|>submit_paste.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*-coding:UTF-8 -*
"""
The Submit paste module
================
This module is taking paste in redis queue ARDB_DB and submit to global
"""
##################################
# Import External packages
###############################... |
def compute(self, uuid): |
<|file_name|>wamnclient.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import pygeoip
import json
from logsparser.lognormalizer import LogNormalizer as LN
import gzip
import glob
import socket
import urllib2
IP = 'IP.Of,Your.Server'
normalizer = LN('/usr/local/share/logsparser/normalizers')
gi = pygeoip.GeoIP('../G... | IP = p.read() |
<|file_name|>range.go<|end_file_name|><|fim▁begin|>package main
import "fmt"
func main() {
pow := make([]int, 10) //Lam bien go 10phan tu
for i := range pow {
pow[i] = 1 << uint(i) // == 2**i
}
for _, value := range pow {
fmt.Printf("%d\n", value)
}<|fim▁hole|>}<|fim▁end|> | |
<|file_name|>appmon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
###
# Copyright (c) 2016 Nishant Das Patnaik.
#
# 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.apa... | print((colored("[ERROR] Can't spawn %s" % app_name, "red")))
traceback.print_exc()
sys.exit(1) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.