prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>0006_bookmark_collections.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-09-15 17:18
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bookmarks', '0005_aut... | ] |
<|file_name|>test_reactivate_account.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from django.core.urlresolvers import reverse<|fim▁hole|>
from sentry.testutils import TestCase
class ReactivateAccountTest(TestCase):
@fixture
def path(self):
return reverse('sentry-reactivate-... | from exam import fixture |
<|file_name|>clientset_generated.go<|end_file_name|><|fim▁begin|>package fake
import (
clientset "github.com/openshift/client-go/oauth/clientset/versioned"
oauthv1 "github.com/openshift/client-go/oauth/clientset/versioned/typed/oauth/v1"
fakeoauthv1 "github.com/openshift/client-go/oauth/clientset/versioned/typed/oa... | |
<|file_name|>editer.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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 ... |
"""Paramètre 'éditer de la commande 'auberge'"""
|
<|file_name|>issue-50461-used-mut-from-moves.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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:... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms. |
<|file_name|>Demo01_JS.js<|end_file_name|><|fim▁begin|>// GUI Animator for Unity UI version: 0.9.93 (Product page: http://ge-team.com/pages/unity-3d/gui-animator-for-unity-ui/)
//
// Author: Gold Experience Team (http://www.ge-team.com/pages/)
// Products: http://ge-team.com/pages/unity-3d/
// Support: geteamdev@g... | |
<|file_name|>files.js<|end_file_name|><|fim▁begin|>window.utils = window.utils || {};
window.utils.files = (function() {
function getSize(size) {
var quantity, unit;
if (size < Math.pow(1024, 2)) {
quantity = size / 1024;
unit = "KB";
} else if (size < Math.pow(1024, 3)) {
quantity = size / Math.po... | }, function () {
if (onerror) onerror(); |
<|file_name|>Ataca_a_los_orcos_V0.0.5.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import random
import textwrap
def print_bold(msg):
#Funcion para mostrar por pantalla un string en negrita
print("\033[1m"+msg+"\033[0m")
def print_linea_punteada(width=72):
print('-'*width)
def ocupar_chozas()... | while len(chozas) < 5: #Definimos un número de asentamiento para establecerlo como amigo o enemigo
eleccion_aleatoria = random.choice(ocupantes) |
<|file_name|>gogapi.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import http.cookiejar
import json
import re
import requests
import urllib.parse
import http.server
import webbrowser
from datetime import datetime, timezone, timedelta
import os.path
from pprint import pprint
PARSE_JSON = True
# Taken from Gw... | return self.get_json(galaxy_url("gwent.decks", user_id))
|
<|file_name|>notify.rs<|end_file_name|><|fim▁begin|>use mio::Token;
use mio::deprecated::Sender;
use handler::{Notify};
quick_error! {
/// Error when waking up a connection
///
/// In most cases it's okay to panic on this error
#[derive(Debug)]
pub enum WakeupError {
/// I/O error when sen... | |
<|file_name|>analysis.py<|end_file_name|><|fim▁begin|># python3
# pylint: disable=g-bad-file-header
# Copyright 2019 DeepMind Technologies Limited. 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... | df = dc_preprocess(df_in=df) |
<|file_name|>method-on-struct.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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.apac... |
fn main() { |
<|file_name|>querystring_builder.py<|end_file_name|><|fim▁begin|>import logging
from office365.sharepoint.helpers.utils import to_camel
logger = logging.getLogger(__name__)
class QueryStringBuilder:
"""class to map web-querystring dictionary to sharepoint-querystring"""
date_operators = ['ge', 'gt', 'le', '... | values = filter_value.split(',') |
<|file_name|>LanGameInfo.cpp<|end_file_name|><|fim▁begin|>//
// This file is part of Return To The Roots.
//
// Return To The Roots is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the Lic... | serializer.PushBool(isIPv6);
serializer.PushString(version); |
<|file_name|>FrequencyFilter.java<|end_file_name|><|fim▁begin|>// Catalano Imaging Library
// The Catalano Framework
//
// Copyright © Diego Catalano, 2015
// diego.catalano at live.com
//
// Copyright © Andrew Kirillov, 2007-2008
// andrew.kirillov@gmail.com
//
// This library is free software; you can red... | // Lesser General Public License for more details.
|
<|file_name|>tokens.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
def NUMBER(value):
return ("NUMBER", value)
def NAME(value):
return ("NAME", value)
def SYMBOL(value):
return ("SYMBOL", value)
def SEMICOLON():
return ("SEMICOLON", )
<|fim▁hole|>def OPENPAREN():
return ("OPENPAREN", ... | |
<|file_name|>html5shiv.js<|end_file_name|><|fim▁begin|>/*
* =============================================================
* elaostrap
*
* (c) 2015 Jeremy FAGIS <jeremy@fagis.fr>
* =============================================================
*/
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof ... | |
<|file_name|>recovery.go<|end_file_name|><|fim▁begin|>// Copyright 2013 Martini Authors
// Copyright 2014 The Macaron 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
//
// htt... | resp["message"] = "Internal Server Error - Check the Grafana server logs for the detailed error message." |
<|file_name|>0011_photo_image_file.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('latest_tweets', '0010_photo_unique'),
]
operations = [
mi... | ), |
<|file_name|>guest.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>
}
}<|fim▁end|> | export class Guest {
constructor(public name: String, public quantity: number){ |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup
from src import __version__
setup(
name="irma.common",
version=__version__,
author="Quarkslab",
author_email="irma@quarkslab.com",
description="The common component of the IRMA software",
packages=["irma.common"... | "irma.common.plugins": "src/plugins"}, |
<|file_name|>optimization-fuel-1.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.apache... | // compile-flags: --error-format human -Z fuel=foo=1 |
<|file_name|>events.rs<|end_file_name|><|fim▁begin|>#[derive(Clone, Debug, Copy)]
pub enum Event {
/// The size of the window has changed.
Resized(u32, u32),
/// The position of the window has changed.
Moved(i32, i32),
/// The window has been closed.
Closed,
/// The window received a unic... | /// The window needs to be redrawn.
Refresh,
} |
<|file_name|>test_simple.py<|end_file_name|><|fim▁begin|>import unittest
import pystache
from pystache import Renderer
from examples.nested_context import NestedContext
from examples.complex import Complex
from examples.lambdas import Lambdas
from examples.template_partial import TemplatePartial
from examples.simple i... | |
<|file_name|>cli.py<|end_file_name|><|fim▁begin|>from cfme.utils.version import get_stream
from collections import namedtuple
from contextlib import contextmanager
from cfme.test_framework.sprout.client import SproutClient
from cfme.utils.conf import cfme_data, credentials
from cfme.utils.log import logger
import pytes... | logger.error("Couldn't provision an appliance at all")
raise SproutException('No provision available')
yield apps[0]
|
<|file_name|>test_ioctl.py<|end_file_name|><|fim▁begin|>import array
import unittest
from test.test_support import run_unittest, import_module, get_attribute
import os, struct
fcntl = import_module('fcntl')
termios = import_module('termios')
get_attribute(termios, 'TIOCGPGRP') #Can't run tests without this feature
try... | fill = -12345
if nbytes is not None:
# Extend the buffer so that it is exactly `nbytes` bytes long
buf.extend([fill] * (nbytes // intsize)) |
<|file_name|>duplicate_entry_error.rs<|end_file_name|><|fim▁begin|>// normalize-stderr-test "loaded from .*libstd-.*.rlib" -> "loaded from SYSROOT/libstd-*.rlib"
// note-pattern: first defined in crate `std`.
// Test for issue #31788 and E0152
#![feature(lang_items)]
use std::panic::PanicInfo;
#[lang = "panic_impl"... | loop {}
}
fn main() {} |
<|file_name|>draw_element.cc<|end_file_name|><|fim▁begin|>/*
* Copyright 2009, Google 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... | |
<|file_name|>ResponseRow.d.ts<|end_file_name|><|fim▁begin|>import EntityRow from "./EntityRow";
import { PromiseExprEvaluatorRow, Schema, Row } from "mwater-expressions";
import { ResponseData } from "./response";
import { FormDesign } from "./formDesign";
import { CustomRow } from "./CustomRow";
export default class R... | getEntityByCode: (entityType: string, entityCode: string, callback: (entity: any) => void) => void;
/** Get a specific row of a custom table */
getCustomTableRow: (tableId: string, rowId: string) => Promise<Row | null>;
/** Deployment _id of the response */ |
<|file_name|>Pilot.py<|end_file_name|><|fim▁begin|>__RCSID__ = "$Id$"
from DIRAC.AccountingSystem.Client.Types.BaseAccountingType import BaseAccountingType
class Pilot(BaseAccountingType):<|fim▁hole|> BaseAccountingType.__init__(self)
self.definitionKeyFields = [('User', 'VARCHAR(64)'),
... |
def __init__(self): |
<|file_name|>stability-attribute-sanity.rs<|end_file_name|><|fim▁begin|>// Various checks that stability attributes are used correctly, per RFC 507
#![feature(staged_api)]
#![stable(feature = "rust1", since = "1.0.0")]
mod bogus_attribute_types_1 {
#[stable(feature = "a", since = "b", reason)] //~ ERROR unknown ... | fn f1() { } |
<|file_name|>read_input.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding=utf-8
"""
A simple example demonstrating the various ways to call cmd2.Cmd.read_input() for input history and tab completion
"""
from typing import (
List,
)
import cmd2
EXAMPLE_COMMANDS = "Example Commands"
class ReadInputAp... | |
<|file_name|>Facade.java<|end_file_name|><|fim▁begin|>package com.designpattern.structural.facade;
public class Facade {
SystemOne system1 = new SystemOne();
SystemTwo system2 = new SystemTwo();
SystemThree system3 = new SystemThree();
SystemFour system4 = new SystemFour();
public void facadeFunction1()... | System.out.println("---- facade function 1");
system1.methodOne();
system3.methodThree();
|
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>use std::rand;
use std::rand::Rng;
use settings::Settings;
use piece::Piece;
pub fn check_overlap(settings: &Settings, pos: u32, content_len: u32, files: &Vec<Piece>) -> bool {
for i in files.iter() {
if pos + 1 > i.start_pos && pos - 1 < i.en... | pub fn concat_vec<T>(a: Vec<T>, b: Vec<T>) -> Vec<T> {
let mut r = a; |
<|file_name|>HelloWorld.py<|end_file_name|><|fim▁begin|>"""Example macro."""
revision = "$Rev$"
url = "$URL$"
#
# The following shows the code for macro, old-style.
#
# The `execute` function serves no purpose other than to illustrate
# the example, it will not be used anymore.
#
# ---- (ignore in your own macro) ---... |
# Note that there's no need to HTML escape the returned data,
# as the template engine (Genshi) will do it for us. |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># Copyright (C) 2014 Universidad Politecnica de Madrid
#
# 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... | |
<|file_name|>imdb.py<|end_file_name|><|fim▁begin|>"""
General image database
An image database creates a list of relative image path called image_set_index and
transform index to absolute image path. As to training, it is necessary that ground
truth and proposals are mixed together for training.
roidb
basic format [ima... | roi_rec['image'] = gt_roidb[i]['image']
roi_rec['height'] = gt_roidb[i]['height']
roi_rec['width'] = gt_roidb[i]['width']
|
<|file_name|>train.py<|end_file_name|><|fim▁begin|>import os
import json
import tensorflow as tf
import numpy as np
def load_data(taxonomy):
data_list= list(filter(lambda x:x[-3:]=='npy', os.listdir(taxonomy)))
result=[]
for data_file in data_list:
result.append(np.load('%s/%s' %(taxonomy, data_file)))
if len(r... | train_step = tf.train.GradientDescentOptimizer(0.5).minimize(cross_entropy)
sess= tf.InteractiveSession()
|
<|file_name|>test_prompt.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
import sys
from contextlib import contextmanager
from StringIO import StringIO
import mock
from nose.tools import raises
from . import prompt as _
class TestValueToStr():
def test_none(s... | _.Suggestion(None, 1)
@raises(ValueError) |
<|file_name|>config-test.js<|end_file_name|><|fim▁begin|>var expect = require('chai').expect;
var assert = require('chai').assert;
var sinon = require('sinon');
var Config = require('../lib/config');
describe('config', function() {
describe('#constructor', function() {
it('creates a new object with the config... | expect(config.source).to.equal('.');
expect(config.destination).to.equal('_site'); |
<|file_name|>0003_auto__add_field_user_is_admin.py<|end_file_name|><|fim▁begin|># -*- coding: 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 field 'User.is_admin'
... | |
<|file_name|>rational_impl.rs<|end_file_name|><|fim▁begin|>//! # Licensing
//! This Source Code is subject to the terms of the Mozilla Public License
//! version 2.0 (the "License"). You can obtain a copy of the License at
//! [http://mozilla.org/MPL/2.0/](http://mozilla.org/MPL/2.0/).
use num_rational::Ratio;
use num... | let diff = if *self > *other {
self.clone() - other.clone() |
<|file_name|>react-event-listener-tests.tsx<|end_file_name|><|fim▁begin|>import React = require("react");
import EventListener, { withOptions } from "react-event-listener";
<EventListener target={document} onBeforeUnload={ev => { }} />;<|fim▁hole|><EventListener target={document} onSelectionChange={ev => { }} />;
<Eve... | <EventListener target={window} onResize={withOptions((ev: UIEvent) => { }, { passive: true, capture: true })} />;
<EventListener target="window" onResize={() => { }}/>; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![crate_name = "bindgen"]
#![crate_type = "dylib"]
#![cfg_attr(feature = "clippy", feature(plugin))]
#![cfg_attr(feature = "clippy", plugin(clippy))]
extern crate clang_sys;
extern crate syntex_syntax as syntax;
extern crate libc;
#[macro_use] extern crate log;
use s... | |
<|file_name|>simple_command.py<|end_file_name|><|fim▁begin|>from console.main.command_handler.commands.command import Command
class SimpleCommand(Command):<|fim▁hole|><|fim▁end|> | pass |
<|file_name|>memo.ts<|end_file_name|><|fim▁begin|>// tslint:disable:no-unsafe-any
/**
* Memo class used for decycle json objects. Uses WeakSet if available otherwise array.
*/
export class Memo {
/** Determines if WeakSet is available */
private readonly _hasWeakSet: boolean;
/** Either WeakSet or Array */
pr... | /**
* Sets obj to remember.
* @param obj Object to remember |
<|file_name|>vendoropts_test.go<|end_file_name|><|fim▁begin|>package dhcp6opts
import (
"bytes"
"io"
"reflect"
"testing"
"github.com/mdlayher/dhcp6"
)
// TestVendorOptsMarshalBinary verifies that VendorOpts marshals properly for the input values.
func TestVendorOptsMarshalBinary(t *testing.T) {
var tests = []s... | 0, 1, 0, 0xa,
},
err: dhcp6.ErrInvalidPacket,
}, |
<|file_name|>interfaces.go<|end_file_name|><|fim▁begin|>package dnsapi
// 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 incorre... |
var _ RecordSetsClientAPI = (*dns.RecordSetsClient)(nil)
// ZonesClientAPI contains the set of methods on the ZonesClient type. |
<|file_name|>loop_var01.py<|end_file_name|><|fim▁begin|>#Using the variable 'i' is restricted by polyphony's name scope rule
from polyphony import testbench
def loop_var01():
for i in range(10):
pass
return i
<|fim▁hole|>def test():
loop_var01()
test()<|fim▁end|> | @testbench |
<|file_name|>scrollspy.js<|end_file_name|><|fim▁begin|>function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnP... | // Public |
<|file_name|>NodeConnection.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software ... | return deferred.promise();
}; |
<|file_name|>grove_electricity_sensor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# GrovePi Example for using the Grove Electricity Sensor (http://www.seeedstudio.com/wiki/Grove_-_Electricity_Sensor)
#
# The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http:/... | sensor_value = grovepi.analogRead(sensor)
# Calculate amplitude current (mA) |
<|file_name|>Capture.py<|end_file_name|><|fim▁begin|>"""This modules is used to capture the screen
"""
import pyautogui
import time
import Globals
PATH = './Captures/'
def capture_area(area):
"""
Captures area of the screen<|fim▁hole|> Args:
area (Tuple (x,y,width,height)): Area to capture
R... | |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># Copyright (c) 2011 OpenStack Foundation
#
# 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/license... | |
<|file_name|>files_4.js<|end_file_name|><|fim▁begin|>var searchData=
[
['ebert_5fgraph_2eh_0',['ebert_graph.h',['../ebert__graph_8h.html',1,'']]],
['element_2ecc_1',['element.cc',['../element_8cc.html',1,'']]],
['encoding_2ecc_2',['encoding.cc',['../encoding_8cc.html',1,'']]],
['encoding_2eh_3',['encoding.h',['... | ['environment_2ecc_7',['environment.cc',['../environment_8cc.html',1,'']]],
['environment_2eh_8',['environment.h',['../environment_8h.html',1,'']]],
['eulerian_5fpath_2eh_9',['eulerian_path.h',['../eulerian__path_8h.html',1,'']]], |
<|file_name|>meshSearch.C<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 Ope... | hits.append(bHit);
|
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>extern crate gcc;
use std::env;
fn main() {
// for libhdfs.a
match env::var("HADOOP_HOME") {<|fim▁hole|> },
Err(e) => { panic!("HADOOP_HOME shell environment must be set: {}", e); }
}
// for jvm.h and linking to jni libraries
let mut minidfs_config... | Ok(val) => {
println!("cargo:rustc-link-search=native={}/lib/native", val); |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
<|fim▁hole|>
execute_from_command_line(sys.argv)<|fim▁end|> | if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "devault.settings")
from django.core.management import execute_from_command_line |
<|file_name|>debug-spec.js<|end_file_name|><|fim▁begin|>'use strict'
/* global
* describe, it, beforeEach, afterEach, expect, spyOn,
* loadFixtures, Waypoint
*/
describe('Waypoints debug script', function() {
var waypoint, element
beforeEach(function() {
loadFixtures('standard.html')
})
afterEach(fun... | handler: function() {} |
<|file_name|>statistics.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | // Generated by CoffeeScript 1.3.1 |
<|file_name|>ProviderCellEvent.ts<|end_file_name|><|fim▁begin|>import { ProviderEvent } from "./ProviderEvent";
<|fim▁hole|> *
* Interface for data provider cell events.
*/
export interface ProviderCellEvent extends ProviderEvent {
/**
* Cell ids for cells where data have been created.
*/
cellIds: s... | /** |
<|file_name|>instr_movhpd.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::*;
use ::test::run_test;
#[test]
fn movhpd_1() {
run_test(&Instruct... | fn movhpd_4() {
run_test(&Instruction { mnemonic: Mnemonic::MOVHPD, operand1: Some(IndirectScaledDisplaced(RDX, Eight, 2126469565, Some(OperandSize::Qword), None)), operand2: Some(Direct(XMM5)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: No... |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, t... | #
# For details, see https://github.com/spack/spack
# Please also see the NOTICE and LICENSE files for our notice and the LGPL. |
<|file_name|>Timer_Queue_Iterator.cpp<|end_file_name|><|fim▁begin|>//$Id: Timer_Queue_Iterator.cpp 2622 2015-08-13 18:30:00Z mitza $
#ifndef ACE_TIMER_QUEUE_ITERATOR_CPP<|fim▁hole|>#include "ace/config-all.h"
#if defined (ACE_HAS_ALLOC_HOOKS)
# include "ace/Malloc_Base.h"
#endif /* ACE_HAS_ALLOC_HOOKS */
#if !defined... | #define ACE_TIMER_QUEUE_ITERATOR_CPP
|
<|file_name|>SubtreeEvaluator.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
* ... | // The entry Dn is not part of the subtree specification, get out
return false;
} |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from django.core.exceptions import ValidationError
from django.db import models
def validate_answer_to_universe(value):
if value != 42:
raise ValidationError('This is not the answer to life, universe and everything!', code=... |
class GenericIPAddressTestModel(models.Model): |
<|file_name|>pannernode.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::audionode::AudioNode;
use crate::dom::aud... | self.upcast::<AudioNode>()
.message(AudioNodeMessage::PannerNode(msg));
}
// https://webaudio.github.io/web-audio-api/#dom-pannernode-coneouterangle |
<|file_name|>ldm_feeder.py<|end_file_name|><|fim▁begin|>##
##SMART FP7 - Search engine for MultimediA enviRonment generated contenT
##Webpage: http://smartfp7.eu
##
## 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... | ## Jose Miguel Garrido, jose.garridog at atos dot net
##
|
<|file_name|>overlapping_inherent_impls.rs<|end_file_name|><|fim▁begin|>// Test that you cannot define items with the same name in overlapping inherent<|fim▁hole|>#![allow(unused)]
struct Foo;
impl Foo {
fn id() {} //~ ERROR duplicate definitions
}
impl Foo {
fn id() {}
}
struct Bar<T>(T);
impl<T> Bar<T> {... | // impl blocks.
|
<|file_name|>onetimequeue.py<|end_file_name|><|fim▁begin|>from collections import deque
class onetimequeue(object):
def __init__ (self):
self._q = deque()
self._seen = set()
def push(self, obj):
if obj in self._seen:
return
self._seen.add(obj)
self._q.append(obj)
def pop(self):
... | def __len__(self):
return len(self._q) |
<|file_name|>ResourcePickerPopover.tsx<|end_file_name|><|fim▁begin|>import React, { createRef, useState } from 'react';
import { css } from '@emotion/css';
import { Button, ButtonGroup, useStyles2 } from '@grafana/ui';
import { GrafanaTheme2 } from '@grafana/data';
import { FocusScope } from '@react-aria/focus';
import... | |
<|file_name|>xfstate.rs<|end_file_name|><|fim▁begin|>extern crate gears;
use gears::structure::xflow::*;
use gears::runtime::xfstate::*;
#[cfg(test)]
#[test]
fn test_store_has() {
let mut xfstate = XFState::default();
let xvar = XFlowVariable {
name: "number1".to_string(),
vtype: XFlowValueType... | assert_eq!(xfstate.has("number1"), true);
xfstate.remove("number1"); |
<|file_name|>label.rs<|end_file_name|><|fim▁begin|>/* Copyright 2016 Jordan Miner
*
* Licensed under the MIT license <LICENSE or
* http://opensource.org/licenses/MIT>. This file may not be copied,
* modified, or distributed except according to those terms.
*/
use super::control_prelude::*;
#[derive(Clone)]
pub s... | Label(HandleRc::new(ih))
} |
<|file_name|>waitForExpect.tsx<|end_file_name|><|fim▁begin|>import { ReactWrapper } from 'enzyme';
export const createWaitForExpect = (
expectation: (rootComponent: ReactWrapper) => void | Promise<void>,
maxTime = 100,
interval = 10
) => (rootComponent: ReactWrapper) => {
return new Promise((resolve, reject) =... | if (remainingTime < 0) {
clearInterval(intervalId);
return reject(
`Expected to find element within ${maxTime}ms, but it was never found.` |
<|file_name|>bfs_test.py<|end_file_name|><|fim▁begin|>import unittest
import graph
class BreadthFirstSearchTest(unittest.TestCase):
__runSlowTests = False
def testTinyGraph(self):
g = graph.Graph.from_file('tinyG.txt')
bfs = graph.BreadthFirstSearch(g, 0)
self.assertEqual(7, bfs.cou... | self.assertIsNone(bfs.path_to(7)) |
<|file_name|>xrayrequest.cpp<|end_file_name|><|fim▁begin|>/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws 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 ver... | |
<|file_name|>test_api_applications.py<|end_file_name|><|fim▁begin|><|fim▁hole|>This test case test the REST API
api/applications.py
"""
import json
from .base import MyApiTestCase
class APIApplicationsResolverTestCase(MyApiTestCase):
def test_get_applications(self):
with self.app.test_request_context('/... | """ |
<|file_name|>os.py<|end_file_name|><|fim▁begin|>r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is either posixpath or ntpath
- os.name is either 'posix', 'nt', 'os2' or 'ce'.
- os.curdir is a s... | """spawnle(mode, file, *args, env) -> integer
Execute file with arguments from args in a subprocess with the
supplied environment. |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React from 'react'
import {HOC, Link} from 'cerebral-view-react'
import PageProgress from '../PageProgress'
// View
class AutoReload extends React.Component {
constructor (props) {
super(props)
this.state = {
secondsElapsed: 0
}
this.on... | |
<|file_name|>defaults.rs<|end_file_name|><|fim▁begin|>// Bloom
//<|fim▁hole|>// Copyright: 2017, Valerian Saliou <valerian@valeriansaliou.name>
// License: Mozilla Public License v2.0 (MPL v2.0)
pub static REQUEST_AUTHORIZATION_DEFAULT: &'static str = "";
pub static REQUEST_SHARD_DEFAULT: u8 = 0;<|fim▁end|> | // HTTP REST API caching middleware |
<|file_name|>admin_script.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use language_e2e_tests::{account::Account, current_function_name, executor::FakeExecutor};
use diem_crypto::{ed25519::Ed25519PrivateKey, PrivateKey, Uniform};
use diem_types::{
... | executor.add_account_data(&new_account);
let privkey = Ed25519PrivateKey::generate_for_testing();
let pubkey = privkey.public_key(); |
<|file_name|>grants.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from scrapy.spider import Spider
from scrapy.selector import Selector
from kgrants.items import KgrantsItem
from scrapy.http import Request
import time
class GrantsSpider(Spider):
name = "grants"
allowed_domains = ["www.knightfoundat... | |
<|file_name|>estimate-null-insert-sizes.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Copyright (C) 2015 Louis Dijkstra
This file is part of error-model-aligner
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... | def loglikelihood(mu, sigma, isizes, counts, n): |
<|file_name|>TextOutput.cpp<|end_file_name|><|fim▁begin|>/**
@file TextOutput.cpp
@maintainer Morgan McGuire, http://graphics.cs.williams.edu
@created 2004-06-21
@edited 2010-03-14
Copyright 2000-2010, Morgan McGuire.
All rights reserved.
*/
#include "G3D/TextOutput.h"
#include "G3D/Log.h"
#include "G3... | // newline is taken care of below.
if (c != '\r') {
++currentColumn;
} |
<|file_name|>loadVariations.ts<|end_file_name|><|fim▁begin|>import { LATEST_EMOJI_VERSION, LATEST_UNICODE_VERSION } from 'emojibase';
import { parseVariations } from '../parsers/parseVariations';
import { EmojiVariationMap } from '../types';
import { fetchAndCache } from './fetchAndCache';
export async function loadVa... | ).toFixed(1);
return fetchAndCache( |
<|file_name|>sync_test.go<|end_file_name|><|fim▁begin|>// Test sync/copy/move
package sync
import (
"context"
"fmt"
"runtime"
"strings"
"testing"
"time"
"github.com/pkg/errors"
_ "github.com/rclone/rclone/backend/all" // import all backends
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/account... | r := fstest.NewRun(t)
defer r.Finalise()
file1 := r.WriteFile("potato2", "hello world", t1)
file2 := r.WriteFile("hello world2", "hello world2", t2) |
<|file_name|>data.go<|end_file_name|><|fim▁begin|>// Code generated by soracom-cli generate-cmd. DO NOT EDIT.
package cmd
import (
"github.com/spf13/cobra"
)
func init() {
RootCmd.AddCommand(DataCmd)
}<|fim▁hole|> Short: TRCLI("cli.data.summary"),
Long: TRCLI(`cli.data.description`),
}<|fim▁end|> |
// DataCmd defines 'data' subcommand
var DataCmd = &cobra.Command{
Use: "data", |
<|file_name|>regions-fn-subtyping-2.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|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// htt... | |
<|file_name|>rcmuser-admin-users-controller.js<|end_file_name|><|fim▁begin|>/**
* rcmuserAdminUsersApp.rcmuserAdminUsers
*/
angular.module('rcmuserAdminUsersApp').controller(
'rcmuserAdminUsers',
[
'$window',
'$scope',
'$log',
'$uibModal',
'RcmUserResult',
'RcmR... | }
]
); |
<|file_name|>try_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/licenses/... | x = 2
finally:
x = 3 |
<|file_name|>crypto.go<|end_file_name|><|fim▁begin|>// Package crypto implements cryptographic functions for Kerberos 5 implementation.
package crypto
import (
"encoding/hex"
"fmt"
"github.com/hashicorp/gokrb5/crypto/etype"
"github.com/hashicorp/gokrb5/iana/chksumtype"
"github.com/hashicorp/gokrb5/iana/etypeID"
... | }
if len(et2[0].S2KParams) == 4 {
sk2p = hex.EncodeToString(et2[0].S2KParams)
} |
<|file_name|>layer_normalization_avx2.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2014, Intel Corporation
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 retain the above copy... | |
<|file_name|>cloud.cc<|end_file_name|><|fim▁begin|>#include <iostream>
#include <fstream>
#include <sstream><|fim▁hole|>#include <math.h>
#include <opennfs/cloud.h>
#include <opennfs/opengl.h>
#include <opennfs/billboard.h>
namespace visualizer {
void CloudLayer::enable_light_shafts()
{
_light_shafts_enabled = tr... | #include <cstdint>
#include <stdexcept> |
<|file_name|>only.spec.js<|end_file_name|><|fim▁begin|>'use strict';
var run = require('./helpers').runMochaJSON;
var assert = require('assert');
describe('.only()', function() {
describe('bdd', function() {
it('should run only tests that marked as `only`', function(done) {
run('options/only/bdd.fixture.j... | assert.equal(res.code, 0);
done();
});
}); |
<|file_name|>setpath.py<|end_file_name|><|fim▁begin|>#----------------------------------------------------------------------
#This utility sets up the python configuration files so as to
#allow Python to find files in a specified directory, regardless
#of what directory the user is working from. This is typically
#use... | |
<|file_name|>m_main.py<|end_file_name|><|fim▁begin|>import logging
from gettext import gettext as _
from typing import Tuple
from aai_framework.dial import ColorTxt
from aai_framework.interface import ModuleInterface
from .main import vars_, Vars
logger = logging.getLogger(__name__)
class Module(ModuleInterface):
... | LEN_INSTALL = 2665
@property
def vars_(self) -> Vars: |
<|file_name|>status.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 The Rook 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.org/licenses/LICENSE-... | NumberUp int `json:"numUp"`
Full bool `json:"full"`
NearFull bool `json:"nearFull"`
} |
<|file_name|>elb.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Scopely, Inc.
# Copyright (c) 2015 Mitch Garnaat
#
# Licensed under the Apache License, Version 2.0 (the "License"). 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... | # language governing permissions and limitations under the License.
from skew.resources.aws import AWSResource
|
<|file_name|>IOM_plugin_overlaplcwp.py<|end_file_name|><|fim▁begin|>"""The WaveBlocks Project
IOM plugin providing functions for handling various
overlap matrices of linear combinations of general
wavepackets.
@author: R. Bourquin
@copyright: Copyright (C) 2013 R. Bourquin
@license: Modified BSD License
"""
import n... | """
valid_keys = ("ov", "ovkin", "ovpot") |
<|file_name|>auto_correlations_compare.py<|end_file_name|><|fim▁begin|>"""
This scripts compares the autocorrelation in statsmodels with
the one that you can build using only correlate.
"""
import numpy as np
import matplotlib.pyplot as plt
import scipy.signal as signal
import statsmodels.api as sm
from signals.time_s... | auto_correlation1 = auto_correlation1[aux:aux + nlags1] / (normalizing * var) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.