prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>PianoHeroFileHandler.java<|end_file_name|><|fim▁begin|>package edu.brown.cs.pianoHeroFiles;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFou... | * Saves an mp3 file directory and returns its saved path as a string
* |
<|file_name|>dms.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "dms")]
extern crate rusoto_core;
extern crate rusoto_dms;
use rusoto_dms::{DatabaseMigrationService, DatabaseMigrationServiceClient, DescribeEndpointsMessage};
use rusoto_core::Region;
#[test]
fn should_describe_tags() {
let client = DatabaseMigr... | } |
<|file_name|>index.test.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import merge from 'deepmerge';
import {Platform} from 'react-native';
import {Navigation} from 'react-native-navigation';
import configureMockStore fro... | },
statusBar: {
visible: true, |
<|file_name|>frame.go<|end_file_name|><|fim▁begin|>package jps
type ServerFrame struct {
Request IncomingRequest
Response OutgoingResponse
Session ServerSession
ConnectionDetails
}
type ClientFrame struct {
Request OutgoingRequest
Response IncomingResponse<|fim▁hole|><|fim▁end|> | Session ClientSession
ConnectionDetails
} |
<|file_name|>list_get_codec.py<|end_file_name|><|fim▁begin|>from hazelcast.serialization.bits import *<|fim▁hole|>from hazelcast.protocol.builtin import StringCodec
from hazelcast.protocol.builtin import DataCodec
from hazelcast.protocol.builtin import CodecUtil
# hex: 0x050F00
_REQUEST_MESSAGE_TYPE = 331520
# hex: 0x... | from hazelcast.protocol.builtin import FixSizedTypesCodec
from hazelcast.protocol.client_message import OutboundMessage, REQUEST_HEADER_SIZE, create_initial_buffer |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# encoding: utf-8<|fim▁hole|>from .post import *
from .system import *
def all():
result = []
models = []
for m in models:
result += m.__all__
return result
__all__ = all()<|fim▁end|> | from .user import *
from .upload import * |
<|file_name|>test_cobertura.py<|end_file_name|><|fim▁begin|>import mock
import lxml.etree as ET
from .utils import make_cobertura
def test_parse_path():
from pycobertura import Cobertura
xml_path = 'foo.xml'
with mock.patch('pycobertura.cobertura.os.path.exists', return_value=True):
with mock.p... |
def test_missed_lines(): |
<|file_name|>sv.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
<|fim▁hole|><|fim▁end|> | CKEDITOR.plugins.setLang( 'removeformat', 'sv', {
toolbar: 'Radera formatering'
} ); |
<|file_name|>DragAndDrop.java<|end_file_name|><|fim▁begin|>package gui.dragndrop;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.input.*;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
public class DragAnd... | |
<|file_name|>versions.py<|end_file_name|><|fim▁begin|># Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import pytest
from spack.main import SpackCommand
versions = Spack... | @pytest.mark.network
def test_remote_versions_only():
"""Test a package for which remote versions should be available."""
|
<|file_name|>testing.py<|end_file_name|><|fim▁begin|>from __future__ import annotations
import re
import sys
from typing import Any, Callable, TypeVar
from pathlib import Path
import numpy as np
import numpy.typing as npt
AR_f8: npt.NDArray[np.float64]
AR_i8: npt.NDArray[np.int64]
bool_obj: bool
suppress_obj: np.te... |
reveal_type(np.testing.assert_array_almost_equal_nulp(AR_i8, AR_f8, nulp=2)) # E: None
reveal_type(np.testing.assert_array_max_ulp(AR_i8, AR_f8, maxulp=2)) # E: numpy.ndarray[Any, numpy.dtype[Any]] |
<|file_name|>address.py<|end_file_name|><|fim▁begin|>"""Contains the :code:`Address` class, representing a collection of reverse
geocoding results. Primarily, this functions as a container for a set of
:code:`errorgeopy.Location` objects after a successful reverse geocode, and
exposes methods that operate on this set o... | limit (int): The maximum number of match candidates to retrieve
from fuzzywuzzy. The length of the returned array may be longer, if
the set of addresses has identical addresses that are good matches |
<|file_name|>get_type_id.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
use core::any::Any;
use core::any::TypeId;
// #[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
// #[stable(feature = "rust1", since = "1.0.0")]
// pub struct TypeId {
// ... |
// impl<T: Reflect + 'static> Any for T {
// fn get_type_id(&self) -> TypeId { TypeId::of::<T>() } |
<|file_name|>dispatcher.py<|end_file_name|><|fim▁begin|># This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program... | for ext in self.extensions:
if ext not in ordered:
ordered.append(ext) |
<|file_name|>EarthShape.java<|end_file_name|><|fim▁begin|>// EarthShape.java
// See copyright.txt for license and terms of use.
package earthshape;
import java.awt.BorderLayout;
import java.awt.Cursor;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListe... | public void setActiveSquareNoRedraw(SurfaceSquare sq)
{
if (this.activeSquare != null) { |
<|file_name|>inventory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright 2017 Northern.tech AS
#<|fim▁hole|># You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | #
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate byteorder;
extern crate wasm_ast;
use byteorder::{ByteOrder, LittleEndian};
use std::collections::HashMap;
use std::default::Default;
use std::iter::repeat;
use wasm_ast::{BinOp, Expr, Function, Size, UnaryOp};
use wasm_ast::BinOp::{Add, And, Copysign, Di... |
}
|
<|file_name|>0003_rename_deleted_field.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-06-27 20:29
from __future__ import unicode_literals
from django.db import migrations
import osf.utils.fields
class Migration(migrations.Migration):
<|fim▁hole|> ]
operations = ... | dependencies = [
('addons_onedrive', '0002_auto_20171121_1426'), |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use db::Pool;
use rocket::{self, Rocket, Request};
use rocket_contrib::{Json, Value};
use std::env;
mod teams;
mod members;
pub fn app(pool: Pool) -> Rocket {
set_log_level();
rocket::ignite()
.manage(pool)
.mount("/teams", teams::routes())
... | } |
<|file_name|>SerializerTest.ts<|end_file_name|><|fim▁begin|>import { Pipeline, Step } from '@ephox/agar';
import { Arr } from '@ephox/katamari';
import { LegacyUnit } from '@ephox/mcagar';
import Serializer from 'tinymce/core/api/dom/Serializer';
import DOMUtils from 'tinymce/core/api/dom/DOMUtils';
import TrimHtml fro... | 'body'
);
}); |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var express = require('express');
var router = express.Router();
/**
* 获得主页内容<|fim▁hole|> *
*/
router.get('/', function(req, res, next) {
res.render('user/index', {
title: 'Express'
});
});
module.exports = router;<|fim▁end|> | |
<|file_name|>ImageConverter.hpp<|end_file_name|><|fim▁begin|>#ifndef IMAGECONVERTER_HPP
#define IMAGECONVERTER_HPP
#include <QImage>
#include <QDebug>
#include <opencv2/core.hpp><|fim▁hole|>#include <opencv2/imgproc.hpp>
#include "Logger.hpp"
class ImageConverter {
public:
ImageConverter() = default;
stati... | |
<|file_name|>codemirror.component.js<|end_file_name|><|fim▁begin|>/*
Misojs Codemirror component
*/
var m = require('mithril'),
basePath = "external/codemirror/",
pjson = require("./package.json");
// Here we have a few fixes to make CM work in node - we only setup each,
// if they don't already exist, otherwise w... | });
}
} else {
console.warn('ERROR: You need Codemirror in the page'); |
<|file_name|>init_models.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
from .pagemodels import *
from .catalogmodels import *
from .utilmodels import *
from .usermodels import *
from .dbconnect import Base, engine
def init_models():
Base.metadata.create_all(engine)<|fim▁end|> | # -*- coding: utf-8 -*- |
<|file_name|>_symmetric.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class SymmetricValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(<|fim▁hole|> super(SymmetricValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | self, plotly_name="symmetric", parent_name="scatter3d.error_y", **kwargs
): |
<|file_name|>06.py<|end_file_name|><|fim▁begin|># THREE GOLD STARS
# Sudoku [http://en.wikipedia.org/wiki/Sudoku]
# is a logic puzzle where a game
# is defined by a partially filled
# 9 x 9 square of digits where each square
# contains one of the digits 1,2,3,4,5,6,7,8,9.
# For this question we will generalize
# and s... | [4,5,2,1,3],
[3,4,5,2,1],
[5,6,4,3,2]]
|
<|file_name|>into_iter.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
use core::option::IntoIter;
// #[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
// #[stable(feature = "rust1", since = "1.0.0")]
// pub enum Option<T> {
// //... |
#[test]
fn into_iter_test2() {
let x: Option<T> = Some::<T>("string"); |
<|file_name|>CopyRange.js<|end_file_name|><|fim▁begin|>/*
* @brief ajax
*
* @file Group.js
*
* Copyright (C) 2006-2009 Jedox AG
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License (Version 2) as published
* by the Free Software Foundat... | // private static methods
// class constructor |
<|file_name|>0002_person_token.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-26 10:54
from __future__ import unicode_literals
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('news', '0001_init... | ),
] |
<|file_name|>ForceFocusHook.ts<|end_file_name|><|fim▁begin|>import {Ref, useEffect, useRef} from 'react'
export function useForceFocus<T extends HTMLElement>(): Ref<T> {
const el = useRef<T>(null)
<|fim▁hole|> }
}, [])
return el
}<|fim▁end|> | useEffect(() => {
if (el.current) {
el.current.focus() |
<|file_name|>tool_extrude.py<|end_file_name|><|fim▁begin|># tool_extrude.py
# Extrusion tool.
# Copyright (c) 2015, Lennart Riecken
#
# 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... | ty = 1
elif dx < 0:
ty = -1
elif ax == self.api.mainwindow.display.Z_AXIS: |
<|file_name|>ringbuf.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/li... | fn test_param_reccy() {
let reccy1 = RecCy { x: 1, y: 2, t: One(1) };
let reccy2 = RecCy { x: 345, y: 2, t: Two(1, 2) }; |
<|file_name|>ComponentAddon.java<|end_file_name|><|fim▁begin|>/**
* L2FProd.com Common Components 7.3 License.
*
* Copyright 2005-2007 L2FProd.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy ... | public interface ComponentAddon {
/**
|
<|file_name|>create_bidder_level_filter_set.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License ... | def platform_type(s): |
<|file_name|>live_values.py<|end_file_name|><|fim▁begin|># Copyright 2017 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.apach... | |
<|file_name|>test_vector.cpp<|end_file_name|><|fim▁begin|>#include <gtest/gtest.h>
#include <iostream>
#include "geometry.hpp"
#include "vector.hpp"<|fim▁hole|>TEST(Vector, OrthogonalBasis) {
constexpr const int dim = 3;
using fptype = float;
const fptype eps = 1e-4;
Array<fptype, dim> tests[] = {
{{1.0... | #include "array.hpp"
|
<|file_name|>network_dropdown.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 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.
/**
* @fileoverview Network drop-down implementation.
*/
cr.define('cr.ui', function(... | this.container.firstItem = null;
this.container.selectedItem = null;
for (var i = 0; i < items.length; ++i) { |
<|file_name|>fasta_name_filter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
FastaNameFilter
Description: Filter a fasta file based on a string to find in the
sequences headers, or given a file with a list of id
fastaNameFilter.py -i input.fa -o output.fa -s "str... | along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
|
<|file_name|>FEM.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import math
import Sofa
def tostr(L):
return str(L).replace('[', '').replace("]", '').replace(",", ' ')
def transform(T,p):
return [T[0][0]*p[0]+T[0][1]*p[1]+T[0][2]*p[2]+T[1][0],T[0][3]*p[0]+T[0][4]*p[1]+T[0][5]*p[2]+T[1][1],T[0][6]*p[0]+T[0][7]*p[... | |
<|file_name|>browser.js<|end_file_name|><|fim▁begin|>export const browserVersions = () => {
let u = navigator.userAgent
return {
// 移动终端浏览器版本信息
trident: u.indexOf('Trident') > -1, // IE内核
presto: u.indexOf('Presto') > -1, // opera内核
webKit: u.indexOf('AppleWebKit') > -1, // 苹果、谷歌内核<|fim▁hole|> ge... | |
<|file_name|>analytics.js<|end_file_name|><|fim▁begin|>// GoSquared
var GoSquared = {};
GoSquared.acct = "GSN-064561-T";
(function(w){
function gs(){
w._gstc_lt = +new Date;
var d = document, g = d.createElement("script");
g.type = "text/javascript";
g.src = "//d1l6p2sc9645hc.cloudfront.net/tracker.js... | })(window); |
<|file_name|>AjaxTargetUpdateTestInner.java<|end_file_name|><|fim▁begin|>package forscher.nocket.page.gen.ajax;
import gengui.annotations.Eager;
import java.io.Serializable;
public class AjaxTargetUpdateTestInner implements Serializable {
private String feld1;
private String feld2;
<|fim▁hole|>
@Eager
... | public String getEagerFeld1() {
return feld1;
} |
<|file_name|>eightball.py<|end_file_name|><|fim▁begin|># Copyright the Karmabot authors and contributors.
# All rights reserved. See AUTHORS.
#
# This file is part of 'karmabot' and is distributed under the BSD license.
# See LICENSE for more details.
from karmabot.core.facets import Facet
from karmabot.core.commands... | return thing.name == "eightball"
@commands.add("shake {thing}", help="shake the magic eightball")
def shake(self, thing, context): |
<|file_name|>assignment-returned.js<|end_file_name|><|fim▁begin|>import { h } from 'omi';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(h("path", {
d: "M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.... | }), 'AssignmentReturned'); |
<|file_name|>frontend.py<|end_file_name|><|fim▁begin|>###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation ... | #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
<|file_name|>btpl_value_var_reference252_all_of.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.111
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-genera... | |
<|file_name|>closeDialog.js<|end_file_name|><|fim▁begin|>// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const GObject = imports.gi.GObject;
const Lang = imports.lang;
const Meta = imports.gi.Meta;
const Shell ... | this._dialog.grab_key_focus();
}
}); |
<|file_name|>refcounts.py<|end_file_name|><|fim▁begin|>"""Support functions for loading the reference count data file."""
__version__ = '$Revision: 1.2 $'
import os
import string
import sys
# Determine the expected location of the reference count file:
try:
p = os.path.dirname(__file__)
except NameError:
p =... | return loadfile(open(path))
def loadfile(fp): |
<|file_name|>lint-dead-code-5.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licens... | // file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
// |
<|file_name|>calculate-score.js<|end_file_name|><|fim▁begin|>export default function calculateScore (subject, chosenId, time) {<|fim▁hole|> const isCorrectAnswer = subject.id === chosenId
let score
if(isCorrectAnswer) {
if(time < 7) {
score = 3
} else {
// Needs review
score = .9 + (2 * (... | |
<|file_name|>charmconfigwatcher_test.go<|end_file_name|><|fim▁begin|>// Copyright 2019 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package cache
import (
"github.com/juju/errors"
"github.com/juju/juju/core/settings"
"github.com/juju/names/v4"
jc "github.com/juju/testing/checkers"
"... | // assertWatcherConfig unwraps the charm config watcher and ensures that its
// configuration hash matches that of the input configuration map.
func (s *charmConfigWatcherSuite) assertOneChange(
c *gc.C, wc StringsWatcherC, cfg map[string]interface{}, extra ...string, |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 Google LLC
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
//! Cryptography in Rust.<|fim▁hole|>//! Mundane is a Rust cryptography library backed b... | //! |
<|file_name|>gossip.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go. DO NOT EDIT.
// source: micro/go-plugins/registry/gossip/proto/gossip.proto
package gossip
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not ot... | }
func (m *Update) GetData() []byte { |
<|file_name|>Filter.ts<|end_file_name|><|fim▁begin|>module App {
export class Filter extends LionSoftAngular.Filter {
<|fim▁hole|> protected static addFactoryInjections(injects: string[]) {
LionSoftAngular.Filter.addFactoryInjections(injects);
this.addInjection(injects, "$filter");
... | $filter: ng.IFilterService;
|
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin<|fim▁hole|>admin.site.register(Organization)<|fim▁end|> |
from .models import Organization
|
<|file_name|>test_grid.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (C) 2014 Equinor ASA, Norway.
#
# The file 'test_grid.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | c = grid.findCellCornerXY( 0.90 , 0.90 , 0 )
self.assertEqual( c , (nx + 1) + 1 ) |
<|file_name|>test_offhours.py<|end_file_name|><|fim▁begin|># Copyright 2015-2017 Capital One Services, 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/L... | |
<|file_name|>radio.js<|end_file_name|><|fim▁begin|>/* eslint-env mocha */
const mockBot = require('../mockBot')
const assert = require('assert')
const mockery = require('mockery')
const sinon = require('sinon')
const json = JSON.stringify({
state: 'normal',
nowTitle: 'Midnight News',
nowInfo: '20/03/2019',
nex... | describe('radio module', function () { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># To change this license header, choose License Headers in Project Properties.<|fim▁hole|><|fim▁end|> | # To change this template file, choose Tools | Templates
# and open the template in the editor. |
<|file_name|>test-registry-datasets.py<|end_file_name|><|fim▁begin|>"""Tests for registry module - datasets method"""
import vcr
from pygbif import registry
@vcr.use_cassette("test/vcr_cassettes/test_datasets.yaml")
def test_datasets():
"registry.datasets - basic test"
res = registry.datasets()
assert dic... | |
<|file_name|>lint.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright (c) 2013 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.
"""Runs Android's lint tool."""
import argparse
import os
import re
import sy... |
cmd = [ |
<|file_name|>reference.py<|end_file_name|><|fim▁begin|>import sys
import pprint
class Reference(object):
def __init__(self, tb_index, varname, target):
self.tb_index = tb_index
self.varname = varname
self.target = target
def marker(self, xtb, tb_index, key):
return Marker(sel... | code = self.xtb._format_variable.__code__
if frame.f_code == code:
indent = frame.f_locals["indent"] + 4
break |
<|file_name|>wiggle.rs<|end_file_name|><|fim▁begin|>//! Dataflow node that generates/propagates/mutates a wiggle.
use util::{modulo_one, almost_eq, angle_almost_eq};
use network::{Network, NodeIndex, GenerationId, NodeId, OutputId, Inputs, Outputs};
use console_server::reactor::Messages;
use wiggles_value::{Data, Unipo... | } |
<|file_name|>org_delete.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
import argparse
import regrws
import regrws.method.org
try:
from apikey import APIKEY
except ImportError:
APIKEY = None
epilog = 'API key can be omitted if APIKEY is defined in apikey.py'
parser = argparse.ArgumentParser... | required=False if APIKEY else True, dest='api_key') |
<|file_name|>DBtest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.7
import os
import sys
this_dir = os.path.dirname(os.path.abspath(__file__))<|fim▁hole|>trunk_dir = os.path.split(this_dir)[0]
sys.path.insert(0,trunk_dir)
from ikol.dbregister import DataBase
from ikol import var
if os.path.exists(var.DB_P... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ******************************************************************************
# Copyright 2014-2018 Intel Corporation<|fim▁hole|># You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. |
<|file_name|>test_images.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from PIL import Image
from treemap.images import save_uploaded_image
from treemap.tests import LocalMediaTestCase, media_dir
... | |
<|file_name|>actions.js<|end_file_name|><|fim▁begin|>import { createAction, createThunkAction } from 'redux/actions';
import { getShortenUrl } from 'services/bitly';
import { saveAreaOfInterest } from 'components/forms/area-of-interest/actions';
export const setShareData = createAction('setShareData');
export const ... | export const setShareSelected = createAction('setShareSelected');
export const setShareOpen = createAction('setShareOpen');
export const setShareCopied = createAction('setShareCopied');
export const setShareLoading = createAction('setShareLoading'); |
<|file_name|>connect_ack_flags.rs<|end_file_name|><|fim▁begin|>use std::io::{Read, Write};
use std::convert::From;
use byteorder::{ReadBytesExt, WriteBytesExt};
use control::variable_header::VariableHeaderError;
use {Encodable, Decodable};
#[derive(Debug, Eq, PartialEq, Copy, Clone)]
pub struct ConnackFlags {
pu... | let code = self.session_present as u8;
writer.write_u8(code).map_err(From::from)
} |
<|file_name|>any.rs<|end_file_name|><|fim▁begin|>use AsLua;
use AsMutLua;
use Push;<|fim▁hole|>use LuaRead;
/// Represents any value that can be stored by Lua
#[derive(Clone, Debug, PartialEq)]
pub enum AnyLuaValue {
LuaString(String),
LuaNumber(f64),
LuaBoolean(bool),
LuaArray(Vec<(AnyLuaValue, AnyLu... | use PushGuard; |
<|file_name|>EventEmitter.test.js<|end_file_name|><|fim▁begin|>var expect = require('chai').expect,
sinon = require('sinon'),
EventEmitter = require('../src/EventEmitter');
describe('EventEmitter tests', function() {
var emitter,
foo,
bar;
beforeEach(function() {
emitter = new... | describe('.removeAllListeners', function() { |
<|file_name|>terminal-backend-module.ts<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2017 TypeFox and others.
*
* 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... |
const logger = ctx.container.get<ILogger>(ILogger);
const loggerChild = logger.child({ 'module': 'terminal-backend' }); |
<|file_name|>matchMakingThread.py<|end_file_name|><|fim▁begin|>#This will be the thread responsible for the matchmaking which operates as follows:
#There are four lists where the players are divided into based on their rank.
#List 1 is for ranks 0,1,2.
#List 2 is for ranks 3,4,5.
#List 3 is for ranks 6,7,8.
#List 4 is ... | #exitQueue is used for exiting the thread |
<|file_name|>lights_controller.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import sys
import remote_core as core
import radio_lights
def main(argv):
config = core.load_config()
lights_config_names = {"1":"door_light", "2":"desk_light", "3": "shelf_light"}<|fim▁hole|> if argv[0] == "an":
argv = ["1n", "2n"... |
if len(argv) == 1 and len(argv[0]) == 2: |
<|file_name|>xml.py<|end_file_name|><|fim▁begin|># The contents of this file are subject to the Mozilla Public 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.mozilla.org/MPL/
#
# Software distributed under... | except ExpatError: |
<|file_name|>config_test.go<|end_file_name|><|fim▁begin|>package sshd
// Tests ensuring that configuration-driven options translate to correct
// behaviors.
import (
"code.google.com/p/go.crypto/ssh"
"testing"
)
func TestConfigFromConfig(t *testing.T) {
our_config := &Config{
Hostkey: []byte(testServerPrivateK... | t.Error("Pubkey callback was not bound, but an implementation was provided. sshd will erroneously not offer pubkey auth.")
}
if cfg.PasswordCallback == nil { |
<|file_name|>regions-close-object-into-object-3.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://... | // file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT. |
<|file_name|>train_sequence_model.py<|end_file_name|><|fim▁begin|>"""Module to train sequence model.
Vectorizes training and validation texts into sequences and uses that for
training a sequence model - a sepCNN model. We use sequence model for text
classification when the ratio of number of samples to number of words... | FLAGS.data_dir)
train_sequence_model(data) |
<|file_name|>delete_recorder_id_parameters.go<|end_file_name|><|fim▁begin|>// Code generated by go-swagger; DO NOT EDIT.
// Copyright 2017-2022 Authors of Cilium
// SPDX-License-Identifier: Apache-2.0
package recorder
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re... | o.ID = id
} |
<|file_name|>webXRMotionControllerManager.ts<|end_file_name|><|fim▁begin|>import {
WebXRAbstractMotionController, IMotionControllerProfile,
} from './webXRAbstractMotionController';
import { WebXRGenericTriggerMotionController } from './webXRGenericMotionController';
import { Scene } from '../../scene';
import... | }
}
// make sure microsoft/windows mixed reality works correctly
|
<|file_name|>test_cache_invocation.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import unittest
import apt_pkg
import apt.progress.base
class TestCache(unittest.TestCase):
"""Test invocation of apt_pkg.Cache()"""
def setUp(self):
apt_pkg.init_config()
apt_pkg.init_system()
<|fim▁hole|> ... | def test_wrong_invocation(self):
"""cache_invocation: Test wrong invocation."""
apt_cache = apt_pkg.Cache(progress=None)
|
<|file_name|>NoSuchProcessStepDossierPartException.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This 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 the Free
* Sof... | super(msg, cause);
} |
<|file_name|>try_telethon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import traceback
from telethon_examples.interactive_telegram_client \<|fim▁hole|> import InteractiveTelegramClient
def load_settings(path='api/settings'):
"""Loads the user settings located under `api/`"""
result = {}
wit... | |
<|file_name|>nonlinear_solver.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This is the module where the main solver object for the
nonlinear solver of bolt is defined. This solver object
stores the details of the system defined under physical_system,
and is evolved using the met... | p3_center = af.flat(af.to_array(p3_center))
if(self.N_species > 1): |
<|file_name|>download-dir-name-view.ts<|end_file_name|><|fim▁begin|>/// <reference path="../../../../definitions/jquery/jquery.d.ts" />
/// <reference path="../../../model/config/config.ts" />
/// <reference path="../../view.ts" />
/// <reference path="../../template.ts" />
// TODO: ファイル分けろwww
module Prisc {
expor... | description:"編集画面を経由によって画質の劣化があり得ます。これを防ぐためにそのままダウンロードします",
name: "only-capture"
});
} |
<|file_name|>test_login.py<|end_file_name|><|fim▁begin|>import pytest
from selenium import webdriver
@pytest.fixture
def driver(request):
wd = webdriver.Firefox(capabilities={"marionette": True})
#(desired_capabilities={"chromeOptions": {"args": ["--start-fullscreen"]}})<|fim▁hole|> return wd
def test_ex... | request.addfinalizer(wd.quit) |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>"""Pipeline configuration parameters."""
from os.path import dirname, abspath, join
from sqlalchemy import create_engine
OS_TYPES_URL = ('https://raw.githubusercontent.com/'
'openspending/os-types/master/src/os-types.json')
PIPELINE_FILE = 'pipeline... | {'format': '%Y'},
{'format': '%d/%m/%Y'}, |
<|file_name|>TestDaguCar.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from rcr.robots.dagucar.DaguCar import DaguCar
def main():
car = DaguCar( "/dev/rfcomm1", 500 )
car.MoveForward( 15 )
car.Pause( 1000 )
car.MoveBackward( 15 )
car.Pause( 1000 )
car.MoveLeft( ... | car.Stop()
car.Close() |
<|file_name|>owners_file_tags.py<|end_file_name|><|fim▁begin|># Copyright (c) 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.
import os
import posixpath
import re
from collections import defaultdict
def uniform_pat... | data = {}
def nearest_ancestor_tag(dirname, tag):
""" Find the value of tag in the nearest ancestor that defines it.""" |
<|file_name|>fake_cloudidentitygroup.go<|end_file_name|><|fim▁begin|>// 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/licenses/... | |
<|file_name|>WAxesButtons.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from roars.gui.pyqtutils import PyQtWidget, PyQtImageConverter
from WBaseWidget import WBaseWidget
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4 import QtCore
class WAxesButtons(WBaseWidget):
... | 'ui_axes_buttons' |
<|file_name|>solution.py<|end_file_name|><|fim▁begin|># Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def pathSum(self, root, sum):
"""
:type root: TreeN... | |
<|file_name|>ada_delta.py<|end_file_name|><|fim▁begin|>import numpy
from chainer import cuda
from chainer import optimizer
_default_hyperparam = optimizer.Hyperparameter()
_default_hyperparam.rho = 0.95
_default_hyperparam.eps = 1e-6
class AdaDeltaRule(optimizer.UpdateRule):
"""Update rule of Zeiler's ADADELT... | moments. |
<|file_name|>requestmaker.js<|end_file_name|><|fim▁begin|>/*! @license Firebase v4.3.1<|fim▁hole|>
"use strict";
//# sourceMappingURL=requestmaker.js.map<|fim▁end|> | Build: rev-b4fe95f
Terms: https://firebase.google.com/terms/ */ |
<|file_name|>raw_building.py<|end_file_name|><|fim▁begin|># Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2014-2016 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2014 Google, Inc.
# Copyright (c) 2015-2016 Cara Vinson <ceridwenv@gmail.com>
# Licensed under the LGPL: h... | return _CONST_PROXY[const.value.__class__]
nodes.Const._proxied = property(_set_proxied) |
<|file_name|>borrowck-loan-blocks-move-cc.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://w... | |
<|file_name|>test_ha_pair.py<|end_file_name|><|fim▁begin|># Copyright 2015 Infoblox Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www... | 'vip': 'VIP',
'node1_ha': 'NODE1_HA',
'node2_ha': 'NODE2_HA',
'node1_lan1': 'NODE1_LAN1', |
<|file_name|>MavenRootModelAdapter.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2013 JetBrains s.r.o.
*
* 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... | }
@Nullable |
<|file_name|>conditional.js<|end_file_name|><|fim▁begin|>function* f1() {
a = (yield) ? 1 : 1;
a = yield 1 ? 1 : 1;
a = (yield 1) ? 1 : 1;
a = 1 ? yield : yield;
a = 1 ? yield 1 : yield 1;
}
function* f2() {
a = yield* 1 ? 1 : 1;
a = (yield* 1) ? 1 : 1;<|fim▁hole|>}
async function f3() {
a = await 1 ?... | a = 1 ? yield* 1 : yield* 1; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.