prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>base.rs<|end_file_name|><|fim▁begin|>#[cfg(feature = "packed_simd")] use packed_simd; use crate::time::{Time, TimeDelta}; use byteorder::{ByteOrder, LittleEndian}; use serde; use std; use std::cmp::{Eq, PartialEq}; use std::collections::VecDeque; use std::error; use std::fmt; use std::io; use std::iter::E...
sample_rate: f64, buffer: &[u8],
<|file_name|>layer_norm.py<|end_file_name|><|fim▁begin|>import torch import torch.nn as nn class LayerNorm(nn.Module): def __init__(self, features, eps=1e-6):<|fim▁hole|> super().__init__() self.gamma = nn.Parameter(torch.ones(features)) self.beta = nn.Parameter(torch.zeros(features)) ...
<|file_name|>renderer.rs<|end_file_name|><|fim▁begin|>// This file is part of Mooneye GB. // Copyright (C) 2014-2020 Joonas Javanainen <joonas.javanainen@gmail.com> // // Mooneye GB is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Fre...
0..1, ); }
<|file_name|>com_amazonaws_services_ec2_model_Storage.go<|end_file_name|><|fim▁begin|>package ec2 import "github.com/timob/javabind" type ServicesEc2ModelStorageInterface interface { JavaLangObjectInterface // public void setS3(com.amazonaws.services.ec2.model.S3Storage) SetS3(a ServicesEc2ModelS3StorageInterface...
dst := &javabind.Callable{} retconv.Dest(dst) if err := retconv.Convert(javabind.ObjectRef(jret)); err != nil { panic(err)
<|file_name|>refresh_code_plugin.py<|end_file_name|><|fim▁begin|># proxy module<|fim▁hole|>from envisage.plugins.refresh_code.refresh_code_plugin import *<|fim▁end|>
from __future__ import absolute_import
<|file_name|>Solution.java<|end_file_name|><|fim▁begin|>public class Solution { public List<List<Integer>> generate(int numRows) { List<List<Integer>> result = new ArrayList<>(); ArrayList<Integer> tmp = new ArrayList<>(); for (int i = 0; i < numRows; i++) {<|fim▁hole|> result.add...
tmp.add(0, 1); for (int j = 1; j < tmp.size() - 1; j++) { tmp.set(j, tmp.get(j) + tmp.get(j + 1)); }
<|file_name|>generate_block.rs<|end_file_name|><|fim▁begin|>// Copyrighttape Technologies 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/LICENSE...
} pub struct BuildBlock {}
<|file_name|>unwind-box-unique.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. //<|fim▁hole|>// except according to those terms. // error-pattern:fail extern crate debug;...
// 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|>lessons10.js<|end_file_name|><|fim▁begin|>/** * Created by sasha on 18.11.13.<|fim▁hole|> */<|fim▁end|>
<|file_name|>tools.py<|end_file_name|><|fim▁begin|>## $Id: tools.py 23525 2011-05-12 04:11:40Z davea $ import configxml try: # use new hashlib if available from hashlib import md5 except: import md5 import os, shutil, binascii, filecmp # from http://www.plope.com/software/uuidgen/view _urandomfd = None de...
return checksum
<|file_name|>base.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ | This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) | This file contains the DAL support for many relational databases, inclu...
try: for (i, db) in instances:
<|file_name|>075_Sort_Colors.js<|end_file_name|><|fim▁begin|><|fim▁hole|> * @return {void} Do not return anything, modify nums in-place instead. */ var sortColors = function(nums) { nums.sort(); };<|fim▁end|>
/** * @param {number[]} nums
<|file_name|>DataTypePointInTime.java<|end_file_name|><|fim▁begin|>package org.hl7.v3; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>DataTypePointInTimeのJavaクラス。 * * <p>次のスキーマ・フラグメントは、このクラス内に含まれる予期されるコンテンツを指定します。 * <p> * <pre> * &lt;simpleType name="D...
* &lt;restriction base="{urn:hl7-org:v3}cs"> * &lt;enumeration value="TS"/> * &lt;/restriction> * &lt;/simpleType>
<|file_name|>10.4.3-1-19gs.js<|end_file_name|><|fim▁begin|>/// 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"). Any redis...
* @path ch10/10.4/10.4.3/10.4.3-1-19gs.js * @description Strict - checking 'this' from a global scope (indirect eval used within strict mode)
<|file_name|>feature_column_ops_test.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...
tf.contrib.layers.weighted_sum_from_feature_columns( features, [country, language, country_language], num_outputs=1, scope=scope))
<|file_name|>ReactTransitionGroup.js<|end_file_name|><|fim▁begin|>/** * Copyright 2013-2014 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/lic...
componentDidUpdate: function() {
<|file_name|>action_reposync.py<|end_file_name|><|fim▁begin|>""" Builds out and synchronizes yum repo mirrors. Initial support for rsync, perhaps reposync coming later. Copyright 2006-2007, Red Hat, Inc Michael DeHaan <mdehaan@redhat.com> This program is free software; you can redistribute it and/or modify it under t...
if repo.mirror_locally: rc = utils.subprocess_call(self.logger, cmd)
<|file_name|>test_manager.py<|end_file_name|><|fim▁begin|>import datetime import queue import multiprocessing import pytest from honcho.printer import Message from honcho.manager import Manager from honcho.manager import SYSTEM_PRINTER_NAME HISTORIES = { 'one': { 'processes': {'foo': {}}, 'messag...
<|file_name|>course2.rs<|end_file_name|><|fim▁begin|>extern crate cemu_smm; use cemu_smm::course2::*; use std::fs::{read, read_dir}; use std::io; use std::process::Command; fn decrypt_test_assets() -> io::Result<()> { let save_folders = vec![ "tests/assets/saves/smm2/save1", "tests/assets/saves/sm...
zip.write_all(course_121)?;
<|file_name|>regions-escape-bound-fn.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.ap...
<|file_name|>control.cc<|end_file_name|><|fim▁begin|>#include "control.h" Control::Control (int special_index) : _special_index (special_index) { } void Control::process_g (double delta_t) { } void Control::process_c (double delta_t) { for (size_t i = 0; i < _control_outs.size(); ++i) { _control_outs[i] = *(_...
} }
<|file_name|>MainActivity.java<|end_file_name|><|fim▁begin|>package com.mdg.droiders.samagra.shush; import android.Manifest; import android.app.NotificationManager; import android.content.ContentValues; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; i...
<|file_name|>lib-gode-rules.go<|end_file_name|><|fim▁begin|>// lib-gode-rules.go package gode_rules import ( "reflect" "bytes" "encoding/gob" "encoding/json" "fmt" "log" "strings" "github.com/robertkrimen/otto" ) type RuleEngine struct { Rules []Rule ActiveRules []Rule IgnoreFactChanges bool Otto *otto.Ot...
if b, err = call.Argument(0).ToBoolean(); err != nil { log.Fatal(err.Error())
<|file_name|>float.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
pub fn f32_eq(f1: f32, f2: f32, epsilon: f32) -> bool { let diff = (f1 - f2).abs(); diff < epsilon.abs() }
<|file_name|>auth.service.ts<|end_file_name|><|fim▁begin|>module op.common { 'use strict'; export interface IAuthService { register: (user: IUser) => ng.IPromise<string>; login: (email: string, password: string) => ng.IPromise<string>; logout: () => void; } class AuthService im...
.service('AuthService', AuthService);
<|file_name|>test_resources.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- #_____________________________________________________________________________ # # This file is part of txrecaptcha, a Twisted reCAPTCHA client. # # :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org> # Matthew F...
"""A web resource for protecting.""" def render_GET(self, request): """Handles requests for the mock resource.
<|file_name|>print_last_modif_date.js<|end_file_name|><|fim▁begin|>function print_last_modif_date(v) { document.write("Last updated " + v.substr(7, 19));<|fim▁hole|><|fim▁end|>
}
<|file_name|>factortools.py<|end_file_name|><|fim▁begin|>"""Polynomial factorization routines in characteristic zero. """ from __future__ import print_function, division from sympy.polys.galoistools import ( gf_from_int_poly, gf_to_int_poly, gf_lshift, gf_add_mul, gf_mul, gf_div, gf_rem, gf_gcdex, ...
T = dup_zz_diophantine(F, n - i, p, K)
<|file_name|>unio.py<|end_file_name|><|fim▁begin|>import io import os import sys import codecs import contextlib # We do not trust traditional unixes about having reliable file systems. # In that case we know better than what the env says and declare this to # be utf-8 always. has_likely_buggy_unicode_filesystem = \ ...
sys.stdout = stream if and_stderr: sys.stderr = stream
<|file_name|>git.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ =...
type: bool
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from os import path from .taskqueue import TaskQueueClient __all__ = ['TaskQueueClient'] <|fim▁hole|>with open(path.join(path.dirname(__file__), 'version.txt')) as fp: __version__ = fp.read().strip()<|fim▁end|>
<|file_name|>repack_database.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Repacking Instaseis databases. Requires click, h5py, and numpy. :copyright: Lion Krischer (krischer@geophysik.uni-muenchen.de), 2016 Simon Stähler (staehler@geophysik.uni-muenchen.de), 2016 :license...
f_in_1.close()
<|file_name|>forocoches.py<|end_file_name|><|fim▁begin|>################################################################################ # # Copyright 2015-2020 Félix Brezo and Yaiza Rubio # # This program is part of OSRFramework. You can redistribute it and/or modify # it under the terms of the GNU Affero Gen...
<|file_name|>ospf.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013 Cisco Systems Inc. # All rights reserved import ipaddress import re from .feature import Feature from .vrf import VRF from .cisco_secret import CiscoSecret from .nxcli import * import nxos_utils class OSPFSession(Feature): ''' Use this cl...
def cfg_maximum_paths(self, max, **kwargs):
<|file_name|>dhcpclientscapy.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # vim:ts=4:sw=4:expandtab 2 # -*- coding: utf-8 -*- ''' Based on https://github.com/mortnerDHCPv4v6 ''' # TODO: # * refactor # * read conf from dhclient.conf # * daemonize # * requests in loop # * send renew according to renew time ...
<|file_name|>viewpop.js<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2015 by Rafael Angel Aznar Aparici (rafaaznar at gmail dot com) * * sisane: The stunning micro-library that helps you to develop easily * AJAX web applications by using Angular.js 1.x & sisane-server * sisane is distributed unde...
$uibModalInstance.dismiss('cancel');
<|file_name|>test16.py<|end_file_name|><|fim▁begin|>from shutit_module import ShutItModule <|fim▁hole|> def build(self, shutit): shutit.login() shutit.login(command='bash') shutit.send('ls',note='We are listing files') shutit.logout() shutit.logout() return True def module(): return test16( 'shutit.test...
class test16(ShutItModule):
<|file_name|>editorFunctions.js<|end_file_name|><|fim▁begin|><|fim▁hole|>function editorOn(divid){ $('#'+divid).parent().parent().find(' >*:last-child img').css('visibility','hidden'); borderstyle = $('#'+divid).parent().parent().css('border'); $('#'+divid).parent().parent().css('border','') } function editorOff(divi...
// JScript File var borderstyle
<|file_name|>MainActivity.java<|end_file_name|><|fim▁begin|>package com.twopillar.jiba.activity; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.v4.app.FragmentTabHost; import android.view.KeyEvent; import android.view.View; import android.widg...
<|file_name|>containerpush.ts<|end_file_name|><|fim▁begin|>"use strict"; import * as fs from "fs"; import * as tl from "vsts-task-lib/task"; import ContainerConnection from "docker-common/containerconnection"; import * as sourceUtils from "docker-common/sourceutils"; import * as imageUtils from "docker-common/containe...
}
<|file_name|>DefaultNewDatasourceConnectorViewImpl.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * Copyright (c) 2012-2017 Codenvy, S.A. * All rights reserved. This program and the accompanying materials * are made available under the terms of the ...
<|file_name|>ecooputil.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python ############################################################################### # # # Project: ECOOP, sponsored by The National Science Foundation # Purpose: this code is part of the Cyberinfrastructure developed for the ECOOP project # ...
print 'session data directory : ID', ID return ID def ensure_dir(self, dir):
<|file_name|>playit.py<|end_file_name|><|fim▁begin|>import subprocess from pkg_resources import resource_filename <|fim▁hole|> """ filepath = resource_filename(__name__, 'sound/' + file) subprocess.Popen(["paplay", filepath])<|fim▁end|>
def playit(file): """ Function used to play a sound file
<|file_name|>0013_formpage_button_name.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-25 15:50 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pages', '0012_auto_201...
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>use std::path::PathBuf; use std::{env, fs}; fn main() { let current_dir = PathBuf::from(&env::current_dir().unwrap()); let out_dir = PathBuf::from(&env::var_os("OUT_DIR").unwrap()); //println!("cargo:rustc-flags=-L {:?} -l mosquitto", out_dir.display());<...
//println!("cargo:rustc-link-search=native={}", out_dir.display()); }
<|file_name|>Trait.js<|end_file_name|><|fim▁begin|>/** * Trait class <|fim▁hole|> this.traits = [methods]; var extraTraits = methods.$traits; if (extraTraits) { if (typeof extraTraits === "string") { extraTraits = extraTraits.replace(/ /g, '').split(','); } for (va...
*/ function Trait(methods, allTraits) { allTraits = allTraits || [];
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com> # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file import os import email import tempfile import re from email.header import Header imp...
parms = tuple(map('='.join, part.get_params()))
<|file_name|>ipc.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 crate::time; use crate::time::ProfilerCategory; use crate::ti...
pub fn recv(&self) -> Result<T, bincode::Error> { time::profile( ProfilerCategory::IpcReceiver, None,
<|file_name|>001_initial_db.py<|end_file_name|><|fim▁begin|>def migrate_up(manager): raise Exception('migrate.py should be migrating directly to schema 51 ' 'instead of running migration 1...')<|fim▁hole|> def migrate_down(manager): manager.execute_script(DROP_DB_SQL) DROP_DB_SQL = """\ DR...
<|file_name|>user_team_mgmt.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # This example shows the different aspects of user/team management. # import sys from sdcclient import SdcClient # # Parse arguments # if len(sys.argv) != 4: print(('usage: %s <sysdig-token> team-name user-name' % sys.argv[0])) ...
<|file_name|>test_uniform.py<|end_file_name|><|fim▁begin|>import unittest from chainer import cuda from chainer import initializers from chainer import testing from chainer.testing import attr import numpy @testing.parameterize(*testing.product({ 'target': [ initializers.Uniform, initializers.LeC...
@attr.gpu
<|file_name|>regress-122076.js<|end_file_name|><|fim▁begin|>/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* 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://...
sEval += ' return true;' sEval += '}'
<|file_name|>model.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>"""Test config for channels""" import pytest<|fim▁hole|> @pytest.fixture(autouse=True) def mock_search_tasks(mocker): """Patch the helpers so they don't fire celery tasks""" return mocker.patch("channels.api.search_task_helpers")<|fim▁end|>
<|file_name|>RoleService.java<|end_file_name|><|fim▁begin|>package pe.com.ccpl.siconc.web.service; <|fim▁hole|> public Role getRole(int id); }<|fim▁end|>
import pe.com.ccpl.siconc.web.model.Role; public interface RoleService {
<|file_name|>fai.go<|end_file_name|><|fim▁begin|>// Copyright ©2013 The bíogo 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 fai implements FAI fasta sequence file index handling. package fai import ( "bufio" "bytes" ...
<|file_name|>korw.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode}; use ::RegType::*; use ::instruction_def::*; use ::Operand::*; use ::Reg::*; use ::RegScale::*; fn korw_1() { run_test(&Instruction { mnemonic: Mnemonic::KORW, operand1...
run_test(&Instruction { mnemonic: Mnemonic::KORW, operand1: Some(Direct(K7)), operand2: Some(Direct(K3)), operand3: Some(Direct(K2)), operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 228, 69, 250], OperandSize::Qword) }
<|file_name|>PathState.cpp<|end_file_name|><|fim▁begin|>/* Copyright 2015 ETH Zurich * * 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 * ...
int target = mOrigin + C * x * x * x; if (target > mCongestionWindow) mCount = mCongestionWindow / (target - mCongestionWindow); else
<|file_name|>simple_request.py<|end_file_name|><|fim▁begin|>__author__ = 'thorwhalen' import requests from serialize.khan_logger import KhanLogger import logging class SimpleRequest(object): def __init__(self, log_file_name=None, log_level=logging.INFO): full_log_path_and_name = KhanLogger.default_log_p...
<|file_name|>test.py<|end_file_name|><|fim▁begin|>__author__ = 'swhite' """ This package contains the test modules for the repository app of the ReFlow project, organized by test type (unit, integration, etc.) To run all the tests in the repository app, using the manage.py command: "python manage.py test repository"....
"""
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2015 Holger Nahrstaedt # See COPYING for license details. """ wavelet toolbox """ from __future__ import division, print_function, absolute_import from .dwt import * from .utility import * from ._pyyawt import * from .dw...
from numpy.testing import Tester
<|file_name|>IEditor.cpp<|end_file_name|><|fim▁begin|>#include <XEEditor/IEditor.hpp> //#include <EditorI/SelectionRectangle.h> //#include "E:/Projekte/Src Game/_Engine/XEngine/TestXE/XETUI/GUI.h" //#include <EditorI/TFViewport.h> #include <XEEditor/Editor.hpp> namespace EI { EI::Editor* gEditor = nullptr; /...
// Ogre::SceneNode* pSceneNode;
<|file_name|>command_line.py<|end_file_name|><|fim▁begin|>import argparse import docker import logging import os import docket logger = logging.getLogger('docket') logging.basicConfig() parser = argparse.ArgumentParser(description='') parser.add_argument('-t --tag', dest='tag', help='tag for final image') parser.add_...
logger.setLevel(logging.DEBUG)
<|file_name|>insn_assert_lt.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # AWL simulator - instructions # # Copyright 2012-2014 Michael Buesch <m@bues.ch> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Fr...
s.NER = 0
<|file_name|>facetrack.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Released under the BSD license. See LICENSE file for details. """ This program basically does face detection an blurs the face out. """ print __doc__ from SimpleCV import Camera, Display, HaarCascade # Initialize the camera cam = Camera() # Create ...
#!/usr/bin/env python #
<|file_name|>production.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ''' Production Configurations - Use djangosecure - Use Amazon's S3 for storing static files and uploaded media - Use sendgrid to send emails - Use MEMCACHIER on Heroku ''' from configurations import values # See: http://django-storages.re...
ALLOWED_HOSTS = ["*"] # END SITE CONFIGURATION INSTALLED_APPS += ("gunicorn", )
<|file_name|>abc.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ''' :author: Patrick Lauer This class holds the Artificial Bee Colony(ABC) algorithm, based on Karaboga (2007): D. Karaboga, AN IDEA BASED ON HONEY BEE SWARM FOR NUMERICAL OPTIMIZATION,TECHNICAL REPORT-TR06, Erciyes University, Engineering Facu...
c=0 p=0
<|file_name|>test_config_scope.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding=utf-8 import pytest import sacred.optional as opt from sacred.config.config_scope import ( ConfigScope, dedent_function_body, dedent_line, get_function_body, is_empty_or_comment, ) from sacred.config.cust...
answer = 42
<|file_name|>test_stacking.py<|end_file_name|><|fim▁begin|>"""Test the stacking classifier and regressor.""" # Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com> # License: BSD 3 clause import pytest import numpy as np import scipy.sparse as sparse from sklearn.base import BaseEstimator from sklearn.base import Cl...
<|file_name|>restoration_status.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation,...
}
<|file_name|>wordcount.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from __future__ import print_function from collections import Counter from operator import itemgetter import os _path = os.path.abspath(os.path.dirname(__file__)) SOURCE = os.path.join(_path, 'poems_for_wordcount.txt') DESTINATION = os.pat...
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url<|fim▁hole|>app_name = "producto" urlpatterns = [ url(r'list-productos/$', list_products, name='list_products'), ]<|fim▁end|>
from .views import list_products
<|file_name|>sidebar.js<|end_file_name|><|fim▁begin|>'use strict' const React = require('react'); import {Sidebar} from 'react-semantify'; <|fim▁hole|> <a className="item"> Our company </a> <a className="item"> Dashboard </a> <a className="item"> My r...
const UISidebar = React.createClass({ render : function() { return ( <Sidebar className="ui top sidebar menu push scale down" init={true}>
<|file_name|>integration.test.ts<|end_file_name|><|fim▁begin|>// tslint:disable:deprecation import { Integration } from '@sentry/types'; import { getIntegrationsToSetup } from '../../src/integration'; /** JSDoc */ class MockIntegration implements Integration { public constructor(name: string) { this.name = name...
const firstDefault = new MockIntegration('foo'); (firstDefault as any).order = 'firstDefault'; const secondDefault = new MockIntegration('bar'); (secondDefault as any).order = 'secondDefault';
<|file_name|>common.js<|end_file_name|><|fim▁begin|>$.fn.onEnterKey = function( closure ) {<|fim▁hole|> if (code == 13) { closure(); return false; } } ); } String.prototype.trunc = String.prototype.trunc || function(n){ ...
$(this).keypress( function( event ) { var code = event.keyCode ? event.keyCode : event.which;
<|file_name|>util.ts<|end_file_name|><|fim▁begin|>import * as $ from 'jquery'; import { Timestamp } from 'index'; export const endlessWaiting = new Promise<void>(() => {}); export function waitDOMContentLoaded(): Promise<void> { return new Promise(resolve => { switch (document.readyState) { case '...
for (const child of Array.from(ele.querySelectorAll('*[style]'))) { child.removeAttribute('style'); }
<|file_name|>OidcSettings.ts<|end_file_name|><|fim▁begin|>import {Type} from "@tsed/core"; import {JwksKeyParameters} from "@tsed/jwks"; import {Configuration} from "oidc-provider"; import {OidcAccountsMethods} from "./OidcAccountsMethods"; export interface OidcSettings extends Configuration { /** * Path on which...
<|file_name|>FATSuite.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * Copyright (c) 2017, 2020 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public...
import com.ibm.ws.transaction.test.tests.EJBNewTxDBTest; import com.ibm.ws.transaction.test.tests.EJBNewTxRoSTest; import com.ibm.ws.transaction.test.tests.EJBNewTxTest;
<|file_name|>raft.go<|end_file_name|><|fim▁begin|>package raft import ( "github.com/iketheadore/raft/comm" "github.com/iketheadore/raft/logic" ) type Raft struct { localServ logic.Server listener comm.Listener sender comm.Sender logic *logic.Logic } func New(addr string) *Raft { r := &Raft{localServ: ...
<|file_name|>UserService.java<|end_file_name|><|fim▁begin|>package com.lynx.service; import java.util.Collection; import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import com.lynx.domai...
return userRepository.save(user); }
<|file_name|>demo_mp_async.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import freenect import signal import matplotlib.pyplot as mp from misc.demo import frame_convert mp.ion() image_rgb = None image_depth = None keep_running = True def display_depth(dev, data, timestamp): global image_depth dat...
def body(*args):
<|file_name|>eventlet_backdoor.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 OpenStack Foundation. # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complianc...
start, end = port_range, port_range else: start, end = port_range.split(':', 1)
<|file_name|>test_compositor_host_ozone.cc<|end_file_name|><|fim▁begin|>// Copyright 2013 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 "ui/compositor/test/test_compositor_host.h" #include "base/basictypes.h"...
ui::ContextFactory* context_factory_;
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin from django.contrib.auth.models import Group as AuthGroup from sigma_core.models.user import User from sigma_core.models.group import Group from sigma_core.models.group_member import GroupMember from sigma_core.models.group_field impor...
extra = 0
<|file_name|>DecafError.java<|end_file_name|><|fim▁begin|>package stage2; public class DecafError { int numErrors; DecafError(){ } public static String errorPos(Position p){ return "(L: " + p.startLine + ", Col: " + p.startCol + ") -- (L: " + p.endLine + ", Col: " + p.endCol + ...
<|file_name|>redirect.rs<|end_file_name|><|fim▁begin|>use response::{Response, Responder}; use http::hyper::header; use http::Status; /// An empty redirect response to a given URL. /// /// This type simplifies returning a redirect response to the client. #[derive(Debug)] pub struct Redirect(Status, String); impl Redi...
/// let redirect = Redirect::to("/other_url"); /// ``` pub fn to(uri: &str) -> Redirect { Redirect(Status::SeeOther, String::from(uri))
<|file_name|>parse_ctf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # # Copyright (c) 2020 Intel Corporation. # # SPDX-License-Identifier: Apache-2.0 """ Script to parse CTF data and print to the screen in a custom and colorful format. Generate trace using samples/subsys/tracing for example: west build ...
return {} for msg in msg_it:
<|file_name|>epw2wea.py<|end_file_name|><|fim▁begin|># coding=utf-8 from ._commandbase import RadianceCommand from ..datatype import RadiancePath import os class Epw2wea(RadianceCommand): """epw2wea transforms an EnergyPlus weather data (.epw) file into the DAYSIM weather file format, for use with the RADIAN...
return rad_string @property
<|file_name|>api_test.go<|end_file_name|><|fim▁begin|>// Copyright 2013 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package juju_test import ( "context" "crypto/tls" "fmt" "net" "time" "github.com/juju/errors" "github.com/juju/names/v4" "github.com/juju/testing" jc "github.com...
<|file_name|>GradeofDifferentation.java<|end_file_name|><|fim▁begin|>//############################################################################# //# # //# Copyright (C) <2015> <IMS MAXIMS> # //# ...
<|file_name|>authoring.spec.ts<|end_file_name|><|fim▁begin|>describe('authoring', () => { var GUID = 'urn:tag:superdesk-1'; var USER = 'user:1'; var ITEM: any = {guid: GUID}; beforeEach(window.module(($provide) => { $provide.constant('lodash', _); })); beforeEach(window.module('angular...
<|file_name|>monitors_test.py<|end_file_name|><|fim▁begin|># Copyright 2016 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/licens...
def monitor_func(test): del test # Unused.
<|file_name|>PlaceholderImage.js<|end_file_name|><|fim▁begin|>import cx from 'clsx' import PropTypes from 'prop-types' import React from 'react' import { customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib' /** * A placeholder can contain an image. */ function PlaceholderImage(props) { ...
} export default PlaceholderImage
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|>import re from django.core.urlresolvers import reverse def test_view_with_scss_file(client, precompiled): """ Test view that renders *SCSS file* that *imports SCSS file from another Django app*. :param client: ``pytest-django`` fixture: Django test...
'var _class = function _class(customVersion) {\n' ' _classCallCheck(this, _class);\n' '\n' ' console.log(\'Framework v\' + (customVersion || version) + \' initialized\');\n'
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Hello World API implemented using Google Cloud Endpoints. Defined here are the ProtoRPC messages needed to define Schemas for methods as well as those methods defined in an API. """ import endpoints from protorpc import messages, message_types, remote # TODO r...
hotness=2), Note(#dsid='rkbn31ha',
<|file_name|>server.js<|end_file_name|><|fim▁begin|>angular.module('qmsk.e2.server', [ 'qmsk.e2', 'qmsk.e2.console', 'qmsk.e2.web', 'ngResource', 'ngRoute', 'jsonFormatter', 'ui.bootstrap', ]) .config(function($routeProvider) { $routeProvider .when('/...
Preset.activate({id: preset.id, live: true}, function success(r) { $scope.programPreset = preset; },
<|file_name|>all.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # ...
# distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
<|file_name|>task.model.js<|end_file_name|><|fim▁begin|>'use strict'; var mongoose = require('mongoose'); var Schema = mongoose.Schema; var TaskSchema = new Schema({ name: String, description: String, point: Number, task_users: [{ type: Schema.Types.ObjectId, ref: "TaskUser"}],<|fim▁hole|>}); module.exports ...
_week: { type: Schema.Types.ObjectId, ref: "Week"}
<|file_name|>tutorial_quanconv_cifar10.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # -*- coding: utf-8 -*- """ - 1. This model has 1,068,298 paramters and quantization compression strategy(weight:8 bits, active: 8 bits here, you can change the setting), after 705 epoches' training with GPU, test accurcy of 84.0...
<|file_name|>grpc.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2022 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/LI...