prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>report.go<|end_file_name|><|fim▁begin|><|fim▁hole|>package report
type Report struct {
System SystemReport `json:"system"`
Reports map[string]interface{} `json:"reports"`
}<|fim▁end|> | |
<|file_name|>make_current_guard.rs<|end_file_name|><|fim▁begin|>use glutin_egl_sys as ffi;
/// A guard for when you want to make the context current. Destroying the guard
/// restores the previously-current context.
#[derive(Debug)]
pub struct MakeCurrentGuard {
display: ffi::egl::types::EGLDisplay,
old_displa... | }
}
}
|
<|file_name|>restful-basic-authentication.go<|end_file_name|><|fim▁begin|>package main
import (
"github.com/emicklei/go-restful"
"io"
"net/http"
)
// This example shows how to create a (Route) Filter that performs Basic Authentication on the Http request.
//
// GET http://localhost:8080/secret
// and use ... | |
<|file_name|>LeadStatusEditController.js<|end_file_name|><|fim▁begin|>app.controller('LeadStatusEditCtrl', ['$scope', 'Auth', 'Leadstatus', function ($scope, Auth, Leadstatus) {
$("ul.page-sidebar-menu li").removeClass("active");
$("#id_LeadStatus").addClass("active");
$scope.isSignedIn = false;
$scope.... | $scope.$watch('isSelectedAll', function (newValue, oldValue) {
if (newValue) $scope.nbrSelected = $scope.leadstatuses.length; |
<|file_name|>script_checker.hpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2013-2016 John Connor (BM-NC49AxAjcqVcF5jNPu85Rb8MJ2d9JqZt)
*
* This file is part of vcash.
*
* vcash is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License with
* additi... | * The hash type.
*/
std::int32_t m_hash_type; |
<|file_name|>Zp-symbols.js<|end_file_name|><|fim▁begin|>// All symbols in the `Zp` category as per Unicode v2.1.9:
[
'\u2029'<|fim▁hole|><|fim▁end|> | ]; |
<|file_name|>base_ming.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import os
import ming
from ming import Session
from ming.odm import ThreadLocalODMSession
from ming import create_datastore
from depot.fields.ming import DepotExtension
mainsession = Session()<|fim▁hole|>database_setup = Fals... | DBSession = ThreadLocalODMSession(mainsession, extensions=(DepotExtension, ))
|
<|file_name|>credits.js<|end_file_name|><|fim▁begin|>module.exports = function() {
function CreditsCommand() {
return {<|fim▁hole|> var msg = '\nCREDITS:\n';
msg += 'Hack Bot\n';
msg += 'version: v1\n';
msg += 'created by: R.M.C. (hacktastic)\n\n\n';
sandbox.sendChannelMessage(msg);
}
};... | name: 'credits',
params: '[none]',
execute: function(data, sandbox) {
|
<|file_name|>test_cp2_x_cincoffset_sealed.py<|end_file_name|><|fim▁begin|>#-
# Copyright (c) 2014 Michael Roe
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
# ("CTSRD"), as part of the DARPA CRA... | @attr('capabilities')
def test_cp2_x_cincoffset_sealed_1(self):
'''Test that CIncOffset on a sealed capability does not change the offsrt''' |
<|file_name|>misc.py<|end_file_name|><|fim▁begin|>import time
from os import system
import bot as cleanBot
def pp(message, mtype='INFO'):
mtype = mtype.upper()
print '[%s] [%s] %s' % (time.strftime('%H:%M:%S', time.gmtime()), mtype, message)
def ppi(channel, message, username):
print '[%s %s] <%s> %s' % (... |
def pbot(message, channel=''):
if channel:
msg = '[%s %s] <%s> %s' % (time.strftime('%H:%M:%S', time.gmtime()), channel, 'BOT', message) |
<|file_name|>alert.component.ts<|end_file_name|><|fim▁begin|>import { Component, Input } from '@angular/core';
@Component({
selector: 'ts-alert',
templateUrl: 'alert.component.html'
})<|fim▁hole|> @Input() type: string;
@Input() message: string;
}<|fim▁end|> | export class AlertComponent { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""
Copyright 2013 LinkedIn Corp. 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... | |
<|file_name|>Fuse.Resources.ResourceBinding-1.cpp<|end_file_name|><|fim▁begin|>#include <app/Fuse.Node.h>
#include <app/Fuse.Resources.ResourceBinding__float4.h>
#include <app/Fuse.Resources.ResourceRegistry.h>
#include <app/Uno.Action.h>
#include <app/Uno.ArgumentNullException.h>
#include <app/Uno.Bool.h>
#include <ap... |
void ResourceBinding__float4__set_Target(ResourceBinding__float4* __this, ::app::Uno::UX::Property__float4* value) |
<|file_name|>logger-service.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | // tslint:disable-next-line:no-console
export default { log: console.log }; |
<|file_name|>manager.go<|end_file_name|><|fim▁begin|>// Copyright 2017 PingCAP, 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
/... | etcdCli: etcdCli,
id: id, |
<|file_name|>docstrings.py<|end_file_name|><|fim▁begin|>"""
Docstrings are another source of information for functions and classes.
:mod:`jedi.evaluate.dynamic` tries to find all executions of functions, while
the docstring parsing is much easier. There are three different types of
docstrings that |jedi| understands:
... | ones. `(str, int)` means that it returns a tuple with both types.
"""
from jedi.evaluate.context.iterable import SequenceLiteralContext, FakeSequence
if isinstance(array, SequenceLiteralContext): |
<|file_name|>max_aggregate_only.py<|end_file_name|><|fim▁begin|>import numpy as np
from scipy.stats import skew, kurtosis, shapiro, pearsonr, ansari, mood, levene, fligner, bartlett, mannwhitneyu
from scipy.spatial.distance import braycurtis, canberra, chebyshev, cityblock, correlation, cosine, euclidean, hamming, jacc... | REGRESSION_RESIDUAL_METRICS = [
] + UNARY_NUMERICAL_FEATURES
BINARY_PROBABILITY_CLASSIFICATION_METRICS = [ |
<|file_name|>wbalance.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2012 The Android Open Source Project
*
* 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... |
void prepareWhiteBalance() {
uchar4 estimation = estimateWhite(); |
<|file_name|>log.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The go-burnout Authors
// This file is part of the go-burnout library.
//
// The go-burnout library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Softwa... | // EncodeRLP implements rlp.Encoder. |
<|file_name|>appendjob.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any la... | /*
Copyright (c) 2009 Kevin Ottens <ervin@kde.org> |
<|file_name|>cisco_fc_zone_driver.py<|end_file_name|><|fim▁begin|># (c) Copyright 2014 Cisco Systems 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... | if zoning_policy_fab:
zoning_policy = zoning_policy_fab
|
<|file_name|>mydecimal_test.go<|end_file_name|><|fim▁begin|>// Copyright 2016 PingCAP, 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/LICENS... | result string
err error
} |
<|file_name|>colors.go<|end_file_name|><|fim▁begin|><|fim▁hole|>import "github.com/nsf/termbox-go"
type Color int
const (
ColorBlack Color = 1 << iota
ColorBlue
ColorCyan
ColorGreen
ColorMagenta
ColorRed
ColorWhite
ColorYellow
ColorAlpha
)
func (c Color) GetTermboxColor() termbox.Attribute {
switch c {
ca... | package techcore
|
<|file_name|>stats.cpp<|end_file_name|><|fim▁begin|>/**
* Copyright [2013-2014] [OHsystem]
*
* We spent a lot of time writing this code, so show some respect:
* - Do not remove this copyright notice anywhere (bot, website etc.)
* - We do not provide support to those who removed copyright notice
*
* OHSystem is free sof... | CStats :: ~CStats( )
{ |
<|file_name|>csvfile.py<|end_file_name|><|fim▁begin|>import os
import pandas as pd
from input import Input
class Main(Input):
name = "CSV File Input"
def build_file_list(self):
files = {}
for s in self.symbols:
normalized_file = "%s.%s" % (s, self.extension)
if os.path.isfile(os.path.join(self.symbol_dir,... | return files
|
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for mozblog project.<|fim▁hole|>
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi imp... | |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
<|fim▁hole|>import os
# Import the common config file
# Note that paths in the common config are interpreted as if they were
# in the location of this file
sys.path.insert(0, os.path.abspath('../../_common'))
from common_conf import *
# Over... | import sys |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
<|fim▁hole|>from setup.install... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/****************************************************************************
Copyright (c) 2015 Roland Ruckerbauer All Rights Reserved.
This file is part of hidapi_rust.
hidapi_rust is free software: you can redistribute it and/or modify
it under the t... | |
<|file_name|>bubble_sort.rs<|end_file_name|><|fim▁begin|>fn bubble_sort(v: &Vec<i32>) -> Vec<i32> {
let mut a = v.clone();
let mut swapped = true;
while swapped {
swapped = false;
for i in 1..(v.len()) {
if a[i - 1] > a[i] {
let aux = a[i];
a[i] = ... |
fn main() { |
<|file_name|>icon_importer.py<|end_file_name|><|fim▁begin|>import urllib2
import lxml.html
import numpy
import scipy
import scipy.misc
import scipy.cluster
import urlparse
import struct
import operator
import gzip
import datetime
import requests
import httplib
from PIL import BmpImagePlugin, PngImagePlugin, Image
from ... | return icon |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from pony.orm.core import * |
<|file_name|>result.go<|end_file_name|><|fim▁begin|>package subcommands
import (
"flag"
"fmt"
"io"
"os"
"reflect"
"strings"
"text/tabwriter"
"bazil.org/bazil/cliutil/positional"
)
type atom struct {
pkg string
cmd interface{}
}
// Result is the result of parsing the arguments given to a command.
//
// TOD... | for i, a := range r.list {
l[i] = a.cmd
}
return l |
<|file_name|>window.rs<|end_file_name|><|fim▁begin|>use std::fmt;
use std::ops::Range;
use std::iter::IntoIterator;
use types::{State, BoardView};
use board::Board;
#[derive(Clone, Copy)]
pub struct Window<'a> {
pub min_x: i32,
pub min_y: i32,
pub max_x: i32,
pub max_y: i32,
board: &'a Board
}
im... | fn next(&mut self) -> Option<(i32, i32, State)> { |
<|file_name|>cmdutils.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2010 Stanislav Bohm
#
# This file is part of Kaira.
#
# Kaira is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of... | build_config = p.get_build_config(target)
if directory is not None:
build_config.directory = directory |
<|file_name|>block.rs<|end_file_name|><|fim▁begin|>extern crate modbus;
use modbus::{Coil,binary,Reason,ExceptionCode,tcp};
use {Code, Count, Address, Values, Value, Quantity};
use {ModbusResponsePDU, ModbusRequestPDU};
use FunctionCode;
use enum_primitive::FromPrimitive;
pub struct BlankRegisters {
holding_regi... | impl BlankRegisters {
|
<|file_name|>functions.py<|end_file_name|><|fim▁begin|>import shutil
from pprint import pprint
import pandas as pd
import csv
import pickle<|fim▁hole|>import subprocess
from luigi import six
from sklearn.decomposition import NMF
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.n... | import inspect, os
import requests
from os import listdir
import numpy as np |
<|file_name|>SwitchStatus.java<|end_file_name|><|fim▁begin|>package com.simonbrunner.msnswitchctrl.network;
/**
* Created by simon on 03/01/16.
*/
public class SwitchStatus {
private Boolean plug1;
private Boolean plug2;
public Boolean getPlug1() {
return plug1;
}
public void setPlug1(... | |
<|file_name|>translate_old.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import with_statement
from collections import defaultdict
from copy import deepcopy
import axiom_rules
import fact_groups
import instantiate
import pddl
import sas_tasks
import simplify
import ti... | # decent check that the precondition is indeed inconsistent
# (using *all* mutexes), but that seems tough with this |
<|file_name|>single_element_loop.rs<|end_file_name|><|fim▁begin|>// run-rustfix
// Tests from for_loop.rs that don't have suggestions
#[warn(clippy::single_element_loop)]
fn main() {
let item1 = 2;
for item in &[item1] {<|fim▁hole|>
for item in [item1].iter() {
println!("{:?}", item);
}
}<|fim▁... | println!("{}", item);
} |
<|file_name|>0003_auto_20170221_0107.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-02-21 01:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('clients', '0002_contact... | migrations.AlterField(
model_name='contact', |
<|file_name|>globals.js<|end_file_name|><|fim▁begin|>/**
* Global Variable Configuration
* (sails.config.globals)
*
* Configure which global variables which will be exposed
* automatically by Sails.
*
* For more information on configuration, check out:
* http://sailsjs.org/#!/documentation/reference/sails.confi... | * Expose the lodash installed in Sails core as a global variable. If this *
* is disabled, like any other node module you can always run npm install * |
<|file_name|>BitcrusherProps.js<|end_file_name|><|fim▁begin|>'use strict';
const BitcrusherProps = {
bits: {
type: 'number',
bounds: [1, 16],
defaultValue: 4
},
normfreq: {
type: 'number',
bounds: [0, 1],
step: 0.1,
defaultValue: 0.1
},
buffer... | type: 'number',
bounds: [256, 16384],
defaultValue: 4096
}, |
<|file_name|>util.go<|end_file_name|><|fim▁begin|>package id3
import (
"bytes"
"errors"
"io"
"time"
)
var timestampFormats = []string{
"2006-01-02T15:04:05",<|fim▁hole|> "2006-01-02",
"2006-01",
"2006",
}
func parseTime(timeStr string) (time.Time, error) {
for i := range timestampFormats {
t, err := time.P... | "2006-01-02T15:04",
"2006-01-02T15", |
<|file_name|>sailfishos-uithemer-sl_SI.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="sl_SI">
<context>
<name>AboutPage</name>
<message>
<source>Sources</source>
<translation>Viri</translation>
</message>
<message>
... | <message>
<source>Install dependencies</source>
<translation>Namesti odvisnosti</translation> |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>/* Periodically crawl web pages and alert the user of changes
*
* Copyright (C) 2016 Owen Stenson
*
* 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 Softwa... | println!("\t{}", now);
now = Local::now(); |
<|file_name|>40.rs<|end_file_name|><|fim▁begin|>/* Problem 40: Champernowne's constant
*
* An irrational decimal fraction is created by concatenating the positive integers:
*
* 0.123456789101112131415161718192021...
*
* It can be seen that the 12th digit of the fractional part is 1.
*
* If dn represents the nth... | (1..)
.flat_map(digits::new::<_, u32>)
.nth(position as usize - 1)
.unwrap() |
<|file_name|>SaplingGrowTreeEvent.java<|end_file_name|><|fim▁begin|>/*
* Minecraft Forge
* Copyright (c) 2016.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the... | * <br>
* This event is fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}.<br> |
<|file_name|>05.3.TriangleStripSet.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
###
# Copyright (c) 2002-2007 Systems in Motion
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permiss... | (2.1, 12.1, -.2 ), ( 2.1, 14.6, -.2), |
<|file_name|>l-archiver_uk.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="uk_UA">
<context>
<name>Backend</name>
<message>
<location filename="../TarBackend.cpp" line="218"/>
<source>Could not read archive</source>
<transl... | <source>Refresh Device List</source>
<translation type="unfinished"></translation> |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var _ = require('underscore');
var nolp = require('./lib/nolp/nolp.js');
var ups = require('./lib/ups/ups.js');
/**
* available delivery services
*
* @var array of strings
* @private
*/
var availableServices = [
"dhl",
"ups"
];
/**
* retrieves the s... | *
* A callback will be called with an tracking object:
*
* { |
<|file_name|>TestParserSemantic.java<|end_file_name|><|fim▁begin|>/* MicroJava Parser Semantic Tester
*
* Test only semantics. The grammar in all tests are correct.
*/
package MicroJava;
import java.io.*;
public class TestParserSemantic {
public static void main(String args[]) {
if (args.length == 0) ... | private static void testFactor() { |
<|file_name|>LTS.py<|end_file_name|><|fim▁begin|>from interfaces.labels_map import LabelsMap
from helpers.python_ext import to_str
class LTS:
def __init__(self,
init_states,
model_by_signal:dict,
tau_model:LabelsMap,
state_name:str,
... | # return the range of tau \cup init_states
states = set(map(lambda l_v: l_v[1], self._tau_model.items())) |
<|file_name|>openstack_service.py<|end_file_name|><|fim▁begin|>import novaclient
from novaclient.exceptions import NotFound
import novaclient.client
from keystoneauth1 import loading
from keystoneauth1 import session
import neutronclient.v2_0.client
import cinderclient.v2.client
from osc_lib.utils import wait_for_del... | pass
class ListImages(task.Task): |
<|file_name|>facefuck_rockstar.py<|end_file_name|><|fim▁begin|>from RockStar import RockStar
<|fim▁hole|>rock_it_bro = RockStar(days=400, file_name='helloWorld.ff', code=facefuck_code)
rock_it_bro.make_me_a_rockstar()<|fim▁end|> | facefuck_code = (":) :) :) :) :) :) :) :) :) :)\n=(\n:> :) :) :) :) :) :) :) :> :) :) :) :) :) :) :) :) :) :) :> :) :) :) :> :) :< :< :< :< :(\n"
"=)\n:> :) :) :P\n:> :) :P\n:) :) :) :) :) :) :) :P\n"
":P\n:) :) :) :P\n:> :) :) :P\n:< :< :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :P\n:> :P\n:) :) :) :P\n:( :( :... |
<|file_name|>bool.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/L... | *
* ~~~rust
* rusti> !false
* true |
<|file_name|>error-with-invalid-abi.rs<|end_file_name|><|fim▁begin|>#[track_caller]
extern "C" fn f() {}
//~^^ ERROR `#[track_caller]` requires Rust ABI
extern "C" {
#[track_caller]
fn g();
//~^^ ERROR `#[track_caller]` requires Rust ABI<|fim▁hole|>
fn main() {}<|fim▁end|> | } |
<|file_name|>AddAllItems.py<|end_file_name|><|fim▁begin|>#Copyright (c) 2014 Sony Computer Entertainment America LLC. See License.txt.
import sys
sys.path.append("./CommonTestScripts")
import Test
doc = atfDocService.OpenNewDocument(editor)
#===================== 0: root ==================================
Test.Equ... | editingContext.Insert[UIAnimation](DomNode(UISchema.UIAnimationType.Type), font.DomNode)
Test.Equal(0, Test.GetEnumerableCount(treeLister.TreeView.GetChildren(font.DomNode)), "Verify font child count does not increase when adding an animation")
#===================== 6: Sprite ================================== |
<|file_name|>0277_auto_20180601_1458.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-06-01 12:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [<|fim▁hole|> ('base', '0276... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate libc;
use libc::{c_char, c_int, c_void, free, malloc, size_t};
use std::ffi;
use std::mem;
use std::ptr;
use std::str;
mod c {
use libc::{c_char, c_int};
#[repr(C)]
pub enum Status {
Done = 0,
EOF,
Move,
Dispat... | Some(word) => word,
None => return ptr::null_mut::<c_char>()
};
|
<|file_name|>consts.py<|end_file_name|><|fim▁begin|><|fim▁hole|>__license__ = "BSD License"
__contact__ = "Name Of Current Guardian of this file <email@address>"
USER_AGENT = 'api-indiv-0829BA2B33942A4A5E6338FE05EFB8A1'
HOST_NAME = "http://myanimelist.net"
DEBUG = False
RETRY_NUMBER = 4
RETRY_SLEEP = 1
SHORT_SITE_F... | __authors__ = ""
__copyright__ = "(c) 2014, pymal" |
<|file_name|>autocompletor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008-2010 Zuza Software Foundation
#
# This file is part of Virtaal.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | if key in self:
return super(defaultdict, self).__getitem__(key)
else:
return self.__factory() |
<|file_name|>linearize.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# linearize.py: Construct a linear, no-fork, best version of the blockchain.
#
#
# Copyright (c) 2013 The Umaro developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licens... |
outf.write(outhdr)
outf.write(data) |
<|file_name|>keys_iterator.py<|end_file_name|><|fim▁begin|>import traceback
import sys
from gribapi import *
INPUT = 'rap_130_20120822_2200_001.grb2'
VERBOSE = 1 # verbose error reporting<|fim▁hole|>
while 1:
gid = grib_new_from_file(f)
if gid is None: break
iterid = grib_keys_iterator_n... |
def example():
f = open(INPUT) |
<|file_name|>config_imagenet32.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2022 The Google Research Authors.<|fim▁hole|># 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
#
# ht... | # |
<|file_name|>kalman_filter.cpp<|end_file_name|><|fim▁begin|>#include "kalman_filter.h"
#include <iostream>
using Eigen::MatrixXd;
using Eigen::VectorXd;
KalmanFilter::KalmanFilter() {}
KalmanFilter::~KalmanFilter() {}
void KalmanFilter::Init(VectorXd &x_in, MatrixXd &P_in, MatrixXd &F_in,
MatrixXd &H_in, Ma... | MatrixXd K = PHt * Si;
//new estimate |
<|file_name|>SinglePingResponseCallback.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2011-2012 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2012 The OpenNMS Group, Inc.
*
* Open... | |
<|file_name|>task.rs<|end_file_name|><|fim▁begin|>// The MIT License (MIT)
//
// Copyright (c) 2015 Kashyap
//
// 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, includin... |
struct TaskTable { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import re
import json
import logging
import random
import venusian
from collections import namedtuple
from collections import OrderedDict
from zope.interface import providedBy, Interface
from pyramid.compat import string_types
from pyramid.config.views import Defaul... |
def add_layout(cfg, name='', context=None, root=None, parent=None,
renderer=None, route_name=None, use_global_views=True, |
<|file_name|>drawUtilities.js<|end_file_name|><|fim▁begin|>/// <reference path="_reference.js" />
"use strict";
var svgNameSpace = "http://www.w3.org/2000/svg";
function createSVG(id, width, height) {
var svg = document.createElementNS(svgNameSpace, "svg");
if (id) {
svg.setAttribute("id", id);
}
... | path.setAttribute('stroke-width', strokeWidth);
return path; |
<|file_name|>db_pruner.py<|end_file_name|><|fim▁begin|>from blur.quickinit import *
def tableSizeInMegs(tableName):
q = Database.current().exec_('SELECT * FROM table_size_in_megs(?)',[QVariant(tableName)])
if q.next(): return q.value(0)
return None
def pruneTable(tableName, defaultSizeLimit, orderColumn, rowsPer... | if q.numRowsAffected() < rowsPerIteration: |
<|file_name|>queue.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-<|fim▁hole|>
class Queue:
def __init__(self):
self.queue = []
def enqueue(self, item):
self.queue.append(item)
def dequeue(self, item):
return self.queue.pop(0)<|fim▁end|> | |
<|file_name|>flag_changer.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
from devil.android import device_errors
class FlagChanger(object):
"""Chang... | Follows similar logic to CommandLine.java::tokenizeQuotedArguments:
* Flags are split using whitespace, unless the whitespace is within a |
<|file_name|>GIFImage.py<|end_file_name|><|fim▁begin|>"""GIFImage by Matthew Roe"""
import Image
import pygame
from pygame.locals import *
import time
class GIFImage(object):
def __init__(self, filename):
self.filename = filename
self.image = Image.open(filename)
self.frames = []
... | self.reversed = not self.reversed
def reset(self): |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|>
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cg4.settin... | WSGI config for cg4 project. |
<|file_name|>util_spec.js<|end_file_name|><|fim▁begin|>/*************************GO-LICENSE-START*********************************
* Copyright 2018 ThoughtWorks, 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 obt... | assertTrue(jQuery("#foo")[0].disabled);
assertTrue(jQuery("#bar")[0].disabled);
});
}); |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod data_source;
mod manager;
pub use self::data_source::*;<|fim▁hole|><|fim▁end|> | pub use self::manager::*; |
<|file_name|>oauth_apiserver_test.go<|end_file_name|><|fim▁begin|>package oauthserver
import (
"io/ioutil"
"os"
"reflect"
"testing"
_ "github.com/openshift/origin/pkg/api/install"
"github.com/openshift/origin/pkg/cmd/server/apis/config"
"github.com/openshift/origin/pkg/cmd/server/apis/config/latest"
)
func Te... | Secrets: []config.SessionSecret{
{Authentication: "a1", Encryption: "e1"},
{Authentication: "a2", Encryption: "e2"}, |
<|file_name|>poly.rs<|end_file_name|><|fim▁begin|>// `libpoly.rs`
#![feature(globs)]
#![feature(macro_rules)]
#![crate_id = "poly#0.1"]
#![comment = "A Musical Instrument for Computers "]
#![license = "MIT"]
#![crate_type = "lib"]
extern crate libc;
use libc::*;
macro_rules! unsafe_return(
($func:expr $rett:ty) ... | unsafe {
poly_set_wavetype(index as c_int, wavetype)
} |
<|file_name|>or-test.js<|end_file_name|><|fim▁begin|><|fim▁hole|>import { or } from 'opensource-challenge-client/helpers/or'
describe('Unit | Helper | or', function() {
it('works', function() {
expect(or([42, 42])).to.equal(true)
expect(or([false, 42, false])).to.equal(true)
expect(or([true, 42])).to.equ... | import { expect } from 'chai'
import { describe, it } from 'mocha' |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// STD Dependencies -----------------------------------------------------------
use std::fmt;
use std::sync::mpsc;
use std::collections::HashMap;
// Discord Dependencies -------------------------------------------------------
use discord::model::{
ChannelId, UserId... | #[derive(Debug, PartialEq)] |
<|file_name|>callbacks.rs<|end_file_name|><|fim▁begin|>//! R_ext/Callbacks.h
//!
//! Not part of the API, subject to change at any time. -- From R
//!
//! These structures are for C (and R function) top-level task handlers.
//! Such routines are called at the end of every (successful) top-level task
//! in the regular ... | ) -> Rboolean, |
<|file_name|>segment_ro.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Takes apart large IATI XML files and outputs one file per reporting org.
# Copyright 2013 Mark Brough.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License... | 'package_name': prefix+"-"+org,
'package_title': data['title']})
print "Finished writing data, find the files in", output_directory
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from djpcms import sites
if sites.settings.CMS_ORM == 'django':
from djpcms.core.cmsmodels._django import *
elif sites.settings.CMS_ORM == 'stdnet':
from djpcms.core.cmsmodels._stdnet import *
else:
raise NotImplemente... | |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>/*
* @license Apache-2.0
*
* Copyright (c) 2019 The Stdlib 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.apac... | * var bool = isSameValue( NaN, NaN ); |
<|file_name|>UserManagerTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2012 Mike Adamson
*
* 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... | public class UserManagerTest extends AbstractUserManagementTest {
@Test
public void canAddUserPlainPasswordAndGetSessionForUser() throws Exception { |
<|file_name|>heartbeat_monitor.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (c) 2017
#
# Author(s):
#
# Lars Ørum Rasmussen <ras@dmi.dk>
# Janne Kotro <janne.kotro@fmi.fi>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public... | class Monitor(threading.Thread): |
<|file_name|>addrman.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 Pieter Wuille
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "addrman.h"
#include "hash.h"
#include "serialize.h"
#include "streams.h"
int C... | // periodically update nTime
bool fCurrentlyOnline = (GetAdjustedTime() - addr.nTime < 24 * 60 * 60); |
<|file_name|>beatmap_processor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
from utils.file_system import *
from calculations.beatmap_metadata import BeatmapMetadata
from database.database_wrapper import DatabaseWrapper
def hello(msg):
print("Hello world! " + msg)
def print_help():
print(... | if not dir_exists("thumbnails"):
mkdir("thumbnails") |
<|file_name|>XrdClientUrlInfo.hh<|end_file_name|><|fim▁begin|>#ifndef _XRC_URLINFO_H
#define _XRC_URLINFO_H
/******************************************************************************/
/* */
/* X r d C l i e n t U r l I n f o... | /* Adapted from TXNetFile (root.cern.ch) originally done by */
/* Alvise Dorigo, Fabrizio Furano, INFN Padova, 2003 */
/* Revised by G. Ganis, CERN, June 2005 */ |
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import warnings
from functools import wraps
def deprecated(func):
"""
Generates a deprecation warning
"""
@wraps(func)
def wrapper(*args, **kwargs):
msg = "'{}' is deprecated".format(func.__name__)
warnings.warn(msg, category... | return wrapper |
<|file_name|>plugin_test.go<|end_file_name|><|fim▁begin|>// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package plugin_test
import (
"bytes"
"context"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
... | |
<|file_name|>matchers.js<|end_file_name|><|fim▁begin|>/* global window beforeEach jasmine it xit fit */
if (typeof global === 'undefined') {
global = window; // eslint-disable-line
}
const customMatchers = {
toAlmostEqual: (util, customEqualityTesters) => ({
compare: (actual, expected) => {
const cleanA... | |
<|file_name|>ui_root.py<|end_file_name|><|fim▁begin|>'''
Implements the targetcli root UI.
This file is part of targetcli.
Copyright (c) 2011-2013 by Datera, 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 th... | |
<|file_name|>PositionAnimExpectationRightOf.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017 GcsSloop
*
* 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/... | |
<|file_name|>test_navigation.py<|end_file_name|><|fim▁begin|># Copyright 2010 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
__metaclass__ = type
from zope.component import (
ComponentLookupError,
getMultiAdapter,
)
from zope.confi... | |
<|file_name|>.eslintrc.js<|end_file_name|><|fim▁begin|>module.exports = {
rules: {
"no-alert": [0],
"@thibaudcolas/cookbook/import/no-extraneous-dependencies": [
"error",<|fim▁hole|> devDependencies: true,
},
],
},
};<|fim▁end|> | { |
<|file_name|>map_data.js<|end_file_name|><|fim▁begin|>import {
event as d3_event,
select as d3_select
} from 'd3-selection';
import { svgIcon } from '../svg/icon';
import { t, textDirection } from '../util/locale';
import { tooltip } from '../util/tooltip';
import { geoExtent } from '../geo';
import { modeBrow... | } |
<|file_name|>publicRouter.js<|end_file_name|><|fim▁begin|>var express = require('express');
var https = require('https');
var http = require('http');
var url = require('url');
var bodyParser = require('body-parser');
var request = require('request') ;
//var publicRouter = express.Router();
module.exports = function (... | |
<|file_name|>schemasTest.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|>const Lab = require('lab');
const expect = Code.expect;
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
describe('server/schemas.todoSchema', () => {
it('validates object', (done) => {
... | const Schemas = require('../server/schemas');
const Code = require('code'); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.