prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>ResultChangeIds.java<|end_file_name|><|fim▁begin|>// Copyright (C) 2018 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apach...
* Keeps track of the change IDs thus far updated by ReceiveCommit. * * <p>This class is thread-safe. */
<|file_name|>capture-and-send.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Script to capture the screen with GTK, and format and send # to a TV backlighting system. # # Copyright 2013 Daniel Foote. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in comp...
green = raw_pixel[1] / scale blue = raw_pixel[2] / scale
<|file_name|>myapp.js<|end_file_name|><|fim▁begin|>$(function() { var select = $( "#minbeds" ); var slider = $( "<div id='slider'></div>" ).insertAfter( select ).slider({ min: 1, max: 4, range: "min", value: select[ 0 ].selectedIndex + 1, slide: function( event, ui ) { ...
}); });
<|file_name|>faGrinHearts.d.ts<|end_file_name|><|fim▁begin|>import { IconDefinition, IconPrefix, IconName } from "@fortawesome/fontawesome-common-types"; export const definition: IconDefinition; export const faGrinHearts: IconDefinition; export const prefix: IconPrefix; export const iconName: IconName; export const wi...
export const ligatures: string[]; export const unicode: string;
<|file_name|>CrudValidationTest.java<|end_file_name|><|fim▁begin|>/* Copyright 2013 Red Hat, Inc. and/or its affiliates. This file is part of lightblue. 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 Foun...
} @Test public void testInvalidInputWithNonValidating() throws Exception {
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// @adjivas - github.com/adjivas. See the LICENSE<|fim▁hole|>// // This file may not be copied, modified, or distributed // except according to those terms. #[macro_use] extern crate msg; #[allow(unused_unsafe)] #[allow(unused_assignments)] #[test] fn the_message () { ...
// file at the top-level directory of this distribution and at // https://github.com/adjivas/sem
<|file_name|>ErrorHandler.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|>Copyright (c) 2016-2017, Kir Chou https://github.com/note35/sinon/blob/master/LICENSE A set of functions for handling known error """ def __exception_helper(msg, exception=Exception): #pylint: disable=missing-docstring raise exception(msg) ...
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages, Extension recoil_module = Extension('_recoil', sources=['recoil_interface.c', 'recoil.c']) def readme(): with open('README.rst') as f: return f.read() setup( name="pyrecoil", version="0.3.1",<|fim▁hole...
packages=find_packages(), ext_modules=[recoil_module], include_package_data=True,
<|file_name|>test_logging_support.py<|end_file_name|><|fim▁begin|># # LMirror is Copyright (C) 2010 Robert Collins <robertc@robertcollins.net> # # LMirror 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, eithe...
#
<|file_name|>LayerCacheModel.java<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. * * This 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 * Software Foundation; eith...
<|file_name|>simple.go<|end_file_name|><|fim▁begin|>package examples <|fim▁hole|>const JSONExample_User = `{ "name": "calavera" }`<|fim▁end|>
<|file_name|>test_linear_layer.py<|end_file_name|><|fim▁begin|># ---------------------------------------------------------------------------- # Copyright 2015 Nervana Systems Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You m...
init_unif = Uniform(low=w_rng[0], high=w_rng[1]) layer = Linear(nout=nout, init=init_unif)
<|file_name|>checks.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 applicable law or ...
<|file_name|>test_withlatestfrom.py<|end_file_name|><|fim▁begin|>import unittest from rx import Observable from rx.testing import TestScheduler, ReactiveTest, is_prime, MockDisposable from rx.disposables import Disposable, SerialDisposable on_next = ReactiveTest.on_next on_completed = ReactiveTest.on_completed on_err...
e2 = Observable.never() def create():
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use std::error; use std::fmt; #[derive(Debug)] pub enum MiningError { Iteration, NoParent, } impl fmt::Display for MiningError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { MiningError::Iteration => write!(f, "co...
MiningError::Iteration => "could not mine block, hit iteration limit", MiningError::NoParent => "block has no parent", }
<|file_name|>LBFGS.java<|end_file_name|><|fim▁begin|>/* * LBFGS.java * * Copyright (C) 2016 Pavel Prokhorov (pavelvpster@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, eith...
}
<|file_name|>fuzzing_helpers.cc<|end_file_name|><|fim▁begin|>// Copyright 2020-2021 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 // // http://www.apache.org/licenses/LIC...
std::string InputTypeToDirectoryName(InputType input_type) { // TODO(#27): Extend when more input types are supported. switch (input_type) {
<|file_name|>service.py<|end_file_name|><|fim▁begin|>""" System services =============== This module provides low-level tools for managing system services, using the ``service`` command. It supports both `upstart`_ services and traditional SysV-style ``/etc/init.d/`` scripts. .. _upstart: http://upstart.ubuntu.com/ ...
fabtools.service.start('foo') """ sudo('service %(service)s restart' % locals())
<|file_name|>kendo.culture.ur.js<|end_file_name|><|fim▁begin|>/* * Kendo UI v2015.2.805 (http://www.telerik.com/kendo-ui) * Copyright 2015 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a comm...
}, currency: { pattern: ["$n-","$n"],
<|file_name|>string.hpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2014 Mustafa Gönül * * dnw 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) a...
/** * @brief Splits @a str @a delimiter into @a result.
<|file_name|>HttpServer.js<|end_file_name|><|fim▁begin|>"use strict"; var express = require('express'); var less = require('less-middleware'); function HttpServer(port, staticServedPath, logRequest) { this.port = port; this.staticServedPath = staticServedPath; this.logRequest = (typeof logRequest === "undefined...
console.log(req.method, req.url);
<|file_name|>Warps.java<|end_file_name|><|fim▁begin|>package com.earth2me.essentials; import com.earth2me.essentials.commands.WarpNotFoundException; import com.earth2me.essentials.utils.StringUtil; import net.ess3.api.InvalidNameException; import net.ess3.api.InvalidWorldException; import org.bukkit.Location; import o...
return keys; }
<|file_name|>server_lib_same_variables_clear_test.py<|end_file_name|><|fim▁begin|># Copyright 2017 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...
# Reinitializes the variables. sess_2.run(variables.global_variables_initializer()) self.assertAllEqual([[4]], sess_2.run(v2)) sess_2.close()
<|file_name|>JdkComboBox.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.apache.org/licenses/...
addElement(new SuggestedJdkItem(type, path)); } } }
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use failure::{format_err, Error}; mod dependency; pub use self::dependency::{Dependency, DependencySet}; mod parser_state; pub use self::parser_state::ParserState; mod trans_system; pub use self::trans_system::{AttachmentAddr, Transition, TransitionLookup,...
use std::collections::HashSet; use conllx::Token;
<|file_name|>delete_tmp_dirs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Copyright 2021 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file.<|fim▁hole|> """Delete files from the temporary directory on a Swarming bot.""" import os import sys...
<|file_name|>play_20170606134526.js<|end_file_name|><|fim▁begin|>var playState = { create: function(){ var background = game.add.sprite(0, 0, 'cidade'); background.width = 1300; background.height = 650; graphics = game.add.graphics(0, 0); groupCidade = game.add.group(); ...
graphics.lineStyle(3, 0x05005e, 1); graphics.drawRoundedRect(x, 200, 315, 190, 10);
<|file_name|>PisNP.py<|end_file_name|><|fim▁begin|>import sys input_data = sys.stdin.readlines() static = input_data.pop(0).rstrip().split() teams = int(static[0]) pizza = int(static[1]) nopizza= int(static[2]) input_data.pop(0) pizza_scores = input_data[0:pizza] input_data = input_data[pizza:] pizza_scores = [-1 i...
<|file_name|>spam-messages.js<|end_file_name|><|fim▁begin|>import r from 'restructure'; import Entity from '../entity';<|fim▁hole|> export default Entity({ id: r.uint32le, name: StringRef, });<|fim▁end|>
import StringRef from '../string-ref';
<|file_name|>htmlstyleelement.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use cssparser::Parser as CssParser; use dom::binding...
use layout_interface::{LayoutChan, Msg}; use style::media_queries::parse_media_query_list;
<|file_name|>test.py<|end_file_name|><|fim▁begin|># Copyright (c) 2006 The Regents of The University of Michigan # 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 mu...
# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
<|file_name|>class_snowflake_1_1_game_1_1_game_database.js<|end_file_name|><|fim▁begin|>var class_snowflake_1_1_game_1_1_game_database =<|fim▁hole|> [ "GetGameByUUID", "class_snowflake_1_1_game_1_1_game_database.html#ada7d853b053f0bbfbc6dea8eb89e85c4", null ], [ "GetGamesByName", "class_snowflake_1_1_game_1_1_ga...
[ [ "GameDatabase", "class_snowflake_1_1_game_1_1_game_database.html#a2f09c1f7fe18beaf8be1447e541f4d68", null ], [ "AddGame", "class_snowflake_1_1_game_1_1_game_database.html#a859513bbac24328df5d3fe2e47dbc183", null ], [ "GetAllGames", "class_snowflake_1_1_game_1_1_game_database.html#a7c43f2ccabe44f0491ae25...
<|file_name|>mainThreadDocumentContentProviders.ts<|end_file_name|><|fim▁begin|>/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for licens...
<|file_name|>RegisterInstancesWithLoadBalancerResult.java<|end_file_name|><|fim▁begin|>/* * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.<|fim▁hole|> * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/ap...
* * Licensed under the Apache License, Version 2.0 (the "License").
<|file_name|>tooltip.spec.ts<|end_file_name|><|fim▁begin|>import { TestBed, ComponentFixture, fakeAsync, tick } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { Tooltip, TooltipModule } from './tooltip'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; i...
describe('Tooltip', () => { let tooltip: Tooltip;
<|file_name|>post_comments_responses.go<|end_file_name|><|fim▁begin|>package comment // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "fmt" "github.com/go-swagger/go-swagger/client" "github.com/go-swagger/go-swagger/httpk...
}
<|file_name|>mstcpip.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015-2017 winapi-rs developers // 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. // All files i...
pub fn IN4_IS_UNALIGNED_ADDR_UNSPECIFIED(a: &IN_ADDR) -> bool { unsafe { *a.S_un.S_addr() == IN4ADDR_ANY } } #[inline]
<|file_name|>commandinfo.go<|end_file_name|><|fim▁begin|>// Copyright 2014 Gary Burd // // 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|>texture_animator.rs<|end_file_name|><|fim▁begin|>use resources::AnimatedTexture; use rand::{Rng, thread_rng}; use sfml::graphics::IntRect; pub struct TextureAnimator { n_frames: u32, step: i32, randomize: (bool, bool), tex_width: u32, current: u32, delay: f32, timer: f32, r...
<|file_name|>report_data_map.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals # mappings for table dumps # "remember to add indexes!" data_map = { "Company": { "col...
"order_by": "lft" },
<|file_name|>en-gb.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'colordialog', 'en-gb', { clear: 'Clear', highlight: 'Highlight', options: 'C...
selected: 'Selected Colour', title: 'Select colour' } );
<|file_name|>user.py<|end_file_name|><|fim▁begin|># Authors: # Jason Gerard DeRose <jderose@redhat.com> # Pavel Zuna <pzuna@redhat.com> # # Copyright (C) 2008 Red Hat # see file 'COPYING' for use and warranty information # # This program is free software; you can redistribute it and/or modify # it under the terms ...
options['preserve'] = False elif preserve: options['preserve'] = True
<|file_name|>client_pool.go<|end_file_name|><|fim▁begin|>/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Un...
"k8s.io/client-go/1.5/pkg/api"
<|file_name|>SettingsActivity.java<|end_file_name|><|fim▁begin|>/* * This is the source code of Telegram for Android v. 3.x.x. * It is licensed under GNU GPL v. 2 or later. * You should have received a copy of the license in this archive (see LICENSE). * * Copyright Nikolai Kudashov, 2013-2016. */ package org.po...
SerializedData data = new SerializedData(); res.user.serializeToStream(data); editor.putString("support_user", Base64.encodeToString(data.toByteArray(), Base64.DEFAULT));
<|file_name|>test_one_hot_encoding.py<|end_file_name|><|fim▁begin|>import os import unittest<|fim▁hole|>from ParamSklearn.components.data_preprocessing.one_hot_encoding import OneHotEncoder from ParamSklearn.util import _test_preprocessing class OneHotEncoderTest(unittest.TestCase): def setUp(self): self....
import numpy as np from scipy import sparse
<|file_name|>lifetime.rs<|end_file_name|><|fim▁begin|>use std::cmp::Ordering; use std::fmt::{self, Display}; use std::hash::{Hash, Hasher}; use proc_macro2::{Ident, Span}; #[cfg(feature = "parsing")] use crate::lookahead; /// A Rust lifetime: `'a`. /// /// Lifetime names must conform to the following rules: /// /// ...
#[cfg(feature = "parsing")] pub mod parsing { use super::*;
<|file_name|>RippleAdaptersTest.java<|end_file_name|><|fim▁begin|>package org.knowm.xchange.ripple; import static org.assertj.core.api.Assertions.assertThat; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMa...
final ObjectMapper mapper = new ObjectMapper();
<|file_name|>api.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 {ChangeDetectionStrategy, ViewEncapsulation} from '../../cor...
* Whether to wrap the 'directives' and/or `pipes` array, if one is generated, in a closure. * * This is done when the directives or pipes contain forward references. */
<|file_name|>menu.py<|end_file_name|><|fim▁begin|># This file is part of Indico. # Copyright (C) 2002 - 2015 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 Software Fo...
@return_ascii def __repr__(self):
<|file_name|>arviz-plot_dist-5.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
az.plot_dist(b, rug=True, quantiles=[.25, .5, .75], cumulative=True)
<|file_name|>KeepyUppy.java<|end_file_name|><|fim▁begin|>/* Copyright David Strachan Buchan 2013 * This file is part of BounceBallGame. BounceBallGame 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...
printLicence(); game = new KeepyUppy();
<|file_name|>asterisk_based.rs<|end_file_name|><|fim▁begin|>/* * This file is part of libloadorder * * Copyright (C) 2017 Oliver Hamlet * * libloadorder 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, e...
use std::fs::{remove_dir_all, File}; use std::io; use std::io::{BufRead, BufReader};
<|file_name|>ApplicationTest.java<|end_file_name|><|fim▁begin|>package ru.ac.uniyar.dots; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestC...
super(Application.class); } }
<|file_name|>interfaces.py<|end_file_name|><|fim▁begin|>from zope import component from zope import interface from zope.interface.interfaces import IObjectEvent from zope import location from sparc.configuration.container import ISparcPyContainerConfiguredApplication #EVENTS class ISnippetAvailableForSecretsSniffEvent...
""" #SNIPPETS
<|file_name|>container.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 General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
if item: container.children[slot_or_type] = None item.container = None item.slot = -1
<|file_name|>test_sys.py<|end_file_name|><|fim▁begin|>import unittest from petsc4py import PETSc # --------------------------------------------------------------------<|fim▁hole|>class TestVersion(unittest.TestCase): def testGetVersion(self): version = PETSc.Sys.getVersion() self.assertTrue(versio...
<|file_name|>BrickView.java<|end_file_name|><|fim▁begin|>package eu.dowsing.kolla.widget.brick.facade; import javafx.scene.layout.Pane; import javafx.scene.paint.Color; import javafx.scene.shape.Circle; import javafx.scene.shape.CircleBuilder; import javafx.scene.shape.Rectangle; import javafx.scene.shape.RectangleBui...
public void showHand(Importance importance, Position pos, int fingerCount, boolean handledGesture) { // first all rectangles visible setVisible(true);
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>""" WSGI config for mng_files project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/<|fim▁hole|>import os import sys path = os.path.ab...
"""
<|file_name|>module.js<|end_file_name|><|fim▁begin|>(function () { 'use strict'; <|fim▁hole|> 'ui.bootstrap', 'ui.router', 'driver.customReports', 'driver.resources', 'angular-spinkit', ]); })();<|fim▁end|>
angular.module('driver.tools.export', [
<|file_name|>password-match-validator.ts<|end_file_name|><|fim▁begin|>import { FormGroup } from '@angular/forms'; export class PasswordMatchValidator { static validate(passwordFormGroup: FormGroup) { const password = passwordFormGroup.controls.password.value; const repeatPassword = passwordFormGroup.co...
};
<|file_name|>task.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/L...
}
<|file_name|>operation_panel.ts<|end_file_name|><|fim▁begin|>import styled from 'styled-components' import { PanelWrapper as PanelWrapperBase, PanelInnerWrapper as PanelInnerWrapperBase, IndexArrowIcon as IndexArrowIconBase, } from './index' export const Wrapper = styled(PanelWrapperBase)`` export const InnerWr...
top: -18px; right: 16px; `
<|file_name|>iter.rs<|end_file_name|><|fim▁begin|>//! Iterators over a `Rope`'s data. //! //! The iterators in Ropey can be created from both `Rope`s and `RopeSlice`s. //! When created from a `RopeSlice`, they iterate over only the data that the //! `RopeSlice` refers to. For the `Lines` and `Chunks` iterators, the da...
let mut lines = Vec::new(); let mut itr = s.lines(); while let Some(text) = itr.next() {
<|file_name|>Test.java<|end_file_name|><|fim▁begin|>package com.oauth.services.security; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.keygen.BytesKeyGenerator; import org.springframework.security.crypto.keygen.KeyGenerators; import org.springframew...
*/
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Color-Coding Studio. All Rights Reserved. * * Use of this source code is governed by an Apache License, Version 2.0 * that can be found in the LICENSE file at http://www.apache.org/licenses/LICENSE-2.0 <|fim▁hole|><|fim▁end|>
*/ /// <reference path="./IdentityChooseView.ts" />
<|file_name|>kernel.py<|end_file_name|><|fim▁begin|>"""Module containing kernel related classes""" __author__ = 'wittawat' from abc import ABCMeta, abstractmethod import numpy as np import scipy.signal as sig class Kernel(object): """Abstract class for kernels""" __metaclass__ = ABCMeta @abstractmethod ...
<|file_name|>client_test.go<|end_file_name|><|fim▁begin|>package buckyclient import ( // "errors" "bytes" "fmt" "io" "io/ioutil" "log" "net/http" "net/http/httptest" "os" "testing" "time" "github.com/stretchr/testify/assert" ) // mockBuckyServer echoes out the contents it receives in its request body fu...
<|file_name|>omni_completer_test.py<|end_file_name|><|fim▁begin|># encoding: utf-8 # # Copyright (C) 2016 YouCompleteMe contributors # # This file is part of YouCompleteMe. # # YouCompleteMe is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # ...
# Fails here: Filtering on unicode is not supported eq_( results, [ omnifunc_result[ 1 ] ] )
<|file_name|>PartialCompilationTest.java<|end_file_name|><|fim▁begin|>/* * Copyright 2017 The Closure Compiler 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 *<|fim▁hole|> * U...
* http://www.apache.org/licenses/LICENSE-2.0 *
<|file_name|>_api_tag_description_operations.py<|end_file_name|><|fim▁begin|># coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license informati...
cls = kwargs.pop('cls', None) # type: ClsType["_models.TagDescriptionContract"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class XorgServer(AutotoolsPackage, XorgPackage)...
<|file_name|>ros1initializer.cpp<|end_file_name|><|fim▁begin|>#include "ros1initializer.h" #include <ros/ros.h> #include <common/logging.h> using namespace roscommunication; Ros1Initializer::Ros1Initializer(QString name) : mInitialized(false) { ros::VP_string initString; QString nodeName = name; ros::...
} mInitialized = true; debug(LOG_WARNING, "RosInitializer", "Initialized");
<|file_name|>testsettings.py<|end_file_name|><|fim▁begin|>""" Settings for testing the application. """ import os DEBUG = True DJANGO_RDFLIB_DEVELOP = True DB_PATH = os.path.abspath(os.path.join(__file__, '..', '..', '..', 'rdflib_django.db')) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sql...
}
<|file_name|>threadChild.ts<|end_file_name|><|fim▁begin|>/** * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import {isMainThread, parentPort} from 'worker_threa...
error = new Error('"null" or "undefined" thrown'); }
<|file_name|>node_test.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The Cockroach 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/LI...
<|file_name|>pre-commit-hook.js<|end_file_name|><|fim▁begin|>const execSync = require( 'child_process' ).execSync; const spawnSync = require( 'child_process' ).spawnSync; const existsSync = require( 'fs' ).existsSync; const path = require( 'path' ); const chalk = require( 'chalk' ); const _ = require( 'lodash' ); cons...
<|file_name|>helper.js<|end_file_name|><|fim▁begin|>var EFA = { log: [], /* Prevent backspace being used as back button in infopath form in modal. Source: http://johnliu.net/blog/2012/3/27/infopath-disabling-backspace-key-in-browser-form.html grab a reference to the modal window object in ...
};
<|file_name|>cellrenderertoggle.rs<|end_file_name|><|fim▁begin|>// This file is part of rgtk. // // rgtk 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, either version 3 of the License, or // (at your...
<|file_name|>ColSpec.js<|end_file_name|><|fim▁begin|>import React from 'react'; import ReactTestUtils from 'react/lib/ReactTestUtils'; import ReactDOM from 'react-dom'; import Col from '../src/Col'; describe('Col', () => { it('Should set Offset of zero', () => { let instance = ReactTestUtils.renderIntoDocument(...
let instanceClassName = ReactDOM.findDOMNode(instance).className; assert.ok(instanceClassName.match(/\bcol-xs-pull-0\b/));
<|file_name|>setversion.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # # Copyright (C) 2017-2020 EOS di Manlio Morini. # # 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....
def file_process(name, rule, args): print("--- Processing " + os.path.basename(name))
<|file_name|>node.rs<|end_file_name|><|fim▁begin|>use std::fmt; use common; use ast; use super::token; use ast::NodeVisitor; pub fn dump_node<'a>(node: &'a ast::Node<'a>) -> String { let mut dumper = NodeDumper::new(); node.accept(&mut dumper); dumper.status().result.clone() } pub fn dump_bare_node<'...
<|file_name|>dailysearcher.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License
<|file_name|>parse.ts<|end_file_name|><|fim▁begin|>import { BecauseError } from "../../errors"; import { Response } from "../../response"; import { parse_response } from "../../parse"; import { JWT, LazyJWT } from "./jwt"; class TokenParseError extends BecauseError { } // https://github.com/boundlessgeo/bcs/blob/ma...
// /src/main/java/com/boundlessgeo/bcs/data/ApiKeyResponse.java
<|file_name|>nul_merger.rs<|end_file_name|><|fim▁begin|>use flowgger::config::Config; use super::Merger; <|fim▁hole|>impl NulMerger { pub fn new(_config: &Config) -> NulMerger { NulMerger } } impl Merger for NulMerger { fn frame(&self, bytes: &mut Vec<u8>) { bytes.push(0); } }<|fim▁end|...
#[derive(Clone)] pub struct NulMerger;
<|file_name|>expn_asy.py<|end_file_name|><|fim▁begin|>"""Precompute the polynomials for the asymptotic expansion of the generalized exponential integral. Sources ------- [1] NIST, Digital Library of Mathematical Functions, https://dlmf.nist.gov/8.20#ii """ import os try: import sympy<|fim▁hole|> def generat...
from sympy import Poly x = sympy.symbols('x') except ImportError: pass
<|file_name|>ode.py<|end_file_name|><|fim▁begin|>""" This module contains dsolve() and different helper functions that it uses. dsolve() solves ordinary differential equations. See the docstring on the various functions for their uses. Note that partial differential equations support is in pde.py. Note that ode_hint(...
C1 + C2*x + C3*x
<|file_name|>font.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use app_units::Au; use font::{FontHandleMethods, FontMetrics, Fo...
fn font_units_to_au(&self, value: f64) -> Au {
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! byt - views //! //! Byt operates by handling a set of Views that refer to either a file or some other kind of UI //! component. The term `View" is kind of disingenous as they are really more akin to both the //! "controller" and "view" in MVC parlance, but I didn't t...
pub mod file;
<|file_name|>220 Contains Duplicate III.py<|end_file_name|><|fim▁begin|>class Solution(object): def containsNearbyAlmostDuplicate(self, nums, k, t): """<|fim▁hole|> """ if k < 1 or t < 0: return False dic = {} t += 1 for i in range(len(nums)): i...
:type nums: List[int] :type k: int :type t: int :rtype: bool
<|file_name|>test_convert_notebooks.py<|end_file_name|><|fim▁begin|>""" @brief test log(time=0s) """ import os<|fim▁hole|>from pyquickhelper.filehelper import explore_folder_iterfile from pyquickhelper.ipythonhelper import upgrade_notebook, remove_execution_number class TestConvertNotebooks(unittest.TestCase): ...
import unittest from pyquickhelper.loghelper import fLOG
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate hyper; extern crate flate2; extern crate basmap; use std::env; use hyper::Client; use hyper::header::Connection; use std::io::stdout; use std::io::prelude::*; use flate2::read::GzDecoder; use basmap::basmap::Basmap; use basmap::options::OptionBuilder; ...
fn main() { let args: Vec<String> = env::args().collect(); let program = args[0].clone(); let options = OptionBuilder::new();
<|file_name|>errors.rs<|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 under the Apach...
}
<|file_name|>grains.py<|end_file_name|><|fim▁begin|><|fim▁hole|> def total_after(): pass<|fim▁end|>
def on_square(): pass
<|file_name|>gcmt_utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env/python ''' Set of moment tensor utility functions ''' import numpy as np from math import fabs, log10, sqrt, acos, atan2, pi def tensor_components_to_use(mrr, mtt, mpp, mrt, mrp, mtp): ''' Converts components to Up, South, East definition...
<|file_name|>email.py<|end_file_name|><|fim▁begin|>from threading import Thread from flask_mail import Message from flask import render_template, current_app from . import mail from .decorators import async @async def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(to, s...
return thr
<|file_name|>integer.js<|end_file_name|><|fim▁begin|>export default function(that) {<|fim▁hole|><|fim▁end|>
return !isNaN(that.curValue) && that.curValue%1===0; }
<|file_name|>RejectionActionTests.java<|end_file_name|><|fim▁begin|>/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apa...
responses.add(searchResponse); latch.countDown();
<|file_name|>server_test.go<|end_file_name|><|fim▁begin|>// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net import ( "io"; "os"; "strings"; "syscall"; "testing"; ) func runEcho(fd io.ReadWrite...
if kernelSupportsIPv6() {
<|file_name|>eventsource.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::cell::DomRefCell; use dom::bindings::c...
} self.parser_state = ParserState::Eol;
<|file_name|>Honeybee_Set EnergyPlus Zone Schedules.py<|end_file_name|><|fim▁begin|># # Honeybee: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari # # This file is part of Honeybee. # # Copyright (c) 2013-2015, Mostapha Sadeghipour Roudsari <Sadeghipour@gmail.com> # Honeybee is free...
if lightingSchedule != [] and lightingSchedule[0] != None: try: HBZone.lightingSchedule = lightingSchedule[zoneCount] except: HBZone.lightingSchedule = lightingSchedule[0]