prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>resources.go<|end_file_name|><|fim▁begin|>package main
<|fim▁hole|>//go:generate go tool generate_resources ../resources music resources<|fim▁end|> | |
<|file_name|>next-prev-pattern.js<|end_file_name|><|fim▁begin|>import React from "react";
import styled from 'styled-components'
import Link from './link';<|fim▁hole|>
const nextArrow = "/icons/next-arrow.png";
const prevArrow = "/icons/prev-arrow.png";
const PatternLink = styled.span`
width: 100%;
display: flex;
... | |
<|file_name|>dispatcher.go<|end_file_name|><|fim▁begin|>package runner
import (
"fmt"
//"error"
//"log"
//"os"
//"io"
"github.com/go-QA/logger"
//"../logger"
//"runtime"
"time"
)
const (
MAX_WAIT_MATCH_RETURN = 3000 // Maximum time in milliseconds to wait for build return message
)
type R... | func (mock *BuildMockMatch) FindMatches(buildInfo BuildInfo) []RunInfo {
return []RunInfo{
|
<|file_name|>dell_storagecenter_common.py<|end_file_name|><|fim▁begin|># Copyright 2016 Dell 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... | with self._client.open_connection() as api:
try:
rspecs = self._get_replication_specs( |
<|file_name|>menubutton.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3<|fim▁hole|>
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class MenuButton(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self)
self.connect("destroy", Gtk.main_quit)
menubutton ... | |
<|file_name|>rest-handler.js<|end_file_name|><|fim▁begin|>var http = require('http')
var url = require('url')
var path = require('path')
var sleep = require('sleep-ref')
var Router = require("routes-router")
var concat = require('concat-stream')
var ldj = require('ldjson-stream')
var manifest = require('level-manifest'... | var blob = self.dat.blobs.backend.exists(opts, function(err, exists) {
res.statusCode = exists ? 200 : 404
res.setHeader('content-length', 0) |
<|file_name|>CmdArgs.cpp<|end_file_name|><|fim▁begin|>/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
Doom 3 Source Code is f... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/L... | # limitations under the License.
"""A helper library for the runtime_configs command group.""" |
<|file_name|>PlainView.js<|end_file_name|><|fim▁begin|><|fim▁hole|> // define the (default) controller type for this View
getControllerName: function() {
return "my.own.controller";
},
// defines the UI of this View
createContent: function(oController) {
// button text is bound to Mo... | sap.ui.jsview(ui5nameSpace, {
|
<|file_name|>PasswordManagerRegistration.java<|end_file_name|><|fim▁begin|>package view;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JPasswordField;
import javax.swing.JButton;
import javax.swing.JTextField;
import java.awt.BorderLayout;
import java.awt.Font;
public class PasswordManager... | }
} |
<|file_name|>script.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import shutil
import os, sys
import time
import logging
from .loaders import PythonLoader, YAMLLoader
from .bundle import get_all_bundle_files
from .exceptions import BuildError
from .updater import TimestampUpdater
from .merge i... | if env is None:
assert not (ns.module and ns.config) |
<|file_name|>worker.py<|end_file_name|><|fim▁begin|># vim: expandtab sw=4 ts=4 sts=4:
#
# Copyright © 2003 - 2018 Michal Čihař <michal@cihar.com>
#
# This file is part of python-gammu <https://wammu.eu/python-gammu/>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GN... | """ |
<|file_name|>filters.py<|end_file_name|><|fim▁begin|>from rest_framework.filters import (
FilterSet
)
from trialscompendium.trials.models import Treatment
class TreatmentListFilter(FilterSet):
"""
Filter query list from treatment database table
"""
class Meta:
model = Treatment
fie... | |
<|file_name|>ore-sponge-versions.tester.js<|end_file_name|><|fim▁begin|>import joiModule from 'joi'
import { createServiceTester } from '../tester.js'
const Joi = joiModule.extend(joi => ({
base: joi.array(),
coerce: (value, helpers) => ({<|fim▁hole|> }),
type: 'versionArray',
}))
const isDottedVersionAtLeastOne... | value: value.split ? value.split(' | ') : value, |
<|file_name|>20190711074029-streaks-and-reached_goals.ts<|end_file_name|><|fim▁begin|>export const up = async function(db: any): Promise<any> {
return db.runSql(
`
CREATE TABLE streaks (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
client_id CHAR(36) NOT NULL,
locale_id INT N... | |
<|file_name|>ItFlys.java<|end_file_name|><|fim▁begin|><|fim▁hole|> */
public class ItFlys implements Flys {
@Override
public String fly() {
return "Flying high!";
}
}<|fim▁end|> | package com.fifino.patterns.strategy;
/**
* Created by porfiriopartida on 2/13/16. |
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp'),
jshint = require('gulp-jshint'),
mocha = require('gulp-mocha'),
cover = require('gulp-coverage'),
jscs = require('gulp-jscs');
gulp.task('default', ['jscs', 'lint', 'test'], function () {
});
gulp.task('lint', function (... | debugDirectory: 'debug'
}))
.pipe(mocha({reporter: 'nyan'}))
.pipe(cover.gather()) |
<|file_name|>test_microbench_uorb.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
*
* Copyright (C) 2018-2019 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitt... | PERF("uORB::Subscription orb_check vehicle_status", ret = vstatus.updated(), 100); |
<|file_name|>test_blogpost.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
import os.path
import pytest
import abclinuxuapi
from abclinuxuapi import shared
@pytest.fixture
def bp_url():
return "http://www.abclinuxu.cz/blog/bystroushaak/2015/2/b... | """ |
<|file_name|>GameObject.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* Copyright (C) 2008-2010 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as ... | if (IsInWorld())
{
if (m_zoneScript)
m_zoneScript->OnGameObjectCreate(this, false); |
<|file_name|>dht.go<|end_file_name|><|fim▁begin|>package commands
import (
"bytes"
"errors"
"fmt"
"io"
"time"
key "github.com/ipfs/go-ipfs/blocks/key"
cmds "github.com/ipfs/go-ipfs/commands"
notif "github.com/ipfs/go-ipfs/notifications"
path "github.com/ipfs/go-ipfs/path"
ipdht "github.com/ipfs/go-ipfs/rout... | },
Subcommands: map[string]*cmds.Command{ |
<|file_name|>SimulationParameters.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
.. py:currentmodule:: FileFormat.SimulationParameters
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
MCXRay simulation parameters input file.
"""
# Script information for the file.
__author__ = "Hend... | baseFilenameRef = r"Results\McXRay"
self.baseFilename = baseFilenameRef
|
<|file_name|>fortranfile.py<|end_file_name|><|fim▁begin|># Copyright 2008-2010 Neil Martinsen-Burrell
#
# 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 ... | """File with methods for dealing with fortran unformatted data files""" |
<|file_name|>feed.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding=utf-8
import os
import datetime
from google.appengine.ext import webapp
from google.appengine.api import memcache
from google.appengine.ext import db
from google.appengine.ext.webapp import util
from google.appengine.ext.webapp import te... | class FeedHomeHandler(webapp.RequestHandler):
def head(self):
self.response.out.write('')
|
<|file_name|>translate.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 Mozilla
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at http://www.apache.org/licenses/LICENSE-2.0
// Unless requi... | /// https://github.com/rust-lang/rust/issues/29638. |
<|file_name|>fstimer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import fstimer.fslogger
import fstimer.timer
from gi.repository import Gtk
<|fim▁hole|>def main():
pytimer = fstimer.timer.PyTimer()
Gtk.main()
if __name__ == '__main__':
main()<|fim▁end|> | |
<|file_name|>borrowck-pat-enum.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.o... | //~^ ERROR unsafe borrow |
<|file_name|>radio.rs<|end_file_name|><|fim▁begin|>use crate::direction::Direction;
use crate::event::{Event, EventResult, Key, MouseButton, MouseEvent};
use crate::theme::ColorStyle;
use crate::view::View;
use crate::Cursive;
use crate::Vec2;
use crate::{Printer, With};
use std::cell::RefCell;
use std::rc::Rc;
struct... | impl RadioGroup<String> {
/// Adds a button, using the label itself as value.
pub fn button_str<S: Into<String>>(
&mut self, |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.views.generic import TemplateView
from . import views
app_name = 'web'
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name="front.html"), name='front'),
... | # Brand
url(r'^brands/$', views.BrandListView.as_view(), |
<|file_name|>sf2.js<|end_file_name|><|fim▁begin|>define(['js/util'], function (util) {
"use strict";
var sf2 = {};
sf2.createFromArrayBuffer = function(ab) {
var that = {
riffHeader: null,
sfbk: {}
};
var ar = util.ArrayReader(ab);
... | imod: []
};
for(var i = inst0.instBagNdx; i < inst1.instBagNdx; i++) {
var ibag0 = parseIBAG1(ar, ibag, i); |
<|file_name|>uxrom.rs<|end_file_name|><|fim▁begin|>use crate::{
cart::Cart,
rom::{NesRom, CHR_BANK_SIZE, PRG_BANK_SIZE},
};
pub struct Uxrom {
prg_bank: Vec<u8>,
chr_rom: [u8; CHR_BANK_SIZE],
bank_select: u8,
last_bank: u8,
}
impl Uxrom {
pub fn new(rom: &NesRom) -> Result<Self, &'static s... | }
fn resolve_prg_addr(addr: u16, bank_select: u8, last_bank: u8) -> usize {
let addr = addr as usize; |
<|file_name|>tag_sets.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The html5ever Project Developers. See the
// COPYRIGHT file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
/... | |
<|file_name|>palindromic-substrings.js<|end_file_name|><|fim▁begin|>/**
* Palindromic Substrings
*
* Given a string, your task is to count how many palindromic substrings in this string.
*
* The substrings with different start indexes or end indexes are counted as different substrings even they consist of
* same ... | * Input: "aaa"
* Output: 6 |
<|file_name|>META.js<|end_file_name|><|fim▁begin|>import _ from 'lodash/fp'
export const TYPES = {
ADDON: 'addon',
COLLECTION: 'collection',
ELEMENT: 'element',
VIEW: 'view',
MODULE: 'module',
}
const TYPE_VALUES = _.values(TYPES)
/**
* Determine if an object qualifies as a META object.
* It must have th... | const getMeta = (metaArg) => {
// literal |
<|file_name|>ServerPropertiesDAO.java<|end_file_name|><|fim▁begin|>/**
* This file is part of tera-api.
*
* tera-api 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, ... | import com.tera.common.model.context.Context;
import com.tera.common.model.context.ContextType;
/**
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import datetime
from django.db import models
from django.db.models import get_model
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import... | |
<|file_name|>halo_session.py<|end_file_name|><|fim▁begin|>import base64
import httplib
import json
import os
import re
import ssl
import urllib
from urlparse import urlunsplit<|fim▁hole|>
class HaloSession(object):
"""All Halo API session management happens in this object.
Args:
key(str): Halo API key
... | from exceptions import CloudPassageAuthentication
|
<|file_name|>test_operator.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from numba.cuda.testing import unittest
from numba import cuda
import operator
class TestOperatorModule(unittest.TestCase):
"""
Test if operator module is supported by the CUDA target.
"""
def operator_template(self, op):
@... | from __future__ import print_function, absolute_import, division
import numpy as np |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for parse 1.9
// Project: https://parse.com/
// Definitions by: Ullisen Media Group <http://ullisenmedia.com>, David Poetzsch-Heffter <https://github.com/dpoetzsch>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript V... | cid: string;
changed: boolean;
className: string;
|
<|file_name|>mir_codegen_switch.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, mo... | // 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. |
<|file_name|>constant.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>GENDER = ((u'男',u'男'),(u'女',u'女'))<|fim▁end|> | |
<|file_name|>PreferencesBasedRepository.java<|end_file_name|><|fim▁begin|>package com.github.sixro.minihabits.core.infrastructure.domain;
import java.util.*;
import com.badlogic.gdx.Preferences;
import com.github.sixro.minihabits.core.domain.*;
public class PreferencesBasedRepository implements Repository {
... | prefs.putString("mini_habits", asString(currentList));
prefs.flush();
}
|
<|file_name|>sbtview.py<|end_file_name|><|fim▁begin|>import sublime
import sublime_plugin
try:
from .sbtsettings import SBTSettings
from .util import maybe, OnePerWindow
except(ValueError):
from sbtsettings import SBTSettings
from util import maybe, OnePerWindow
import re
class SbtView(OnePerWindow)... | |
<|file_name|>global.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/. */
//! Abstractions for global scopes.
//!
//! This module contai... |
/// Get the URL for this global scope.
pub fn get_url(&self) -> Url {
match *self { |
<|file_name|>System_service_alert.java<|end_file_name|><|fim▁begin|>//Auto generated file
//Do not edit this file
package org.sisiya.ui.standart;
import org.sql2o.Connection;
import org.sql2o.Query;
import java.util.List;
import org.sisiya.ui.Application;
import java.util.Date;
public class System_service_a... | |
<|file_name|>helper.go<|end_file_name|><|fim▁begin|>// Copyright 2015 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
//... | // RoundFloat uses default rounding mode, see http://www.gnu.org/software/libc/manual/html_node/Rounding.html |
<|file_name|>styles.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import * as path from 'path';
import * as webpack from 'webpack'... | // Use expanded as otherwise sass will remove comments that are needed for autoprefixer
// Ex: /* autoprefixer grid: autoplace */
// tslint:disable-next-line: max-line-length
// See: https://github.com/webpack-contrib/sass-loader/blob/45ad0be17264ceada5f0b4fb87e93... |
<|file_name|>tcp_listen.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
def main():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('127.0.0.1', 5555))
s.listen(1)
while 1:
conn, addr = s.accept()
#data = conn.recv(1024)
conn.send("blabla".encode())
... | #!/usr/bin/env python3
import socket |
<|file_name|>explorer_factory.rs<|end_file_name|><|fim▁begin|>// The MIT License (MIT)
//
// Copyright (c) 2015 dinowernli
//
// 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 restri... | fn create_monte_carlo_explorer<'a>( |
<|file_name|>skip_issue.go<|end_file_name|><|fim▁begin|>// Copyright 2018 Istio Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.o... | //
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<|file_name|>euler002.py<|end_file_name|><|fim▁begin|>T = int(raw_input())
for test in xrange(T):
N = int(raw_input())
a, b, result = 0, 1, 0
c = a+b
while c < N:
if c%2 == 0:
result += c
a,b = b,c
c = a+b<|fim▁hole|> print result<|fim▁end|> | |
<|file_name|>utility.go<|end_file_name|><|fim▁begin|>package utility
import (
"crypto/rand"
"encoding/base64"
"fmt"
"log"
"math"
"strconv"
"strings"
"time"
"encoding/binary"
"github.com/Dancapistan/gobase32"
"github.com/boatilus/peppercorn/db"
"github.com/boatilus/peppercorn/version"
"github.com/mssola/... | }
// GenerateRandomNonce creates a cryptographically-secure random base64 string 128 bits wide, for
// use as a nonce value Content-Security-Policy |
<|file_name|>auth_service.js<|end_file_name|><|fim▁begin|>// Copyright 2016 Hewlett-Packard Development Company, L.P.
//
// 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... | .send(payload)
.expect(201)
.expect(res => { |
<|file_name|>fake_server_verifier.cc<|end_file_name|><|fim▁begin|>// Copyright 2014 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.
#include "components/sync/test/fake_server/fake_server_verifier.h"
#include <map>
#incl... | for (int tab_id : window.tab()) {
if (tab_ids_to_window_ids.find(tab_id) == tab_ids_to_window_ids.end()) { |
<|file_name|>bitcoin_sr.ts<|end_file_name|><|fim▁begin|><TS language="sr" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Kliknite desnim klikom radi izmene adrese ili oznake</translation>
</message>
<mess... | <source>Alt+P</source>
<translation>Alt+П</translation>
</message>
</context> |
<|file_name|>get-initial-game-state.test.js<|end_file_name|><|fim▁begin|>"use strict";
const test = require("tape");
const aceyDeuceyGameEngine = require("../");
const getInitialGameState = aceyDeuceyGameEngine.getInitialGameState;
test("getInitialGameState", t => {
t.plan(1);
const gameState = {
boar... | {isPlayerOne: null, numPieces: 0},
{isPlayerOne: null, numPieces: 0},
{isPlayerOne: null, numPieces: 0},
{isPlayerOne: null, numPieces: 0}, |
<|file_name|>menu.module.ts<|end_file_name|><|fim▁begin|>/*
"l'Agenda Collaboratif"
Copyright (C) 2016 Valentin VIENNOT
Contact : vviennot@orange.fr
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 Founda... | public sections: Section[];
|
<|file_name|>Searching_Faculty.py<|end_file_name|><|fim▁begin|>import time
import os
import sys
import pickle
a=sys.argv[1]
q=open('facultysubject.txt','r')
w=open('facultydept.txt','r')
e=open('facultyprojects.txt','r')
dic1={}
dic2={}<|fim▁hole|>##print dic2.keys()
dic3=pickle.load(e)
#3print dic3.keys()
print 'NAME... | dic3={}
dic1=pickle.load(q)
##print dic1.keys()
dic2=pickle.load(w) |
<|file_name|>crud.py<|end_file_name|><|fim▁begin|># sql/crud.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
"""Functions used by compiler.py to de... | for k, v in stmt_parameters.items():
colkey = _column_as_key(k)
if colkey is not None:
parameters.setdefault(colkey, v) |
<|file_name|>ShHealOper_ChangeOrientation.cpp<|end_file_name|><|fim▁begin|>// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Publ... | |
<|file_name|>shape_base.py<|end_file_name|><|fim▁begin|>from __future__ import division, absolute_import, print_function
import warnings
import numpy.core.numeric as _nx
from numpy.core.numeric import (
asarray, zeros, outer, concatenate, isscalar, array, asanyarray
)
from numpy.core.fromnumeric import produc... | |
<|file_name|>VisBio.java<|end_file_name|><|fim▁begin|>/*
* #%L
* VisBio application for visualization of multidimensional biological
* image data.
* %%
* Copyright (C) 2002 - 2014 Board of Regents of the University of
* Wisconsin-Madison.
* %%
* This program is free software: you can redistribute it and/or modi... | // construct VisBio interface via reflection |
<|file_name|>bufpool.cc<|end_file_name|><|fim▁begin|>/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of t... | |
<|file_name|>testutils.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function, division
from pony.py23compat import basestring
from functools import wraps
from contextlib import contextmanager
from pony.orm.core import Database
from pony.utils import import_module
def raises_... | def execute(cursor, sql, args=None):
|
<|file_name|>SettingUpdate.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2013-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#include "SettingUpdate.h"
#include "ServiceBroker.h"
#include "Set... | auto strType = elem->Attribute(SETTING_XML_ATTR_TYPE);
if (strType == nullptr || strlen(strType) <= 0 || !setType(strType))
{
s_logger->warn("missing or unknown update type definition"); |
<|file_name|>SystemCommandCall.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2010 Pablo Arrighi, Alex Concha, Miguel Lezama for version 1.
* Copyright 2013 Pablo Arrighi, Miguel Lezama, Kevin Mazet for version 2.
*
* This file is part of GOOL.
*
* GOOL is free software: you can redistribute it and/or modif... | *
* You should have received a copy of the GNU General Public License along with GOOL,
* in the file COPYING.txt. If not, see <http://www.gnu.org/licenses/>.
*/ |
<|file_name|>sync-rwlock-read-mode-shouldnt-escape.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
//... | // except according to those terms. |
<|file_name|>test_fixes.py<|end_file_name|><|fim▁begin|>from execnet import Group
from execnet.gateway_bootstrap import fix_pid_for_jython_popen
<|fim▁hole|> group.makegateway('popen//id=via')
group.makegateway('popen//via=via')
finally:
group.terminate(timeout=1.0)
def test_jython_bootstra... |
def test_jython_bootstrap_not_on_remote():
group = Group()
try: |
<|file_name|>timedelta.py<|end_file_name|><|fim▁begin|>import datetime
from judge.utils.timedelta import nice_repr
from . import registry
@registry.filter
def timedelta(value, display='long'):
if value is None:
return value<|fim▁hole|>
@registry.filter
def timestampdelta(value, display='long'):
valu... | return nice_repr(value, display) |
<|file_name|>Node.java<|end_file_name|><|fim▁begin|>/* This code is part of Freenet. It is distributed under the GNU General
* Public License, version 2 (or at your option any later version). See
* http://www.gnu.org/ for further details of the GPL. */
/* Freenet 0.7 node. */
package freenet.node;
import static free... | "Node.storeSaltHashResizeOnStart", "Node.storeSaltHashResizeOnStartLong", new BooleanCallback() { |
<|file_name|>server.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"log"
"net"
"os"
"github.com/kennylevinsen/g9p"
"github.com/kennylevinsen/g9ptools/fileserver"
"github.com/kennylevinsen/g9ptools/ramfs/ramtree"
)
func main() {
if len(os.Args) < 5 {
fmt.Printf("Too few arguments\n")
fmt.Prin... | } |
<|file_name|>org.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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|>qunit.js<|end_file_name|><|fim▁begin|>/**
* QUnit v1.3.0pre - A JavaScript Unit Testing Framework
*
* http://docs.jquery.com/QUnit
*
* Copyright (c) 2011 John Resig, Jörn Zaefferer
* Dual licensed under the MIT (MIT-LICENSE.txt)
* or GPL (GPL-LICENSE.txt) licenses.
* Pulled Live from Git Sat Jan 14... | } |
<|file_name|>DtoImpl.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2012-2014 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
*... | /** Tests whether or not a given return type is a java.util.List. */
public static boolean isList(Class<?> returnType) { |
<|file_name|>bitcoin_ro_RO.ts<|end_file_name|><|fim▁begin|><TS language="ro_RO" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Click-dreapta pentru a edita adresa sau eticheta</translation>
</message>
<me... | <source>Watch-only:</source>
<translation>Doar-supraveghere:</translation>
</message> |
<|file_name|>gawterm.py<|end_file_name|><|fim▁begin|># ------------------------------------------------------------------------
# Program : gawterm.py
# Author : Gerard Wassink
# Date : March 17, 2017
#
# Function : supply a terminal window with panes for remote control
# of my elevator, can also be used for o... | | || | |
<|file_name|>app_test.py<|end_file_name|><|fim▁begin|>import os
import unittest
os.environ['SIMULATE_HARDWARE'] = '1'
os.environ['LOCK_SETTINGS_PATH'] = 'test-settings'
import db
from app import app
primary_pin = '1234'
sub_pin = '0000'
class AppTestCase(unittest.TestCase):
def setUp(self):
app.testing... | self.app.post('/lock', follow_redirects=True)
self.logout()
|
<|file_name|>ToolbarDisplayOptions.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2014 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
*
* ht... | import android.view.Menu;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.ArrayAdapter; |
<|file_name|>aor-13.rs<|end_file_name|><|fim▁begin|>use std::cmp::min;
use std::cmp::max;
use std::collections::HashMap;
use std::io::prelude::*;
use std::fs::File;
use std::path::Path;
use std::cell::RefCell;
const INFTY: i32 = 1 << 30;
struct Node {
adj: Vec<(String, i32)>
}
struct Graph {
names: HashMap<S... | |
<|file_name|>test-goldens.ts<|end_file_name|><|fim▁begin|>import * as firebaseFunctions from 'firebase-functions';
import * as firebaseAdmin from 'firebase-admin';
import * as path from 'path';
const gcs = require('@google-cloud/storage')();
/** The storage bucket to store the images. The bucket is also used by Fireb... | * goldens. |
<|file_name|>home.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|> });
});<|fim▁end|> | describe('Controller: HomeCtrl', function () {
it('should make a unit test ...', function () { |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from distutils.core import setup
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(
name="wrtfreezer",<|fim▁hole|> url="https://github.com/shuhaowu/wrtfreezer",
packages=["wrtfreezer"],
scripts=["wrtbuild"]... | version="0.1",
description="A simple utility to mass build OpenWRT images.",
author="Shuhao Wu",
license="AGPL", |
<|file_name|>graph_gen.cpp<|end_file_name|><|fim▁begin|>//============================================================================
// Name : GraphGenerator.cpp
// Author : Sindre S. Fjermestad
// Version :
// Copyright : My copyright notice
// Description : Generator for graphs of a certain type
/... | p = i + 1;
} |
<|file_name|>Loader.js<|end_file_name|><|fim▁begin|>const fs = require('fs');
class Loader {
static extend (name, loader) {
return { name, loader };
}
static get (name, options) {
const item = options.loaders.find((loader) => name === loader.name);
if (!item) {
throw new Error(`Missing loader... | this.options.source.script = source || '';
|
<|file_name|>ga_statistics.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 Revolution Solid & Contributors.
// author(s): carlos-lopez-garces, sysnett
// rust-monster is licensed under an MIT License.
use std::cmp::Ordering::*;
use ::ga::ga_core::GAIndividual;
use ::ga::ga_population::{GAPopulation, GAPopulationSta... | stats.update_best(&better_pop);
let mut best_pop = stats.best().unwrap(); |
<|file_name|>merge_java_srcs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (c) 2014 Intel Corporation. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import os
import re
import sys
import shutil
def DoCop... | path = eval(path)
DoCopy(path, options.target_path)
|
<|file_name|>WholeCellViz-visualizations.js<|end_file_name|><|fim▁begin|>/***********************
* WholeCellViz visualizations should extend the Visualization class using this template:
*
* var NewVisualization = Visualization2D.extend({
* getData: function(md){
* this.data = this.getSeriesData('getSeriesData.php',... | this.segmentSeparation = (1 + this.segmentSpacing) * this.segmentHeight;
this.chrSeparation = (this.chrSpacing + 1 * (this.numSegments + this.segmentSpacing * (this.numSegments - 1))) * this.segmentHeight;
this.legendX = this.width - 57; |
<|file_name|>8.py<|end_file_name|><|fim▁begin|># Created by PyCharm Pro Edition
# User: Kaushik Talukdar
# Date: 01-04-17
# Time: 03:10 AM
# Using continue
# continue will send the loop back to its root
nos = 0<|fim▁hole|> print(nos)
# AVOID INFINITE LOOP
# if the... | while nos < 10:
nos += 1
if nos%2 == 0:
continue |
<|file_name|>emotiv.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Emotiv acquisition :
Reverse engineering and original crack code written by
Cody Brocious (http://github.com/daeken)
Kyle Machulis (http://github.com/qdot)
Many thanks for their contribution.
Need python-crypto.
"""
import mul... | else: |
<|file_name|>message_builder.rs<|end_file_name|><|fim▁begin|>use session::{Session, ReceiptRequest, OutstandingReceipt};
use frame::Frame;
use option_setter::OptionSetter;
pub struct MessageBuilder<'a> {
pub session: &'a mut Session,
pub frame: Frame,
pub receipt_request: Option<ReceiptRequest>
}
impl<'a>... | } |
<|file_name|>sankey_definition.py<|end_file_name|><|fim▁begin|>from textwrap import dedent
from pprint import pformat
from collections import OrderedDict
import attr
from . import sentinel
from .ordering import Ordering
# adapted from https://stackoverflow.com/a/47663099/1615465
def no_default_vals_in_repr(cls):
... | return self.target is Elsewhere
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from Operators.Mutation.Mutator import Mutator<|fim▁hole|>from Operators.Mutation.DisplacementMutator import DisplacementMutator
from Operators.Mutation.InversionMutator import InversionMutator<|fim▁end|> | |
<|file_name|>CardMenu.java<|end_file_name|><|fim▁begin|>package fr.fablabmars.model;
import java.util.ArrayList;
import fr.fablabmars.observer.Observable;
import fr.fablabmars.observer.Observer;
/**
* Observable contenant le menu courant.
*
* @author Guillaume Perouffe
* @see Observable
*/
public ... | public int getState(){
return panel;
}
|
<|file_name|>asm-out-assign-imm.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://w... | }
#[cfg(not(target_arch = "x86"), not(target_arch = "x86_64"), not(target_arch = "arm"))]
pub fn main() {} |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration val... | |
<|file_name|>address.js<|end_file_name|><|fim▁begin|>define(['jquery','config','base','ajax','checkInput','serializeJson'],function($,config,base,AjaxFunUtils){
var defaultAddr = '';
var init = function(){
getAddress(defaultAddr);
};
//加载模板
var loadhtml = function(){
var telhtml = '<div id="addressbox" class=... | var lihtml = ''; |
<|file_name|>softmax_op_test.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
#<|fim▁hole|># http://www.ap... | |
<|file_name|>check-suite-view.test.js<|end_file_name|><|fim▁begin|>import React from 'react';
import {shallow} from 'enzyme';
import {BareCheckSuiteView} from '../../lib/views/check-suite-view';
import CheckRunView from '../../lib/views/check-run-view';
import checkSuiteQuery from '../../lib/views/__generated__/check... | const props = {
checkSuite: checkSuiteBuilder(checkSuiteQuery).build(),
checkRuns: [],
switchToIssueish: () => {}, |
<|file_name|>util.go<|end_file_name|><|fim▁begin|>package sourcemap
import (
"io"
)
type (
RuneReader interface {
ReadRune() (r rune, size int, err error)
}
RuneWriter interface {
WriteRune(r rune) (size int, err error)
}
Segment struct {
GeneratedLine int
GeneratedColumn int
SourceIndex int
S... | rw.WriteRune(rune(hexc[byte(r)>>4]))
_, err = rw.WriteRune(rune(hexc[byte(r)&0xF])) |
<|file_name|>qcustomplot.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************
** **
** QCustomPlot, an easy to use, modern plotting widget for Qt **
** Copyright (C) 2011, 2012, 2013 ... | qDebug() << Q_FUNC_INFO << "requested point distance on graph" << mName << "without data";
return 500; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.