prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>config.ts<|end_file_name|><|fim▁begin|>export const CONFIG = { github: { token: process.env.GITHUB_TOKEN<|fim▁hole|> } };<|fim▁end|>
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>''' Provides a command line application for Bokeh. The following subcommands are available: ''' from __future__ import absolute_import def _build_docstring(): global __doc__ from . import subcommands for cls in subcommands.all:<|fim▁hole|> _build_doc...
__doc__ += "%8s : %s\n" % (cls.name, cls.help)
<|file_name|>InfSourceSectionParser.py<|end_file_name|><|fim▁begin|>## @file # This file contained the parser for [Sources] sections in INF file # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the te...
LineCommentContent = '' for Item in HeaderComments: LineCommentContent += Item[0] + DT.END_OF_LINE LineComment.SetHeaderComments(LineCommentContent)
<|file_name|>operations.py<|end_file_name|><|fim▁begin|># This file is part of Indico. # Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN). # # Indico 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 Softw...
case `undo_unschedule` contains the necessary data to re-schedule it (undoing the session change causing it to be unscheduled)
<|file_name|>TreeNodeProject.java<|end_file_name|><|fim▁begin|>/* * Orbit, a versatile image analysis software for biological image-based quantification. * Copyright (C) 2009 - 2017 Idorsia Pharmaceuticals Ltd., Hegenheimermattweg 91, CH-4123 Allschwil, Switzerland. * * This program is free software: y...
@Override public synchronized List<TreeNodeProject> getNodes(AbstractOrbitTreeNode parent) {
<|file_name|>ClassTemplateBuilder.java<|end_file_name|><|fim▁begin|>package twg2.template.codeTemplate; import java.util.ArrayList; import java.util.List; import java.util.Map; /** * @param <T> the {@link ClassInfo} to build * * @author TeamworkGuy2 * @since 2015-1-24 */ public final class ClassTemplateBuilder<...
<|file_name|>discount.py<|end_file_name|><|fim▁begin|><|fim▁hole|># - Node (administer inline with nodes) # - Bulk amounts on nodes # - User # - Group of users # - Order (this is more-or-less a voucher) # - Shipping costs # Possible amounts: # - Percentage # - Fixed amount # Flag indicating if a discount can be combine...
# Possible discounts:
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals from django.db import models from django.core.paginator import Paginator, PageNotAnInteger from wagtail.wagtailcore.models import Page from wagtail.wagtailcore.fields import RichTextField from wagtail.wagtailadmin.edit_handler...
class EventIndexPage(Page):
<|file_name|>handjoob.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright(C) 2013 Bezleputh # # This file is part of weboob. # # weboob 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, e...
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main import ( "api/handlers" "fmt" "net/http" "runtime" "time" ) func init() { runtime.GOMAXPROCS(runtime.NumCPU()) } func main() { fmt.Println("Server is start at ", time.Now().String(), " , on port 8080") http.HandleFunc("/useage", handlers.Useage)<...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python from django.http import HttpResponse from django.template import RequestContext, loader from django.views.decorators.csrf import csrf_exempt import django.shortcuts<|fim▁hole|>#-------------------------------------------------------------------------...
from wlokalu.api import presence
<|file_name|>train.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import argparse from collections import OrderedDict import json import os import logging from keras.callbacks import EarlyStopping from sklearn.preprocessing import normalize from sklearn.metrics import roc_curve, auc, roc_auc_scor...
else: X_meta = None
<|file_name|>NetworkConfigurator.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2006-2007 Sun Microsystems, Inc. All rights reserved. * * The Sun Project JXTA(TM) Software License * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the follo...
// *
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2014-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <L...
BlockDynHlit => ok!(BlockDynHdist(take!(5) + 1)), BlockDynHdist(hlit) => ok!(BlockDynHclen(hlit, take!(5) + 1)), BlockDynHclen(hlit, hdist) => {
<|file_name|>call_interpolate.py<|end_file_name|><|fim▁begin|>from bundleprocessing import interpolateMetric import pandas as pd import nibabel as nib import argparse parser = argparse.ArgumentParser() parser.add_argument('-templateBundle', '--templateBundle', required = True) parser.add_argument('-subjectBundle', '...
parser.add_argument('-flip', '--flip', type=bool, required = True) parser.add_argument('-outTracks', '--outTracks', required = True)
<|file_name|>halfspace.cpp<|end_file_name|><|fim▁begin|>/* * Software License Agreement (BSD License) * * Copyright (c) 2011-2014, Willow Garage, Inc. * Copyright (c) 2014-2016, Open Source Robotics Foundation * All rights reserved. * * Redistribution and use in source and binary forms, with or without * m...
} //==============================================================================
<|file_name|>OffHeapStarTreeBuilder.java<|end_file_name|><|fim▁begin|>/** * Copyright (C) 2014-2015 LinkedIn Corp. (pinot-core@linkedin.com) * * 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 ...
dictionary.put(dimValue, dictionary.size()); } dimension.setDimension(i, dictionary.get(dimValue)); }
<|file_name|>requireAfterTeardown.test.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.<|fim▁hole|>import runJest from '../runJest'...
*/ import {wrap} from 'jest-snapshot-serializer-raw';
<|file_name|>channels.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ################################################## ## DEPENDENCIES import sys import os import os.path try: import builtins as builtin except ImportError: import __builtin__ as builtin from os.path import getmtime, exists import tim...
<|file_name|>vtable.rs<|end_file_name|><|fim▁begin|>/* * Copyright 2018 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/l...
read_scalar_at::<VOffsetT>( self.buf, self.loc + SIZE_VOFFSET + SIZE_VOFFSET + SIZE_VOFFSET * idx,
<|file_name|>book-store.rs<|end_file_name|><|fim▁begin|>//! Tests for book-store //! //! Generated by [script][script] using [canonical data][canonical-data] //! //! [script]: https://github.com/exercism/rust/blob/master/bin/init_exercise.py //! [canonical-data]: https://raw.githubusercontent.com/exercism/problem-speci...
/// Only a single book fn test_only_a_single_book() { process_total_case((vec![1], vec![vec![1]]), 8.0); }
<|file_name|>issue-63832-await-short-temporary-lifetime.rs<|end_file_name|><|fim▁begin|>// check-pass // edition:2018 async fn foo(x: &[Vec<u32>]) -> u32 { 0 } <|fim▁hole|> foo(&[vec![123]]).await; } fn main() { }<|fim▁end|>
async fn bar() {
<|file_name|>oneshot.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/license...
<|file_name|>projectdb.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-07-17 21:06:43 import time import mysql.connector from pyspider.database.base.projectdb import...
return None def drop(self, name):
<|file_name|>log_ft_data.cpp<|end_file_name|><|fim▁begin|>/* * log_ft_data.cpp * * Created on: Jul 9, 2010 * Author: dc */ #include <iostream> #include <cstdio> #include <cstdlib> #include <syslog.h> #include <signal.h> #include <unistd.h> #include <native/task.h> #include <native/timer.h> #include <boos...
outFile = argv[2]; printf("Output file: %s\n", outFile); } else if (strcmp(argv[1], "-a") == 0) {
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import csv import pickle import datetime import os import urllib.request, urllib.parse, urllib.error from django.core.cache import cache from django.urls import reverse from django.http import HttpResponseRedirect, HttpResponse, Http404 from django.db.models import Q ...
dishonesty_cases = DisciplineCaseInstrStudent.objects.filter(offering=course, student=member.person) group_memberships = GroupMember.objects.filter(student=member, activity__offering__slug=course_slug) grade_history = GradeHistory.objects.filter(member=member, status_change=False).select_related('enter...
<|file_name|>polyfills.js<|end_file_name|><|fim▁begin|>// Polyfills if ( Number.EPSILON === undefined ) { Number.EPSILON = Math.pow( 2, - 52 ); } if ( Number.isInteger === undefined ) { // Missing in IE // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger Number...
throw new TypeError( 'Cannot convert undefined or null to object' );
<|file_name|>setup_bgmapi.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages setup( name = 'project',<|fim▁hole|> packages = find_packages(), entry_points = {'scrapy': ['settings = bgmapi.settings']}, )<|fim▁end|>
version = '1.0',
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import functools from framework.auth import Auth<|fim▁hole|> from website.archiver import ( StatResult, AggregateStatResult, ARCHIVER_NETWORK_ERROR, ARCHIVER_SIZE_EXCEEDED, ARCHIVER_FILE_NOT_FOUND, ARCHIVER_FORCED_FAILURE, ) from website import ( ...
<|file_name|>SimpleObject.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|># Copyright (c) 2017 Jason Lowe-Power # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions...
<|file_name|>window.js<|end_file_name|><|fim▁begin|>/** * A debounce method that has a sliding window, there's a minimum and maximum wait time **/ module.exports = function (cb, min, max, settings) { var ctx, args, next, limit, timeout; <|fim▁hole|> settings = {}; } function fire() { limit = null; cb.apply(s...
if (!settings) {
<|file_name|>app.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule } from '@angular/forms'; import { AppComponent } from './app.component'; import { jqxCheckBoxComponent } from 'components/angular_jq...
bootstrap: [AppComponent] })
<|file_name|>cdpserver.py<|end_file_name|><|fim▁begin|>''' ThunderGate - an open source toolkit for PCI bus exploration Copyright (C) 2015-2016 Saul St. John 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...
for c in v.children:
<|file_name|>ExactInlineInfo.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU Gene...
import org.graalvm.compiler.nodes.spi.CoreProviders;
<|file_name|>fake_video_capture_device.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "media/video/capture/fake_video_capture_device.h" #include <string> ...
if (capture_thread_.IsRunning()) {
<|file_name|>dllmain.cpp<|end_file_name|><|fim▁begin|>/* This file is part of: NoahFrame https://github.com/ketoo/NoahGameFrame Copyright 2009 - 2018 NoahFrame(NoahGameFrame) File creator: lvsheng.huang NoahFrame is open-source software and you can redistribute it...
<|file_name|>runner.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2019, Cloudflare, Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must r...
e
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals from django.db.models import signals from django.dispatch import receiver from django.test import TestCase from django.utils import six from .models import Person, Car # #8285: signals can be any callable class PostDeleteHand...
(p2, True, False), ]) data[:] = []
<|file_name|>0002_auto__add_definedgeography.py<|end_file_name|><|fim▁begin|># encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'DefinedGeography' ...
}, 'seak.puvscf': { 'Meta': {'unique_together': "(('pu', 'cf'),)", 'object_name': 'PuVsCf'}, 'amount': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
<|file_name|>testloader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding: utf-8 import unittest import sys import os PROJECT_PATH = os.path.sep.join(os.path.abspath(__file__).split(os.path.sep)[:-2]) ROOT_PATH = os.path.dirname(__file__) if __name__ == '__main__': if 'GAE_SDK' in os.environ: ...
sys.path.insert(0, SDK_PATH) import dev_appserver
<|file_name|>replace.js.ts<|end_file_name|><|fim▁begin|>import path from 'path'; import fs from 'fs'; import rcs from '../lib'; const fixturesCwd = '__tests__/files/fixtures'; const resultsCwd = '__tests__/files/results'; function replaceJsMacro(input, expected, fillLibrary = fs.readFileSync(path.join(fixturesCwd, '...
` const text = 'This has no conflicts';
<|file_name|>no_pivot_ldl_test.py<|end_file_name|><|fim▁begin|># Copyright 2021 The TensorFlow Probability 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.o...
return np.einsum('...ij,...j,...kj->...ik', unit_tril, diag, unit_tril)
<|file_name|>test_restore.py<|end_file_name|><|fim▁begin|># Back In Time # Copyright (C) 2008-2017 Oprea Dan, Bart de Koning, Richard Bailey, Germar Reitze # # 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 ...
# with this program; if not, write to the Free Software Foundation,Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
<|file_name|>create_response.js<|end_file_name|><|fim▁begin|>App.CreateResponseView = Ember.View.extend({ templateName: "studentapp/create_response",<|fim▁hole|> didInsertElement: function() { this.get('controller').send('loadFields'); }.observes('controller.model') });<|fim▁end|>
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|># 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 required by applic...
import warnings
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main import ( "archive/zip" "bitbucket.org/tebeka/nrsc" "fmt" "github.com/remyoudompheng/go-misc/zipfs" "html" "log" "net/http" "os" "strings" "text/template" ) func checkinputdir() { if _, err := os.Stat("./dzi"); os.IsNotExist(err) { fmt.Println...
dziID := strings.Split(html.EscapeString(req.URL.Path), "/")[2] dzi := "/dzi/" + dziID + "/" + dziID + ".dzi" templ.Execute(res, dzi) }
<|file_name|>attr_iterator.rs<|end_file_name|><|fim▁begin|>// Copyright 2018, The Gtk-rs Project Developers. // See the COPYRIGHT file at the top-level directory of this distribution. // Licensed under the MIT license, see the LICENSE file or <https://opensource.org/licenses/MIT> use glib::translate::*; use glib_sys; ...
<|file_name|>wait_condition.rs<|end_file_name|><|fim▁begin|>use alloc::arc::Arc; use collections::Vec; use spin::{Mutex, RwLock}; use context::{self, Context}; #[derive(Debug)] pub struct WaitCondition { contexts: Mutex<Vec<Arc<RwLock<Context>>>> } impl WaitCondition { pub fn new() -> WaitCondition { ...
len } pub fn wait(&self) {
<|file_name|>BendpointSnapping.js<|end_file_name|><|fim▁begin|>import { assign, forEach, isArray } from 'min-dash'; var abs= Math.abs, round = Math.round; var TOLERANCE = 10; export default function BendpointSnapping(eventBus) { function snapTo(values, value) { if (isArray(values)) { var i =...
var snapPoints = context.snapPoints, connection = context.connection,
<|file_name|>component-names-generator.ts<|end_file_name|><|fim▁begin|>import fs = require('fs'); import path = require('path'); export default class ComponentNamesGenerator { private _encoding = 'utf8'; private _config; constructor(config) { this._config = config;<|fim▁hole|> return ` ...
} prepareTagName(fileName: string) {
<|file_name|>WrapperClassBean.java<|end_file_name|><|fim▁begin|>/* * $Id: WrapperClassBean.java 799110 2009-07-29 22:44:26Z musachy $ * * 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...
private boolean primitiveBooleanField2;
<|file_name|>Database.js<|end_file_name|><|fim▁begin|>/* * This file is part of the easy framework. * * (c) Julien Sergent <sergent.julien@icloud.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ const ConfigLoader = require( 'easy/co...
* get - get database configurations *
<|file_name|>assert0.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python -tt<|fim▁hole|> """Use a descriptive macro instead of assert(false);""" error_msg = 'Use NEVER_HERE() from base/macros.h here.' regexp = r"""assert *\( *(0|false) *\)""" forbidden = [ 'assert(0)', 'assert(false)', ] allowed = [ '...
# encoding: utf-8 #
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import include from django.contrib import admin from django.urls import path app_name = "transmission" <|fim▁hole|>urlpatterns = [ path("admin/", admin.site.urls), path("torrents/", include("torrents.urls", namespace="torrents")), path...
<|file_name|>test_source.py<|end_file_name|><|fim▁begin|>from blueice.test_helpers import * from blueice.model import Model def test_mcsource(): conf = test_conf(mc=True) m = Model(conf) s = m.sources[0] bins = conf['analysis_space'][0][1] assert s.events_per_day == 1000 assert s.fraction_in_r...
assert (s.pdf([bins[0]]) + s.pdf([bins[1]])) / 2 == s.pdf([(bins[0] + bins[1])/2])
<|file_name|>create_venv.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # 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 script can be used to setup a vi...
print 'Installing Firefox UI Tests and dependencies...' print 'Command: %s' % command
<|file_name|>implementation.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ''' Created on Nov 14, 2014 Implementation of a hand speed-based segmentation module @author: Arturo Curiel ''' import zope.interface as zi try: import magic except:<|fim▁hole|> from nixtla.segmentation.handspeed_based.adapters ...
import nixtla.core.tools.magic_win as magic from nixtla.core.base_module import BaseModule from nixtla.segmentation.interface import ISegmentationModule
<|file_name|>utils_test.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The Serviced 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/LICEN...
// See the License for the specific language governing permissions and // limitations under the License.
<|file_name|>tools.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 nu from __future__ import (unicode_literals, absolute_import, division, print_function) import re import unicodedata import datetime import subprocess from py3compat im...
def datetime_repr(adatetime):
<|file_name|>ParsedSubdomainMeshGenerator.C<|end_file_name|><|fim▁begin|>//* This file is part of the MOOSE framework //* https://www.mooseframework.org //* //* All rights reserved, see COPYRIGHT for full restrictions //* https://github.com/idaholab/moose/blob/master/COPYRIGHT //* //* Licensed under LGPL 2.1, please se...
elem->subdomain_id() = _block_id;
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>#[path = "../mod.rs"] mod testsuite; pub use testsuite::*;<|fim▁end|>
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0. mod test_cdc;
<|file_name|>test_templatetags.py<|end_file_name|><|fim▁begin|>from django.test import TestCase from common.templatetags.verbose_name import verbose_name from users.models import SystersUser class TemplateTagsTestCase(TestCase):<|fim▁hole|> self.assertEqual(verbose_name(SystersUser, "homepage_url"), "Homepage...
def test_verbose_names(self): """Test verbose_name template tag"""
<|file_name|>OrderByBuilderImpl.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 *...
<|file_name|>ArmorHelper.java<|end_file_name|><|fim▁begin|>package mcmod.nxs.animalwarriors.lib; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemArmor; public class ArmorHelper extends ItemArmor { public ArmorHelper(ArmorMaterial material, int type, int layer)<|fim▁hole|> super(material...
{
<|file_name|>fullscreen.rs<|end_file_name|><|fim▁begin|>#[cfg(target_os = "android")] #[macro_use] extern crate android_glue; extern crate glutin; use std::io; mod support; #[cfg(target_os = "android")] android_start!(main); #[cfg(not(feature = "window"))] fn main() { println!("This example requires glutin to be c...
.unwrap(); unsafe { window.make_current() };
<|file_name|>i2c_device_test.go<|end_file_name|><|fim▁begin|>package sysfs import ( "os" "testing" "gobot.io/x/gobot/gobottest" ) func TestNewI2cDevice(t *testing.T) { fs := NewMockFilesystem([]string{}) SetFilesystem(fs) i, err := NewI2cDevice(os.DevNull) gobottest.Refute(t, err, nil) fs = NewMockFilesyst...
<|file_name|>neuron.rs<|end_file_name|><|fim▁begin|>/* This file is part of Mulp. Mulp 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 License, or (at your option) any later version. Mulp...
// Neuron // McCulloch & Pitts's Neuron //
<|file_name|>editdate.py<|end_file_name|><|fim▁begin|># # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # Copyright (C) 2009 Douglas S. Blank # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public Lic...
<|file_name|>xml-hint.js<|end_file_name|><|fim▁begin|>(function () { "use strict"; <|fim▁hole|> var tags = options && options.schemaInfo; var quote = (options && options.quoteChar) || '"'; if (!tags) return;// logO(tags, 'tags');//gets tags from schema (html in this case) ...
var Pos = CodeMirror.Pos; function getHints(cm, options) {
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os.path <<<<<<< HEAD import re import sys ======= import sys import gspread >>>>>>> # This is a combination of 2 commits. ======= <<<<<<< HEAD import re import sys ======= import sys import gspread >>>>>>> # This is a combination of 2 c...
"Intended Audience :: Science/Research", "Topic :: Office/Business :: Financial :: Spreadsheet",
<|file_name|>registering.rs<|end_file_name|><|fim▁begin|>#![cfg(all(feature = "os-poll", feature = "net"))] use std::io::{self, Write}; use std::thread::sleep; use std::time::Duration; use log::{debug, info, trace}; #[cfg(debug_assertions)] use mio::net::UdpSocket; use mio::net::{TcpListener, TcpStream}; use mio::{Ev...
assert!(events.iter().next().is_none()); }
<|file_name|>pool.rs<|end_file_name|><|fim▁begin|>use std::{mem, fmt}; use std::sync::atomic::{AtomicUsize, Ordering}; use std::ops::{Index, IndexMut}; use std::marker::PhantomData; use std::collections::LinkedList; use std::ops::{Deref, DerefMut}; use std::ptr; pub mod tests; /// Arc is the only valid way to access...
pub unsafe fn retain(&mut self) { self.get_pool().retain(self.index); }
<|file_name|>gregorian.js<|end_file_name|><|fim▁begin|>define( //begin v1.x content { "field-quarter-short-relative+0": "tento štvrťr.", "field-quarter-short-relative+1": "budúci štvrťr.", "dayPeriods-standAlone-abbr-noon": "pol.", "field-tue-relative+-1": "minulý utorok", "field-year": "rok", "dateFormatItem-yw"...
"utorok", "streda", "štvrtok",
<|file_name|>EmptyMain.tsx<|end_file_name|><|fim▁begin|>/** * * @license * Copyright (C) 2017 Joseph Roque * * 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...
* @description Displays a false version of the Main view while the app loads in the background */ 'use strict';
<|file_name|>operations.go<|end_file_name|><|fim▁begin|>package storage // 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 incorr...
if tracing.IsEnabled() {
<|file_name|>introspect_panel.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import ibus import dbus<|fim▁hole|>e = ibus.interface.IPanel() print e.Introspect("/", bus)<|fim▁end|>
bus = dbus.SessionBus()
<|file_name|>index.js<|end_file_name|><|fim▁begin|>// Declare internals <|fim▁hole|> // Plugin registration exports.register = function (plugin, options, next) { plugin.route({ path: '/test2', method: 'GET', handler: function (request, reply) { reply('testing123'); } }); plugin.route({ path: '/test2/path', me...
var internals = {};
<|file_name|>dot.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2015, The Radare Project. All rights reserved. // See the COPYING file at the top-level directory of this distribution. // Licensed under the BSD 3-Clause License: // <http://opensource.org/licenses/BSD-3-Clause> // This file may not be copied, modified,...
fn node_cluster(&self, _: &Self::NodeIndex) -> Option<usize> { Some(0)
<|file_name|>writer.go<|end_file_name|><|fim▁begin|>package goyaml2 import (<|fim▁hole|>) func Write(w io.Writer, v interface{}) error { return nil }<|fim▁end|>
"io"
<|file_name|>contact.py<|end_file_name|><|fim▁begin|>"""Basic contact management functions. Contacts are linked to monitors and are used to determine where to send alerts for monitors. Contacts are basic name/email/phone sets. Contacts are only stored in the database and not in memory, they are loaded from the datab...
<|file_name|>synology.py<|end_file_name|><|fim▁begin|>import json import traceback from couchpotato.core._base.downloader.main import DownloaderBase from couchpotato.core.helpers.encoding import isInt from couchpotato.core.helpers.variable import cleanHost from couchpotato.core.logger import CPLog import requests lo...
return False try: # Send request to Synology
<|file_name|>auth-guard.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, RouterStateSnapshot, Router, Route, CanActivate, CanActivateChild, CanLoad } from '@angular/router'; import { AuthService } from './auth.service'; @Injectable() export ...
console.log('In canLoad: ' + route.path); return this.checkLoggedIn(route.path); }
<|file_name|>test_contents.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import six from sys import platform import locale import os.path from pelican.tests.support import unittest, get_settings from pelican.contents import Page, Article, Static, URL...
self.assertFalse(wrapper_a >= wrapper_b) self.assertFalse(wrapper_a == wrapper_b)
<|file_name|>visavis-chess.js<|end_file_name|><|fim▁begin|>Dagaz.Controller.persistense = "setup"; Dagaz.Model.WIDTH = 8; Dagaz.Model.HEIGHT = 8; ZRF = { JUMP: 0, IF: 1, FORK: 2, FUNCTION: 3, IN_ZONE: 4, FLAG: 5, SET_FLAG: ...
}
<|file_name|>0015_add_tp_path_idx.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.9.11 on 2016-11-04 16:36 from __future__ import unicode_literals from django.db import migrations <|fim▁hole|> ('pootle_app', '0014_set_directory_tp_path'), ] operations = [ migrat...
class Migration(migrations.Migration): dependencies = [
<|file_name|>api.js<|end_file_name|><|fim▁begin|>YUI.add("yuidoc-meta", function(Y) { Y.YUIDoc = { meta: { "classes": [ "Amplitude", "AudioIn", "Env", "FFT", "Noise", "Oscillator", "Pulse", "SoundFile",<|fim▁hole|> "p5.dom", "p5.sound...
"p5.Element", "p5.MediaElement",
<|file_name|>Zinser_Assignment8.py<|end_file_name|><|fim▁begin|>#Mitch Zinser #CSCI 3202 Assignment 8 #Worked with the Wikipedia Example and Brady Auen from math import log2 #For converting numbers to log base 2 '''PIPE TO EXTERNAL FILE WITH > filename.txt''' letters = 'abcdefghijklmnopqrstuvwxyz' '''File to read in da...
word2 += i[2]
<|file_name|>todoviewview.cpp<|end_file_name|><|fim▁begin|>/* This file is part of KOrganizer. Copyright (c) 2008 Thomas Thrainer <tom_t@gmx.at> 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 Foundat...
current.sibling( current.row(), current.column() + 1 ), 1 ); if ( tmp.isValid() ) {
<|file_name|>storage_folding.cpp<|end_file_name|><|fim▁begin|>#include <stdio.h> #include "Halide.h" using namespace Halide; // Override Halide's malloc and free size_t custom_malloc_size = 0; void *my_malloc(void *user_context, size_t x) { custom_malloc_size = x; void *orig = malloc(x+32); void *ptr = ...
<|file_name|>decoder.py<|end_file_name|><|fim▁begin|># Copyright 2016 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.apache.or...
Some decoders, however, shuffle batches / beams between time steps and `tfa.seq2seq.dynamic_decode` will mix up the finished state across these entries because it does not track the reshuffle across time steps. In this case, it is up to the decoder to declare that it will keep track of i...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2014 by SiegeLord // // All rights reserved. Distributed under ZLib. For full terms see the file LICENSE. #![crate_name="allegro_dialog_sys"] #![crate_type = "lib"] extern crate allegro_sys; #[macro_use] extern crate allegro_util; extern crate libc; p...
pub mod allegro_dialog { #![allow(non_camel_case_types)]
<|file_name|>re.4.py<|end_file_name|><|fim▁begin|>import re<|fim▁hole|>p = re.compile(r'(\w+) (\w+)(?P<sign>.*)', re.DOTALL) print re.DOTALL print "p.pattern:", p.pattern print "p.flags:", p.flags print "p.groups:", p.groups print "p.groupindex:", p.groupindex<|fim▁end|>
<|file_name|>exec_date_after_start_date_dep.py<|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<|fim▁hole|># with the License. You may obtain a copy of the L...
# regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! A set of utilities to help with common use cases that are not required to //! fully use the library. #[cfg(all(feature = "client", feature = "cache"))] mod argument_convert; mod colour; mod custom_message; mod message_builder; #[cfg(all(feature = "client", feature ...
#[inline] async fn clean_channels(cache: &impl AsRef<Cache>, s: &mut String) { let mut progress = 0;
<|file_name|>210-Evt-EventListeners.cpp<|end_file_name|><|fim▁begin|>// 210-Evt-EventListeners.cpp // Contents: // 1. Printing of listener data // 2. My listener and registration // 3. Test cases // main() provided in 000-CatchMain.cpp // Let Catch provide the required interfaces: #define CATCH_CONFIG_EXTERNAL_INTER...
<|file_name|>table.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/. */ //! CSS table formatting contexts. #![deny(unsafe_code)] use ...
<|file_name|>closure-reform-pretty.rs<|end_file_name|><|fim▁begin|>// Any copyright is dedicated to the Public Domain. // http://creativecommons.org/publicdomain/zero/1.0/ // pp-exact fn call_it(f: Box<FnMut(String) -> String>) { } fn call_this<F>(f: F) where F: Fn(&str) + Send { } fn call_that<F>(f: F) where F: fo...
<|file_name|>copyfiles.ts<|end_file_name|><|fim▁begin|>/// <reference path="../../definitions/vsts-task-lib.d.ts" /> import path = require('path'); import os = require('os'); import tl = require('vsts-task-lib/task'); function getCommonLocalPath(files: string[]): string { if (!files || files.length === 0) { ...
for (var j: number = 0; j < matches.length; j++) { var matchPath = matches[j]; if (!map.hasOwnProperty(matchPath)) {
<|file_name|>closest.js<|end_file_name|><|fim▁begin|>export default function closest(n, arr) { let i let ndx let diff let best = Infinity let low = 0 let high = arr.length - 1 while (low <= high) { // eslint-disable-next-line no-bitwise i = low + ((high - low) >> 1) diff = arr[i] - n if ...
return arr[ndx]
<|file_name|>tagstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import re, logging, copy from threading import Lock class Tagger(object): def __init__(self, hosts_attr="fields.hosts", hosts_sep=":", tag_file="tags_jobs.safe"): self.tags_by_host = {} self.hosts_sep = str(hosts_sep) ...
def get_tags_by_host(self, host): if host not in self.tags_by_host: return {}