prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>resolver.js<|end_file_name|><|fim▁begin|>import Resolver from 'ember/resolver'; <|fim▁hole|> resolver.namespace = { modulePrefix: 'map-app' }; export default resolver;<|fim▁end|>
var resolver = Resolver.create();
<|file_name|>apic.rs<|end_file_name|><|fim▁begin|>use common::*; use arch::init::{LOCAL_APIC_PAGE_VADDR, IO_APIC_PAGE_VADDR}; use util::{Mutex}; use super::{InterruptVector}; /// Local APIC pointer. #[derive(Debug)] pub struct LocalAPIC { address: VAddr, } /// I/O APIC pointer. #[derive(Debug)] pub struct IOAPIC ...
} /// Enable timer with a specific value.
<|file_name|>rotational-cipher.rs<|end_file_name|><|fim▁begin|>extern crate rotational_cipher as cipher; #[test] fn rotate_a_1() { assert_eq!("b", cipher::rotate("a", 1)); } #[test] #[ignore] fn rotate_a_26() { assert_eq!("a", cipher::rotate("a", 26)); } #[test] #[ignore] fn rotate_a_0() { assert_eq!("a"...
assert_eq!("T R L", cipher::rotate("O M G", 5)); }
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod segment; use std::path::PathBuf; use std::fs::File; use std::path::Path; use std::fs; use super::{Storage, StorageError, StorageResult}; use super::{Page, PAGE_SIZE, PageError}; use super::{Row, RowBuilder}; pub use self::segment::Segment; pub struct Disk { ...
}
<|file_name|>trailing_zeros.rs<|end_file_name|><|fim▁begin|>use integer::Integer; impl Integer { /// Returns the number of trailing zeros in the binary expansion of an `Integer` (equivalently, /// the multiplicity of 2 in its prime factorization) or `None` is the `Integer` is 0. /// /// Time: worst cas...
} }
<|file_name|>bitcoin_vi_VN.ts<|end_file_name|><|fim▁begin|><TS language="vi_VN" version="2.1"> <context> <name>AddressBookPage</name> <message> <source>Right-click to edit address or label</source> <translation>Nhấn chuột phải để sửa địa chỉ hoặc nhãn</translation> </message> <message> ...
<context> <name>WalletView</name> <message> <source>&amp;Export</source>
<|file_name|>test_issues.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Copyright (C) 2016 Red Hat, 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/...
from __future__ import unicode_literals
<|file_name|>captcha.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # #Copyright (C) 2009 kingzero, RaNaN # #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...
<|file_name|>aggregator_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license ...
# published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of
<|file_name|>extensions.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 l...
#from solum.openstack.common import log as logging
<|file_name|>bip9-softforks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2015-2016 The nealcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test BIP 9 soft forks. Connect to a singl...
assert_equal(self.get_bip9_status(bipName)['status'], 'active') assert_equal(self.get_bip9_status(bipName)['since'], 576)
<|file_name|>tokentrees.rs<|end_file_name|><|fim▁begin|>use super::{StringReader, UnmatchedBrace}; use rustc_ast::token::{self, DelimToken, Token}; use rustc_ast::tokenstream::{ DelimSpan, Spacing::{self, *}, TokenStream, TokenTree, TreeAndSpacing, };<|fim▁hole|>use rustc_ast_pretty::pprust::token_to_strin...
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import ckanext.deadoralive.config as config import ckanext.deadoralive.tests.helpers as custom_helpers class TestConfig(custom_helpers.FunctionalTestBaseClass): def test_that_it_reads_settings_from_config_file(self): """Test that non-default config...
# file.
<|file_name|>floppy_config.go<|end_file_name|><|fim▁begin|>package common import ( "fmt" "os" "github.com/mitchellh/packer/template/interpolate" ) <|fim▁hole|>} func (c *FloppyConfig) Prepare(ctx *interpolate.Context) []error { var errs []error if c.FloppyFiles == nil { c.FloppyFiles = make([]string, 0) } ...
type FloppyConfig struct { FloppyFiles []string `mapstructure:"floppy_files"`
<|file_name|>component.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';<|fim▁hole|> classNames: ['kit-canvas-scroller'], canvasStyle: Ember.computed('parentView.canvasStyle', function() { return this.get('parentView').get('canvasStyle'); }), numberOfItems: Ember.computed('parentView', function() { ret...
import layout from './template'; export default Ember.Component.extend({ layout: layout,
<|file_name|>detect.rs<|end_file_name|><|fim▁begin|>/* Copyright (C) 2018 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free * Software Foundation. * * This program is distributed in the ...
} } 0
<|file_name|>example.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import hypertrack hypertrack.secret_key = 'c237rtyfeo9893u2t4ghoevslsd' customer = hypertrack.Customer.create( name='John Doe', email='john@customer.com', phone='+15555555555', ) print(customer)<|fim▁end|>
<|file_name|>gamemenu.py<|end_file_name|><|fim▁begin|>class GameMenu(object): def __init__(self, menu_name, **options): self.menu_name = menu_name <|fim▁hole|><|fim▁end|>
self.options = options
<|file_name|>modulegen__gcc_LP64.py<|end_file_name|><|fim▁begin|>from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warning...
module.add_class('Ipv6OptionHeader', parent=root_module['ns3::Header'])
<|file_name|>EndExploration.ts<|end_file_name|><|fim▁begin|>// Copyright 2019 The Oppia 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...
// limitations under the License.
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from base import StreetAddressValidation, AddressValidation UPS_XAV_CONNECTION = 'https://onlinetools.ups.com/ups.app/xml/XAV' UPS_XAV_CONNECTION_TEST = 'https://wwwcie.ups.com/ups.app/xml/XAV' <|fim▁hole|><|fim▁end|>
UPS_AV_CONNECTION = 'https://onlinetools.ups.com/ups.app/xml/AV' UPS_AV_CONNECTION_TEST = 'https://wwwcie.ups.com/ups.app/xml/AV'
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # MinerLite - A client side miner controller. # This will launch cgminer with a few delay seconds and # retrieve the local data and post it into somewhere! # # Author: Yanxiang Wu # Release Under GPL 3 # Used code from cgminer python API example i...
def run_cgminer(path): subprocess.Popen([path, "--api-listen"])
<|file_name|>mutable-enum-indirect.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apac...
fn bar<T: Sync>(_: T) {} fn main() {
<|file_name|>tink.js<|end_file_name|><|fim▁begin|>"use strict"; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descrip...
_createClass(Tink, [{ key: "makeDraggable",
<|file_name|>resolve-conflict-import-vs-import.rs<|end_file_name|><|fim▁begin|>// run-rustfix #[allow(unused_imports)] use std::mem::transmute; use std::mem::transmute; //~^ ERROR the name `transmute` is defined multiple times <|fim▁hole|>}<|fim▁end|>
fn main() {
<|file_name|>factor.rs<|end_file_name|><|fim▁begin|>#![crate_name = "uu_factor"] /* * This file is part of the uutils coreutils package. * * (c) T. Jameson Little <t.jameson.little@gmail.com> * (c) Wiktor Kuropatwa <wiktor.kuropatwa@gmail.com> * 20150223 added Pollard rho method implementation * (c) kwantam <kwant...
if d == num {
<|file_name|>_sync.py<|end_file_name|><|fim▁begin|>from os import remove, mkdir, listdir, rmdir from os.path import join, expanduser, isdir from os.path import split as splitdir import codecs from shutil import copy2 indir = join(expanduser("~"),"Desktop") orgdir = "" bakdir = "" with codecs.open(join(indir,"_diff.tx...
<|file_name|>cart_modifier.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*- from decimal import Decimal from shop.cart.cart_modifiers_base import BaseCartModifier class TextOptionsOptionsCartModifier(BaseCartModifier): ''' This modifier adds an extra field to the cart to let the lineitem "know" abou...
def process_cart_item(self, cart_item, state):
<|file_name|>PacketFilterApplyingException.ts<|end_file_name|><|fim▁begin|>/// <reference path="../../../node.d.ts" /> export = PacketFilterApplyingException;<|fim▁hole|>'use strict'; /** * 要求された操作を行えません。起動中のサーバに対して変更されたパケットフィルタを反映するタスクが既に実行中です。 */ class PacketFilterApplyingException extends HttpConflictException {...
import HttpConflictException = require('../../errors/HttpConflictException');
<|file_name|>uritests.cpp<|end_file_name|><|fim▁begin|>#include "uritests.h" #include "../guiutil.h" #include "../walletmodel.h" #include <QUrl> void URITests::uriTests() { SendCoinsRecipient rv; QUrl uri; uri.setUrl(QString("AnonymousCoin:LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9?req-dontexist=")); QVERIFY(...
QVERIFY(rv.address == QString("LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9")); QVERIFY(rv.label == QString()); QVERIFY(rv.amount == 100000);
<|file_name|>servers.py<|end_file_name|><|fim▁begin|># Copyright 2010 OpenStack Foundation # Copyright 2011 Piston Cloud Computing, 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 # ...
<|file_name|>initfin.hpp<|end_file_name|><|fim▁begin|>/* Copyright (c) 2005 CodeSourcery, LLC. All rights reserved. */ /** @file initfin.hpp @author Zack Weinberg @date 2005-01-19 @brief VSIPL++ Library: [initfin] Initialization and finalization. This file declares the mechanism for initial...
/// implementation-defined options which modify the library's behavior. /// (This only happens the first time a \c vsipl object is created.) /// /// vsipl objects may not be copied.
<|file_name|>Box.js<|end_file_name|><|fim▁begin|>/** * @class EZ3.Box * @constructor * @param {EZ3.Vector3} [min] * @param {EZ3.Vector3} [max] */ EZ3.Box = function(min, max) { /** * @property {EZ3.Vector3} min * @default new EZ3.Vector3(Infinity) */ this.min = (min !== undefined) ? min : n...
points.push((new EZ3.Vector3(this.min.x, this.min.y, this.min.z)).mulMatrix4(matrix)); points.push((new EZ3.Vector3(this.min.x, this.min.y, this.max.z)).mulMatrix4(matrix)); points.push((new EZ3.Vector3(this.min.x, this.max.y, this.min.z)).mulMatrix4(matrix));
<|file_name|>WIPS_Bansal2010_hierarchy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python ############################################## ###Python template ###Author: Elizabeth Lee ###Date: 2/6/15 ###Function: Redraw figure 4A in Shifting Demographic Landscape (Bansal2010) ###Import data: ###Command Line: python ##...
childtest = [float(c) for c in childlist] adulttest = [float(a) for a in adultlist] print childtest
<|file_name|>WareDao.java<|end_file_name|><|fim▁begin|>package com.thinkgem.jeesite.modules.purifier.dao; import com.thinkgem.jeesite.common.persistence.CrudDao; import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao; import com.thinkgem.jeesite.modules.purifier.entity.Ware; <|fim▁hole|>/** * 仓库管理dao *...
<|file_name|>OpenInTerminalSettingsState.java<|end_file_name|><|fim▁begin|>/** * Copyright (C) 2015 Łukasz Tomczak <lksztmczk@gmail.com>. * * This file is part of OpenInTerminal plugin. * * OpenInTerminal plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General...
public OpenInTerminalSettingsState(String terminalCommand, String terminalCommandOptions) {
<|file_name|>d6.rs<|end_file_name|><|fim▁begin|>extern crate adventofcode; use adventofcode::d6::{Graph, Parser}; use std::io; use std::io::BufRead; fn total_orbits(orbits: &[String]) -> usize { let orbits = Parser::parse(orbits); let counts = Graph::new(orbits).traverse(); counts.iter().map(|(_, v)| *v).s...
let b = io::BufReader::new(io::stdin()); let v = b.lines().collect::<Result<Vec<String>, io::Error>>()?;
<|file_name|>pep_002.rs<|end_file_name|><|fim▁begin|>// https://doc.rust-lang.org/rust-by-example/trait/iter.html struct Fibonacci { curr: u64, next: u64, } impl Iterator for Fibonacci { type Item = u64; fn next(&mut self) -> Option<Self::Item> { let new_next = self.curr + self.next; s...
.filter(|n| n % 2 == 0) .sum() }
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|># it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This application is distributed in the hope that it will be useful, # but WITHOUT ANY W...
# # Copyright 2008,2009 Free Software Foundation, Inc. # # This application is free software; you can redistribute it and/or modify
<|file_name|>Paras.java<|end_file_name|><|fim▁begin|>package io.valhala.javamon.pokemon.skeleton; import io.valhala.javamon.pokemon.Pokemon; import io.valhala.javamon.pokemon.type.Type; public abstract class Paras extends Pokemon { public Paras() { super("Paras", 35, 70, 55, 25, 55, true, 46,Type.BUG,Type.GRASS);...
}
<|file_name|>clipboard_windows.cpp<|end_file_name|><|fim▁begin|>/*********************************************************************** * * Copyright (C) 2011, 2014 Graeme Gott <graeme@gottcode.org> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Pu...
{ if (canConvertFromMime(format, mime_data)) {
<|file_name|>union.rs<|end_file_name|><|fim▁begin|>#[repr(C)]<|fim▁hole|><|fim▁end|>
union U { i: i32, f: f32, }
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of compono released under the Apache 2 license. # See the NOTICE for more information. from distutils.command.install_data import install_data import os import sys if not hasattr(sys, 'version_info'...
zip_safe = False,
<|file_name|>main.dev.js<|end_file_name|><|fim▁begin|>/******/ (function(modules) { // webpackBootstrap /******/ // install a JSONP callback for chunk loading /******/ function webpackJsonpCallback(data) { /******/ var chunkIds = data[0]; /******/ var moreModules = data[1]; /******/ var executeModules = data[2]...
<|file_name|>NonNlsMessages.java<|end_file_name|><|fim▁begin|>/* * NonNlsMessages.java * Copyright 2008-2014 Gamegineer contributors and others. * All rights reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published...
<|file_name|>che-branding-config.ts<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2015-2018 Red Hat, Inc. * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 * which is available at https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifie...
* Red Hat, Inc. - initial API and implementation */ 'use strict';
<|file_name|>ScriptingKeyframesMaterialResource.hpp<|end_file_name|><|fim▁begin|>#ifndef DT3_SCRIPTINGKEYFRAMESMATERIALRESOURCE #define DT3_SCRIPTINGKEYFRAMESMATERIALRESOURCE //============================================================================== /// /// File: ScriptingKeyframesMaterialResource.hpp<|fim▁hole|...
/// /// Copyright (C) 2000-2014 by Smells Like Donkey Software Inc. All rights reserved. ///
<|file_name|>mssql.js<|end_file_name|><|fim▁begin|>if (typeof (QP) == "undefined" || !QP) { var QP = {} }; (function() { /* Draws the lines linking nodes in query plan diagram. root - The document element in which the diagram is contained. */ QP.drawLines = function(root) { if (root ==...
<|file_name|>scenemanager.py<|end_file_name|><|fim▁begin|>import serial from threading import Thread from menu import Menu from time import sleep import settings as s import pygame from pygame import * ser = serial.Serial('/dev/ttyACM0', 9600, timeout=.025) current_mark = None def worker(): global curren...
screen = pygame.display.set_mode((s.DISPLAY_WIDTH, s.DISPLAY_HEIGHT), pygame.FULLSCREEN) timer = pygame.time.Clock() running = True manager = SceneMananger()
<|file_name|>url.js<|end_file_name|><|fim▁begin|>http://jsfiddle.net/fusioncharts/38U6R/<|fim▁hole|><|fim▁end|>
http://jsfiddle.net/gh/get/jquery/1.9.1/sguha-work/fiddletest/tree/master/fiddles/Chart/Data-Labels/Configuring-x-axis-data-labels-display---wrap-mode_466/
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Armstrong Platform Documentation documentation build configuration file, created by # sphinx-quickstart on Mon Sep 26 13:38:48 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all poss...
#html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True
<|file_name|>customevent.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::codegen::Bindings::CustomEventBinding;...
impl<'a> CustomEventMethods for &'a CustomEvent { // https://dom.spec.whatwg.org/#dom-customevent-detail fn Detail(self, _cx: *mut JSContext) -> JSVal {
<|file_name|>char.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.org/licenses/L...
let c: char = 'x'; let d: char = 'x';
<|file_name|>static.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2012-2016 The Revel Framework Authors, All rights reserved. // Revel Framework source code and usage is governed by a MIT style // license that can be found in the LICENSE file. package controllers<|fim▁hole|> "os" fpath "path/filepath" "strings" ...
import (
<|file_name|>AdmobHelper.java<|end_file_name|><|fim▁begin|>package eu.ttbox.geoping.ui.admob; import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.util.Log; import android.view.View;<|fim▁hole|>import com.goo...
import com.google.android.gms.ads.AdListener; import com.google.android.gms.ads.AdRequest;
<|file_name|>admin.py<|end_file_name|><|fim▁begin|><|fim▁hole|>admin.site.register(Catalog) admin.site.register(Item)<|fim▁end|>
from django.contrib import admin from .models import Catalog, Item
<|file_name|>models.py<|end_file_name|><|fim▁begin|>""" Model and manager used by the two-step (sign up, then activate) workflow. If you're not using that workflow, you don't need to have 'registration' in your INSTALLED_APPS. This is provided primarily for backwards-compatibility with existing installations; new inst...
if SHA1_RE.search(activation_key): try: profile = self.get(activation_key=activation_key) except self.model.DoesNotExist:
<|file_name|>bucket.go<|end_file_name|><|fim▁begin|>// Licensed under the Apache License, Version 2.0 // Details: https://raw.githubusercontent.com/square/quotaservice/master/LICENSE // Package memory implements token buckets in memory, inspired by the algorithms used in Guava's // RateLimiter library - https://github...
<|file_name|>oracle_element.py<|end_file_name|><|fim▁begin|># Copyright 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/LICENSE-2.0 # #...
"""A Reach Oracle configuration class. Attributes: reach_name: The name of the Oracle.
<|file_name|>connection.rs<|end_file_name|><|fim▁begin|>use proto; use byteorder::{BigEndian, WriteBytesExt}; use std; use std::net::{IpAddr, TcpStream};<|fim▁hole|> use openssl; use openssl::ssl::{HandshakeError, SslContext, SslMethod, SslStream}; use protobuf; // Connect const SSL_HANDSHAKE_RETRIES: u8 = 3; #[de...
use std::sync::Mutex;
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from __future__ import division import datetime as dt missing = object() try: import numpy as np except ImportError: np = None def int_to_rgb(number): """Given an integer, return the rgb""" number = int(number) r = number % 256 g = (number...
self._freshline = True
<|file_name|>job.rs<|end_file_name|><|fim▁begin|>// // Copyright:: Copyright (c) 2016 Chef Software, Inc. // License:: Apache License, Version 2.0 // // 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 Lic...
<|file_name|>f303xe--wwdg.go<|end_file_name|><|fim▁begin|>// +build f303xe // Peripheral: WWDG_Periph Window WATCHDOG. // Instances: // WWDG mmap.WWDG_BASE // Registers: // 0x00 32 CR Control register. // 0x04 32 CFR Configuration register. // 0x08 32 SR Status register. // Import: // stm32/o/f303xe/mmap p...
<|file_name|>string_format.py<|end_file_name|><|fim▁begin|># Change the following to True to get a much more comprehensive set of tests # to run, albeit, which take considerably longer. full_tests = False def test(fmt, *args): print('{:8s}'.format(fmt) + '>' + fmt.format(*args) + '<') test("}}{{") test("{}-{}",...
print('IndexError') try:
<|file_name|>timer.rs<|end_file_name|><|fim▁begin|>// Zinc, the bare metal stack for rust. // Copyright 2014 Lionel Flandrin <lionel@svkt.org> // // 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...
}
<|file_name|>HookListTablePlaceholder.tsx<|end_file_name|><|fim▁begin|>import { FunctionComponent } from 'react'; import { translate } from '@waldur/i18n'; import { ImageTablePlaceholder } from '@waldur/table/ImageTablePlaceholder'; const Illustration = require('@waldur/images/table-placeholders/undraw_empty_xct9.svg...
title={translate('You have no notifications yet.')}
<|file_name|>BinanceAuthentication.ts<|end_file_name|><|fim▁begin|>import * as crypto from "crypto"; export class BinanceAuthentication { private secretKey: string; private apiKey: string; public signParameters(parameters: string): string { const hmac = crypto.createHmac("sha256", this.getSecretK...
if (this.secretKey) {
<|file_name|>test_view_only_query_parameter.py<|end_file_name|><|fim▁begin|>import pytest from api.base.settings.defaults import API_BASE from osf_tests.factories import ( ProjectFactory, AuthUserFactory, PrivateLinkFactory, ) from osf.utils import permissions @pytest.fixture() def admin(): return Au...
assert 'custom_citation' in attributes assert 'node_license' in attributes assert 'forks' in relationships
<|file_name|>unread.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core'; import { Observable } from 'rxjs/Observable'; <|fim▁hole|>import { ApplicationViewModel, ListBody, ListPageViewModel } from '../services/viewmodel.types'; import { DataService } from './data.service'; export class U...
import { EventEmitter } from 'events'; import { LocalDataService } from '../services/local-data.service';
<|file_name|>XBeeAtCmd.cpp<|end_file_name|><|fim▁begin|>#include <XBeeAtCmd.hpp> #include <iostream> #include <stdlib.h> #include <XBeeDebug.hpp> XBeeAtCmd::XBeeAtCmd(){ _frameId = XBEE_DEFAULT_FRAME_ID; _atCmd = XBEE_DEFAULT_AT_CMD; _paramValue = new vector<uint8_t>(); } vector<uint8_t> XBeeAtCmd::getParamValu...
return true; }
<|file_name|>While.cpp<|end_file_name|><|fim▁begin|>//Kappy ; While Loop program //While.cpp : Shows how the while loop is used #include <iostream> using namespace std; void main() { double amountOfSyrup, numOfWaffles; amountOfSyrup = 2.6; cout << "How many waffles do you have? "; cin >> numOfWaffles; cout << ...
else if(numOfWaffles == 0) { cout << "You ran out of waffles!" << endl; }
<|file_name|>redact_test.py<|end_file_name|><|fim▁begin|># Copyright 2017 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/LICENSE-2.0 # # Un...
test_filepath = os.path.join(RESOURCE_DIRECTORY, "test.png") output_filepath = os.path.join(tempdir, "redacted.png") redact.redact_image_all_text(
<|file_name|>report.py<|end_file_name|><|fim▁begin|># coding: utf-8 """ Routines for printing a report. """ from __future__ import print_function, division, absolute_import import sys from collections import namedtuple from contextlib import contextmanager import textwrap from .adapters import BACK, FRONT, PREFIX, SUF...
report += "{pairs_or_reads} that were too long: {too_long:13,d} ({too_long_fraction:.1%})\n"
<|file_name|>Squares.py<|end_file_name|><|fim▁begin|>#David Hickox #Feb 15 17 #Squares (counter update) #descriptions, description, much descripticve #variables # limit, where it stops # num, sentry variable #creates array if needbe #array = [[0 for x in range(h)] for y in range(w)] #imports date time and curenc...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Define the Python wrapper-functions which provide an interface to the C++ implementations. """ <|fim▁hole|><|fim▁end|>
from .present import CPP_BINDINGS_PRESENT from .imager import cpp_image_visibilities, CppKernelFuncs
<|file_name|>Login.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- #<|fim▁hole|># All Rights Reserved. # Use is subject to license terms supplied in LICENSE.txt # import requests from Parse_OMERO_Properties import USERNAME, PASSWORD, OMERO_WEB_HOST, \ SERVER_NAME ...
# Copyright (C) 2016-2017 University of Dundee & Open Microscopy Environment.
<|file_name|>actiongroup.cpp<|end_file_name|><|fim▁begin|>#include "actiongroup.h" #include "taskheader_p.h" #include "taskgroup_p.h" #include "actionlabel.h" #include "actionpanelscheme.h" #include <QtGui/QPainter> namespace QSint { ActionGroup::ActionGroup(QWidget *parent) : QWidget(parent) { myHeader = ne...
if (myDummy->isVisible()) {
<|file_name|>test_management.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals import codecs import os import shutil import tempfile import unittest from admin_scripts.tests import AdminScriptTestCase from django.conf import settings from django.contrib.staticfiles import storage from django.co...
def run_collectstatic(self): super(TestCollectionExcludeNoDefaultIgnore, self).run_collectstatic( use_default_ignore_patterns=False)
<|file_name|>roster_nb.py<|end_file_name|><|fim▁begin|>## roster_nb.py ## based on roster.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## modified by Dimitur Kirov <dkirov@gmail.com> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of ...
<|file_name|>screenshot.py<|end_file_name|><|fim▁begin|>from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Get-Screenshot', 'Author': ['@obscuresec', '@harmj0y'], 'Description': ('Takes a screenshot of the cur...
$DrawingGraphics.CopyFromScreen( $ScreenBounds.Location, [Drawing.Point]::Empty, $ScreenBounds.Size); $DrawingGraphics.Dispose(); $ms = New-Object System.IO.MemoryStream; if ($Ratio) {
<|file_name|>border.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -* # Copyright (c) 2010 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 cod...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3<|fim▁hole|>from django.shortcuts import render # Create your views here. from CnbetaApis.datas.Models import * from CnbetaApis.datas.get_letv_json import get_letv_json from CnbetaApis.datas.get_youku_json import get_youku_json from django.views...
<|file_name|>game.js<|end_file_name|><|fim▁begin|>/* Game namespace */ var game = { // an object where to store game information data : { // score score : 0 }, // Run on page load. "onload" : function () { // Initialize the video. if (!me.video.init("screen", me.video.CANVAS, 1067, 600, true, '1.0')) {...
<|file_name|>reporting_server.py<|end_file_name|><|fim▁begin|># Copyright 2021 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. import os from googleapiclient.discovery import build from google.oauth2 import service_accoun...
class RealTimeReportingServer(): SCOPES = ['https://www.googleapis.com/auth/admin.reports.audit.readonly']
<|file_name|>AgentApplication.java<|end_file_name|><|fim▁begin|>package io.monocycle.agent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; <|fim▁hole|>import org.springframework.sche...
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration;
<|file_name|>request.go<|end_file_name|><|fim▁begin|>// Copyright 2015 mint.zhao.chiu@gmail.com // // Licensed under the Apache License, Version 2.0 (the "License"): you may // not use this file except in compliance with the License. You may obtain // a copy of the License at // // http://www.apache.org/licenses/LI...
urls, err := url.ParseRequestURI(req.HttpUrl) if err != nil { return "" }
<|file_name|>util.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import re RATEBEER_BASE_URL = 'http://www.ratebeer.com/beer' def ratebeer_url(ratebeer_id, short_name):<|fim▁hole|> '[^A-Za-z0-9\-]+', '', short_name.replace(' ', '-') ) return "%s/%s/%s/" % (RATEBEER_BASE_URL, ...
fixed_name = re.sub(
<|file_name|>test_predicates.py<|end_file_name|><|fim▁begin|>import doctest import pytest from datascience import predicates from datascience import * def test_both(): """Both f and g.""" p = are.above(2) & are.below(4) ps = [p(x) for x in range(1, 6)] assert ps == [False, False, True, False, False] d...
ps = [p(x) for x in range(1, 6)] assert ps == [False, False, False, True, True] def test_above_or_equal_to():
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .stackapi import StackAPI<|fim▁hole|><|fim▁end|>
from .stackapi import StackAPIError
<|file_name|>test_instruction_values.rs<|end_file_name|><|fim▁begin|>use inkwell::context::Context; use inkwell::values::{BasicValue, InstructionOpcode::*}; use inkwell::{AddressSpace, AtomicOrdering, AtomicRMWBinOp, FloatPredicate, IntPredicate}; #[test] fn test_operands() { let context = Context::create(); l...
let f32_type = context.f32_type(); let f32_ptr_type = f32_type.ptr_type(AddressSpace::Generic); let fn_type = void_type.fn_type(&[f32_ptr_type.into(), f32_type.into()], false);
<|file_name|>sendheaders.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Sarielsaz Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test behavior of headers messages to announc...
with mininode_lock:
<|file_name|>engine.py<|end_file_name|><|fim▁begin|>""" The "engine room" of django mailer. Methods here actually handle the sending of queued messages. """ from django_mailer import constants, models, settings from lockfile import FileLock, AlreadyLocked, LockTimeout from socket import error as SocketError import l...
<|file_name|>test_xpathevaluator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Test cases related to XPath evaluation and the XPath class """ import unittest, sys, os.path this_dir = os.path.dirname(__file__) if this_dir not in sys.path: sys.path.insert(0, this_dir) # needed for Py3 from common_im...
def test_xpath_list_attribute(self): tree = self.parse('<a b="B" c="C"/>')
<|file_name|>run_e2e.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 Unless...
if tr.err != nil { errCount++
<|file_name|>animation_style_normalizer.ts<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> * Copyright Google LLC 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 */ /** * @publicApi */ export abstract class An...
* @license
<|file_name|>mock.go<|end_file_name|><|fim▁begin|>package mock import ( "time" "github.com/hashicorp/nomad/nomad/structs" ) func Node() *structs.Node { node := &structs.Node{ ID: structs.GenerateUUID(), SecretID: structs.GenerateUUID(), Datacenter: "dc1", Name: "foobar", Attributes: map[...
NodeID: "12345678-abcd-efab-cdef-123456789abc", TaskGroup: "web", Resources: &structs.Resources{ CPU: 500,
<|file_name|>test_model_post.py<|end_file_name|><|fim▁begin|>from django.test import TestCase <|fim▁hole|> class CategoryModelTests(TestCase): def setUp(self): self.post = PostFactory() def test_string_method(self): self.assertEquals(str(self.post), 'Body text\nWith multiple lines!')<|fim▁end|...
from forums.factories import PostFactory
<|file_name|>bees.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> loop { print!("BEES "); } }<|fim▁end|>
fn main() {
<|file_name|>Puzzle15Processor.java<|end_file_name|><|fim▁begin|>package org.opencv.samples.puzzle15; import org.opencv.core.Core; import org.opencv.core.CvType; import org.opencv.core.Mat; import org.opencv.core.Scalar; import org.opencv.core.Size; import org.opencv.core.Point; import org.opencv.imgproc.Imgproc; imp...
int cols = inputPicture.cols();
<|file_name|>authproxy.py<|end_file_name|><|fim▁begin|>""" Copyright 2011 Jeff Garzik AuthServiceProxy has the following improvements over python-jsonrpc's ServiceProxy class: - HTTP connections persist for the life of the AuthServiceProxy object (if server supports HTTP/1.1) - sends protocol 'version',...