prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>export * from './IMapProps';<|fim▁hole|>export * from './Map';<|fim▁end|> | export * from './IMapState'; |
<|file_name|>VehicleTypeBoatBallista.java<|end_file_name|><|fim▁begin|>/**
Copyright 2012 John Cummens (aka Shadowmage, Shadowmage4513)
This software is distributed under the terms of the GNU General Public License.
Please see COPYING for precise license information.
This file is part of Ancient Warfa... |
this.armorBaySize = 3;
this.upgradeBaySize = 3;
this.ammoBaySize = 6;
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from flask import Flask
from flask_bootstrap import Bootstrap
from flask_mail import Mail
from flask_moment import Moment
from flask_sqlalchemy import SQLAlchemy
from config import config
import chartkick
bootstrap = Bootstrap()
mail = Mail()
moment = Moment()
db ... | app.jinja_env.add_extension("chartkick.ext.charts")
config[config_name].init_app(app)
bootstrap.init_app(app) |
<|file_name|>maptalks.snapto.js<|end_file_name|><|fim▁begin|>/*!
* maptalks.snapto v0.1.11
* LICENSE : MIT
* (c) 2016-2018 maptalks.org
*/
/*!
* requires maptalks@^0.33.1
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('maptalks')) :
type... | this._mousedown = function () {
this._needFindGeometry = false;
};
this._mouseup = function () { |
<|file_name|>test_model.py<|end_file_name|><|fim▁begin|># If your project uses a database, you can set up database tests
# similar to what you see below. Be sure to set the db_uri to
# an appropriate uri for your testing database. sqlite is a good
# choice for testing, because you can use an in-memory database
# which ... | |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"github.com/astaxie/beego"
//"order/controllers/errorpage"
"test/models"
_ "test/routers"
"os"
)
func init() {
models.Connect()
initArgs()
}
func main() {
//beego.ErrorController(&errorpage.ErrorController{})
beego.Run()
}
func initArg... | for _, v := range args {
if v == "-syncdb" {
models.Syncbd(false)
os.Exit(0) |
<|file_name|>test_sqlite.py<|end_file_name|><|fim▁begin|>"""
Unit tests over SQLite backend for Crash Database
"""
from apport.report import Report
import os
from unittest import TestCase
from sqlite import CrashDatabase
class CrashDatabaseTestCase(TestCase):
def setUp(self):
self.crash_base = os.path.se... |
def test_get_id_url(self): |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>const chai = require('chai');
const MemoryCache = require('..');
const observable = require('../lib/observable');
const constants = require('../lib/constants');
const { expect, assert } = chai;
const testObj = () => ({
a: { b: 'c' },
deep: { nested: { obj: {... | tits: 'blitz'
}
|
<|file_name|>version.go<|end_file_name|><|fim▁begin|>package client
import (
"runtime"
"text/template"
"time"
"github.com/docker/docker/api"
"github.com/docker/docker/api/types"
Cli "github.com/docker/docker/cli"
"github.com/docker/docker/dockerversion"
flag "github.com/docker/docker/pkg/mflag"
"github.com/d... | if err == nil {
vd.Server = &serverVersion
}
|
<|file_name|>ipdl-analyze.rs<|end_file_name|><|fim▁begin|>use std::env;
use std::path::Path;
use std::path::PathBuf;
use std::fs::File;
use std::io::Write;
extern crate tools;
extern crate ipdl_parser;
extern crate getopts;
use getopts::Options;
use tools::file_format::analysis::{read_analysis, read_target, WithLoca... |
let matches = match opts.parse(&args[1..]) {
Ok(m) => { m },
Err(f) => { panic!(f.to_string()) }, |
<|file_name|>test_mta2to3.py<|end_file_name|><|fim▁begin|>from axiom.test.historic.stubloader import StubbedTest
from xquotient.mail import MailTransferAgent
from axiom.userbase import LoginSystem
class MTAUpgraderTest(StubbedTest):
def testMTA2to3(self):
"""<|fim▁hole|> mta = self.store.findUnique(... | Make sure MailTransferAgent upgraded OK and that its
"userbase" attribute refers to the store's userbase.
""" |
<|file_name|>_version.py<|end_file_name|><|fim▁begin|># This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) wi... | |
<|file_name|>range.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/... | |
<|file_name|>test_display.py<|end_file_name|><|fim▁begin|>"""Tests for IPython.lib.display.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the ... | |
<|file_name|>datatypes.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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 ... | """ This is the base class for all HP SDN Client data types."""
|
<|file_name|>http.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/licenses/LICEN... | |
<|file_name|>tweets.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
script.matchcenter - Football information for Kodi
A program addon that can be mapped to a key on your remote to display football information.
Livescores, Event details, Line-ups, League tables, next and previous matches by team... | main = TwitterDialog('script-matchcenter-Twitter.xml', addon_path, getskinfolder(), '', hash=twitterhash, standalone=standalone) |
<|file_name|>ShUnaryExpressionImpl.java<|end_file_name|><|fim▁begin|>// This is a generated file. Not intended for manual editing.
package com.intellij.sh.psi.impl;
import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.psi.P... | |
<|file_name|>regs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#-*- coding:utf-8 -*-
from miasm2.expression.expression import ExprId
from miasm2.core.cpu import gen_reg, gen_regs
gen_reg('PC', globals())
gen_reg('PC_FETCH', globals())
gen_reg('R_LO', globals())
gen_reg('R_HI', globals())
exception_flags =... | regs_flt_str = ['F%d'%i for i in xrange(0x20)] |
<|file_name|>language.js<|end_file_name|><|fim▁begin|>Fox.define('language', [], function () {
var Language = function (cache) {
this.cache = cache || null;
this.data = {};
};
_.extend(Language.prototype, {
data: null,
cache: null,
url: 'I18n',
has: func... | this.once('sync', callback);
if (!disableCache) { |
<|file_name|>banner_generator.py<|end_file_name|><|fim▁begin|>from osgeo import gdal, osr, ogr
import numpy as np
import scipy.misc<|fim▁hole|>logger = logging.getLogger("banner-generator")
def create_raster_from_band( red, green, blue, output_file):
logger.debug("Create big raster in output_file : %s"%output_file... | import logging
logging.basicConfig(level=logging.INFO) |
<|file_name|>life.rs<|end_file_name|><|fim▁begin|>#![cfg(test)]
use traits::Cell;
use traits::Coord;
use traits::Engine;
use traits::Consumer;
use traits::Grid;
use engine::Sequential;
use grid::twodim::TwodimGrid;
use grid::nhood::MooreNhood;
use grid::EmptyState;
use utils::find_cell;
/// Implementation of Conway's ... | #[derive(Clone, Debug, Serialize, Deserialize)]
struct Life {
state: LifeState,
coord: (i32, i32), |
<|file_name|>support.js<|end_file_name|><|fim▁begin|>var request = require('request');
var RestSupport = function() {
RestSupport.prototype.get = function(resource, next) {
var me = this;
<|fim▁hole|> url: resource,
method: 'GET',
headers: {
'content-type': 'application/json'
... | request({ |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# DyNe documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 10 16:15:03 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values ... | # (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'dyne', u'DyNe Documentation', |
<|file_name|>concept.js<|end_file_name|><|fim▁begin|>/**
* Define a namespace for the application.
*/
window.app = {};
var app = window.app;
/**
* @constructor
* @extends {ol.interaction.Pointer}
*/
app.Drag = function() {
ol.interaction.Pointer.call(this, {
handleDownEvent: app.Drag.prototype.handleDown... | vector.getSource().addFeature(poly2);
|
<|file_name|>ex_7.rs<|end_file_name|><|fim▁begin|>/*
Copyright © 2013 Free Software Foundation, Inc
See licensing in LICENSE file
File: examples/ex_7.rs
Author: Jesse 'Jeaye' Wilkerson
Description:
Basic input and attribute example, using the Unicode-aware get_wch functions.
*/
extern crate ... | {
let locale_conf = LcCategory::all;
setlocale(locale_conf, "en_US.UTF-8");
|
<|file_name|>cyber.py<|end_file_name|><|fim▁begin|># ****************************************************************************
# Copyright 2018 The Apollo 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... | if reader is None:
return None |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-13 15:43
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependenc... | ],
options={
'verbose_name': 'Order', |
<|file_name|>clauses_test.go<|end_file_name|><|fim▁begin|>package qb
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestSQLText(t *testing.T) {
text := SQLText("1")
assert.Equal(t, "1", text.Text)
}
func TestGetClauseFrom(t *testing.T) {
var c Clause
c = SQLText("1")
assert.Equal(t, c, GetClau... | assert.Equal(t, 2, l.Clauses[0].(BindClause).Value)
assert.Equal(t, 4, l.Clauses[1].(BindClause).Value)
}
|
<|file_name|>PayloadPriority.py<|end_file_name|><|fim▁begin|><|fim▁hole|> * This software is open source, the MIT license applies.
*
* Website : http://www.synerty.com
* Support : support@synerty.com
"""
RPC_PRIORITY = 10
DEFAULT_PRIORITY = 100<|fim▁end|> | """
* Created by Synerty Pty Ltd
* |
<|file_name|>main.ts<|end_file_name|><|fim▁begin|>'use strict';
import * as path from 'path';
import {
workspace, Disposable, ExtensionContext, window
} from 'vscode';
import {
LanguageClient, LanguageClientOptions, ServerOptions, TransportKind
} from 'vscode-languageclient';
/**
* Activates the extension.... | module: serverModule,
transport: TransportKind.ipc |
<|file_name|>Gen.java<|end_file_name|><|fim▁begin|>package miscellaneous;
import java.util.Arrays;
public class Gen {
private static int greyCode(int n1){
return n1 ^ (n1 >> 1);
}
/*
* Advances l1 to next lexicographical higher combination.
* cap is the largest value allowed for one index.
... | |
<|file_name|>opendocument.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) 2006-2010 Søren Roug, European Environment Agency
#
# 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 F... | pass |
<|file_name|>multiple_create.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
#
# 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 L... | |
<|file_name|>assign_ops2.rs<|end_file_name|><|fim▁begin|>#[allow(unused_assignments)]
#[warn(clippy::misrefactored_assign_op, clippy::assign_op_pattern)]
fn main() {
let mut a = 5;
a += a + 1;
a += 1 + a;
a -= a - 1;
a *= a * 99;
a *= 42 * a;<|fim▁hole|> a &= a & 1;
a *= a * a;
a = a ... | a /= a / 2;
a %= a % 5; |
<|file_name|>date.py<|end_file_name|><|fim▁begin|>from pylons_common.lib.log import create_logger
from pylons_common.lib.utils import pluralize
logger = create_logger('pylons_common.lib.datetime')
from datetime import datetime, timedelta
DATE_FORMAT_ACCEPT = [u'%Y-%m-%d %H:%M:%S', u'%Y-%m-%d %H:%M:%SZ', u'%Y-%m-%d', ... | |
<|file_name|>index-test.js<|end_file_name|><|fim▁begin|>describe('raureif', function () {<|fim▁hole|><|fim▁end|> | it('test', function () {
});
}); |
<|file_name|>IModel.py<|end_file_name|><|fim▁begin|>from copy import deepcopy
class IModel():
def __init__(self):
self.list = []
def __getitem__(self, index):<|fim▁hole|> if index >= len(self.list):
raise IndexError("Index out of range.")
return self.list[index]
def __... | '''
Getter for the [] operator
''' |
<|file_name|>middleware.py<|end_file_name|><|fim▁begin|>import json
from json_url_rewriter import config
from json_url_rewriter.rewrite import URLRewriter
class HeaderToPathPrefixRewriter(object):
"""
A rewriter to take the value of a header and prefix any path.
"""<|fim▁hole|> self.keys = keys
... |
def __init__(self, keys, base, header_name): |
<|file_name|>files_2.js<|end_file_name|><|fim▁begin|>var searchData=<|fim▁hole|>];<|fim▁end|> | [
['digitalpin_2eh',['DigitalPin.h',['../_digital_pin_8h.html',1,'']]] |
<|file_name|>default.py<|end_file_name|><|fim▁begin|>import xbmc, xbmcaddon, xbmcgui, xbmcplugin,os,sys
import shutil
import urllib2,urllib
import re
import extract
import time
import downloader
import plugintools
import zipfile
import ntpath
##CREDIT TO LEE @ COMMUNITY BUILDS FOR WRITING THE FORCE CLOSE FUNCTION AND ... | dialog.ok("[COLOR=red][B]WARNING !!![/COLOR][/B]", "If you\'re seeing this message it means the force close", "was unsuccessful. Please force close XBMC/Kodi [COLOR=lime]DO NOT[/COLOR] exit cleanly via the menu.",'')
elif myplatform == 'android': # Android
print "############ try android force ... |
<|file_name|>EsetlegProcessor.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017 David Karnok
*
* 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/... | return new EsetlegProcessorRefCount<>(this); |
<|file_name|>test_socket.py<|end_file_name|><|fim▁begin|># --------------------------------------------------------
# test_socket.py: Unit tests for socket, select.
# --------------------------------------------------------
# Make sure we can import i2p
import sys; sys.path += ['../../']
import traceback, time, threa... |
def noblock_stream_test():
"""Unit test for non-blocking stream commands and listen.""" |
<|file_name|>virtual_machine_update.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
#... | 'vm_id': {'key': 'properties.vmId', 'type': 'str'},
'identity': {'key': 'identity', 'type': 'VirtualMachineIdentity'},
'zones': {'key': 'zones', 'type': '[str]'},
} |
<|file_name|>animation_manager.cpp<|end_file_name|><|fim▁begin|>#include "animation_manager.hpp"
using namespace engine;
AnimationManager AnimationManager::instance;
void AnimationManager::add_animation_quad(AnimationQuad* newQuad){
animationQuads.push_back(newQuad);
}
void AnimationManager::add_collider(SDL_Rec... | std::sort(animationQuads.begin(), animationQuads.end(),[](const AnimationQuad* lhs, const AnimationQuad* rhs){ return lhs->y < rhs->y; });
for(AnimationQuad * quad : animationQuads) {
SDL_RenderCopy(WindowManager::getGameCanvas(), quad->getTexture(), quad->getClipRect(), quad->getRenderQuad()); |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>import operator
import os
import abc
import functools
import pyparsing as pp
from mitmproxy.utils import strutils
from mitmproxy.utils import human
import typing # noqa
from . import generators
from . import exceptions
class Settings:
def __init__(
self,... | length = None # type: typing.Optional[int]
def __init__(self, value): |
<|file_name|>monitor.rs<|end_file_name|><|fim▁begin|>//! Asynchronous server and topology discovery and monitoring using isMaster results.
use {Client, Result};
use Error::{self, ArgumentError, OperationError};
use bson::{self, Bson, oid};
use chrono::{DateTime, UTC};
use coll::options::FindOptions;
use command_type:... | // Updates the server description associated with this monitor using an isMaster server response. |
<|file_name|>LoginUserDetails.java<|end_file_name|><|fim▁begin|>package org.onetwo.ext.security.utils;<|fim▁hole|>
import org.onetwo.common.web.userdetails.UserDetail;
import org.onetwo.common.web.userdetails.UserRoot;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.u... |
import java.util.Collection; |
<|file_name|>errors.rs<|end_file_name|><|fim▁begin|>// ------------------------------------------------------------------------- //
// Imports //
// ------------------------------------------------------------------------- //
// Standard libraries impor... | /// Occurs when the program is run outside of a workspace. |
<|file_name|>Importer.java<|end_file_name|><|fim▁begin|>package de.konqi.fitapi.common.importer;<|fim▁hole|>
/**
* Created by konqi on 08.05.2016.
*/
public interface Importer {
void importFromStream(String userEmail, InputStream is) throws IOException;
}<|fim▁end|> |
import java.io.IOException;
import java.io.InputStream; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 Pierre Talbot (IRCAM)
// 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
... |
pub use str_stream::*;
pub use stream::*;
pub use parse_state::*; |
<|file_name|>MainActivity.java<|end_file_name|><|fim▁begin|>package net.talayhan.android.vibeproject.Controller;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import andr... | int id = item.getItemId();
//noinspection SimplifiableIfStatement |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.shortcuts import render
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
def centres(request):
... | |
<|file_name|>test_time.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3.3
import unittest
import sys
sys.path.append("/home/hazel/Documents/new_linux_paradise/paradise_office_site/sandbox_v1.0/cygnet_maker/cy_data_validation")
from datetime import time
from time_conv import Time
class TimeTestCase(unittest.TestCase... | self.time = Time.check_time("70 80") |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// DO NOT EDIT !
// This file was generated automatically from 'src/mako/api/lib.rs.mako'
// DO NOT EDIT !
//! This documentation was generated from *coordinate* crate version *0.1.8+20141215*, where *20141215* is the exact revision of the *coordinate:v1* schema built b... | //! .progress("sanctus")
//! .note("takimata")
//! .lng(0.741081967736)
//! .lat(0.155564420342) |
<|file_name|>FillLayout.js<|end_file_name|><|fim▁begin|>$_L(["$wt.widgets.Layout"],"$wt.layout.FillLayout",["$wt.graphics.Point","$wt.layout.FillData"],function(){
c$=$_C(function(){
this.type=256;
this.marginWidth=0;
this.marginHeight=0;
this.spacing=0;
$_Z(this,arguments);
},$wt.layout,"FillLayout",$wt.widget... | },"~N");
$_V(c$,"computeSize",
function(composite,wHint,hHint,flushCache){
var children=composite.getChildren();
|
<|file_name|>periodic_task.py<|end_file_name|><|fim▁begin|>#
# 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 requir... |
class _PeriodicTasksMeta(type):
def _add_periodic_task(cls, task): |
<|file_name|>logging.py<|end_file_name|><|fim▁begin|>"""Access and control log capturing."""
import logging
import os
import re
import sys
from contextlib import contextmanager
from io import StringIO
from pathlib import Path
from typing import AbstractSet
from typing import Dict
from typing import Generator
from typin... |
def pytest_addoption(parser: Parser) -> None: |
<|file_name|>not-panic-safe.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// http://rust-lang.org/COPYRIGHT.
//
// 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. ... | // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at |
<|file_name|>AboutApplyingWhatWeHaveLearnt.js<|end_file_name|><|fim▁begin|>var dojox; //globals
var df = dojox.lang.functional;
describe("About Applying What We Have Learnt", function() {
var operations;
beforeEach(function () {
operations = [
{ direction: "RT", distance: 200},
... | });
|
<|file_name|>test_open_file.py<|end_file_name|><|fim▁begin|>import unittest
<|fim▁hole|> """
Class test for request params class
"""
def test_open_file_error(self):
"""
test case secured upload
"""
injectionContainer.Container.update(
ContainerMock().container... | import upload.injectionContainer as injectionContainer
from upload.strategy.dummys.injectedContainerDummy import ContainerMock
class TestRequestParams(unittest.TestCase): |
<|file_name|>secp256k1.cc<|end_file_name|><|fim▁begin|>////////////////////////////////////////////////////////////////////////////////
//
// secp256k1.cc
//
// Copyright (c) 2013 Eric Lombrozo
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated document... | } |
<|file_name|>VolumeWeightedAveragePriceExecutionModelRegressionAlgorithm.py<|end_file_name|><|fim▁begin|># QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License"... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![feature(proc_macro_hygiene)]
#[macro_use] pub mod logger;
pub mod app;
pub mod render;
pub mod resource;<|fim▁hole|><|fim▁end|> | pub mod time; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/* io::mod.rs */
use core::mem::volatile_store;
use kernel::sgash;
mod font;
/* http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0225d/BBABEGGE.html */
pub static UART0: *mut u32 = 0x101f1000 as *mut u32;
pub static UART0_IMSC: *mut u32 = (0x101f1000 + ... |
pub unsafe fn backup() |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>'''
This file is part of pyShop
pyShop 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, or
(at your option) any later version.
p... |
class ProductAdmin(admin.ModelAdmin):
'''Contains the admin panel settings for product objects |
<|file_name|>exporter.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2015-2019 grafana-dashboard-builder contributors
#
# 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
#
# ... |
def process_projects(self, projects, parent_context=None):
""" |
<|file_name|>filters-1.py<|end_file_name|><|fim▁begin|>import convis
import numpy as np
import matplotlib.pylab as plt<|fim▁hole|>plt.figure()
plt.plot(convis.numerical_filters.exponential_filter_1d(tau=0.01))<|fim▁end|> | plt.figure()
plt.imshow(convis.numerical_filters.gauss_filter_2d(4.0,4.0)) |
<|file_name|>search_engine_unit_tests.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Pub... | self._check("title:muon", '', None,
[['+', 'muon', 'title', 'w']])
if not CFG_CERN_SITE: |
<|file_name|>rankcommand.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"strings"
"thezombie.net/libgojira"
)
func init() {
parser.AddCommand("rank",
"Rank Jira stories",
"The rank command allows a user to modify story ranks",
&rankCommand)
}
//Command made to list
type RankCommand struct {
... | target := args[len(args)-1]
before_or_after := strings.ToLower(args[len(args)-2]) |
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp');
var tingpng = require('gulp-tinypng');
<|fim▁hole|>
gulp.task('default', function () {
gulp.src('source/*.png')
.pipe(tingpng('q3BNdXVPRfkwwful4l0Hlf1cb8KlhmUE'))
.pipe(gulp.dest('destination'));
});<|fim▁end|> | |
<|file_name|>lpurge.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2020 DDN. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
use crate::{agent_error::ImlAgentError, env};
use futures::future::TryFutureExt;
use std::{collections::HashMap, pa... | vars.insert("mailbox".to_string(), &c.mailbox); |
<|file_name|>TCNarrativeTextCtrl.py<|end_file_name|><|fim▁begin|># Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you ... | import wx
import armid
from ARM import * |
<|file_name|>tsigkey.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Rackspace Hosting
# 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://... | # under the License.
from designate.objects.base import BaseObject
|
<|file_name|>script_test_1.py<|end_file_name|><|fim▁begin|>"""Test that arguments passed to a script Menu.main(loop=True) execute
properly."""
##==============================================================#
## SECTION: Imports #
##==========================================... | self.assertEqual(0, result)
self.assertTrue(op.exists("foo"))
self.assertFalse(op.exists("bar"))
self.assertTrue(op.exists("caz")) |
<|file_name|>parser.js<|end_file_name|><|fim▁begin|>/*!
* Jade - Parser
* Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Lexer = require('./lexer')
, nodes = require('./nodes');
/**
* Initialize `Parser` with the given input `str` and `filename`.
*... | var name = this.advance().val
, tag = new nodes.Tag(name);
tag.line = this.line(); |
<|file_name|>0006_auto_20180223_2138.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-23 21:38<|fim▁hole|>from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('members', '... | |
<|file_name|>strike.py<|end_file_name|><|fim▁begin|># Author: matigonkas
# URL: https://github.com/SiCKRAGETV/sickrage
#
# This file is part of SickRage.
#
# SickRage 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... |
def __init__(self):
generic.TorrentProvider.__init__(self, "Strike") |
<|file_name|>wavesPass.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|> * This code is available to you under Apache License Version 2.0, January
* 2014. You can grab a copy of license from the same repository from where you
* fetched this code.
*/
#include "llvm/ADT/DenseMap.h"
#include "llvm/Analysis/CFGPrinter.h"
#... | /*
* Spatial Computation - Manifestation of Spatial computing.
* Copyright © 2014 Pranav Kant
* |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/*jshint esversion: 6 */<|fim▁hole|><|fim▁end|> |
import './flowtext.js'; |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2019 OpenSynergy Indonesia
# Copyright 2022 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "New Assignment Career Transition "
"Integration With Timesheet Computa... | "hr_assignment_transition",
"hr_career_transition_timesheet_computation",
], |
<|file_name|>service.py<|end_file_name|><|fim▁begin|># Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | import diff_match_patch
|
<|file_name|>JournalEntryForm.js<|end_file_name|><|fim▁begin|>import React from 'react'
import { compose } from 'redux'
import { connect } from 'react-redux'
import { Field, FieldArray, reduxForm } from 'redux-form'
import { amount, autocomplete, debitCredit } from './Fields'
import { Button, FontIcon } from 'react-too... | {fields.map((record, index) => |
<|file_name|>utils-triggers.js<|end_file_name|><|fim▁begin|>function triggerEventAfterBootstrap(checkout) {
jQuery(document).trigger("wpshopify_bootstrap_after", [checkout]);
}
function triggerEventBeforeBootstrap() {
jQuery(document).trigger("wpshopify_bootstrap_before");
}
function triggerEventAfterAddToCart(pr... | |
<|file_name|>dilatedcontext.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import tensorflow as tf
from niftynet.layer import layer_util
class DilatedTensor(object):
"""
This context manager makes a wrapper of input_tensor
When created, the... | self.zero_paddings, |
<|file_name|>askbot_add_test_content.py<|end_file_name|><|fim▁begin|>from django.core.management.base import NoArgsCommand
from askbot.models import User
from optparse import make_option
from askbot.utils.console import choice_dialog
NUM_USERS = 40
# KEEP NEXT 3 SETTINGS LESS THAN OR EQUAL TO NUM_USERS!
NUM_QUESTIONS... | user.reputation = INITIAL_REPUTATION
user.save()
self.print_if_verbose("Created User '%s'" % user.username) |
<|file_name|>com_google_android_feedback.py<|end_file_name|><|fim▁begin|>'''
NFI -- Silensec's Nyuki Forensics Investigator
Copyright (C) 2014 George Nicolaou (george[at]silensec[dot]com)
Silensec Ltd.
Juma Fredrick (j.fredrick[at]silensec[dot]com)
Silensec ... | self.known = True |
<|file_name|>RenderscriptParser.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2013 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:... | while (!builder.eof()) {
builder.advanceLexer();
} |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|># Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0<|fim▁hole|>"""
import sys
# This is needed so Python can find test_tools on the path.
sys.path.append('../../..')
from test_tools.fixtures.common import *<|fi... |
"""
Contains common test fixtures used to run unit tests. |
<|file_name|>bsp_generator.rs<|end_file_name|><|fim▁begin|>use core::{DungeonGenerator, RoomType, Room, Rectangle};
use rand::{SeedableRng, StdRng, Rng};
use std::collections::VecDeque;
use std::cmp::{min, max};
/// Simple Binary Space Partioning dungeon generation algorithm:
///
/// 1. Workspace splitting to random ... | /// levels of binary tree |
<|file_name|>basic.js<|end_file_name|><|fim▁begin|>const fs = require('fs');
const path = require('path');
const cleanCss = require('../../index.js');
module.exports = {<|fim▁hole|> name : 'basic test',
this : function () {
const str = fs.readFileSync(path.resolve('test/styles/basic.dirty.scss'), 'utf8');
... | |
<|file_name|>resource.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 WALLIX
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 required by app... | |
<|file_name|>es_query_aggop.py<|end_file_name|><|fim▁begin|># encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahna... | def es_countop(es, mvel, query):
""" |
<|file_name|>finding_if_prime.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
import math
import random
def finding_prime(number):
num=abs(number)
if num<4: return True
for x in range(2,num):
if num%x == 0:
return False
return True
def finding_prime_sqrt(number):
num=abs(number)
if num<4: return True
... |
def finding_prime_fermat(number): |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you... | |
<|file_name|>watch.js<|end_file_name|><|fim▁begin|>module.exports = {
livereload: {
options: {
livereload: '<%= express.options.livereload %>'
},
files: [
'<%= yeoman.currentDir %>',
'<%= yeoman.demo %>/**/*.html',
'<%= yeoman.demo %>/**/*.js',... | '<%= yeoman.src %>/{,*/}*.css',
'<%= yeoman.src %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
]
}, |
<|file_name|>corrmm.py<|end_file_name|><|fim▁begin|>"""
GpuCorrMM-based convolutional layers
"""
import theano
from .. import init
from .. import nonlinearities
from .base import Layer
from .conv import conv_output_length
from theano.sandbox.cuda.basic_ops import gpu_contiguous
from theano.sandbox.cuda.blas import... |
def get_bias_params(self): |
<|file_name|>CelestrackNORAD.py<|end_file_name|><|fim▁begin|><|fim▁hole|>TURKSAT 4A
1 39522U 14007A 15301.78105273 .00000128 00000-0 00000+0 0 9996
2 39522 0.0299 272.9737 0004735 326.3457 120.6614 1.00271335 6265
'''
import math
import sys
import astropy.units as u
name = sys.stdin.readline... | ''' |
<|file_name|>issue-49257.rs<|end_file_name|><|fim▁begin|>// Test for #49257:
// emits good diagnostics for `..` pattern fragments not in the last position.
#![allow(unused)]
struct Point { x: u8, y: u8 }
fn main() {<|fim▁hole|> let p = Point { x: 0, y: 0 };
let Point { .., y, } = p; //~ ERROR expected `}`, fo... | |
<|file_name|>storage.py<|end_file_name|><|fim▁begin|>"""
Classes and functions to handle storage devices.
This exports:
- two functions for get image/blkdebug filename
- class for image operates and basic parameters
"""
from __future__ import division
import errno
import logging
import os
import shutil
import re
i... | :param base_key_secrets: ImageSecret objects from its backing images
:param cipher_alg: name of encryption cipher algorithm
:param cipher_mode: name of encryption cipher mode |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.