prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>borrowed-enum.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.apache....
zzz(); // #break } fn zzz() {()}
<|file_name|>query.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright (c) 2015,掌阅科技 All rights reserved. 摘 要: query.py 创 建 者: WangLichao 创建日期: 2015-03-06 """ # pylint: disable=arguments-differ<|fim▁hole|>OPERATOR = { 'like': '包含', '=': '等于', '!=': '不等于', '>'...
from tornado.web import UIModule
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
from ._costs import *
<|file_name|>module.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright(C) 2013 Julien Veyssier # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundatio...
return self.browser.iter_movies(pattern.encode('utf-8'))
<|file_name|>safi.rs<|end_file_name|><|fim▁begin|>use core::fmt; /// Unicast [RFC4760] pub const SAFI_UNICAST: Safi = Safi(1); /// Multicast [RFC4760] pub const SAFI_MULTICAST: Safi =...
2 => write!(f, "multicast"), n => write!(f, "unknown({})", n), }
<|file_name|>babelfish.js<|end_file_name|><|fim▁begin|>/* babelfish 1.0.2 nodeca/babelfish */!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=glob...
<|file_name|>geo.py<|end_file_name|><|fim▁begin|>from collections.abc import Sequence<|fim▁hole|>from .compound import All class Latitude(All): """Validate the given value as a number between -90 and +90 in decimal degrees, representing latitude.""" validators = [ Instance(Number), Range(-90, 90) ] latit...
from numbers import Number from . import Validator, Length, Range, Instance
<|file_name|>ios.py<|end_file_name|><|fim▁begin|># This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and ...
ios_argument_spec = { 'provider': dict(type='dict', options=ios_provider_spec), }
<|file_name|>Sqlite3Ex.cpp<|end_file_name|><|fim▁begin|>/*#include "StdAfx.h"*/ #include "Sqlite3Ex.h" #include <string.h> Sqlite3Ex::Sqlite3Ex(void) :m_pSqlite(NULL) { memset(m_szErrMsg, 0x00, ERRMSG_LENGTH); } Sqlite3Ex::~Sqlite3Ex(void) { } bool Sqlite3Ex::Open(const wchar_t* szDbPath) { ...
<|file_name|>func.cpp<|end_file_name|><|fim▁begin|>#include <iostream> #include <cstdlib> #include <vector> #include <fstream> #include "strings.cpp" #define NAMEFILE "./names.txt" #define JOBFILE "./jobs.txt" #define TRIM (after(buffer,':')) //Define global variables vector<string> femaleNames; vector<string> maleNam...
maleNames.push_back(TRIM);
<|file_name|>page.py<|end_file_name|><|fim▁begin|>from element import BasePageElement from locators import PageFooterLocators from selenium.webdriver.common.action_chains import ActionChains class BasePage(object): def __init__(self, driver): self.driver = driver class FooterPage(BasePage): def ...
return "" in self.driver.current_url def click_gplus_button(self):
<|file_name|>mcdonalds_il.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import scrapy import json import re from locations.items import GeojsonPointItem class McDonalsILSpider(scrapy.Spider): name = "mcdonalds_il" allowed_domains = ["www.mcdonalds.co.il"] start_urls = ( 'https://www.mcd...
'to_day': short_day,
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codec...
# Although 'package_data' is the preferred approach, in some case you may
<|file_name|>microsoft.py<|end_file_name|><|fim▁begin|>import base64 import json import requests def call_vision_api(image_filename, api_keys): api_key = api_keys['microsoft'] post_url = "https://api.projectoxford.ai/vision/v1.0/analyze?visualFeatures=Categories,Tags,Description,Faces,ImageType,Color,Adult&sub...
<|file_name|>test.py<|end_file_name|><|fim▁begin|>import unittest import broccoli.parser class BroccoliTest(unittest.TestCase): def test_job_creation(self): config = broccoli.parser.parse('input.json') job = broccoli.job.Job(config) self.assertEqual(job.name, 'Job1') self.assertE...
unittest.main()
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages version = "6.3.0" with open("requirements.txt", "r") as f: install_requires = f.readlines() setup( name='frappe', version=version, description='Metadata driven, full-stack web framework', author='Frappe Te...
<|file_name|>simple.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010, Mats Kindahl, Charles Bell, and Lars Thalmann<|fim▁hole|># # Use of this source code is goverened by a BSD licence that can be # found in the LICENCE file. from mysql.replicant.server import Server from mysql.replicant.common import User from my...
# All rights reserved.
<|file_name|>types_.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import collections def read_only(self, name, val): raise ValueError('not supported') class SimpleObject(object): def __init__(self, a, b, c): self.a = a self.b = b self.b = c class SimpleObjectImmutable(object...
<|file_name|>EventDispatchForbiddenScope.cpp<|end_file_name|><|fim▁begin|>// Copyright 2015 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 "config.h"<|fim▁hole|>namespace blink { #if ENABLE(ASSERT) unsigned Ev...
#include "platform/EventDispatchForbiddenScope.h"
<|file_name|>update_lib_doc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # HORTON: Helpful Open-source Research TOol for N-fermion systems. # Copyright (C) 2011-2016 The HORTON Development Team # # This file is part of HORTON. # # HORTON is free software; you can redistribute it and/or ...
packages['horton.%s' % subpackage] = [] # find modules
<|file_name|>validation.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Validators for UI @author: Jan Gabriel @contact: jan.gabriel@tul.cz """ from enum import Enum from PyQt5.QtGui import QColor from PyQt5 import QtWidgets class ValidationColors(Enum): """ Holds colors for form validation. "...
control.setToolTip(errors[key])
<|file_name|>sass.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp'); var sass = require('gulp-sass'); var auto = require('gulp-autoprefixer');<|fim▁hole|>gulp.task('scss', function() { return gulp.src('src/scss/*.scss') .pipe(plumber()) .pipe(sass()) .pipe(sourcemaps.init()) ...
var sourcemaps = require('gulp-sourcemaps'); var browserSync = require('browser-sync').create(); var plumber = require('gulp-plumber');
<|file_name|>ParameterUI.js<|end_file_name|><|fim▁begin|>/* Copyright (c) Business Objects 2006. All rights reserved. */ /* ================================================================================ ParameterUI Widget for displaying and editing parameter values. Contains one or many ParameterValueRows and, opti...
<|file_name|>ChangePasswordResult.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ Copyright 2012 GroupDocs.<|fim▁hole|> 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 ap...
Licensed under the Apache License, Version 2.0 (the "License");
<|file_name|>CWE78_OS_Command_Injection__wchar_t_connect_socket_execlp_82_bad.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|>/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE78_OS_Command_Injection__wchar_t_connect_socket_execlp_82_bad.cpp Label Definition File: CWE78_OS_Command_Injection.strings.label.xml Template Fi...
<|file_name|>main.js<|end_file_name|><|fim▁begin|>var map, boroughSearch = [], theaterSearch = [], museumSearch = []; /* Basemap Layers */ var mapquestOSM = L.tileLayer("http://{s}.tiles.mapbox.com/v3/am3081.h0po4e8k/{z}/{x}/{y}.png"); var mbTerrainSat = L.tileLayer("https://{s}.tiles.mapbox.com/v3/matt.hd0b2...
<|file_name|>Main.java<|end_file_name|><|fim▁begin|>package savetheenvironment.profiles.mocking; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.core.env.MapPropertySource; import org.springframework.cor...
System.out.println(title);
<|file_name|>user-posts.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { UserPostsComponent } from './user-posts.component'; describe('UserPostsComponent', () => { let component: UserPostsComponent; let fixture: ComponentFixture<User...
component = fixture.componentInstance;
<|file_name|>client.go<|end_file_name|><|fim▁begin|>/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apac...
<|file_name|>question-block.js<|end_file_name|><|fim▁begin|>'use strict'; angular.module('app.directives') .directive('questionBlock',function() { return { restrict: 'E', scope: {<|fim▁hole|> }, templateUrl:'/directives/questions/question-block.html' }; });<|fim▁end|>
question:'='
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>extern mod std; use std::io::fs::{File, mkdir_recursive}; use std::{os, ptr, str}; use std::io::{Reader, io_error}; use std::path::Path; use std::libc::{c_void}; use std::unstable::atomics::{AtomicBool, Acquire, Release, INIT_ATOMIC_BOOL}; use nspr::raw::nspr::*; use ...
}
<|file_name|>compress.rs<|end_file_name|><|fim▁begin|>extern crate byteorder; extern crate crc; use std::io; use std::io::{BufWriter, ErrorKind, Write, Seek, SeekFrom, Result, Error}; use self::byteorder::{ByteOrder, WriteBytesExt, LittleEndian}; use self::crc::{crc32, Hasher32}; use definitions::*; // We limit how...
dst[i] = ((offset >> 8) as u8) & 0x07 << 5 | (x as u8) << 2 | TAG_COPY_1; dst[i + 1] = offset as u8; i += 2; break;
<|file_name|>csearch.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/li...
/// Iterates over each child of the given item. pub fn each_child_of_item(cstore: &cstore::CStore, def_id: ast::DefId,
<|file_name|>ChartsPageTest.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2011-2012 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2012 The OpenNMS Group, Inc. * * OpenNMS(R) is a ...
<|file_name|>Money.js<|end_file_name|><|fim▁begin|><|fim▁hole|> throw new Error('Numeral is required in global variable') } export default class MoneyComponent extends NumeralFieldComponent { unformatValue(label) { return label === '' ? undefined : numeral._.stringToNumber(label) } formatValue(real) { ...
import NumeralFieldComponent from './Numeral' const numeral = global.numeral if (!numeral) {
<|file_name|>ao_memory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ Copyright (c) 2004-Present Pivotal Software, Inc. This program and the accompanying materials are made available under the terms of the under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance...
gpfaultinjector.run()
<|file_name|>transpile_config.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source ...
# copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. """Models for TranspileConfig and its related components."""
<|file_name|>endian.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2013-2015 Sandstorm Development Group, Inc. and contributors // Licensed under the MIT License: // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"),...
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
<|file_name|>testPanel.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- panel_file = open('panels.txt','r') name_file = open('testName.txt','r') sample_type_file = open("sampleType.txt") test_panel_results = open("output/testPanelResults.txt", 'w') panel = [] type = []<|fim▁hole|>def get_s...
test_names = []
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig <|fim▁hole|><|fim▁end|>
class AttachmentsConfig(AppConfig): verbose_name = 'Attachments'
<|file_name|>EvenSlaverDomainEntity.java<|end_file_name|><|fim▁begin|><|fim▁hole|> import java.util.Date; import ua.com.fielden.platform.domaintree.testing.EntityWithStringKeyType; import ua.com.fielden.platform.entity.AbstractEntity; import ua.com.fielden.platform.entity.DynamicEntityKey; import ua.com.fielden.platfo...
package ua.com.fielden.platform.entity_centre.review;
<|file_name|>strategyAtrRsi.py<|end_file_name|><|fim▁begin|># encoding: UTF-8 """ 一个ATR-RSI指标结合的交易策略,适合用在股指的1分钟和5分钟线上。 注意事项: 1. 作者不对交易盈利做任何保证,策略代码仅供参考 2. 本策略需要用到talib,没有安装的用户请先参考www.vnpy.org上的教程安装 3. 将IF0000_1min.csv用ctaHistoryData.py导入MongoDB后,直接运行本文件即可回测策略 """ from ctaBase import * from ctaTemplate import CtaTem...
varList = ['inited', 'trading',
<|file_name|>BaseDialogBuilder.java<|end_file_name|><|fim▁begin|>package com.avast.android.dialogs.core; import android.content.Context; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; /** * Internal base ...
fragment.show(mFragmentManager, mTag); return fragment;
<|file_name|>UnauthenticatedProfile.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react'; import { Platform, StyleSheet, View } from 'react-native'; import url from 'url'; import DevMenuContext from '../../DevMenuContext'; import * as DevMenuWebBrowser from '../../DevMenuWebBrowser'; import Colors from '../...
<|file_name|>patches1.C<|end_file_name|><|fim▁begin|>// { dg-do assemble } // GROUPS passed patches // patches file // From: david.binderman@pmsr.philips.co.uk // Date: Wed, 6 Oct 93 17:05:54 BST // Subject: Reno 1.2 bug fix // Message-ID: <9310061605.AA04160@pmsr.philips.co.uk> int type(float) { return 1;...
int type(double) { return 2; } int type(long double) { return 3; } extern "C" int printf( const char *, ...);
<|file_name|>validateExpectedNssComponentsTree.cpp<|end_file_name|><|fim▁begin|>/******************************************************************************* File: validateExpectedNssComponentsTree.cpp Project: OpenSonATA Authors: The OpenSonATA code is the result of many programmers over many years...
<|file_name|>error.py<|end_file_name|><|fim▁begin|>class Error(object): def __init__(self, code, msg=None, data=None): self.code = code self.msg = msg self.data = data <|fim▁hole|> err = self.to_dict() return str(err) def to_dict(self): err = {} err['e...
def __str__(self):
<|file_name|>publish-gh-release-notes.py<|end_file_name|><|fim▁begin|>""" Script used to publish GitHub release notes extracted from CHANGELOG.rst. This script is meant to be executed after a successful deployment in GitHub actions. Uses the following environment variables: * GIT_TAG: the name of the tag of the curr...
# found a new version title while parsing the version we want: break out elif consuming_version: break if consuming_version:
<|file_name|>wallet_keypool.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Doriancoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the wallet keypool and interaction ...
assert(addr_before_encrypting_data['hdmasterkeyid'] != wallet_info['hdmasterkeyid']) assert(addr_data['hdmasterkeyid'] == wallet_info['hdmasterkeyid']) assert_raises_rpc_error(-12, "Error: Keypool ran out, please call keypoolrefill first", nodes[0].getnewaddress)
<|file_name|>book.rs<|end_file_name|><|fim▁begin|>use super::Processor; use crate::data::messages::{BookRecord, BookUpdate, RecordUpdate}; use crate::data::trade::TradeBook; use crate::error::PoloError; use std::str::FromStr; use std::sync::{Arc, Mutex}; #[derive(Clone)] pub struct Accountant { tb: Arc<Mutex<Trade...
} }
<|file_name|>read_project_steps.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- #!/usr/bin/env python # # Copyright 2014 BigML # # 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 # # ...
from bigml.api import HTTP_OK
<|file_name|>DefaultGradientModel.java<|end_file_name|><|fim▁begin|>package com.michaelbaranov.microba.gradient; import java.awt.Color; import java.util.ArrayList; import java.util.List; import com.michaelbaranov.microba.common.AbstractBoundedTableModel; /** * A very basic implementation of {@link AbstractBoundedTa...
}
<|file_name|>webpack.config.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
module.exports.default = undefined;
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url from waldur_mastermind.booking import views <|fim▁hole|> r'booking-resources', views.ResourceViewSet, basename='booking-resource' ) router.register( r'booking-offerings', views.OfferingViewSet, basename='booking-o...
def register_in(router): router.register(
<|file_name|>alpha.py<|end_file_name|><|fim▁begin|>#csv module. import csv from geopy import geocoders from collections import defaultdict import json def checkgeocode(geocode): #return len(geocode) if len(geocode) < 9: return "0"+str(geocode) else: return geocode with open('casualty.csv', 'rb') as f: read...
print codelist for k,v in codelist.iteritems(): print k,v
<|file_name|>search-dao-queries.js<|end_file_name|><|fim▁begin|>/** * @author Trilogis Srl * @author Gustavo German Soria * * Search DAO queries module */ /** * Import of the line model * @type {exports} */ var line = require('./../models/line.js'); /** * Import of the road model * @type {exports} */ var r...
break; case params.POLYGON : { table = polygon.model.nameTable;
<|file_name|>index.rs<|end_file_name|><|fim▁begin|>#![feature(test)] extern crate test; extern crate bloodhound; use test::Bencher; use std::path::PathBuf; use bloodhound::Index; #[bench] fn bench_find(b: &mut Bencher) {<|fim▁hole|> let mut index = Index::new(PathBuf::from(".")); index.populate(None, false); ...
<|file_name|>arrayFrom.js<|end_file_name|><|fim▁begin|>/** * Array.from ponyfill. * * @param {Object} iterable * * @returns {Array}<|fim▁hole|> */ export default function arrayFrom(iterable) { const arr = []; for (let i = 0; i < iterable.length; i += 1) { arr.push(iterable[i]); } return a...
<|file_name|>template_test.go<|end_file_name|><|fim▁begin|>package template import ( "bytes" "io" "io/ioutil" "log" "os" "testing" "text/template" "github.com/k8sp/sextant/cloud-config-server/certgen" "github.com/k8sp/sextant/clusterdesc" "github.com/stretchr/testify/assert" "github.com/topicai/candy" "go...
var ccTmpl bytes.Buffer Execute(tmpl, config, "00:25:90:c0:f7:80", caKey, caCrt, &ccTmpl) yml := make(map[interface{}]interface{}) candy.Must(yaml.Unmarshal(ccTmpl.Bytes(), yml))
<|file_name|>simulation.py<|end_file_name|><|fim▁begin|>""" Define a simple framework for time-evolving a set of arbitrary agents and monitoring their evolution. """ import numpy as np def int_r(f): """ Convert to nearest integer. """ return int(np.round(f)) class Simulation(object): """ A class that manages...
agent = self._agent i = self._i
<|file_name|>regexp_test.cc<|end_file_name|><|fim▁begin|>// Copyright 2006 The RE2 Authors. All Rights Reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file.<|fim▁hole|>#include <vector> #include "util/test.h" #include "re2/regexp.h" namespace re2 { // Test ...
// Test parse.cc, dump.cc, and tostring.cc. #include <string>
<|file_name|>logic.py<|end_file_name|><|fim▁begin|>from django.core.exceptions import PermissionDenied from core.models import Author, Editor def copy_author_to_submission(user, book): author = Author( first_name=user.first_name, middle_name=user.profile.middle_name, last_name=user.last_n...
book.author.add(author) return author
<|file_name|>bitcoin_sk.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="sk" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About stripecoin</source> ...
<translation>Poslať Litecoins</translation> </message> <message>
<|file_name|>keyword-trait-as-identifier.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or<|fim▁hole|>/...
<|file_name|>filter.py<|end_file_name|><|fim▁begin|>import os import shutil import unittest import copy from nvpy.nvpy import Config from nvpy.notes_db import NotesDB notes = { '1': { 'modifydate': 1111111222, 'tags': [], 'createdate': 1111111111, 'syncdate': 0, 'content': '...
self.assertEqual(filtered_notes[0].note['content'], notes['3']['content']) self.assertEqual(match_regexp, '') # Should ignore for tag pattern self.assertEqual(active_notes, 3)
<|file_name|>body_test.go<|end_file_name|><|fim▁begin|>package middleware import ( "io" "net/http" "testing" "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/internal/testing/petstore" "github.com/stretchr/testify/assert" ) type eofReader struct { } func (r *eofReader) Read(b []byte) (int, error...
req.ContentLength = 1
<|file_name|>convection.cpp<|end_file_name|><|fim▁begin|>#include "convection.h" #include "sem.h" using namespace mnl; using namespace std; deformedConvectionEvaluator::deformedConvectionEvaluator(const basics::matrixStack& G, const basics::Matrix& D, const basics::Vector& weight, const basics::Field2<bas...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from . import errordocument from . import recursive<|fim▁hole|>from . import static<|fim▁end|>
<|file_name|>context_processors.py<|end_file_name|><|fim▁begin|><|fim▁hole|> def get_site_url(request, slash=False): domain = Site.objects.get_current().domain protocol = 'https' if request.is_secure() else 'http' root = "%s://%s" % (protocol, domain) if slash: root += '/' return root def...
# -*- coding: utf-8 -*- from django.contrib.sites.models import Site from django.conf import settings
<|file_name|>list_container.js<|end_file_name|><|fim▁begin|>// Copyright 2014 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 {assert, assertInstanceof, assertNotReached} from 'chrome://resources/js/assert.m.js'; ...
THUMBNAIL: 'thumb' }; /**
<|file_name|>bobserver.py<|end_file_name|><|fim▁begin|>import socketserver, os from configparser import ConfigParser """ Byte [1] = Action 255 items """ class BOBServer(socketserver.BaseRequestHandler): """ The request handler class for our server. It is instantiated once per connection to the server, a...
Let's setup the configuration """ config = loadConfigFile() HOST, PORT = config['server']['host'], config['server']['port']
<|file_name|>Text.js<|end_file_name|><|fim▁begin|>define(["require", "exports", '../../has', "../dom/form/Text"], function (require, exports, has) { var Text; if (has('host-browser')) { Text = require('../dom/form/Text'); } return Text;<|fim▁hole|><|fim▁end|>
}); //# sourceMappingURL=../../_debug/ui/form/Text.js.map
<|file_name|>TestOpenOrderImpl.java<|end_file_name|><|fim▁begin|>/* * The MIT License (MIT) * * Copyright (c) 2015 Gareth Jon Lynch * * 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 wi...
* subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all
<|file_name|>weakset_test.cpp<|end_file_name|><|fim▁begin|>#include "weakset_test.h" #include "weakset.h" CPPUNIT_TEST_SUITE_REGISTRATION(WeaksetTest); template <typename T> uint weak_set_size(weak_set<T>& w) { uint c = 0; for (typename weak_set<T>::iterator i = w.begin(); i != w.end(); ++i) { ++c; }...
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # RedPipe documentation build configuration file, created by # sphinx-quickstart on Wed Apr 19 13:22:45 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration valu...
] suppress_warnings = ['image.nonlocal_uri']
<|file_name|>ship-6-alien.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import pyglet from pyglet.gl import * from pyglet.window import key import math import random window = pyglet.window.Window(fullscreen=True) pyglet.resource.path.append('./images') pyglet.resource.reindex() center_x = int(window.width/2) ce...
# Update velocity if self[key.UP]: self.image = ship_image_on
<|file_name|>VoiceSend.java<|end_file_name|><|fim▁begin|>package com.yunpian.sdk.model; /** * Created by bingone on 15/11/8.<|fim▁hole|>public class VoiceSend extends BaseInfo { }<|fim▁end|>
*/
<|file_name|>client.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 ver...
result = _basic_request(url, headers=headers, timeout=timeout, limit=limit) if output == 'extended': response_headers = response.headers
<|file_name|>anonymity.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> F: Fn() { f(); } fn main() { let x = 7; // 捕获的 `x` 成为一个匿名类型并为它实现 `Fn`。 // 将它存储到 `print` 中。 let print = || println!("{}", x); apply(print); }<|fim▁end|>
// `F` 必须针对一个没有输入参数和返回值的闭包实现 `Fn` // —— 确切地讲是 `print` 要求的类型。 fn apply<F>(f: F) where
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import fetchopenfmri.fetch<|fim▁end|>
<|file_name|>osext.go<|end_file_name|><|fim▁begin|>// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Extensions to the standard "os" package. package osext // import "github.com/kardianos/osext" import "pat...
return "", err }
<|file_name|>treap_bst.py<|end_file_name|><|fim▁begin|># https://en.wikipedia.org/wiki/Treap import random import time class Treap: def __init__(self, key): self.key = key self.prio = random.randint(0, 1000000000) self.size = 1 self.left = None self.right = None def ...
left.right = merge(left.right, right) left.update() return left else:
<|file_name|>plot_montage.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ .. _plot_montage: Plotting sensor layouts of EEG systems ====================================== This example illustrates how to load all the EEG system montages shipped in MNE-python, and display it on fsaverage template. """ # noq...
<|file_name|>protractor.js<|end_file_name|><|fim▁begin|>var addressBar = element(by.css("#addressBar")), url = 'http://www.example.com/base/ratingList.html#!/path?a=b#h'; it("should show fake browser info on load", function(){ expect(addressBar.getAttribute('value')).toBe(url); expect(element(by.binding('$lo...
expect(element(by.binding('$location.hash()')).getText()).toBe(''); navigation.get(1).click();
<|file_name|>win_pkg.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- ''' :maintainer: HubbleStack :maturity: 2016.7.0 :platform: Windows :requires: SaltStack ''' from __future__ import absolute_import import copy import fnmatch import logging import salt.utils import salt.utils.platform from salt.exception...
for name, tag in item.iteritems(): tag_data = {} # Whitelist could have a dictionary, not a string
<|file_name|>cmp9.component.spec.ts<|end_file_name|><|fim▁begin|>import {NO_ERRORS_SCHEMA} from '@angular/core'; import {async, ComponentFixture, TestBed} from '@angular/core/testing'; import {ReactiveFormsModule} from '@angular/forms'; import {MatButtonModule, MatCardModule, MatInputModule, MatRadioModule, MatSelectMo...
import {Cmp9Component} from './cmp9.component';
<|file_name|>PublisherMapper.java<|end_file_name|><|fim▁begin|>package com.example.dao; import com.example.model.Publisher; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; import java.util.List;<|fim▁hole|>@Mapper public interface PublisherMapper { @Select("SELECT *, PHONE...
<|file_name|>instance_scarlet_monastery.cpp<|end_file_name|><|fim▁begin|>/** * ScriptDev2 is an extension for mangos providing enhanced features for * area triggers, creatures, game objects, instances, items, and spells beyond * the default database scripting in mangos. * * Copyright (C) 2006-2013 ScriptDev2 <htt...
return m_auiEncounter[0];
<|file_name|>table.go<|end_file_name|><|fim▁begin|>// generated by go run gen.go; DO NOT EDIT package publicsuffix const version = "publicsuffix.org's effective_tld_names.dat, hg revision e5572fc5c754 (2014-04-02)" const ( nodesBitsChildren = 9 nodesBitsICANN = 1 nodesBitsTextOffset = 15 nodesBitsTextLeng...
0x0be1b842, // n0x0054 c0x002f (n0x0415-n0x0419) + I cc 0x0c30b4c2, // n0x0055 c0x0030 (n0x0419-n0x041a) + I cd 0x00243546, // n0x0056 c0x0000 (---------------) + I center 0x0026f243, // n0x0057 c0x0000 (---------------) + I ceo
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import content from "./content.md"<|fim▁hole|> return content + image }<|fim▁end|>
import image from "./image.png" export default function() {
<|file_name|>test_event.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """Test events classes. This file is part of PyVISA. :copyright: 2019-2020 by PyVISA Authors, see AUTHORS for more details. :license: MIT, see LICENSE for more details. """ import logging import pytest from pyvisa import constants, err...
<|file_name|>__.js<|end_file_name|><|fim▁begin|>/** * A special placeholder value used to specify "gaps" within curried functions, * allowing partial application of any combination of arguments, * regardless of their positions. * * If `g` is a curried ternary function and `_` is `R.__`, the following are equivalen...
* - `g(_, 2)(1, 3)`
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # MicroPython documentation build configuration file, created by # sphinx-quickstart on Sun Sep 21 11:42:03 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all ...
# add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('.'))
<|file_name|>promi2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Author: csiu # Created: 2015-02-02 import argparse from ConfigParser import SafeConfigParser import sys import os from utils import get_value_from_keycolonvalue_list, ensure_dir, random_string import features import mirna_proximity import cor...
for line in f: line = line.strip()
<|file_name|>views_academico.py<|end_file_name|><|fim▁begin|># coding: utf-8 from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import UserPassesTestMixin from django.views.generic import ListView from django.views import View from django.db.models import Q import posgradmin.model...
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import type { FormatRelativeFn } from '../../../types' const formatRelativeLocale = { lastWeek: (date: Date): string => { const day = date.getUTCDay() switch (day) {<|fim▁hole|> return "'prejšnjo nedeljo ob' p" case 3: return "'prejšnjo...
case 0:
<|file_name|>GenerateUpdateLines.py<|end_file_name|><|fim▁begin|>import datetime def suffix(d): return 'th' if 11<=d<=13 else {1:'st',2:'nd',3:'rd'}.get(d%10, 'th') def custom_strftime(format, t): return t.strftime(format).replace('{S}', str(t.day) + suffix(t.day)) print "Welcome to GenerateUpdateLines, the...
start = int(raw_input("Enter initial day number: "))
<|file_name|>attr.rs<|end_file_name|><|fim▁begin|>use std::rc::Rc; use syntax::ast::{self, TokenTree}; use syntax::attr; use syntax::codemap::Span; use syntax::ext::base::ExtCtxt; use syntax::fold::Folder; use syntax::parse::parser::PathParsingMode; use syntax::parse::token::{self, InternedString}; use syntax::parse; u...
self.deserialize_with.as_ref() }
<|file_name|>unique_items.rs<|end_file_name|><|fim▁begin|>use serde_json::Value; use super::super::schema; use super::super::validators;<|fim▁hole|> fn compile(&self, def: &Value, ctx: &schema::WalkContext<'_>) -> super::KeywordResult { let uniq = keyword_key_exists!(def, "uniqueItems"); if uniq.is...
#[allow(missing_copy_implementations)] pub struct UniqueItems; impl super::Keyword for UniqueItems {
<|file_name|>LeftJoin.java<|end_file_name|><|fim▁begin|>/* * $Id: LeftJoin.java,v 1.2 2006/04/09 12:13:12 laddi Exp $ * Created on 5.10.2004 * * Copyright (C) 2004 Idega Software hf. All Rights Reserved. * * This software is the proprietary information of Idega hf. * Use is subject to license terms. */ package ...