prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>statix.js<|end_file_name|><|fim▁begin|>/* jshint node: true */
(function () {
"use strict";
var APP;
var utils = require("./utils");
var fs = require("fs");
var path = require("path");
var wrench = require("wrench");
var colors = require("colors");
var supervisor = require("supervisor");
funct... |
wrench.mkdirSyncRecursive(path.dirname(path.join(outputDir, page.output))); |
<|file_name|>angular-translate-loader-partial.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1<|fim▁hole|><|fim▁end|> | oid sha256:d1b4f8dc9d9f4ae479ea4896a2bc244b2d51382eb978009a23c65d2d9ff28f9f
size 5749 |
<|file_name|>time.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 ipc_channel::ipc;
use profile::time;
use profile_traits::ipc... | let chan = time::Profiler::create(&Some(OutputOptions::Stdout(5.0)), None);
let (profiled_sender, profiled_receiver) = ProfiledIpc::channel(chan.clone()).unwrap();
thread::spawn(move || { |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>export { default as Home} from './home';
export { default as Post} from './post';
export { default as Search} from './search';<|fim▁hole|>export { default as Author} from './author';
export { default as Comment} from './comment';
export { default as Setting} from './se... | export { default as About} from './about'; |
<|file_name|>colorbars.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
desc = 'Color bars'
phash = ''
def plot():
import matplotlib as mpl
from matplotlib import pyplot as pp
from matplotlib import style
import numpy as np
# Make a figure and axes with dimensions as desired.<|fim▁hole|> ... | fig, ax = pp.subplots(3)
# Set the colormap and norm to correspond to the data for which |
<|file_name|>struct_def.rs<|end_file_name|><|fim▁begin|>struct S1 {
f1: i32,
f2
}
struct S2 {
f1: i32<|fim▁hole|><|fim▁end|> | f2: i32
} |
<|file_name|>dtmdata.py<|end_file_name|><|fim▁begin|>'''
Created on 14 Jun 2016
@author: gjermund.vingerhagen
'''
import numpy as np
import scipy.interpolate as intp
import linecache
import utmconverter as utm
def splitHead(inp):
return inp
def lineToArr(l1):
arra = np.array(np.fromstring(l1[... | d_ele = interpolateEle2(ele1,ele2,ele3,ele4,[dpx,dpy])
return d_ele
|
<|file_name|>elasticsearch_logging_discovery.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 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/lice... | |
<|file_name|>executor.py<|end_file_name|><|fim▁begin|>"""Executor util helpers."""
from __future__ import annotations
from concurrent.futures import ThreadPoolExecutor
import contextlib
import logging
import queue
import sys
from threading import Thread
import time
import traceback
from .thread import async_raise
_L... | |
<|file_name|>quickInfoGenerics.ts<|end_file_name|><|fim▁begin|>/// <reference path='fourslash.ts' />
////class Con/*1*/tainer<T> {
//// x: T;
////}
////interface IList</*2*/T> {
//// getItem(i: number): /*3*/T;
////}
////class List2</*4*/T extends IList<number>> implements IList<T> {
//// private __i... | ////var y2 = x./*15*/method(x2, [x3, x3]);
goTo.marker("1");
|
<|file_name|>vrdisplay.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::compartments::InCompartment;
use crate::dom::bi... | *self.display.borrow_mut() = display.clone(); |
<|file_name|>box.mako.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/. */
<%namespace name="helpers" file="/helpers.mako.rs" />
<% fro... | "computed::Time::zero()", |
<|file_name|>loader.py<|end_file_name|><|fim▁begin|>import csv
from dateutil.parser import parse
from adoptarbol.tree.models import Tree
def load(filename):
with open(filename, encoding='utf-8') as f:
reader = csv.reader(f)
header = next(reader)
def pos_for(field):
return he... | try:
return(float(string))
except ValueError:
return None |
<|file_name|>PacketReceiversReady.java<|end_file_name|><|fim▁begin|>package mcjty.rftools.blocks.teleporter;
import mcjty.rftools.network.PacketListFromServer;
import io.netty.buffer.ByteBuf;
import java.util.List;
public class PacketReceiversReady extends PacketListFromServer<PacketReceiversReady,TeleportDestinatio... | } |
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 Kyle Mayes
//
// 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|>test_graph.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 under the Apache Lic... | assert "phrase" == edge.inV.label
assert edge.inV != edge.outV
#
vertex_property = VertexProperty(long(24), "name", "marko") |
<|file_name|>martex_tr.ts<|end_file_name|><|fim▁begin|><TS language="tr" version="2.1">
<context>
<name>AddNewAddressDialog</name>
<message>
<source>Dialog</source>
<translation>Diyalog</translation>
</message>
<message>
<source>My Address</source>
<translation>Adresim</t... | |
<|file_name|>ej.culture.az-Latn-AZ.js<|end_file_name|><|fim▁begin|>ej.addCulture( "az-Latn-AZ", {
name: "az-Latn-AZ",
englishName: "Azerbaijani (Latin, Azerbaijan)",
nativeName: "Azərbaycan dili (Azərbaycan)",
language: "az-Latn",
numberFormat: {
",": " ",
".": ",",
percent: {
pattern: ["-n%","n%"],
",... | // determine month by looking at how many days into the hyear we are
// monthDays contains the number of days up to each month.
hmonth = 0;
var daysIntoYear = daysSinceJan0101 - absDays; |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use error::ErrorResponse;
/// Result type for a ClientRequest.
pub type ClientResult<T> = Result<T, ClientError>;
/// Errors occuring as the result of a ClientRequest.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ClientError {
/// Request timeout reached.
... | |
<|file_name|>Text.js<|end_file_name|><|fim▁begin|>var PixiText = require('../../lib/pixi/src/core/text/Text'),
utils = require('../core/utils'),
math = require('../../lib/pixi/src/core/math'),
Sprite = require('../display/Sprite'),
CONST = require('../core/const');
function Text(text, style, resolution... |
// word wrap |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|># This file is part of the Simulation Manager project for VecNet.
# For copyright and licensing information about this project, see the
# NOTICE.txt and LICENSE.md files in its top-level directory; they are<|fim▁hole|># with this file, You can obtain one at http://... | # available at https://github.com/vecnet/simulation-manager
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License (MPL), version 2.0. If a copy of the MPL was not distributed |
<|file_name|>ncd-dcb.py<|end_file_name|><|fim▁begin|># ncd-dcb.py
#
# Use Cilibrasi and Vitanyi's Normalized Compression Distance
# to cluster a randomly chosen sample of entries from the
# Dictionary of Canadian Biography volume 1
#
# wjt
# http://digitalhistoryhacks.blogspot.com
#
# 26 jun 2007
import bz2... | |
<|file_name|>update_header.py<|end_file_name|><|fim▁begin|># This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import os
import re
import subprocess
import sy... | }
|
<|file_name|>feature-gate-native_link_modifiers_whole_archive.rs<|end_file_name|><|fim▁begin|>#![allow(incomplete_features)]
#![feature(native_link_modifiers)]
#[link(name = "foo", modifiers = "+whole-archive")]
//~^ ERROR: `#[link(modifiers="whole-archive")]` is unstable<|fim▁hole|>fn main() {}<|fim▁end|> | extern "C" {}
|
<|file_name|>App.tsx<|end_file_name|><|fim▁begin|>import React from "react";
import { HomeScreen } from "./routes";
import { ImpactIndex } from "./data";
export interface AppProps {
index: ImpactIndex;
}
const App = (props: AppProps) => {
const [terms, setTerms] = React.useState("T");
const [selected, set... | export default App; |
<|file_name|>flexberry-enum.js<|end_file_name|><|fim▁begin|>/**
@module ember-flexberry
*/
import Ember from 'ember';
const { getOwner } = Ember;
import { enumCaptions } from 'ember-flexberry-data/utils/enum-functions';
/**
Helper for get array captions of registered enum.<|fim▁hole|> @extends <a href="http://em... |
@class EnumCaptionHelper |
<|file_name|>pointerHandler.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---... | this._lastPointerType = 'pen'; |
<|file_name|>Teacher-Quiz.py<|end_file_name|><|fim▁begin|># Teacher Quiz - Python Code - Elizabeth Tweedale
import csv, random<|fim▁hole|> print ("Hello",str(yourName))
return yourName
def getQuestions(): # getQuestions reads in the questions from a CSV f... |
def askName(): # askName function returns the name of the student
print("Welcome to the Super Python Quiz!")
yourName = input("What is your name? ") |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>from django.contrib.messages import constants, get_level, set_level, utils
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.constants import DEFAULT_LEVELS
from django.contrib.messages.storage import base, default_storage
from django.c... | 'APP_DIRS': True,
}],
)
def test_middleware_disabled_fail_silently(self): |
<|file_name|>requirements.py<|end_file_name|><|fim▁begin|>"""Validate requirements."""
from __future__ import annotations
from collections import deque
import json
import operator
import os
import re
import subprocess
import sys
from awesomeversion import AwesomeVersion, AwesomeVersionStrategy
from stdlib_list import... | |
<|file_name|>DrumMachine_Config.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> switch (rowIndex) {
case 0: //bass
return [0, 10];
case 1: //snare
return [4, 12];
case 2: //cymbal
return [];
case 3: //hihat
return [2,7,9,12];
}
ret... | export const sampleIds = ["bass", "snare", "cymbal", "hihat"];
import { Direction, SliderOptions } from "../../../lib/slider/Slider";
export function RowConfig(rowIndex: number): Array<number> { |
<|file_name|>AddLivetickerActivity.java<|end_file_name|><|fim▁begin|>package com.sunilson.pro4.activities;
import android.app.DatePickerDialog;<|fim▁hole|>import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.widget.Toolbar;
import android.view.Vi... | import android.app.TimePickerDialog; |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>#coding:utf-8
from django.shortcuts import render,render_to_response,redirect
from django.core.urlresolvers import reverse
from block.models import Blocks
from models import Article
from django.template import RequestContext
from django.contrib import messages
from dja... | |
<|file_name|>config.js<|end_file_name|><|fim▁begin|>'use strict'
var config = {}
config.facebook = {
'appID': '261938654297222',
'appSecret': 'cd8d0bf4ce75ae5e24be29970b79876f',
'callbackUrl': '/login/facebook/callback/'
}
config.server = {
'port': process.env.PORT || 3000,
'env': process.env.NODE_ENV || '... | // The default location shown to signed out users on /missions is Amsterdam! |
<|file_name|>KmdImages.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Detect same images and try to merge metadatas before deleting duplicates"""
import PIL.Image as Image
import PIL.ImageChops as ImageChops
import sys
import os
import pyexiv2<|fim▁hole|>import logging
#Handler for m... | import datetime |
<|file_name|>model.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;
use itertools::Itertools;
use rustc_serialize::json;
use ngrams::ngrams;
use errors::DeserializeError;
pub struct Model {
pub ngram_ranks: HashMap<String, usize>,
}
impl Model {
pub fn build_from_text(text: &str) -> Self {
... |
// Nicer way to build a hash map.
Model { ngram_ranks: ngrams.enumerate().map(|(a, b)| (b, a)).collect() } |
<|file_name|>dynamic_lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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.or... | target_os = "openbsd"))]
mod dl {
use prelude::v1::*;
|
<|file_name|>SelectionsModal.js<|end_file_name|><|fim▁begin|>/*
* Copyright 2012 OSBI Ltd
*
* 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/licens... | * limitations under the License.
*/ |
<|file_name|>Divider.js<|end_file_name|><|fim▁begin|>/* @flow */
import * as React from 'react';
import cn from 'classnames';
import { StyleClasses } from '../theme/styleClasses';
type Props = {
// An optional inline-style to apply to the overlay.
style: ?Object,
// An optional css className to apply.
classNam... | { |
<|file_name|>defaults.py<|end_file_name|><|fim▁begin|>"""
Django settings for the admin project.
"""
import os
from urlparse import urlparse
from website import settings as osf_settings
from django.contrib import messages
from api.base.settings import * # noqa
# TODO ALL SETTINGS FROM API WILL BE IMPORTED AND WILL NE... |
# TODO - remove duplicated items, as this is now using settings from the API
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
<|file_name|>MathMaxMinEveryElementToNumber.java<|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/. */
package org.mozilla.javascript.tests... | {
} |
<|file_name|>ClusterView.java<|end_file_name|><|fim▁begin|>package org.cacheonix.impl.net.cluster;
import java.util.List;
import java.util.Set;
import org.cacheonix.impl.net.ClusterNodeAddress;
import org.cacheonix.impl.net.processor.ReceiverAddress;
import org.cacheonix.impl.net.processor.UUID;
import org.cacheonix.... | * @param address ClusterNodeAddress to check.
* @return <code>true</code> if the cluster view contains active node. |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># $Id$
# importing this module shouldn't directly cause other large imports
# do large imports in the init() hook so that you can call back to the
# ModuleManager progress handler methods.
"""vtk_kit package driver file.
This performs all initialisation necessary... | # and do the same for vtkdevide
global vtkdevide
import vtkdevide |
<|file_name|>test-server-errors.js<|end_file_name|><|fim▁begin|>'use strict';
var http = require('http');
var Logger = require('bunyan');<|fim▁hole|>});
var server = http.createServer(function (request) {
var data = '';
log.info({ url: request.url }, 'Incoming Request');
request.on('data', function (chun... |
var log = new Logger({
name: 'test-server',
level: 'debug' |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from simplequeue.lib.configuration import config<|fim▁hole|>
__all__ = ['config']<|fim▁end|> | |
<|file_name|>htmloptionelement.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::attr::Attr;
use crate::dom::bindin... | |
<|file_name|>zip.py<|end_file_name|><|fim▁begin|>import os, tempfile, zipfile, tarfile, logging
from django.core.servers.basehttp import FileWrapper
from django.http import HttpResponse
def get_zipfile(file_list):
"""
Create a ZIP file on disk and transmit it in chunks of 8KB,
without load... | wrapper = FileWrapper(fin)
response = HttpResponse(wrapper, content_type='application/tar')
response['Content-Disposition'] = 'attachment; filename=commcarehq.tar' |
<|file_name|>v1_rule_with_operations.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-... | import six
from kubernetes.client.configuration import Configuration |
<|file_name|>subscribe_group.py<|end_file_name|><|fim▁begin|>## www.pubnub.com - PubNub Real-time push service in the cloud.
# coding=utf8
## PubNub Real-time Push APIs and Notifications Framework
## Copyright (c) 2010 Stephen Blum
## http://www.pubnub.com/
import sys
from pubnub import Pubnub as Pubnub
publish_key... |
def callback_d(message, channel):
print(str(message) + ' , ' + channel) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# This file is part of Shoop.
#<|fim▁hole|>from shoop.api.factories import viewset_factory
from shoop.core.api.orders import OrderViewSet
from shoop.core.api.products import ProductViewSet, ShopProductViewSet
from shoop.core.models import Con... | # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree. |
<|file_name|>test_client_websocket_35.py<|end_file_name|><|fim▁begin|>import pytest
import aiohttp
from aiohttp import web
@pytest.mark.run_loop
async def test_client_ws_async_for(loop, create_server):<|fim▁hole|> items = ['q1', 'q2', 'q3']
async def handler(request):
ws = web.WebSocketResponse()
... | |
<|file_name|>UserSettingsEditComponent.ts<|end_file_name|><|fim▁begin|>import {Input, Component} from 'angular2/core';
import {Router, RouterLink, CanActivate} from 'angular2/router';
import {UserSettingsComponent} from '../userSettings/UserSettingsComponent';
import {UserSettingsService} from '../../shared/services/... | import {UserSettings} from '../../shared/models/UserSettings';
import {
PointerType, |
<|file_name|>network_test.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2017, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, t... | |
<|file_name|>test_print.py<|end_file_name|><|fim▁begin|>from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class PrintTests(TranspileTestCase):
def test_fileobj(self):
self.assertCodeExecution("""
class FileLikeObject:
def __init__(self):
self.b... |
def test_flush(self):
self.assertCodeExecution(""" |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import clearSuggestedActions from './actions/clearSuggestedActions';
import connect from './actions/connect';
import createStore, { withDevTools as createStoreWithDevTools } from './createStore';
import disconnect from './actions/disconnect';
import dismissNotification... | import postActivity from './actions/postActivity';
import sendEvent from './actions/sendEvent'; |
<|file_name|>rolebinding.go<|end_file_name|><|fim▁begin|>/*
Copyright 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/LICENSE-2.0
Unless ... | // WithNamespace sets the Namespace field in the declarative configuration to the given value |
<|file_name|>classCqrs_1_1MongoDB_1_1Serialisers_1_1TypeSerialiser.js<|end_file_name|><|fim▁begin|>var classCqrs_1_1MongoDB_1_1Serialisers_1_1TypeSerialiser =
[<|fim▁hole|>];<|fim▁end|> | [ "Deserialize", "classCqrs_1_1MongoDB_1_1Serialisers_1_1TypeSerialiser_a5e8aa7ae1372033da215d02b79947b20.html#a5e8aa7ae1372033da215d02b79947b20", null ],
[ "Serialize", "classCqrs_1_1MongoDB_1_1Serialisers_1_1TypeSerialiser_a4aec60f5df74f482b576f4e0dad0d5f6.html#a4aec60f5df74f482b576f4e0dad0d5f6", null ],
... |
<|file_name|>package.go<|end_file_name|><|fim▁begin|>/*
Copyright IBM Corp. 2016 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/LICENSE-2.0
... | |
<|file_name|>test_floatingips.py<|end_file_name|><|fim▁begin|># Copyright 2015 Hewlett-Packard Development Company, L.P
# 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 Li... | |
<|file_name|>io.rs<|end_file_name|><|fim▁begin|>/*!
This module provides some miscellaneous IO support routines.
*/
use std::io::{IoError, IoResult, OtherIoError};
<|fim▁hole|>/**
Reads a line of input from the given `Reader`. This does not require a push-back buffer. It returns the line *with* the line terminator.
... | |
<|file_name|>test_add_group.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import pytest
from model.group import Group<|fim▁hole|> fixture = Application()
request.addfinalizer(fixture.destroy)
return fixture
def test_add_group(app):
app.session.login(username="admin", password="secret")
app... | from fixture.application import Application
@pytest.fixture
def app(request): |
<|file_name|>caches_test.go<|end_file_name|><|fim▁begin|>/*
Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
Copyright (C) ITsysCOM GmbH
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Softwa... | |
<|file_name|>add_test.go<|end_file_name|><|fim▁begin|>package coreunix
import (
"bytes"
"context"
"io"
"io/ioutil"
"math/rand"
"os"
"testing"
"time"
"github.com/ipfs/go-ipfs/blocks/blockstore"
"github.com/ipfs/go-ipfs/blockservice"
"github.com/ipfs/go-ipfs/commands/files"
"github.com/ipfs/go-ipfs/core"
d... | |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pigame.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above impo... | ) |
<|file_name|>repro_mixin.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
... |
def assert_not_exists(self, root, path): |
<|file_name|>p_serial.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Ver 18 - 15 November 2017 -
import time
import serial
import string
import sys
import mysql.connector
from mysql.connector import errorcode, pooling
from db import *
import datetime
#from threading import Thread
import m... | with open("/sys/class/gpio/gpio" + gpio + "/direction", "w") as writer: |
<|file_name|>stability-attribute-sanity-2.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://w... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
|
<|file_name|>_mod0_1_1_0_0_2.py<|end_file_name|><|fim▁begin|>name0_1_1_0_0_2_0 = None
name0_1_1_0_0_2_1 = None<|fim▁hole|>name0_1_1_0_0_2_3 = None
name0_1_1_0_0_2_4 = None<|fim▁end|> |
name0_1_1_0_0_2_2 = None
|
<|file_name|>bsd_pf.rs<|end_file_name|><|fim▁begin|>//! PacketFilter implementation for *BSD
use std::{
ffi::CString,
io::{self, Error, ErrorKind},
mem,
net::SocketAddr,
ptr,
};
use log::trace;
use once_cell::sync::Lazy;
use socket2::{Protocol, SockAddr};
mod ffi {
use cfg_if::cfg_if;
use... | |
<|file_name|>workflow.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2013, Theo Crevon
# Copyright (c) 2013, Greg Leclercq
#
# See the file LICENSE for copying permission.
from boto.swf.exceptions import SWFResponseError
from swf.constants import REGISTERED
from swf.querysets.base import Bas... | def filter(self, |
<|file_name|>OnEventAdapter.java<|end_file_name|><|fim▁begin|>package com.mithos.bfg.loop;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
/**
* This class is an adapter for {@link OnEvent}. All methods do
* nothing and return true, so you need only implement... | public boolean keyPressed(KeyEvent e) {
return true; |
<|file_name|>0002_auto_20170703_1345.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-03 13:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('frontend', '0001_initia... | model_name='frontenddeployment',
name='deployed_at', |
<|file_name|>db_create.py<|end_file_name|><|fim▁begin|>from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI<|fim▁hole|>from app import db
import os.path
db.create_all()
if not os.path.exists(SQLALCHEMY_MIGRATE_REPO):
api.create(SQLALCHEMY_MIGRATE_REPO, 'database_repository')
api.versi... | from config import SQLALCHEMY_MIGRATE_REPO |
<|file_name|>main.py<|end_file_name|><|fim▁begin|># My files
from handlers import MainPage
from handlers import WelcomePage
from handlers import SignUpPage
from handlers import SignIn
from handlers import SignOut
from handlers import NewPost
from handlers import EditPost
from handlers import DeletePost
from handlers im... | |
<|file_name|>test_variables.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
"""Test class for Smart/Puppet Variables
:Requirement: Smart_Variables
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: API
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import json
from random ... | default_value=gen_string('alpha'),
hidden_value=True,
).create()
self.assertEqual(getattr(smart_variable, 'hidden_value?'), True) |
<|file_name|>nested_macro_privacy.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 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.apach... | |
<|file_name|>tuntap_tests.py<|end_file_name|><|fim▁begin|># Copyright (c) 2011 Mattias Nissler <mattias.nissler@gmx.de>
#
# Redistribution and use in source and binary forms, with or without modification, are permitted
# provided that the following conditions are met:<|fim▁hole|># 2. Redistributions in binary form mu... | #
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer. |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|><|fim▁hole|>itemtypes_tables.update({
'lu_int_wms': 'lux_layer_internal_wms',
'lu_ext_wms': 'lux_layer_external_wms',
})<|fim▁end|> | from c2cgeoportal_admin.views.layertree import itemtypes_tables
|
<|file_name|>CreateSpeciesMutation.js<|end_file_name|><|fim▁begin|>import { commitMutation, graphql } from 'react-relay'
import { ConnectionHandler } from 'relay-runtime'
const mutation = graphql`
mutation CreateSpeciesMutation($input: CreateSpeciesInput!) {
createSpecies(input: $input) {
clientMutationId<... | speciesEdge {
node {
authorId |
<|file_name|>test_brightbox.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 under the Apa... | from libcloud.test import MockHttpTestCase
from libcloud.test.secrets import LB_BRIGHTBOX_PARAMS |
<|file_name|>ProgressBar.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>GUI.Util.ProgressBar<|fim▁end|> | GUI.Util.ProgressBar$1 |
<|file_name|>errata.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2008--2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FO... | # in this software or its documentation. |
<|file_name|>metering.py<|end_file_name|><|fim▁begin|>import ceilometerclient.client as clclient
import logging
log = logging.getLogger(__name__)
class Metering:
'''Wrapper for the OpenStack MEtering service (Ceilometer)'''
def __init__(self, conf):
creds = self._get_creds(conf)
self.ceilo = c... | d = {}
d['os_username'] = conf.get("environment", "OS_USERNAME") |
<|file_name|>update_service.go<|end_file_name|><|fim▁begin|>// Copyright 2016-2021 The Libsacloud 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/... | // See the License for the specific language governing permissions and |
<|file_name|>sign.py<|end_file_name|><|fim▁begin|>import chainer
from chainer import backend
from chainer import utils
def sign(x):
"""Elementwise sign function.
For a given input :math:`x`, this function returns :math:`sgn(x)`
defined as
.. math::
sgn(x) = \\left \\{ \\begin{array}{cc}
... |
"""
if isinstance(x, chainer.variable.Variable): |
<|file_name|>Matches.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2008,2010 itemis AG (http://www.itemis.eu) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the... | * http://www.eclipse.org/legal/epl-v10.html
*
*******************************************************************************/ |
<|file_name|>currie.py<|end_file_name|><|fim▁begin|>"""
Currie -- you can do magic.
Goal here is to have a thread launching piglets.
And curio controlling the operation.
Aim to use joy to control which widget loop to use.
No piglets known to be harmed with this code.
So there is a pig farm and piglets running ever... | parser = argparse.ArgumentParser()
parser.add_argument('--pig', default='tk')
parser.add_argument('--wave') |
<|file_name|>webpack.dev.js<|end_file_name|><|fim▁begin|>var webpack = require('webpack');
var helpers = require('./helpers');
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
const ENV = process.env.NODE_ENV = process.e... | devServer: {
historyApiFallback: true, |
<|file_name|>0011_document_html_text_string.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-25 01:59
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pdfapp', '0010_a... | name='html_text_string',
field=models.TextField(blank=True, null=True),
),
] |
<|file_name|>path-lookahead.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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/... |
// Parser test for #37765
fn with_parens<T: ToString>(arg: T) -> String { //~WARN function is never used: `with_parens` |
<|file_name|>introspection.py<|end_file_name|><|fim▁begin|>from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.postgresql.introspection import DatabaseIntrospection
class GeoIntrospectionError(Exception):
pass
class PostGISIntrospection(DatabaseIntrospection):
# Reverse dictionary for Po... | 'raster_overviews', |
<|file_name|>_debugger_case_breakpoint_remote_no_import.py<|end_file_name|><|fim▁begin|>if __name__ == '__main__':<|fim▁hole|>
if root_dirname not in sys.path:
sys.path.append(root_dirname)
print('before pydevd.settrace')
breakpoint(port=port) # Set up through custom sitecustomize.py
... | import os
import sys
port = int(sys.argv[1])
root_dirname = os.path.dirname(os.path.dirname(__file__)) |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|>import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "battleground.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)<|f... | |
<|file_name|>BvMT+JZAM.text.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | __d("UPoCs",function(o,e,s){s.exports="Here is brisk demo!"}); |
<|file_name|>index.test.js<|end_file_name|><|fim▁begin|>// @flow
import type { ConfigSparseWithSource } from '../../';
import configResolve from '../';
type Fixture = {
name: string,
in: ConfigSparseWithSource,
};
const fixtures: Fixture[] = [
{
name: '01 empty input config',
in: {},
... | describe('lib/config/resolve', () => {
fixtures.forEach((fixture) => {
it(fixture.name, () => {
const received = configResolve(fixture.in); |
<|file_name|>ws_util.py<|end_file_name|><|fim▁begin|>"""
Some helper functions for workspace stuff
"""
import logging
import re
import biokbase
import biokbase.workspace
from biokbase.workspace import client as WorkspaceClient
g_log = logging.getLogger(__name__)
# regex for parsing out workspace_id and object_id from... | 'hidden' : 1} |
<|file_name|>ExitProductSortingHolder.java<|end_file_name|><|fim▁begin|>package ca.ulaval.glo2004.Domain.Matrix;
import ca.ulaval.glo2004.Domain.StationExitPoint;
import java.io.Serializable;
public class ExitProductSortingHolder implements Serializable{
public StationExitPoint exitPoint;
public double value;... |
public ExitProductSortingHolder(StationExitPoint exitPoint, double value){
this.exitPoint = exitPoint;
this.value = value; |
<|file_name|>test_consumer_groups.py<|end_file_name|><|fim▁begin|>import json
import unittest
import mock
from django.http import HttpResponseBadRequest
from base import (assert_auth_CREATE, assert_auth_READ, assert_auth_UPDATE, assert_auth_DELETE,
assert_auth_EXECUTE)
from pulp.server.exceptions im... | raise AssertionError("InvalidValue should be raised with nonexistent resources")
self.assertEqual(response.http_status_code, 400)
self.assertEqual(response.error_data['property_names'], ['distributor_id']) |
<|file_name|>S15.5.4.12_A11.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.<|fim▁hole|>// This code is governed by the BSD license found in the LICENSE file.
/**
* The length property of the search method is 1
*
* @path ch15/15.5/15.5.4/15.5.4.12/S15.5.4.12_A11.js
* @de... | |
<|file_name|>configs.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#----------------------------------------------------------------------------
# ModRana config files handling
#----------------------------------------------------------------------------
# Copyright 2012, Martin Kolman
#
# This program is fre... | shutil.copy(source, configPath)
log.info(" ** default config file copying DONE") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.