prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate clap;
// Time Start: Mon, 02 Dec 2019 12:59:41 -0500
// Time Finish 1: Mon, 02 Dec 2019 14:46:54 -0500 (1 hour, 47 minutes, 13 seconds)
// Time Finish 2: Mon, 02 Dec 2019 14:53:56 -0500 (7 minutes, 2 seconds)
// Time Total: 1 hour, 54 minutes, 15 seconds
... | ic.run();
println!("Part 1: {}", ic.get(0));
} |
<|file_name|>next_reject_back.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
use core::str::pattern::ReverseSearcher;
use core::str::pattern::CharSearcher;
use core::str::pattern::Pattern;
// #[derive(Clone)]
// pub struct CharSearcher<'a>(<CharEqPatt... | // type Searcher: Searcher<'a>;
//
// /// Constructs the associated searcher from
// /// `self` and the `haystack` to search in. |
<|file_name|>URLInviz.js<|end_file_name|><|fim▁begin|>// document.getElementsByTagName('body')[0].style.visibility = 'hidden';
// //console.log("first" + "/\\b" + "Hello" + "\\b/gi");<|fim▁hole|>
var fn2 = function() {
//console.log('running');
document.getElementsByTagName('body')[0].style.visibility = 'hidden... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | """Test segzify.""" |
<|file_name|>threaded.py<|end_file_name|><|fim▁begin|>import queue
import logging
import platform
import threading
import datetime as dt
import serial
import serial.threaded
import serial_device
from .or_event import OrEvent
logger = logging.getLogger(__name__)
# Flag to indicate whether queues should be polled.
#... | ----------
state : dict
State dictionary to share ``protocol`` object reference.
comport : str |
<|file_name|>Start.py<|end_file_name|><|fim▁begin|>from foam.sfa.util.xrn import urn_to_hrn<|fim▁hole|>from foam.sfa.trust.credential import Credential
from foam.sfa.trust.auth import Auth
class Start:
def __init__(self, xrn, creds, **kwargs):
hrn, type = urn_to_hrn(xrn)
valid_creds = Auth().c... | |
<|file_name|>uri-template.js<|end_file_name|><|fim▁begin|>import { expect } from 'chai';
import buildUriTemplate from '../src/uri-template';
describe('URI Template Handler', () => {
context('when there are path object parameters', () => {
context('when the path object parameters are not query parameters', () =>... | type: 'string',
}, |
<|file_name|>gt.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
// pub trait FixedSizeArray<T> {
// /// Converts the array to immutable slice
// fn as_slice(&self) -> &[T];
// /// Converts the array to mutable slice
// fn as_mut_slice(&m... | // fn as_ref(&self) -> &[T] {
// &self[..] |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from unittest import TestCase
from chess import get_potential_moves
class ChessTestCase(TestCase):
def setup(self):
pass
def teardown(self):
pass
def test_knight(self):
response = get_potential_moves('knight', 'd2')
respo... |
for each in possible_moves:
self.assertTrue(each in response) |
<|file_name|>helpers.js<|end_file_name|><|fim▁begin|>//!Defines two helper functions.
/*
* c
* https://github.com/rumpl/c
*
* Copyright (c) 2012 Djordje Lukic
* Licensed under the MIT license.
*/
"use strict";
const helpers = module.exports;
<|fim▁hole|>const colors = require("colors/safe"); //Despit... | |
<|file_name|>test_functions2.py<|end_file_name|><|fim▁begin|>import math
from sympy.mpmath import *
def test_bessel():
mp.dps = 15
assert j0(1).ae(0.765197686557966551)
assert j0(pi).ae(-0.304242177644093864)
assert j0(1000).ae(0.0247866861524201746)
assert j0(-25).ae(0.0962667832759581162)
ass... | assert ellipe(3+4j).ae(1.4995535209333469543-1.5778790079127582745j) |
<|file_name|>dns.go<|end_file_name|><|fim▁begin|>/*
Copyright 2015 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/LIC... | |
<|file_name|>mod.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/licens... | a_region: Region,
b_region: Region)
-> bool { |
<|file_name|>messaging.py<|end_file_name|><|fim▁begin|><|fim▁hole|># 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 writing, software
# distributed under the Lice... | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
<|file_name|>session.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# papyon - a python client library for Msn<|fim▁hole|>#
# Copyright (C) 2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2008 Richard Spiers <richard.spiers@gmail.com>
#
# This program is free software; you can redistribute it and/or mod... | |
<|file_name|>FooController.java<|end_file_name|><|fim▁begin|>package org.jsondoc.core.issues.issue151;
import org.jsondoc.core.annotation.Api;
import org.jsondoc.core.annotation.ApiMethod;
import org.jsondoc.core.annotation.ApiResponseObject;
@Api(name = "Foo Services", description = "bla, bla, bla ...", group = "foo... | public FooWrapper<BarPojo> getBar() {
return null;
}
|
<|file_name|>ScrollerProxy.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2013-2014 EaseMob Technologies. 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... | public void forceFinished(boolean finished) {
|
<|file_name|>where2.py<|end_file_name|><|fim▁begin|>"""
# A Better Where
WHERE2 is a near-linear time top-down clustering alogithm.
WHERE2 updated an older where with new Python tricks.
## Standard Header Stuff
"""
from __future__ import division,print_function
import sys
sys.dont_write_bytecode = True
from lib... | prunes as it divides the data.dat. GALE checks for
domination between the poles and ignores data.dat in |
<|file_name|>resource.rs<|end_file_name|><|fim▁begin|>//! `Resource` data description.
use std::fmt;
use serde::de::{
value::Error as ValueError, Deserialize, Deserializer, Error, IgnoredAny, IntoDeserializer,
MapAccess, Visitor,
};
use super::super::resources::ResourceType;
use crate::data::RoomName;
with_u... | }
}
deserializer.deserialize_identifier(FieldVisitor) |
<|file_name|>RentalStatus.java<|end_file_name|><|fim▁begin|>package com.baldy.commons.models.ref;<|fim▁hole|>
/**
* @author mbmartinez
*/
public enum RentalStatus {
AVAILABLE,
LEASED
}<|fim▁end|> | |
<|file_name|>info.py<|end_file_name|><|fim▁begin|># DFF -- An Open Source Digital Forensics Framework
# Copyright (C) 2009-2011 ArxSys
# This program is free software, distributed under the terms of
# the GNU General Public License Version 2. See the LICENSE file
# at the top of the source tree.
#
# See http://www.di... |
class INFO(Script, VariantTreePrinter):
def __init__(self):
Script.__init__(self, "info") |
<|file_name|>xattr.rs<|end_file_name|><|fim▁begin|>//! Extended attribute support for Darwin and Linux systems.
extern crate libc;
use std::io;
use std::path::Path;
pub const ENABLED: bool = cfg!(feature="git") && cfg!(any(target_os="macos", target_os="linux"));
pub trait FileAttributes {
fn attributes(&self) -... | unsafe {
listxattr(c_path.as_ptr(), ptr::null_mut(), 0)
}
} |
<|file_name|>createController.js<|end_file_name|><|fim▁begin|>var app = angular.module("ethics-app");
// User create controller
app.controller("userCreateController", function($scope, $rootScope, $routeParams, $filter, $translate, $location, config, $window, $authenticationService, $userService, $universityService, $... | }) |
<|file_name|>resources.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-<|fim▁hole|>#
# Resources to make it easier and faster to implement and test game of life
#
# @author Mikael Wikström
# https://github.com/leakim/GameOfLifeKata
#
import pygame
class GameOfLife:
# still
BLOCK_0 ... | |
<|file_name|>run_rec_mrbpr.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# =======================================================================
# This file is part of MCLRE.
#
# MCLRE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#... | EXPERIMENT_NAME = ARGS.experiment_name
REGION = ARGS.region
ALGORITHM_NAME = ARGS.algorithm |
<|file_name|>SwitchPhase.py<|end_file_name|><|fim▁begin|># Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without lim... | def getSwitch(self): |
<|file_name|>VisualBlock.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, absolute_import
from PySide2 import QtGui,QtCore,QtWidgets
from math import *
import pickle, os, json
import learnbot_dsl.guis.EditVar as EditVar
from learnbot_dsl.learnbotCode.Block import *
from learnbot_dsl.learnbotCode.L... | |
<|file_name|>main_intents_strategy.py<|end_file_name|><|fim▁begin|>'''
Created on Nov 26, 2014
@author: Yury Zhauniarovich <y.zhalnerovich{at}gmail.com>
'''
import os, time
from interfaces.adb_interface import AdbInterface
from bboxcoverage import BBoxCoverage
from running_strategies import IntentInvocationStrategy
... | bboxcoverage.stopTesting("main_intents", paramsToWrite=params)
except:
print "Exception while running strategy!" |
<|file_name|>Physics.ts<|end_file_name|><|fim▁begin|>import { Physics as EightBittrPhysics } from "eightbittr";
import { FullScreenPokemon } from "../FullScreenPokemon";
import { Direction } from "./Constants";
import { Character, Grass, Actor } from "./Actors";
/**
* Physics functions to move Actors around.
*/
ex... | return Direction.Left; |
<|file_name|>shapeshift.js<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity 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 ... |
if (error) { |
<|file_name|>test-ae-rbm.py<|end_file_name|><|fim▁begin|>import os
from rbm import RBM
from au import AutoEncoder
import tensorflow as tf<|fim▁hole|>
flags = tf.app.flags
FLAGS = flags.FLAGS
flags.DEFINE_string('data_dir', '/tmp/data/', 'Directory for storing data')
flags.DEFINE_integer('epochs', 50, 'The number of tra... | import input_data
from utilsnn import show_image, min_max_scale
import matplotlib.pyplot as plt |
<|file_name|>subtypingWithCallSignaturesA.js<|end_file_name|><|fim▁begin|>//// [subtypingWithCallSignaturesA.ts]
declare function foo3(cb: (x: number) => number): typeof cb;<|fim▁hole|>//// [subtypingWithCallSignaturesA.js]
var r5 = foo3(function (x) { return ''; });<|fim▁end|> | var r5 = foo3((x: number) => ''); // error
|
<|file_name|>test_get_role_details_action.py<|end_file_name|><|fim▁begin|>from unittest import mock
from taskplus.core.actions import GetRoleDetailsAction, GetRoleDetailsRequest
from taskplus.core.domain import UserRole
from taskplus.core.shared.response import ResponseFailure
def test_get_role_details_action():
... | |
<|file_name|>wp-category-show.js<|end_file_name|><|fim▁begin|>/**
* Javascript file for Category Show.
* It requires jQuery.
*/
function wpcs_gen_tag() {<|fim▁hole|> // There is a need to add the id%% tag to be compatible with other versions
$("#wpcs_gen_tag").val("%%wpcs-"+$("#wpcs_term_dropdown").val()+"%%"+$("#... | // Category Show searches for term_id since 0.4.1 and not term slug. |
<|file_name|>toolchain.py<|end_file_name|><|fim▁begin|># Directives using the toolchain
# documentation.
import docutils
<|fim▁hole|> app.add_object_type("ppdirective", "ppdir");
app.add_object_type("literal", "lit");<|fim▁end|> | def setup(app):
app.add_object_type("asmdirective", "asmdir");
app.add_object_type("asminstruction", "asminst");
app.add_object_type("ppexpressionop", "ppexprop"); |
<|file_name|>Updatedserver.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import logging
import os
import urllib
from cvmfsreplica.cvmfsreplicaex import PluginConfigurationFailure
from cvmfsreplica.interfaces import RepositoryPluginAcceptanceInterface
import cvmfsreplica.pluginsmanagement as pm
class Updated... |
# read the local revision number |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .decorators import render_to_json<|fim▁hole|><|fim▁end|> | from .helper import HeadFileUploader, ImageFactory, BaseModelManager, get_first_letter, convertjson |
<|file_name|>IEntityService.ts<|end_file_name|><|fim▁begin|> module app.shared {<|fim▁hole|> }<|fim▁end|> | export interface IEntityService<T extends IEntity> {
post : (entity : T) => ng.IPromise<T>;
} |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup
from setuptools import find_packages
setup(
name='geonition_aliases',
version='0.0.1',
author='Dariusz Walczak',
url='',
packages=find_packages(),
include_package_data=True,
package_data = {
"geoforms": ... | |
<|file_name|>trans_frater_augmentation.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# This file is part of CONCUSS, https://github.com/theoryinpractice/concuss/,
# and is Copyright (C) North Carolina State University, 2015. It is licensed
# under the three-clause BSD license; see LICENSE.
#
<|fim▁hole|>from lib... | |
<|file_name|>wrapper.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.<|fim▁hole|>// option. This file may not be copied, modified, or distributed
// except according to those... | //
// 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 |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import itertools
from django.conf import settings
from django.contrib.syndication.views import Feed, FeedDoesNotExist
from django.utils import timezone
from schedule.feeds.ical import ICalendarFeed
from schedule.models import Calendar
class UpcomingEventsFeed(Fe... | |
<|file_name|>PokemonRarity_pb2.py<|end_file_name|><|fim▁begin|># Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Enums/PokemonRarity.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from goog... | serialized_start=58,
serialized_end=112,
) |
<|file_name|>lecroyBaseScope.py<|end_file_name|><|fim▁begin|>"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the S... | None,
ivi.Doc("""
Sets the current grid used in the display. There are multiple grid modes. |
<|file_name|>ioport.rs<|end_file_name|><|fim▁begin|>// Copyright Dan Schatzberg, 2015. This file is part of Genesis.
// Genesis is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by<|fim▁hole|>// but WITHOUT ANY WARRANTY; without even the... | // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Genesis is distributed in the hope that it will be useful, |
<|file_name|>WsdlGeneratorPipe.java<|end_file_name|><|fim▁begin|>/*
Copyright 2016, 2020 Nationale-Nederlanden, 2020-2021 WeAreFrank!
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
... | |
<|file_name|>stub_activity.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2011 The Android Open Source Project
//
// 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.apac... | #pragma rs java_package_name(android.renderscript.cts)
|
<|file_name|>ct04.cpp<|end_file_name|><|fim▁begin|>/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redi... | }
} |
<|file_name|>SpellEffects.cpp<|end_file_name|><|fim▁begin|>/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* 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 Softwar... | |
<|file_name|>helper.rs<|end_file_name|><|fim▁begin|>// This file provides a const function that is unstably const forever.
#![feature(staged_api)]
#![stable(feature = "1", since = "1.0.0")]
#[stable(feature = "1", since = "1.0.0")]
#[rustc_const_unstable(feature = "foo", issue = "none")]<|fim▁hole|>pub const fn unsta... | |
<|file_name|>gantry-totop.js<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> * @author RocketTheme http://www.rockettheme.com
* @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
*/
eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!... | * @version $Id: gantry-totop.js 58623 2012-12-15 22:01:32Z btowles $ |
<|file_name|>testCombined.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem.PyMol import MolViewer
from rdkit.Chem.Subshape import SubshapeBuilder,SubshapeObjects,SubshapeAligner
from rdkit.six.moves import cPickle
import copy
m1... | print(len(algs))
print(pruneStats)
import os,tempfile |
<|file_name|>fileBased.spec.js<|end_file_name|><|fim▁begin|>var loadJsons = require('../lib/loadJsons');
describe("Get a recursive directory load of JSONs", function() {
var data;
beforeEach(function(done) {
if(data) done();
else {
loadJsons("./specs")(function(d) {
data = d;
done();
... | |
<|file_name|>split_check.rs<|end_file_name|><|fim▁begin|>// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
use std::path::Path;
use std::sync::mpsc::{self, sync_channel};
use std::sync::Arc;
use std::time::Duration;
use engine_rocks::raw::DB;
use engine_rocks::Compat;
use raftstore::coprocessor::{
... | m.insert("coprocessor.batch_split_limit".to_owned(), "123".to_owned()); |
<|file_name|>baseline_picdata.py<|end_file_name|><|fim▁begin|>import sys
import os
#For baseline and redundacy-detecion to prepare message size picture
def MessageSize(typePrefix, directory):
wf = open("%(typePrefix)s-msgsize.data"%vars(), "w")
wf.write("#Suggest Filename: %(typePrefix)s-message.data\n#Dat... | |
<|file_name|>stefan.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#Author: Stefan Toman
if __name__ == '__main__':
n = int(input())
a = set(map(int, input().split()))
m = int(input())
b = set(map(int, input().split()))
print(len(a-b))<|fim▁end|> | #!/usr/bin/env python3
|
<|file_name|>main.js<|end_file_name|><|fim▁begin|>/* ========================================================================
* DOM-based Routing
* Based on http://goo.gl/EUTi53 by Paul Irish
*
* Only fires on body classes that match. If a body class contains a dash,
* replace the dash with an underscore when addi... |
// Load Events |
<|file_name|>state_test.go<|end_file_name|><|fim▁begin|>package models
import (
"testing"
"time"
)
func TestSetServiceState(t *testing.T) {
err := SetServiceState("testState", time.Now().UTC(), 1)
if err != nil {
t.Error(err)
return
}
}<|fim▁hole|>func TestSetServiceStateByDays(t *testing.T) {
err := SetSer... | |
<|file_name|>InitialDirContext.java<|end_file_name|><|fim▁begin|>/*===========================================================================
* Licensed Materials - Property of IBM
* "Restricted Materials of IBM"
*
* IBM SDK, Java(tm) Technology Edition, v8
* (C) Copyright IBM Corp. 1999, 2009. All Rights Reserv... | }
public Attributes getAttributes(Name name)
throws NamingException { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2019 The dm_control 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.... | from dm_control.entities.manipulators.kinova.jaco_arm import JacoArm
from dm_control.entities.manipulators.kinova.jaco_hand import JacoHand |
<|file_name|>models.go<|end_file_name|><|fim▁begin|>package managedservices
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause in... | }
|
<|file_name|>111815001.py<|end_file_name|><|fim▁begin|>import random
import math
import sympy
from sympy import latex, fraction, Symbol, Rational
localid =11181500100000
letter=["a","b","c","d"]
n=[0,0,0,0,0,0]
m=[0,0,0,0,0]
f = open("111815001.tex","w") #opens file with name of "test.txt"
for x in range(0, 1000)... | zz=random.randint(1,6)
if zz==1:
letter[1]=latex(Rational(m[4],m[3]))
elif zz==2: |
<|file_name|>UDPScanThread.java<|end_file_name|><|fim▁begin|>package com.ks.net;
import java.io.IOException;
import java.net.DatagramPacket;<|fim▁hole|>
import com.ks.activitys.IndexActivity.IndexHandler;
import com.ks.net.enums.MessageEnums;
public class UDPScanThread extends Thread {
private static final int UDPP... | import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketTimeoutException;
import java.util.ArrayList; |
<|file_name|>widget.ts<|end_file_name|><|fim▁begin|>import {WidgetConfig} from '../shared/widget-config';
import {WidgetService} from '../shared/widget.service';
export class Widget {
title: string;
updateInterval: number = 1000;
widgetConfig: WidgetConfig;
titleUrl: string;
description: string;
construc... | this.titleUrl = widgetConfig.titleUrl;
this.description = widgetConfig.description;
this.triggerUpdate();
} |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, url
from .views import MediaLibraryAPIView, MediaLibraryItemView, AddShelfRelationAPIView
<|fim▁hole|>urlpatterns = patterns('',
url(r'^(?P<type>(audio|video|image))/$', MediaLibraryAPIView.as_view(), name='medialibrary'),
... | |
<|file_name|>msg-ctrl.js<|end_file_name|><|fim▁begin|>define(['./module'], function (controllers) {
'use strict';<|fim▁hole|>});<|fim▁end|> | controllers.controller('msg_ctrl', [function ($scope) {}]); |
<|file_name|>OverviewPanelItem.js<|end_file_name|><|fim▁begin|>///
// Dependencies
///
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import classNames from 'classnames';
import isString from 'lodash/isString';
import * as types from './types';
import Panel from 'react-bo... | this.onSelect = this.onSelect.bind(this); |
<|file_name|>csv_converter.py<|end_file_name|><|fim▁begin|># Copyright 2005-2010 Wesabe, 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-... |
txn_list = []
for stmt in stmt_obj: |
<|file_name|>element.js<|end_file_name|><|fim▁begin|>/**
* The DOM Element unit handling
*
* Copyright (C) 2008-2011 Nikolay Nemshilov
*/
var Element = RightJS.Element = new Class(Wrapper, {
/**
* constructor
*
* NOTE: this constructor will dynamically typecast
* the wrappers depending on the e... | make_element = function(tag, options) {
if (options !== undefined && (tag === 'input' || tag === 'button')) {
tag = '<'+ tag +' name="'+ options.name + |
<|file_name|>ask.js<|end_file_name|><|fim▁begin|>//you will need an API key from https://developer.voicesignin.com
var https = require('https');
exports.handler = (event, context, callback) => {
const crypto = require('crypto');
const hash = crypto.createHash('sha256');
console.log(JSON.stringify(eve... |
var requestResponse = JSON.parse(rawData);
console.log('reqresp: ' + JSON.stringify(requestResponse)); |
<|file_name|>Stixai.py<|end_file_name|><|fim▁begin|>import random
class ai:
def __init__(self, actions, responses):
self.IN = actions
self.OUT = responses
def get_act(self, action, valres):
if action in self.IN:
mList = {}
for response in self.OUT:
... | return resp
def update(ins, outs):
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Combines sequences of arithmetic or logical instructions into single instructions.
//! For every instruction, try to combine one of its operands into itself. This
//! transforms linear data-dependency chains into trees.
use analysis::analyzer::{
Action, Analyzer... | /// Skip this substitution.
Skip,
|
<|file_name|>ribi_create_tally_test.cpp<|end_file_name|><|fim▁begin|>#include "ribi_create_tally.h"
#include <iostream>
#include <fstream>
// Boost.Test does not play well with -Weffc++
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include <boost/test/unit_test.hpp>
using namespace ribi;
BO... | BOOST_CHECK(result == expected);
}
{
const std::vector<std::string> v = { "A", "B" }; |
<|file_name|>q14.py<|end_file_name|><|fim▁begin|>"""
问题描述:给定一个正数数组arr,其中所有的值都为整数,以下是最小不可组成和的概念:
1)把arr每个子集内的所有元素加起来会出现很多值,其中最小的记为min,最大的记为max.
2)在区间[min,max]上,如果有数不可以被arr某一个子集相加得到,那么其中最小的那个数是
arr的最小不可组成和.
3)在区间[min,max]上,如果所有的数都可以被arr的某一个子集相加得到,那么max+1是arr
的最小不可组成和.
请写函数返回正数数组arr的最小不可组成和.
举例:
arr=[3, 2, 5],子集{2}相加产生2为... | cur_set.add(cur_sum)
return
cls.process(arr, index+1, cur_sum+arr[index], cur_set) |
<|file_name|>docente-model.js<|end_file_name|><|fim▁begin|>define(['backbone', 'underscore'], function (Backbone, _) {
return Backbone.Model.extend({<|fim▁hole|> defaults: {
persona: {
personaPnombre: '',
personaSnombre: '',
personaApaterno: '',
personaAmaterno: '',
dni: ''
}
},
validate... | idAttribute: 'username', |
<|file_name|>bot.cpp<|end_file_name|><|fim▁begin|>/*
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 2012 <copyright holder> <email>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publis... | nearestNode = map->graphNodes[i]; |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
<|fim▁hole|>setup(name='my_project',
version='0.1.0',
packages=['my_project'],
entry_points={
'console_scripts': [
'my_project = crawler.__main__:main'
]
},
in... | from setuptools import setup
|
<|file_name|>HotelRepository.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2012-2016 the original author or 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://... | Hotel findByCityAndName(City city, String name);
@Query("select h.city as city, h.name as name, avg(r.rating) as averageRating "
+ "from Hotel h left outer join h.reviews r where h.city = ?1 group by h") |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# scikit-survival documentation build configuration file
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autog... | #add_function_parentheses = True
|
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import os
from typing import Dict, List, Union
OptionalJSON = Union[List, Dict, float, int, str, bool, None]
def ensure_dir_exists(directory):
if not os.path.exists(directory):
os.mkdir(directory)
def get_dir(directory: str) -> str:
"""
Return... | |
<|file_name|>oauth.js.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for JavaScript software for implementing an OAuth consumer
// Project: https://code.google.com/p/oauth/
// Definitions by: NOBUOKA Yu <https://github.com/nobuoka>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare namespace... | * Encoded values are joined with an ampersand character (&) in between them.
* @see {@link https://tools.ietf.org/html/rfc5849#section-3.6} |
<|file_name|>jquery.inputmask.numeric.extensions-2.5.0.js<|end_file_name|><|fim▁begin|>/*
Input Mask plugin extensions
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) 2010 - 2014 Robin Herbots
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
Version: 2.5.0
Optional exte... | isNumeric: true,
digits: "*", //number of fractionalDigits
groupSeparator: "",//",", // | "."
radixPoint: ".", |
<|file_name|>outlier_cleaner.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import math
def outlierCleaner(predictions, ages, net_worths):
"""
Clean away the 10% of points that have the largest
residual errors (difference between the prediction
and the actual net worth).
Return... | print sorted_data |
<|file_name|>pastetext.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
(function()
{
CKEDITOR.dialog.add( 'pastetext', function( editor )
{
return {
title : editor.lang.p... | type : 'textarea',
|
<|file_name|>test.py<|end_file_name|><|fim▁begin|>import numpy as np
import time
import matplotlib.pyplot as plt
from AndorSpectrometer import Spectrometer
spec = Spectrometer(start_cooler=False,init_shutter=True)
#time.sleep(30)
spec.SetCentreWavelength(650)
spec.SetSlitWidth(100)
# spec.SetImageofSlit()
# slit =... | |
<|file_name|>base.js<|end_file_name|><|fim▁begin|>if(!Hummingbird) { var Hummingbird = {}; }
Hummingbird.Base = function() {};
Hummingbird.Base.prototype = {
validMessageCount: 0,
messageRate: 20,
initialize: function() {
this.averageLog = [];
this.setFilter();
this.registerHandler();
},
reg... | this.onMessage(message, this.average());
}
} |
<|file_name|>test_acl.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | from swift3.test.functional.utils import get_error_code
from swift3.etree import fromstring |
<|file_name|>response.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from decimal import Decimal as D
class NexmoResponse(object):
"""A convenient wrapper to manipulate the Nexmo json response.
The class makes it easy to retrieve information about sent messa... | self.message_count = len(self.messages)
self.total_price = sum(msg.message_price for msg in self.messages)
self.remaining_balance = min(msg.remaining_balance for msg in self.messages) |
<|file_name|>ValidConfig.ts<|end_file_name|><|fim▁begin|>/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import {Config} from '@jest/types';
import {replaceP... |
export default initialOptions; |
<|file_name|>c006.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
using namespace std;
int main()
{
int a,b,c,d;
int sum=1080;
while(cin>>a>>b>>c>>d)
{
if(a==0&&b==0&&c==0&&d==0)
break;
if(a>b)
{
sum=(a-b)*9+sum;
}
... | |
<|file_name|>sshkey.go<|end_file_name|><|fim▁begin|>package util
import (
"crypto"
"io"
"golang.org/x/crypto/ssh"
)
func SignatureFormatFromSigningOptionAndCA(opt string, ca ssh.PublicKey) string {
switch {
case ca != nil && ca.Type() == ssh.KeyAlgoED25519:
return ssh.KeyAlgoED25519
case ca != nil && ca.Type... | } |
<|file_name|>decomp.py<|end_file_name|><|fim▁begin|>"""
PySAR
Polarimetric SAR decomposition
Contents
--------
decomp_fd(hhhh,vvvv,hvhv,hhvv,numthrd=None) : Freeman-Durden 3-component decomposition
"""
from __future__ import print_function, division
import sys,os
import numpy as np
###===========================... | --------- |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2019 Canonical Ltd
#
# 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... | # Pull in helpers that 'charms_openstack.plugins' will export |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[doc = r" Value read from the register"]
pub struct R {
bits: u32,<|fim▁hole|>}
#[doc = r" Value to write to the register"]
pub struct W {
bits: u32,
}
impl super::CNT {
#[doc = r" Modifies the contents of the register"]
#[inline(always)]
pub fn modi... | |
<|file_name|>procfs_net_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 Gravitational, 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.0
Un... | sockets, err = getTCPSocketsFromPath("fixtures/tcp6")
c.Assert(err, IsNil)
c.Assert(sockets, Not(IsNil))
} |
<|file_name|>entity.js<|end_file_name|><|fim▁begin|>'use strict';
var _ = require('lodash');
var Q = require('q');
var util = require('util');
var should = require('./utils/should');
var descriptors = require('./utils/descriptors');
var Attribute = require('./attribute');
var AssertionResult = require('./assertion-res... | _.forEach(mapping, function(matcher, name) { |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2015, Alberto Corona <alberto@0x1a.us>
// All rights reserved. This file is part of core-utils, distributed under the
// GPL v3 license. For full terms please see the LICENSE file.
#![crate_type = "lib"]
#![feature(path_relative_from,exit_status)]
exte... | println!("{}: Missing arguments\n\
Try '{} --help' for more information", prog, prog); |
<|file_name|>index.spec.js<|end_file_name|><|fim▁begin|>const {suite} = require('suitape');
const snakeobj = require('./../index');
suite('snakeobj object', (test) => {
test('Returns same as input if input is not an object', (assert) => {
[1, 'hola', true, new Date()].forEach(input => {
const out = snakeob... | assert('equal', out, input);
}); |
<|file_name|>types.ts<|end_file_name|><|fim▁begin|>/* Copyright (c) Ben Robert Mewburn
* Licensed under the ISC Licence.
*/
'use strict';
import { Range } from 'vscode-languageserver-types';
export interface Predicate<T> {
(t: T): boolean;
}
export interface DebugLogger {
debug(message: string): void;
}
... |
parent() {
if (this._spine.length > 1) { |
<|file_name|>feed.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import logging<|fim▁hole|>import types
import dateutil.parser
import feedparser
import pytz
import http
from html_sanitizer import HTMLSanitizer
def getFeed(url):
current_feed = []
content = http.get(url)
feed = feedparser.parse(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.