prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>layout-base.d.ts<|end_file_name|><|fim▁begin|>declare module "ui/layouts/layout-base" {
import view = require("ui/core/view");
import dependencyObservable = require("ui/core/dependency-observable");
/**
* Base class for all views that supports children positioning.
*/
export clas... | getChildrenCount(): number; |
<|file_name|>stats.operators.data.js<|end_file_name|><|fim▁begin|>'use strict';
var R6MStatsOpData = (function(R6MLangTerms, undefined) {
var WARNING_THRESHOLD = 20,
opStats = {
attackers: [],
defenders: [],
sortInfo: {
field: null,
rank: null,
isDescending: null
}... | bValue = b.statsAllRanks[sortField];
} else {
aValue = (a.statsByRank[optionalRank]) ? a.statsByRank[optionalRank][sortField] : -1;
bValue = (b.statsByRank[optionalRank]) ? b.statsByRank[optionalRank][sortField] : -1; |
<|file_name|>report.py<|end_file_name|><|fim▁begin|>import time
import csv<|fim▁hole|>def report(ob):
#Create log file
log_file_report = ob.file_destination + "/" + "Parameters_Results.log"
log_report = file(log_file_report, 'a' )
#Print parameters
#Batch or single file
... | |
<|file_name|>account-level-purchase-links.tsx<|end_file_name|><|fim▁begin|>import { CompactCard } from '@automattic/components';
import { useTranslate } from 'i18n-calypso';<|fim▁hole|> return (
<>
<CompactCard href="/me/purchases">{ translate( 'View all purchases' ) }</CompactCard>
</>
);
}<|fim▁end|> |
export default function AccountLevelPurchaseLinks() {
const translate = useTranslate(); |
<|file_name|>vec-matching-autoslice.rs<|end_file_name|><|fim▁begin|>pub fn main() {
let x = @[1, 2, 3];
match x {
[2, ..] => fail!(),
[1, ..tail] => {
assert_eq!(tail, [2, 3]);
}
[_] => fail!(),
[] => fail!()
}
let y = (~[(1, true), (2, false)], 0.5);... | } |
<|file_name|>expr.rs<|end_file_name|><|fim▁begin|>//* This file is part of the uutils coreutils package.
//*
//* (c) Roman Gafiyatullin <r.gafiyatullin@me.com>
//*
//* For the full copyright and license information, please view the LICENSE
//* file that was distributed with this source code.
use clap::{crate_version, ... | println!(
r#"Usage: expr EXPRESSION
or: expr OPTION |
<|file_name|>EditPanel.java<|end_file_name|><|fim▁begin|>package panels;
import javax.swing.JPanel;
import javax.swing.JTextArea;<|fim▁hole|>
public class EditPanel extends JPanel {
JTextArea srcEdit;
public EditPanel() {
srcEdit = new JTextArea(20, 30);
String src = ".data\n"
+ "a: .word 1, 2, 3\n";
... | |
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py
def lcm(a, b):
return a * b / gcd(a, b)
def gcd(a, b):
while b != 0:
(a, b) = (b, a % b)
return a
# Returns two integers x, y such that gcd(a, b) = ax + by
def egcd(a, b):
if a == 0:
return (0, 1)
el... |
# Returns incongruents solutions to a polynomial congruence
def polyCongr(coefficients, m): |
<|file_name|>SystemAttrEnum.java<|end_file_name|><|fim▁begin|>/*
* IRIS -- Intelligent Roadway Information System
* Copyright (C) 2009-2015 Minnesota Department of Transportation
* Copyright (C) 2012 Iteris Inc.
* Copyright (C) 2014 AHMCT, University of California
* Copyright (C) 2015 SRF Consulting Group
*
... | |
<|file_name|>role_table.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""Test of table output."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(KeyComboAction("End"))
sequence.append(KeyComboAction("Up"))
sequence.append(KeyComboAction("<Shift>Right"))
sequence.append(K... | sequence.append(utils.AssertPresentationAction(
"2. Next row", |
<|file_name|>license-helper-spec.js<|end_file_name|><|fim▁begin|>import {writeArray} from 'event-stream';
import gulp from 'gulp';
import license from '../../tasks/helpers/license-helper';
describe('license', () => {
let result;
beforeEach(done => {
const licenseStream = gulp.src('src/pivotal-ui/components/al... | }); |
<|file_name|>Lower.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2010, 2013, 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 Public... | public Node leaveSwitchNode(final SwitchNode switchNode) {
if(!switchNode.isUniqueInteger()) {
// Wrap it in a block so its internally created tag is restricted in scope |
<|file_name|>factory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
destination.factory
'''<|fim▁hole|>from destination.aws import AwsDestination
from exceptions import AutocertError
from config import CFG
from app import app
class DestinationFactoryError(AutocertError):
def __i... |
from destination.zeus import ZeusDestination |
<|file_name|>electrum_es_ES.ts<|end_file_name|><|fim▁begin|><TS language="es_ES" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Haz clic derecho para editar la dirección o la etiqueta</translation>
</message>... | <context>
<name>ElectrumGUI</name>
<message>
<source>Sign &message...</source> |
<|file_name|>cwlutils.py<|end_file_name|><|fim▁begin|>"""Useful utilities for handling CWL inputs and outputs.
This is shared functionality abstracted across multiple approaches, currently
mostly handling CWL records. This needs some generalization to apply across
non-variant calling workflows.<|fim▁hole|>import colle... | """ |
<|file_name|>dump_db_classes.py<|end_file_name|><|fim▁begin|>import shelve
db = shelve.open('class-shelve')
for key in db:<|fim▁hole|>print(bob.lastName())
print(db['tom'].lastName)<|fim▁end|> | print(key, '=>\n)', db[key].name, db[key].pay)
bob = db['bob'] |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>import Vue from 'vue'
import Kanban from './components/kanban-app.vue'
import store from './store.js'
new Vue({
el: '#app',<|fim▁hole|>})<|fim▁end|> | store,
render: h => h(Kanban) |
<|file_name|>basic_services_broker.py<|end_file_name|><|fim▁begin|>from ..broker import Broker
class BasicServicesBroker(Broker):
controller = "basic_services"
def authenticate(self, **kwargs):
"""Authenticates the user with NetMRI.
**Inputs**
| ``api version min:`` None
... | | ``default:`` None |
<|file_name|>test1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
<|fim▁hole|>from framework import do_exit, get_globals, main
def do_work():
global g_test_import
global globals1
print("do_work")
globals1 = get_globals()
g_test_import = globals1["g_test_import"]
print("do_work: g_test_i... | |
<|file_name|>iso.hh<|end_file_name|><|fim▁begin|>/*
* The ckFileSystem library provides core software functionality.
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 Fr... | * |
<|file_name|>default.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
Template Add-on
Copyright (C) 2016 Demo
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 v... | def Menu(name,url,mode,iconimage,fanart,description,showcontext=True,allinfo={}): |
<|file_name|>share_tensor_test.py<|end_file_name|><|fim▁begin|># third party
# third party<|fim▁hole|>import numpy as np
import pytest
# syft absolute
# absolute
from syft.core.tensor.smpc.share_tensor import ShareTensor
@pytest.mark.smpc
def test_bit_extraction() -> None:
share = ShareTensor(rank=0, parties_inf... | |
<|file_name|>webgl_paint_thread.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/. */
use canvas_traits::{CanvasCommonMsg, CanvasData, C... | };
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>"""
Setup script for the Gimbal package
"""<|fim▁hole|>from setuptools import find_packages
def readme():
"""Returns the contents of the README without the header image."""
header = '======\nGimbal\n======\n'
with open('README.rst', 'r') as f:
f.r... | from setuptools import setup |
<|file_name|>concurrenttools.py<|end_file_name|><|fim▁begin|>"""
Concurrent downloaders
"""
import os
import sys
import signal
import logging
import itertools
from functools import partial
from concurrent.futures import ProcessPoolExecutor
from pomp.core.base import (
BaseCrawler, BaseDownloader, BaseCrawlExceptio... | |
<|file_name|>combineLatestWith.ts<|end_file_name|><|fim▁begin|>import { ObservableInputTuple, OperatorFunction, Cons } from '../types';
import { combineLatest } from './combineLatest';
/**
* Create an observable that combines the latest values from all passed observables and the source
* into arrays and emits them.
... | * document.body.appendChild(input1);
* const input2 = document.createElement('input'); |
<|file_name|>validation.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding=utf-8
from __future__ import division, print_function, unicode_literals
import re
import unicodedata
h1_start = re.compile(r"^\s*=(?P<title>[^=]+)=*[ \t]*")
valid_title = re.compile(r"[^=]+")
general_heading = re.compile(r"^\s*(={2,... | |
<|file_name|>slice.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
use std::collections::{BTreeMap, HashMap, HashSet};
use std::sync::Arc;
use anyhow::{an... | .map(Ok::<_, Error>),
))
}) |
<|file_name|>angelloModelSpec.js<|end_file_name|><|fim▁begin|>describe('Service: angelloModel', function() {
//load module for service
beforeEach(module('Angello'));
var modelService;
beforeEach(inject(function(angelloModel) {
modelService = angelloModel;
}));
describe('#getStatuses', function() {
it('sho... | });
});
}); |
<|file_name|>test_polynomial.py<|end_file_name|><|fim▁begin|>"""Tests for polynomial module.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.polynomial.polynomial as poly
from numpy.testing import (
TestCase, assert_almost_equal, assert_raises,
assert_equal... | assert_almost_equal(trim(res), trim(tgt)) |
<|file_name|>kakasi.py<|end_file_name|><|fim▁begin|>#===============================================================================
import re
from untwisted.magic import sign
from channel import not_quiet
from runtime import later
import message
import util
import limit
import kakasi_lib
link, install, uninstall =... | raw_reply = kakasi_lib.kakasi(msg) |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import *
from . import views
from . import z_queries
from rockletonfortune import settings
from django.contrib.auth.views import login, logout
from django.contrib.auth.decorators import login_required
from django.contrib.auth import views as auth_... |
# Edit the weekly/monthly allocation per secondary transaction
url(r'budget/edit/$', login_required(views.budget_edit), name = 'budget_edit'),
|
<|file_name|>module.js<|end_file_name|><|fim▁begin|>// Copyright 2015 Peter Beverloo. All rights reserved.
// Use of this source code is governed by the MIT license, a copy of which can
// be found in the LICENSE file.
<|fim▁hole|>export class Module {
constructor(env) {
this.env_ = env;
let decoratedRoutes ... | // Base class for a module. Stores the environment and handles magic such as route annotations. |
<|file_name|>PopulatePackages.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Populate package directories.
#
# python PopulatePackages.py < packages.csv
#
# The input packages.csv table must have these columns:
#
# Package Name,Directory Name,Prefixes,File Numbers,File Names,Globals
#
# Rows with an empty ... | globals = set(glob.glob('*.zwr'))
#----------------------------------------------------------------------------- |
<|file_name|>parametric_attention_test.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2022 The Google Research 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
#
# htt... | |
<|file_name|>NWStreamBlockVideo.cpp<|end_file_name|><|fim▁begin|>/*
* This file is part of NWFramework.
* Copyright (c) InCrew Software and Others.
* (See the AUTHORS file in the root of this distribution.)
*
* NWFramework is free software; you can redistribute it and/or modify
* ... | }
else
{
|
<|file_name|>spline.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2015 Airbus
# Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licen... | # limitations under the License. |
<|file_name|>BudgetsPage.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
import { Component } from 'react';
import { Button, Checkbox, Icon, Table, Input, Container } from 'semantic-ui-react'
import { observable, action } from "mobx";
import { observer } from "mobx-react";
import { BudgetEditorModal } ... | this.budgetToDelete = undefined;
}
@action onDeleteReject = () => { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Licensed under a 3-clause BSD style license - see LICENSE.rst
""" astropy.cosmology contains classes and functions for cosmological
distance measures and other cosmology-related calculations.
See the `Astropy documentation
<https://docs.astropy.org/en/latest/cosm... | from .parameter import *
from .realizations import * |
<|file_name|>ui.js<|end_file_name|><|fim▁begin|>var ui = (function () {
function buildOnlineUsersList(users) {
var div = '<h1>Online users</h1>'
var ul = '<ul id="online-users">';
for (var i = users.length - 1; i >= 0; i--) {
var li = $('<li class = "online-user" data-username='... | // Adding colors to the messages
if (localStorage.getItem("username") == senderUsername) {
li += '<span class="blue-message">';
} |
<|file_name|>range_ex.py<|end_file_name|><|fim▁begin|># range_ex.py Test of asynchronous mqtt client with clean session False.
# Extended version publishes SSID
# (C) Copyright Peter Hinch 2017-2019.
# Released under the MIT licence.
# Public brokers https://github.com/mqtt/mqtt.github.io/wiki/public_brokers
# This d... | async def wifi_han(state): |
<|file_name|>auth.module.js<|end_file_name|><|fim▁begin|>/**
* @author shirishgoyal
* created on 16.12.2015
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.auth', [
'BlurAdmin.services'
])
.config(routeConfig);
/** @ngInject */
function routeConfig($stateProvide... | // .state('auth.login', {
// url: '/login', |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate clap;
mod cli;
mod config;
mod core;
mod util;
use std::fs::File;
use std::io::prelude::*;
use dotenv::dotenv;
use crate::config::Config;
fn main() -> std::io::Result<()> {
dotenv().ok();
let matches = cli::app().get_matches();
... | let mut config_file = File::open(config_path)?;
let mut contents = String::new(); |
<|file_name|>hitbtc_test.go<|end_file_name|><|fim▁begin|>package hitbtc
import (
"context"
"errors"
"log"
"net/http"
"os"
"sync"
"testing"
"time"
"github.com/gorilla/websocket"
"github.com/thrasher-corp/gocryptotrader/common"
"github.com/thrasher-corp/gocryptotrader/config"
"github.com/thrasher-corp/gocry... | |
<|file_name|>1d46e8d4483_add_mod_versioning.py<|end_file_name|><|fim▁begin|>"""Add mod versioning<|fim▁hole|>
"""
# revision identifiers, used by Alembic.
revision = '1d46e8d4483'
down_revision = '2650a2191fe'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic -... |
Revision ID: 1d46e8d4483
Revises: 2650a2191fe
Create Date: 2014-06-10 01:29:49.567535 |
<|file_name|>storage.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
author: Jimmy
contact: 234390130@qq.com
file: storage.py
time: 2017/9/4 下午3:18
description:
'''
__author__ = 'Jimmy'
import pymongo
from ctp.ctp_struct import *
from bson import json_util as jsonb
from util... | def getMaxOrderRef():
db = _getDataBase() |
<|file_name|>recipe_manager.py<|end_file_name|><|fim▁begin|>import os
from iotile.core.dev import ComponentRegistry
from iotile.ship.recipe import RecipeObject
from iotile.ship.exceptions import RecipeNotFoundError
class RecipeManager:
"""A class that maintains a list of installed recipes and recipe actions.
... | |
<|file_name|>overlap.py<|end_file_name|><|fim▁begin|>from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from ._overlap import _compute_overlap
__all__ = ['compute_overlap']
def compute_overlap(ilon, ilat, olon, olat):
"""Compute the ove... | |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Watermarks documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 8 16:49:39 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration v... | # If false, no index is generated. |
<|file_name|>07_ExampleDoc.py<|end_file_name|><|fim▁begin|>#ImportModules
import ShareYourSystem as SYS
#define and get two children
MyParenter=SYS.ParenterClass(
).array(
[
['-Layers'],
['|First','|Second'],
['-Neurons'],
['|E','|I']
]
).command(
'+-.values+|.values',
'#call:parent',
_AfterWal... | '#value:#map@get':["/~/ManagementTagStr",">>self"],
'#if':[
('/~/^/ParentKeyStr',SYS.operator.eq,"#direct:Layers")
] |
<|file_name|>step6_file.rs<|end_file_name|><|fim▁begin|>use std::rc::Rc;
//use std::collections::HashMap;
use fnv::FnvHashMap;
use itertools::Itertools;
#[macro_use]
extern crate lazy_static;
extern crate regex;
extern crate itertools;
extern crate fnv;
extern crate rustyline;
use rustyline::error::ReadlineError;
use... | }, |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#
# Copyright 2017 University of Southern California
#<|fim▁hole|># you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | # Licensed under the Apache License, Version 2.0 (the "License"); |
<|file_name|>0002_make_unique_per_user.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('subscriptions', '0001_initial'),
]
operations = [
migrations.AlterUniqueTogether(
name='personalarticl... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import cx_Freeze
import sys
<|fim▁hole|>
executables = [cx_Freeze.Executable("MusicCompiler.py", base=None)]
cx_Freeze.setup(
name= "MusicCompiler",
description = "Best Program Ever Known To Humanity.",
author = "Space Sheep Enterprises",
opt... | import os
|
<|file_name|>test.py<|end_file_name|><|fim▁begin|>g = 2<|fim▁hole|><|fim▁end|> | i = 2
<warning descr="Non-ASCII character 'ɡ' in the file, but no encoding declared">ɡ</warning> = 1
a = g + i |
<|file_name|>window_platform_event.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modific... | |
<|file_name|>EntityRenderEvent.java<|end_file_name|><|fim▁begin|>package de.gurkenlabs.litiengine.entities;
import de.gurkenlabs.litiengine.graphics.RenderEngine;
import java.awt.Graphics2D;
import java.util.EventObject;
/**
* This {@code EventObject} contains data about the rendering process of an entity.
*
* @se... | * @return The graphics object on which the entity is rendered.
*/
public Graphics2D getGraphics() { |
<|file_name|>ARDecoder.py<|end_file_name|><|fim▁begin|>__author__ = 'Marko Milutinovic'
"""
This class will implement an Arithmetic Coding decoder
"""
import array
import utils
import math
class ARDecoder:
BITS_IN_BYTE = 8
def __init__(self, wordSize_, vocabularySize_, terminationSymbol_):
"""
... |
if(self.mCurrentEncodedDataByteIndex >= self.mEncodedDataCount):
raise Exception("Exceeded encoded data buffer") |
<|file_name|>link-input.js<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as published by
* the Free Software Found... | );
|
<|file_name|>test_conversion.py<|end_file_name|><|fim▁begin|># Licensed under the GPLv3 - see LICENSE
import pytest
import numpy as np
import astropy.units as u
from astropy.time import Time
from .. import vdif
from .. import mark4
from .. import mark5b
from .. import dada
from ..base.encoding import EIGHT_BIT_1_SIGMA
... | vd0, vd1 = vdif_payload0.data, vdif_payload1.data
assert np.allclose(vd0, vdif_data[:, 0, :])
assert np.allclose(vd1, vdif_data[:, 1, :])
vd = np.zeros((vd0.shape[0], 2, vd0.shape[1]), vd0.dtype) |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var _ = require('underscore');
var keystone = require('../../');
var utils = keystone.utils;
/**
* Content Class
*
* Accessed via `Keystone.content`
*
* @api public
*/
var Content = function () {};
/**
* Loads page content by page key (optional).
*
* If pag... | } |
<|file_name|>String.js<|end_file_name|><|fim▁begin|>/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.<|fim▁hole|> * LICENSE.txt file that wa... | *
* For the full copyright and license information, please read the |
<|file_name|>main.py<|end_file_name|><|fim▁begin|># encoding: utf-8
# main.py, copyright 2014 by Marko Čibej <marko@cibej.org>
#
# This file is part of SvgMapper. Full sources and documentation
# are available here: https://github.com/tumbislav/SvgMapper
#
# This program is free software; you can redistribute it and/o... | if the_log:
level = log_levels[int(the_log[0])] |
<|file_name|>unifi.py<|end_file_name|><|fim▁begin|>"""
Support for Unifi WAP controllers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.unifi/
"""
import logging
import urllib
from homeassistant.components.device_tracker import DOMAIN
fr... | """
client = self._clients.get(mac, {})
name = client.get('name') or client.get('hostname') |
<|file_name|>httpclient.go<|end_file_name|><|fim▁begin|>package httpclient
//Verbatim from: https://gist.github.com/dmichael/5710968
import (<|fim▁hole|> "net/http"
"net/http/httputil"
"time"
"github.com/sirupsen/logrus"
)
// Config encapsulates the basic settings for the HTTPClient
type Config struct {
Connect... | "errors"
"net" |
<|file_name|>TypeTextAtCefTest.ts<|end_file_name|><|fim▁begin|>import { Keys } from '@ephox/agar';
import { describe, it } from '@ephox/bedrock-client';
import { TinyAssertions, TinyContentActions, TinyHooks, TinySelections } from '@ephox/mcagar';
import Editor from 'tinymce/core/api/Editor';
import Theme from 'tinymc... |
it('Type after cef inline element', () => {
const editor = hook.editor();
editor.setContent('<p><span contenteditable="false">a</span></p>'); |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>/*
* TLRW algorithm implementation for Rust.
* Let's see what we can do here.
*
* (c) Silly Hat, 2016.
*/
/*
* Features, additional crates and constants go here.
*/
#![allow(dead_code)]
extern crate libc;
extern crate rand;
extern crate time;
use rand::Rng... | |
<|file_name|>zkocc_structs.go<|end_file_name|><|fim▁begin|>// Copyright 2012, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package zk
// contains the structures used for RPC calls to zkocc.
import (
"time"
)
type ZkStat str... | func (zkStat *ZkStat) NumChildren() int {
return zkStat.numChildren
} |
<|file_name|>splashscreen.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2011-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "splashscreen.h"
#include "clientversion.h"
#include "util... | newPixmap = QPixmap(":/images/splash");
}
|
<|file_name|>today.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import { ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import * as moment from 'moment';
import { SlimLoadingBarService } from ... | private _state: AppState,
private router: Router,
private slimLoadingBarService: SlimLoadingBarService,
private viewAppointmentService: ViewAppointmentService |
<|file_name|>download.rs<|end_file_name|><|fim▁begin|>use async_trait::async_trait;
use cucumber::given;
use snafu::ResultExt;
use crate::error;
use crate::error::Error;
use crate::state::{GlobalState, State, Step, StepStatus};
use tests::download;
// Download OSM
#[given(regex = r"osm file has been downloaded for (... | })
.await |
<|file_name|>sort.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
'''A simple implementation of a sorting algorithm, meant to allow
people to manually rank a list of items using whatever subjective or
objective criteria they want.
This program can be called as a script and used interactively. You
can provide t... | |
<|file_name|>ItemElectricEngine.java<|end_file_name|><|fim▁begin|>package adamros.mods.transducers.item;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import adamros.mods.transducers.Transducers;
import net.minecraft.entity.player.EntityPlayer;
import net.minecra... | |
<|file_name|>SelectionSort9.java<|end_file_name|><|fim▁begin|>package main.java;
public class SelectionSort9 {
public static <T extends Comparable<T>> void sort(final T[] a) {
for (int i = 0; i < a.length - 1; i++) {
int min = i;
for (int j = i + 1; j < a.length; j++) {
if (a[j].compareTo(a[min]) < 0) ... | } |
<|file_name|>TaskListSoapInterface.java<|end_file_name|><|fim▁begin|>/*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* The Apereo Foundation licenses this file to ... | * 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|>rest.go<|end_file_name|><|fim▁begin|>package imagestreamimport
import (
"fmt"
"net/http"
"time"
"github.com/golang/glog"
gocontext "golang.org/x/net/context"
kapierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/a... | specTag.ReferencePolicy = referencePolicy
stream.Spec.Tags[tag] = specTag |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Provides NN for a CUDA backend.
#![allow(missing_docs)]
use ::plugin::*;
use co::prelude::*;
use co::plugin::Error as PluginError;
use cudnn::*;
#[macro_use]
pub mod helper;
lazy_static! {
static ref CUDNN: Cudnn = Cudnn::new().unwrap();
}
pub trait ICudnnDesc... | /// Creates a TensorDescriptor similar to `cudnn_tensor_desc`,
/// but will create a fitting 3D tensor if the actual tensor would be 1D/2D.
///
/// This should be used in operations where the shape doesn't really matter |
<|file_name|>i18n_subsites.py<|end_file_name|><|fim▁begin|>"""i18n_subsites plugin creates i18n-ized subsites of the default site
This plugin is designed for Pelican 3.4 and later
"""
import os
import six
import logging
import posixpath
from copy import copy
from itertools import chain
from operator import attrgett... | _MAIN_LANG = None # lang of the main Pelican instance
_MAIN_SITEURL = None # siteurl of the main Pelican instance |
<|file_name|>bpath.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <string>
#include <boost/filesystem.hpp>
int main() {
std::string ps = "/usr/local/dayu/scripts"; <|fim▁hole|> p /= "kk.py";
std::cout << p.string() << std::endl;
std::cout << p.stem() << std::endl;
std::cout << p... | boost::filesystem::path p(ps); |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>#
# This file is part of pysmi software.
#
# Copyright (c) 2015-2020, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pysmi/license.html
#
<|fim▁hole|>
class AbstractSearcher(object):
def setOptions(self, **kwargs):
for k in kwargs:
... | |
<|file_name|>workerglobalscope.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/. */
use dom::bindings::codegen::Bindings::FunctionBindi... |
pub struct WorkerGlobalScopeInit {
pub resource_task: ResourceTask,
pub mem_profiler_chan: mem::ProfilerChan, |
<|file_name|>discovery.py<|end_file_name|><|fim▁begin|># Copyright (C) 2010 Google 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
#
#... | Returns: |
<|file_name|>modifiedCluster.py<|end_file_name|><|fim▁begin|>import numpy as np
from sklearn import cluster, datasets, preprocessing
import pickle
import gensim
import time
import re
import tokenize
from scipy import spatial
def save_obj(obj, name ):
with open( name + '.pkl', 'wb') as f:
pickle.dump(obj, f... | X_Scaled_Feature_Vecs=[]
for word in model.vocab:
X_Scaled_Feature_Vecs.append(model[word])
|
<|file_name|>GlobalExceptionHandler.java<|end_file_name|><|fim▁begin|>package com.raymond.entrypoint;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
import org.springframework.security.core.AuthenticationException;<|fim▁hole|>import javax.servlet.http.HttpSer... | import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
|
<|file_name|>ScriptLanguageActionExecutor.java<|end_file_name|><|fim▁begin|>/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this ... | *
* Unless required by applicable law or agreed to in writing, software |
<|file_name|>error.cpp<|end_file_name|><|fim▁begin|>#include "stdafx.h"
#include "com4j.h"
void error( JNIEnv* env, const char* file, int line, HRESULT hr, const char* msg ... ) {
// format the message
va_list va;
va_start(va,msg);<|fim▁hole|> vsprintf(w,msg,va);
env->ExceptionClear();
env->Throw( (jthrowable)co... |
int len = _vscprintf(msg,va);
char* w = reinterpret_cast<char*>(alloca(len+1)); // +1 for '\0' |
<|file_name|>fluxx.visualizations.js<|end_file_name|><|fim▁begin|>(function($){
$.fn.extend({
renderChart: function() {
return this.each(function() {
var $chart = $(this);
if ($chart.children().length > 0)
return;
var data = $.parseJSON($chart.html());
var saveHTML... | var $td = $('td:first', $(this));
if (legend[$.trim($td.text())])
legend[$.trim($td.text())].canvas._elem.css('opacity', '.5');
}, function(e) { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Module computes indentation for block
It contains implementation of indenters, which are supported by katepart xml files
"""
import logging
logger = logging.getLogger('qutepart')
from PyQt4.QtGui import QTextCursor
def _getSmartIndenter(indenterName, qpart,... | insertIndent()
else: |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from app.core.helper import create_app
from app.core.db import db
from app.core.json import json_respon
from app.user.views import user_views
from app.user.models import*
from app.user.loginmanager import login_manager
from app.hotel.views import hotel_views
from ... | |
<|file_name|>AllPlot.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2006 Sean C. Rhea (srhea@srhea.net)
* Copyright (c) 2010 Mark Liversedge (liversedge@gmail.com)
*
* 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 th... | objects->smoothRPCO[secs] = totalRPCO / list.size();
objects->smoothLPP[secs] = QwtIntervalSample( bydist ? totalDist : secs / 60.0, QwtInterval(totalLPPB / list.size(), totalLPPE / list.size() ) );
objects->smoothRPP[secs] = QwtIntervalSample( bydist ? totalDist ... |
<|file_name|>convert.go<|end_file_name|><|fim▁begin|>/*
Copyright 2019 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
Unless... | |
<|file_name|>uniprot_parser_v01.py<|end_file_name|><|fim▁begin|>__author__ = 'nicolas'
# coding=utf-8
from os.path import expanduser
from ordereddict import OrderedDict
from Bio import SwissProt
import time
import MySQLdb as mdb
"""
Fuck!
from ordereddict import OrderedDict
import MySQLdb as mdb
dicc = {}
dictdebug_... | # Variables del script
database = "ptmdb"
tabla_cuentas = "sprot_count1" |
<|file_name|>uhd_fft_qt.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: UHD FFT Qt
# Author: Johannes Demel
# Generated: Wed Jan 29 13:51:16 2014
##################################################
from PyQt4 import Qt
from g... | self.usrp_dev.set_samp_rate(self.samp_rate)
def get_rf_label(self): |
<|file_name|>sonnet_predict_bed.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2017 Calico 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.or... | out_h5.create_dataset('start', data=site_seqs_start) |
<|file_name|>HarmonyApplication.java<|end_file_name|><|fim▁begin|>package org.mariotaku.harmony.app;
import android.app.Application;
import android.content.Context;
import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra1... | public class HarmonyApplication extends Application implements Constants {
private ImageLoaderWrapper mImageLoaderWrapper; |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'
const path = require('path')
const Generator = require('yeoman-generator')
const chalk = require('chalk')
const _ = require('lodash')
_.templateSettings.interpolate = /<%=([\s\S]+?)%>/g<|fim▁hole|> this.props = {}
},
paths: function () {
this.s... |
module.exports = Generator.extend({
initializing: function () { |
<|file_name|>CommonProxy.java<|end_file_name|><|fim▁begin|>package com.technode.terrafirmastuff.core.proxy;
import com.bioxx.tfc.api.Tools.ChiselManager;
import com.technode.terrafirmastuff.handler.ServerTickHandler;
import com.technode.terrafirmastuff.tileentity.TEOilLampMod;
import com.technode.terrafirmastuff.tools... | import com.technode.terrafirmastuff.tools.ChiselMode_Paver;
import com.technode.terrafirmastuff.tools.ChiselMode_Pillar;
import cpw.mods.fml.common.FMLCommonHandler; |
<|file_name|>test_calc.py<|end_file_name|><|fim▁begin|>import pytest
from calc import INTEGER, EOF, PLUS, Calc, CalcError
def test_calc_raises_error_on_invalid_tokens():
"""
Test that invalid tokens cause a ``CalcError`` and that the exception stack
trace contains useful information.
"""
input_te... | def test_calc_finds_eof_token_after_int():
"""
Test that after consuming a solitary an INTEGER :class:`Token` a |
<|file_name|>azure_rm_managed_disk.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright (c) 2017 Bruno Medina Bolanos Cacho <bruno.medina@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_func... | |
<|file_name|>generator_matrix.py<|end_file_name|><|fim▁begin|>import random
import time
import sys
import Csound
import subprocess
import base64
import hashlib
import matrixmusic
csd = None
oscillator = None
buzzer = None
voice = None
truevoice = None
song_publisher = None
def add_motif(instrument, req):
global c... | elif motif.instrument == 'voice':
add_motif(voice, motif)
csd.output() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.