prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>profile_analysis.py<|end_file_name|><|fim▁begin|>'''
The MIT License (MIT)
Copyright (c) 2016 Vasileios Kagklis
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 without restriction, i... | furnished to do so, subject to the following conditions:
|
<|file_name|>evec-slice.rs<|end_file_name|><|fim▁begin|>// run-pass
#![allow(unused_assignments)]
pub fn main() {
let x : &[isize] = &[1,2,3,4,5];
let mut z : &[isize] = &[1,2,3,4,5];
z = x;
assert_eq!(z[0], 1);
assert_eq!(z[4], 5);
let a : &[isize] = &[1,1,1,1,1];
let b : &[isize] = &[2,2... | |
<|file_name|>IQuoteDisplayProps.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>
export interface IQuoteDisplayProps {
quote: IQuotation;
}<|fim▁end|> | import { IQuotation } from '../../model/QuotationService/IQuotation'; |
<|file_name|>git.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
Tests for the Git state
'''
# Import python libs
from __future__ import absolute_import
import os
import shutil
import socket
import subprocess
import tempfile
# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath, ski... | ''' |
<|file_name|>unnecessary-private.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache... | |
<|file_name|>ui-input.ts<|end_file_name|><|fim▁begin|>import {AfterViewInit, Component, EventEmitter, Inject, Input, Optional} from '@angular/core';
import {NG_ASYNC_VALIDATORS, NG_VALIDATORS, NG_VALUE_ACCESSOR} from '@angular/forms';
import {ValidationService} from '../../core/services/validation.service';<|fim▁hole|>... | import {UIElementBase} from '../ui-element-base';
@Component({
selector: 'ui-input', |
<|file_name|>zone_silverpine_forest.cpp<|end_file_name|><|fim▁begin|>/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* 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... | } |
<|file_name|>test_create_dot_application.py<|end_file_name|><|fim▁begin|>"""
Tests the ``create_dot_application`` management command.
"""
from __future__ import absolute_import, unicode_literals
from django.core.management import call_command
from django.test import TestCase
from oauth2_provider.models import get_appl... | |
<|file_name|>hsd_inc_beh.py<|end_file_name|><|fim▁begin|>def hsd_inc_beh(rxd, txd):
'''|
| Specify the behavior, describe data processing; there is no notion
| of clock. Access the in/out interfaces via get() and append()
| methods. The "hsd_inc_beh" function does not return values.
|________'''
... | txd.append(data) |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='StaticPage',
... | 'verbose_name': 'static page',
},
bases=(models.Model,), |
<|file_name|>parser.rs<|end_file_name|><|fim▁begin|>use std::io::{IoError, IoErrorKind, IoResult, Reader};
use std::slice::bytes::{copy_memory, MutableByteVector};
#[cfg(test)]
use std::io::MemReader;
#[cfg(test)]
use std::str::Slice;
use message::{Message, MessageErr};
<|fim▁hole|> buffer: [u8, ..1024],
buffe... | #[experimental]
pub struct Parser<T: Reader> { |
<|file_name|>mem.rs<|end_file_name|><|fim▁begin|>// mem.rs
// AltOSRust
//
// Created by Daniel Seitz on 12/6/16
/*
#[no_mangle]
pub unsafe extern fn __aeabi_memclr4(dest: *mut u32, mut n: isize) {
while n > 0 {
n -= 1;
*dest.offset(n) = 0;
}
}
#[no_mangle]
// TODO: Implement this, right now we don't do a... | panic!("Don't Reallocate Memory yet!");
//if dest.offset(0) >= src.offset(len) |
<|file_name|>solveauxpow.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (c) 2014-2015 Daniel Kraft
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# CLI to solve an auxpow (or not) in regtest difficulty.
... |
# Mine the block.
|
<|file_name|>yaml_formatter.py<|end_file_name|><|fim▁begin|>from yaml import load_all
try:
from yaml import CLoader as Loader
except ImportError:
print("Using pure python YAML loader, it may be slow.")
from yaml import Loader
from iengine import IDocumentFormatter
__author__ = 'reyoung'<|fim▁hole|>class Y... | |
<|file_name|>person.js<|end_file_name|><|fim▁begin|>'use strict';
var assert = require('assert');
var resource = require('../resource');
<|fim▁hole|>exports.Person = resource.create('Person', {api: 'person', version: 2})
.extend({
flag: function(options){
return this.constructor.post('/people/' + this.id... | |
<|file_name|>urg_tracker.cpp<|end_file_name|><|fim▁begin|>#include <ros/ros.h>
#include <pthread.h>
#include <fstream>
#include <std_msgs/String.h>
#include <sensor_msgs/LaserScan.h>
#include <sensor_msgs/MultiEchoLaserScan.h>
#include <urg_c/urg_sensor.h>
#include <urg_c/urg_utils.h>
#include <visualization_msgs/Marke... |
if (ORIGIN_X < X && X < MAX_FIELD_X && ORIGIN_Y < Y && Y < MAX_FIELD_Y)
{ |
<|file_name|>test_mongodb.py<|end_file_name|><|fim▁begin|>"""Tests for mongodb backend
Authors:
* Min RK
"""
#-------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# t... | |
<|file_name|>doc_view_list.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*-
SQL = """select SQL_CALC_FOUND_ROWS * FROM doc_view order by `name` asc limit %(offset)d,%(limit)d ;"""
FOUND_ROWS = True
ROOT = "doc_view_list"
ROOT_PREFIX = "<doc_view_edit />"
ROOT_POSTFIX= None
XSL_TEMPLATE = "data/af-web.xsl"
EVENT =... | PARAM = None
TITLE="Список видов документов"
MESSAGE="ошибка получения списка видов документов" |
<|file_name|>CurrencyModel.java<|end_file_name|><|fim▁begin|>/*
You may freely copy, distribute, modify and use this class as long
as the original author attribution remains intact. See message
below.
Copyright (C) 1998-2006 Christian Pesch. All Rights Reserved.
*/
package slash.carcosts;
import slash.gui.m... | |
<|file_name|>htmlframeelement.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::utils::{DOMString, null_string, E... | |
<|file_name|>hashing.py<|end_file_name|><|fim▁begin|>import hashlib
from typing import BinaryIO
def get_fp_sha256(fp: BinaryIO) -> str:
"""
Get the SHA-256 checksum of the data in the file `fp`.
<|fim▁hole|> while True:
chunk = fp.read(524288)
if not chunk:
break
hasher.... | :return: hex string
"""
fp.seek(0)
hasher = hashlib.sha256() |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>"""
"""
from django.core.urlresolvers import reverse
from django.test import TestCase
from wagtail.tests.utils import WagtailTestUtils
class BaseTestIndexView(TestCase, WagtailTestUtils):
"""
Base test case for CRUD index view.
"""
url_namespace =... | ) |
<|file_name|>SoapProviderTest.java<|end_file_name|><|fim▁begin|>/*
Copyright 2018 Nationale-Nederlanden
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/lice... | webServiceContext.getMessageContext().clear();
assertEquals(value, SOAPProvider.getSession().get("SOAPAction"));
}
|
<|file_name|>js.js<|end_file_name|><|fim▁begin|>$(document).ready(function(){
$('.service-wrapper img').hover(
function(){
$(this).animate({'width':'100px'});
//$(this).next().css({'display':'none'});<|fim▁hole|> $(this).animate({'width':'50px'});
... | },
function(){ |
<|file_name|>Matches.java<|end_file_name|><|fim▁begin|>/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package builtin.matcher;
import builtin.BuiltinSub;
import gui.Constants;
import gui.MintException;
import gui.Pointer;
import gui.PointerTools;
import gui.SmartLis... | // less character.
if (nextChars.contains("" + c)) {
return DECREMENT_THIS;
} else { |
<|file_name|>lan_access.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
from bottle import route, run
@route("/")
<|fim▁hole|># hostデフォルト値は、127.0.0.1
# OK - localhost / 127.0.0.1
# NG - 192.168.0.10 / hostname
# run(port=8080, debug=True, reloader=True)
# run(host="localhost", port=8080, debug=True, rel... | def access():
return "OK!"
|
<|file_name|>union_scan_test.go<|end_file_name|><|fim▁begin|>// Copyright 2016 PingCAP, Inc.
//<|fim▁hole|>// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License f... | // 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
// |
<|file_name|>combined_gene_table.py<|end_file_name|><|fim▁begin|>"""
For a detailed gene table and a summary gene table
"""
<|fim▁hole|>
filename = 'detailed_gene_table_v75'
detailed_out = open(filename, 'w')
file = 'summary_gene_table_v75'
summary_out = open(file, 'w')
# write out files for detailed and summary gen... | #!/usr/bin/env python
from collections import defaultdict |
<|file_name|>sg_AbstractSliceComponent.cpp<|end_file_name|><|fim▁begin|>/*
This file is part of SpatGRIS.
Developers: Samuel Béland, Olivier Bélanger, Nicolas Masson
SpatGRIS 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 Soft... | {
JUCE_ASSERT_MESSAGE_THREAD;
|
<|file_name|>server.py<|end_file_name|><|fim▁begin|>"""Shared class to maintain Plex server instances."""
import logging
import ssl
import time
from urllib.parse import urlparse
from plexapi.client import PlexClient
from plexapi.exceptions import BadRequest, NotFound, Unauthorized
import plexapi.myplex
import plexapi.... | client = self._client_device_cache[plextv_client.clientIdentifier]
if client is not None:
process_device("plex.tv", client)
elif plextv_client.clientIdentifier not in available_clients: |
<|file_name|>default.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Django settings for app-framework project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and thei... | except:
pass
|
<|file_name|>test.py<|end_file_name|><|fim▁begin|>#Unused
def fail():
for t in [TypeA, TypeB]:
x = TypeA()
run_test(x)
#OK by name
def OK1(seq):
for _ in seq:
do_something()
print("Hi")
#OK counting
def OK2(seq):
i = 3
for x in seq:
i += 1
return i
#OK chec... | def __init__(self):
self.attr = self.cls_attr
|
<|file_name|>auth.guard.ts<|end_file_name|><|fim▁begin|>import {Injectable} from "@angular/core";
import {CanActivate, Router, ActivatedRouteSnapshot, RouterStateSnapshot} from "@angular/router";
import {Observable} from "rxjs";
import {UserService} from "../user/user.service";
@Injectable()
export class AuthGuard imp... | this.router.navigate(['login']);
return false; |
<|file_name|>test_thresholding.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy.testing import (assert_equal,
assert_almost_equal,
assert_raises)
import skimage
from skimage import data
from skimage._shared._warnings import expected_warnings
from skima... | threshold = threshold_minimum(camera)
assert threshold == 76
|
<|file_name|>ilwiscoordinatesystem.cpp<|end_file_name|><|fim▁begin|>/******************************************************************************
*
* Purpose: Translation from ILWIS coordinate system information.
* Author: Lichun Wang, lichun@itc.nl
*
***********************************************************... | |
<|file_name|>MockConnector.py<|end_file_name|><|fim▁begin|>import time
import random
from cloudbrain.connectors.ConnectorInterface import Connector
from cloudbrain.utils.metadata_info import get_num_channels
class MockConnector(Connector):
def __init__(self, publishers, buffer_size, device_name, device_port=... |
while 1:
for data_generator in self.data_generators: |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![feature(globs)] //Enable experimental glob import
extern crate native;
extern crate gl;
extern crate glfw;
use gl::types::*;
use glfw::Context;
use std::mem;
use std::ptr;
use std::str;
static VERTEX_DATA: [GLfloat, ..12] = [
-0.5, 0.5,
0.5, 0.5,
-0.5,... | // Fail on error |
<|file_name|>ast.py<|end_file_name|><|fim▁begin|>"""
Franca abstract syntax tree representation.
"""
from abc import ABCMeta
from collections import OrderedDict
class ASTException(Exception):
def __init__(self, message):
super(ASTException, self).__init__()
self.message = message
def __str_... | class IntegerValue(Value):
BINARY = 2 |
<|file_name|>projects.py<|end_file_name|><|fim▁begin|># Copyright 2017, Fabien Boucher
# Copyright 2017, Red Hat
#
# 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.... | 'tags': projects_index.get_tags()}
@expose('json') |
<|file_name|>package-info.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 to You under ... | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. |
<|file_name|>ex0408.cpp<|end_file_name|><|fim▁begin|>// Example 4-8: Using continue in a loop.
#include <cmath>
#include <iostream>
#include <istream>
#include <limits>
#include <ostream>
using namespace std;
int main(int argc, char *argv[]){
while(true) {
cout << "Enter a number: ";
double x;<|fim▁hole|> ... | cin >> x;
if (cin.eof() || cin.bad())
// Input error: exit.
break; |
<|file_name|>ujson_fuzzer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# Copyright 2020 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/licens... | |
<|file_name|>isobox.js<|end_file_name|><|fim▁begin|>define(function() {
return {
draw: function(context, t) {
var x = this.getNumber("x", t, 100),
y = this.getNumber("y", t, 100),
size = this.getNumber("size", t, 60),
h = this.getNumber("h", t, 40),
colorLeft = this.getColor("colorLeft",... | this.drawFillAndStroke(context, t, true, false);
|
<|file_name|>test108.js<|end_file_name|><|fim▁begin|>//
// tselect01.js
// Test for select
//
if(typeof exports === 'object') {
var assert = require("assert");
var alasql = require('..');
};
describe('Create database', function(){
it('Create new database', function(done) {
<|fim▁hole|> done();
}... | var db = new alasql.Database();
assert.deepEqual(db.tables, {});
|
<|file_name|>protocol_test.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// th... | bytes, err := rlp.EncodeToBytes(tt.packet)
if err != nil && !tt.fail {
t.Fatalf("test %d: failed to encode packet: %v", i, err)
} else if err == nil && tt.fail { |
<|file_name|>vpinsrb.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
fn vpinsrb_1() {
run_test(&Instruction { mnemonic: Mnemonic::VPINSRB,... | |
<|file_name|>Union.js<|end_file_name|><|fim▁begin|>function Component(type,id,uri,name,query,inputList,x,y) {
// this.code = code;
// this.type = type;
this.componentId = id;
this.uri = uri;
this.name = name;
this.query = query;
this.inputList = inputList;
this.x = x;
this.y = y;
};
Component.protot... |
var label = document.createElement("label");
label.setAttribute("class","activeimg");
var br = document.createElement("br");
|
<|file_name|>smallints.rs<|end_file_name|><|fim▁begin|>// Copyright 2014-2016 Johannes Köster.
// Licensed under the MIT license (http://opensource.org/licenses/MIT)
// This file may not be copied, modified, or distributed
// except according to those terms.
//! A data structure for a sequence of small integers with a... | B: Integer + NumCast + Copy,
<S as Num>::FromStrRadixErr: 'a,
<B as Num>::FromStrRadixErr: 'a, |
<|file_name|>google-apps-script.mail.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for Google Apps Script 2017-05-12
// Project: https://developers.google.com/apps-script/
// Definitions by: motemen <https://github.com/motemen/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference ... | * request from a user than MailApp scripts.
*/
export interface MailApp { |
<|file_name|>FrontendCommandHandler.js<|end_file_name|><|fim▁begin|>var debugProtocol = require('debug')('node-inspector:protocol:devtools');
var RuntimeAgent = require('./RuntimeAgent').RuntimeAgent,
PageAgent = require('./PageAgent').PageAgent,
NetworkAgent = require('./NetworkAgent').NetworkAgent,
DebuggerAge... | this._handleMethodResult(
requestId,
fullMethodName, |
<|file_name|>FunctionRecompileTest.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
* ... | |
<|file_name|>type_resolver.rs<|end_file_name|><|fim▁begin|>use std::iter;
use crate::model;
use crate::model::WithLoc;
use crate::protobuf_path::ProtobufPath;
use crate::pure::convert::WithFullName;
use crate::FileDescriptorPair;
use crate::ProtobufAbsPath;
use crate::ProtobufAbsPathRef;
use crate::ProtobufIdent;
use ... | }
Err(TypeResolverError::NotFoundByRelPath(name.clone(), scope.to_owned()).into()) |
<|file_name|>details_en.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>Details</name>
<message>
<location filename="../../details/src/details.cpp" line="19"/>
<source>Astronomic data</source>
<trans... | <location filename="../../details/src/details.cpp" line="27"/>
<location filename="../../details/src/details.cpp" line="28"/>
<source>Select a planet</source>
<translation type="unfinished"></translation> |
<|file_name|>ShopService.java<|end_file_name|><|fim▁begin|>package cn.springmvc.service;
<|fim▁hole|>}<|fim▁end|> | public interface ShopService {
|
<|file_name|>window.rs<|end_file_name|><|fim▁begin|>use std::collections::vec_deque::IntoIter as VecDequeIter;
use std::default::Default;
use Api;
use BuilderAttribs;
use ContextError;
use CreationError;
use CursorState;
use Event;
use GlContext;
use GlProfile;
use GlRequest;
use MouseCursor;
use PixelFormat;
use Robu... | self.attribs.stereoscopy = true;
self |
<|file_name|>solution.py<|end_file_name|><|fim▁begin|>class Solution(object):
def letterCombinations(self, digits):
"""
:type digits: str
:rtype: List[str]
"""
def fill(n):
if n == l:
result.append(''.join(combination))
return
... | for c in cs: |
<|file_name|>InstructorFeedbackSubmissionEditSaveActionTest.java<|end_file_name|><|fim▁begin|>package teammates.test.cases.action;
import org.testng.annotations.Test;
import teammates.common.datatransfer.DataBundle;
import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes;
import teammates.common.da... | |
<|file_name|>population_server.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from math import pi
from bokeh.client import push_session
from bokeh.document import Document
from bokeh.models.glyphs import Line, Quad
from bokeh.models import (
Plot, ColumnDataSource, DataRange1d, FactorRange,... | |
<|file_name|>update_general.py<|end_file_name|><|fim▁begin|># import libraries
import urllib.request
from feedgen.feed import FeedGenerator
from post_parser import post_title, post_author, post_time, post_files_num
from misc import is_number
# info
baseurl = 'http://phya.snu.ac.kr/xe/underbbs/'
url ='http://phya.snu.a... | num_notices = f.read().split(',')
f.close() |
<|file_name|>main.js<|end_file_name|><|fim▁begin|><|fim▁hole|>document.body.appendChild(Demo1());<|fim▁end|> | let Demo1 = require('./components/demo1.js');
|
<|file_name|>test_iot_hub.py<|end_file_name|><|fim▁begin|># Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from ..azure_common import BaseTest, arm_template
class IoTHubTest(BaseTest):
def setUp(self):
super(IoTHubTest, self).setUp()<|fim▁hole|> p = self.load_polic... |
def test_iot_hub_schema_validate(self):
with self.sign_out_patch(): |
<|file_name|>line_displaced.py<|end_file_name|><|fim▁begin|>from chiplotle.geometry.shapes.path import path
from chiplotle.geometry.transforms.perpendicular_displace \
import perpendicular_displace
def line_displaced(start_coord, end_coord, displacements):
'''Returns a Path defined as a line spanning points `s... | '''
p = path([start_coord, end_coord])
perpendicular_displace(p, displacements) |
<|file_name|>DdsDcpsInfoUtilsTypeSupportImpl.cpp<|end_file_name|><|fim▁begin|>/* Generated by ../bin/opendds_idl version 3.6 (ACE version 6.2a_p7) running on input file DdsDcpsInfoUtils.idl*/
#include "DCPS/DdsDcps_pch.h"
#include "DdsDcpsInfoUtilsTypeSupportImpl.h"
#include <cstring>
#include <stdexcept>
#include "dd... | |
<|file_name|>ProcessableHandlerInterface.d.ts<|end_file_name|><|fim▁begin|>declare namespace Jymfony.Component.Logger.Handler {
export class ProcessableHandlerInterface {
public static readonly definition: Newable<ProcessableHandlerInterface>;
/**
* Adds a processor in the stack.
... | * Removes the processor on top of the stack and returns it.
*
* @throws {Jymfony.Component.Logger.Exception.LogicException} In case the processor stack is empty |
<|file_name|>black_lies_bitmap_test.go<|end_file_name|><|fim▁begin|>package dnssec
import (
"testing"
"time"
"github.com/coredns/coredns/plugin/test"
"github.com/coredns/coredns/request"
"github.com/miekg/dns"
)
const server = "dns//."
func TestBlackLiesBitmapNoData(t *testing.T) {
d, rm1, rm2 := newDnssec(t... | defer rm1()
defer rm2()
|
<|file_name|>default.go<|end_file_name|><|fim▁begin|>/*
Copyright 2021 The Knative 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 req... |
// NewDefault will return a default SUT for this repo.
func NewDefault() SystemUnderTest { |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use failure::Error;
<|fim▁hole|>pub type Result<T> = std::result::Result<T, Error>;<|fim▁end|> | |
<|file_name|>MyInterceptor.java<|end_file_name|><|fim▁begin|>package com.lagnada.demo.cxfrest.rest;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Message;<|fim▁hole|>import java.security.Principal;
public class MyInterceptor extends AbstractPhaseInterceptor<Message> {
public MyIntercepto... | import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;
import org.apache.cxf.security.SecurityContext;
|
<|file_name|>stbt_run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
"""
Copyright 2012-2013 YouView TV Ltd.
2014-2017 stb-tester.com Ltd.
License: LGPL v2.1 or (at your option) any later version (see
https://github.com/stb-tester/stb-tester/blob/master/LICENSE for details).
"""
import argparse
import s... | sane_unicode_and_exception_handling, video)
|
<|file_name|>test_program_code.py<|end_file_name|><|fim▁begin|># Copyright (c) 2018 PaddlePaddle 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:/... | if __name__ == "__main__":
unittest.main() |
<|file_name|>digital_ocean_account_facts.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __fut... | data:
description: DigitalOcean account facts
returned: success |
<|file_name|>test_Cursor.py<|end_file_name|><|fim▁begin|>import pytest
from py4jdbc.dbapi2 import connect, Connection
from py4jdbc.resultset import ResultSet
from py4jdbc.exceptions.dbapi2 import Error
def test_connect(gateway):
url = "jdbc:derby:memory:testdb;create=true"
conn = connect(url, gateway=gateway... | '''Assert all rows of result set have the correct class.
''' |
<|file_name|>pat.rs<|end_file_name|><|fim▁begin|>extern crate std;
#[derive(Debug)]
pub struct ProgramAssociationTable {
pub table_id: u8,
pub transport_stream_id: u16,
pub version_number: u8,
pub current_next_indicator: bool,
pub section_number: u8,
pub last_section_number: u8,
pub program... | })
} |
<|file_name|>aggregated_error_rates.rs<|end_file_name|><|fim▁begin|>use crate::log_parser::log_events::HttpError;
use crate::request_response_matcher;
use crate::log_parser::*;
#[derive(PartialEq, Debug, Clone)]
pub struct ErrorRatesResult {
pub client_error_4xx: f32,
pub server_error_5xx: f32,
}
pub trait Ht... | impl HttpErrorState for String {
fn error(&self) -> Option<HttpError> { |
<|file_name|>namespace.rs<|end_file_name|><|fim▁begin|>//! Contains namespace manipulation types and functions.
use std::iter::{Map, Rev};
use std::collections::btree_map::{BTreeMap, Entry};
use std::collections::btree_map::Iter as Entries;
use std::collections::HashSet;
use std::slice::Iter;
/// Designates prefix fo... | ///
/// This method does not override a mapping in the topmost namespace if it is
/// already present, however, it does not depend on other namespaces in the stack,
/// so it is possible to put a mapping which is present in lower namespaces. |
<|file_name|>heuristic-instructions.py<|end_file_name|><|fim▁begin|>import wasp
def onConflict():
"""
Optional.
A conflict happened during the solving
"""
pass
def onDeletion():
"""
Optional.
The method for deleting clauses is invoked.
"""
pass
def onLearningClause(lbd, size, ... | """ |
<|file_name|>htmlsourceelement.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::HTMLSourceEle... | self.htmlelement.reflector()
}
} |
<|file_name|>test_rich_string01.py<|end_file_name|><|fim▁begin|>###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Wor... |
""" |
<|file_name|>user_service.go<|end_file_name|><|fim▁begin|>//scgen
package service
const (
user_info = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=%s&openid=%s&lang=zh_CN"
)<|fim▁hole|>
}<|fim▁end|> |
func UserInfo(userid, openid string) { |
<|file_name|>stage.ts<|end_file_name|><|fim▁begin|>'use strict';
import { Class, Instance, isInstanceOf } from 'immutable-class';
export interface MarinParameters {
left?: number;
right?: number;
top?: number;
bottom?: number;
}
<|fim▁hole|> y: number;
width: number;
height: number;
}
// ToDo: make this... | export interface StageValue {
x: number; |
<|file_name|>measure_values.ts<|end_file_name|><|fim▁begin|>import {Date, DateWrapper} from 'angular2/src/facade/lang';
import {Map} from 'angular2/src/facade/collection';
export class MeasureValues {
constructor(public runIndex: number, public timeStamp: Date,
public values: {[key: string]: any}) {}
... | }
} |
<|file_name|>less-than.js<|end_file_name|><|fim▁begin|>function lessThan (a, b) {<|fim▁hole|>}
function main () {
for (var i = 0; i < 10000; i++) {
lessThan(1, 0x7fffffff)
}
for (var i = 0; i < 10000; i++) {
lessThan(1, Infinity)
}
for (var i = 0; i < 10000; i++) {
lessTha... | return a < b |
<|file_name|>test_functionalAggregator.py<|end_file_name|><|fim▁begin|>from bzt.modules.functional import FunctionalAggregator, FunctionalAggregatorListener, FunctionalSample
from tests import BZTestCase
from tests.mocks import MockFunctionalReader
class MockListener(FunctionalAggregatorListener):
def __init__(s... | error_msg=None, error_trace=None, extras=None), |
<|file_name|>scanner_test.rs<|end_file_name|><|fim▁begin|>extern crate ers;
use std::io::BufferedReader;
use std::io::fs::File;
use std::str::eq;
use ers::{Scanner};
fn fail_with_file(path : ~str) {
let mut buf = ~BufferedReader::new(File::open(&Path::new(path.clone()))) as ~Buffer;
let input = buf.read_to_st... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod types;
pub mod utils;
use crate::metrics::SizeStats;
use crate::error::*;
use std::sync::Arc;
use parking_lot::RwLock;
use std::ops::{
DerefMut,
Deref
};
use bytes::BytesMut;
use redis_protocol::encode::encode_bytes;
use redis_protocol::decode::decode_byt... |
pub fn new(name: String, req_size_stats: Arc<RwLock<SizeStats>>, res_size_stats: Arc<RwLock<SizeStats>>) -> Self { |
<|file_name|>SocketChannel.py<|end_file_name|><|fim▁begin|>import socket
import struct
import sys
from time import sleep
import logging
class SocketChannelFactory():
'''
Provides method to create channel connection.
'''
def openChannel(self, host, port):
try:
sock = socket.socket(socket.AF_... | Write a byte stream message to the channel.
The message will be prepended by its length packed
in 4 bytes in Big Endian.
|
<|file_name|>winsock.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.apache.org/license... | pub type WSAEVENT = libc::HANDLE;
#[repr(C)] |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Models for Credit Eligibility for courses.
Credit courses allow students to receive university credit for
successful completion of a course on EdX
"""
import datetime
from collections import defaultdict
import logging
import pytz
from d... | Args:
course_key (CourseKey): The identifier for a course
Keyword Arguments |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... | |
<|file_name|>line_and_point_2d_intersection.rs<|end_file_name|><|fim▁begin|>use collisions::shapes::Intersection;
use collisions::shapes::_2d::{Line2D, Point2D};
impl Intersection<Line2D> for Point2D {
type Output = Point2D;
fn intersection(&self, line: &Line2D) -> Option<Self::Output> {
let point = s... | line.as_ray().intersection(point).and_then(|intersection_point| { |
<|file_name|>udt.rs<|end_file_name|><|fim▁begin|>// #![feature(plugin)]
// #![plugin(clippy)]
extern crate cassandra_sys;
mod examples_util;
use examples_util::*;
use std::ffi::CString;
use std::mem;
use cassandra_sys::*;
fn insert_into_udt(session: &mut CassSession, schema_meta: &CassSchemaMeta, uuid_gen: &mut Cass... | let address = cass_user_type_new_from_data_type(udt_address);
let phone = cass_collection_new(CASS_COLLECTION_TYPE_SET, 2);
for i in 0..2 { |
<|file_name|>ChopperCommand.cpp<|end_file_name|><|fim▁begin|>/* *****************************************************************************
* The method lives() is based on Xitari's code, from Google Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Gene... | void ChopperCommandSettings::reset() {
m_reward = 0;
m_score = 0;
m_terminal = false; |
<|file_name|>vaffl.py<|end_file_name|><|fim▁begin|>import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--mat", type=str, help="mat file with observations X and side info", required=True)
parser.add_argument("--epochs", type=int, help="number of epochs", default = 2000)
parser.add_argument("--hs... | |
<|file_name|>Utils.ts<|end_file_name|><|fim▁begin|>///<reference path='../../typings/node/node.d.ts'/>
///<reference path='../../typings/underscore/underscore.d.ts'/>
import _ = require('underscore');
/**
* Utility functions for business rules purposes.
*
* + String functions
* + Number functions
*/
module Ut... | }
remove(listener: (parameter: T) => any): void {
var index = this.listeners.indexOf(listener); |
<|file_name|>vertica.py<|end_file_name|><|fim▁begin|>from collections import ChainMap
from py4jdbc.exceptions import dbapi2
exc_classes = ChainMap(sqlstate.exc_classes).new_child()
class _VCodeAgg(dbapi2.CodeAggregatorMeta):
exc_classes = exc_classes
class VerticaMultinodeError(dbapi2.DatabaseError, metaclas... | ('0L000', 'ERRCODE_INVALID_GRANTOR'),
('0LV01', 'ERRCODE_INVALID_GRANT_OPERATION'), |
<|file_name|>MultipleFields.java<|end_file_name|><|fim▁begin|>package com.latte.ui.recycler;
<|fim▁hole|> * Created by Administrator on 2017/9/18 0018.
*/
public enum MultipleFields {
ITEM_TYPE,
TITLE,
TEXT,
IMAGE_URL,
BANNERS,
SPAN_SIZE,
ID,
NAME,
TAG
}<|fim▁end|> | /** |
<|file_name|>states.client.config.js<|end_file_name|><|fim▁begin|>'use strict';
// Configuring the Articles module
angular.module('states').run(['Menus',
function(Menus) {<|fim▁hole|> Menus.addMenuItem('topbar', 'States', 'states', 'dropdown', '/states(/create)?');
Menus.addSubMenuItem('topbar', 'states', 'List St... | // Set top bar menu items |
<|file_name|>abc.js<|end_file_name|><|fim▁begin|>/**
* @namespace
* @description All general ABC methods and functionality should be placed within this namespace.
* @version 0.0.5 Jul 2014
* @author ABC Innovation
*
*/
var ABC = function() {
var includeLocations = [];
var onLoadFunctions =... | function getSubMenus() {
// need to check active stylesheet!
// don't get sub menus if handheld or iphone css
|
<|file_name|>2d.fillStyle.parse.hsl-clamp-4.worker.js<|end_file_name|><|fim▁begin|>// DO NOT EDIT! This test has been generated by tools/gentest.py.
// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsl-clamp-4
// Description:<|fim▁hole|>importScripts("/resources/testharness.js");
importScripts("/2dcontext/resourc... | // Note:<p class="notes">
|
<|file_name|>Unified-Canadian-Aboriginal-Syllabics-symbols.js<|end_file_name|><|fim▁begin|>// All symbols in the Unified Canadian Aboriginal Syllabics block as per Unicode v5.1.0:
[
'\u1400',
'\u1401',
'\u1402',
'\u1403',
'\u1404',
'\u1405',
'\u1406',
'\u1407',
'\u1408',
'\u1409',
'\u140A',
'\u140B',
'\u14... | '\u1444',
'\u1445', |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.