prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>models.go<|end_file_name|><|fim▁begin|>package devices
// 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.<|fim▁hole|>import (
"context"
... | // Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
<|file_name|>_peering_management_client.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 information.
#... | if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports |
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate cql;<|fim▁hole|>macro_rules! assert_response(
($resp:expr) => (
if match $resp.opcode { cql::OpcodeResponse::OpcodeError => true, _ => false } {
panic!("Test failed at assertion: {}",
match $resp.body { c... | |
<|file_name|>eepd20109.go<|end_file_name|><|fim▁begin|>package goenocean<|fim▁hole|>
type EepD20109 struct {
TelegramVld
}
func NewEepD20109() *EepD20109 { // {{{
return &EepD20109{NewTelegramVld()}
} // }}}
func (p *EepD20109) SetTelegram(t TelegramVld) { // {{{
p.TelegramVld = t
} // }}}
func (p *EepD20109) Com... | |
<|file_name|>analysis.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import numbers
import numpy as np
from ..constants import BOLTZMANN_IN_MEV_K
from ..energy import Energy
class Analysis(object):
r"""Class containing methods for the Data class
Attributes
----------
detailed_balance_facto... | result += np.trapz(self.intensity[self.get_bounds(bounds)] - self.estimate_background(background),
np.squeeze(self.data[key][self.get_bounds(bounds)]))
return result |
<|file_name|>query_ned.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright (c) 2016-2018 Weitian LI <weitian@aaronly.me>
# MIT License
#
# TODO:
# * allow to query by coordinates & radius range
# * filter queried results according to the type/other...
# * if not queried by name, then try query by... | |
<|file_name|>createWatchProgram.js<|end_file_name|><|fim▁begin|>"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) retur... | return updatedProgram;
} |
<|file_name|>driver_linux_test.go<|end_file_name|><|fim▁begin|>package docker
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
"time"
"github.com/hashicorp/nomad/client/testutil"<|fim▁hole|> "github.com/stretchr/testify/require"
)
func TestDockerDriver_authFromHelper(t *testing.T) {
dir, ... | "github.com/hashicorp/nomad/helper/freeport"
tu "github.com/hashicorp/nomad/testutil" |
<|file_name|>lib.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/. */
#![deny(unsafe_code)]
#![feature(box_patterns)]
#![feature(box_sy... | |
<|file_name|>mwcc.py<|end_file_name|><|fim▁begin|>"""SCons.Tool.mwcc
Tool-specific initialization for the Metrowerks CodeWarrior compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 200... | # indent-tabs-mode:nil |
<|file_name|>codeEditorBase.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Provides class BaseCodeEditor; base class for
CodeEditor class in Coder
and CodeBox class in dlgCode (code component)
"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 20... | menu.Append(deleteItem) |
<|file_name|>write_to_mut_ref_dest.rs<|end_file_name|><|fim▁begin|>// revisions: stock mut_refs
#![cfg_attr(mut_refs, feature(const_mut_refs))]
use std::cell::Cell;
const FOO: &u32 = {
let mut a = 42;
{
let b: *mut u32 = &mut a; //[stock]~ ERROR mutable references are not allowed in constants
... | }
&{a} |
<|file_name|>pruneusers.py<|end_file_name|><|fim▁begin|>from datetime import timedelta
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from django.db.models import Count, F
from django.utils.timezone import now<|fim▁hole|> help = """Prune old, inactive user accounts.
... | from hc.accounts.models import Profile
class Command(BaseCommand): |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// DO NOT EDIT !
// This file was generated automatically from 'src/mako/cli/main.rs.mako'
// DO NOT EDIT !
#![allow(unused_variables, unused_imports, dead_code, unused_mut)]
#[macro_use]
extern crate clap;
extern crate yup_oauth2 as oauth2;
extern crate yup_hyper_mock... | Some(false)),
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from ._Recognized_objects import * |
<|file_name|>krumo.js<|end_file_name|><|fim▁begin|>/**
* JavaScript routines for Krumo
*
* @version $Id: krumo.js,v 1.1.2.2 2008/06/03 20:36:03 weitzman Exp $
* @link http://sourceforge.net/projects/krumo
*/
/////////////////////////////////////////////////////////////////////////////
/**
* Krumo JS Class
*/
function... | el.className = el.className.replace(className, '');
}
}
|
<|file_name|>FormViewPreparer.java<|end_file_name|><|fim▁begin|>package org.lightadmin.core.view.preparer;
import org.apache.tiles.AttributeContext;
import org.apache.tiles.context.TilesRequestContext;
import org.lightadmin.core.config.domain.DomainTypeAdministrationConfiguration;
<|fim▁hole|> super.execute(til... | public class FormViewPreparer extends ConfigurationAwareViewPreparer {
@Override
protected void execute(final TilesRequestContext tilesContext, final AttributeContext attributeContext, final DomainTypeAdministrationConfiguration configuration) { |
<|file_name|>preview-thumbnail.component.spec.ts<|end_file_name|><|fim▁begin|>// Copyright 2020 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
//
... | imports: [HttpClientTestingModule], |
<|file_name|>login.js<|end_file_name|><|fim▁begin|>var fnObj = {};<|fim▁hole|> axboot.ajax({
type: "GET",
url: ["samples", "parent"],
data: caller.searchView.getData(),
callback: function (res) {
caller.gridView01.setData(res);
},
... | var ACTIONS = axboot.actionExtend(fnObj, {
PAGE_SEARCH: function (caller, act, data) { |
<|file_name|>test_judging_round.py<|end_file_name|><|fim▁begin|># MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from impact.tests.api_test_case import APITestCase
from impact.tests.factories import JudgingRoundFactory
class TestJudgingRound(APITestCase):
def test_str(self):
judging_round = Judging... | assert judging_round.name in judging_round_string
assert str(judging_round.program) in judging_round_string |
<|file_name|>hostutil_linux.go<|end_file_name|><|fim▁begin|>// +build linux
/*
Copyright 2014 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/lice... | return volumeID, nil
}
} |
<|file_name|>KafkaTerms.java<|end_file_name|><|fim▁begin|>/*
* Grakn - A Distributed Semantic Database
* Copyright (C) 2016 Grakn Labs Limited
*
* Grakn 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, e... | |
<|file_name|>StringHelper.py<|end_file_name|><|fim▁begin|>import re, random, string
from Service import Service
class StringHelper(Service):
articles = ["a", "an", "the", "of", "is"]
def randomLetterString(self, numCharacters = 8):
return "".join(random.choice(string.ascii_letters) for i in range(numCharacters))
... | result.append(word in self.articles and word or word.capitalize()) |
<|file_name|>Blog-api.js<|end_file_name|><|fim▁begin|>/**
* Blog-api.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
attributes: {
<|fim▁hole|><|fim▁end|> | }
}; |
<|file_name|>gray_conversion.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
html_colors = {
"aliceblue": "f0f8ff",
"antiquewhite": "faebd7",
"aqua": "00ffff",
"aquamarine": "7fffd4",
"azure": "f0ffff",
"beige": "f5f5dc",
"bisque": "ffe4c4",
"black": "000000",
"blanchedalmond... | "cyan": "00ffff", |
<|file_name|>_videoplayerApp.js<|end_file_name|><|fim▁begin|>/* jshint -W117 */
/*
Copyright 2016 Herko ter Horst
__________________________________________________________________________
Filename: _videoplayerApp.js
__________________________________________________________________________
*/
log.addSrcFile("_... | * CONTEXT CALLBACKS
* ========================= |
<|file_name|>middleware.py<|end_file_name|><|fim▁begin|>#
# Copyright 2013 IBM Corp.
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the L... | |
<|file_name|>cmd_model.go<|end_file_name|><|fim▁begin|>// -*- Mode: Go; indent-tabs-mode: t -*-
/*
* Copyright (C) 2019 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Founda... | // handle brand/brand-id and model/model + display-name differently on just
// `snap model` w/o opts
if x.Serial || x.Verbose {
fmt.Fprintf(w, "brand-id:\t%s\n", brandIDHeader) |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# {{pkglts pysetup,
from os import walk
from os.path import abspath, normpath
from os.path import join as pj
from setuptools import setup, find_packages
short_descr = "Set of data structures used in openalea such as : gr... | history = open('HISTORY.rst').read().replace('.. :changelog:', '')
|
<|file_name|>SpinInput.js<|end_file_name|><|fim▁begin|>//>>built
define("clipart/SpinInput",["dojo/_base/declare","clipart/_clipart"],function(_1,_2){<|fim▁hole|><|fim▁end|> | return _1("clipart.SpinInput",[_2],{});
}); |
<|file_name|>Labyrinthe.java<|end_file_name|><|fim▁begin|>package pacman.carte;
import java.util.ArrayList;
import pacman.personnages.Pacman;
import pacman.personnages.Personnage;<|fim▁hole|> public static final int NB_COLONNE = 20;
public static final int NB_LIGNE = 20;
protected int[][] grille;
protected int lar... |
public class Labyrinthe {
|
<|file_name|>cbc.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* @ngdoc function
* @name quickNewsApp.controller:CbcCtrl
* @description
* # CbcCtrl
* Controller of the quickNewsApp
*/
angular.module('quickNewsApp')
.controller('CbcCtrl', function ($scope, $http) {
this.awesomeThings = [
'HTML5 Bo... |
$scope.getActiveTab = function() {
return this.tab; |
<|file_name|>march31.py<|end_file_name|><|fim▁begin|>def find_number(x):
str_x = str(x)
if len(str_x) == 1:
raise Exception()
left_most = str_x[0]
try:
small_from_rest = find_number(int(str_x[1:]))<|fim▁hole|> # assumption: no repeated digit
rest_of_digits = ''.join(sorte... | return int(left_most + str(small_from_rest))
except:
# min() will throw exception if parameter is empty list, meaning no digit is greater than the left_most digit.
new_left_most = min([c for c in str_x[1:] if c > left_most]) |
<|file_name|>test_shape_examples.py<|end_file_name|><|fim▁begin|># Copyright 2011 Nicholas Bray
#
# 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-... | # 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|>SignalCellularNoSimRounded.js<|end_file_name|><|fim▁begin|>"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
<|fim▁hole|>});
exports.default = void 0;
var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon"));
var _jsxRuntime = requir... | Object.defineProperty(exports, "__esModule", {
value: true |
<|file_name|>method_registry.py<|end_file_name|><|fim▁begin|># Eve W-Space
# Copyright 2014 Andrew Austin and contributors
#
# 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
#
# ... |
for app in settings.INSTALLED_APPS:
mod = import_module(app) |
<|file_name|>xml.rs<|end_file_name|><|fim▁begin|>//! Interface to libxml2.
use remacs_macros::lisp_fn;
use crate::{lisp::LispObject, remacs_sys::Qnil};
#[cfg(feature = "use-xml2")]
use crate::remacs_sys::{init_libxml2_functions, parse_region};
<|fim▁hole|>#[cfg(feature = "use-xml2")]
fn libxml_parse_region(
star... | |
<|file_name|>modelActionTypes.js<|end_file_name|><|fim▁begin|>exports.LOADING = "LOADING";
exports.ERROR = "ERROR";
exports.SUCCESS = "SUCCESS";
exports.FETCH = "FETCH";
exports.CREATE = "CREATE";
exports.UPDATE = "UPDATE";
exports.DELETE = "DELETE";<|fim▁hole|>exports.SET_PAGE = "SET_PAGE"<|fim▁end|> | exports.SET_EDIT_MODE = "SET_EDIT_MODE";
exports.SET_ADD_MODE = "SET_ADD_MODE";
exports.CLOSE_FORM = "CLOSE_FORM"; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># For these tests to run successfully, two conditions must be met:
# 1. MEDIA_URL and MEDIA_ROOT must be set in settings
# 2. The user running the tests must have read/write access to MEDIA_ROOT
# Unit tests:
from sorl.thumbnail.tests.classes import ThumbnailTest, ... | } |
<|file_name|>SunPCSC.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Publ... | |
<|file_name|>api.py<|end_file_name|><|fim▁begin|>from storitell.tastypie.resources import ModelResource
from storitell.stories.models import Story
from storitell.stories.extra_methods import moderate_comment<|fim▁hole|># Stories can be read through a REST-ful interface. It'd be nice
# to be able to POST as well, but th... | from storitell.tastypie.validation import Validation
|
<|file_name|>gb_thread.cpp<|end_file_name|><|fim▁begin|>#include "gb_thread.hpp"
#include "z80.hpp"
#include "memory.hpp"
#include "rom.hpp"
#include "cart_rom_only.hpp"
#include "cart_mbc1.hpp"
#include "cart_mbc5.hpp"
#include "internal_ram.hpp"
#include "video.hpp"
#include "timer.hpp"
#include "joypad.hpp"
#include... | join();
}
void gb::gb_thread::start(gb::rom rom) |
<|file_name|>alerte_info.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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 ... | # without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
<|file_name|>event.rs<|end_file_name|><|fim▁begin|>//! Process window events.
use std::borrow::Cow;
use std::cmp::{max, min};
use std::collections::{HashMap, VecDeque};
use std::error::Error;
use std::ffi::OsStr;
use std::fmt::Debug;
#[cfg(not(windows))]
use std::os::unix::io::RawFd;
use std::path::PathBuf;
use std::t... | let terminal_blinking = self.terminal.cursor_style().blinking; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# © 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
<|fim▁hole|><|fim▁end|> | from . import hr_employee |
<|file_name|>res_company.py<|end_file_name|><|fim▁begin|># Copyright 2018 Tecnativa - Vicent Cubells <vicent.cubells@tecnativa.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3
from odoo import fields, models
SORTING_CRITERIA = [
("name", "By name"),
("product_id.name", "By product name"),
("... | |
<|file_name|>two_fer_test.py<|end_file_name|><|fim▁begin|>import unittest
import two_fer
class Two_Fer_test(unittest.TestCase):
def test_empty(self):
self.assertEqual(two_fer.two_fer(), 'One for you, one for me.')
def test_eve(self):<|fim▁hole|> def test_bob(self):
self.assertEqual(two_fe... | self.assertEqual(two_fer.two_fer("Eve"), "One for Eve, one for me.")
|
<|file_name|>state_db.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity 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 3 of ... | if let (Some(ref number), Some(ref hash), Some(ref parent)) = (self.commit_number, self.commit_hash, self.parent_hash) { |
<|file_name|>20 ---.py<|end_file_name|><|fim▁begin|>#FLM: ---------
<|fim▁hole|><|fim▁end|> |
pass |
<|file_name|>UniversalLinks.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>
declare namespace UniversalLinks {
interface EventData {
url: string
scheme: string
host: string
path: string
params: string
hash: string
}
/**
* The universalLinks object allows us to subscribe to events that ha... | // Type definitions for Apache Cordova Universal/Deep Links plugin.
// Project: https://github.com/nordnet/cordova-universal-links-plugin
// Definitions by: Mark Henle <https://github.com/freefal> |
<|file_name|>grand_parent_with_parent_with_child.js<|end_file_name|><|fim▁begin|>function child() {
alert('child');
}
<|fim▁hole|>
function grandParent() {
alert('grand parent');
}<|fim▁end|> | function parent() {
alert('parent');
} |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from django.utils.six.moves.urllib.parse import parse_qs, urlsplit
from reviewboard.hostingsvcs.utils.paginator import (APIPaginator,
InvalidPageError,
... | |
<|file_name|>dao_test.go<|end_file_name|><|fim▁begin|>package account
import (
"context"
"flag"
"go-common/app/interface/main/creative/conf"
accapi "go-common/app/service/main/account/api"
relaMdl "go-common/app/service/main/relation/model"
relation "go-common/app/service/main/relation/rpc/client"
"go-common/li... | |
<|file_name|>astconv.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... | if let Some(&ty) = tcx.ast_ty_to_ty_cache.borrow().get(&self_ty_id) {
ty
} else { |
<|file_name|>optimized.go<|end_file_name|><|fim▁begin|>package builds
import (
"fmt"
"strings"
g "github.com/onsi/ginkgo"
o "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
e2e "k8s.io/kubernetes/test/e2e/framework"
buildv1 "github.com/openshift/api/build/v1"
exutil "github.com/openshi... | e2e.Logf("Build logs:\n%s", result) |
<|file_name|>trainer.py<|end_file_name|><|fim▁begin|># Copyright 2021 DeepMind Technologies 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.org/licenses/LICEN... | optimizer: The optimizer to use e.g. the result of optax.sgd(...).
loss_fn: An instance of the loss function, pmapped across all devices.
|
<|file_name|>anritsu_signal_source.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015-2018 by ExopyHqcLegacy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full licen... | switch_on_off method''').format(value), 80)
raise VisaTypeError(mess) |
<|file_name|>api.py<|end_file_name|><|fim▁begin|>"""Certificates API
This is a Python API for generating certificates asynchronously.
Other Django apps should use the API functions defined in this module
rather than importing Django models directly.
"""
import logging
from django.conf import settings
from django.core... | if not isinstance(course_key, CourseKey): |
<|file_name|>Pysam_0_8_4.py<|end_file_name|><|fim▁begin|>from starcluster.clustersetup import ClusterSetup
from starcluster.logger import log
class PysamInstaller(ClusterSetup):<|fim▁hole|> node.ssh.execute('pip install --target=d:\/opt/software/pysam pysam') #https://github.com/pysam-developers... | def run(self, nodes, master, user, user_shell, volumes):
for node in nodes:
log.info("Installing PySam 0.8.4 on %s" % (node.alias))
node.ssh.execute('mkdir -p /opt/software/pysam') |
<|file_name|>battery.py<|end_file_name|><|fim▁begin|># Copyright (C) 2006-2007, Red Hat, Inc.
#
# 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 opt... | old_present = self._present
old_time = self.props.time_remaining
self._fetch_properties_from_upower()
if self._level != old_level: |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>//#![deny(warnings)]
// please excuse my poor rust, this is my first time
extern crate toml;
extern crate rustc_serialize;
use std::fs::File;
use std::env;
use std::io;
use std::io::prelude::*;
use toml::Value;
use rustc_serialize::json::Json;
extern crate hyper;
e... | let mut input = String::new(); |
<|file_name|>step1_make_new_labels.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Libraries
import imapclient
# Local imports
import account_settings<|fim▁hole|>import utils
def get_all_folders(username, password):
server = utils.login_to_server(username, password)
all_folders = server.list_folders()
... | |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import io
from pytest import fixture
class _FakeOutputFile(io.StringIO):
def close(self):
self.contents = self.getvalue()
super().close()
@fixture
def fake_output_file():
return _FakeOutputFile()
type_example_values = {
"none": (No... | @fixture(params=values_not_from_types("str")) |
<|file_name|>users.client.service.js<|end_file_name|><|fim▁begin|>'use strict';
// Users service used for communicating with the users REST endpoint
angular.module('users').factory('Users', [
'$resource',<|fim▁hole|> }
]);<|fim▁end|> | function ($resource) {
return $resource('users', {}, { update: { method: 'PUT' } }); |
<|file_name|>time.js<|end_file_name|><|fim▁begin|>(function (r) {
"use strict";
var events = r('events');
var eventEmitter = new events.EventEmitter();
var playerManager = r('../PlayerSetup/player-manager').playerManager;
var helper = r('../helpers');
var world = {
valston: r('..... | sunset: 36,
moonRise: 40,
night: 42,
midNight: 48,
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from pycddb.dataset import Dataset
from lingpy import Wordlist, csv2list
from lingpy.compare.partial import _get_slices
def prepare(ds):
errs = 0<|fim▁hole|> W = {}
for k in wl:
value = wl[k, 'value']
tokens = wl[k, 'tokens']
doc ... | wl = Wordlist(ds.raw('bds.tsv')) |
<|file_name|>datacatalog_v1beta1_generated_data_catalog_test_iam_permissions_async.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2022 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... |
# [END datacatalog_v1beta1_generated_DataCatalog_TestIamPermissions_async] |
<|file_name|>DeleteMemberRequestProtocolMarshaller.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.<|fim▁hole|> *
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>__all__ = ['appie.appie', 'appie.extensions']
<|fim▁hole|>from appie.appie import *
from appie.extensions import *<|fim▁end|> | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate nalgebra as na;
use std::io::{self, Write};
pub use bounds::Bounds;
pub use na::Vec2;
pub mod bounds;
pub type Position = na::Pnt2<f32>;
fn pmin(p1: Position, p2: Position) -> Position {
Position::new(p1.x.min(p2.x), p1.y.min(p2.y))
}
fn pmax(p1: Po... | |
<|file_name|>hypothesis_testing_kolmogorov_smirnov_test_example.py<|end_file_name|><|fim▁begin|>#
# Licensed to the Apache Software Foundation (ASF) under one or more<|fim▁hole|># The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance wi... | # contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. |
<|file_name|>demo.py<|end_file_name|><|fim▁begin|># _*_ coding:utf-8 _*_<|fim▁hole|>from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
import unittest
import os
import time
import copy
import utils
from elements_path import LOGIN_FORM, TOP_BAR, CENTER, CENTER_PERSONAL, CENTER... | __author__ = 'Y-ling'
__date__ = '2017/9/15 11:11'
|
<|file_name|>verifier.py<|end_file_name|><|fim▁begin|>import itertools
from whylog.config.investigation_plan import Clue
from whylog.constraints.exceptions import TooManyConstraintsToNegate
from whylog.front.utils import FrontInput
class Verifier(object):
UNMATCHED = Clue(None, None, None, None)
@classmetho... | |
<|file_name|>exhaustive_vec_permutations.rs<|end_file_name|><|fim▁begin|>use itertools::Itertools;
use malachite_base::vecs::exhaustive_vec_permutations;
fn exhaustive_vec_permutations_helper(cs: &str, out: &[&str]) {
let cs = cs.chars().collect_vec();
let css: Vec<String> = exhaustive_vec_permutations(cs)
... | "4312", "4321", |
<|file_name|>url_search_params.cc<|end_file_name|><|fim▁begin|>// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/core/url/url_search_params.h"
#include <algorithm>
#i... | ExceptionState&) override {
if (current_ >= params_->Params().size())
return false;
|
<|file_name|>process_event.py<|end_file_name|><|fim▁begin|>from ptrace.signames import signalName
class ProcessEvent(Exception):
"""
A process event: program exit, program killed by a signal, program
received a signal, etc.
The attribute "process" contains the related process.
"""
def __init__... | |
<|file_name|>docker.py<|end_file_name|><|fim▁begin|>#
# Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# U... | #
import common
import ports |
<|file_name|>primary.js<|end_file_name|><|fim▁begin|>(function($,window){
<|fim▁hole|><|fim▁end|> | })(Zepto,window); |
<|file_name|>LoginUserInfoPresenter.java<|end_file_name|><|fim▁begin|>package com.dumu.housego.presenter;
import com.dumu.housego.entity.UserInfo;
import com.dumu.housego.model.ILoginUserInfoModel;
import com.dumu.housego.model.IModel.AsycnCallBack;
import com.dumu.housego.model.LoginUserInfoModel;<|fim▁hole|> private... | import com.dumu.housego.view.ILoginUserInfoView;
public class LoginUserInfoPresenter implements ILoginUserInfoPresenter {
private ILoginUserInfoModel model; |
<|file_name|>calendar.js<|end_file_name|><|fim▁begin|>/************************************************************************************************************
JS Calendar
Copyright (C) September 2006 DTHMLGoodies.com, Alf Magne Kalleland
This library is free software; you can redistribute it and/or
modify i... | hourDiv.style.width = '30px';
var span = document.createElement('SPAN');
|
<|file_name|>foo.rs<|end_file_name|><|fim▁begin|>// We're only emitting dep info, so we shouldn't be running static analysis to
// figure out that this program is erroneous.
fn main() {
let a: u8 = "a";<|fim▁hole|><|fim▁end|> | } |
<|file_name|>main_ctrl.py<|end_file_name|><|fim▁begin|>from controllers.job_ctrl import JobController
from models.job_model import JobModel
from views.job_view import JobView
class MainController(object):
def __init__(self, main_model):
self.main_view = None
self.main_model = main_model
s... | def fetch_job(self):
job_num = self.main_view.job_num
if self.main_model.job_exists(job_num): |
<|file_name|>typesWithOptionalProperty.ts<|end_file_name|><|fim▁begin|>// basic uses of optional properties without errors
interface I {
foo: string;
bar?: number;
baz? (): string;
}
var a: {
foo: string;
bar?: number;
baz? (): string;
};
var b = { foo: '' };
var c = { foo: '', bar: 3 };
var ... |
var i: I;
i = b; |
<|file_name|>maps.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from collections import Counter
from itertools import groupby
from operator import itemgetter
import numpy
from django.db.models import F
from tracpro.charts.formatters import format_number
from .utils import get_numeric_valu... | |
<|file_name|>RiseOfTheKraken.js<|end_file_name|><|fim▁begin|>const PlotCard = require('../../plotcard.js');
class RiseOfTheKraken extends PlotCard {
setupCardAbilities() {
this.interrupt({
when: {<|fim▁hole|> this.game.addPower(this.controller, 1);
}
});
}... | onUnopposedWin: event => event.challenge.winner === this.controller
},
handler: () => {
this.game.addMessage('{0} uses {1} to gain an additional power from winning an unopposed challenge', this.controller, this); |
<|file_name|>google.js<|end_file_name|><|fim▁begin|>'use strict';<|fim▁hole|> * Module dependencies.
*/
var passport = require('passport'),
url = require('url'),
GoogleStrategy = require('passport-google-oauth').OAuth2Strategy,
config = require('../config'),
users = require('../../app/controllers/users.server.... |
/** |
<|file_name|>test_uri.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from httoop import URI
def test_simple_uri_comparision(uri):
u1 = URI(b'http://abc.com:80/~smith/home.html')
u2 = URI(b'http://ABC.com/%7Esmith/home.html')
u3 = URI(b'http://ABC.com:/%7esmith/home.html')
u4 = URI(b'http... | |
<|file_name|>HelloWorldActivity.java<|end_file_name|><|fim▁begin|>package org.shenit.tutorial.android;<|fim▁hole|>import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
public class HelloWorldActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) ... | |
<|file_name|>0046_auto_20200221_1735.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2020-02-21 17:35
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
import django.db.models.deletion
import sentry.db.models.fields.foreig... | # By default we prefer to run in a transaction, but for migrations where you want |
<|file_name|>qa_ofdm_txrx.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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 S... | from ofdm_txrx import ofdm_tx, ofdm_rx
from utils import tagged_streams
|
<|file_name|>cosine_similarity.py<|end_file_name|><|fim▁begin|>import sys
import numpy as np
if __name__ == '__main__':
print 'Loading word vectors...'
wordvecs = None
wordlist = []
for i, line in enumerate(sys.stdin):
word, vec = line.strip().split(' ', 1)
vec = map(float, vec.split())
if wordvec... | ]
for test, tvec in tests:
results = []
print '=-=-' * 10 |
<|file_name|>test_dynamic.py<|end_file_name|><|fim▁begin|>from sqlalchemy.testing import eq_, is_
from sqlalchemy.orm import backref, configure_mappers
from sqlalchemy import testing<|fim▁hole|>from sqlalchemy import desc, select, func, exc
from sqlalchemy.orm import mapper, relationship, create_session, Query, \
... | |
<|file_name|>RowDataPacket.js<|end_file_name|><|fim▁begin|>var Types = require('../constants/types');
var Charsets = require('../constants/charsets');
var Field = require('./Field');
var IEEE_754_BINARY_64_PRECISION = Math.pow(2, 53);
module.exports = R... | return dt; |
<|file_name|>DiskMap.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
*
* ... | setOriginalDiskPath(originalDiskPath);
return this;
} |
<|file_name|>test_about.py<|end_file_name|><|fim▁begin|>"""
Test the about xblock
"""
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from .helpers import LoginEnrollmentTestCase
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from courseware.tests.mo... | |
<|file_name|>thread.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses... | use sys::{thread, stack_overflow}; |
<|file_name|>KeelFileFilter.java<|end_file_name|><|fim▁begin|>/***********************************************************************
This file is part of KEEL-software, the Data Mining tool for regression,
classification, clustering, pattern mining and so on.
Copyright (C) 2004-2010
F. Herrera (herrera@decsa... | * </p> |
<|file_name|>condvar.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/license... |
// ETIMEDOUT is not a totally reliable method of determining timeout due
// to clock shifts, so do the check ourselves |
<|file_name|>ethash.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The go-ethereum Authors
// Copyright 2015 Lefteris Karapetsas <lefteris@refu.co>
// Copyright 2015 Matthew Wampler-Doty <matthew.wampler.doty@gmail.com>
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: ... | // Light implements the Verify half of the proof of work. It uses a few small
// in-memory caches to verify the nonces found by Full.
type Light struct { |
<|file_name|>operator.nullcoalescing.assign.default.js<|end_file_name|><|fim▁begin|><|fim▁hole|>var Type = require("@kaoscript/runtime").Type;
module.exports = function() {
let tt = foo();
if(!Type.isValue(tt)) {
tt = bar;
}
};<|fim▁end|> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.