prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>test_client_server.py<|end_file_name|><|fim▁begin|>import pytest
<|fim▁hole|>class TestClientServer:
def test_server_port_property(self):
port = 1050
server = Server(port=port)
assert server.port == port
def test_client_addresses_property(self):
client = Client()
... | from zeroless import (Server, Client)
|
<|file_name|>vz-projector.ts<|end_file_name|><|fim▁begin|>/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licens... | private projectionsPanel: ProjectionsPanel; |
<|file_name|>dropout.py<|end_file_name|><|fim▁begin|>import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import sys<|fim▁hole|>have_data = os.path.exists('MNIST_data/train-images-idx3-ubyte.gz')
if not have_data:
download('./MNIST_data')
# load data
mnist = input_data.read_data_sets(... | sys.path.append('./MNIST_data')
import os.path
from download import download |
<|file_name|>operation.go<|end_file_name|><|fim▁begin|>package subscription
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause in... | // GetPreparer prepares the Get request.
func (client OperationClient) GetPreparer(ctx context.Context, operationID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"operationId": autorest.Encode("path", operationID), |
<|file_name|>ControllerMountSpyPlugin.ts<|end_file_name|><|fim▁begin|>import { PluginConfig, exportDependency, PluginConstructor } from '../../core/PluginConfig'
import { memoize } from 'lodash';
export type MountSpyCondition = (x: React.Component) => boolean
export interface MountSpyObserver {
condition: MountSpyC... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (c) 2016 Lyft 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,
# WITHOUT WAR... | # 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|>best_fitness.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Future
from __future__ import absolute_import, division, print_function, \
unicode_literals, with_statement
# Standard Library
from datetime import datetime
# Third Party
import matplotlib.pyplot as plt
from matplotlib import cm
f... | self.best_fitnesses.append(self.current_best.raw_values)
time_delta = datetime.now() - self.start_time
self.timestamps.append(time_delta.total_seconds()) |
<|file_name|>util-sha1.js<|end_file_name|><|fim▁begin|>/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* SHA-1 implementation in JavaScript (c) Chris Veness 2002-2014 / MIT Licence */
/* ... | |
<|file_name|>OOMPpart_RESE_0805_X_O202_01.py<|end_file_name|><|fim▁begin|>import OOMP
newPart = OOMP.oompItem(9439)
newPart.addTag("oompType", "RESE")
newPart.addTag("oompSize", "0805")
newPart.addTag("oompColor", "X")
newPart.addTag("oompDesc", "O202")<|fim▁hole|>newPart.addTag("oompIndex", "01")
OOMP.parts.append(n... | |
<|file_name|>OutFundTrans.java<|end_file_name|><|fim▁begin|>/* */ package com.hundsun.network.gates.houchao.biz.services.pojo;
/* */
/* */ import org.springframework.context.annotation.Scope;
/* */ import org.springframework.stereotype.Service;
/* */
/* */ @Service("outFundTrans")
/* */ @Sc... | /* */ }
/* */ }
|
<|file_name|>LanguageSettings.py<|end_file_name|><|fim▁begin|># The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the ... | self.box_sizer.Add(self.top_error, flag=wx.TOP|wx.LEFT|wx.RIGHT, border=SPACING)
# BUG add menu separator
# BUG change color of extra menu item
self.choice.Append(lang) |
<|file_name|>DotNet.java<|end_file_name|><|fim▁begin|>import java.security.Security;
import java.util.Base64;
import org.bouncycastle.crypto.BlockCipher;
import org.bouncycastle.crypto.BufferedBlockCipher;
import org.bouncycastle.crypto.engines.RijndaelEngine;
import org.bouncycastle.crypto.modes.CBCBlockCipher;
impor... | public class DotNet {
static byte[] buffer = new byte[] {
(byte)17, |
<|file_name|>extension.py<|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 Apache L... | |
<|file_name|>parserGenericsInVariableDeclaration1.ts<|end_file_name|><|fim▁begin|>var v : Foo<T> = 1;
var v : Foo<T>= 1;<|fim▁hole|>
var v : Foo<Bar<T>> = 1;
var v : Foo<Bar<T>>= 1;
var v : Foo<Bar<Quux<T>>> = 1;
var v : Foo<Bar<Quux<T>>>= 1;<|fim▁end|> | |
<|file_name|>web.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
pygments.lexers.web
~~~~~~~~~~~~~~~~~~~
Lexers for web-related languages and markup.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
try:
set
e... | For ActionScript source code. |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2012 Jens Hoffmann (hoffmaje)<|fim▁hole|># ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from django.db import models
from django.contrib.auth.models import User<|fim▁end|> | |
<|file_name|>memory.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import absolute_import
from apscheduler.jobstores.base import BaseJobStore, JobLookupError, ConflictingIdError
from apscheduler.util import datetime_to_utc_timestamp
class MemoryJobStore(BaseJobStore):
"""
Stores jobs in an a... | |
<|file_name|>addFilter.js<|end_file_name|><|fim▁begin|>var LedgerRequestHandler = require('../../helpers/ledgerRequestHandler');
/**
* @api {post} /gl/:LEDGER_ID/add-filter add filter
* @apiGroup Ledger.Utils
* @apiVersion v1.0.0
*
* @apiDescription
* Add a filter for caching balances. This will speed up balan... | 'excludingCounterparties': { type: 'string', required: true },
'excludingContraAccounts': { type: 'string', required: true },
'withCounterparties': { type: 'string' }
}, |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.management import call_command
from django.db import models, connections, transaction
from django.urls import reverse
from django_tenants.clone import CloneS... | verbosity=1):
"""
Creates the schema 'schema_name' for this tenant. Optionally checks if
the schema already exists before creating it. Returns true if the |
<|file_name|>presentation_availability_state.cc<|end_file_name|><|fim▁begin|>// Copyright 2017 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 "third_party/blink/renderer/modules/presentation/presentation_availa... |
if (screen_availability == mojom::blink::ScreenAvailability::DISABLED) {
for (auto& callback_ptr : listener->availability_callbacks) { |
<|file_name|>sessions.py<|end_file_name|><|fim▁begin|># Rekall Memory Forensics
#
# Copyright 2014 Google Inc. 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 by
# the Free Software Foundation; either versi... | definitions.Buffer(purpose="terminal_output",
context=entity.identity)] |
<|file_name|>MacroHelper.java<|end_file_name|><|fim▁begin|>package net.jloop.rejoice;
import net.jloop.rejoice.types.Symbol;<|fim▁hole|>import java.util.Iterator;
import java.util.List;
public class MacroHelper {
public static List<Value> collect(Env env, Iterator<Value> input, Symbol terminator) {
List<... | import net.jloop.rejoice.types.Type;
import java.util.ArrayList; |
<|file_name|>count_custom_vhs.py<|end_file_name|><|fim▁begin|>import os, sys
import json
import copy
import numpy as np
import random
from multiprocessing import Pool
import ipdb
################################################################################################
utils_path = os.path.join(os.path.dirname(o... | item["imports"].append(imp)
adjmatrix.append(item)
open(adj_name + '.json','w').write(json.dumps(adjmatrix,ensure_ascii=False, indent = 2)) |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># Copyright (c) 2017 Nick Gashkov
#
# Distributed under MIT License. See LICENSE file for details.
<|fim▁hole|>
class ValidationError(Exception):
def __init__(self, *args, **kwargs):
self.error_dict = kwargs.pop('error_dict')
super(ValidationEr... | |
<|file_name|>tica.py<|end_file_name|><|fim▁begin|># This file is part of PyEMMA.
#
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)
#
# PyEMMA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publish... | indim = iterable.dimension()
if not self.dim <= indim: |
<|file_name|>Solution.py<|end_file_name|><|fim▁begin|>"""
Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used.
Note:
All letters in hexadecimal (a-f) must be in lowercase.
The hexadecimal string must not contain extra leading 0s. If the number i... | def toHex(self, num):
"""
:type num: int
:rtype: str |
<|file_name|>upper_half.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::basic::unsigneds::PrimitiveUnsigned;
use malachite_base::num::conversion::traits::{JoinHalves, SplitInHalf};
use malachite_base_test_util::generators::unsigned_gen;
fn upper_half_test_helper<T: PrimitiveUnsigned + SplitInHalf>(n: T, out: ... | pub fn test_upper_half() { |
<|file_name|>test_arcgis_swm.py<|end_file_name|><|fim▁begin|>import unittest
import pysal
from pysal.core.IOHandlers.arcgis_swm import ArcGISSwmIO
import tempfile
import os
class test_ArcGISSwmIO(unittest.TestCase):
def setUp(self):
self.test_file = test_file = pysal.examples.get_path('ohio.swm')
... | |
<|file_name|>post_limit_checker.js<|end_file_name|><|fim▁begin|>//* TITLE Post Limit Checker **//
//* VERSION 0.2.1 **//
//* DESCRIPTION Are you close to the limit? **//
//* DETAILS Shows you how many posts you can reblog today. **//
//* DEVELOPER STUDIOXENIX **//
//* FRAME false **//
//* BETA false **//
XKit.extensio... | |
<|file_name|>regularizers.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apac... | The L2 regularization penalty is computed as
`loss = l2 * reduce_sum(square(x))`
|
<|file_name|>dictio.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#Covered by GPL V2.0
from encoders import *
from payloads import *<|fim▁hole|> def __init__(self,dicc=None):
if dicc:
self.__payload=dicc.getpayload()
self.__encoder=dicc.getencoder()
else:
self.__payload=payload()
self.__encoder =... |
# generate_dictio evolution
class dictionary: |
<|file_name|>captcha.py<|end_file_name|><|fim▁begin|>import os, requests, tempfile, time, webbrowser
import lacuna.bc
import lacuna.exceptions as err
### Dev notes:
### The tempfile containing the captcha image is not deleted until solveit()
### has been called.
###
### Allowing the tempfile to delete itself (dele... | delattr( self, 'guid' )
delattr( self, 'resp' ) |
<|file_name|>test_update_loyalty_program.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Talon.One API
The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, whi... |
import talon_one
from talon_one.models.update_loyalty_program import UpdateLoyaltyProgram # noqa: E501 |
<|file_name|>job.py<|end_file_name|><|fim▁begin|>from disco.core import Disco, result_iterator
from disco.settings import DiscoSettings
from disco.func import chain_reader
from discodex.objects import DataSet
from freequery.document import docparse
from freequery.document.docset import Docset
from freequery.index.tf_id... |
def __run_discodex_index(self, results):
opts = {
'parser': 'disco.func.chain_reader', |
<|file_name|>ContextImpl.java<|end_file_name|><|fim▁begin|>/*
************************************************************************
******************* CANADIAN ASTRONOMY DATA CENTRE *******************
************** CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
*
* (c) 2011. ... | |
<|file_name|>Test_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import os
import glob<|fim▁hole|>import cgi
import PrintPages_test as pt
address = cgi.escape(os.environ["REMOTE_ADDR"])
script = "Main Model Form"
pt.write_log_entry(script, address)
pt.print_header('GrowChinook', 'Std')
pt.print_full_form(None... | |
<|file_name|>parsetwo.py<|end_file_name|><|fim▁begin|>import sys
import os
def convbytes(bstr):
return str(buildint(bstr))
def buildint(bvals):
return int.from_bytes(bvals, byteorder='little')
def buildstr(bvals):
print(str(bvals))
#return str(bvals)
return bvals.decode("utf-8")
def getOutFile(i... | lival = buildint(bytes_read)
print("read size of type:"+str(lival)) |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use ffi::{SystemError, OPERATION_CANCELED};
use reactor::Reactor;
use core::{AsIoContext, IoContext, Perform, ThreadIoContext};
use std::cmp::Ordering;
use std::ops::{Deref, DerefMut};
use std::sync::Mutex;
use std::time::{Duration, Instant, SystemTime};
use libc::time... | _ => 0,
}
}
|
<|file_name|>build.js<|end_file_name|><|fim▁begin|>module.exports = require('./../make')({<|fim▁hole|><|fim▁end|> | build: true
}); |
<|file_name|>en-CA.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. 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
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/gu... | |
<|file_name|>test_multiprocessing.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
class TestMP:
def __init__(self,n):
self.n = n
@staticmethod
def worker(q):
"""worker function"""
# print('worker',*args)
# print("ppid= {} pid= {}".format(os.getppid(),os.getpid()))
q.put([... | from multiprocessing import Process,Queue
import os |
<|file_name|>parse_annotations.py<|end_file_name|><|fim▁begin|># annotation parser that processes our hashtags
import re
def get_abstracts(filename):
output = []
abstract_buffer = []
notes_buffer = []
last_abstract_no = 0
last_pmid = 0
last_biviewid = 0
with open(filename, 'rb') ... | output.append({"abstract": "\n".join(abstract_buffer),
"notes": notes_buffer})
|
<|file_name|>max_abs_scaler_example.py<|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<|fim▁hole|># (the "License"); you may not use this file except in compliance with
# the License. You may obt... | # this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0 |
<|file_name|>s3aaa.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
""" Authentication, Authorization, Accouting
@requires: U{B{I{gluon}} <http://web2py.com>}
@copyright: (c) 2010-2012 Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obt... | |
<|file_name|>processPrivatePage.ts<|end_file_name|><|fim▁begin|>import {contact} from './contact';
import {getGenderFromName} from './getGenderFromName';
import {normalizeFbLink as normalizeLink} from './normalizeLink';
import {eduwork} from './eduwork';
import {hometown} from './hometown';
import {bio} from './bio';
i... | }; |
<|file_name|>errors.rs<|end_file_name|><|fim▁begin|>use api::rpc::Error;
pub fn unauthenticated() -> Error {
Error {
code: 1,
message: "authentication is required for this request".to_owned(),
data: None,
}
}
pub fn already_authenticated() -> Error {
Error {
code: 2,<|fim▁h... | message: "client is already authenticated".to_owned(), |
<|file_name|>thermal_1_0_0_temperature.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
htt... | """ |
<|file_name|>session.py<|end_file_name|><|fim▁begin|>''' Wrapper around session access. Keep track of session madness as the app grows. '''
import logging
logger = logging.getLogger("pyfb")
FB_ACCESS_TOKEN = "fb_access_token"
FB_EXPIRES = "fb_expires"
FB_USER_ID = "fb_user_id"
def get_fb_access_token(request, warn=... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![feature(libc)]
#[macro_use]
extern crate bitflags;
extern crate time;
extern crate libc;
use libc::c_int;
use std::io;
pub mod epoll;
pub mod kqueue;
pub mod event;
pub mod select;
pub fn errno(rv: c_int) -> io::Result<()> {
if rv < 0 {
return Err(io:... | }
Ok(()) |
<|file_name|>LeaderServiceTask.java<|end_file_name|><|fim▁begin|>package com.bazaarvoice.emodb.common.dropwizard.leader;
import com.bazaarvoice.curator.recipes.leader.LeaderService;
import com.bazaarvoice.emodb.common.dropwizard.task.TaskRegistry;
import com.bazaarvoice.emodb.common.zookeeper.leader.PartitionedLeaderS... | return leaderService.getLeader().getId();
} catch (Exception e) { |
<|file_name|>vimeo.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import unicode_literals
import base64
import functools
import json
import re
import itertools
from .common import InfoExtractor
from ..compat import (
compat_kwargs,
compat_HTTPError,
compat_str,
compat_urlparse,
)
from... | }, {
'url': 'https://vimeo.com/ondemand/nazmaalik', |
<|file_name|>vif_driver.py<|end_file_name|><|fim▁begin|>from abc import abstractmethod
class VIFDriver(object):
@abstractmethod
def after_device_destroy(self, environ, domxml):
return domxml
<|fim▁hole|> @abstractmethod
def after_network_setup(self, environ, json_content):
return json_... | @abstractmethod
def after_device_create(self, environ, domxml):
return domxml
|
<|file_name|>Rect.js<|end_file_name|><|fim▁begin|>import PropTypes from 'prop-types';
import Element from './Element';
export default class Rect extends Element {
static displayName = 'Rect';
static propTypes = {
x: PropTypes.oneOfType([PropTypes.func, PropTypes.number]),
y: PropTypes.oneOfType([PropTyp... | |
<|file_name|>_reference_data_sets_operations.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license informati... | return cls(pipeline_response, deserialized, {})
return deserialized |
<|file_name|>datasource.test.js<|end_file_name|><|fim▁begin|>"use strict";
var mapnik = require('../');
var assert = require('assert');
var path = require('path');
mapnik.register_datasource(path.join(mapnik.settings.paths.input_plugins,'geojson.input'));
mapnik.register_datasource(path.join(mapnik.settings.paths.inp... | |
<|file_name|>false.rs<|end_file_name|><|fim▁begin|>// rustfmt-empty_item_single_line: false
// Empty impl on single line
impl Lorem {
}<|fim▁hole|>impl Ipsum {
}
fn lorem() {
}
fn lorem() {
}<|fim▁end|> | |
<|file_name|>encoding_support.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/. */
//! Parsing stylesheets from bytes (not `&str`).
ex... | |
<|file_name|>min_order_common.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Common design parameters for minimum order design methods
@author: Christian Muenker
"""
from __future__ import print_function, division, unicode_literals
#from importlib import import_module
<|fim▁hole|>class min_order_common(o... | #import filterbroker as fb
|
<|file_name|>DataProvider.java<|end_file_name|><|fim▁begin|>package by.bsuir.verkpavel.adb.data;
<|fim▁hole|>
import by.bsuir.verkpavel.adb.data.entity.Account;
import by.bsuir.verkpavel.adb.data.entity.Client;
import by.bsuir.verkpavel.adb.data.entity.Deposit;
import by.bsuir.verkpavel.adb.data.entity.TransactionsInfo... | import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ArrayList; |
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>module.exports = function(grunt) {
"use strict";
var jsFiles = ["Gruntfile.js", "src/**/*.js"];
var htmlfiles = ["src/view/todoList.html", "src/view/todoFooter.html", "src/view/todoCreater.html"];
grunt.initConfig({
jshint: {
all: jsFiles,
... | files: ["src/**/*.css"] |
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>module.exports = function(config) {
config.set({
basePath: './',
frameworks: ['systemjs', 'jasmine'],
systemjs: {
configFile: 'config.js',
config: {
paths: {
"*": null,
"src/*": "src/*",
"ty... | preprocessors: { },
reporters: ['progress'],
port: 9876,
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![allow(non_upper_case_globals)]
// External crates
#[macro_use]
extern crate clap;
extern crate num_cpus;
extern crate num;
extern crate time;
// External modules
use clap::App;
use num::complex::Complex64;
use time::{precise_time_ns};
// Rust modules
use std::fs::F... | try!(fs::create_dir("plot")); |
<|file_name|>react-tests.js<|end_file_name|><|fim▁begin|>/* eslint-env mocha */
const { expect } = chai;
import React from './React';
import TestUtils from './TestUtils';
describe('React components', () => {
it('should find valid xpath in react component', () => {
const component = TestUtils.renderIntoDocument(<... | });
}); |
<|file_name|>drop_rows_by_keywords.py<|end_file_name|><|fim▁begin|># vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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
#
# ... | <?xml version="1.0" encoding="UTF-8"?>
<NativeDicomModel xml:space="preserve">
<DicomAttribute keyword="FileMetaInformationVersion" tag="00020001" vr="OB"><InlineBinary>AAE=</InlineBinary></DicomAttribute>
<DicomAttribute keyword="MediaStorageSOPClassUID" tag="0002000... |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|># pylint: disable=redefined-outer-name
import os
import pytest
from pylint import checkers
from pylint.lint import PyLinter
# pylint: disable=no-name-in-module
from pylint.testutils import MinimalTestReporter
@pytest.fixture
def linter(checker, register, enable, ... | |
<|file_name|>interfaces.py<|end_file_name|><|fim▁begin|>import os
import time
from abc import abstractmethod, ABC
from typing import Dict, Tuple, List
from cereal import car
from common.kalman.simple_kalman import KF1D
from common.realtime import DT_CTRL
from selfdrive.car import gen_empty_fingerprint
from selfdrive.c... | class CarInterfaceBase(ABC):
def __init__(self, CP, CarController, CarState):
self.CP = CP
self.VM = VehicleModel(CP) |
<|file_name|>test_kinesis_cloudformation.py<|end_file_name|><|fim▁begin|>import boto3
import sure # noqa
from moto import mock_kinesis, mock_cloudformation
@mock_cloudformation
def test_kinesis_cloudformation_create_stream():
cf_conn = boto3.client("cloudformation", region_name="us-east-1")
stack_name = "M... | |
<|file_name|>integration.spec.ts<|end_file_name|><|fim▁begin|>// TODO: write a test that ensures that Quagga.decodeSingle returns a Promise when it should
// TODO: write a test that tests the multiple: true decoding option, allowing for multiple barcodes in
// a single image to be returned.
// TODO: write a test that a... | |
<|file_name|>commands.rs<|end_file_name|><|fim▁begin|>use river::River;
pub use river::PeekResult;
/// Push command - stateless
///
/// Used to push messages to rivers like this:
///
/// ```
/// john::PushCommand::new().execute("river_name", "message");
/// ```
pub struct PushCommand;
impl PushCommand {
/// Const... | /// Used to execute peek command, specifying a river name and optionally offset to peek at
pub fn execute(&self, river: &str, offset: Option < uint >) -> Option < PeekResult > { |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from pyramid.security import (
_get_authentication_policy
)
def my_get_authentication_policy(request):
# CRITICAL
# _get_authentication_policy(request)
# this method will return the instanciate singleton object that handle
# policy in pyramid app<... | # the policy object store keys from conf for generate token |
<|file_name|>CImageColorDef.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|>
#include <cstring>
bool
CImageColorDef::
getRGB(const std::string &name, double *r, double *g, double *b)
{
int ri, gi, bi;
if (! getRGBI(name, &ri, &gi, &bi))
return false;
double rgb_scale = 1.0/255.0;
*r = ri*rgb_scale;
*g = ... | #include <CImageLibI.h>
#include <CImageColorDefP.h> |
<|file_name|>parameter_server_strategy.py<|end_file_name|><|fim▁begin|># Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... | |
<|file_name|>website_bolt.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
class WebsiteBolt(ExtractorBolt):
name ='website_extractor'
def __init__(self):
ExtractorBolt.__init__(self)
self.extractor = ExtractWebsite()<|fim▁end|> | from extractors.extract_website import ExtractWebsite
from datawakestreams.extractors.extractor_bolt import ExtractorBolt |
<|file_name|>StaticMeshComponent.cpp<|end_file_name|><|fim▁begin|>
#include "Internal.hpp"
#include <LuminoEngine/Graphics/Texture.hpp>
#include <LuminoEngine/Rendering/Material.hpp>
#include <LuminoEngine/Mesh/Mesh.hpp>
#include <LuminoEngine/Visual/StaticMeshComponent.hpp>
namespace ln {
//=============... |
} // namespace ln |
<|file_name|>az_completer.py<|end_file_name|><|fim▁begin|># --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ----------... | |
<|file_name|>nytimes-scrape.py<|end_file_name|><|fim▁begin|>model_search = "http://api.nytimes.com/svc/search/v2/" + \
"articlesearch.response-format?" + \
"[q=search term&" + \
"fq=filter-field:(filter-term)&additional-params=values]" + \
"&api-key=9key"
"""http://api.n... | "&api-key=key"
precise_search = "http://api.nytimes.com/svc/search/v2/" + \ |
<|file_name|>raw.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 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/LI... | |
<|file_name|>util.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014, Salesforce.com, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the a... | scores = numpy.array(scores)
scores -= scores.max() |
<|file_name|>cotisations.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import division<|fim▁hole|>from openfisca_core import reforms
from openfisca_france.model.base import FloatCol, Individus, Variable
# Build function
def build_reform(tax_benefit_system):
Reform = reforms.make_reform... | |
<|file_name|>angular-cookies.js<|end_file_name|><|fim▁begin|>/**
* @license AngularJS v1.3.0-build.2690+sha.be7c02c
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, angular, undefined) {'use strict';
/**
* @ngdoc module
* @name ngCookies
* @description
*
* # ngCookies
*
... | |
<|file_name|>bootstrap.ts<|end_file_name|><|fim▁begin|>import {Component} from '@angular/core';<|fim▁hole|>@Component({selector: 'my-app', template: 'Hello {{ name }}!'})
class MyApp {
name: string = 'World';
}
function main() {
return bootstrap(MyApp);
}
// #enddocregion<|fim▁end|> | import {bootstrap} from '@angular/platform-browser';
// #docregion bootstrap |
<|file_name|>callback.rs<|end_file_name|><|fim▁begin|>use std::mem;
use std::ptr;
use std::cell::RefCell;
use std::sync::mpsc::Sender;
use std::sync::{Arc, Mutex};
use std::ffi::OsString;
use std::os::windows::ffi::OsStringExt;
use CursorState;
use Event;
use super::event;
use user32;
use shell32;
use winapi;
/// Th... | }, |
<|file_name|>VirtualMachineRestrictMovementState.java<|end_file_name|><|fim▁begin|>// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.avs.models;
import com.azure.core.util.Expand... |
/** @return known VirtualMachineRestrictMovementState values. */
public static Collection<VirtualMachineRestrictMovementState> values() { |
<|file_name|>che-clipboard.directive.ts<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015-2017 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* htt... | }
} |
<|file_name|>symmetric.go<|end_file_name|><|fim▁begin|>// Copyright ©2015 The gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package mat64
import (
"math"
"github.com/gonum/blas"
"github.com/gonum/blas/blas64"
"github.co... | // The returned matrix starts at {i,i} of the recevier and extends k-i rows |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
class Category(models.Model):
name = models.CharField(max_length=30)<|fim▁hole|> active = models.BooleanField(default=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=Tru... | |
<|file_name|>pos_session_opening.py<|end_file_name|><|fim▁begin|>from openerp.osv import osv, fields
from openerp.tools.translate import _
from openerp.addons.point_of_sale.point_of_sale import pos_session
class pos_session_opening(osv.osv_memory):
_name = 'pos.session.opening'
_columns = {
'pos_con... | |
<|file_name|>ImageLoaderProvider.java<|end_file_name|><|fim▁begin|>package com.mypodcasts.support.injection;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import javax.inject.Inject;
import javax.inject.Provider;
public class ImageLoaderProvider implements Provider<ImageLoade... | @Inject |
<|file_name|>util.go<|end_file_name|><|fim▁begin|>/**
* Copyright 2013 @ S1N1 Team.
* name :
* author : jarryliu
* date : 2014-02-03 23:18
* description :
* history :
*/
package ols
import (
"bytes"
"fmt"
"github.com/atnet/gof"
"go2o/src/core/domain/interface/enum"
"go2o/src/core/service/dps"
"html/templa... | "strings"
)
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use parser::span::parse_spans;
use parser::Block;
use parser::Block::Paragraph;
use parser::Span::{Break, Text};
mod atx_header;
mod blockquote;
mod code_block;
mod hr;
mod link_reference;
mod ordered_list;
mod setext_header;
mod unordered_list;
use self::atx_header::pa... | vec![CodeBlock(None, "this is code\nand this as well".to_owned())]
);
|
<|file_name|>include_bib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# file include_bib.py
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.
# authors Richard Heck and [SchAirport]
# Full author contact details are available in f... |
def InsertBib(fil, out):
''' Inserts the contents of the .bbl file instead of the bibliography in a new .tex file '''
|
<|file_name|>config.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public<|fim▁hole|># 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/.
from __future__ import absolute_i... | |
<|file_name|>FindNextHigherNumberWithSameDigits.py<|end_file_name|><|fim▁begin|>'''
Given a number, find the next higher number using only the digits in the given number.
For example if the given number is 1234, next higher number with same digits is 1243
'''
def FindNext(num):
number = str(num)
length = len(... | temp = sorted(number[i:])
Next = temp[temp.index(current)+1]
temp.remove(Next) |
<|file_name|>gh-subscribers-table.js<|end_file_name|><|fim▁begin|>define("ghost-admin/templates/components/gh-subscribers-table", ["exports"], function (exports) {
exports["default"] = Ember.HTMLBars.template((function () {
var child0 = (function () {
var child0 = (function () {
var child0 = (functi... | "source": null,
"start": { |
<|file_name|>OauthController.java<|end_file_name|><|fim▁begin|>package lab.springboot.authorization.controller;
import lab.springboot.authorization.config.SecurityProperties;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Mo... |
@Controller |
<|file_name|>physicsImpostor.ts<|end_file_name|><|fim▁begin|>import { Nullable, IndicesArray } from "../types";
import { Logger } from "../Misc/logger";
import { ArrayTools } from "../Misc/arrayTools";
import { Vector3, Matrix, Quaternion } from "../Maths/math.vector";
import { TransformNode } from "../Meshes/trans... | }
|
<|file_name|>PtReportHistoryQueryHelper.java<|end_file_name|><|fim▁begin|>package com.yh.hr.res.pt.queryhelper;
import com.yh.hr.res.pt.dto.PtReportHistoryDTO;
import com.yh.platform.core.dao.DaoUtil;
import com.yh.platform.core.exception.ServiceException;
import com.yh.platform.core.util.BeanHelper;
import org.apache... | public class PtReportHistoryQueryHelper {
|
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""
Application urlconfig
"""
from __future__ import absolute_import
from django.conf.urls import url
from . import views
urlpatterns = [
url(
r"^(?P<uuid>[0-9a-f-]{36})/$",
views.RateView.as_view(),
name="rate"<|fim▁hole|> ),
url(... | |
<|file_name|>Timer.presets.ts<|end_file_name|><|fim▁begin|>/**
* 프리셋 설정 폼 동작 구성
*/
const { ipcRenderer } = require('electron');
const { getConfig, setConfig } = require('./Timer');
export default () => {
const $presets = $('#presets');<|fim▁hole|> const $delete = $presets.find('.delete');
const $name = $... | const $presetDialog = $('#presetDialog');
const $edit = $presets.find('.edit');
const $new = $presets.find('.new'); |
<|file_name|>run.js<|end_file_name|><|fim▁begin|>/**<|fim▁hole|><|fim▁end|> | * Run the APP
*/
app.run(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.