prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>vendor.ts<|end_file_name|><|fim▁begin|>// For vendors for example jQuery, Lodash, angular2-jwt just import them here unless you plan on
// chunking vendors files for async loading. You would need to import the async loaded vendors
// at the entry point of the async loaded file. Also see custom-typings.d.ts... | import '@angular/platform-browser';
import '@angular/platform-browser-dynamic'; |
<|file_name|>sort-down.js<|end_file_name|><|fim▁begin|>const createSortDownIcon = (button) => {
button.firstChild.remove();
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
svg.setAttribute('height', '12');
svg.setAttribute('viewBox', '0 0 503 700');
const path = document.createElem... | L13.419,481.428C-13.124,454.885,5.685,409.357,43.302,409.357z`);
svg.appendChild(path); |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub use self::mouse_joint::{MouseJointConfig, MouseJoint};
use std::rc::{Rc, Weak};
use std::cell::RefCell;
use std::mem;
use std::ptr;
use super::{Body, BodyHandleWeak};
use super::island::{Position, Velocity};
use ::dynamics::world::TimeStep;
mod mouse_joint;
pub ty... | body_a: BodyHandleWeak<'a>,
body_b: BodyHandleWeak<'a>,
is_island: bool, |
<|file_name|>examples.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
module.exports = {
mouseposition: path.join(__dirname, "web", "client", "examples", "mouseposition", "app"),
scalebar: path.join(__dirname, "web", "client", "examples", "scalebar", "app"),
layertree: path.join(__dirname, "web", "client", "ex... | var path = require("path"); |
<|file_name|>test_notifier.py<|end_file_name|><|fim▁begin|># Copyright 2013 Red Hat, 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/L... | logger = mock.Mock() |
<|file_name|>footer.js<|end_file_name|><|fim▁begin|>(function (angular) {
"use strict";
var appFooter = angular.module('myApp.footer', []);
appFooter.controller("footerCtrl", ['$scope', function ($scope) {
}]);
myApp.directive("siteFooter",function(){
return {
... | }; |
<|file_name|>network_source_line_server_unittest.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2010, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributio... | EXPECT_CALL(resolver, FindCFIFrameInfo(_))
.WillOnce(Return((CFIFrameInfo*)NULL)) |
<|file_name|>patient_encounter_entry.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt, fmt_money, cstr, cint
from selling.doctype.customer.customer import DocType
import datetime
from webnotes import msgprint, _
from selling.doctype.lead.lead import... | )
order by parent,qty"""%({"parent":patient_data}),as_dict=1)
patient_data_new=[] |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod button;
mod led;
mod poti;
mod seg7;
pub use self::button::Button;
pub use self::led::Led;
pub use self::poti::Poti;<|fim▁hole|><|fim▁end|> | pub use self::seg7::Seg7; |
<|file_name|>SqlServerEnvironment.java<|end_file_name|><|fim▁begin|>package dbfit.environment;
import dbfit.annotations.DatabaseEnvironment;
import dbfit.api.AbstractDbEnvironment;
import dbfit.util.DbParameterAccessor;
import dbfit.util.DbParameterAccessorsMapBuilder;
import dbfit.util.Direction;
import static dbfit.... | |
<|file_name|>LClientManager.cpp<|end_file_name|><|fim▁begin|>/*
The MIT License (MIT)
Copyright (c) <2010-2020> <wenshengming>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction,... | LClient *pClient = new LClient;
if (pClient == NULL)
{
return false; |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>'''
Created on Apr 19, 2015
@author: bcopy
'''
import os
import cherrypy
import sys
import subprocess
import random
import time
import threading
import Queue
import tempfile
class ScriptMonitor(object):
'''
Monitors the script execution and updates result stat... | for line in iter(self._fd.readline, ''):
self._queue.put(line)
|
<|file_name|>rooms.py<|end_file_name|><|fim▁begin|>"""
Room Typeclasses for the TutorialWorld.
This defines special types of Rooms available in the tutorial. To keep
everything in one place we define them together with the custom
commands needed to control them. Those commands could also have been
in a separate modul... | |
<|file_name|>tstTwoDDistributionHelpers.cpp<|end_file_name|><|fim▁begin|>//---------------------------------------------------------------------------//
//!
//! \file tstTwoDDistributionHelpers.cpp
//! \author Luke Kersting
//! \brief Coherent photon scattering distribution unit tests
//!
//-------------------------... | { |
<|file_name|>union_template.rs<|end_file_name|><|fim▁begin|>#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
#[repr(C)]
pub struct NastyStruct {<|fim▁hole|> pub mIsSome: bool,
pub mStorage: NastyStruct__bindgen_ty_1,
pub __bindgen_anon_1: NastyStruct__bind... | |
<|file_name|>networkConfig.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# F... | connection_status = self.test_connection(proxy_host, proxy_port, proxy_user, proxy_password)
ga_GObject.idle_add(self.on_test_connection_finish, connection_status)
def test_connection(self, proxy_host, proxy_port, proxy_user, proxy_password): |
<|file_name|>sample_test.py<|end_file_name|><|fim▁begin|># Copyright 2014 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 at
#
# http://www.apache.org/licenses... | # 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|>index.js<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> * @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* @namespace Phaser.Structs
*/
module.exports = {
List: require('./List'),
Map: require('./Map'),
ProcessQueue: requ... | * @author Richard Davey <rich@photonstorm.com> |
<|file_name|>include.js<|end_file_name|><|fim▁begin|>(function () {
var
oLoginViewModel,
oSettingsViewModel
;
AfterLogicApi.addPluginHook('view-model-defined', function (sViewModelName, oViewModel) {
if (oViewModel && ('CLoginViewModel' === sViewModelName))
{
oLoginVi... |
}()); |
<|file_name|>backend.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf8 -*-
# National Library of Norway, 2014-2015
# load the packages
from pysqlite2 import dbapi2 as sqlite3
from collections import Counter
from operator import itemgetter
from itertools import chain
from flask import Flask, Respons... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import logging
from flask import abort<|fim▁hole|>from flask import session
from flask import url_for
from testrail_reporting.auth.models import AuthUser
from testrail_reporting.auth.oauth import get_google
log = logging.getLogger(__name__)
auth = Blueprint('auth', ... | from flask import Blueprint
from flask import current_app
from flask import flash
from flask import redirect |
<|file_name|>location.rs<|end_file_name|><|fim▁begin|>pub struct GpsCoordinates {
pub lat: f64,
pub long: f64,<|fim▁hole|><|fim▁end|> | } |
<|file_name|>admission_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 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-2.0
... | |
<|file_name|>tipoDocumentoFormulario.js<|end_file_name|><|fim▁begin|>var baseURL;
$.validator.addMethod("alfanumerico", function(value, element) {<|fim▁hole|>}, "Este campo es alfanumerico.");
$("#frmGuardaTipoDocumento").validate({
rules : {
descripcion : "required",
codigo : {required:true,alfanumerico:tru... | return this.optional(element) || /^[-._a-z0-9\- ]+$/i.test(value); |
<|file_name|>test_randbytes.py<|end_file_name|><|fim▁begin|># Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for L{twisted.python.randbytes}.
"""
import os
from twisted.trial import unittest
from twisted.python import randbytes
class SecureRandomTestCaseBase(object):
"""
... | """
self._check(randbytes.insecureRandom)
|
<|file_name|>test_iamgen.py<|end_file_name|><|fim▁begin|># Copyright 2020 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.
# You may obtain a copy of the License at
#
# http://w... | |
<|file_name|>app-ctrl.ts<|end_file_name|><|fim▁begin|>/// <reference path="../../../typings/angularjs/angular.d.ts" /><|fim▁hole|>
export class AppCtrl {
static $inject = [
'$http'
];
loaded: boolean;
scripts: Array<{}>;
constructor($http: ng.IHttpService) {
this.loaded = false;
this.scripts = [... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Parity Technologies (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 versio... | mod ws_server;
/// Exported tests for use in signer RPC client testing
pub mod tests; |
<|file_name|>_virtual_machine_images_operations.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license inform... | |
<|file_name|>RegCache.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2012- PPSSPP Project.
// 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, version 2.0 or later versions.
// This program ... | else if (regs[i].location.IsImm())
return 3;
}
} |
<|file_name|>hooking.py<|end_file_name|><|fim▁begin|>#
# Copyright 2011-2017 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 option... | f.write(domxml.toxml(encoding='utf-8')) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.shortcuts import render
from .models import *
from .forms import *
from comunicacion.lugar.models import *
from mapeo.models import *
from django.http import HttpResponse
from django.db.models import Sum, Count, Avg
import collection... | for obj in ACCESO_AGUA_CHOICES:
conteo = filtro.filter(fuente_agua__icontains = obj[0]).count() |
<|file_name|>univariate.py<|end_file_name|><|fim▁begin|>r"""
==================================================
Feature computation for univariate time series
==================================================
This sub-module provides routines for computing features on univariate time series.
Many functions are impro... | |
<|file_name|>test_indexedDB.py<|end_file_name|><|fim▁begin|>from browser import window
_kids=['Marsha', 'Jan', 'Cindy']
def continue1(event):
_objectStore.get('Jan', onsuccess=exists, onerror=continue2)
def continue2(event):
for _kid in _kids:
_rec={'name': _kid}
_objectStore.put(_rec, _kid, ... | req = db.put(_rec, _kid) |
<|file_name|>trestle.py<|end_file_name|><|fim▁begin|>#(c) 2016-2018 by Authors
#This file is a part of Flye program.
#Released under the BSD license (see LICENSE file)
"""
Created on Wed Jan 4 03:50:31 2017
@author: jeffrey_yuan
"""
from __future__ import absolute_import
from __future__ import division
import os
im... | if num_bases == overlap:
return i + 1
return len(aln)
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
# version string following pep-0396 and pep-0386<|fim▁hole|>__version__ = '0.9a4.dev1' # pragma: nocover<|fim▁end|> | |
<|file_name|>ObservadorDoControleRemoto.java<|end_file_name|><|fim▁begin|>package controle.gui_jogo;
import controle.configuradores_gui.ConfiguradorVisualizadorDeCartas;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.ut... | |
<|file_name|>dev.js<|end_file_name|><|fim▁begin|>var gulp = require("gulp");
var util = require("gulp-util");
var config = require("../config")
gulp.task("watch", () => {
gulp.watch(`${config.src.ts}`, ["compile:ts"]).on("change", reportChange).on("error", swallowError);
gulp.watch(`${config.test.files}`, ["comp... |
});
function reportChange(event) { |
<|file_name|>test.go<|end_file_name|><|fim▁begin|>package main
import (
"os"
"os/exec"
)
func runTestsCommand() {
goTest := []string{"go", "test"}
goTest = append(goTest, flags.Args()[1:]...)
runCmd(goTest, func(c *exec.Cmd) {
c.Env = appendToPathList(os.Environ(), "GOPATH", appengineDir)
})<|fim▁hole|><|fim▁... | } |
<|file_name|>ratings-counter.py<|end_file_name|><|fim▁begin|>from pyspark import SparkConf, SparkContext<|fim▁hole|>conf = SparkConf().setMaster("local").setAppName("RatingsHistogram")
sc = SparkContext(conf=conf)
lines = sc.textFile("file:///SparkCourse/ml-100k/u.data")
ratings = lines.map(lambda x: x.split()[2])
res... | import collections
|
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.utils.translation import ugettext_lazy as _
app_info = {
'name': 'comments',
'author': 'Katrid',
'website': 'http://katrid.com',
'short_description': 'Enterprise Social Network',<|fim▁hole|> 'dependencies': ['keops.modules.contact'],
... | 'description': _('Comments, Discussions, Mailing List, News, Document Followers'), |
<|file_name|>GradientSkia.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2008, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code mu... | |
<|file_name|>analyze_dxp.py<|end_file_name|><|fim▁begin|>"""
Some helper functions to analyze the output of sys.getdxp() (which is
only available if Python was built with -DDYNAMIC_EXECUTION_PROFILE).
These will tell you which opcodes have been executed most frequently
in the current process, and, if Python was als... | # of occurrences of the pair)
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from datetime import datetime, timedelta
import logging
from urllib import urlencode
from django.http import Http404
from django.utils import html
from django.utils.safestring import mark_safe
import pytz
from corehq import Domain
from corehq.apps import reports
from ... |
@property
def transform(self):
return SerializableFunction() |
<|file_name|>sync.rs<|end_file_name|><|fim▁begin|>use std::io;
use std::net::SocketAddr;
use ldap::Ldap;
use search::{Scope, DerefAliases, SearchEntry};<|fim▁hole|>
use tokio_core::reactor::{Core, Handle};
pub struct LdapSync {
inner: Ldap,
core: Core,
}
impl LdapSync {
pub fn connect(addr: &SocketAddr) ... | |
<|file_name|>FindOverriders.java<|end_file_name|><|fim▁begin|>package edu.cmu.hcii.whyline.analysis;
import java.util.SortedSet;
import java.util.TreeSet;
import edu.cmu.hcii.whyline.bytecode.MethodInfo;
import edu.cmu.hcii.whyline.source.JavaSourceFile;
import edu.cmu.hcii.whyline.source.Line;
import edu.cmu.hcii.wh... | public String getResultsDescription() { return "overriders of " + method.getInternalName(); }
public String getCurrentStatus() { return "Done."; }
|
<|file_name|>formatPhoneNumberDefaultMetadata.test.js<|end_file_name|><|fim▁begin|>import formatPhoneNumber, { formatPhoneNumberIntl } from './formatPhoneNumberDefaultMetadata'
describe('formatPhoneNumberDefaultMetadata', () => {
it('should format phone numbers', () => {<|fim▁hole|> formatPhoneNumber('+12133734253',... | |
<|file_name|>data-mapping.js<|end_file_name|><|fim▁begin|>var DataMapping = require("montage-data/logic/service/data-mapping").DataMapping,
ObjectDescriptor = require("montage-data/logic/model/object-descriptor").ObjectDescriptor;
describe("A DataMapping", function() {
function ClassA(a, b, c, d) {
thi... | mapped = new ClassB();
new DataMapping().mapFromRawData(mapped, data);
expect(mapped).toEqual(new ClassB(1, 2, object, random)); |
<|file_name|>api_boilerplate.py<|end_file_name|><|fim▁begin|>"""
This module is responsible for doing all the authentication.
Adapted from the Google API Documentation.
"""
from __future__ import print_function
import os
import httplib2
import apiclient
import oauth2client
try:
import argparse
flags = argpar... | """
home_dir = os.path.expanduser('~') |
<|file_name|>dispersion.py<|end_file_name|><|fim▁begin|># Natural Language Toolkit: Dispersion Plots
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
A utility for displaying lexical dispersion.
"""
def disp... | |
<|file_name|>BooleanType.ts<|end_file_name|><|fim▁begin|>import {Equalitable} from '../helpers/Equalitable';
import {Cloneable} from '../helpers/Cloneable';
import {Comparable} from '../helpers/Comparable';
<|fim▁hole|>/**
* Utility class for boolean type
*
* TODO: Add boolean operators like and, or, xor?
* TODO: C... | |
<|file_name|>factories.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import factory
from udata.factories import ModelFactory
from .models import Dataset, Resource, Checksum, CommunityResource, License
from udata.core.organization.factories import OrganizationFactory... | model = Checksum |
<|file_name|>UProveToken.java<|end_file_name|><|fim▁begin|>//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the Apache License Version 2.0.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EIT... | public void setProverInformation(byte[] proverInformation) {
|
<|file_name|>prng4.js.uncompressed.js<|end_file_name|><|fim▁begin|>// AMD-ID "dojox/math/random/prng4"
define("dojox/math/random/prng4", ["dojo", "dojox"], function(dojo, dojox) {
<|fim▁hole|>// All Rights Reserved.
// See "LICENSE-BigInteger" for details.
// prng4.js - uses Arcfour as a PRNG
function Arcfour... |
dojo.getObject("math.random.prng4", true, dojox);
// Copyright (c) 2005 Tom Wu
|
<|file_name|>disablenonworkingunits.cpp<|end_file_name|><|fim▁begin|>#include "disablenonworkingunits.h"
#include "wololo/datPatch.h"
namespace wololo {
void disableNonWorkingUnitsPatch(genie::DatFile *aocDat, std::map<int, std::string> *langReplacement) {<|fim▁hole|>
for (size_t civIndex = 0; civIndex < aocDat->Civ... | /*
* Disabling units that are not supposed to show in the scenario editor
*/ |
<|file_name|>courses.py<|end_file_name|><|fim▁begin|># pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
from lettuce import step, world
from common import *
############### ACTIONS ####################
@step('There are no courses$')
def no_courses(step):<|... | world.clear_courses()
create_studio_user() |
<|file_name|>elementexe.cpp<|end_file_name|><|fim▁begin|>/*
* Script element for command execution.
* Copyright (C) 2009-2010 Petr Kubanek <petr@kubanek.net>
*
* 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 S... | if (paramNextString (&imagename)) |
<|file_name|>gallery-tipsy.js<|end_file_name|><|fim▁begin|>var Lang = Y.Lang,
getCN = Y.ClassNameManager.getClassName,
//HTML5 Data Attributes
DATA_CONTENT = 'data-content',
DATA_PLACEMENT = 'data-placement',
//Classes
TIPSY = 'tipsy',
FADE = 'fade',
IN = 'in',
CLASSES = {
... | |
<|file_name|>_templateitemname.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class TemplateitemnameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(<|fim▁hole|> **kwargs
):
super(TemplateitemnameValidator, self).__init__(
plotly_name=plotly... | self,
plotly_name="templateitemname",
parent_name="histogram2d.colorbar.tickformatstop", |
<|file_name|>errors.go<|end_file_name|><|fim▁begin|>// Copyright 2015 Bowery, Inc.
package errors
import (
"errors"
"fmt"
"reflect"
"runtime"
"strconv"
"strings"
)
// New creates a new error, this solves issue of name collision with
// errors pkg.
func New(args ...interface{}) error {
return errors.New(string... | |
<|file_name|>gulpfile.babel.js<|end_file_name|><|fim▁begin|>'use strict';
// Proxy URL (optional)
const proxyUrl = 'drupal.dev';
// API keys
const TINYPNG_KEY = '';
// fonts
const fontList = [];
// vendors
const jsVendorList = [];
const cssVendorList = [];
// paths to relevant directories
const dirs = {
src: './sr... | scss: `${dirs.src}/**/*.scss`, |
<|file_name|>clientcache.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/lice... | if config, ok := c.configs[version]; ok { |
<|file_name|>change-password-prompt.component.ts<|end_file_name|><|fim▁begin|>/**
* Created by Андрей on 01.07.2017.
*/
import { Component } from '@angular/core';
import { DialogComponent, DialogService } from 'ng2-bootstrap-modal';
import { FormBuilder, FormControl, Validators } from '@angular/forms';
import { passC... | this.router.navigate(['/sign-in']);
},
(error) => {
this.serverError = JSON.parse(error._body); |
<|file_name|>bitcoin_pt_PT.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_PT" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Summitcoin</source>
<translation type="un... | <message> |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
__license__ = 'Public Domain'
import codecs
import io
import os
import random
import sys
from .options import (
parseOpts,
)
from .compat import (
compat_expanduser,
compa... | if opts.username is not None and opts.password is None:
opts.password = compat_getpass('Type account password and press [Return]: ') |
<|file_name|>bridges.py<|end_file_name|><|fim▁begin|>import threading
import upnp
import nupnp
class DiscoveryThread(threading.Thread):
def __init__(self, bridges):
super(DiscoveryThread, self).__init__()
self.bridges = bridges
<|fim▁hole|>
def run(self):
self.upnp_thread.start()
... | self.upnp_thread = upnp.UPnPDiscoveryThread(self.bridges)
self.nupnp_thread = nupnp.NUPnPDiscoveryThread(self.bridges) |
<|file_name|>type_coercion.rs<|end_file_name|><|fim▁begin|>// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under ... | None, |
<|file_name|>sale.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute i... | product_ids += [x.id for x in template.product_variant_ids]
result = mod_obj.xmlid_to_res_id(cr, uid, 'sale.action_order_line_product_tree',raise_if_not_found=True)
result = act_obj.read(cr, uid, [result], context=context)[0]
result['domain'] = "[('product_id','in',[" + ','.join(map(... |
<|file_name|>echo_cmdline_client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
"""
echo_cmdline_client.py
Copyright (c) 2018-2019 Alan Yorinks All right reserved.
Python Banyan is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
Version 3 a... | # When a message is received and its number is zero, finish up. |
<|file_name|>OpenVRRenderer.py<|end_file_name|><|fim▁begin|>from ctypes import c_float, cast, POINTER
import numpy as np
import OpenGL.GL as gl
import openvr
from openvr.gl_renderer import OpenVrFramebuffer as OpenVRFramebuffer
from openvr.gl_renderer import matrixForOpenVrMatrix as matrixForOpenVRMatrix
from openvr... | |
<|file_name|>connected-position-strategy.spec.ts<|end_file_name|><|fim▁begin|>import {ElementRef} from '@angular/core';
import {ConnectedPositionStrategy} from './connected-position-strategy';
import {ViewportRuler} from './viewport-ruler';
import {OverlayPositionBuilder} from './overlay-position-builder';
import {Conn... |
originElement.style.top = '200px'; |
<|file_name|>dom-utils.ts<|end_file_name|><|fim▁begin|>export const containerSize = () => document.getElementById('app-view-container') || { offsetHeight: 960, offsetWidth: 960 };
export const windowSize = () => ({ width: window.innerWidth, height: window.innerHeight });
export const browserLocale = () => {
let lang;... | // tslint:disable-next-line
if (nav.languages && nav.languages.length) {
// latest versions of Chrome and Firefox set this correctly |
<|file_name|>markers.py<|end_file_name|><|fim▁begin|>from numpy.random import random
from bokeh.plotting import figure, show, output_file
def mscatter(p, x, y, marker):
p.scatter(x, y, marker=marker, size=15,
line_color="navy", fill_color="orange", alpha=0.5)
def mtext(p, x, y, text):
p.text(x,... | |
<|file_name|>jquery.fatNav.js<|end_file_name|><|fim▁begin|>(function($, window, document) {
var pluginName = 'fatNav',
defaults = {};
function Plugin(options) {
this.settings = $.extend({}, defaults, options);
this._defaults = defaults;
this._name = pluginName;
this... |
this._bodyOverflow = $('body').css('overflow'); |
<|file_name|>ImageListCellRenderer.java<|end_file_name|><|fim▁begin|>package com.lizardtech.djvubean.outline;
import java.awt.Color;
import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.ListCellRenderer;
import javax.swing.UIManager;
public cla... | boolean cellHasFocus)
{
if (value instanceof JPanel)
{ |
<|file_name|>bitcoin_vi_VN.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="vi_VN">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Gridcoin</source>
<tran... | </message>
<message>
<location line="+4"/> |
<|file_name|>test_scan.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import unittest
import weakref
from pyopenapi.migration.scan import Scanner, Dispatcher, scan
from pyopenapi.migration.versions.v1_2.objects import (
ApiDeclaration, Authorization, Operation, ResponseMessage, Parameter)
from pyopenapi.m... | Operation: 20,
ResponseMessage: 23
})
|
<|file_name|>TimezonedbModel.ts<|end_file_name|><|fim▁begin|>export interface ITimezonedbModel {
status: string;
message: string;
countryCode: string;
countryName: string;
zoneName: string;
abbreviation: string;
gmtOffset: number;
dst: string;
dstStart: number;
dstEnd: number;<|f... | |
<|file_name|>test_marshaller_plugins.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014-2021, Freja Nordsiek
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source co... | ell = [1, 2, 'b1', b'3991', True, None] |
<|file_name|>skill_data.py<|end_file_name|><|fim▁begin|># Copyright 2018 Mycroft AI 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.0
#
# ... | Args:
basedir (str): path of directory to load from
bus (messagebus emitter): messagebus instance used to send the vocab to |
<|file_name|>hero-list.component.spec.js<|end_file_name|><|fim▁begin|>'use strict';
describe('heroList', function(){
//Load module that contains the heroList component
beforeEach(module('heroList'));
describe('HeroListController', function(){
it('should create a `heroes` model with 6 heroes', inject(function($c... | |
<|file_name|>require-min.js<|end_file_name|><|fim▁begin|>/*
RequireJS 2.2.0 Copyright jQuery Foundation and other contributors.
Released under MIT license, http://github.com/requirejs/requirejs/LICENSE
*/
var requirejs, require, define;
(function(ga) {
function ka(b, c, d, g) {
return g || ""
}
func... | H()
}, |
<|file_name|>file.go<|end_file_name|><|fim▁begin|>// Mgmt
// Copyright (C) 2013-2016+ James Shubin and the project contributors
// Written by James Shubin <james@shubin.ca> and the project contributors
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero Gen... | if obj.found { |
<|file_name|>0009_auto_20160516_0649.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-16 06:49
from __future__ import unicode_literals
from django.db import migrations, models<|fim▁hole|>
dependencies = [
('voximplant', '0008_auto_20160514_0800'),
]
op... |
class Migration(migrations.Migration): |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url
from . import views<|fim▁hole|> url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^logout/$', views.logout_view, name='logout'),
]<|fim▁end|> | from django.views.decorators.cache import cache_page
app_name = 'webinter'
urlpatterns = [ |
<|file_name|>modulemanager.js<|end_file_name|><|fim▁begin|>// Copyright 2008 The Closure Library 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
//
// h... | |
<|file_name|>ProxyViewList.js<|end_file_name|><|fim▁begin|>import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { Headline } from '@folio/stripes/components';
import css from './ProxyViewList.css';
const ProxyViewList = ({ records, name, label, itemCompon... | |
<|file_name|>error.go<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2019 the Octant contributors. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package component
import (
"fmt"
"github.com/vmware-tanzu/octant/internal/util/json"
)
// Error is a component for freetext
//
// +octant:component
type Err... |
return t.Config.Data < v.Config.Data |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010-2013 Código Sur Sociedad Civil.
# All rights reserved.
#
# This file is part of Cyclope.
#
# Cyclope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public ... | from django.db import models
from cyclope import settings as cyc_settings |
<|file_name|>test_split.py<|end_file_name|><|fim▁begin|>"""Test the split module"""
from __future__ import division
import warnings
import pytest
import numpy as np
from scipy.sparse import coo_matrix, csc_matrix, csr_matrix
from scipy import stats
from itertools import combinations
from itertools import combinations_w... | |
<|file_name|>show.js<|end_file_name|><|fim▁begin|>import PlanRequiredRoute from "../plan-required";
import Notify from 'ember-notify';
export default PlanRequiredRoute.extend({
model: function(params) {
var _this = this;
return this.store.find('entry', params.entry_id).then(function(entry) {<|fim▁hole|> ... | // Force a reload if the meta data is out of date
var meta = _this.store.metadataFor("entry"); |
<|file_name|>Player.java<|end_file_name|><|fim▁begin|>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package grupp07.model;
import java.util.ArrayList;
import javafx.scene.p... | |
<|file_name|>column.mako.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/. */
<%namespace name="helpers" file="/helpers.mako.rs" />
<%... | |
<|file_name|>EditablePanel.java<|end_file_name|><|fim▁begin|>/**
* Licensed to the Austrian Association for Software Tool Integration (AASTI)
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. The AASTI lic... | public class EditablePanel extends Panel {
|
<|file_name|>stringUtils.spec.ts<|end_file_name|><|fim▁begin|>/**
* @copyright 2009-2019 Vanilla Forums Inc.
* @license GPL-2.0-only
*/
import { hashString, splitStringLoosely, matchAtMention, labelize } from "./stringUtils";
describe("hashString()", () => {
it("the same string always results in the same value... | |
<|file_name|>unwind-unique.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/l... | |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|><|fim▁hole|>class AutodoappConfig(AppConfig):
name = 'AutoDoApp'<|fim▁end|> | from django.apps import AppConfig
|
<|file_name|>algorithm.py<|end_file_name|><|fim▁begin|>import hashlib
def hash_list():
return str(hashlib.algorithms_guaranteed)
def hash_text(algorithm_array, text, pass_count):
result_dict = {}
# Type checking
if type(pass_count) is not int:
return [False, {"error": "Pass count should be o... | return [False, {"error": "Text should be of 'string' type."}]
elif type(algorithm_array) is not list:
return [False, {"error": "Algorithm list should be of 'list' type."}] |
<|file_name|>idna.go<|end_file_name|><|fim▁begin|>// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:generate go run gen.go gen_trieval.go gen_common.go
// Package idna implements IDNA2008 using the compat... | display = &Profile{options{
useSTD3Rules: true, |
<|file_name|>2015-edition-warning.rs<|end_file_name|><|fim▁begin|>// run-rustfix
#![allow(non_camel_case_types)]<|fim▁hole|>//~^ ERROR `await` is a keyword
//~| WARN was previously accepted
pub struct await;
//~^ ERROR `await` is a keyword
//~| WARN was previously accepted
}
}
use outer_mod::await::await;
... | #![deny(keyword_idents)]
mod outer_mod {
pub mod await { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.