prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>jquery.elastislide.js<|end_file_name|><|fim▁begin|>(function( window, $, undefined ) {
// http://www.netcu.de/jquery-touchwipe-iphone-ipad-library
$.fn.touchwipe = function(settings) {
var config = {
min_move_x: 20,
min_move_y: 20,
wipeLeft: function() { },
wipeRight: function() { ... | |
<|file_name|>script.py<|end_file_name|><|fim▁begin|>"""
None of the functions/objects in this module need be passed `db`.
Naming convention: a `pub` is either a pubkey or a pubkeyhash
"""
import hashlib
import bitcoin as bitcoinlib
import binascii
from bitcoin.core.key import CPubKey
from counterpartylib.lib import... | if is_pubkeyhash(pub): |
<|file_name|>PRNG.js<|end_file_name|><|fim▁begin|>import { modulo } from './Math.js'
export function random(x) {
return modulo(Math.sin(x) * 43758.5453123, 1)<|fim▁hole|><|fim▁end|> | } |
<|file_name|>lru_cache.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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://ww... | self._last_visits.append(t)
|
<|file_name|>dining_philosophers.rs<|end_file_name|><|fim▁begin|>// http://rosettacode.org/wiki/Dining_philosophers
//! A Rust implementation of a solution for the Dining Philosophers Problem. We prevent a deadlock
//! by using Dijkstra's solution of making a single diner "left-handed." That is, all diners except
//! ... | |
<|file_name|>repl.py<|end_file_name|><|fim▁begin|>import code
import sys
from awesomestream.jsonrpc import Client
def main():
try:
host = sys.argv[1]
except IndexError:
host = 'http://localhost:9997/'
banner = """>>> from awesomestream.jsonrpc import Client<|fim▁hole|> c = Client(host)
... | >>> c = Client('%s')""" % (host,) |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate failure;
#[macro_use]
extern crate lazy_static;
extern crate chrono;
extern crate mp3_duration;
extern crate rayon;
extern crate regex;
extern crate reqwest;
extern crate rss;
extern crate select;
extern crate url;
mod diecast;
mod spodcast;
m... | use rayon::prelude::*;
use rss::Channel;
use rss::Item; |
<|file_name|>tokens.rs<|end_file_name|><|fim▁begin|>use files::dump;
pub struct Token<'a>
{
pub name: &'a str,
pub range: (usize, usize),
pub value: String,
pub line_number: usize,
}
impl <'a> Token<'a>
{
#[allow(dead_code)]
pub fn clone(&self) -> Token<'a>
{
Token
{
... | // Token name
lexed_token_string.push_str(token.name);
if name_pad_length > 0 { lexed_token_string.push_str(&spaces[..name_pad_length]); } |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from errors import *
from manager import SchemaManager |
<|file_name|>initGlobalShortcuts.js<|end_file_name|><|fim▁begin|><|fim▁hole|>function initGlobalShortcuts () {
globalShortcut.register('MediaNextTrack', playbackControls.clickNextSong)
globalShortcut.register('MediaPreviousTrack', playbackControls.clickPreviousSong)
globalShortcut.register('MediaStop', playbackCo... | import { globalShortcut } from 'electron'
import playbackControls from '../actions/playbackControls'
|
<|file_name|>EventPattern.py<|end_file_name|><|fim▁begin|>import uuid
from uqbar.objects import new
from supriya.patterns.Pattern import Pattern
class EventPattern(Pattern):
### CLASS VARIABLES ###
__slots__ = ()
<|fim▁hole|>
if not isinstance(expr, supriya.patterns.Event):
expr = supr... | ### SPECIAL METHODS ###
def _coerce_iterator_output(self, expr, state=None):
import supriya.patterns |
<|file_name|>date.js<|end_file_name|><|fim▁begin|>/**
* Globalize v1.4.0-alpha.2
*
* http://github.com/jquery/globalize
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2018-03-09T13:51Z
*/
/*!
* Globalize v1.4.0-alpha.2 2018-03-09T... | * G: 0
* y: 1 |
<|file_name|>sleepcr.rs<|end_file_name|><|fim▁begin|>#[doc = "Register `SLEEPCR` reader"]
pub struct R(crate::R<SLEEPCR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<SLEEPCR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<SLEEPCR_SPEC>> f... | }
#[doc = r"Sets the field bit"] |
<|file_name|>ios.py<|end_file_name|><|fim▁begin|>"""
ios.py
Handle arguments, configuration file
@author: K.Edeline
"""
import sys
import argparse
import configparser
import logging
import shutil
class IOManager(object):
"""
extend me
"""
#DEFAULT_CONFIG_LOC="/tmp/deploypl.ini"
PKG_FILE = "pack... | |
<|file_name|>rc.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/license... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | pub mod file; |
<|file_name|>directive.d.ts<|end_file_name|><|fim▁begin|>import { OnInit, SimpleChanges, OnChanges } from '@angular/core';
import { Validator, AbstractControl } from '@angular/forms';
export declare class NotEqualValidator implements Validator, OnInit, OnChanges {
notEqual: any;<|fim▁hole|> ngOnChanges(changes: ... | private validator;
private onChange;
ngOnInit(): void; |
<|file_name|>test_order.py<|end_file_name|><|fim▁begin|>import string
import unittest
import datetime
import collections
from unittest import mock
from flumine.order.order import (
BaseOrder,
BetfairOrder,
ExchangeType,
OrderTypes,
OrderStatus,
VALID_BETFAIR_CUSTOMER_ORDER_REF_CHARACTERS,
L... | for c in string.digits: |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from operator import attrgetter
from django.db import models
from django.test import TestCase
from .models import Answer, Dimension, Entity, Post, Question
<|fim▁hole|> def setUpTestData(cls):
cls.q1 = Question.obje... |
class OrderWithRespectToTests(TestCase):
@classmethod |
<|file_name|>bitcoin_zh_TW.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="zh_TW" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Litecoin</sour... | <location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation>編輯位址與標記的儲存列表</translation> |
<|file_name|>mylistwidget.py<|end_file_name|><|fim▁begin|>__author__ = 'snake'
from PyQt4 import QtGui, QtCore
class SiteItems(QtGui.QListWidget):
<|fim▁hole|>
def startDrag(self, dropAction):
# create mime data object
#get all selected items
selitems = ""
for i in self.selected... | def __init__(self):
super(SiteItems, self).__init__() |
<|file_name|>linux_command_runner_test.go<|end_file_name|><|fim▁begin|>package linux_command_runner_test
import (
"os"
"os/exec"
"syscall"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"code.cloudfoundry.org/commandrunner/linux_command_runner"
)
var _ = Describe("Running commands", func() {
It("runs ... | |
<|file_name|>optimisation.py<|end_file_name|><|fim▁begin|>"""
optimisation.py: Optimisations for worldview solving
Copyright (C) 2014 Michael Kelly
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 So... | |
<|file_name|>generate_date_table.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
###############################################################################
# #
# This program is free software: you can redistribute it and/or ... | priorities = {}
illegitimate_names = set()
with open(lpsn_gss_file, encoding='utf-8', errors='ignore') as f:
csv_reader = csv.reader(f)
|
<|file_name|>FtpRobotRulesParser.java<|end_file_name|><|fim▁begin|>/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to Yo... | if (status.getCode() == ProtocolStatus.SUCCESS) {
robotRules = parseRules(url.toString(), output.getContent().getContent(),
CONTENT_TYPE, agentNames); |
<|file_name|>httpbasics.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Copyright (c) 2015-2017 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-lice... | out1 = conn.getresponse().read()
assert(b'"error":null' in out1)
#node2 (third node) is running with standard keep-alive parameters which means keep-alive is on |
<|file_name|>test_ordinary_fields.py<|end_file_name|><|fim▁begin|>import unittest
import uuid
from django.core.checks import Error, Warning as DjangoWarning
from django.db import connection, models
from django.test import (
SimpleTestCase, TestCase, skipIfDBFeature, skipUnlessDBFeature,
)
from django.test.utils im... | errors.extend(field.check()) |
<|file_name|>rst2html.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python<|fim▁hole|># Modified for Bazaar to accommodate options containing dots
#
# This file is in the public domain.
"""
A minimal front end to the Docutils Publisher, producing HTML.
"""
try:
import locale
locale.setlocale(locale.LC_ALL, ... |
# Originally by Dave Goodger, from the docutils, distribution.
# |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>'use strict';
/* App Module */
var granuleApp = angular.module('granuleApp', [ 'ngRoute', 'angularBasicAuth', 'granuleControllers', 'granuleServices']);
granuleApp.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/login', {
... | |
<|file_name|>_base.ctx.js<|end_file_name|><|fim▁begin|>module.exports = {
path: {<|fim▁hole|> scripts: '/assets/scripts',
styles: '/assets/styles',
images: '/assets/images'
},
site: {
url: require('./package.json').mylly.url,
name: 'My website',
lang: 'en',
charset: 'utf-8',
ua: '' ... | |
<|file_name|>dci.rs<|end_file_name|><|fim▁begin|>#[doc = "Register `DCI` reader"]
pub struct R(crate::R<DCI_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<DCI_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<DCI_SPEC>> for R {
#[inline(... | }
#[doc = "Checks if the value of the field is `VALUE1`"] |
<|file_name|>modal-portfolio.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core'
import template from './modal-portfolio.component.html'
@Component({
selector: 'modal-portfolio',
template
})
export class ModalPortfolioComponent {<|fim▁hole|><|fim▁end|> | constructor() {}
} |
<|file_name|>send_summary_mails.py<|end_file_name|><|fim▁begin|>from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from django.template.loader import render_to_string
from django.conf import settings
from preferences.models import UserPreferences
from summaries.models im... | |
<|file_name|>InitialDock1.py<|end_file_name|><|fim▁begin|>import sys
from PyQt4 import QtGui, QtCore
class InitialDock1(QtGui.QWidget):
def __init__(self, parent=None, message=None, speciesDefault=None, contBtnFn=None, addBtnFn=None, speciesFn=None):
QtGui.QWidget.__init__(self,parent)
self.setWin... | self.connect(self.speciesSelector,QtCore.SIGNAL('activated(QString)'), speciesFn)
|
<|file_name|>ActualInvocationsSource.hpp<|end_file_name|><|fim▁begin|>//
// Created by eran on 01/04/2015.
//
#include <unordered_set>
#include "fakeit/Invocation.hpp"
namespace fakeit {
struct ActualInvocationsContainer {
virtual void clear() = 0;
virtual ~ActualInvocationsContainer() NO_THROWS { }
};
s... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![recursion_limit = "1024"]
mod async_rt;
mod backend;
mod codec;
mod dealer;
mod endpoint;
mod error;
mod fair_queue;
mod message;
mod r#pub;
mod pull;
mod push;
mod rep;
mod req;
mod router;
mod sub;
mod task_handle;
mod transport;
pub mod util;
#[doc(hidden)]
pub m... | |
<|file_name|>parse_response_file.py<|end_file_name|><|fim▁begin|>from ggrade import read_tab_file
import argparse
################################################################################
################################################################################
def main():
# Parse the input argumen... | outfile.write("\n")
outfile.write(solutions_string)
outfile.write("\n")
outfile.write(extra_feedback_string) |
<|file_name|>WISCSpider.py<|end_file_name|><|fim▁begin|>import scrapy
import re
from research.items import ResearchItem
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
class CaltechSpider(scrapy.Spider):
name = "WISC"<|fim▁hole|>
def parse(self, response):
item = ResearchItem()
for sel in response.xpath('... | allowed_domains = ["cs.wisc.edu"]
start_urls = ["https://www.cs.wisc.edu/research/groups"] |
<|file_name|>WorldWideWeb_suite.py<|end_file_name|><|fim▁begin|>"""Suite WorldWideWeb suite, as defined in Spyglass spec.:
Level 1, version 1
Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2
AETE/AEUT resource version 1/0, language 0, scrip... | _subcode = 'LSTW'
if _arguments: raise TypeError, 'No optional args expected' |
<|file_name|>batchutils.py<|end_file_name|><|fim▁begin|>import plugins, datetime, time, os
class BatchVersionFilter:
def __init__(self, batchSession):
self.batchSession = batchSession
def verifyVersions(self, app):
badVersion = self.findUnacceptableVersion(app)
if badVersion is not Non... | pass
return None, None, None
|
<|file_name|>TestNativeAtan2piRelaxed.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2016 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<|fim▁hole|> ... | *
* http://www.apache.org/licenses/LICENSE-2.0
* |
<|file_name|>test_shelve_instance.py<|end_file_name|><|fim▁begin|># Copyright 2014 Scality
# 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://w... | self.assertEqual(self.timestamp, got_timestamp)
def _shelve_then_unshelve_server(self, server): |
<|file_name|>api.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The Gogs Authors. All rights reserved.
// Copyright 2016 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// Package v1 Gitea API.
//
// This documentation d... | Post(bind(api.CreateOAuth2ApplicationOptions{}), user.CreateOauth2Application)
m.Combo("/oauth2/{id}"). |
<|file_name|>tui.py<|end_file_name|><|fim▁begin|>class SpellPickerController:
def render(self):
pass
<|fim▁hole|>_controller_class = SpellPickerController<|fim▁end|> | |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|># This file contains the WSGI configuration required to serve up your
# web application at http://khasm08.pythonanywhere.com/
# It works by setting the variable 'application' to a WSGI handler of some
# description.
#
# +++++++++++ GENERAL DEBUGGING TIPS +++++++++++
# ... | ## is used externally.
#from main_flask_app_file import app as application |
<|file_name|>userAccountBasicAuth.js<|end_file_name|><|fim▁begin|>import basicAuth from 'express-basic-auth'
import { Ability } from '@casl/ability'
const userAccountAuthorizer = (app) => async (email, password, cb) => {
try {
const auth = await app
.service('authentication')
.create({ email, passwor... | }) |
<|file_name|>fullsearch.py<|end_file_name|><|fim▁begin|># -*- coding: iso-8859-1 -*-
"""
MoinMoin - fullsearch action
This is the backend of the search form. Search pages and print results.
@copyright: 2001 by Juergen Hermann <jh@web.de>
@license: GNU GPL, see COPYING for details.
"""
impor... | """ Return a paragraph showing hints for a search
|
<|file_name|>TrustBasedServiceRecommender.java<|end_file_name|><|fim▁begin|>package org.trrusst.software.recommender;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
... | serviceDAO.setName(resultArray[1]); |
<|file_name|>import_tests.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::unit_tests::testutils::{
compile_module_string_with_stdlib, compile_script_string_with_stdlib,
};
#[test]
fn compile_script_with_imports() {
let code = String... | |
<|file_name|>sitemap-helpers.js<|end_file_name|><|fim▁begin|>const libxmljs2 = require('libxmljs2');
const fetch = require('node-fetch');
const E2eHelpers = require('../../../testing/e2e/helpers');
const SITEMAP_URL = `${E2eHelpers.baseUrl}/sitemap.xml`;
const SITEMAP_LOC_NS = 'http://www.sitemaps.org/schemas/sitemap/... | |
<|file_name|>BenchmarkTest11696.java<|end_file_name|><|fim▁begin|><|fim▁hole|>* Benchmark Project. For details, please see
* <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>.
*
* The Benchmark is free software: you can redistribute it and/or modify it under the terms
* o... | /**
* OWASP Benchmark Project v1.1
*
* This file is part of the Open Web Application Security Project (OWASP) |
<|file_name|>pwconst_user.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2012 Carsten Burstedde, Donna Calhoun
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must r... | |
<|file_name|>schema.py<|end_file_name|><|fim▁begin|>"""Voluptuous schemas for the KNX integration."""
import voluptuous as vol
from xknx.devices.climate import SetpointShiftMode
from homeassistant.const import (
CONF_ADDRESS,
CONF_DEVICE_CLASS,
CONF_ENTITY_ID,
CONF_HOST,
CONF_NAME,
CONF_PORT,
... | |
<|file_name|>container_manager_stub.go<|end_file_name|><|fim▁begin|>/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICE... | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and |
<|file_name|>ninnhu_kalman_filtering_expt.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Thu Apr 28 16:52:18 2016 by emin
"""
import os
import sys
import theano
import theano.tensor as T
import numpy as np
from lasagne.layers import InputLayer, ReshapeLayer, DenseLayer
from generators import Kal... | # To reshape back to our original shape, we can use the symbolic shape variables we retrieved above.
l_out = ReshapeLayer(l_dense, (batch_size, seqlen, n_out))
return l_out, l_rec |
<|file_name|>point-loc_test.go<|end_file_name|><|fim▁begin|>package test
import (
"fmt"
"math/rand"
"strconv"
"testing"
"time"
"github.com/200sc/go-compgeo/dcel"
"github.com/200sc/go-compgeo/dcel/off"
"github.com/200sc/go-compgeo/dcel/pointLoc"
"github.com/200sc/go-compgeo/dcel/pointLoc/bench/bruteForce"
"g... | pt := randomPt()
pl.PointLocate(pt.X(), pt.Y())
}
} |
<|file_name|>sup.server.protocol.ts<|end_file_name|><|fim▁begin|>import { Upload } from './../models/upload/upload.model';
import { SUPController } from './sup.server.controller';
const yellow = '\x1b[33m%s\x1b[0m: ';
export class SUP {
constructor(private io: SocketIOClient.Manager) { ... | |
<|file_name|>WaypointManager.java<|end_file_name|><|fim▁begin|>package org.droidplanner.core.MAVLink;
import com.MAVLink.Messages.MAVLinkMessage;
import com.MAVLink.common.msg_mission_ack;
import com.MAVLink.common.msg_mission_count;
import com.MAVLink.common.msg_mission_current;
import com.MAVLink.common.msg_mission_... | |
<|file_name|>logsettings.py<|end_file_name|><|fim▁begin|>import os
import platform
import sys
from logging.handlers import SysLogHandler
LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
def get_logger_config(log_dir,
logging_env="no_env",
tracking_filename="t... | '[%(name)s] %(filename)s:%(lineno)d - %(message)s', |
<|file_name|>transfer.go<|end_file_name|><|fim▁begin|>// Copyright 2009 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 http
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http/internal"<|fim▁hol... | "net/textproto"
"sort"
"strconv"
"strings" |
<|file_name|>ping_pong_paddle.js<|end_file_name|><|fim▁begin|>function PingPongPaddle(x, y, z, radius) {
this.x = x;
this.y = y;
this.z = z;
this.radius = radius;
}
PingPongPaddle.prototype = {
rotation: new THREE.Vector3(0, 0, 0),
init: function(scene) {
var tableImage = THREE.ImageUti... | this.paddle.position.x = this.x;
this.paddle.position.y = this.y;
this.paddle.position.z = this.z;
scene.add(this.paddle); |
<|file_name|>test_scale.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public ... | expected = input[:]
output = Scale()(input)
self.assertEqualVector(output, input)
|
<|file_name|>_width.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class WidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="width", parent_name="violin", **kwargs):
super(WidthValidator, self).__init__(<|fim▁hole|> parent_name=pare... | plotly_name=plotly_name, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, ... |
distro: Provides a more stable linux distribution detection. |
<|file_name|>gate.rs<|end_file_name|><|fim▁begin|>// ignore-arm
// ignore-aarch64
// ignore-wasm
// ignore-emscripten
// ignore-mips
// ignore-mips64
// ignore-powerpc<|fim▁hole|>// ignore-powerpc64le
// ignore-riscv64
// ignore-sparc
// ignore-sparc64
// ignore-s390x
// gate-test-sse4a_target_feature
// gate-test-powe... | // ignore-powerpc64 |
<|file_name|>decodable.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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/... | // except according to those terms.
/*! |
<|file_name|>compile.js<|end_file_name|><|fim▁begin|>var typecheck = require('./typeinference').typecheck,
macroexpand = require('./macroexpand').macroexpand,
loadModule = require('./modules').loadModule,
exportType = require('./modules').exportType,
types = require('./types'),
nodeToType = require(... |
if(!opts.nodejs) {
output.push("(function() {");
} |
<|file_name|>items.py<|end_file_name|><|fim▁begin|># Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html<|fim▁hole|>class PopularArticlesItem(Item):
# define the fields for your item here like:
# name = Field()
pass<|fim▁end|> |
from scrapy.item import Item, Field
|
<|file_name|>assembly.py<|end_file_name|><|fim▁begin|>'''
Opcode d(11:8) Operand d(7:0) Operation
0 8 bits representing a constant Load constant to Reg0
1 8 bits representing a constant Load constant to Reg1
2 d7 selects register Re... | printInstructions(); |
<|file_name|>test_mxne_inverse.py<|end_file_name|><|fim▁begin|># Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de>
#
# License: Simplified BSD
import os.path as op
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_allcl... | import mne
from mne.datasets import testing
from mne.label import read_label |
<|file_name|>parse_test.go<|end_file_name|><|fim▁begin|>// Copyright 2009 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 net
import (
"bufio";
"os";
"testing";
)
func TestReadLine(t *testing.T) {
filename := "/e... | lineno := 1;
byteno := 0;
for { |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>#
# stage.py -- Classes for pipeline stages
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from ginga.misc import Bunch
<|fim▁hole|>
class StageError(Exception):
pass
class Stage(object):
"""Clas... | #__all__ = ['Pipeline']
|
<|file_name|>progressbar-labels.ts<|end_file_name|><|fim▁begin|>import {Component} from '@angular/core';
@Component({
selector: 'ng2vd-progressbar-labels',<|fim▁hole|> ng2v-progressbar {
margin-top: 5rem;
}
`]
})
export class Ng2vdProgressbarLabels {
}<|fim▁end|> | templateUrl: './progressbar-labels.html',
styles: [` |
<|file_name|>0002_auto__add_field_score_created_at__add_field_score_updated_at__add_fiel.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration)... | 'form_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'maximum_monthly_records': ('django.db.models.fields.IntegerField', [], {'default': '20'}),
'passing_... |
<|file_name|>test_satellitesync.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
"""Test class for InterSatellite Sync feature
:Requirement: Satellitesync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: UI
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from robottelo.de... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from flask import render_template
from app import app, db, models
import json
@app.route('/')<|fim▁hole|>def index():
# obtain today's words
# words = models.Words.query.all()
# words = list((str(word[0]), word[1]) for word in db.session.query(models.Words... | @app.route('/index') |
<|file_name|>fetch-zero-knowledge.js<|end_file_name|><|fim▁begin|>/**
* Fetch configuration data using an API Key and the Application Secret Key.
* By doing so, the sconfig servers will just apply firewall rules (if any) and return
* the encrypted configuration data. The client will then decrypt the configuration
*... | key: '{YOUR_API_KEY}', // the 32-char version of an API Key
secret: '{YOUR_APP_SECRET}', // the 32 char secret key found under the App Details tab
//version: '{YOUR_VERSION}', // version name to fetch, defaults to latest version created |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>__author__ = 'tom'
from django.contrib import admin
from core.models import Post, Project
admin.site.register(Post)<|fim▁hole|><|fim▁end|> | admin.site.register(Project) |
<|file_name|>htmltextareaelement.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::attr::Attr;
use dom::bindings::cell::DOM... | |
<|file_name|>request_test.go<|end_file_name|><|fim▁begin|>// Copyright 2013 Matthew Baird
// 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
//... | |
<|file_name|>ll.rs<|end_file_name|><|fim▁begin|>#![allow(improper_ctypes, non_camel_case_types)]
use super::errors;
use super::{Connection, UserStatus, MessageType, FileControl, };
use libc::{c_int, c_uint, c_void};
pub enum Struct_Tox { }
pub type Tox = Struct_Tox;
#[repr(C)]
#[derive(Copy, Clone, PartialEq, Eq)]
... | pub fn tox_friend_get_status(tox: *const Tox, friend_number: u32,
error: *mut TOX_ERR_FRIEND_QUERY)
-> UserStatus;
pub fn tox_callback_friend_status(tox: *mut Tox, |
<|file_name|>4eba2f05c2f4_correct_vxlan_endpoint_primary_key.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Thales Services SAS
#
# 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
... | |
<|file_name|>light.py<|end_file_name|><|fim▁begin|>"""Support for FutureNow Ethernet unit outputs as Lights."""
import logging
import voluptuous as vol
from homeassistant.const import (
CONF_NAME, CONF_HOST, CONF_PORT, CONF_DEVICES)
from homeassistant.components.light import (
ATTR_BRIGHTNESS, SUPPORT_BRIGHT... | |
<|file_name|>afip.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
... | if self.type == 'manual':
name = 'Manual'
elif self.type == 'preprinted': |
<|file_name|>KeyRelationImpl.cpp<|end_file_name|><|fim▁begin|>// -*- mode: c++; c-basic-style: "bsd"; c-basic-offset: 4; -*-
/*
* kdm/data/KeyRelationImpl.cpp
* Copyright (C) Cátedra SAES-UMU 2010 <andres.senac@um.es>
* Copyright (C) INCHRON GmbH 2016 <soeren.henning@inchron.com>
*
* EMF4CPP is free software: you ... | * See the GNU Lesser General Public License for more details.
* |
<|file_name|>test_2595_Spinner.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010 Resolver Systems Ltd.
<|fim▁hole|># All Rights Reserved
#
from functionaltest import FunctionalTest
class Test_2595_Throbber(FunctionalTest):
def test_spinner_appears_during_recalcs(self):
# * Harold likes to ... | |
<|file_name|>optimizer.py<|end_file_name|><|fim▁begin|>import logging
from math import isclose
try: # pragma: no cover
import torch
optim = torch.optim
except ImportError: # pragma: no cover
optim = None
def pinverse(t):
"""
Computes the pseudo-inverse of a matrix using SVD.
Parameters
... | 9. Rprop: Resilient Backpropagation Algorithm
10. SGD: Stochastic Gradient Descent.
|
<|file_name|>InsertStream_test.js<|end_file_name|><|fim▁begin|><|fim▁hole|>import assert from 'assert';
import sinon from 'sinon';
import fs from 'fs';
import stream from 'stream';
import { InsertStream } from '../';
/**
* Transform class to turn our string JSON data into objects.
*/
class TransformToObject extends... | |
<|file_name|>formdata.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::cell::DomRefCell;
use crate::dom:... | |
<|file_name|>install.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# called from wnf.py
# lib/wnf.py --install [rootpassword] [dbname] [source]
from __future__ import unicode_literals
import os, sys, json
import webnotes
import... | webnotes.conn.commit() |
<|file_name|>focus_tab.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# License: GPLv3 Copyright: 2020, Kovid Goyal <kovid at kovidgoyal.net>
from typing import TYPE_CHECKING, Optional
from .base import (
MATCH_TAB_OPTION, ArgsType, Boss, PayloadGetType, PayloadType, RCOptions,
RemoteCommand, Response... |
def response_from_kitty(self, boss: Boss, window: Optional[Window], payload_get: PayloadGetType) -> ResponseType:
for tab in self.tabs_for_match_payload(boss, window, payload_get):
if tab: |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 The Bazel 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.org/... | |
<|file_name|>fans.js<|end_file_name|><|fim▁begin|>var fans=require('../../modules/blog/fans');
var User=require('../../modules/resume/user');
var async = require('asyncawait/async');
var await = require('asyncawait/await');
module.exports=(async(function(method,req,res){
var result;
if(method==='get'){
}
else if(m... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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 o... | Utilities with minimum-depends for use in setup.py
"""
import datetime |
<|file_name|>enu.py<|end_file_name|><|fim▁begin|>"""
Copyright (C) 2017 Open Source Robotics 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 License at
http://www.apache.org/licenses/LICENSE-2.... | cos_lon = origin._cos_lon()
cos_lat = origin._cos_lat()
global_to_ecef_matrix = np.array([[-sin_lon, -cos_lon * sin_lat, cos_lon * cos_lat], |
<|file_name|>cmdboardpolygonremove.cpp<|end_file_name|><|fim▁begin|>/*
* LibrePCB - Professional EDA for everyone!
* Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
* https://librepcb.org/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the... | }
/*******************************************************************************
* Inherited from UndoCommand |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | default_app_config = 'providers.com.dailyssrn.apps.AppConfig' |
<|file_name|>tektronixMDO3012.py<|end_file_name|><|fim▁begin|>"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2016 Alex Forencich
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 Softw... | self._analog_channel_count = 2
self._digital_channel_count = 16 |
<|file_name|>stylesheet.js<|end_file_name|><|fim▁begin|>import { red } from "./colors.js";
export default `body { background: url("${
new URL("./file.png" + __resourceQuery, import.meta.url).href<|fim▁hole|>}"); color: ${red}; }`;<|fim▁end|> | |
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sickrage.github.io
# Git: https://github.com/SickRage/SickRage.git
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the ... | logger.log("Deleting empty folder: " + check_empty_dir)
# need shutil.rmtree when ignore_items is really implemented
ek(os.rmdir, check_empty_dir)
# do the library update for synoindex |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.