prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>combinelatest.js<|end_file_name|><|fim▁begin|>/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
*
* @example
* 1 - obs = Rx.Observable.combineLatest(obs1, obs2, ob... |
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) { |
<|file_name|>ops.py<|end_file_name|><|fim▁begin|>import theano
import theano.tensor as T
from theano.sandbox.cuda.basic_ops import (as_cuda_ndarray_variable,
host_from_gpu,
gpu_contiguous, HostFromGpu,
... | b_u = (1. - a)*0. + a*b_u |
<|file_name|>figure2_2a.py<|end_file_name|><|fim▁begin|>'''
Created on Dec 5, 2016
@author: paveenju
'''
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib2tikz.save as tikz_save
import utils.functions as fn
if __name__ == '__main__':
pass
def axes():
... | # data generation
|
<|file_name|>render_backend.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/. */
//! The high-level module responsible for managing the... | debug!("\tdocument {:?}", id);
let scene_name = format!("scene-{}-{}", id.namespace_id.0, id.id);
let scene = config.deserialize_for_scene::<Scene, _>(&scene_name)
.expect(&format!("Unable to open {}.ron", scene_name)); |
<|file_name|>sha2.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... | |
<|file_name|>parquet_dataset_kernel.cc<|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
Unl... | return tensorflow::errors::Unimplemented(absl::StrCat(
"This Parquet Data Type is unimplemented ",
file_metadata->schema()->Column(i)->physical_type()));
} |
<|file_name|>statevector.js<|end_file_name|><|fim▁begin|>//________________________________________________________________________________________________
// statevector.js
//todo: update description
//
// cStateVector object - This is a generic container useful for ...
// Every item added to the queue is time st... | |
<|file_name|>instance.py<|end_file_name|><|fim▁begin|># Copyright 2014-2015 Isotoma Limited
#
# 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
#
... | |
<|file_name|>filter.ts<|end_file_name|><|fim▁begin|>/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2017, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.... | */
constructor(source: IIterator<T>, fn: (value: T, index: number) => boolean) {
this._source = source;
this._fn = fn; |
<|file_name|>json.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import json
class JSONRenderer:
"""
Renders a mystery as JSON
"""
<|fim▁hole|><|fim▁end|> | def render(self, mystery):
return json.dumps(mystery.encode(), indent=4) |
<|file_name|>qmqp.cc<|end_file_name|><|fim▁begin|>// nullmailer -- a simple relay-only MTA
// Copyright (C) 2018 Bruce Guenter <bruce@untroubled.org>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software F... | if(msg.eof())
size += msg.last_count();
return size > 0; |
<|file_name|>thrift_build.rs<|end_file_name|><|fim▁begin|>// @generated by autocargo
use std::env;
use std::fs;
use std::path::Path;
use thrift_compiler::Config;
#[rustfmt::skip]
fn main() {
// Rerun if this gets rewritten.
println!("cargo:rerun-if-changed=thrift_build.rs");
let out_dir = env::var_os("OU... |
let conf = { |
<|file_name|>shortanswer.module.ts<|end_file_name|><|fim▁begin|>// (C) Copyright 2015 Martin Dougiamas
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/lice... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use bytes::Buf;
use futures::{Async, Future, Poll};
use h2::{Reason, SendStream};
use http::header::{
HeaderName, CONNECTION, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, TE, TRAILER,
TRANSFER_ENCODING, UPGRADE,
};
use http::HeaderMap;
use body::Payload;
mod client... | pub(crate) use self::server::Server;
|
<|file_name|>group.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Stephen Fromm <sfromm@gmail.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
__metaclass... | |
<|file_name|>sys_rekey.go<|end_file_name|><|fim▁begin|>package api
import (
"context"
"errors"
"github.com/mitchellh/mapstructure"
)
func (c *Sys) RekeyStatus() (*RekeyStatusResponse, error) {
r := c.c.NewRequest("GET", "/v1/sys/rekey/init")
ctx, cancelFunc := context.WithCancel(context.Background())
defer ca... | |
<|file_name|>lockscreen_rc.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.8.0)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x04\x31\
\x89\
\x50\x4e\x47\x0d\x0a\x... | \xeb\xee\xe8\xeb\xeb\x56\x5f\x80\xe6\xed\xed\x56\x61\x80\xe8\xec\ |
<|file_name|>RoleGraphViewer.java<|end_file_name|><|fim▁begin|>package de.uni.freiburg.iig.telematik.sewol.accesscontrol.rbac.lattice.graphic;
import org.apache.commons.collections15.Factory;
import edu.uci.ics.jung.graph.Graph;
import edu.uci.ics.jung.graph.SparseMultigraph;
public class RoleGraphViewer {
Graph<In... | return nodeCount++;
} |
<|file_name|>maxSumSub.py<|end_file_name|><|fim▁begin|>def maxSumSub(arr):
maxSums = [0]*len(arr)
for i in range(len(arr)):<|fim▁hole|> if (arr[j] < arr[i]):
s = maxSums[j] + arr[i]
if (s > maxS):
maxS = s
maxSums[i] = maxS
return max(ma... | Si = arr[i]
maxS = Si
for j in range(0,i): |
<|file_name|>helper.rs<|end_file_name|><|fim▁begin|>/// Turn a failed parse into `None` and a successful parse into `Some`.
///
/// - **Syntax:** `option!(THING)`
/// - **Output:** `Option<THING>`
///
/// ```rust
/// extern crate syn;
/// #[macro_use] extern crate synom;
///
/// use syn::tokens::Bang;
///
/// named!(ma... | /// type, you'll find this in quite a few parsers. This is also the primary way
/// to parse punctuation.
///
/// - **Syntax:** `syn!(TYPE)` |
<|file_name|>ctx.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
flask.ctx
~~~~~~~~~
Implements the objects required to keep the context.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import sys
from fun... | |
<|file_name|>next-tick-gambi.js<|end_file_name|><|fim▁begin|>function getFunction(f,b){
return function myNextTick(){
console.log(f + " " + b);<|fim▁hole|>}
process.nextTick(getFunction("foo", "bar"));<|fim▁end|> | }; |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>import _cloneRegExp from './internal/_cloneRegExp';
import _curry2 from './internal/_curry2';
import _isRegExp from './internal/_isRegExp';
import toString from './toString';
/**
* Determines whether a given string matches a given regular expression.
*
* @func
* @m... | * @see R.match
* @example |
<|file_name|>subtract.js<|end_file_name|><|fim▁begin|>import { subtract } from '../subtract';
describe('Core.subtract', () => {
test('Subtracts the second argument from the first', () => {
expect(subtract(10, 8)).toBe(2);<|fim▁hole|>});<|fim▁end|> | }); |
<|file_name|>Helpers.py<|end_file_name|><|fim▁begin|>__author__ = 'jhala'
import types
import os.path, time
import json
import logging
import logging.config
logging.config.fileConfig('logging.conf')
logger = logging.getLogger(__name__)
import re
appInfo='appinfo.json'
''' Helper Functions '''
''' get the file as an... | dataFileRequiresUpdate=True |
<|file_name|>game.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals, division
from sc2reader.utils import Length
from sc2reader.events.base import Event
from sc2reader.log_utils import loggable
from itertools import chain
@loggable
class... |
def __str__(self):
return self._str_prefix() + "{0} at ({1}, {2})".format( |
<|file_name|>UsefulConfigParser.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 SnapDisco Pty Ltd, Australia.
# All rights reserved.
#
# This source code is licensed under the terms of the MIT license
# found in the "LICENSE" file in the root directory of this source tree.
import sys
if sys.version_info.major >=... | ## section name(s) are present in the config; this function will check
## this automatically, so no exception is raised by RawConfigParser. |
<|file_name|>handler_librato_out.go<|end_file_name|><|fim▁begin|>package librato
import (
"encoding/json"
"errors"
"fmt"
"strconv"
"time"
cc "github.com/grokify/commonchat"
"github.com/grokify/chathooks/pkg/config"
"github.com/grokify/chathooks/pkg/handlers"
"github.com/grokify/chathooks/pkg/models"
)
cons... |
if len(violation.Metric) > 0 {
attachment.AddField(cc.Field{
Title: "Metric", |
<|file_name|>_covtype.py<|end_file_name|><|fim▁begin|>"""Forest covertype dataset.
A classic dataset for classification benchmarks, featuring categorical and
real-valued features.
The dataset page is available from UCI Machine Learning Repository
https://archive.ics.uci.edu/ml/datasets/Covertype
Courtesy of Joc... | Parameters
----------
data_home : str, default=None |
<|file_name|>diagnostic_led.py<|end_file_name|><|fim▁begin|>import machine
import time
<|fim▁hole|> with open('config/diagnostic_led.pin', 'r') as fp:
invert = False
value = int(fp.read())
if value < 0:
value = -value
invert = True
DIAGNOSTIC_LED = machine.Sig... | DIAGNOSTIC_LED = None
try: |
<|file_name|>categoryLevel.js<|end_file_name|><|fim▁begin|>var CategoryLevel = function(){
'use strict';
var categorys = {};
this.addCategory = function(_name) {
categorys[_name] = [];
};
this.addDataToLastCategory = function(_categoryName, _lineData, _className) {<|fim▁hole|><|fim▁end|> | var category = categorys[_categoryName];
};
}; |
<|file_name|>advisor.spec.js<|end_file_name|><|fim▁begin|>'use strict';
describe('Controller: AdvisorCtrl', function () {<|fim▁hole|>
var AdvisorCtrl, scope;
// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new();
AdvisorCtrl = $con... |
// load the controller's module
beforeEach(module('advisorLinkApp')); |
<|file_name|>timeout.rs<|end_file_name|><|fim▁begin|>// * This file is part of the uutils coreutils package.
// *
// * (c) Alex Lyon <arcterus@mail.com>
// *
// * For the full copyright and license information, please view the LICENSE
// * file that was distributed with this source code.
// spell-checker:ignore ... |
static ABOUT: &str = "Start COMMAND, and kill it if still running after DURATION.";
const USAGE: &str = "{} [OPTION] DURATION COMMAND..."; |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import find_packages
from setuptools import setup
setup(
name='svs',
version='1.0.0',
description='The InAcademia Simple validation Service allows for the easy validation of affiliation (Student,'
'Faculty, Staff) of a user ... | package_dir={'': 'src'},
package_data={
'svs': [ |
<|file_name|>nntplib.py<|end_file_name|><|fim▁begin|>"""An NNTP client class based on:
- RFC 977: Network News Transfer Protocol
- RFC 2980: Common NNTP Extensions
- RFC 3977: Network News Transfer Protocol (version 2)
Example:
>>> from nntplib import NNTP
>>> s = NNTP('news')
>>> resp, count, first, last, name = s.g... | |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals<|fim▁hole|>from appconf import AppConf
class BlogConf(AppConf):
DISQUS_SHORTNAME = 'django-staticgen'
POST_IDENTIFIER = 'current_post'
class Meta:
prefix = 'blog'<|fim▁end|> |
from django.conf import settings # noqa
from django.utils.translation import ugettext_lazy as _ # noqa
|
<|file_name|>main.js<|end_file_name|><|fim▁begin|>$(document).ready(function(){
//enable the return time input and dropdown
$("#round").change(function() {
if(this.checked) {
console.log("Return data field open!");
$("#rD").removeClass('ui disabled input').addClass('ui input');... | type: "POST",
url: "/user", |
<|file_name|>ovirt_storage_domains.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# ... | aliases: ['type']
host:
description: |
<|file_name|>checkerboard.py<|end_file_name|><|fim▁begin|># Generates alternating frames of a checkerboard pattern.
Q_STARTING_INDEX = 150
UNIVERSE_LIGHTS = 144 #144 for side 1, #116 for side 2
flip = 0
for i in range(1,200): # 5 seconds * 40 / second (frame)
print "Record Cue " + str(Q_STARTING_INDEX + i)
fo... | print "C"+ str(j)+ " @ #"+str(value)+";"
flip = not flip # switch the checkerboard for the next frame
print "Record Stop" |
<|file_name|>latex.rs<|end_file_name|><|fim▁begin|>use std::io::IoResult;
use collections::HashMap;
use backend::Backend;
use colors;
pub struct LatexBackend {
contexts: Vec<~str>,
}
impl LatexBackend {
pub fn new() -> LatexBackend {
LatexBackend {
contexts: Vec::new(),
}
}
}... | let text = text.trim_right_chars('\n').to_owned();
let new_len = text.len(); |
<|file_name|>column-header-additional-actions.spec.ts<|end_file_name|><|fim▁begin|>/// <reference types="Cypress" />
context('Column template', () => {
beforeEach(() => {
cy.visit('http://127.0.0.1:4201/#/filter-header-template');
});
it('shows "Level" menu, and filter list using checkboxes', () => {
cy... | .get(
'#table > thead > tr > th:nth-child(3) > div.ngx-dropdown > div > div > label:nth-child(3)'
)
.contains('Low') |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, t... | # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
# |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (c) 2010-2011, Monash e-Research Centre
# (Monash University, Australia)
# Copyright (c) 2010-2011, VeRSI Consortium
# (Victorian eResearch Strategic Initiative, Australia)
# All rights reserved.
# Redistribution and use in ... | post_save.connect(hook, sender=Dataset_File, weak=False)
logger.debug('Initialised postsave hook %s' % post_save.receivers)
|
<|file_name|>MemoryMappedFile.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2014-2020 Real Logic Limited.
*
* 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/l... | if (!::WriteFile(fd.handle, buffer, (DWORD)size, &written, nullptr))
{
return false; |
<|file_name|>Masonry.d.ts<|end_file_name|><|fim▁begin|>import { PureComponent, Validator, Requireable } from 'react';
import { CellMeasurerCacheInterface, KeyMapper, MeasuredCellParent } from './CellMeasurer';
import { GridCellRenderer } from './Grid';
import { IndexRange } from '../../index';
/**
* Specifies the numb... | * At this time the positioner has access to cached size measurements for all cells.
* The positions it returns are cached by Masonry for fast access later.
* Phase one is repeated if the user scrolls beyond the current layout's bounds. |
<|file_name|>p2ptransportchannel_unittest.cc<|end_file_name|><|fim▁begin|>/*
* libjingle
* Copyright 2009 Google Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must re... | channel->SignalReadPacket.connect( |
<|file_name|>IWDeveloper.java<|end_file_name|><|fim▁begin|>package com.idega.development.presentation;
import com.idega.idegaweb.IWBundle;
import com.idega.idegaweb.IWMainApplication;
import com.idega.presentation.IWContext;
import com.idega.presentation.Image;
import com.idega.presentation.Layer;
import com.idega.pre... | |
<|file_name|>0007_auto_20160530_1233.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-30 12:33
from __future__ import unicode_literals<|fim▁hole|>from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependen... | |
<|file_name|>tabsscontrollers.js<|end_file_name|><|fim▁begin|>angular.module('tabss.controllers', [])
.controller('TabssCtrl', function($scope,$state) {
$scope.gotoTabs =function(){
$state.go('tabs')
}
$scope.gotoNearby =function(){
$state.go('app.nearby')
}
$scope.gotoEditProfile... | }
$scope.gotoQRCode =function(){ |
<|file_name|>lib.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... | let opts = vec!(
optflagmulti("a", "apple", "Desc"));
|
<|file_name|>index_spec.ts<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> *
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
import { Schema as ... | * @license
* Copyright Google LLC All Rights Reserved. |
<|file_name|>r3-p2-divide-an-island.cpp<|end_file_name|><|fim▁begin|>/***************************************************************/
/** **/
/** Leonardo Haddad nº 7295361 **/
/** Desafios de Programação - Round 3 Professora... | double normalizedToX (double normalizedValue) |
<|file_name|>WiselyConfiguration.java<|end_file_name|><|fim▁begin|>package cn.aezo.spring.base.annotation.combineannotation;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import java.lang.annotation.Documented;
import java.lang.annotation.Ele... | @Retention(RetentionPolicy.RUNTIME)
@Documented |
<|file_name|>32-bridge-in.py<|end_file_name|><|fim▁begin|># This example is designed to be paired with example file 31-bridge-out.py
# Run the two with DIFFERENT DEVICE TOKENS.
# (They can be either in same "project" or separate projects as set at phone. Just use different tokens.)
# This "in" bridge receives data di... | #----------------------------------------------- |
<|file_name|>opt.rs<|end_file_name|><|fim▁begin|>// -------------------------------------------------------------------------------------------------
// Rick, a Rust intercal compiler. Save your souls!
//
// Copyright (c) 2015 Georg Brandl
//
// This program is free software; you can redistribute it and/or modify it u... | Optimizer::opt_expr(&mut result); // XXX will this always terminate?
*expr = result;
} |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
import uchicagohvz.overwrite_fs
from django.conf import settings
import django.utils.timezone
import uch... | |
<|file_name|>v2_invest_optimize_only_gas_and_storage.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
General description
-------------------
This example shows how to perform a capacity optimization for
an energy system with storage. The following energy system is modeled:
input/output bg... | |
<|file_name|>dev_dodobas.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from .dev import * # noqa
INSTALLED_APPS += (
'django_extensions',
)
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'healthsites_dev',
'USER': '',
'PASSWORD... | },
'loggers': {
'django.db.backends': { |
<|file_name|>angular-cookies.js<|end_file_name|><|fim▁begin|>/**
* @license AngularJS v1.3.0-beta.11
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, angular, undefined) {'use strict';
/**
* @ngdoc module
* @name ngCookies
* @description
*
* # ngCookies
*
* The `ngCookie... | * |
<|file_name|>consensus.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 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 ... | let ci1 = net.peer(1).chain.chain_info();
assert_eq!(ci0.best_block_number, 3); |
<|file_name|>shh.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Sof... | "math/big" |
<|file_name|>python.py<|end_file_name|><|fim▁begin|>"""
Python environments and packages
================================
This module provides tools for using Python `virtual environments`_
and installing Python packages using the `pip`_ installer.
.. _virtual environments: http://www.virtualenv.org/
.. _pip: http://... | packages = [packages]
if allow_external in (None, False): |
<|file_name|>checker.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# coding=utf-8
# Simple Steam profile checker Telegram bot
# Copyright (c) 2017 EasyCoding Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... | self.__gamebans = xmlp.getElementsByTagName('gamebans')[0].firstChild.data
# Fetching custom description...
dcs = xmlp.getElementsByTagName('customdescr')[0].firstChild |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod char_indexing;
/// Defines potential patterns used to match against a password
pub mod patterns;
use self::patterns::*;
use crate::frequency_lists::DictionaryType;
use char_indexing::{CharIndexable, CharIndexableStr};
use fancy_regex::Regex as FancyRegex;
use iterto... | for &(day, month, year) in &test_data {
let password = format!("{}.{}.{}", year, month, day);
let matches = (matching::DateMatch {}).get_matches(&password, &HashMap::new()); |
<|file_name|>modelinstance.py<|end_file_name|><|fim▁begin|>import numpy as np
from menpo.base import Targetable, Vectorizable
from menpo.model import MeanInstanceLinearModel
from menpofit.differentiable import DP
def similarity_2d_instance_model(shape):
r"""
A MeanInstanceLinearModel that encodes all possibl... | """
def __init__(self, model, global_transform_cls): |
<|file_name|>dtrun.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2001 Andrew T. Csillag <drew_csillag@geocities.com>
#
# You may distribute under the terms of either the GNU General
# Public License or the SkunkWeb License, as specified in the
# README file.
#
import os
import DT
import sys
i... | |
<|file_name|>regions-outlives-nominal-type-region-rev.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or... | //
// Rule OutlivesNominalType from RFC 1214. |
<|file_name|>drawing_skyline.py<|end_file_name|><|fim▁begin|>import collections
import functools
from typing import List
from test_framework import generic_test
from test_framework.test_utils import enable_executor_hook
Rect = collections.namedtuple('Rect', ('left', 'right', 'height'))
def compute_skyline(buildings... | result = executor.run(functools.partial(compute_skyline, buildings))
return [(x.left, x.right, x.height) for x in result] |
<|file_name|>quick_test.py<|end_file_name|><|fim▁begin|>import sys
import os
from ..data.molecular_species import molecular_species
from ..data.reaction_mechanism_class import reaction_mechanism
from ..data.condition_class import condition
from ..data.reagent import reagent
from ..data.puzzle_class import puzzle
from .... | |
<|file_name|>plugin-compat.js<|end_file_name|><|fim▁begin|>let hookTypes;
const callStyles = {
sync: 'applyPlugins',
syncWaterfall: 'applyPluginsWaterfall',
syncBail: 'applyPluginsBailResult',
sync_map: 'applyPlugins',
asyncWaterfall: 'applyPluginsAsyncWaterfall',
asyncParallel: 'applyPluginsParallel',
a... | seal: ['sync', []],
}, |
<|file_name|>template.go<|end_file_name|><|fim▁begin|>package export
import (
"fmt"
"os"
"github.com/spf13/cobra"
"github.com/elastic/beats/libbeat/cmd/instance"
"github.com/elastic/beats/libbeat/paths"
"github.com/elastic/beats/libbeat/template"
)
<|fim▁hole|> Short: "Export index template to stdout",
Run:... | func GenTemplateConfigCmd(name, idxPrefix, beatVersion string) *cobra.Command {
genTemplateConfigCmd := &cobra.Command{
Use: "template", |
<|file_name|>elephant.py<|end_file_name|><|fim▁begin|>import numpy as np
import pylab
# elephant parameters
p1, p2, p3, p4 = (50 - 30j, 18 + 8j, 12 - 10j, -14 - 60j )<|fim▁hole|>def fourier(t, C):
f = np.zeros(t.shape)
A, B = C.real, C.imag
for k in range(len(C)):
f = f + A[k]*np.cos(k*t) + B[k]*... | p5 = 40 + 20j # eyepiece
|
<|file_name|>DBImportFirstPage.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2005-2010, G. Weirich and Elexis
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Pub... | dbName.setEnabled(true); |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import re
import os
import sys
def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
init_py = open(os.path.join(pac... | |
<|file_name|>NodeNotebook.py<|end_file_name|><|fim▁begin|># vim: set fileencoding=utf-8 :
# ***********************IMPORTANT NMAP LICENSE TERMS************************
# * *
# * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is ... | |
<|file_name|>subreddits.py<|end_file_name|><|fim▁begin|>import os, sys, re, json
from praw2 import Reddit
reload(sys)<|fim▁hole|>except:
def log(msg):
print(msg)
sys.setdefaultencoding("utf-8")
CLIENT_ID = 'J_0zNv7dXM1n3Q'
CLIENT_SECRET = 'sfiPkzKDd8LZl3Ie1WLAvpCICH4'
USER_AGENT = 'sparkle streams 1.0'
c... |
try:
from xbmc import log |
<|file_name|>int_rect.rs<|end_file_name|><|fim▁begin|>use math::IntVector;
use sdl2::rect::Rect as SdlRect;
#[derive(Debug, Copy, PartialEq, Clone)]
pub struct IntRect {
pub xy: IntVector,
pub width: u32,
pub height: u32,
}
impl IntRect {
fn new(x: i32, y: i32, width: u32, height: u32) -> IntRect {
... | self.xy.y
}
|
<|file_name|>SplitRGBBands.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
SplitRGBBands.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email ... | commands = []
if isWindows():
commands.append("io_gdal 0 -GRIDS \"" + temp + "\" -FILES \"" + input+"\"") |
<|file_name|>File.java<|end_file_name|><|fim▁begin|>package scrum.server.files;
import ilarkesto.io.IO;
import scrum.server.admin.User;
public class File extends GFile {
// --- dependencies ---
// --- ---<|fim▁hole|>
public void deleteFile() {
IO.delete(getJavaFile());
}
public java.io.File getJavaFile() {
... | |
<|file_name|>PtyPartEffectTranslate.moc.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2010, Anima Games, Benjamin Karaban, Laurent Schneider,
* Jérémie Comarmond, Didier Colin.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted ... | updateData();
}
//-----------------------------------------------------------------------------
|
<|file_name|>app.js<|end_file_name|><|fim▁begin|>const { resolve } = require('path')
const express = require('express')
const bodyParser = require('body-parser')
var proxy = require('express-http-proxy')
const app = express()
// parse JSON bodies
app.use(bodyParser.json({ type: 'application/json' }))
// the index fi... | |
<|file_name|>lovins.py<|end_file_name|><|fim▁begin|>"""This module implements the Lovins stemming algorithm. Use the ``stem()``
function::
stemmed_word = stem(word)
"""
from whoosh.util.collections2 import defaultdict
# Conditions
def A(base):
# A No restrictions on stem
return True
def B(base):
... | ("her", "hes", "pt"),
("mit", "mis"), |
<|file_name|>strategy.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|>
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License i... | you may not use this file except in compliance with the License.
You may obtain a copy of the License at |
<|file_name|>client.go<|end_file_name|><|fim▁begin|>package pdns
import (
"encoding/json"
"fmt"
"io"
"net/http"
"strconv"
"strings"
"github.com/xenolf/lego/challenge/dns01"
)
type Record struct {
Content string `json:"content"`
Disabled bool `json:"disabled"`
// pre-v1 API
Name string `json:"name"`
T... | |
<|file_name|>pygments.py<|end_file_name|><|fim▁begin|>import importlib
from pygments.lexer import RegexLexer, bygroups
from pygments.styles import STYLE_MAP
from pygments.token import *
def load_style(full_class_string):
modulename, styleclass = full_class_string.split('::')
module = importlib.import_module(... | repl_styles[name] = load_style(import_info)
repl_styles[name].styles[Whitespace] = '' # some styles underline ws
|
<|file_name|>knockout.kogrid-tests.ts<|end_file_name|><|fim▁begin|>export interface IGridItem {
name: string;
}
export class Tests {
public items: KnockoutObservableArray<IGridItem>;
public selectedItems: KnockoutObservableArray<IGridItem>;
public gridOptionsAlarms: kg.GridOptions<IGridItem>;
cons... | plugins: null, |
<|file_name|>export.js<|end_file_name|><|fim▁begin|>var auth = require( './auth' ),
surveyTemplate = require( '../lib/survey_template' ),
SurveyResponse = require( '../models/survey_response' );
var ExportController = function() {
this.csv = function( req, res ) {
var now = new Date(),
... |
exports.setup = function( app ) { |
<|file_name|>doop-list.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
var _ = require('lodash');
var async = require('async-chainable');
var asyncFlush = require('async-chainable-flush');
var colors = require('chalk');
var doop = require('.');
var glob = require('glob');
var fs = require('fs');
var fspath = requi... | // Hash all Doop files {{{ |
<|file_name|>enum-no_trailing_comma.rs<|end_file_name|><|fim▁begin|>// rustfmt-enum_trailing_comma: false
enum X {
A,
B
}
enum Y {
A,
B
}
enum TupX {
A(u32),
B(i32, u16)
}
enum TupY {
A(u32),
B(i32, u16)
}
<|fim▁hole|>
enum StructY {
A { s: u16 },
B { u: u32, i: i32 }
}<|fim▁... | enum StructX {
A { s: u16 },
B { u: u32, i: i32 }
} |
<|file_name|>utils.go<|end_file_name|><|fim▁begin|>package utils
import (
"code.google.com/p/goauth2/oauth"
"github.com/google/go-github/github"
"github.com/pinterb/hsc/config"
)
// Utils manages interactions with all utilities
type Utils struct {
client *github.Client
config *config.Config
Users *UserUtils
/... |
// Response is a light wrapper around the go-github Response struct |
<|file_name|>erroneous_aclfull_proxy.py<|end_file_name|><|fim▁begin|>from . import NetworkObject
import z3
class ErroneousAclWebProxy (NetworkObject):
"""A caching web proxy which enforces ACLs erroneously.
The idea here was to present something that is deliberately not path independent"""
def _init (se... | self.constraints.append(cache_conditions)
|
<|file_name|>bitswap.go<|end_file_name|><|fim▁begin|>// package bitswap implements the IPFS Exchange interface with the BitSwap
// bilateral exchange protocol.
package bitswap
import (
"errors"
"math"
"sync"
"time"
process "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
procctx "gith... | findKeys: make(chan *blockRequest, sizeBatchRequestChan),
process: px,
newBlocks: make(chan *blocks.Block, HasBlockBufferSize), |
<|file_name|>saveMember.ts<|end_file_name|><|fim▁begin|>import { FormValidationResult } from 'lc-form-validation';
import * as toastr from 'toastr';<|fim▁hole|>import { actionTypes } from '../../../common/constants/actionTypes';
import { MemberEntity } from '../../../model';
import { memberAPI } from '../../../api/memb... | |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>const Lib = require("../src/main");
const assert = require("assert");
describe("plain object output", function () {
context("for `JSON.stringify` serializable objects", function () {
it("should have resembling structure", function () {
const obj1 = { a: 1, ... | |
<|file_name|>test_run.py<|end_file_name|><|fim▁begin|>#####################################################################################
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# Unless a separate license agreement exists between you and Crossbar.io GmbH (e.g.
# you have purchased a commercial license),... | {
"name": "realm1", |
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import logging
from functools import wraps
from requests.exceptions import HTTPError
from django.utils.decorators import available_attrs
from django.conf import settings
from authclient import _get_user_session_key, SESSION_KEY
from authclient.client import auth... | def _wrapped(request, *args, **kwargs):
return view_func(request, *args, **kwargs) |
<|file_name|>robotinspect.py<|end_file_name|><|fim▁begin|># Copyright 2008-2013 Nokia Siemens Networks Oyj
#
# 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/l... | else:
def is_java_init(init): |
<|file_name|>NavigationBar.qunit.js<|end_file_name|><|fim▁begin|>/*global QUnit */
sap.ui.define([
"sap/ui/qunit/QUnitUtils",
"sap/ui/qunit/utils/createAndAppendDiv",
"sap/ui/ux3/NavigationBar",
"sap/ui/thirdparty/jquery",
"sap/ui/ux3/NavigationItem"
], function(qutils, createAndAppendDiv, NavigationBar, jQuery, N... |
assert.ok(arrowPos > left && arrowPos < right, "arrow position (" + arrowPos
+ ") should be around the center of the selected item (between " + left + " and " + right + ")"); |
<|file_name|>oobfuncs.py<|end_file_name|><|fim▁begin|>"""
OOB configuration.
This module should be included in (or replace) the
default module set in settings.OOB_PLUGIN_MODULES
All functions defined in this module are made available
to be called by the OOB handler.
<|fim▁hole|> function execution - the oob protoc... | See src/server/oob_msdp.py for more information.
|
<|file_name|>column_puyo_list.rs<|end_file_name|><|fim▁begin|>use color::PuyoColor;
use small_int_set::SmallIntSet;
const MAX_SIZE: usize = 8;
pub struct ColumnPuyoList {
size: [usize; 6],
puyo: [[PuyoColor; MAX_SIZE]; 6],
place_holders: [SmallIntSet; 6],
}
impl ColumnPuyoList {
pub fn new() -> Colum... | cpl.add(1, PuyoColor::IRON);
assert!(cpl.has_place_holder()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.