prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>logger.py<|end_file_name|><|fim▁begin|># Borrowed and modified from xbmcswift
import logging
import xbmc
from pulsar.addon import ADDON_ID
class XBMCHandler(logging.StreamHandler):
xbmc_levels = {
'DEBUG': 0,
'INFO': 2,
'WARNING': 3,
'ERROR': 4,
'LOGCRITICAL': 5... | def _get_logger():
logger = logging.getLogger(ADDON_ID)
logger.setLevel(logging.DEBUG) |
<|file_name|>type_api.py<|end_file_name|><|fim▁begin|># sql/types_api.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Base types API.
"""
fro... |
return x == y
|
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2008, 2010 Xuggle Inc. All rights reserved.
*
* This file is part of Xuggle-Utils.
*
* Xuggle-Utils is free software: you can redistribute it and/or modify... | * Sometimes you only want |
<|file_name|>invite.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can red... | mail_mail.send(cr, uid, [mail_id], recipient_ids=[follower_id], context=context)
return {'type': 'ir.actions.act_window_close'} |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import {RouteConfig} from "aurelia-router";
import {autoinject} from "aurelia-dependency-injection";
import {FrameworkConfiguration} from "aurelia-framework";
import {BaseAureliaModule, module} from "../aurelia-modules/index";<|fim▁hole|> name: "home",
title: "home"... |
const routes: RouteConfig[] = [{ |
<|file_name|>bench_test.go<|end_file_name|><|fim▁begin|>/*
*
* k6 - a next-generation load testing tool
* Copyright (C) 2019 Load Impact
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Found... | time.Sleep(time.Nanosecond * 20) |
<|file_name|>openssh_key_pair.go<|end_file_name|><|fim▁begin|>// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See the LICENSE file in builder/azure for license information.
package arm
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/base64"
"encoding/pe... | "time"
) |
<|file_name|>issue-24081.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.
//<|fim▁hole|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or h... | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>import inspect
import operator
import types as pytypes
import typing as pt
from collections import OrderedDict
from collections.abc import Sequence
from llvmlite import ir as llvmir
from numba import njit
from numba.core import cgutils, errors, imputils, types, utils
f... | |
<|file_name|>0013_module_list_widget.py<|end_file_name|><|fim▁begin|># encoding: utf8
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('infrastructure', '0012_auto_20140209_0400'),
]
operations = [
migrations.AddField(
mode... | field=models.TextField(null=True, blank=True),
preserve_default=True,
), |
<|file_name|>print_bot_id.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os<|fim▁hole|>
BOT_NAME = 'chopbot3000'
slack_client = SlackClient(os.environ.get('SLACK_BOT_TOKEN'))
if __name__ == "__main__":
api_call = slack_client.api_call("users.list")
if api_call.get('ok'):
# retrieve all u... | from slackclient import SlackClient
|
<|file_name|>cgol.rs<|end_file_name|><|fim▁begin|>use std::os;
use std::rand;
use std::rand::Rng;
use std::io::Timer;
use std::time::Duration;
use std::clone::Clone;
#[deriving(Clone)]
struct Field {
x: uint,
y: uint,
active: bool
}
fn next_round(field: &mut Vec<Vec<Field>>) {
let old_field = field.c... | |
<|file_name|>format.go<|end_file_name|><|fim▁begin|><|fim▁hole|>package format
import (
"errors"
"fmt"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/hclsyntax"
"github.com/hashicorp/hcl/v2/hclwrite"
"github.com/katbyte/terrafmt/lib/common"
)
func Block(content, path string) (string, error) {
b :=... | |
<|file_name|>application.js<|end_file_name|><|fim▁begin|>import Route from '@ember/routing/route';
export default Route.extend({
redirect() {
this._super(...arguments);
this.transitionTo('examples.single-date-picker');<|fim▁hole|><|fim▁end|> | }
}); |
<|file_name|>cluster_handler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of... | #
# This program is free software; you can redistribute it and/or modify it under |
<|file_name|>post.py<|end_file_name|><|fim▁begin|>import __settings__
from __settings__ import INSTALLED_APPS
assert hasattr(__settings__, 'BASE_DIR'), 'BASE_DIR required'
<|fim▁hole|>)<|fim▁end|> |
INSTALLED_APPS += (
'post', |
<|file_name|>pokemon_hunter.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
from geopy.distance import great_circle
from s2sphere import Cell, CellId, LatLng
from pokemongo_bot import inventory
from pokemongo_bot.base_task import BaseTask
from pokemongo_bot... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | |
<|file_name|>baseRequiredField.validator.ts<|end_file_name|><|fim▁begin|>import { get, has, upperFirst } from 'lodash';
import { IPipeline, IStage, IStageOrTriggerTypeConfig, ITrigger } from 'core/domain';
import { IStageOrTriggerValidator, IValidatorConfig } from './PipelineConfigValidator';
export interface IRequir... | return fieldExists && (field || field === 0) && !(Array.isArray(field) && field.length === 0);
}
} |
<|file_name|>vrframedata.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 https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::VRFrameData... | |
<|file_name|>triangulation.rs<|end_file_name|><|fim▁begin|>//! Methods for converting shapes into triangles.
use ImageSize;
use interpolation::lerp;
use types::{
Line,
SourceRectangle,
Polygon,
Polygons,
Radius,
Rectangle,
Resolution,
};
use math::{
multiply,
orient,
translate,
... | /// Uses buffers that fit inside L1 cache. |
<|file_name|>test_slack_base_object_children.py<|end_file_name|><|fim▁begin|>import unittest
from charlesbot.slack.slack_channel_joined import SlackChannelJoined<|fim▁hole|>from charlesbot.slack.slack_group_left import SlackGroupLeft
from charlesbot.slack.slack_message import SlackMessage
class TestSlackBaseObjectChi... | from charlesbot.slack.slack_channel_left import SlackChannelLeft
from charlesbot.slack.slack_group_joined import SlackGroupJoined |
<|file_name|>avatar.js<|end_file_name|><|fim▁begin|>avatar = function(x){
this.x = x;
this.y = 0;
this.prevY = 0;
this.velocity_x = 0;
this.velocity_y = 0;
this.img = loadImage("stickman.png");
this.crouch = loadImage("crouch.png");
this.width = 16;
this.standingHeight=64;
this.crouchHeight=44;
this.height =... |
this.platformCheck();
|
<|file_name|>instr_vpackssdw.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 vpackssdw_1() {
run_test(&In... | fn vpackssdw_8() {
run_test(&Instruction { mnemonic: Mnemonic::VPACKSSDW, operand1: Some(Direct(YMM1)), operand2: Some(Direct(YMM0)), operand3: Some(IndirectScaledIndexedDisplaced(RDX, RCX, Eight, 918132910, Some(OperandSize::Ymmword), None)), operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae:... |
<|file_name|>startRust.rs<|end_file_name|><|fim▁begin|>use std::thread;
fn main() {
let han: Vec<_> = (0..10).into_iter()
.map( |t| { thread::spawn(move || { println!("Hello world from {}", t);
thread::sleep_ms(5000)}) })
.collect();
<|fim▁hole|>
}<|... | for h in han {
h.join().unwrap();
} |
<|file_name|>steps124.go<|end_file_name|><|fim▁begin|>// Copyright 2015 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package upgrades
import (
"fmt"
"io"
"os"
"path/filepath"
"strings"
"github.com/juju/juju/state"
)
// stateStepsFor124 returns upgrade steps for Juju 1.24 that man... | description: "change updated field on status from time to int",
targets: []Target{DatabaseMaster},
run: func(context Context) error { |
<|file_name|>article-min.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | /*! fabrik */
var FbListArticle=new Class({Extends:FbListPlugin}); |
<|file_name|>layout_image.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/. */
//! Infrastructure to initiate network requests for imag... | let (action_sender, action_receiver) = ipc::channel().unwrap();
let listener = NetworkListener { |
<|file_name|>pages.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright(C) 2014 Bezleputh
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation,... | obj_date = FromTimestamp(Dict('characteristics/date')) |
<|file_name|>grunt.py<|end_file_name|><|fim▁begin|>import socket
import poormanslogging as log
LISTENPORT = 6666
class Grunt(object):
def __init__(self):
try:
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.s.bind(('', LISTENPORT))
self.s.listen(1)
log.info('Waiting for orders on port {... | except OSError:
break
msg = b''.join(chunks) |
<|file_name|>asm-out-read-uninit.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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://... | #[cfg(target_arch = "x86")]
#[cfg(target_arch = "x86_64")] |
<|file_name|>operations.py<|end_file_name|><|fim▁begin|>def rewrite_keywords(journal_like):<|fim▁hole|> return journal_like<|fim▁end|> | bib = journal_like.bibjson()
kwords = [k.lower() for k in bib.keywords]
bib.set_keywords(kwords) |
<|file_name|>test_aggregate.py<|end_file_name|><|fim▁begin|># Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/L... | |
<|file_name|>route.js<|end_file_name|><|fim▁begin|>import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';
import { get } from '@ember/object';
export default Route.extend({
access: service(),
catalog: service(),<|fim▁hole|>
beforeModel() {
this._super(...arguments);
... | scope: service(), |
<|file_name|>speech.py<|end_file_name|><|fim▁begin|># Copyright (C) 2011 One Laptop Per Child
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your opt... | self._rate = rate
self.save()
def say_text(self, text): |
<|file_name|>interpolate.py<|end_file_name|><|fim▁begin|>import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits
from scipy.interpolate import interp1d,splev,splrep
def extractSpectrum(filename):
"""
NAME:
extractSpectrum
PURPOSE:
To open an input fits fil... | fileName = 'spec-4053-55591-0938.fits'
lam, flux = extractSpectrum(fileName)
|
<|file_name|>PostShowPage.xaml.cpp<|end_file_name|><|fim▁begin|>//
// PostShowPage.xaml.cpp
// Implementation of the PostShowPage class
//
#include "pch.h"
#include "PostShowPage.xaml.h"
#include "PostPage.xaml.h"
#include "LoginPage.xaml.h"
#include "define.h"
using namespace GhostBlogClient;
using namespace Platf... | }
void PostShowPage::PostShowEditButtonClick(Object^ sender, RoutedEventArgs^ e)
{ |
<|file_name|>len_zero.rs<|end_file_name|><|fim▁begin|>use clippy_utils::diagnostics::{span_lint, span_lint_and_sugg, span_lint_and_then};
use clippy_utils::source::snippet_with_applicability;
use clippy_utils::{get_item_name, get_parent_as_impl, is_lint_allowed};
use if_chain::if_chain;
use rustc_ast::ast::LitKind;
use... | } |
<|file_name|>Comment.py<|end_file_name|><|fim▁begin|>from .User import User
class Comment(object):
def __init__(self, commentData):
self.status = None
self.username_id = None
self.created_at_utc = None
self.created_at = None
self.bit_flags = None
self.user = None
... |
def getStatus(self): |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#
# Copyright 2001 - 2016 Ludek Smid [http://www.ospace.net/]
#
# This file is part of Outer Space.
#
# Outer Space 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 Softwar... | |
<|file_name|>osyczka2.py<|end_file_name|><|fim▁begin|>from model import Model
from helpers.candidate import Candidate
from helpers.decision import Decision
class Osyczka2(Model):
def __init__(self):
Model.__init__(self)
self.initialize_decs()
def initialize_decs(self):
dec = Decision... |
def aggregate(self, candidate): |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
from __future__ import (unicode_literals, absolute_import,
division, print_function)
import logging
from django.http import Http404
from django.shortcuts import rend... | return render(request,
kwargs.get('template_name', 'trachoma/mission_detail.html'), |
<|file_name|>chef_linux.go<|end_file_name|><|fim▁begin|>package collectors
import (
"bufio"
"encoding/json"
"fmt"
"io"
"os"
"strings"
"time"
"github.com/leapar/bosun/metadata"<|fim▁hole|> StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
ElapsedTime float32 `json:"elapsed_time"`
... | "github.com/leapar/bosun/opentsdb"
)
type crSummary struct { |
<|file_name|>iptables_test.go<|end_file_name|><|fim▁begin|>package iptables
import (
"net"
"os/exec"
"strconv"
"strings"
"sync"
"testing"
_ "github.com/docker/libnetwork/testutils"
)
const chainName = "DOCKEREST"
var natChain *ChainInfo
var filterChain *ChainInfo
var bridgeName string
func TestNewChain(t *t... | |
<|file_name|>hrpd_advanced_config.py<|end_file_name|><|fim▁begin|>from __future__ import (absolute_import, division, print_function)
from isis_powder.hrpd_routines.hrpd_enums import HRPD_TOF_WINDOWS
absorption_correction_params = {
"cylinder_sample_height": 2.0,
"cylinder_sample_radius": 0.3,
"cylinder_po... | return window_10_110_params
if tof_window == HRPD_TOF_WINDOWS.window_30_130:
return window_30_130_params |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate nalgebra;
use nalgebra::{DMat};
/// This trait must be implemented for the single values of a summed area table source.
/// This library contains implementations for all numeric primitive types.
pub trait SourceValue : Copy {
fn as_f64(self) -> f64;
}
im... | pub fn get_overall_average(&self) -> f64{
self.get_average((0,0),(self.table.ncols()-1,self.table.nrows()-1))
}
|
<|file_name|>test_multithreading.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010-2013 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... | self.assertEqual(0, self.error_counter[0])
self.assertQueueContains(self.got_items,
set(['item%d' % i for i in range(20)]))
self.assertQueueContains( |
<|file_name|>GymEvent.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Local Imports
from PokeAlarm.Utils import get_gmaps_link, get_applemaps_link, \
get_waze_link, get_dist_as_str, get_team_emoji, get_ex_eligible_emoji
from . import BaseEvent
from PokeAlarm import Unknown
class GymEvent(BaseEvent):
""" Event r... | # Standard Library Imports
# 3rd Party Imports |
<|file_name|>c3.js<|end_file_name|><|fim▁begin|>(function (window) {
'use strict';
/*global define, module, exports, require */
var c3 = { version: "0.4.11" };
var c3_chart_fn,
c3_chart_internal_fn,
c3_chart_internal_axis_fn;
function API(owner) {
this.owner =... | c3_chart_internal_fn.getOtherTargetX = function (index) {
var xs = this.getOtherTargetXs();
return xs && index < xs.length ? xs[index] : null;
|
<|file_name|>rclxls.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# Extractor for Excel files.
# Mso-dumper is not compatible with Python3. We use sys.executable to
# start the actual extractor, so we need to use python2 too.
import rclexecm
import rclexec1
import xlsxmltocsv
import re
import sys
import os
i... | self.ntry = 1 |
<|file_name|>optimize.py<|end_file_name|><|fim▁begin|>import sys
import typing
import click
import glotaran as gta
from . import util
@click.option('--dataformat', '-dfmt', default=None,
type=click.Choice(gta.io.reader.known_reading_formats.keys()),
help='The input format of the data. Wi... | e.g.:
glotaran optimize --
""" |
<|file_name|>framework_lib.py<|end_file_name|><|fim▁begin|># Copyright 2015 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/lice... |
# Load a TensorFlow plugin
from tensorflow.python.framework.load_library import * |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 Google Inc. All rights reserved.
//
// 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 witho... | else { text.find("\n.\n").map(|pos| pos + 1) }
} |
<|file_name|>test_artificial_32_Quantization_MovingAverage_5_12_100.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 5, transform ... | |
<|file_name|>0022_auto_20161208_2216.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-12-08 21:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0021_auto_20161... | operations = [
migrations.AlterField(
model_name='tournamentteam',
name='name', |
<|file_name|>PlotCursor.ts<|end_file_name|><|fim▁begin|>/*
* Copyright 2018 TWO SIGMA OPEN SOURCE, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | const model = this.scope.stdmodel;
const opt = model.xCursor;
const mapX = this.scope.plotRange.scr2dataX; |
<|file_name|>metric.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
#
# http://www.apache.org/... | tb_writer (tf.Writer): tensorboard writer to write to. |
<|file_name|>core-tls-store-pointer.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied... | // 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. |
<|file_name|>fermentator-status.ts<|end_file_name|><|fim▁begin|>export const FERMENTATORS_STATUS: any[] = [
{ id: 0, name: 'Vacío', buttonClass: 'btn-outline-danger'},<|fim▁hole|><|fim▁end|> | { id: 1, name: 'Fermentando', buttonClass: 'btn-outline-primary'},
{ id: 2, name: 'Enfriando', buttonClass: 'btn-outline-secondary'}
]; |
<|file_name|>editLambdaArgToTypeParameter1.ts<|end_file_name|><|fim▁begin|>/// <reference path='fourslash.ts'/>
////class C<T> {
//// foo(x: T) {
//// return (a: number/*1*/) => x;
//// }
////}
/////*2*/
goTo.marker('1');
edit.backspace(6);
edit.insert('T');
verify.numberOfErrorsInCurrentFile(0);
goTo.m... | edit.insertLine('');
verify.numberOfErrorsInCurrentFile(0); |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for dts_test_project project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build pat... |
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC' |
<|file_name|>invalidEnumAssignments.ts<|end_file_name|><|fim▁begin|>enum E {
A,
B
}
enum E2 {
A,
B
}
var e: E;
var e2: E2;
<|fim▁hole|>e = E2.A;
e2 = E.A;
e = <void>null;
e = {};
e = '';
function f<T>(a: T) {
e = a;
}<|fim▁end|> | |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md><|fim▁hole|>}<|fim▁end|> | extern crate build;
fn main() {
build::link("mstask", true) |
<|file_name|>pluginconf_d.py<|end_file_name|><|fim▁begin|>"""
pluginconf.d configuration file - Files
=======================================
Shared mappers for parsing and extracting data from
``/etc/yum/pluginconf.d/*.conf`` files. Parsers contained
in this module are:
PluginConfD - files ``/etc/yum/pluginconf.d/*.... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Setup script for the WDmodel package
"""
import sys<|fim▁hole|>import glob
from setuptools import find_packages, setup
dep_file = 'dependencies_py36.txt'
with open(dep_file,'r') as f:
required = f.read().splitlines()
dir_path = os.p... | import os
import re |
<|file_name|>libvirt.py<|end_file_name|><|fim▁begin|>#
# Copyright 2015 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) any... | except libvirt.libvirtError as e:
if e.get_error_code() != libvirt.VIR_ERR_NO_NWFILTER:
raise |
<|file_name|>jquery.topUniversityFloatBox.js<|end_file_name|><|fim▁begin|>jQuery(function($){
var window_height = $(window).height();
var element_height = $("#top_university_float_box").height();
var window_scrollTop = $(window).scrollTop();
var ep = window_scrollTop + ( window_height - element_height) /2;
... | }); |
<|file_name|>test_sqlite_util.py<|end_file_name|><|fim▁begin|>from unittest import TestCase
from aq.sqlite_util import connect, create_table, insert_all
class TestSqliteUtil(TestCase):
def test_dict_adapter(self):
with connect(':memory:') as conn:
conn.execute('CREATE TABLE foo (foo)')
... | json_obj = '{"foo": "bar"}'
query = "select json_get('{0}', 'foo')".format(json_obj)
self.assertEqual(conn.execute(query).fetchone()[0], 'bar')
|
<|file_name|>test.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import ipdb
# Print log messages only from the root process in parallel
parameters["std_out_all_processes"] = False;
# Load mesh from file
mesh = Mesh()
domain_vertices = [Point(1.0, -1.0),
Point(6.0, -1.0),
Point(6.0,... | from dolfin import * |
<|file_name|>fdt_test.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2016 Google, Inc
# Written by Simon Glass <sjg@chromium.org>
#
# Test for the fdt modules
import os
import sys
import tempfile
import unittest
from dtoc import fdt
from dtoc import fdt_util
from dtoc.fdt import F... | self.assertEquals(['another', 'multi-word', 'message'], prop.value) |
<|file_name|>URE_Model.java<|end_file_name|><|fim▁begin|>package jat.coreNOSA.gps;
/* JAT: Java Astrodynamics Toolkit
*
* Copyright (c) 2003 National Aeronautics and Space Administration. All rights reserved.
*
* This file is part of JAT. JAT is free software; you can
* redistribute it and/or modify it under the... | }
/** Compute the User range error due to SV clock and ephemeris errors.
* @param i GPS SV index |
<|file_name|>bitcoin_bs.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="bs" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About nopoolcoin</source>... | |
<|file_name|>base.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
from collections import OrderedDict
from django.core.management.base import BaseCommand, CommandParser
from django.core.management.color import no_style<|fim▁hol... |
def add_builtin_arguments(parser): |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commente... | # If false, no module index is generated.
#html_domain_indices = True
|
<|file_name|>AssetRegistry.js<|end_file_name|><|fim▁begin|>sap.ui.define(['exports', './asset-registries/i18n', './asset-registries/LocaleData', './asset-registries/Themes', './asset-registries/Icons'], function (exports, i18n, LocaleData, Themes, Icons) { 'use strict';<|fim▁hole|>
exports.registerI18nLoader = i18n.re... | |
<|file_name|>HTMLElement.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|>
try:
from io import StringIO
except ImportError:
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import bs4 as BeautifulSoup
import logging
from thug.DOM.W3C.Ele... | |
<|file_name|>ApplicationCustomizersService.ts<|end_file_name|><|fim▁begin|>import { sp } from "@pnp/sp";
import "@pnp/sp/webs";
import "@pnp/sp/user-custom-actions";
import { ISearchQuery } from "@pnp/sp/search";
import { Web } from "@pnp/sp/webs";
export default class ApplicationCustomizersService {
/**
* ... | } catch (error) { |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django.core.validators import validate_email
from django import forms
from captcha.fields import ReCaptchaField
from .models import ContactUs
class CreateContact(forms.ModelForm):
captcha = ReCaptchaField()
class Meta:
model = ContactUs
... | 'email': forms.EmailInput({'required': 'required',
'placeholder': 'Email'}),
'message': forms.Textarea(attrs={'required': 'required',
'placeholder': 'Message'}) |
<|file_name|>index.events.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
bus.registerEvent([
{
kind: 'event',
type: 'connector.telegram.started',
toString: (ev) => `${ev.service}: bots webhooks: ${Object.entries(ev.bots).map(([botName, bot]) => `\n\t${botName} (${bot.ref}): ${bot.webhook}`)}`,
... | import {VType, validateEventFactory, BaseEvent} from '../../common/events'
import oncePerServices from '../../common/services/oncePerServices'
export default oncePerServices(function defineEvents({bus = missingService('bus')}) { |
<|file_name|>200-ensure-low-loadavg.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
# Exits with exit code 0 (i.e., allows sleep) if all load averages
# (1, 5, 15 minutes) are below ``MAX_IDLE_LOAD``.
from os import getloadavg
MAX_IDLE_LOAD = .09
def check_load(time_span, load):
if load > MAX_IDLE_LOAD:
print(
... | #!/usr/bin/env python3 |
<|file_name|>vec.rs<|end_file_name|><|fim▁begin|>//! Vector-related Spliterator.
use super::{Split, ExactSizeSpliterator, IntoSpliterator};
use std::sync::Arc;
use std::ptr;
// a wrapper around a vector which doesn't leak memory, but does not drop the contents when
// it is dropped.
// this is because the iterator r... | end: *mut T,
}
impl<T> Iterator for Iter<T> { |
<|file_name|>a_very_big_sum_test.go<|end_file_name|><|fim▁begin|>package averybigsum
import (
"testing"
)
func TestExample(t *testing.T) {
ar := []int32{1000000001, 1000000002, 1000000003, 1000000004, 1000000005}
result := AVeryBigSum(ar)
if result != 5000000015 {<|fim▁hole|><|fim▁end|> | t.Errorf("AVeryBigSum failed the example test")
}
} |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
responses
=========
A utility library for mocking out the `requests` Python library.
:copyright: (c) 2013 Dropbox, Inc.
"""
from setuptools import setup
from setuptools.command.test import test as TestCommand
import sys
setup_requires = []... | setup(
name='responses',
version='0.2.2',
author='David Cramer', |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
urlpatterns = [
url(r'^$', TemplateV... | url(r'^403/$', 'django.views.defaults.permission_denied'), |
<|file_name|>oneshot.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/license... | None => unreachable!(),
}
} |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// +--------------------------------------------------------------------------+
// | Copyright 2016 Matthew D. Steele <mdsteele@alum.mit.edu> |
// | |
// | This file is... | |
<|file_name|>old_serialize.py<|end_file_name|><|fim▁begin|># Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Modifications made by Cloudera are:
# Copyright (c) 2016 Cloudera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not... | wrapper = {}
# JSON list serialization is the only case where we aren't setting
# a key on a dict. We handle this by using a __current__ key on a |
<|file_name|>gateway.py<|end_file_name|><|fim▁begin|>import twe_lite
import json
import queue
import sys
import time
import traceback
import yaml
from threading import Thread
from datetime import datetime
from pytz import timezone
from iothub_client import IoTHubClient, IoTHubClientError, IoTHubTransportProvi... | status = self.__iothub_client.get_send_status()
if status == IoTHubClientStatus.IDLE:
break
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright... |
def clean(self): |
<|file_name|>gregorian.js<|end_file_name|><|fim▁begin|>define(
"dojo/cldr/nls/en-ie/gregorian", //begin v1.x content
{
"dateFormatItem-Md": "d/M",
"dateFormatItem-yMEd": "EEE, d/M/yyyy",
"timeFormat-full": "HH:mm:ss zzzz",<|fim▁hole|> "dateFormat-medium": "d MMM y",
"dateFormatItem-MMdd": "dd/MM",
"dateFormatItem-... | "timeFormat-medium": "HH:mm:ss",
"dateFormatItem-yyyyMMMM": "MMMM y",
"dateFormatItem-MEd": "E, d/M", |
<|file_name|>pager.rs<|end_file_name|><|fim▁begin|>// SPDX-License-Identifier: Unlicense
//! Interface for paging functions.
use crate::pager::{
Attributes, FixedOffset, FrameAllocator, PhysAddr, PhysAddrRange, Translate, VirtAddr,
VirtAddrRange,
};
use crate::util::locked::Locked;
use crate::Result;<|fim▁hol... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
import sqlite3
import os, sys, time, datetime, random, string
import urllib.request, urllib.error
import configparser
from flask import Flask, request, session, redirect
from flask import render_template, g, flash, url_for
from contextlib import clo... | g.db.execute('DELETE FROM pxeitems WHERE id = (SELECT max(id) FROM pxeitems)')
return render_template('failed.html', failed_msg = e)
fpxe.write(PXE_HEADER + '\n') |
<|file_name|>thing.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { Thing } from './thing';
@Component({
selector: 'app-thing',
templateUrl: './thing.component.html',
styleUrls: ['./thing.compon... | redirect(id: number) {
this._router.navigate(['/thing', id]); |
<|file_name|>securitygroup.py<|end_file_name|><|fim▁begin|>""" -*- coding: utf-8 -*- """
from python2awscli import bin_aws
from python2awscli.error import AWSNotFound, ParseError, AWSDuplicate
from python2awscli import must
class BaseSecurityGroup(object):
def __init__(self, name, region, vpc, description, inbou... | '--description', self.description,
'--vpc-id', self.vpc
] |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
from setuptools import setup, find_packages
CURRENT_DIR = os.path.dirname(__file__)
setup(name='datapot',
description='Library for automatic feature extraction from JSON-datasets',
long_description=open(os.path.join(CURREN... | author='Alex Bash, Yuriy Mokriy, Nikita Saveyev, Michal Rozenwald, Peter Romov',
author_email='avbashlykov@gmail.com, yurymokriy@gmail.com, n.a.savelyev@gmail.com, michal.rozenwald@gmail.com, romovpa@gmail.com',
license='GNU v3.0', |
<|file_name|>ServerProxy.java<|end_file_name|><|fim▁begin|>package com.rockoutwill.letsmodreboot.proxy;<|fim▁hole|>public class ServerProxy extends CommonProxy {
}<|fim▁end|> | |
<|file_name|>projection-one-region-closure.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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://... | }
#[rustc_regions]
fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T) |
<|file_name|>webpack.config.js<|end_file_name|><|fim▁begin|>'use strict';
import path from 'path';
import webpack, { optimize, HotModuleReplacementPlugin, NoErrorsPlugin } from 'webpack';
export default {
devtool: 'eval-cheap-module-source-map',
entry: [
'webpack-hot-middleware/client',
'./app/js/bootstrap'
],... | test: /\.js$/,
loaders: ['babel'],
exclude: path.resolve(__dirname, 'node_modules'), |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>fn main() {
println!("hello, world");<|fim▁hole|>}<|fim▁end|> | |
<|file_name|>sudoku_descr.py<|end_file_name|><|fim▁begin|>import json
import math
from common.matrix import Matrix
class SudokuDescr(object):
def __init__(self, matrix=None):
self.matrix = Matrix(matrix=matrix)
y_size = int(math.sqrt(self.matrix.shape[0]))
x_size = int(math.sqrt(self.matrix... |
class SudokuDescrPrinter(): |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.