prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>feed_parse_extractWwwTccedwardsCom.py<|end_file_name|><|fim▁begin|>def extractWwwTccedwardsCom(item):
'''
Parser for 'www.tccedwards.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None<|fim▁hole|> ... | |
<|file_name|>parse_test.go<|end_file_name|><|fim▁begin|>package walnut
import (
"fmt"
"reflect"
"testing"
"time"
)
var splitTests = []struct {
in string
out []line
err error
}{
{"", []line{}, nil},
{"# comment", []line{}, nil},
{"\n\na=1\n\n", []line{{3, 0, "a=1"}}, nil},
{"a=1\nb=2", []line{{1, 0, "a=1"}... | {
[]line{{1, 0, "time = 2012-01-02 15:30:28.000000000789 +0000"}}, |
<|file_name|>dcf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import sys
sys.path.append('/var/www/html/valumodel.com/scripts/dcf')
from calc_dcf import calc_dcf
def create_dcf(req, tax_rate, growth_rate_1_year_out, sga_of_sales, da_of_sales, capex_of_sales, nwc_of_sales, levered_beta, current_yield, exit_multip... | |
<|file_name|>local.js<|end_file_name|><|fim▁begin|>/**
* This is specifically for the builder where the
* dependencies have been resolved and you just want
* to access the component.jsons locally.
*/
var semver = require('semver');
var fs = require('graceful-fs');
var join = require('path').join;
var resolve = req... | }
var folders = yield* this.folders(repo); |
<|file_name|>test_observatory_negotiation.py<|end_file_name|><|fim▁begin|>#from interface.services.icontainer_agent import ContainerAgentClient
#from pyon.ion.endpoint import ProcessRPCClient
from pyon.public import Container, log, IonObject
from pyon.util.containers import DotDict
from pyon.util.int_test import IonInt... |
self.rrclient = ResourceRegistryServiceClient(node=self.container.node) |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|> from django.conf.urls.defaults import url, patterns
from actstream import feeds
from actstream import views
from django.contrib.auth.decorators import login_required
urlpatterns = patterns('actstream.views',
# Syndication Feeds
url(r'^feed/(?P... | try:
from django.conf.urls import url, patterns
except ImportError: |
<|file_name|>update_json.rs<|end_file_name|><|fim▁begin|>use toyunda_player::VideoMeta;
use subtitles::*;
use clap::ArgMatches;
use std::path::PathBuf;
use std::fs::File;
extern crate serde_json;
extern crate serde_yaml;
<|fim▁hole|>/// false on failure
pub fn update_json(args: &ArgMatches) -> bool {
if let Some(... | /// true on success |
<|file_name|>IteratorDeclaration.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* 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... | PsiStatement initialization = statement.getInitialization();
IteratorDeclaration declaration = extract(initialization);
if (declaration == null || !declaration.isHasNextCall(statement.getCondition())) return null;
return declaration; |
<|file_name|>size_hint.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
use core::slice::SliceExt;
use core::slice::IterMut;
// fn size_from_ptr<T>(_: *const T) -> usize {
// mem::size_of::<T>()
// }
// macro_rules! slice_offset {
// ($... | //
// #[inline]
// fn swap(&mut self, a: usize, b: usize) {
// unsafe { |
<|file_name|>update_machine.py<|end_file_name|><|fim▁begin|># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not u... | |
<|file_name|>StringUtil.cpp<|end_file_name|><|fim▁begin|>/* Copyright (C) 2013 Rainmeter Project Developers
*
* This Source Code Form is subject to the terms of the GNU General Public
* License; either version 2 of the License, or (at your option) any later
* version. If a copy of the GPL was not distributed wi... | namespace StringUtil {
std::string Narrow(const WCHAR* str, int strLen, int cp)
{
|
<|file_name|>pysmile_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import glob
import unittest
import pysmile
import json
__author__ = 'Jonathan Hosmer'
class PySmileTestDecode(unittest.TestCase):
def setUp(self):
curdir = os.path.dirname(os.path.abspath(__file__))
sel... | self.assertEqual(a, b, '{}\nExpected:\n{!r}\nGot:\n{!r}'.format(s, b, a))
|
<|file_name|>file.dev.js<|end_file_name|><|fim▁begin|><|fim▁hole|>size 5099<|fim▁end|> | version https://git-lfs.github.com/spec/v1
oid sha256:22a8f31fdc015cfce492a52529a1c36e39643310cec60a6331d4a428ac8a4db6 |
<|file_name|>issue-3675.rs<|end_file_name|><|fim▁begin|>fn main() {
println!("{}"<|fim▁hole|> , 111);
}<|fim▁end|> | // comment |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
<|fim▁hole|><|fim▁end|> | from . import res_country |
<|file_name|>OpServerProxy.cc<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
*/
#include "viz_collector.h"
#include "viz_constants.h"
#include "OpServerProxy.h"
#include <tbb/mutex.h>
#include <boost/bind.hpp>
#include <boost/assign/list_of.hpp>
#include "base/util.h... | redisReply *reply = (redisReply*)r;
|
<|file_name|>rq.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import logging<|fim▁hole|>
try:
from redis import Redis
from rq import Queue
except ImportError:
Redis = None
Queue = None
from kaneda.exceptions import ImproperlyConfigured
from .base import BaseQueue
class RQQu... | |
<|file_name|>disco_test.py<|end_file_name|><|fim▁begin|>"""Tests for certbot.plugins.disco."""
import unittest
import mock
import pkg_resources
import zope.interface
from certbot import errors
from certbot import interfaces
from certbot.plugins import standalone
from certbot.plugins import webroot
EP_SA = pkg_resou... | self.plugin_ep.ifaces.return_value = True
# pylint: disable=protected-access |
<|file_name|>evisgenericeventbrowsergui.cpp<|end_file_name|><|fim▁begin|>/*
** File: evisgenericeventbrowsergui.cpp
** Author: Peter J. Ersts ( ersts at amnh.org )
** Creation Date: 2007-03-08
**
** Copyright ( c ) 2007, American Museum of Natural History. All rights reserved.
**
** This library/program is free softwar... | * @param theCurrentTabIndex - The index of the currently selected tab
*/ |
<|file_name|>tkwindow.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 *-*
# made for python3!
from tkinter import *
from tkinter.ttk import *<|fim▁hole|>
class TkWindow():
registers = {}
def __init__(self, parent, title, width=400, height=300):
self.parent = parent #Tk or toplevel
... | |
<|file_name|>rendercontext.rs<|end_file_name|><|fim▁begin|>extern crate time;
use scene::Scene;
use color::Color;
use trace::trace;
// The render context is the data structure
// that holds state about the current render.
//
// It needs to be thread safe.
pub struct RenderContext {
image: Vec<Color>,
samples... | pub start_time: f64,
pub progressive_render: bool,
pub pixels_rendered: u64,
pub output_filename: String, |
<|file_name|>glrenderer.cpp<|end_file_name|><|fim▁begin|>#include <list>
#include <QGLFunctions>
#include <QGLBuffer>
#include <QPaintDevice>
#include <QSharedPointer>
#include <QColor>
#include <QMap>
#include "Scene/transformation.h"
#include "Scene/camera.h"
#include "Scene/scene.h"
#include "Scene/mesh.h"
#includ... | m_camera = camera; |
<|file_name|>bitcoin_ro_RO.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="ro_RO" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Vsync</source>
<translation>Despre Vsync<... | <location line="-25"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation>Utilizati proxy pentru a ajunge la serviciile tor (implicit: la fel ca proxy)</translation>
</message> |
<|file_name|>entry.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
React.render(<ColorWheel title='ColorWheel' />, document.querySelector('#color-wheel'))<|fim▁end|> | import React from 'react'
import ColorWheel from './ColorWheel.jsx' |
<|file_name|>resolve_lock_lite.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.
use crate::storage::kv::WriteData;
use crate::storage::lock_manager::LockManager;
use crate::storage::mvcc::MvccTxn;
use crate::storage::txn::commands::{
Command, CommandExt, ReleasedLo... | |
<|file_name|>hotshots_fr.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="fr" version="2.0">
<context>
<name/>
<message>
<location filename="../src/AboutDialog.cpp" line="243"/>
<source>release of translation and translator name please</source>
<comment>pu... | <location filename="../ui/AboutDialog.ui" line="304"/>
<source>Reset preferences</source>
<translation>Effacer toutes les préférences</translation> |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
extern crate hashglobe;
extern crate smallvec;
#[cfg(feature = ... | }
self.push(val); |
<|file_name|>LogDBIngester.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#!/usr/local/bin/python
# check python version
import sys
ver_info = sys.version_info
# parse commandlines
if ver_info[0] < 3 and ver_info[1] < 7:
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-... | |
<|file_name|>JpsProjectSerializationTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2012 JetBrains s.r.o.
*
* 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... | assertNotNull(properties); |
<|file_name|>theme-loader.js<|end_file_name|><|fim▁begin|>/**
* @file theme loader
*
* @desc 向每个.vue文件中注入样式相关的变量,不需要手动import
* @author echaoo(1299529160@qq.com)
*/
/* eslint-disable fecs-no-require, fecs-prefer-destructure */
'use strict';
const theme = require('../../config/theme');
const loaderUtils = require... | // 定义在vuetify中默认的两组stylus hash:主题色和material相关
let defaultVuetifyVariables = {
themeColor: { |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
import runpy
from codecs import open
from setuptools import setup, find_packages
# Based on https://github.com/pypa/sampleproject/blob/master/setup.py
# and https://python-packaging-user-guide.readthedocs.org/
here = os.path.abspath(os.path.dirname(__file_... | |
<|file_name|>router_config_loader.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* 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 {Compiler, InjectionToken, Injector, NgModu... | |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>__author__ = 'emre'
<|fim▁hole|><|fim▁end|> | print "hello world" |
<|file_name|>FlyFi.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
FlyFi - Floppy-Fidelity
=======
Created to fulfill all your floppy music needs.
Created on Tue 06-01-2013_05:17:42+0100
@author: Ricardo (XeN) Band <xen@c-base.org>,
Stephan (coon) Thiele <coon@c-base.org>
... | __version__ = "0.1"
import sys |
<|file_name|>atn-generate-food-web.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
""" Generates a plot and JSON file describing a food web.
Files are stored in a directory named based on the species in the food web.
If --parent-dir is not specified, the parent directory is determined
automatically based on D... | parser_generate.add_argument('num_basal_species', type=int, help="Number of basal species") |
<|file_name|>gystogra.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (c) 1993-2008, Cognitive Technologies
All rights reserved.
Разрешается повторное распространение и использование как в виде исходного кода,
так и в двоичной форме, с изменениями или без, при соблюдении следующих условий:
* При повторном распрост... | pVerGt->Signal[k - MinBeg]++;
} |
<|file_name|>NanoInstant.java<|end_file_name|><|fim▁begin|>/* $Id$
* $URL: https://dev.almende.com/svn/abms/coala-common/src/main/java/com/almende/coala/time/NanoInstant.java $
* <|fim▁hole|> * @license
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in complianc... | * Part of the EU project Adapt4EE, see http://www.adapt4ee.eu/
* |
<|file_name|>document_test.go<|end_file_name|><|fim▁begin|>package document_test<|fim▁hole|>import (
"fmt"
"github.com/tummychow/goose/document"
_ "github.com/tummychow/goose/document/file"
_ "github.com/tummychow/goose/document/sql"
"gopkg.in/check.v1"
"os"
"time"
)
type DocumentStoreSuite struct {
Store docu... | |
<|file_name|>derive_on_struct.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2015 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|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENS... | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
<|file_name|>AddressViewDAOImpl.java<|end_file_name|><|fim▁begin|>package com.vertabelo.mobileorm.myplaces.orm.gen;
public class AddressViewDAOImpl
extends com.vertabelo.mobileorm.myplaces.orm.runtime.dao.BaseDAO<AddressView>
implements AddressViewDAO {
public AddressViewDAOImpl(com.vertabelo.mobi... | }
}
|
<|file_name|>isLength.js<|end_file_name|><|fim▁begin|>/**
* Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
* of an array-like value.<|fim▁hole|> * Checks if `value` is a valid array-like length.
*
* **Note:** This function is based on [`ToLength`](http://ecma-i... | */
var MAX_SAFE_INTEGER = 9007199254740991;
/** |
<|file_name|>TileZTC.java<|end_file_name|><|fim▁begin|>package net.gigimoi.zombietc.tile;
import net.gigimoi.zombietc.ZombieTC;
import net.gigimoi.zombietc.util.IListenerZTC;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.... | public abstract class TileZTC extends TileEntity implements IListenerZTC { |
<|file_name|>csgsetg.rs<|end_file_name|><|fim▁begin|>#[doc = "Register `CSGSETG` writer"]
pub struct W(crate::W<CSGSETG_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<CSGSETG_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
... | #[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
} |
<|file_name|>leafgeometry.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 spatial-rs Developers
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. This file may n... | Shapes::Point(ref point) => point.area(),
Shapes::LineSegment(ref linesegment) => linesegment.area(), |
<|file_name|>arm_linux_androideabi.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.
//<|fim▁hole|>// except according to those terms.
use target::Target;
pub fn target() ->... | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed |
<|file_name|>a2Object.hh<|end_file_name|><|fim▁begin|>// Copyright 2016 Martin Fracker, Jr.
// All Rights Reserved.
//
// This project is free software, released under the terms
// of the GNU General Public License v3. Please see the
// file LICENSE in the root directory or visit
// www.gnu.org/licenses/gpl-3.0.... | A2Object(int x, int y); |
<|file_name|>math.py<|end_file_name|><|fim▁begin|>import nltk
PLUS = 'plus'
MUL = 'multiplied by'
DIV = 'divided by'
MIN = 'minus'
OPENB = 'open bracket'
CLOSEB = 'close bracket'
with open('../grammars/math.cfg', 'r') as file:
grammar_str = file.read()
def validate(text):
grammar = nltk.CFG.fromstring(grammar_... | |
<|file_name|>version.py<|end_file_name|><|fim▁begin|># This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This pro... | def execute_delete(self, *args, **kwargs):
return hresponse.HandlerResponse(501) |
<|file_name|>work-item-comment-wrapper.module.ts<|end_file_name|><|fim▁begin|>import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
<|fim▁hole|>//ngrx stuff
import { EffectsModule } from '@ngrx/effects';
import { StoreModule } from '@ngrx/store';
import { CommentEffects } from './../... | |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013 Johnny Vestergaard <jkv@unixcluster.dk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the Licens... | |
<|file_name|>test_pipeline_yml.py<|end_file_name|><|fim▁begin|># Copyright 2015 Joel Granados joel.granados@gmail.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | |
<|file_name|>tagExclusion.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2013 Palantir Technologies, 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://ww... | const firstSpaceIndex = body.search(/\s/);
return [body.substring(1, firstSpaceIndex), body.substring(firstSpaceIndex).trim()];
}, |
<|file_name|>createProgramFromFiles.js<|end_file_name|><|fim▁begin|>define([
'webgl/createProgram',
'webgl/shader/compileShaderFromFile'
], function(
createProgram,
compileShaderFromFile
) {
/**
* Creates a program from 2 script tags.<|fim▁hole|> * @param {string} vertexShaderFileName The file name of the verte... | *
* @param {!WebGLRenderingContext} gl The WebGL Context. |
<|file_name|>repo.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package git
import (
"bytes"
"container/list"
"errors"
"os"
"path"
"path/filepath"
"strings"
"time"... | _STAT_SIZE_PACK = "size-pack: "
_STAT_PRUNE_PACKABLE = "prune-packable: "
_STAT_GARBAGE = "garbage: " |
<|file_name|>indent_list_item.py<|end_file_name|><|fim▁begin|>import re
import sublime
import sublime_plugin
class IndentListItemCommand(sublime_plugin.TextCommand):
bullet_pattern = r'([-+*]|([(]?(\d+|#|[a-y]|[A-Y]|[MDCLXVImdclxvi]+))([).]))'
bullet_pattern_re = re.compile(bullet_pattern)
line_pattern_r... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import List, Optional
__version__ = "20.0.dev0"
<|fim▁hole|> For additional details, see https://github.com/pypa/pip/issues/7498.
"""
from pip._internal.u... | def main(args=None):
# type: (Optional[List[str]]) -> int
"""This is an internal API only meant for use by pip's own console scripts.
|
<|file_name|>IntroduceTwoStepAggregateRule.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this f... | import org.apache.hyracks.algebricks.common.utils.Pair;
import org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator; |
<|file_name|>app.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { BlockUIModule } from 'ng-block-ui';
@NgModule({
imports: [<|fim▁hole|> BlockUIModule.forRoot({
... | BrowserModule, |
<|file_name|>BinaryLink.js<|end_file_name|><|fim▁begin|>// xiNET interaction viewer
// Copyright 2013 Rappsilber Laboratory
//
// This product includes software developed at
// the Rappsilber Laboratory (http://www.rappsilberlab.org/).
"use strict";
var Config = require('../../controller/Config');... | return false;
}
};
|
<|file_name|>AllocationTracker.java<|end_file_name|><|fim▁begin|>// Copyright 2017 The Bazel 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://... | |
<|file_name|>15.3.4.5-13.b-4.js<|end_file_name|><|fim▁begin|><|fim▁hole|>/// Copyright (c) 2012 Ecma International. All rights reserved.
/// Ecma International makes this code available under the terms and conditions set
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
/// "Use Terms"... | |
<|file_name|>tsort.py<|end_file_name|><|fim▁begin|>__all__ = ['tsort']
from functools import reduce
def tsort(data, smallest_first=False, fewest_edges_first=False, flatten=False):
# FIXME: support fewest_edges_first
# make copy of data
tmp = data.copy()
# remove self-references
for k, v in tmp.it... |
if tmp: |
<|file_name|>test_alignment.py<|end_file_name|><|fim▁begin|>"""Unit test of the AlignmentScan
@author: Kay Kasemir
"""
from __future__ import print_function
import unittest
from scan.commands import Set, CommandSequence
from scan.alignment import AlignmentScan
class AlignmentTest(unittest.TestCase):
def testB... | align = AlignmentScan("motor_x", 0, 10, 0.5, "seconds", 0.5, "signal",
pre=Set("motor_y", 3), |
<|file_name|>smartDataActions.tests.ts<|end_file_name|><|fim▁begin|>import { Observable, BehaviorSubject } from 'rxjs';
import { SortDirection } from '../../sorts/index';
import {
IFilterWithValue,
defaultThrottleLimit,
toRequestStream,
throttled,
unthrottled,
toFiltersWithValues,
suppressInactiveFilters,
toTy... | |
<|file_name|>casttype.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-gogo.
// source: combos/unsafemarshaler/casttype.proto
// DO NOT EDIT!
/*
Package casttype is a generated protocol buffer package.
It is generated from these files:
combos/unsafemarshaler/casttype.proto
It has these top-level m... | |
<|file_name|>match-bindings.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 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/... | // except according to those terms.
// run-pass |
<|file_name|>heap-snapshot-summary-show-all.js<|end_file_name|><|fim▁begin|>// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function() {
TestRunner.addResult(`Tests Summary view of detailed hea... | if (!isNaN(maybeNumber)) |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// http://rosettacode.org/wiki/Walk_a_directory/Recursively
extern crate regex;
use regex::Regex;
use std::convert::AsRef;
use std::fs;
use std::path::Path;
fn walk<P>(pth: P, regex: &Regex)
where
P: AsRef<Path>,
{
let result = match fs::read_dir(pth) {<|fim▁h... | |
<|file_name|>auth.service.js<|end_file_name|><|fim▁begin|>const mongoose = require('mongoose');
const UserModel = mongoose.model('User');
module.exports = {
login: (email, password) => {<|fim▁hole|><|fim▁end|> | return UserModel.findOne({email, password});
}
}; |
<|file_name|>canvas_fractal.js<|end_file_name|><|fim▁begin|>var fractal = fractal || {};
fractal.workerPaths = {
"mandelbrot": "public/js/mandel.js",
};
fractal.Fractal = function (canvas, workerCount) {
this.canvas = canvas;
this.workerCount = workerCount;
this.workerDoneCount = 0;
this.ctx = canvas.getC... | |
<|file_name|>leaf.js<|end_file_name|><|fim▁begin|>/**
* @class PrettyJSON.view.Leaf
* @extends Backbone.View
*
* @author #rbarriga
* @version 0.1
*
*/
PrettyJSON.view.Leaf = Backbone.View.extend({
tagName:'span',
data:null,
level:0,
path:'',
type:'string',
isLast: true,
events: {
"m... | this.tpl = _.template(PrettyJSON.tpl.Leaf, state);
$(this.el).html(this.tpl);
return this; |
<|file_name|>backends.py<|end_file_name|><|fim▁begin|>"""This file exists for backwards compatability.
Please use the separate backends found in either `djangae.contrib.gauth.datastore.backends` or
`djangae.contrib.gauth.sql.backends`.
"""
import warnings
from djangae.contrib.gauth.datastore.backends import AppEngineUs... | |
<|file_name|>generate_testdata.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www... | |
<|file_name|>s3object_test.go<|end_file_name|><|fim▁begin|>package awsat
import (
"testing"
"os"
"path/filepath"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/wallix/awless/aws/spec"
)
func TestS3object(t *testing.T) {
t.Run("create", func(t *testing.T) {
f, filePath, cleanup := generateTmpFile("body ... | |
<|file_name|>issue-6458-2.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.<|fim▁hole|>// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may... | //
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
<|file_name|>hello.rs<|end_file_name|><|fim▁begin|>use std::num::strconv;
<|fim▁hole|>}<|fim▁end|> | fn main() {
strconv::float_to_str_bytes_common(
1.1_f64, 10u, true, strconv::SignNeg, strconv::DigAll); |
<|file_name|>show.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/L... | explicit_self: borrowed_explicit_self(), |
<|file_name|>SailBooleanExprQuery.java<|end_file_name|><|fim▁begin|>package de.unikiel.inf.comsys.neo4j.inference.sail;
/*
* #%L
* neo4j-sparql-extension
* %%
* Copyright (C) 2014 Niclas Hoyer
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Pub... | *
* The original constructor of {@link SailBooleanQuery} is protected, thus
* it is not possible to create a new boolean query from a parsed query |
<|file_name|>document.py<|end_file_name|><|fim▁begin|>"""DocumentSource scrapes MDN wiki documents."""
import logging
import dateutil
from .base import DocumentBaseSource
logger = logging.getLogger("kuma.scraper")
class DocumentSource(DocumentBaseSource):
"""Coordinate scraping and local cloning of an MDN Do... | else: |
<|file_name|>sparql_select_result.py<|end_file_name|><|fim▁begin|>"""sparql_select_result.py
Data structure for storing the results of SPARQL SELECT queries"""
__all__ = ["SPARQLSelectResult"]
from xml.etree import ElementTree as et
class SPARQLSelectResult(object):
def __init__(self):
self.variables = []
self.res... | d[binding.get("name")] = uri.text
self.results.append(d) |
<|file_name|>test_link.py<|end_file_name|><|fim▁begin|>from common_fixtures import * # NOQA
def test_link_instance_stop_start(super_client, client, context):
target1 = context.create_container(ports=['180', '122/udp'])
target2 = context.create_container(ports=['280', '222/udp'])
c = context.create_conta... | for port in link.data.fields.ports:
new_ports.add('{}:{}'.format(port.publicPort, port.privatePort)) |
<|file_name|>capability_list.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2017 David Renshaw and contributors
//
// 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, in... | |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# flake8: noqa<|fim▁hole|>
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
('id', models.AutoField(serial... | from __future__ import unicode_literals
from django.db import models, migrations
|
<|file_name|>createrpms.py<|end_file_name|><|fim▁begin|>#
# Script to build RPM's using latest LIS code, it will build the RPM's and copy it to LISISO folder
# currently we have two source tree one for RHEL 5 and one for RHEL6
#
#
import os
import sys
import shutil
import subprocess
homedir = os.getcwd()
directory =... | myfile.write("homedir="+homedir)
# Change direcoty to buildpath, before building .
os.chdir(rhel7buildpath) |
<|file_name|>DogfightErrorState.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2016 OpenXcom Developers.
*
* This file is part of OpenXcom.
*
* OpenXcom 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 Foundat... | |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
"""
Unit tests for the Grammar class and for the GrammarAnalyzer class.
Tests each grammar in the "grammars" folder against a variety of strings.
"""
import unittest
from grammar import Grammar
from grammaranalyzer import GrammarAnalyzer
class... |
def test_grammar1(self):
grammar = Grammar("grammars/grammar1.json")
grammar_analyzer = GrammarAnalyzer(grammar) |
<|file_name|>UI.js<|end_file_name|><|fim▁begin|>"use strict";
exports.buttonEvent = function(id) {
return function(cb) {
return function() {
var el = document.getElementById(id);
el.addEventListener('click', function(ev) {
cb();
});
}
};
};
exports.keydownEvent = function(el) {
... | var debugDivId = "debugDiv";
|
<|file_name|>generate_examples_lib.py<|end_file_name|><|fim▁begin|># Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:/... | "input_dtype": [tf.float32], |
<|file_name|>cost_estimate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Author: Joël Grand-Guillaume
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... | # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details. |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import time
from datetime import timedelta
from djcelery_transactions import task
from django.utils import timezone
from redis_cache import get_redis_connection
from .models import CreditAlert, Invitation, Org,... | |
<|file_name|>stocks.py<|end_file_name|><|fim▁begin|>import numpy as np
import pandas as pd
from bokeh.plotting import *
# Here is some code to read in some stock data from the Yahoo Finance API
AAPL = pd.read_csv(
"http://ichart.yahoo.com/table.csv?s=AAPL&a=0&b=1&c=2000",
parse_dates=['Date'])
GOOG = pd.read_... | x_axis_type = "datetime", # NOTE: only needed on first
tools="pan,wheel_zoom,box_zoom,reset,previewsave" # NOTE: only needed on first
)
|
<|file_name|>convert_cldr.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from gi.repository import Gdk
from xml.etree.ElementTree import ElementTree, Element
import re
ESCAPE_PATTERN = re.compile(r'\\u\{([0-9A-Fa-f]+?)\}')
ISO_PATTERN = re.compile(r'[A-E]([0-9]+)')
def parse_single_key(value):
key = Element(... | root.append(level)
level.set('name', 'level%d' % (index+1))
# FIXME: heuristics here
modifiers = keymap.get('modifiers') |
<|file_name|>JdbcDataTest.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you un... | .sql("select * from departments")
.returns(
"_MAP={deptId=31, name=Sales}\n" + "_MAP={deptId=33, name=Engineering}\n"
+ "_MAP={deptId=34, name=Clerical}\n" + "_MAP={deptId=35, name=Marketing}\n"); |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clist):
... | |
<|file_name|>core-help.js<|end_file_name|><|fim▁begin|>// Help functions
/*
* Return a string with all helper functions whose name contains the 'substring';
* if the 'searchDescription' is true, then also search the function description");
*/
function getHelp(substring, searchDescription) {
return framework.get... | write(framework.getJavaScriptHelp(regex, false), fileName);
} else if (arguments.length > 0) { |
<|file_name|>rad_util.py<|end_file_name|><|fim▁begin|># Copyright (c) 2007 RADLogic
#
# 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 limitation the... | >>> round_grid(7.3, 5, mode=1)
|
<|file_name|>EditFormat.java<|end_file_name|><|fim▁begin|>/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE file at the root of the source
* tree and available online at
*
* https://github.com/keeps/roda
*/
package org.roda.wui.client.planning;
import java.util.Ar... | initWidget(uiBinder.createAndBindUi(this));
} |
<|file_name|>check_errors_xlsx.py<|end_file_name|><|fim▁begin|>from openpyxl import load_workbook
import os
# list of text to search for
keyWordList = ['Resume', 'Label', 'Description', 'ClueText', 'Title', 'QTEtitle']
# default path for docs on my PC for sh8 game xlsx documents
#docDir = "d:/svn/ue3/SH8Game/... | workBook = load_workbook(docPath)
# for test purposes
print docPath
|
<|file_name|>test_artificial_32_Anscombe_Lag1Trend_0_12_20.py<|end_file_name|><|fim▁begin|>import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art<|fim▁hole|>
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 0, transform = "Anscombe", ... | |
<|file_name|>StructureGenTree.java<|end_file_name|><|fim▁begin|>package Game.generation;
import Game.base.BlockBase;
import Game.base.World;
/**
*
* @author maximumtech
*/
public class StructureGenTree extends StructureGenBase {
<|fim▁hole|>
public void generate(int x, int y) {
int height = 13 + rand.n... | public StructureGenTree(World world) {
super(world);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.