prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>user.service.ts<|end_file_name|><|fim▁begin|>import { BaseService } from '../service';
import { inherits } from 'util';
import { Inject, Injectable } from '@angular/core';
import { Http, Response, Headers, Request, RequestMethod } from '@angular/http';
import { Observable } from 'rxjs/Rx';
// Import RxJs ... | Roles: IRole[] |
<|file_name|>preloader.service.ts<|end_file_name|><|fim▁begin|>import {Injectable} from '@angular/core';
@Injectable()
export class PreloaderService {
private static loaders:Array<Promise<any>> = [];
public static registerLoader(method:Promise<any>):void {
PreloaderService.loaders.push(method);
}
public... | });
}
} |
<|file_name|>0005_adjust_issue_report_fields.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-07-29 13:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("issuetracker", "0004_data_migration_set_bugzilla_to_all... | max_length=255, |
<|file_name|>ble_live_read_graphical.py<|end_file_name|><|fim▁begin|>from bluepy.btle import *
import time
import serial
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg
start_time = time.time()
data = []
data2 = []
data3 = []
data4 = []
angles = []
pg.setConfigOption('background', 'w')
pg.setConfigOpti... | plotWidget.plotItem.getAxis('bottom').setPen(pen)
curve = plotWidget.plot(pen=pen) |
<|file_name|>generate-barcode-and-get-image-as-stream.py<|end_file_name|><|fim▁begin|>import asposebarcodecloud
from asposebarcodecloud.BarcodeApi import BarcodeApi
from asposebarcodecloud.BarcodeApi import ApiException
import ConfigParser
config = ConfigParser.ConfigParser()
config.readfp(open(r'../../data/co... | |
<|file_name|>size_constraint.rs<|end_file_name|><|fim▁begin|>use std::cmp::min;
/// Single-dimensional constraint on a view size.
///
/// This describes a possible behaviour for a [`ResizedView`].
///
/// [`ResizedView`]: crate::views::ResizedView
#[derive(Debug, Clone, Copy)]
pub enum SizeConstraint {
/// No cons... | SizeConstraint::Fixed(value) => value, |
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2012-2013 University of Stuttgart.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public... | * passed As the JSP itself handles plain Java objects and not Responses, the |
<|file_name|>rpcservices.py<|end_file_name|><|fim▁begin|># This file is part of the dionaea honeypot
#
# SPDX-FileCopyrightText: 2009 Paul Baecher & Markus Koetter & Mark Schloesser
# SPDX-FileCopyrightText: 2010 Markus Koetter & Tan Kean Siong
# SPDX-FileCopyrightText: 2015 Katarina Durechova
# SPDX-FileCopyrightText:... | if isinstance(self.__packer, ndrlib.Packer): |
<|file_name|>Main.java<|end_file_name|><|fim▁begin|>package PathFinder_2;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Toolkit;
import javax.swing.JFrame;
<|fim▁hole|>public class Main extends JFrame{
private static final long serialVersionUID = 1L;
private final String TITLE = "Are... | |
<|file_name|>bad-reg.rs<|end_file_name|><|fim▁begin|>// only-x86_64<|fim▁hole|>
#![feature(asm, asm_const, asm_sym)]
fn main() {
let mut foo = 0;
let mut bar = 0;
unsafe {
// Bad register/register class
asm!("{}", in(foo) foo);
//~^ ERROR invalid register class `foo`: unknown regis... | // compile-flags: -C target-feature=+avx2 |
<|file_name|>TraceTimeInvocationHandler.java<|end_file_name|><|fim▁begin|>/*
* This file is part of Log4Jdbc.
*
* Log4Jdbc 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 the License, ... | */
public class TraceTimeInvocationHandler implements InvocationHandler {
|
<|file_name|>more-gates.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lice... | |
<|file_name|>data_provider_neo.py<|end_file_name|><|fim▁begin|>import os
import sys
from copy import copy
from collections import OrderedDict
import traceback
import atexit
import neo
from data_provider import DataProvider
from .. import conversions as convert
class NeoDataProvider(DataProvider):
""" Base class... | used.
"""
cascade = 'lazy' if cls.cascade_lazy else True |
<|file_name|>plot_afq_reco80.py<|end_file_name|><|fim▁begin|>"""
==========================
RecoBundles80 using AFQ API
==========================
An example using the AFQ API to run recobundles with the
`80 bundle atlas <https://figshare.com/articles/Advanced_Atlas_of_80_Bundles_in_MNI_space/7375883>`_.
"""
import o... | # ---------------------
# |
<|file_name|>no_backspace_delete.js<|end_file_name|><|fim▁begin|>/**
* Tom Select v1.7.5
* Licensed under the Apache License, Version 2.0 (the "License");
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../tom-select.js')) :
typeof define === 'funct... | function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } |
<|file_name|>integration_entity.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Talon.One API
The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the ot... |
import pprint
import re # noqa: F401
|
<|file_name|>run_game.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import pygame
import math
import random
import sys
import PixelPerfect
from pygame.locals import *
from water import Water
from menu import Menu
from game import Game
from highscores import Highscores
from options import Options
import util
f... | |
<|file_name|>delta.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | ../../../../../../share/pyshared/ubuntuone-storage-protocol/ubuntuone/storageprotocol/delta.py |
<|file_name|>test_continuous_sampling.py<|end_file_name|><|fim▁begin|>import unittest
import numpy as np
from pgmpy.factors.continuous import JointGaussianDistribution as JGD
from pgmpy.sampling import (HamiltonianMC as HMC, HamiltonianMCDA as HMCda, GradLogPDFGaussian, NoUTurnSampler as NUTS,
... | HMC(model=self.test_model).generate_sample(1, 1, 1).send(None)
def test_acceptance_prob(self): |
<|file_name|>TagDomain.ts<|end_file_name|><|fim▁begin|>/**
* Enumeration for tag domains.
* @enum {number}
* @readonly
* @description Defines where lines between two vertices are treated
* as straight.<|fim▁hole|> */
export enum TagDomain {
/**
* Treats lines between two vertices as straight in the
*... | *
* Only applicable for polygons. For rectangles lines between
* vertices are always treated as straight in the distorted 2D
* projection and bended in the undistorted 3D space. |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import fs from "fs";
import { Middleware } from "koa";
import path from "path";
import { Environment } from "../Environment";
import { exportModules, isFunction, notNullFilter } from "../utilities";
export interface IMiddleware {
name: string;
rank: number;
fun... | };
}
return middlewares; |
<|file_name|>db.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2014, 2015, Stephan Rave
# 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 cod... | return self.__dict__
def __repr__(self):
return ', '.join(str(k) + ': ' + str(v) for k, v in sorted(self.dict.items())) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
from .premailer import Premailer, transform<|fim▁hole|><|fim▁end|> |
__version__ = '2.9.4' |
<|file_name|>channel-form.component.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2017 JBoss 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.apach... | |
<|file_name|>Schema.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
sipptam.conf.Schema
~~~~~~~~~~~~~~~~~~~
Contains a basic XML schema to parse the input configuration file.
:copyright: (c) 2013 by luismartingil.
:license: See LICENSE_FILE.
"""
import StringIO
sche... | </xs:sequence>
<xs:attribute name="id" type="xs:string" use="required"/>
</xs:complexType>
|
<|file_name|>cityhash.rs<|end_file_name|><|fim▁begin|>use std::mem;
pub fn cityhash32(mut s: &[u8], len: usize) -> u32 { // mut s: &[u8]
if len <= 24 {
return if len <= 12 {<|fim▁hole|> if len <= 4 {
hash32Len0to4(s, len)
} else {
hash32_len_5_to_12(s, len)
}
} els... | |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>//! This tiny build script ensures that rocket is not compiled with an
//! incompatible version of rust.
extern crate yansi;
extern crate version_check;
use yansi::Color::{Red, Yellow, Blue, White};
use version_check::{supports_features, is_min_version, is_min_date};... | println!("cargo:warning={}", "Build may fail due to incompatible rustc version.");
}
} |
<|file_name|>plotIndices.py<|end_file_name|><|fim▁begin|>import os
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
from matplotlib import cm
import atmath
# Define the observable
srcDir = '../runPlasim/postprocessor/indices/'
# SRng = np.array([1260, 1360, 1380, 1400, 1415, 1425, 1430, 1433... | ax.set_ylabel(indexChoice[0], fontsize=fs_latex)
plt.setp(ax.get_xticklabels(), fontsize=fs_xticklabels)
plt.setp(ax.get_yticklabels(), fontsize=fs_yticklabels)
plt.title('Seasonal cycle for case %s_%d\n\sigma = %.5f' % (restartState, S, seasonal.std())) |
<|file_name|>mssql_to_gcs.py<|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 the ... | |
<|file_name|>test_update_order_lines_partner.py<|end_file_name|><|fim▁begin|>import ddt
from django.core.management import call_command
from django.core.management.base import CommandError
from mock import patch
from oscar.core.loading import get_model
from ecommerce.extensions.test.factories import create_order
from ... | |
<|file_name|>progress.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
#
# progress.py
#
# Author: Billy Wilson Arante
# Created: 2016/02/05 PHT
# Modified: 2016/08/19 PHT
#<|fim▁hole|>
The Python 3 version of loading_icon.py.
"""
while True:
for i in ["/", "-", "|", "\\", "|"]:
prin... |
def progress():
"""Progress icon |
<|file_name|>service.editar.js<|end_file_name|><|fim▁begin|>angular.module('Eintrag').service('editarService', ['$http', function ($http) {
<|fim▁hole|> };
}]);<|fim▁end|> | this.editarUsuario = function (data) {
return $http.post('http://localhost/Eintrag/www/server.php/editarUsuario', $.param(data)); |
<|file_name|>hierarchical_softmax.py<|end_file_name|><|fim▁begin|>from keras import backend as K
from keras import initializations
from keras.backend.common import _EPSILON
from keras.engine.topology import Layer
from keras.engine import InputSpec
from theano.tensor.nnet import h_softmax
import theano.tensor as T
... | return dict(list(base_config.items()) + list(config.items()))
|
<|file_name|>jquery.fitvids.js<|end_file_name|><|fim▁begin|>/*global jQuery */
/*jshint browser:true */
/*!
* FitVids 1.1
*
* Copyright 2013, Chris Coyier - https://css-tricks.com + Dave Rupert - https://daverupert.com
* Credit to Thierry Koblentz - https://www.alistapart.com/articles/creating-intrinsic-ratios-for-... | // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js |
<|file_name|>dlist.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/... | { |
<|file_name|>smb1_session.rs<|end_file_name|><|fim▁begin|>/* Copyright (C) 2018 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed i... | match parse_smb_setup_andx_record(r.data) { |
<|file_name|>growth.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2018 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | def evaluate(self, model):
"""Evaluate in silico growth rates."""
with model:
if self.medium is not None: |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>default_app_config = 'user_deletion.apps.UserDeletionConfig'<|fim▁end|> | |
<|file_name|>set.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/LI... | /// Returns the number of elements in the set.
///
/// # Examples |
<|file_name|>svglength-additive-from-by-1.js<|end_file_name|><|fim▁begin|>description("This tests from-by-animations adding to previous underlying values");
embedSVGTestCase("resources/svglength-additive-from-by-1.svg");
// Setup animation test
function sample1() {<|fim▁hole|> shouldBe("rect.width.baseVal.value", "... | shouldBeCloseEnough("rect.width.animVal.value", "10"); |
<|file_name|>utf8.d.ts<|end_file_name|><|fim▁begin|>/**
* @param {string} str
* @return {Array}
*/
export declare const stringToByteArray: (str: any) => any[];
/**
* Calculate length without actually converting; useful for doing cheaper validation.
* @param {string} str
<|fim▁hole|><|fim▁end|> | * @return {number}
*/
export declare const stringLength: (str: any) => number; |
<|file_name|>test_output_format.py<|end_file_name|><|fim▁begin|>"""tests/test_output_format.py.
Tests the output format handlers included with Hug
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files... | to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or |
<|file_name|>htmlareaelement.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::HTMLAreaElement... | }
} |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for fs-readfile-promise 3.0
// Project: https://github.com/shinnn/fs-readfile-promise<|fim▁hole|>
/// <reference types="node" />
import { PathLike } from "fs";
type PathType = PathLike | number;
type OptionsType = { encoding: string; flag?: string... | // Definitions by: Motosugi Murata <https://github.com/mtsg>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped |
<|file_name|>3841255_WA.cc<|end_file_name|><|fim▁begin|>#include<iostream>
using namespace std;
int n,k;
const int maxn=100010;
bool b[2*maxn];
struct
{
int num,cn;
}queue[2*maxn];
int head,tail;
void bfs()
{
b[n]=1;
queue[0].num=n;
queue[0].cn=1;
while(head<=tail)
{
... | b[queue[head].num*2]=1;
queue[++tail].num=queue[head].num*2;
|
<|file_name|>test_artificial_1024_Logit_PolyTrend_7_12_20.py<|end_file_name|><|fim▁begin|>import pyaf.Bench.TS_datasets as tsds<|fim▁hole|>
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 7, transform = "Logit", sigma = 0.0, exog_count = 20, ar_order = 12);<|fim▁end|> | import tests.artificial.process_artificial_dataset as art |
<|file_name|>capability-unit.js<|end_file_name|><|fim▁begin|>var resetCollection = function(collection) {
collection.find().fetch().forEach(function(obj) {
collection.remove({_id: obj._id});
});
};
describe('CapabilityManager', function() {
var capabilityManager;<|fim▁hole|> beforeAll(function() {
capability... | |
<|file_name|>delete.py<|end_file_name|><|fim▁begin|>from logbook import Logger
from ..core.local import get_current_conf
from ..core.connection import autoccontext
from .. import db
from datetime import timedelta, datetime
log = Logger(__name__)
def del_inactive_queries():
conf = get_current_conf()
with aut... | |
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>const gulp = require('gulp'),
zip = require('gulp-zip');
/**
* Metadata about the plugin.
*
* @var object
*/
const plugin = {<|fim▁hole|> directory: '.'
}
gulp.task('distribute', function () {
let paths = [
'vendor/twig/**/*',
'v... | name: 'example-plugin', |
<|file_name|>instr_cmovl.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
use ::test::run_test;
#[test]
fn cmovl_1() {
run_test(&Instructio... | run_test(&Instruction { mnemonic: Mnemonic::CMOVL, operand1: Some(Direct(RDX)), operand2: Some(IndirectScaledIndexedDisplaced(RSI, RBX, Two, 2066206367, Some(OperandSize::Qword), None)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[... |
<|file_name|>test_plugin_gulp.py<|end_file_name|><|fim▁begin|># -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 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... | def setUp(self):
super().setUp() |
<|file_name|>decimal.py<|end_file_name|><|fim▁begin|># Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz <aahz at pobox.com>
# and T... | return None
if xc >= 10**p:
return None |
<|file_name|>SecondaryNameNode.java<|end_file_name|><|fim▁begin|>/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to ... | long lastCheckpointTime = 0;
if (checkpointPeriod < period) {
period = checkpointPeriod; |
<|file_name|>DistributedMintBattleAI.py<|end_file_name|><|fim▁begin|>from toontown.toonbase import ToontownGlobals
from toontown.coghq import DistributedLevelBattleAI
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import State
from direct.fsm import ClassicFSM, State
from toontown.battle.BattleBase ... | |
<|file_name|>objects.py<|end_file_name|><|fim▁begin|>class ObjectXEDA:
kind= -1
name= ''
posX= 0
posY= 0
centerX= 0
centerY= 0<|fim▁hole|> h= 0
angle= 0
selected= False
mirrored= False
locked= False
glow= False
dragging= False
def is_over(self, x, y):
... | w= 0 |
<|file_name|>reserved_instances.py<|end_file_name|><|fim▁begin|>from moto.core.responses import BaseResponse
class ReservedInstances(BaseResponse):<|fim▁hole|> )
def create_reserved_instances_listing(self):
if self.is_not_dryrun("CreateReservedInstances"):
raise NotImplementedError... | def cancel_reserved_instances_listing(self):
if self.is_not_dryrun("CancelReservedInstances"):
raise NotImplementedError(
"ReservedInstances.cancel_reserved_instances_listing is not yet implemented" |
<|file_name|>exercise.js<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 Westfälische Hochschule
*
* This file is part of Poodle.<|fim▁hole|> * it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any lat... | *
* Poodle is free software: you can redistribute it and/or modify |
<|file_name|>sites.py<|end_file_name|><|fim▁begin|>from functools import update_wrapper
from django.http import Http404, HttpResponseRedirect
from django.contrib.admin import ModelAdmin, actions
from django.contrib.admin.forms import AdminAuthenticationForm
from django.contrib.auth import logout as auth_logout, REDIREC... | return TemplateResponse(request, self.index_template or |
<|file_name|>issue-2150.rs<|end_file_name|><|fim▁begin|>#![deny(unreachable_code)]
#![allow(unused_variables)]
#![allow(dead_code)]
fn fail_len(v: Vec<isize> ) -> usize {
let mut i = 3;
panic!();
for x in &v { i += 1; }
//~^ ERROR: unreachable statement<|fim▁hole|><|fim▁end|> | return i;
}
fn main() {} |
<|file_name|>joystick.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2012 Richard Klancer <rpk@pobox.com>
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, including without l... |
$(function() {
var $background = $('#background'),
$knob = $('#knob'); |
<|file_name|>dateparsetoarray.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2009, 2010 and 2011 Frank G. Bennett, Jr. All Rights
* Reserved.
*
* The contents of this file are subject to the Common Public
* Attribution License Version 1.0 (the “License”); you may not use
* this file except in compliance with ... | */
|
<|file_name|>backend.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
import threading
import os
import time
spoolgore_local = threading.local()<|fim▁hole|>
def send_messages(self, email_messages):
pid = os.getpid()
tid = t... |
class EmailBackend(BaseEmailBackend):
__tmp__ = "%s/tmp" % settings.SPOOLGORE_DIRECTORY |
<|file_name|>BaiduNewsCrawler.java<|end_file_name|><|fim▁begin|>package crawler.impl;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.net.UnknownHostException;
import java.util.Date;
import java.util.List;
import main.Constants;
import model.News;
import org.horrabin.h... |
}
|
<|file_name|>bitcoin_sah.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="sah" version="2.0">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About StartUpcoin Core</source>
<translation type="... | </message>
<message> |
<|file_name|>serveridemixenroll.go<|end_file_name|><|fim▁begin|>/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package lib
import (
"github.com/cloudflare/cfssl/log"
"github.com/hyperledger/fabric-ca/lib/common"
"github.com/hyperledger/fabric-ca/lib/server/idemix"
"github.com/... | |
<|file_name|>PlowShare-Upload.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#requires the following:
#sudo apt-get install curl
#curl http://apt.wxwidgets.org/key.asc | apt-key add -
#sudo apt-get update
#sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-i18n
#sudo apt-get install python-gdata
import wx
i... | nofile_dlg.Destroy()
return
if temp2==0:
nofile_dlg = wx.MessageDialog(None,'No Upload sites Chosen!\nChoose atleast 1 Upload Site','Error',wx.OK | wx.ICON_ERROR) |
<|file_name|>CodeElementTypeNextPreviousAction.java<|end_file_name|><|fim▁begin|>/**
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MP... | } else { |
<|file_name|>test_jsonclient.py<|end_file_name|><|fim▁begin|>from decimal import Decimal
import mock
from unittest2 import TestCase
from restorm.clients.jsonclient import JSONClient, JSONClientMixin
class JSONClientTests(TestCase):
def setUp(self):
self.client = JSONClient()
@mock.patch('ht... | |
<|file_name|>test_openml.py<|end_file_name|><|fim▁begin|>"""Test the openml loader.
"""
import gzip
import warnings
import json
import os
import re
from importlib import resources
from io import BytesIO
import numpy as np
import scipy.sparse
import sklearn
import pytest
from sklearn import config_context
from sklearn.... |
@pytest.mark.parametrize("gzip_response", [True, False]) |
<|file_name|>worldclocks.js<|end_file_name|><|fim▁begin|>var WorldClocks = {};
(function(w) {
function empty() {};
function msg(key, args) {
if (typeof(chrome) != "undefined" && typeof(chrome.i18n) != "undefined") {
return chrome.i18n.getMessage(key, args);
}
return key;
... | function log() {
console.log.apply(console, arguments); |
<|file_name|>dftModel_GUI_frame.py<|end_file_name|><|fim▁begin|># GUI frame for the dftModel_function.py
from Tkinter import *
import tkFileDialog, tkMessageBox
import sys, os
import pygame
from scipy.io.wavfile import read
import dftModel_function
class DftModel_frame:
def __init__(self, parent):
self.p... | |
<|file_name|>test_jest-v20.x.x.js<|end_file_name|><|fim▁begin|>/* @flow */
/* eslint-disable */
import * as React from 'react';
jest.autoMockOff();
jest.clearAllMocks();
jest.resetAllMocks();
// $FlowExpectedError[prop-missing] property `atoMockOff` not found in object type
jest.atoMockOff();
const mockFn = jest.fn(... | expect({ foo: "bar" }).toMatchObject({ baz: "qux" }); |
<|file_name|>master.go<|end_file_name|><|fim▁begin|>package validate
import (
"errors"
"fmt"
"io"
"os"
"text/tabwriter"
"github.com/spf13/cobra"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/util/validation/field"
configapilatest "github.com/openshift/origin/pkg/cmd/server/api/lat... | |
<|file_name|>RobotFactory.cpp<|end_file_name|><|fim▁begin|>#include "TreeFactory.h"
#include "RobotFactory.h"
#include "Robot.h"
#include "kinematic/Tree.h"
#include "kinematic/Enums.h"
#include <vector>
#include <list>
using namespace matrices;
using namespace manip_core::enums;
using namespace manip_core::enums::ro... | return pImpl_->CreateHumanEllipse(robotBasis);
}
case Quadruped: |
<|file_name|>MethodDelegationBinderAmbiguityResolverNoOpTest.java<|end_file_name|><|fim▁begin|>package net.bytebuddy.instrumentation.method.bytecode.bind;
<|fim▁hole|>import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.mock;
public class Me... | import net.bytebuddy.instrumentation.method.MethodDescription;
import org.junit.Test;
|
<|file_name|>UnoTreeRenderer.java<|end_file_name|><|fim▁begin|>/*************************************************************************
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*... | // g.fillRect(x,y,x + fm.stringWidth(getText()),y);
// System.out.println("Text: " + getText());
super.paintComponent(g);
} |
<|file_name|>Panel.cpp<|end_file_name|><|fim▁begin|>#include "Panel.h"
#include "Button.h"
#include "Label.h"
#include "FieldStatus.h"
#include "Field.h"
#include <string>
ShipPanels::Panel::Panel(int dimension, int x, int y) {
this->client = new ClientProcedures();
this->dimension = dimension;
this->warning = ... | |
<|file_name|>strconv.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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... | |
<|file_name|>TestMethodExpressionImpl.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file t... | context.getVariableMapper().setVariable("beanAAA", |
<|file_name|>contact.py<|end_file_name|><|fim▁begin|>from google.appengine.api import mail
import json
import webapp2
<|fim▁hole|> def post(self):
to = self.request.get("to")
user_name = self.request.get("name")
user_address = self.request.get("email")
subject = self.request.get("subj... | class SendEmail(webapp2.RequestHandler): |
<|file_name|>bench.rs<|end_file_name|><|fim▁begin|>#![feature(test)]
extern crate test;
use std::mem::replace;
use test::Bencher;
// bench: find the `BENCH_SIZE` first terms of the fibonacci sequence
static BENCH_SIZE: usize = 20;
// recursive fibonacci
fn fibonacci(n: usize) -> u32 {
if n < 2 {
1
}... | |
<|file_name|>calendar.demo.min.js<|end_file_name|><|fim▁begin|>///*
//Project Name: Spine Admin
//Version: 1.6.0
//Author: BharaniGuru R
//
//*/var handleCalendarDemo=function(){"use strict";var e={left:"prev today",center:"title",right:"agendaWeek next"};var t=new Date;var n=t.getMonth();var r=t.getFullYear();var i... | // console.log(modal);
// |
<|file_name|>res_users.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResUsers(models.Model):
_inherit = 'res.users'
has_group_warning_account = fields.Boolean(
'A warning can be... | |
<|file_name|>KA.py<|end_file_name|><|fim▁begin|>from util import *
import random, string
from random import randint
import time
class KonačniAutomat(types.SimpleNamespace):
"""Automat koji prepoznaje regularni jezik."""
@classmethod
def iz_komponenti(klasa, stanja, abeceda, prijelaz, početno, završna):
"""Sipse... | print("postoji_ciklus", stanje)
print("bijela", boja[stanje], stanje)
if boja[stanje] == "bijela":
dfs_posjeti(rječnikPrirodniPrijelazi, stanje, boja, nasaoCiklus) |
<|file_name|>archiveviewwindow.cpp<|end_file_name|><|fim▁begin|>#include "archiveviewwindow.h"
#include <QLocale>
#include <QCursor>
#include <QPrinter>
#include <QMessageBox>
#include <QFileDialog>
#include <QPrintDialog>
#include <QItemSelectionModel>
#include <QNetworkAccessManager>
#include <definitions/... | |
<|file_name|>depth_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
import numpy as np
import cv2
from collections import deque
from obstacle_detector.distance_calculator import spline_dist
from obstacle_detector.perspective import inv_persp_new
from obstacle_detector.perspective import regress_perspecive
fr... | k = cv2.waitKey(1) & 0xff |
<|file_name|>ManagerService.java<|end_file_name|><|fim▁begin|>package com.ymsino.water.service.manager.manager;
<|fim▁hole|>import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
/**
* This class was generated by the JAX-WS RI. JAX-WS RI... |
import java.util.List;
import javax.jws.WebMethod;
import javax.jws.WebParam;
|
<|file_name|>cod.py<|end_file_name|><|fim▁begin|># coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module provides classes to interface with the Crystallography Open
Database. If you use data from the COD, please cite the following works (as
stipulate... | |
<|file_name|>homedirectory.py<|end_file_name|><|fim▁begin|>"""Attempt to determine the current user's "system" directories"""
try:
## raise ImportError
from win32com.shell import shell, shellcon
except ImportError:
shell = None
try:
import _winreg
except ImportError:
_winreg = None
import os, sys
## T... | possible = os.path.abspath(os.path.expanduser( '~/.config' )) |
<|file_name|>hls_playlist.py<|end_file_name|><|fim▁begin|>import re
from binascii import unhexlify
from collections import namedtuple
from itertools import starmap
from streamlink.compat import urljoin, urlparse
__all__ = ["load", "M3U8Parser"]
# EXT-X-BYTERANGE
ByteRange = namedtuple("ByteRange", "range offset")
... | width, height = 0, 0
return Resolution(width, height)
|
<|file_name|>Leaders_Of_Array.java<|end_file_name|><|fim▁begin|>/*
LEADERS OF AN ARRAY
The task is to find all leaders in an array, where
a leader is an array element which is greater than all the elements
on its right side
*/
import java.util.Scanner;
class Leaders_Of_Array {
public static void... | |
<|file_name|>test_correlog.py<|end_file_name|><|fim▁begin|>from spectrum import CORRELOGRAMPSD, CORRELATION, pcorrelogram, marple_data
from spectrum import data_two_freqs
from pylab import log10, plot, savefig, linspace
from numpy.testing import assert_array_almost_equal, assert_almost_equal
def test_correlog():
... | return psd
def test_correlog_auto_cross(): |
<|file_name|>__init__.py<|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 the Apa... | """
from pyspark.ml.base import Estimator, Model, Transformer
from pyspark.ml.pipeline import Pipeline, PipelineModel
|
<|file_name|>holy_grail_layout.ts<|end_file_name|><|fim▁begin|>import styled from 'styled-components'
import css from '@/utils/css'
import { WIDTH } from '@/utils/css/metric'
import { BaseWrapper, BaseInnerWrapper, BaseContentWrapper } from './index'
export const Wrapper = styled(BaseWrapper)`
${css.flex('justify-... | export const TabsWrapper = styled.div`
width: calc(100% - 42px); |
<|file_name|>line.hpp<|end_file_name|><|fim▁begin|><|fim▁hole|>#include <stdint.h>
#include <sstream>
namespace nntpchan
{
/** @brief a buffered line reader */
class LineReader
{
public:
/** @brief queue inbound data from connection */
void Data(const char *data, ssize_t s);
protected:
/** @brief handle a lin... | #ifndef NNTPCHAN_LINE_HPP
#define NNTPCHAN_LINE_HPP
#include "server.hpp" |
<|file_name|>Form.js<|end_file_name|><|fim▁begin|>/* ************************************************************************
qooxdoo - the new era of web development
http://qooxdoo.org
Copyright:
2004-2009 1&1 Internet AG, Germany, http://www.1und1.de
License:
LGPL: http://www.gnu.org/license... | }
}
}); |
<|file_name|>type-parameter-defaults-referencing-Self-ppaux.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 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-APA... | // the user, but pretty-printing the type during the error message
// caused an ICE. |
<|file_name|>validTag.js<|end_file_name|><|fim▁begin|>import ruleError from './ruleError'<|fim▁hole|>
// Tags that have no associated components but are allowed even so
const componentLessTags = [
'mj-all',
'mj-class',
'mj-selector',
'mj-html-attribute',
]
export default function validateTag(element, { compone... | |
<|file_name|>app.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import rapidsms
import datetime
from rapidsms.apps.base import AppBase
from .models import Poll
from django.db.models import Q
from rapidsms_httprouter.models import Message,MessageBatch
class App(AppBase):
def respond_to_message(self,messag... | # it won't since this app returns false |
<|file_name|>configurable.py<|end_file_name|><|fim▁begin|>import json
from collections import OrderedDict
from inspect import signature
from warnings import warn
import numpy as np
from sklearn.base import BaseEstimator
class Configuration(object):
def __init__(self, name, version, params):
if not isinst... | out["name"] = obj.name
if obj.version != 0:
out["version"] = obj.version
out.update(obj.params) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.