prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>max-spec.ts<|end_file_name|><|fim▁begin|>import { expect } from 'chai';
import * as Rx from '../../src/internal/Rx';
import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing';
declare function asDiagram(arg: string): Function;
const Observable = Rx.Observable;
/** @tes... | const expected = '------- ';
expectObservable((<any>e1).max(), unsub).toBe(expected, { x: 42 });
expectSubscriptions(e1.subscriptions).toBe(subs); |
<|file_name|>lazy-chunk-1.js<|end_file_name|><|fim▁begin|>setTimeout(() => {
import(/* webpackPreload: true */ "./lazy-chunk-2.js").then((mod) =>
mod.test()
);<|fim▁hole|><|fim▁end|> | }, 750); |
<|file_name|>DialogClosedHandler.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 JBoss by Red Hat.
<|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 applic... | *
* Licensed under the Apache License, Version 2.0 (the "License");
|
<|file_name|>p215.py<|end_file_name|><|fim▁begin|>"""KDE of Temps."""
import calendar
from datetime import date, datetime
import pandas as pd
from pyiem.plot.util import fitbox
from pyiem.plot import figure
from pyiem.util import get_autoplot_context, get_sqlalchemy_conn
from pyiem.exceptions import NoDataFound
from m... | ("apr", "April"),
("may", "May"),
("jun", "June"),
("jul", "July"), |
<|file_name|>weibo_bash.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#coding:utf-8
__author__ = 'zhuzhezhe'
'''
功能实现:命令行下发布微博,获取最新微博
'''
from weibo import Client
import getopt
import sys
import configparser
versions = '0.1.5'
# 写入用户数据
def write_data(uname, pwd):
conf = configparser.ConfigParser()
... | else:
print('确保已完成登陆.请填写用户名和密码.')
|
<|file_name|>test_mp4.py<|end_file_name|><|fim▁begin|>import os
import shutil
import struct
from cStringIO import StringIO
from tempfile import mkstemp
from tests import TestCase, add
from mutagen.mp4 import MP4, Atom, Atoms, MP4Tags, MP4Info, \
delete, MP4Cover, MP4MetadataError
from mutagen._util import cdata
t... | fileobj = file(self.audio.filename, "rb+")
atoms = Atoms(fileobj)
fileobj.close() |
<|file_name|>max-depth.js<|end_file_name|><|fim▁begin|>/**
* @fileoverview Tests for max-depth.
* @author Ian Christian Myers
*/
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
var esli... | eslintTester.addRuleTest("lib/rules/max-depth", {
valid: [ |
<|file_name|>polyfill.js<|end_file_name|><|fim▁begin|>'use strict';<|fim▁hole|> , callable = require('es5-ext/object/valid-callable')
, d = require('d')
, ee = require('event-emitter')
, Symbol = require('es6-symbol')
, iterator = require('es6-iterator/valid-iterabl... |
var clear = require('es5-ext/array/#/clear')
, eIndexOf = require('es5-ext/array/#/e-index-of')
, setPrototypeOf = require('es5-ext/object/set-prototype-of') |
<|file_name|>PortCheckerPluginMock.py<|end_file_name|><|fim▁begin|>from random import randint
from yapsy.IPlugin import IPlugin
class PortCheckerPlugin(IPlugin):
"""
Mocked Version: Return random 0 or 1 as exit_code
<|fim▁hole|> a TCP connection to that port. Output is success 0 or failure > 0
... | Takes an ip address and a port as inputs and trys to make |
<|file_name|>import_star_definitions.py<|end_file_name|><|fim▁begin|>class Class(object):
pass
def func():<|fim▁hole|>CONSTANT = 42<|fim▁end|> | return 3.14
|
<|file_name|>opcode.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Manage JSON database of Micro-BESM opcodes.
#
import sys, json, codecs
# Check parameters.
if len(sys.argv) != 2:
print "Usage:"
print " opcode [option] file.json"
print "Options:"
print " TODO"
sys.exit(1)
opcode = []... | |
<|file_name|>jwt.go<|end_file_name|><|fim▁begin|>package util
import (
"net/http"
"github.com/dgrijalva/jwt-go"
"github.com/mb-dev/godo/config"
)
func JWTMiddleware(rw http.ResponseWriter, req *http.Request, next http.HandlerFunc) {
token, err := jwt.ParseFromRequest(req, func(token *jwt.Token) ([]byte, error... | }) |
<|file_name|>performance_timeline.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/. */
// XXX The spec says that the performance timeli... | }
impl TaskSource for PerformanceTimelineTaskSource {
fn queue_with_canceller<T>( |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod bodies;
pub mod starsystem;<|fim▁hole|>#[cfg(test)]
mod test;<|fim▁end|> | |
<|file_name|>flask_app.py<|end_file_name|><|fim▁begin|># Copyright 2019 Google LLC All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/... | # See the License for the specific language governing permissions and |
<|file_name|>isVATPayer.js<|end_file_name|><|fim▁begin|>import {TOGGLE_IS_VAT_PAYER} from '../actions';
export function isVATPayer(state = false, action) {
switch (action.type) {
case TOGGLE_IS_VAT_PAYER:
return !state;<|fim▁hole|><|fim▁end|> | default:
return state;
}
} |
<|file_name|>app.config.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import { EnvConfig } from '../../../tools/config/app.config'
export const ENV_CONFIG = new InjectionToken<EnvConfig>('app.config')<|fim▁end|> | import { InjectionToken } from '@angular/core' |
<|file_name|>countries-dropdown.ts<|end_file_name|><|fim▁begin|>import {PolymerElement, html} from '@polymer/polymer/polymer-element.js';
import {connect} from 'pwa-helpers/connect-mixin.js';
import {store, RootState} from '../../../store.js';
import '@unicef-polymer/etools-dropdown/etools-dropdown.js';
import EtoolsPa... | text-align: right;
line-height: 21px; /* for IE */ |
<|file_name|>epitopefinder_plotdistributioncomparison.py<|end_file_name|><|fim▁begin|>#!python
"""Script for plotting distributions of epitopes per site for two sets of sites.
Uses matplotlib. Designed to analyze output of epitopefinder_getepitopes.py.
Written by Jesse Bloom."""
import os
import sys
import random
... | raise IOError("Failed to find infile %s" % infilename)
d = epitopefinder.io.ParseInfile(open(infilename)) |
<|file_name|>lstm_layer.hpp<|end_file_name|><|fim▁begin|>//=======================================================================
// Copyright (c) 2014-2020 Baptiste Wicht
// Distributed under the terms of the MIT License.<|fim▁hole|>// http://opensource.org/licenses/MIT)
//===========================================... | // (See accompanying file LICENSE or copy at |
<|file_name|>bases.py<|end_file_name|><|fim▁begin|>import re
from functools import reduce
from typing import Optional, Callable, Any, Type, Union
import wx # type: ignore
from gooey.gui import formatters, events
from gooey.gui.util import wx_util
from gooey.python_bindings.types import FormField
from gooey.... | |
<|file_name|>Thumbnail.client.controller.js<|end_file_name|><|fim▁begin|>app.controller('ThumbnailCtrl', function($http, Upload, $timeout, $location, $anchorScroll, $stateParams, $cookies){
thumbnailCtrl = this;
thumbnailCtrl.sendEmail = function(){
$http.get('/api/sendEmail').success(function(response){
... | }); |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
function Square(props) {
return (
<button className="square" onClick={props.onClick}>
{props.value}
</button>
);
}
class Board extends React.Component {
renderSquare... | } |
<|file_name|>grammar2.py<|end_file_name|><|fim▁begin|>import re
from collections import OrderedDict
import compiler.lang as lang
doc_next = None
doc_prev_component = None
doc_root_component = None
class CustomParser(object):
def match(self, next):
raise Exception("Expression should implement match method")
escape... | parser.advance(len(term))
return sym
next = parser.maybe(kw_re) |
<|file_name|>defs.go<|end_file_name|><|fim▁begin|>package lib
// Various constants used throughout the tools.
const (
// ExitSuccess is the successful exit status.
//
// It should be called on successful exit.<|fim▁hole|> ExitSuccess = 0
// ExitFailure is the failing exit status.
ExitFailure = 1
)<|fim▁end|> | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
<|fim▁hole|><|fim▁end|> | from .formatting import ConditionalFormatting
from .rule import Rule |
<|file_name|>edxnotes.py<|end_file_name|><|fim▁begin|>"""
LMS edxnotes page
"""
from __future__ import absolute_import
from bok_choy.page_object import PageLoadError, PageObject, unguarded
from bok_choy.promise import BrokenPromise, EmptyPromise
from selenium.webdriver.common.action_chains import ActionChains
from co... |
Returns:
PageObject |
<|file_name|>StringScriptFieldRangeQuery.java<|end_file_name|><|fim▁begin|>/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
pa... |
@Override |
<|file_name|>editor.js<|end_file_name|><|fim▁begin|>// dependencies
define(['mvc/ui/ui-tabs', 'mvc/ui/ui-misc', 'mvc/ui/ui-portlet', 'utils/utils',
'plugin/models/chart', 'plugin/models/group',
'plugin/views/group', 'plugin/views/settings', 'plugin/views/types'],
function(Tabs, Ui, Portlet, Utils, C... | this.tabs.show(group.id); |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use std::error;
use std::fmt;
use std::io;
use std::result;
use std::sync;
#[cfg(all(feature = "ssl", not(any(target_os = "windows", target_os = "macos"))))]
use openssl::ssl::error::SslError;
#[cfg(all(feature = "ssl", target_os = "macos"))]
use security_framework::b... | ER_TOO_MANY_KEYS = 1069u16,
ER_TOO_MANY_KEY_PARTS = 1070u16,
ER_TOO_LONG_KEY = 1071u16, |
<|file_name|>scenarios.js<|end_file_name|><|fim▁begin|>describe('my app', function() {
it('should redirect `index.html` to `index.html#!/countries/countries', function() {
browser.get('index.html');
expect(browser.getLocationAbsUrl()).toBe('/home');
});
describe('home', function() {
beforeEach(funct... | query.sendKeys('Brunei');
element.all(by.css('.thumbDescription a')).first().click();
expect(browser.getLocationAbsUrl()).toBe('/countries/countries/BN'); |
<|file_name|>relay.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|>
class Relay(object):
_mcp23017_chip = {} # Conceivably, we could have up to 8 of these as there are a possibility of 8 MCP chips on a bus.
def __init__(self, mcp_pin, i2c_address=0x27):
"""
Initialize a relay... |
# A Raspberry Pi GPIO based relay device
import RPi.GPIO as GPIO
from common.adafruit.Adafruit_MCP230xx.Adafruit_MCP230xx import Adafruit_MCP230XX |
<|file_name|>IncorrectMultilineIndexException.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2010-2015, openHAB.org and others.
*
* 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, ... | |
<|file_name|>ui_lib.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# JewelCraft jewelry design toolkit for Blender.
# Copyright (C) 2015-2022 Mikhail Rachinskiy
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | # the Free Software Foundation, either version 3 of the License, or |
<|file_name|>accumulator_factory.rs<|end_file_name|><|fim▁begin|>use std::ops::Add;
pub fn accum<'a, T>(mut n: T) -> Box<FnMut(T) -> T + 'a>
where T: 'a + Add<T, Output=T> + Copy
{
Box::new(move |i: T| { n = n + i; n })
}
#[cfg(not(test))]
pub fn main() {
println!("{}", accumulate());
}
#[test]
pub fn te... |
fn accumulate() -> f32 {
// Deviation: works with all types implementing addition, but not a mixture
// of types (it is possible to handle mixed types, but would require type |
<|file_name|>issue-86465.rs<|end_file_name|><|fim▁begin|>#![feature(type_alias_impl_trait)]
<|fim▁hole|>
fn f<'t, 'u>(a: &'t u32, b: &'u u32) -> (X<'t, 'u>, X<'u, 't>) {
//~^ ERROR concrete type differs from previous defining opaque type use
(a, a)
}
fn main() {}<|fim▁end|> | type X<'a, 'b> = impl std::fmt::Debug; |
<|file_name|>application.js<|end_file_name|><|fim▁begin|>//= require wow
//= require formvalidation.min
//= require formvalidation/framework/bootstrap.min
//= require formvalidation/language/pt_BR<|fim▁hole|><|fim▁end|> | //= require_self
//= require_tree ./autoload |
<|file_name|>fetch_repos.py<|end_file_name|><|fim▁begin|>"""
To use this, create a settings.py file and make these variables:
TOKEN=<oath token for github>
ORG=<your org in github>
DEST=<Path to download to>
"""
from github import Github
from subprocess import call
import os
from settings import TOKEN, ORG, DEST
def... | os.chdir(DEST)
print "Downloading to destination: ", os.getcwd()
g = Github(TOKEN) |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>//! rzw specific error types
//!
//! These error type is compatible with the rust standard io `ErrorKind`.
pub type Result<T> = std::result::Result<T, Error>;
/// Categories of errors that can occur when interacting with z-Wave.
///
/// This list is intended to grow ... |
let kind = match ser_error.kind() {
serial::ErrorKind::NoDevice => ErrorKind::NoController,
serial::ErrorKind::InvalidInput => ErrorKind::InvalidInput, |
<|file_name|>review.py<|end_file_name|><|fim▁begin|># Part of Patient Flow.
# See LICENSE file for full copyright and licensing details.
from openerp.osv import orm, fields, osv
from openerp import SUPERUSER_ID
import logging
_logger = logging.getLogger(__name__)
class nh_etake_list_review(orm.Model):
_name = "n... | 'target': 'new',
'context': context |
<|file_name|>brspnd.rs<|end_file_name|><|fim▁begin|>#[doc = "Register `BRSPND[%s]` reader"]
pub struct R(crate::R<BRSPND_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<BRSPND_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<BRSPND_SPEC>> fo... | VALUE2 = 1, |
<|file_name|>getos.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# STARLING PROJECT
#
# LIRIS - Laboratoire d'InfoRmatique en Image et Systèmes d'information
#
# Copyright: 2012 - 2015 Eric Lombardi (eric.lombardi@liris.cnrs.fr), LIRIS (liris.cnrs.fr), CNRS (www.cnrs.fr)
#
#
# Thi... | # For further information, check the COPYING file distributed with this software.
#
#----------------------------------------------------------------------
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.enums import DBMS
from lib.core.settings import MAXDB_SYSTEM_DBS
from lib.core.unescaper import unescaper
f... | |
<|file_name|>function-call.rs<|end_file_name|><|fim▁begin|>// This test does not passed with gdb < 8.0. See #53497.
// min-gdb-version: 10.1
// compile-flags:-g
// === GDB TESTS ===================================================================================
// gdb-command:run
// gdb-command:print fun(45, true)
... | |
<|file_name|>const.py<|end_file_name|><|fim▁begin|>"""Define constants for the SimpliSafe component."""
from datetime import timedelta
DOMAIN = "simplisafe"<|fim▁hole|>DEFAULT_SCAN_INTERVAL = timedelta(seconds=30)
TOPIC_UPDATE = "update"<|fim▁end|> |
DATA_CLIENT = "client"
|
<|file_name|>parameters.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export { default } from 'ember-fhir/models/parameters'; |
<|file_name|>mpe.ts<|end_file_name|><|fim▁begin|>import { ModuleTitle, ModuleCode } from './modules';
export type MpePreference = {<|fim▁hole|> moduleType: '01' | '02' | '03' | '04';
};
export type MpeSubmission = {
nusExchangeId?: string;
intendedMCs: number;
preferences: Array<MpePreference>;
};
export type... | rank?: number;
moduleTitle?: ModuleTitle;
moduleCredits?: number;
moduleCode: ModuleCode; |
<|file_name|>tensor.rs<|end_file_name|><|fim▁begin|>// This file is generated by rust-protobuf 2.25.1. Do not edit
// @generated
// https://github.com/rust-lang/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy::all)]
#![allow(unused_attributes)]
#![cfg_attr(rustfmt, rustfmt::skip)]
#![allow(box_pointe... | }
if !self.double_val.is_empty() {
os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?; |
<|file_name|>SignupSpec.js<|end_file_name|><|fim▁begin|>// Copyright 2014 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apa... | $httpBackend.flush();
expect(scope.username).toBe('myUsername'); |
<|file_name|>it.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="it" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<source>About LMMS</source>
<translation>Informazioni su LMMS</translation>
</message>
<message>
<source>Version %1 (%2... | <source>Record while playing</source>
<translation>Registra in play</translation> |
<|file_name|>LibraryLoader.java<|end_file_name|><|fim▁begin|>// Copyright (c) 2014 blinkbox Entertainment Limited. All rights reserved.
package com.blinkboxbooks.android.list;
import android.content.Context;
import android.database.ContentObserver;
import android.database.Cursor;
import android.database.MergeCursor;
i... | |
<|file_name|>test-request.ts<|end_file_name|><|fim▁begin|>import {request} from 'mithril/request'
interface Result {
id: number
}
request<Result>({method: "GET", url: "/item"}).then(result => {
console.log(result.id)
})
request<{a: string}>("/item", {method: "POST"}).then(result => {
console.log(result.a)
})
req... | data: {x: "y"}
}).then(result => { |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# Database Module
# --------------------
from __future__ import unicode_literals
import warnings
import datetime
import frappe
import frappe.defaults
import frappe.... | return self.set_value(*args, **kwargs) |
<|file_name|>command_manager.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding=UTF-8
__author__ = "Pierre-Yves Langlois"
__copyright__ = "https://github.com/pylanglois/uwsa/blob/master/LICENCE"
__credits__ = ["Pierre-Yves Langlois"]
__license__ = "BSD"
__maintainer__ = "Pierre-Yves Langlois"
from uwsas.c... | where cmd in %s
""")
|
<|file_name|>newmessage.py<|end_file_name|><|fim▁begin|>'''u413 - an open-source BBS/transmit/PI-themed forum
Copyright (C) 2012 PiMaster
Copyright (C) 2012 EnKrypt<|fim▁hole|> (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even... |
This program 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 Foundation, either version 3 of the License, or |
<|file_name|>fract.rs<|end_file_name|><|fim▁begin|>#![feature(core, core_float)]
extern crate core;
#[cfg(test)]
mod tests {
use core::num::Float;
// impl Float for f32 {
// #[inline]
// fn nan() -> f32 { NAN }
//
// #[inline]
// fn infinity() -> f32 { INFINITY }
//
... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Defines the Weld abstract syntax tree.
//!
//! Most of Weld's optimizations occur over the AST, which doubles as a "High-Level IR." The AST
//! captures the expressions in Weld using a tree data structure.
pub use self::ast::*;
// Various convinience methods on the... | |
<|file_name|>0005_auto__add_macadjanuserprofile.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'MacadjanUserProfile'... | 'map_bounds_top': ('django.db.models.fields.FloatField', [], {'default': '20037508.34'}), |
<|file_name|>StarTreeIndexContainer.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|>main.rs<|end_file_name|><|fim▁begin|>/*
Copyright 2013 Jesse 'Jeaye' Wilkerson
See licensing in LICENSE file, or at:
http://www.opensource.org/licenses/BSD-3-Clause
File: server/main.rs
Author: Jesse 'Jeaye' Wilkerson
Description:
Main engine controller and entry point
... | { ui::term::initialize() };
log_assert!(driver.is_some(), "Unable to initialize UI"); |
<|file_name|>blocks.py<|end_file_name|><|fim▁begin|>import time
import rlp
import trie
import db
import utils
import processblock
import transactions
import logging
import copy
import sys
from repoze.lru import lru_cache
# logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger()
INITIAL_DIFFICULTY = 2 **... | for i in range(self.transaction_count):
tx_rlp = self.transactions.get(rlp.encode(utils.encode_int(i)))
tx, msr, gas = rlp.decode(tx_rlp) |
<|file_name|>go_import_meta_tag_reader.py<|end_file_name|><|fim▁begin|># Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import re
import requests
from pants.subsystem.subsystem import Subsystem
from pants.util.memo import memoized_metho... | |
<|file_name|>MainController.java<|end_file_name|><|fim▁begin|>package finalWeb.controller;
import org.springframework.stereotype.Controller;
<|fim▁hole|>
}<|fim▁end|> | @Controller
public class MainController {
|
<|file_name|>union_find.py<|end_file_name|><|fim▁begin|>"""
Union-find data structure.
"""
from networkx.utils import groups
class UnionFind:
"""Union-find data structure.
Each unionFind instance X maintains a family of disjoint sets of
hashable objects, supporting the following two methods:
- X[it... | with significant additional changes by D. Eppstein. |
<|file_name|>test_client.py<|end_file_name|><|fim▁begin|># Copyright 2014 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | def __init__(self, client): |
<|file_name|>function_ptr.hpp<|end_file_name|><|fim▁begin|>/*=============================================================================
<|fim▁hole|> file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defin... | Copyright (c) 2011 Hartmut Kaiser
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
<|file_name|>test_carepoint_import_mapper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.addons.connector_carepoint.unit import mapper
from .common import SetUpCarepointBase
class TestCarepoint... | def test_backend_id(self):
""" It should map backend_id correctly """
res = self.importer.backend_id(True)
expect = {'backend_id': self.importer.backend_record.id} |
<|file_name|>rtconfig.py<|end_file_name|><|fim▁begin|>import os
# toolchains options
ARCH = 'arm'
CPU = 'cortex-m3'
CROSS_TOOL = 'gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = 'C:\Program Files (x86)\CodeSourcery\Sourc... | POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' |
<|file_name|>shakeout_menu.spec.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
describe("Shakeout Menu", () => {
// Before running tests - we have to make sure the admin user is logged in
before(() => {
cy.login('team_leader','Test1234$');
cy.getCookie("sessionid").should("exist");
cy.getCookie("csrftoke... | // The following will make sure the team_leader does not have access to certain menu items
// All menu items have been tested at the administration level |
<|file_name|>plot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
femagtools.plot
~~~~~~~~~~~~~~~
Creating plots
"""
import numpy as np
import scipy.interpolate as ip
import logging
try:
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from mpl_to... |
def multcal(bch, title=''): |
<|file_name|>webpack-helpers.js<|end_file_name|><|fim▁begin|>const path = require(`path`)
exports.chunkNamer = chunk => {<|fim▁hole|> chunk.forEachModule(m => {
n.push(path.relative(m.context, m.userRequest))
})
return n.join(`_`)
}<|fim▁end|> | if (chunk.name) return chunk.name
let n = [] |
<|file_name|>Type.java<|end_file_name|><|fim▁begin|>package sbahjsic.runtime;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import sbahjsic.core.Warnings;
import sbahjsic.core.Warnings.Level;
import sbahjsic.runtime.Operator.BiOperator;
import sbahjsic.runtime.Operato... | private final Operator operatorLookup(String op) { |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![allow(unknown_lints)]
#![allow(clippy::identity_op)] // used for vertical alignment
use std::collections::BTreeMap;
use std::fs::File;
use std::io::prelude::*;
use std::io::Cursor;
use std::time::Instant;
use anyhow::{bail, Result};
use curl::easy::{Easy, List};
use... | 301 => "Moved Permanently",
302 => "Found",
303 => "See Other", |
<|file_name|>test_parser.py<|end_file_name|><|fim▁begin|># Copyright 2016 Matthias Gazzari
#
# 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
#... | |
<|file_name|>insertsort.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright (C) 2014-2016 Miquel Sabaté Solà <mikisabate@gmail.com>
# This file is licensed under the MIT license.
# See the LICENSE file.
def insertsort(lst):
for i in range(1, len(lst)):
value = lst[i]
j = i
while j... | lst[j] = lst[j - 1]
j -= 1
lst[j] = value
|
<|file_name|>0007_auto_20160221_1533.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-21 15:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):<|fim▁hole|> ('pages', '0006_auto_20160221_1241'),... |
dependencies = [ |
<|file_name|>types.py<|end_file_name|><|fim▁begin|>import logging
import re
import socket
from mopidy.config import validators
from mopidy.internal import log, path
def decode(value):
if isinstance(value, bytes):
value = value.decode(errors="surrogateescape")
for char in ("\\", "\n", "\t"):
... | class _ExpandedPath(str): |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
with open('README.md') as fp:
long_description = fp.read()
setup(
name='typeform',
version='1.1.0',
description='Python Client wrapper for Typeform API',
long_description=long_description,
long_description_content_type='text/markdo... | from setuptools import setup, find_packages |
<|file_name|>bitcoin_en.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="en">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="14"/>
<source>About SLI... | <message> |
<|file_name|>issue-6318.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.org/lice... | } |
<|file_name|>test_clean_provisional.py<|end_file_name|><|fim▁begin|>import unittest
from ebird.api.validation import clean_provisional<|fim▁hole|>
class CleanProvisionalTests(unittest.TestCase):
"""Tests for the clean_provisional validation function."""
def test_converts_bool(self):
self.assertEqual("... | |
<|file_name|>modelSelector.tsx<|end_file_name|><|fim▁begin|>// notice_start
/*
* Copyright 2015 Dev Shop Limited
*
* 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... | * 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|>testDocument.js<|end_file_name|><|fim▁begin|>const fs = require("fs");
const assert = require("assert");
const testMngr = require("test/testManager");
const FormData = require("form-data");
describe("Document No Auth", function () {
let client;
before(async function () {
if (!testMngr.app.config.d... |
const formData2 = new FormData(); |
<|file_name|>test_config_file.py<|end_file_name|><|fim▁begin|>import pytest
from path import Path<|fim▁hole|> CHANGE_SET_PARAMETERS, CHANGE_SET_STACK_TAGS,
FULL_CONFIG_FILE, CHANGE_SET_CAPABILITIES,
ROLE_ARN, VARS)
de... | import yaml
from uuid import uuid4
from formica import cli
from tests.unit.constants import (REGION, PROFILE, STACK, |
<|file_name|>consts.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses... | |
<|file_name|>create.rs<|end_file_name|><|fim▁begin|>// https://rustbyexample.com/std_misc/file/create.html
// http://rust-lang-ja.org/rust-by-example/std_misc/file/create.html
// $ mkdir out<|fim▁hole|>static LOREM_IPSUM: &'static str =
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor i... | // $ rustc create.rs && ./create
// $ cat out/lorem_ipsum.txt
// create.rs |
<|file_name|>TranslogDocument_0_1_0.java<|end_file_name|><|fim▁begin|>package org.uppermodel.translog;
import java.util.LinkedList;
import java.util.List;
import org.uppermodel.translog.v0v1v0.Event;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import... | |
<|file_name|>AutoBuffer.java<|end_file_name|><|fim▁begin|>package water;
import java.io.*;
import java.lang.reflect.Array;
import java.net.*;
import java.nio.*;
import java.nio.channels.*;
import java.util.ArrayList;
import java.util.Random;
import water.network.SocketChannelUtils;
import water.util.Log;
import water... | put1('[');
for( int i=0; i<a.length; i++ ) { |
<|file_name|>comm.py<|end_file_name|><|fim▁begin|>import urllib2
import json
import time
import threading
import Queue
from utils import make_random_id, LOGINFO, LOGDEBUG, LOGERROR
class CommBase(object):
def __init__(self):
self.agents = []
def add_agent(self, agent):
self.agents.append(age... |
class ThreadedComm(CommBase):
class AgentProxy(object):
def __init__(self, tc): |
<|file_name|>http-testing.umd.js<|end_file_name|><|fim▁begin|>/**
* @license Angular v6.1.10
* (c) 2010-2018 Google, Inc. https://angular.io/
* License: MIT
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angul... | MERCHANTABLITY OR NON-INFRINGEMENT.
|
<|file_name|>comment4.rs<|end_file_name|><|fim▁begin|>// rustfmt-normalise_comments: false
//! Doc comment
fn test() {
// comment
// comment2
code(); /* leave this comment alone!
* ok? */
/* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a
* diam lectus. Sed ... | |
<|file_name|>storageos_util_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE... | var testDesc = "testdescription"
var testPool = "testpool"
var testFSType = "ext2" |
<|file_name|>query_directives.js<|end_file_name|><|fim▁begin|>(function() {
'use strict'
function queryLink() {
return {
restrict: 'E',
scope: {
'query': '=',
'visualization': '=?'
},
template: '<a ng-href="{{link}}" class="query-link">{{query.displayname}}</a>',
l... | |
<|file_name|>set_select.js<|end_file_name|><|fim▁begin|>function Controller() {
function closeModal(e) {
$.modal.fireEvent("removeClose", e);
}
function handleTableViewClick(e) {
if (1 == Alloy.Globals.purchases[e.index] || 1 == Alloy.Globals.purchases[1]) {
for (var i = 0; $.tv.... | |
<|file_name|>table_caption.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/. */
//! CSS table formatting contexts.
#![deny(unsafe_code... | fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
self.block_flow.mutate_fragments(mutator) |
<|file_name|>DefaultMultifactorTriggerSelectionStrategy.java<|end_file_name|><|fim▁begin|>package org.apereo.cas.authentication;
import com.google.common.base.Splitter;
import org.apereo.cas.authentication.principal.Principal;
import org.apereo.cas.services.MultifactorAuthenticationProvider;
import org.apereo.cas.serv... | |
<|file_name|>connect.py<|end_file_name|><|fim▁begin|>import pymongo
def connect ():
'''
Create the connection to the MongoDB and create 3 collections needed<|fim▁hole|> conn = pymongo.MongoClient()
print 'MongoDB Connection Successful'
except pymongo.errors.ConnectionFailure, err:
p... | '''
try:
# Create the connection to the local host |
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>// Package rpctest provides a ltcd-specific RPC testing harness crafting and
// executing integration tests by driving a `ltcd` instance via the `RPC`
// interface. Each instance of an active harness comes equipped with a simple<|fim▁hole|>// This package was designed sp... | // in-memory HD wallet capable of properly syncing to the generated chain,
// creating new addresses, and crafting fully signed transactions paying to an
// arbitrary set of outputs.
// |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .version import version as __version__
from oplus.configuration import CONF
from oplus.epm.api import *
from oplus.weather_data.api import *
from oplus.standard_output.api import *
from oplus.eio import Eio
from oplus.mtd import Mtd<|fim▁hole|><|fim▁end|> | from oplus.err import Err
from oplus.summary_table import SummaryTable
from oplus.output_table import OutputTable
from oplus.simulation import Simulation, simulate |
<|file_name|>test_resource_class.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#<|fim▁hole|>#
# Unless required by applicable law or agreed to in writing, soft... | # http://www.apache.org/licenses/LICENSE-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.