prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>date_title_sort.js<|end_file_name|><|fim▁begin|>define(['libs/jquery.dataTables.min'], function () {
/* Custom sort on date in title - created for NAV */
jQuery.extend(jQuery.fn.dataTableExt.oSort, {
"title-date-pre": function (a) {
if (/Never/.test(a)) {
return ... | }, |
<|file_name|>serve.go<|end_file_name|><|fim▁begin|>package plugin
import (
"github.com/hashicorp/go-plugin"
grpcplugin "github.com/hashicorp/terraform/helper/plugin"
proto "github.com/hashicorp/terraform/internal/tfplugin5"
"github.com/hashicorp/terraform/terraform"
)
// The constants below are the names of the p... |
// add the new protocol versions if they're configured
if opts.GRPCProviderFunc != nil || opts.GRPCProvisionerFunc != nil { |
<|file_name|>pipeline.py<|end_file_name|><|fim▁begin|>from disco.core import Job
from disco.worker.task_io import task_input_stream
import hustle
import hustle.core
import hustle.core.marble
from hustle.core.marble import Marble, Column, Aggregation
from functools import partial
from hustle.core.pipeworker import Hustl... | pre_order_stage=()):
from hustle.core.pipeworker import Worker
super(SelectPipe, self).__init__(master=master, worker=Worker()) |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for base freebasics.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi... |
application = get_wsgi_application() |
<|file_name|>demo_cv_async.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import freenect
import cv
import numpy as np
cv.NamedWindow('Depth')
cv.NamedWindow('RGB')
def display_depth(dev, data, timestamp):
data -= np.min(data.ravel())
data *= 65536 / np.max(data.ravel())
image = cv.CreateImageHeade... | def display_rgb(dev, data, timestamp): |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2007-2011 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | |
<|file_name|>bridge_linux_test.go<|end_file_name|><|fim▁begin|>package netlink
import (
"fmt"
"io/ioutil"
"os"
"testing"
)
func TestBridgeVlan(t *testing.T) {
if os.Getenv("TRAVIS_BUILD_DIR") != "" {
t.Skipf("Travis CI worker Linux kernel version (3.13) is too old for this test")
}
tearDown := setUpNetlinkT... | }
} |
<|file_name|>CircularDependencyErrorTest.py<|end_file_name|><|fim▁begin|>import unittest
from coalib.core.CircularDependencyError import CircularDependencyError
class CircularDependencyErrorTest(unittest.TestCase):
def test_default_message(self):
with self.assertRaises(CircularDependencyError) as cm:
... | |
<|file_name|>Expect.py<|end_file_name|><|fim▁begin|>import os
import subprocess
import errno
from JumpScale import j
PIPE = subprocess.PIPE
if subprocess.mswindows:
from win32file import ReadFile, WriteFile
from win32pipe import PeekNamedPipe
import msvcrt
else:
import select
import fcntl
if j.c... | |
<|file_name|>backup.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 Alex Regueiro<|fim▁hole|>// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS I... | //
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. |
<|file_name|>1469.js<|end_file_name|><|fim▁begin|>{<|fim▁hole|> function Test() {
return _Foo.apply(this, arguments) || this;
}
return Test;
}<|fim▁end|> | babelHelpers.inheritsLoose(Test, _Foo);
|
<|file_name|>PageAccessibleLandmarkInfo-dbg.js<|end_file_name|><|fim▁begin|>/*!
* UI development toolkit for HTML5 (OpenUI5)
* (c) Copyright 2009-2016 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
// Provides control sap.m.PageAccessibleLandmarkInfo.
sap... | */
contentLabel : {type : "string", defaultValue : null},
/** |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>function main(){<|fim▁hole|>}<|fim▁end|> | alert("Se ha cargado la página.") |
<|file_name|>util.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import pkgutil
import logging
import sys
import tornado.web
from pyjojo.config import config
from pyjojo.scripts import create_collection
log = logging.getLogger(__name__)
class route(object):
"""
decorates RequestHandlers a... |
base_log = logging.getLogger() |
<|file_name|>open_unit_async.py<|end_file_name|><|fim▁begin|>"""
This example opens the connection in async mode (does not work properly in Python 2.7).
"""
import os
import time
from msl.equipment import (
EquipmentRecord,
ConnectionRecord,
Backend,
)
record = EquipmentRecord(
manufacturer='Pico Tech... |
# flash the LED light for 5 seconds |
<|file_name|>score.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013-2014 Fox Wilson, Peter Foley, Srijay Kasturi, Samuel Damashek, James Forcier and Reed Koser
#
# 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 S... | |
<|file_name|>error_inlining.py<|end_file_name|><|fim▁begin|># RUN: %python -m artiq.compiler.testbench.signature +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t
def f():
delay_mu(2)
def g():<|fim▁hole|>
x = f if True else g
def h():
with interleave:
f()
# CHECK-L: ${LINE:+1}: fatal: it ... | delay_mu(2) |
<|file_name|>jquery.treeview.js<|end_file_name|><|fim▁begin|>/*
* Treeview 1.5pre - jQuery plugin to hide and show branches of a tree
*
* http://bassistance.de/jquery-plugins/jquery-plugin-treeview/
* http://docs.jquery.com/Plugins/Treeview
*
* Copyright (c) 2007 Jörn Zaefferer
*
* Dual licensed under the MIT a... | }
},
prepareBranches: function(settings) {
if (!settings.prerendered) { |
<|file_name|>addKeyboard.js<|end_file_name|><|fim▁begin|>import $ from 'jquery';
import keyboard from 'virtual-keyboard';
$.fn.addKeyboard = function () {
return this.keyboard({
openOn: null,<|fim▁hole|> 'normal': ['7 8 9 {c}', '4 5 6 {del}', '1 2 3 {sign}', '0 0 {dec} {a}'],
},
position: {
//... | stayOpen: false,
layout: 'custom',
customLayout: { |
<|file_name|>Form.File.js<|end_file_name|><|fim▁begin|>/*
JSPWiki - a JSP-based WikiWiki clone.
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... |
options = this.setOptions(options).options;
this.nbr = 0; //upload file counter
this.list = input.getParent(options.list); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
__path__ = extend_path(__path__, __name__)<|fim▁end|> | """Kytos SDN Platform."""
from pkgutil import extend_path |
<|file_name|>dbapi.py<|end_file_name|><|fim▁begin|># Copyright 2013 Cloudera 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
#
# Unless... | likely different.
database : str, optional
The default database. If `None`, the result is
implementation-dependent. |
<|file_name|>test_app.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.models import User, Group
from django.test import Client
from rest_framework import status
from app.models import Project, Task
from app.models import Setting
from app.models import Theme
from webodm import settings
from .classes import Boo... | self.assertTrue(res.status_code == status.HTTP_200_OK)
# Cannot access public URLs unless a task is shared
def test_public_views(client, expectedStatus): |
<|file_name|>decl.py<|end_file_name|><|fim▁begin|>from pyparsing import *
TOP = Forward()
BOTTOM = Forward()
<|fim▁hole|>BATTLEFIELD = Forward()<|fim▁end|> | HAND = Forward()
GRAVEYARD = Forward()
LIBRARY = Forward() |
<|file_name|>AppConfigResourceHelper.java<|end_file_name|><|fim▁begin|>package com.crescentflare.appconfig.helper;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.os.Build;
import android.util.TypedValue;
/**
* Library helper: resource access
* A... | TypedValue typedValue = new TypedValue(); |
<|file_name|>PollDialog.java<|end_file_name|><|fim▁begin|>/**
* JHylaFax - A java client for HylaFAX.
*
* Copyright (C) 2005 by Steffen Pingel <steffenp@gmx.de>
*
* 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 Fr... | public void updateLabels() {
super.updateLabels(); |
<|file_name|>ClientTest.java<|end_file_name|><|fim▁begin|>/*
* Labdoo API
Copyright (C) 2012 Labdoo team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the Lic... | //Check date laptop
// Laptop Laptop = client.getLaptop(nid); |
<|file_name|>asa.py<|end_file_name|><|fim▁begin|># This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and ... | 'command': dict(key=True),
'prompt': dict(),
'answer': dict()
} |
<|file_name|>boot-delay.rs<|end_file_name|><|fim▁begin|>use std::fs::File;
use std::io::Read;
use std::mem::transmute;
use std::thread::sleep;
use std::env;
use std::time::Duration;
fn main() {
let delay = match env::args().nth(1).and_then(|s| s.parse::<f32>().ok()) {
Some(d) => 60.0 * d,
None => ... | |
<|file_name|>test_quantumv2.py<|end_file_name|><|fim▁begin|># Copyright 2012 OpenStack Foundation
# 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
#
# ht... | |
<|file_name|>utils.js<|end_file_name|><|fim▁begin|>var chalk = require('chalk');
var safeStringify = require('fast-safe-stringify')
function handleErrorObject(key, value) {
if (value instanceof Error) {
return Object.getOwnPropertyNames(value).reduce(function(error, key) {
error[key] = value[key]
ret... | |
<|file_name|>gotocol.go<|end_file_name|><|fim▁begin|>// Package gotocol provides protocol support to send a variety of commands
// listener channels and types over a single channel type
package gotocol
import (
"fmt"
"github.com/adrianco/spigo/names"
"log"
"time"
)
// Impositions is the promise theory term for re... | if microservice != name && (*microservices)[microservice] == nil { // don't talk to myself or record duplicates
// remember how to talk to this buddy
(*microservices)[microservice] = msg.ResponseChan // message channel is buddy's listener |
<|file_name|>0011_auto__add_field_pupil_birthday.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Pupil.birthday'
... | 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
}, |
<|file_name|>cache_tests.rs<|end_file_name|><|fim▁begin|>use std::convert::TryInto;
use std::io::Write;
use std::path::PathBuf;
use sharded_lmdb::{ShardedLmdb, DEFAULT_LEASE_TIME};
use store::Store;
use tempfile::TempDir;
use testutil::data::TestData;
use testutil::relative_paths;
use workunit_store::WorkunitStore;
u... | Process, ProcessMetadata,
};
struct RoundtripResults { |
<|file_name|>pluginValidation.ts<|end_file_name|><|fim▁begin|>import { PluginMeta } from '@savantly/sprout-api';<|fim▁hole|> if (!pluginJson.id) {
throw new Error('Plugin id is missing in plugin.json');
}
if (!pluginJson.info) {
throw new Error('Plugin info node is missing in plugin.json');
}
if (!pl... |
export const validatePluginJson = (pluginJson: any) => { |
<|file_name|>lodash._createassigner@3.1.1.js<|end_file_name|><|fim▁begin|><|fim▁hole|>module.exports = require("npm:lodash._createassigner@3.1.1/index");<|fim▁end|> | |
<|file_name|>domain.go<|end_file_name|><|fim▁begin|>package libvirt
// #include <stdlib.h>
// #include <libvirt/libvirt.h>
import "C"
import (
"errors"
"log"
"reflect"
"time"
"unicode/utf8"
"unsafe"
)
// DomainListFlag defines a filter when listing domains.
type DomainListFlag uint32
// Possible values for Dom... | return uint64(cInfo.cpuTime), nil
}
// Save suspends a domain and save its memory contents to a file on disk. After |
<|file_name|>UI.js<|end_file_name|><|fim▁begin|>/*
* These two features seemed out of place everywhere else so I stuck them in here.
* My plan is for UI.js to manage further user interaction
* I'm going to incorporate sliders to customize visualizations in real time
*/
// called when play button overlay is clicked... | |
<|file_name|>test_wfn.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2017 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms ... | assert (get_mask(np.array([1, 2, 3, 4, 1, 2, 3, 4])) == expected).all()
expected = [True, False, False, False, False, False] |
<|file_name|>group_roles.py<|end_file_name|><|fim▁begin|>"""
API operations on Group objects.
"""
import logging
from galaxy.web.base.controller import BaseAPIController, url_for
from galaxy import web
log = logging.getLogger( __name__ )
class GroupRolesAPIController( BaseAPIController ):
@web.expose_api
@we... | decoded_group_id = trans.security.decode_id( group_id )
decoded_role_id = trans.security.decode_id( role_id )
item = None
try: |
<|file_name|>transform.ts<|end_file_name|><|fim▁begin|>namespace ts {
describe("TransformAPI", () => {
function replaceUndefinedWithVoid0(context: TransformationContext) {
const previousOnSubstituteNode = context.onSubstituteNode;
context.enableSubstitution(SyntaxKind.Identifier)... | function baselineDeclarationTransform(text: string, opts: TranspileOptions) {
const fs = vfs.createFromFileSystem(Harness.IO, /*caseSensitive*/ true, { documents: [new documents.TextDocument("/.src/index.ts", text)] });
|
<|file_name|>0145_fix_language_distributions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
from django.db import migrations
idDistributionMap = {
80: {'normalMean': 3450, 'normalStDev': 125},
133: {'normalMean': 3350, 'normalStDev': 75},
13... | 108: {'normalMean': 500, 'normalStDev': 50},
100: {'normalMean': 1000, 'normalStDev': 50},
252: {'normalMean': 351, 'normalStDev': 1}, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
XStatic resource package
See package 'XStatic' for documentation and basic tools.
"""
# official name, upper/lowercase allowed, no spaces
DISPLAY_NAME = 'Angular-lrdragndrop'
# name used for PyPi
PACKAGE_NAME = 'XStatic-%s' % DISPLAY_NAME
NAME = __name__.spl... | from os.path import join, dirname
BASE_DIR = join(dirname(__file__), 'data')
# linux package maintainers just can point to their file locations like this: |
<|file_name|>managed_upload.js<|end_file_name|><|fim▁begin|>module.exports = function () {
this.When(/^I use S3 managed upload to upload(?: a| an) (empty|small|large) buffer to the key "([^"]*)"$/, function (size, key, callback) {
var self = this;
var buffer = self.createBuffer(size);
var params = {Bucke... | Key: key,
Body: self.createBuffer(size)
}; |
<|file_name|>sync.rs<|end_file_name|><|fim▁begin|>extern crate redis;
use std::sync::{Arc, Mutex};
use std::thread;
<|fim▁hole|> thread::spawn(move || {
let pubsub = subscribe_to_redis(&redis_url).unwrap();
loop {
let msg = pubsub.get_message().unwrap();
handle_message(backen... | use backend::{RoundRobinBackend, GetBackend};
pub fn create_sync_thread(backend: Arc<Mutex<RoundRobinBackend>>, redis_url: String) { |
<|file_name|>test_requests.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Test Request Module
This module contains the tests for the OpenRecords `/request` endpoint.
"""
import pytest<|fim▁hole|><|fim▁end|> | from app.models import Requests |
<|file_name|>test_coreg.py<|end_file_name|><|fim▁begin|>from functools import reduce
from glob import glob
import os
import os.path as op
from shutil import copyfile, copytree
import pytest
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_allclose,
assert_array... | subjects_dir=tempdir)
if subject_from == 'fsaverage': # identity transform
source_rr = np.concatenate([s['rr'][s['vertno']] |
<|file_name|>distribtest.py<|end_file_name|><|fim▁begin|># Copyright 2016, Google Inc.
# 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 retain the ab... | print 'Success!' |
<|file_name|>nikeplus.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#By Rhys McCaig @mccaig / mccaig@gmail.com
import sys
import json
import logging
import re
from datetime import datetime, timedelta
import xml.etree.ElementTree as ET
import thread
import numpy
import requests
class NikePlus:
"""Class for work... | parameters = {'access_token':self.token,'activityId':activity_id}
#Note we have to replace activityID into the endpoint in the below code
self.logger.info("[{i}] [{t}] [{f}] ({m})".format(i=self.id, t=thread.get_ident(), f=str(sys._getframe().f_code.co_name), m="Request: "+ self.nikeplus_endpoints['activity_d... |
<|file_name|>sociogram.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
'''
Copyright (c) 2012 Peter Andrews
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.apa... | def set_doc_desc(self, desc):
'''Set document description.'''
if desc is None:
desc = "" |
<|file_name|>trait-safety-trait-impl-cc.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at<|fim▁hole|>// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modif... | // 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 |
<|file_name|>appengine-gen.go<|end_file_name|><|fim▁begin|>// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package appengine provides access to the App Engine Admin API.
//
// For product docu... | // "type": "string"
// }
// }, |
<|file_name|>CacheException.java<|end_file_name|><|fim▁begin|><|fim▁hole|> * 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 under the Apache License, Version 2.0 (the
* "Licens... | /*
* Licensed to the Apache Software Foundation (ASF) under one |
<|file_name|>clean_suite_test.go<|end_file_name|><|fim▁begin|>package clean_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"testing"
)
func TestPrep(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Clean Suite")<|fim▁hole|><|fim▁end|> | } |
<|file_name|>for-loop-no-std.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org... | // except according to those terms.
|
<|file_name|>GetClicksForLink.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
###############################################################################
#
# GetClicksForLink
# Returns the number of clicks on a single Bitly link.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.<|fim▁hole|>... | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at |
<|file_name|>Str.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2014-2016 Samsung Research America, 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/li... | private String s; |
<|file_name|>2_deploy_test_contracts.js<|end_file_name|><|fim▁begin|>var BasicMathLib = artifacts.require("./BasicMathLib.sol");
var Array256Lib = artifacts.require("./Array256Lib.sol");
var TokenLib = artifacts.require("./TokenLib.sol");
var CrowdsaleLib = artifacts.require("./CrowdsaleLib.sol");
var EvenDistroCrowdsa... | var EvenDistroTestEteenD = artifacts.require("./EvenDistroTestEteenD.sol");
var CrowdsaleTestTokenTenD = artifacts.require("./CrowdsaleTestTokenTenD");
var EvenDistroTestTenD = artifacts.require("./EvenDistroTestTenD.sol");
|
<|file_name|>google.py<|end_file_name|><|fim▁begin|>import aiohttp
import discord
import random
from config import GoogleAPIKey
from config import GoogleCSECX
async def google(cmd, message, args):
if not args:
await message.channel.send(cmd.help())
return
else:
search = ' '.join(args)... | title = results['items'][0]['title']
url = results['items'][0]['link']
embed = discord.Embed(color=embed_color)
embed.set_author(name='Google', icon_url='https://avatars2.githubusercontent.com/u/1342004?v=3&s=400', |
<|file_name|>active_app_02_objc_bridge.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2015 deanishe@deanishe.net
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2015-11-23
#
"""Get app info with AppKit via objc bridge."""
from __future__ import print_f... | s = unicode(s, 'utf-8')
elif not isinstance(s, unicode):
raise TypeError("str or unicode required, not {}".format(type(s))) |
<|file_name|>wrapper_traits.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/. */
#![allow(unsafe_code)]
use HTMLCanvasData;
use Layout... | }
// This trait is only public so that it can be implemented by the gecko wrapper. |
<|file_name|>TextColor.js<|end_file_name|><|fim▁begin|>//>>built
define(
"dojox/editor/plugins/nls/da/TextColor", //begin v1.x content<|fim▁hole|>
//end v1.x content
);<|fim▁end|> | ({
"setButtonText": "Definér",
"cancelButtonText": "Annullér"
}) |
<|file_name|>ovpn_util.py<|end_file_name|><|fim▁begin|>"""
Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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; eith... | |
<|file_name|>Markdown.Editor.js<|end_file_name|><|fim▁begin|>// needs Markdown.Converter.js at the moment
(function () {
var util = {},
position = {},
ui = {},
doc = window.document,
re = window.RegExp,
nav = window.navigator,
SETTINGS = { lineLength: 72 ... | var range = panels.ieCachedRange || doc.selection.createRange();
|
<|file_name|>search.py<|end_file_name|><|fim▁begin|>from itertools import repeat
from xmodule.course_module import CourseDescriptor
from .exceptions import (ItemNotFoundError, NoPathToItem)
from . import Location
def path_to_location(modulestore, course_id, location):
'''
Try to find a course_id/chapter/sec... | # we would otherwise immediately exit).
parents = modulestore.get_parent_locations(loc, course_id)
# print 'Processing loc={0}, path={1}'.format(loc, path) |
<|file_name|>test_theano_function.py<|end_file_name|><|fim▁begin|>import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import gradient_check
from chainer import links
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testing.wit... | def setUp(self):
self.input_data = [
numpy.random.uniform( |
<|file_name|>summary.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Prints a summary of the contents of the IPHAS source catalogue.
"""
import os
from astropy.io import fits
from astropy import log
import numpy as np
import sys
from dr2 import constants
n_sources = 0
n_r20 = 0
n_relia... | #n_sources += f[1].header['NAXIS2'] |
<|file_name|>typings.d.ts<|end_file_name|><|fim▁begin|>/// <reference path="../../tools/manual_typings/project/index.d.ts"/><|fim▁hole|><|fim▁end|> | /// <reference path="../../typings/index.d.ts"/> |
<|file_name|>webpack.config.js<|end_file_name|><|fim▁begin|>module.exports = {
entry: {
main: ['babel-polyfill', './lib/index.js'],
test: ['babel-polyfill', 'mocha!./test/index.js'],
},
output: {
path: __dirname,
filename: '[name].bundle.js',
},
module: {
loaders: [
{
test: /... | |
<|file_name|>about.component.ts<|end_file_name|><|fim▁begin|>import {Component, OnInit} from '@angular/core';
@Component({
selector: 'sqap-about',
templateUrl: './about.component.html',
styleUrls: ['./about.component.scss']
})
export class AboutComponent implements OnInit {
<|fim▁hole|> console.log('hello `Ab... | constructor() {
}
ngOnInit() { |
<|file_name|>__main__.py<|end_file_name|><|fim▁begin|>from bot.server import main
<|fim▁hole|><|fim▁end|> | main() |
<|file_name|>StateRecord.java<|end_file_name|><|fim▁begin|>package com.kk.taurus.xfolder.bean;
import java.io.Serializable;
/**
* Created by Taurus on 2017/5/12.
*/
public class StateRecord implements Serializable {
private int focusPosition;
private int scrollToPosition;
private int offset;
<|fim▁hole... | public int getFocusPosition() {
return focusPosition; |
<|file_name|>PacketEncoderTest.java<|end_file_name|><|fim▁begin|>package me.nithanim.netty.packetlib.handler;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import java.util.Arrays;
import me.nithanim.netty.packetlib.packets.Packet;
import me.nithanim.netty.packetlib.testpackets.TestPacketEmpty;
impo... |
private ByteBuf getExactByteBuffer(int payloadSize) { |
<|file_name|>courseinfo.go<|end_file_name|><|fim▁begin|>package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"path"
"strconv"
"strings"
"time"
)
const (
COURSE_BASEURL = "http://www.pluralsight.com/courses/"
COURSEDATA_BASEURL = "http://www.pluralsight.com/data/course/content/... | Title string `json: "title"`
Description string `json: "description"`
Duration string `json: "duration"`
FragmentId string `json: "fragmentIdentifier"` |
<|file_name|>DeckCards.ts<|end_file_name|><|fim▁begin|>/// <reference path="Global.ts" />
/// <reference path="Decks.ts" />
module ScrollsTypes {
'use strict';
export class DeckCards {
cards:CardsAndStats[] = [];<|fim▁hole|>
constructor(deck:Deck) {
this.deck = deck;
th... | deck:Deck; |
<|file_name|>dir_f4703b3db1bd5f8d2d3fca771c570947.js<|end_file_name|><|fim▁begin|><|fim▁hole|> [ "usart2.c", "usart2_8c.html", "usart2_8c" ]
];<|fim▁end|> | var dir_f4703b3db1bd5f8d2d3fca771c570947 =
[
[ "led.c", "led_8c.html", "led_8c" ],
[ "tick.c", "tick_8c.html", "tick_8c" ], |
<|file_name|>bootstrap.js<|end_file_name|><|fim▁begin|>//Declare app level module which depends on filters, and services
var SFApplicationAuth = angular.module('SFApplicationAuth.Auth',[]);
SFApplicationAuth.config(
[
'$stateProvider',
'$urlRouterProvider',
function (
$stateProvider,
$urlRouterProvider
) {
... | }]);
SFApplicationAuth.run(['$rootScope', '$state', '$location', '$log', 'authFactory', function($rootScope, $state, $location, $log, authFactory) { |
<|file_name|>test_codeop.py<|end_file_name|><|fim▁begin|>"""
Test cases for codeop.py
Nick Mathewson
"""
import unittest
from test.support import run_unittest, is_jython
from codeop import compile_command, PyCF_DONT_IMPLY_DEDENT
import io
if is_jython:
import sys
def unify_callables(d):
for n,v... | |
<|file_name|>compare.js<|end_file_name|><|fim▁begin|>import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js'
import { nearlyEqual } from '../../utils/number.js'
import { factory } from '../../utils/factory.js'
import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03.js'
import... |
'any, Array': function (x, y) {
// use matrix implementation
return algorithm14(matrix(y), x, this, true).valueOf() |
<|file_name|>scanner.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 scanner provides a scanner and tokenizer for UTF-8-encoded text.
// It takes an io.Reader provid... | s.error("literal not terminated")
return
} |
<|file_name|>template.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from jinja2 import Template as Jinja2Template<|fim▁hole|>class Template(Jinja2Template):
def __init__(self, *args, **kwargs):
super(Template, self).__init__(*args, **kwargs)
for provider in provide... | from atlas.providers import providers
|
<|file_name|>package.js<|end_file_name|><|fim▁begin|>Package.describe({
summary: "Next bike list package"
});
Package.on_use(function (api) {<|fim▁hole|> api.add_files(['list.html', 'list.js'], ['client']);
});<|fim▁end|> |
api.use(['nb','underscore', 'templating', 'nb-autocomplete', 'nb-markers', 'nb-infowindow', 'nb-directions', 'nb-geocoder', 'nb-markerlabel', 'nb-citypicker'], ['client']);
|
<|file_name|>server.py<|end_file_name|><|fim▁begin|>from flask import Flask, Response, make_response
from video_stream_handler import stream_handler
import logging
import cv2
# see line 398 of connectionpool.py:
logging.basicConfig(level=logging.DEBUG)
thetav = None
<|fim▁hole|>@app.route('/video_feed')
def video_fee... | app = Flask(__name__, static_url_path='/public', static_folder='../')
|
<|file_name|>fullpage.js<|end_file_name|><|fim▁begin|>/**
* fullpage.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
(function() {
tinyMCEPopup.requireLangPack()... | |
<|file_name|>res_partner.py<|end_file_name|><|fim▁begin|># Copyright NuoBiT Solutions, S.L. (<https://www.nuobit.com>)
# Eric Antones <eantones@nuobit.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from odoo import fields, models
class ResPartner(models.Model):
_inherit = "res.partner"
... | "account.journal", "Default journal", domain=[("type", "=", "purchase")]
) |
<|file_name|>sawyer_coffee_button_v1_policy.py<|end_file_name|><|fim▁begin|>import numpy as np
from metaworld.policies.action import Action
from metaworld.policies.policy import Policy, assert_fully_parsed, move
class SawyerCoffeeButtonV1Policy(Policy):
@staticmethod
@assert_fully_parsed
def _parse_obs(... | pos_mug = o_d['mug_pos'] + np.array([.0, .0, .01])
if abs(pos_curr[0] - pos_mug[0]) > 0.02: |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from setuptools import setup, Extension
setup(
name = "python-libmemcached",
version = "0.17.0",
description="python memcached client wrapped on libmemcached",
maintainer="subdragon",
maintainer_email="subdragon@gmail.com",
... | ext_modules=[Extension('cmemcached', ['cmemcached.pyx'],
libraries=['memcached'],
)], |
<|file_name|>reg_status.rs<|end_file_name|><|fim▁begin|>#[derive(Default, Debug)]
pub struct RegStatus {
// CU
coproc_usability: [bool; 4],
// RP
low_power: bool,
// FR
fpregs_extend: bool,
// RE
reverse_endian: bool,
// DS
diag_status: DiagnosticStatus,
// IM
interr... | }
}
|
<|file_name|>core.go<|end_file_name|><|fim▁begin|>package core
import (
"bytes"
"fmt"
"github.com/BurntSushi/toml"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"strconv"
"strings"
)
type Settings struct {
Current string
Files []File
}
type File struct {
Path string
Prefix string
Postfix string
I... | minor, _ := strconv.Atoi(split[1])
patch, _ := strconv.Atoi(split[2])
return major*10000 + minor*100 + patch
} |
<|file_name|>ConfigProperties.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2017-2018. the original author or 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
*
* htt... | } |
<|file_name|>AcceptorReconciliationRequestV01.go<|end_file_name|><|fim▁begin|>package caaa
import (
"encoding/xml"<|fim▁hole|>type Document00900101 struct {
XMLName xml.Name `xml:"urn:iso:std:iso:20022:tech:xsd:caaa.009.001.01 Document"`
Message *AcceptorReconciliationRequestV01 `xml:"Accpt... |
"github.com/fgrid/iso20022"
)
|
<|file_name|>2e171e6198e6_add_data_migration_table.py<|end_file_name|><|fim▁begin|># This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any late... | def upgrade():
op.create_table('data_migration',
Column('id', Integer, primary_key=True), |
<|file_name|>265_test_re.py<|end_file_name|><|fim▁begin|>import sys
sys.path = ['.'] + sys.path
from test.test_support import verbose, run_unittest
import re
from re import Scanner
import sys, os, traceback
from weakref import proxy
# Misc tests from Tim Peters' re.doc
# WARNING: Don't change details in these tests ... | self.assertEqual(pat.match('bc').groups(""), ('b', "", 'b', 'c')) |
<|file_name|>savefile.rs<|end_file_name|><|fim▁begin|>use system::memory::{read, reference};
use warping::Entrance;
<|fim▁hole|>pub fn is_new_game_plus() -> bool {
read(0x803B82A8)
}
pub fn get_picture_count() -> u8 {
read(0x803B8170)
}
pub fn get_triforce_set() -> u8 {
read(0x803B82A9)
}
pub fn get_entr... | |
<|file_name|>traversal.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/. */
//! Traversing the DOM tree; the bloom filter.
use crate:... | // sibling or cousin. Otherwise, recascading a bunch of identical
// elements would unnecessarily flood the cache with identical entries.
// |
<|file_name|>feature_bip68_sequence.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test BIP68 implementation."""
from... | tx_size = len(ToHex(tx))//2 + 120*num_inputs + 50
tx.vout.append(CTxOut(int(value-self.relayfee*tx_size*COIN/1000), CScript([b'a'])))
rawtx = self.nodes[0].signrawtransactionwithwallet(ToHex(tx))["hex"] |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var routes = require('./routes/index');
var admin ... |
var basicAuth = require(path.join(__dirname, "./utils/basic-auth"));
|
<|file_name|>test_delete_local_backupstorage.py<|end_file_name|><|fim▁begin|>import zstackwoodpecker.operations.scheduler_operations as sch_ops
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.operations.tag_operations as tag_ops
import zstackwoodpecker.operations.backupstorage_... | cron='*0 0/10 * * * ?')
sch_ops.add_scheduler_job_group_to_trigger(trigger1.uuid, job_group.uuid)
job_group_inv = res_ops.query_resource(res_ops.SCHEDULERJOBGROUP, cond)[0] |
<|file_name|>nr.rs<|end_file_name|><|fim▁begin|>pub const RESTART_SYSCALL : usize = 0;
pub const EXIT : usize = 1;
pub const FORK : usize = 2;
pub const READ : usize = 3;
pub const WRITE : usize = 4;
pub const OPEN ... | pub const IDLE : usize = 112;
pub const VM86OLD : usize = 113;
pub const WAIT4 : usize = 114;
pub const SWAPOFF : usize = 115; |
<|file_name|>inline.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT<|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 ... | // file at the top-level directory of this distribution and at |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.