prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>config_http_files.py<|end_file_name|><|fim▁begin|>import base64
import json
from pcs_test.tools.command_env.mock_node_communicator import (
place_multinode_call,
)
class FilesShortcuts:
def __init__(self, calls):
self.__calls = calls
def put_files(
self,
node_labels=... | |
<|file_name|>helper_26.py<|end_file_name|><|fim▁begin|>"""
Helper module for Python version 2.6 and below
- Ordered dictionaries
- Encoding/decoding urls
- Unicode
- Exception handling (except Exception, e)
"""
import base64
from urllib import unquote, quote
try:
from ordereddict import OrderedDict
except:
pas... | return quote(uri)
def new_dictionary(): |
<|file_name|>map.js<|end_file_name|><|fim▁begin|>var map;
var bounds;
var markers = {};
var cluster_polygons = {};
var zoomTimeout;
var cluster_center_overlay;
var white_overlay;
var overlay_opacity = 50;
var OPACITY_MAX_PIXELS = 57;
var active_cluster_poly;
var marker_image;
var center_marker;
var cluster_center_marke... |
var center = cluster.geometry.geometries[0].coordinates; |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate oxide;
use oxide::http;
use oxide::http::HttpMethod;<|fim▁hole|>use oxide::http::HttpResponseBuilder;
use oxide::http::HttpStatusCode;
use std::net::Ipv4Addr;
fn main() {
let handler = |req: HttpRequest| -> HttpResponse {
println!("{}", req.t... | use oxide::http::HttpRequest;
use oxide::http::HttpResponse; |
<|file_name|>service_config.go<|end_file_name|><|fim▁begin|>package models
import (
"time"
"encoding/json"
"fmt"
"github.com/go-xorm/xorm"
api "github.com/gogits/go-gogs-client"
"github.com/gogits/gogs/models/errors"
"github.com/gogits/gogs/pkg/setting"
"github.com/gogits/gogs/pkg/sync"
gouuid "github.com/... | ID int64
Type ServiceType
RepoID int64 |
<|file_name|>response.rs<|end_file_name|><|fim▁begin|>//! # HTTP Response generation
//!
//! The HTTP Response code converts response objects into octets and
//! writes them to a stream.
// ****************************************************************************
//
// Imports
//
// ********************************... | AlreadyReported = 208,
ImUsed = 226,
MultipleChoices = 300,
MovedPermanently = 301, |
<|file_name|>Worker2.cpp<|end_file_name|><|fim▁begin|>/*
* File: Worker2.cpp
* Author: saulario
*
* Created on 15 de septiembre de 2016, 6:40
*/
#include "Worker2.h"
#include "Csoft.h"
using namespace csoft::mod2;
Worker2::Worker2(const csoft::Csoft * csoft) {
}
Worker2::Worker2(const Worker2& orig) {
}
W... | |
<|file_name|>console.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# RoundTM - A Round based Tournament Manager
# Copyright (c) 2013 Rémi Alvergnat <toilal.dev@gmail.com>
#
# RoundTM is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General ... | from .events import Event
class Console(object): |
<|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/. */
//! Specified time values.<|fim▁hole|>
use cssparser::{Parser, T... | |
<|file_name|>0458_global_searches_data_migration.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 DataMigration
from django.db import models
from sentry.utils.query import RangeQuerySetWrapperWithProgressBar
DEFAUL... | 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'event': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}),
'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), |
<|file_name|>huffman.py<|end_file_name|><|fim▁begin|># Zadání:
#########
#
# Úkolem je implementovat kompresi textu Huffmanovým kódováním.
#
# Vstup:
# * dva argumenty na příkazové řádce: jméno vstupního souboru a jméno
# výstupního souboru<|fim▁hole|>#
# Vstupní soubor je textový soubor, který obsahuje různě dl... | |
<|file_name|>0013_customprogramsconfig.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-12-13 07:44
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
... | operations = [ |
<|file_name|>InventoryTest.java<|end_file_name|><|fim▁begin|>package com.minecolonies.inventory;
import com.minecolonies.colony.buildings.Building;
import com.minecolonies.colony.materials.MaterialStore;
import com.minecolonies.colony.materials.MaterialSystem;
import com.minecolonies.tileentities.TileEntityColonyBuild... | } |
<|file_name|>omise-base-method-renderer.js<|end_file_name|><|fim▁begin|>define(
[
'Magento_Checkout/js/model/error-processor',
'Magento_Checkout/js/model/full-screen-loader',
'Magento_Checkout/js/model/url-builder'
],
function (
errorProcessor,
fullScreenLoader,
... | * @return {string}
*/
getCode: function() {
return this.code; |
<|file_name|>order.py<|end_file_name|><|fim▁begin|>"""Order a block storage replica volume."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
CONTEXT_SETTINGS = {'token_normalize_func': lambda x: x.upper()}
@cl... | |
<|file_name|>InterpreterTestCases.js<|end_file_name|><|fim▁begin|>var allTestCases = [
{ world: "small",
utterance: "take an object",
interpretations: [["holding(e)", "holding(f)", "holding(g)", "holding(k)", "holding(l)", "holding(m)"]]
},
{ world: "small",
utterance: "take a blue o... | interpretations: [["holding(f)"]] |
<|file_name|>quality_stats.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -tt
# Quality scores from fastx
# Website: http://hannonlab.cshl.edu/fastx_toolkit/
# Import OS features to run external programs
import os
import glob
v = "Version 0.1"
# Versions:
# 0.1 - Simple script to run cutadapt on all of the files
... | # Sample 1
print "Analyzing Sample 1..." |
<|file_name|>panic.rs<|end_file_name|><|fim▁begin|>use pi::uart::MiniUart;
use core::fmt::{Write, Arguments};
#[lang = "eh_personality"]
pub extern "C" fn eh_personality() {}
#[lang = "panic_fmt"]
#[no_mangle]
pub extern fn panic_fmt(msg: Arguments, file: &'static str, line: u32, col: u32) -> ! {
let mut uart = M... | |
<|file_name|>api.js<|end_file_name|><|fim▁begin|>import { stringify } from 'qs'
import _request from '@/utils/request'
import mini from '@/utils/mini'
import env from '@/config/env'
// import { modelApis, commonParams } from './model'
// import { version } from '../package.json'
let apiBaseUrl
apiBaseUrl = `${env.apiB... | data: compact(Object.assign({}, getCommonParams(), params)),
}, success, fail) |
<|file_name|>16.d.ts<|end_file_name|><|fim▁begin|>import * as React from "react";
import { CarbonIconProps } from "../../";
declare const ResearchBlochSphere16: React.ForwardRefExoticComponent<<|fim▁hole|> CarbonIconProps & React.RefAttributes<SVGSVGElement>
>;
export default ResearchBlochSphere16;<|fim▁end|> | |
<|file_name|>sidebar.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-site-sidebar',
templateUrl: 'sidebar.component.html',
styleUrls: ['sidebar.component.scss']
})
export class SidebarComponent implements OnInit {
constructor() { ... | } |
<|file_name|>ConnectorHandler.java<|end_file_name|><|fim▁begin|>package org.ethereum.android.service;
import android.os.Message;
public interface ConnectorHandler {
boolean handleMessage(Message message);
void onConnectorConnected();
void onConnectorDisconnected();<|fim▁hole|><|fim▁end|> | String getID();
} |
<|file_name|>_attachment.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os,sys, re, json, requests
from oxapi import *
def get_a_task(ox):
folder = ox.get_standard_folder('tasks')
task = list(ox.get_tasks(folder.id))[0]
return task
def upload(bean, args=[{'content':N... | |
<|file_name|>update_target.go<|end_file_name|><|fim▁begin|>/*
Copyright 2020 The Vitess 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
Unle... | // Target string to be updated
Target string
|
<|file_name|>sentry-request-handler.js<|end_file_name|><|fim▁begin|>import { Handlers } from '@sentry/node';
import { sentry } from '../../../../config/secrets';
export default function sentryRequestHandler() {<|fim▁hole|> return sentry.dns === 'dsn_from_sentry_dashboard'
? (req, res, next) => next()
: Handle... | |
<|file_name|>workflow.py<|end_file_name|><|fim▁begin|>from orchestra.workflow import Step
from orchestra.workflow import Workflow
<|fim▁hole|>
crawl_step = Step(
slug='crawl',
name='Web Crawling',
description='Find an awesome image on a website',
worker_type=Step.WorkerType.MACHINE,
creation_depends... | from simple_workflow.crawl import crawl_page |
<|file_name|>hidecode.js<|end_file_name|><|fim▁begin|>$(document).ready(function() {
/* Add a [>>>] button on the top-right corner of getthecode div to show the code */
var div = $('.getthecode-header')
var button_text = 'Show/Hide the code';
var button_styles = {
'cursor':'pointer',
'float': 'right... | var jthis = $(this);
var button = $('<span class="show-code-button">>>></span><div style="clear:both;"></div>');
button.css(button_styles)
button.attr('title', button_text); |
<|file_name|>domparser.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 document_loader::DocumentLoader;
use dom::bindings::cod... | }
}
} |
<|file_name|>itertools_repeat_zip.py<|end_file_name|><|fim▁begin|>from itertools import *
for i, s in zip(count(), repeat('over-and-over', 5)):<|fim▁hole|><|fim▁end|> | print(i, s) |
<|file_name|>text.rs<|end_file_name|><|fim▁begin|>use crate::rendering::{Renderable, StandardPrimitive, PlainText};
impl Renderable<StandardPrimitive> for PlainText {<|fim▁hole|>}<|fim▁end|> | fn get_primitives(&mut self) -> Vec<StandardPrimitive> { vec![StandardPrimitive::Text(self.clone())] } |
<|file_name|>HelloConfig.java<|end_file_name|><|fim▁begin|>package io.prajesh.config;
import io.prajesh.domain.HelloWorld;
import io.prajesh.service.HelloWorldService;
import io.prajesh.service.HelloWorldServiceImpl;
import io.prajesh.service.factory.HelloWorldFactory;
import org.springframework.context.annotation.Bea... | |
<|file_name|>temp.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-<|fim▁hole|>@author: sitibanc
"""
import math
import numpy as np
def entropy(p1, n1): # postive, negative
if p1 == 0 and n1 == 0:
return 1
value = 0
pp = p1 / (p1 + n1)
pn = n1 / (p1 + n1)
... | """
Created on Thu Oct 12 22:25:38 2017
|
<|file_name|>test_powermax_common.py<|end_file_name|><|fim▁begin|># Copyright (c) 2020 Dell Inc. or its subsidiaries.
# 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 Lice... | source_group = self.data.test_group_1
snap_name = self.data.group_snapshot_name |
<|file_name|>mesh.modifier.ExtrudeFaces.py<|end_file_name|><|fim▁begin|>#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyGrid", "ExtrudeFaces")
setup.source.rows = 3
setup.source.columns = 3<|fim▁hole|>setup.modifier.mesh_selection = selection
setup.modifier.distance = 5
testing.requ... |
selection = k3d.geometry.selection.create(0)
face_selection = k3d.geometry.primitive_selection.create(selection, k3d.selection.type.FACE)
k3d.geometry.primitive_selection.append(face_selection, 4, 5, 1) |
<|file_name|>ua_exclusive_deviation_alarm_impl.ts<|end_file_name|><|fim▁begin|>/**
* @module node-opcua-address-space.AlarmsAndConditions
*/
import { assert } from "node-opcua-assert";
import { DataValue } from "node-opcua-data-value";
import { NodeId } from "node-opcua-nodeid";
import { DataType } from "node-opcua-v... | assert(alarm instanceof UAExclusiveDeviationAlarmImpl);
assert(alarm instanceof UAExclusiveLimitAlarmImpl);
assert(alarm instanceof UALimitAlarmImpl); |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var plugin = require("./plugin");
module.exports = function(PluginHost) {
var app = PluginHost.owner;
/**
* used like so:
* --external-aliases privateapi,privateAPI,hiddenAPI
* or<|fim▁hole|> * used like so:
* --internal-aliases publicapi
* or
*... | * -ea privateapi,privateAPI
*/
app.options.addDeclaration({ name: 'external-aliases', short: 'ea' });
/** |
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|>"""
Tests for SGA utility functions
"""
import pytest
import pytz
from edx_sga.tests.common import is_near_now
from edx_sga.utils import is_finalized_submission, utcnow
@pytest.mark.parametrize(
"submission_data,expected_value",
[
({"answer": {... |
def test_utcnow(): |
<|file_name|>scrapbook-list.js<|end_file_name|><|fim▁begin|>var GridLayout = require("ui/layouts/grid-layout").GridLayout;
var ListView = require("ui/list-view").ListView;
var StackLayout = require("ui/layouts/stack-layout").StackLayout;
var Image = require("ui/image").Image;
var Label = require("ui/label").Label;
v... | object: this, |
<|file_name|>everyObject-test.js<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be fo... | beforeEach(() => {
mockObject = {foo: 1, bar: 2, baz: 3};
mockCallback = jest.fn(); |
<|file_name|>scroll.js<|end_file_name|><|fim▁begin|>document.getElementsByTagName('body')[0].style.overflow = 'hidden';<|fim▁hole|><|fim▁end|> | window.scrollTo(70, 95); |
<|file_name|>expm1c.cpp<|end_file_name|><|fim▁begin|>// accurate implementation of the complex expm1 function
#include <complex>
#include "Rcpp.h"
using namespace std;
complex<double> expm1c(complex<double> z)
{
complex<double> ii(0,1);
return exp(imag(z)*ii) * expm1(real(z)) + ii * sin(imag(z)) - 2 * sin(imag(z)... | } |
<|file_name|>stdafx.cpp<|end_file_name|><|fim▁begin|>// stdafx.cpp : source file that includes just the standard includes
// xpad.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and n... | |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>extern crate gcc;<|fim▁hole|>fn main() {
gcc::compile_library("libprintf_wrapper.a", &["src/printf_wrapper.c"]);
}<|fim▁end|> | |
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>//
// Last.Backend LLC CONFIDENTIAL
// __________________
//
// [2014] - [2020] Last.Backend LLC
// All Rights Reserved.
//
// NOTICE: All information contained herein is, and remains
// the property of Last.Backend LLC and its suppliers,
// if any. The intellectual an... | // from Last.Backend LLC.
//
package types |
<|file_name|>arith-unsigned.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/... | assert!((60005u16 % 10u16 == 5u16));
assert!((0u32 < 4000000000u32));
assert!((0u32 <= 4000000000u32)); |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import time
from django.conf import settings
from django.test import TestCase
from django.test.client import FakePayload, Client
from django.utils.encoding import force_text
from tastefulpy.serializers import Serializer
try:
... |
* An HTTP 200
* The correct content-type (``text/yaml``)
* The content is valid YAML |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Komiksowiec documentation build configuration file, created by
# sphinx-quickstart on Fri Feb 3 23:11:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all ... | # a list of builtin themes. |
<|file_name|>passwords_deletion_dialog.ts<|end_file_name|><|fim▁begin|>// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview 'settings-passwords-deletion-dialog' is a dialog that is
* op... | * passwords. It informs the user that not all password deletions were completed
* successfully.
*/ |
<|file_name|>anime_db.cpp<|end_file_name|><|fim▁begin|>#include <fstream>
<|fim▁hole|>#include "anime_db.hpp"
#include "trim.hpp"
bool anime_database::dump_anime_db(const astd::filesystem::path& db_path, const anime_database& db)
{
bool result = false;
std::ofstream stream{ db_path.c_str(), std::ios::out |... | #include <algorithm>
|
<|file_name|>RestDockerExample.java<|end_file_name|><|fim▁begin|>package com.am.docker.study.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class RestDockerExample {
<|fim▁hole|> public String home() {
... | @RequestMapping("/") |
<|file_name|>list_databases.ts<|end_file_name|><|fim▁begin|>import type { Document } from '../bson';
import type { Db } from '../db';
import type { Server } from '../sdam/server';
import type { ClientSession } from '../sessions';
import { Callback, MongoDBNamespace } from '../utils';
import { CommandOperation, CommandO... | |
<|file_name|>exec.js<|end_file_name|><|fim▁begin|>function dec(target, name, descriptor) {
assert(target);
assert.equal(typeof name, "string");
assert.equal(typeof descriptor, "object");
target.decoratedProps = (target.decoratedProps || []).concat([name]);
let initializer = descriptor.initializer;
return ... | assert.equal(descs._.writable, false);
assert.equal(descs._.configurable, false);
assert.equal(inst._, "__8__"); |
<|file_name|>Trolley.py<|end_file_name|><|fim▁begin|>from pandac.PandaModules import *
from toontown.toonbase.ToonBaseGlobal import *
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.fsm import ClassicFSM, State
from direct.fsm import State
fr... | doneStatus['mode'] = 'reject' |
<|file_name|>hierarchical.js<|end_file_name|><|fim▁begin|>/* @flow */
import * as React from "react";
import { nest } from "d3-collection";
import { scaleLinear } from "d3-scale";
import TooltipContent from "../tooltip-content";
const parentPath = (d, pathArray) => {
if (d.parent) {
pathArray = parentPath(d.pare... | for (let x = d.depth; x > 1; x--) {
colorNode = colorNode.parent;
}
const lightenScale = scaleLinear() |
<|file_name|>test_IRCClientProtocol.py<|end_file_name|><|fim▁begin|>from unittest import TestCase
from unittest.mock import Mock, patch, call, MagicMock
from flowirc.protocol import IRCClientProtocol
__author__ = 'Olle Lundberg'
class TestIRCClientProtocol(TestCase):
def setUp(self):
self.proto = IRCCli... | def test_data_received_2(self, ircmessage, task):
self.proto.message_received = Mock() |
<|file_name|>SpittleControllerTest.java<|end_file_name|><|fim▁begin|>package spitter.web;
import static org.hamcrest.Matchers.*;
import static org.mockito.Mockito.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResu... |
import java.util.ArrayList; |
<|file_name|>inequalities.py<|end_file_name|><|fim▁begin|>"""Tools for solving inequalities and systems of inequalities. """
from __future__ import print_function, division
from sympy.core import Symbol
from sympy.sets import Interval
from sympy.core.relational import Relational, Eq, Ge, Lt
from sympy.sets.sets impor... | |
<|file_name|>test_global_editor_reader.py<|end_file_name|><|fim▁begin|># Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Test if global editor and global reader role has the permission to access
the workflow objects, owned by Admin.
"""
# T0D0: write tes... | from ggrc_workflows.models import Workflow
from ggrc_workflows.models import WorkflowPerson
from ggrc_workflows.models import TaskGroup
from ggrc_workflows.models import TaskGroupObject |
<|file_name|>bitcoin_bs.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="bs" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Fuelcoin</source>
<translation type="unfinished... | <message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation type="unfinished"/> |
<|file_name|>proxy.py<|end_file_name|><|fim▁begin|>r"""A proxy enabling multiple wiring guide instances to interact with the same
SpiNNaker boards.
A very simple protocol is used between the client and server. Clients may send
the following new-line delimited commands to the server:
* ``VERSION,[versionstring]\n`` Th... | def handle_led(self, sock, args): |
<|file_name|>TestFooSubModel.java<|end_file_name|><|fim▁begin|>package org.jboss.windup.graph.typedgraph;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.frames.Property;
import com.tinkerpop.frames.modules.javahandler.JavaHandler;
import com.tinkerpop.frames.modules.javahandler.JavaHandlerContext;
import... |
@Property("fooProperty") |
<|file_name|>hash_map.rs<|end_file_name|><|fim▁begin|>// Copyright 2014-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/l... | }
robin_hood(bucket, disp, self.hash, self.key, value)
},
NoElem(mut bucket, disp) => { |
<|file_name|>Platform.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restri... | '.exe' |
<|file_name|>Dropdown.spec.js<|end_file_name|><|fim▁begin|>import React from 'react';
import PropTypes from 'prop-types';
import dropdownDriverFactory from '../Dropdown.driver';
import Dropdown from '../Dropdown';
import { sleep } from 'wix-ui-test-utils/react-helpers';
import {
createRendererWithDriver,
createRend... | rerender(<Dropdown options={[{ id: 1, value: 'Option 2' }]} />); |
<|file_name|>controllers.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright © 2011 Varyant, LLC
import re
from wsgiref.util import request_uri
from wack.http.errors import HttpMethodNotAllowed, HttpNotFound
from wack.http.request import Request
from wack.http.response import Response
class Controll... | def __call__(self, environ, start_response): |
<|file_name|>test_voxel.py<|end_file_name|><|fim▁begin|>import numpy as np
from nose.tools import (assert_true, assert_false, assert_equal,
assert_almost_equal)
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_)
from dipy.sims.voxel im... | e0 = np.array([np.sqrt(2) / 2., np.sqrt(2) / 2., 0])
e1 = np.array([0, np.sqrt(2) / 2., np.sqrt(2) / 2.])
mevecs = [all_tensor_evecs(e0), all_tensor_evecs(e1)]
# odf = multi_tensor_odf(vertices, [0.5, 0.5], mevals, mevecs) |
<|file_name|>omnom.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "stream")]
#[macro_use]
extern crate nom;
use nom::{Producer,Consumer,ConsumerState,Input,Move,MemProducer,IResult,Offset};
#[derive(PartialEq,Eq,Debug)]
enum State {
Beginning,
Middle,
End,
Done,
Error
}
struct TestConsumer {
state: ... | |
<|file_name|>OpenOntologyIRI.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 Manuel Fernández Pérez
*
* 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.ap... |
bookmarkParser= new StaXListOntologySourcesParser("ontology", "iri", "resources/xmls/Bookmarks.xml");
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from setuptools import setup, find_packages
classifiers = [
# Get more strings from<|fim▁hole|>"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Program... | # http://pypi.python.org/pypi?%3Aaction=list_classifiers
"License :: OSI Approved :: MIT License", |
<|file_name|>ClassicLogWarning.tsx<|end_file_name|><|fim▁begin|>import { Trans } from '@lingui/macro';
import AlertWarning from 'interface/AlertWarning';
const ClassicLogWarning = () => (
<div className="container">
<AlertWarning style={{ marginBottom: 30 }}>
<h2>
<Trans id="interface.report.classi... | ); |
<|file_name|>iterator.rs<|end_file_name|><|fim▁begin|>// This file is part of libfringe, a low-level green threading library.
// Copyright (c) whitequark <whitequark@whitequark.org>
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICEN... | |
<|file_name|>clipboard_gtk.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2008-2018 SLIBIO <https://github.com/SLIBIO>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software with... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from glob import glob
from distutils.core import setup
setup( name="mythutils_recfail_alarm",<|fim▁hole|> author_email="wylie@pingzero.net",
url="http://www.pingzero.net",
scripts=glob("bin/*"),
data_files=[
( '/etc/mythutils/', glob('etc/m... | version="1.0",
description="Autoamtically notify on Recorder Failed via Prowl service",
author="Wylie Swanson", |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for jt_portfolio project.
It exposes the WSGI callable as a module-level variable named ``application``.
<|fim▁hole|>For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.ws... | |
<|file_name|>EmptyOverview.js<|end_file_name|><|fim▁begin|>/*
* SonarQube
* Copyright (C) 2009-2017 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free... | );
}; |
<|file_name|>TestUnsynchronizedUnboundedChunkBuffer.java<|end_file_name|><|fim▁begin|>/*
Copyright (C) SYSTAP, LLC 2006-2015. All rights reserved.
Contact:
SYSTAP, LLC
2501 Calvert ST NW #106
Washington, DC 20008
licenses@systap.com
This program is free software; you can redistribute it... | |
<|file_name|>palm_trees.rs<|end_file_name|><|fim▁begin|>pub struct PalmTrees {<|fim▁hole|>}<|fim▁end|> | pub palms: Vec<[f64; 2]> |
<|file_name|>gh.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import getpass
import requests
import ConfigParser
BASE_DIR = os.path.dirname(__file__)
class Auth:
"""GitHub API Auth"""
def __init__(self):
self.auth_url = 'https://api.github.com'
... | repo_info = g_commit.get_repo_info(s, owner, repo)
commits_json = g_commit.get_commits(s, owner, repo)
commits_info = []
for commit_json in commits_json: |
<|file_name|>combined-slip-basic.py<|end_file_name|><|fim▁begin|>from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import numpy as np
def coefficient(slipValue, extremumValue, extremumSlip, asymptoteValue, a... | absoluteSlip = abs(slipValue); |
<|file_name|>azure-storage.d.ts<|end_file_name|><|fim▁begin|>//
// Copyright (c) Microsoft and contributors. 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
// ... | |
<|file_name|>player.go<|end_file_name|><|fim▁begin|>package main
import (
"math/rand"
"net"
"time"
)
type Player struct {
Conn net.Conn
Name string
Health int64
LastCrash int64
Color int
Bot bool
Bombs int
DropBomb bool
Car Car
}
func (p *Player) initPlayer(id int) {
sw... | // Player was hit from UP |
<|file_name|>webpack.config.prod.js<|end_file_name|><|fim▁begin|>'use strict';
const autoprefixer = require('autoprefixer');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
cons... | // the HTML & assets that are part of the Webpack build. |
<|file_name|>color.py<|end_file_name|><|fim▁begin|>"""
Color definitions are used as per CSS3 specification:
http://www.w3.org/TR/css3-color/#svg-color
A few colors have multiple names referring to the sames colors, eg. `grey` and `gray` or `aqua` and `cyan`.
In these cases the LAST color when sorted alphabetically ... | |
<|file_name|>IStereotype.java<|end_file_name|><|fim▁begin|>/*
* Package : org.ludo.codegenerator.core.gen.bean
* Source : IStereotype.java<|fim▁hole|>import java.io.Serializable;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;
import org.ludo.codegenerator.core.gen.bean.impl.AttributBean... | */
package org.ludo.codegenerator.core.gen.bean;
|
<|file_name|>generic-impl-less-params-with-defaults.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
// 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|>sql_resources.py<|end_file_name|><|fim▁begin|># coding: utf8
from wsgidav.dav_provider import DAVCollection, DAVNonCollection
from wsgidav.dav_error import DAVError, HTTP_FORBIDDEN
from wsgidav import util
from wsgidav.addons.tracim import role, MyFileStream
from time import mktime
from datetime import da... | return 'text/html'
def getContent(self):
filestream = StringIO() |
<|file_name|>frinkiac.py<|end_file_name|><|fim▁begin|>"""
Frinkiac (Images)
@website https://www.frinkiac.com
@provide-api no
@using-api no<|fim▁hole|>
from json import loads
from urllib import urlencode
categories = ['images']
BASE = 'https://frinkiac.com/'
SEARCH_URL = '{base}api/search?{query}'
RESULT_URL =... | @results JSON
@stable no
@parse url, title, img_src
""" |
<|file_name|>publisher.py<|end_file_name|><|fim▁begin|>import rospy
import time
from collections import deque
<|fim▁hole|> self.publishers = {}
self.queue = deque()
def add_publisher(self, alias, publisher):
self.publishers[alias] = publisher
def publish(self):
while len(self.... | class Publisher(object):
def __init__(self): |
<|file_name|>match.route.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
angular
.module('app.match')
.run(appRun);
appRun.$inject = ['routerHelper'];
/* @ngInject */
function appRun(routerHelper) {
routerHelper.configureStates(getStates());
}
function getStates() {
return [... | |
<|file_name|>boards.js<|end_file_name|><|fim▁begin|>var app = require('../../app');
var boards = require('../controllers/boards');
<|fim▁hole|><|fim▁end|> | app.get('/api/boards', boards.get); |
<|file_name|>paging.rs<|end_file_name|><|fim▁begin|>//! Definitions for paging structures
use ::core::mem::size_of;
use arch::x86_64::x86::paging;
pub trait Level {
type Table;
fn new() -> Self::Table;
}<|fim▁hole|>
trait ParentLevel: Level {
type Child;
}
pub enum PML4Table {}
pub enum PDPTTable {}
pub ... | |
<|file_name|>webserver.py<|end_file_name|><|fim▁begin|>from http.server import SimpleHTTPRequestHandler, HTTPServer
from socketserver import ThreadingMixIn<|fim▁hole|>class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
"""Handle requests in a separate thread."""
if __name__ == '__main__':
server = ThreadedHT... | import threading
|
<|file_name|>test_split_mongo_mongo_connection.py<|end_file_name|><|fim▁begin|>""" Test the behavior of split_mongo/MongoConnection """
from __future__ import absolute_import
import unittest
from mock import patch
from xmodule.exceptions import HeartbeatFailure
from xmodule.modulestore.split_mongo.mongo_connection i... |
with self.assertRaises(HeartbeatFailure):
useless_conn.heartbeat() |
<|file_name|>main.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import sys
def func():
print('{0}.{1}'.format(*sys.version_info[:2]))
print(repr(sys.argv[1:]))
print('Hello World')
return 0<|fim▁end|> | from __future__ import print_function
|
<|file_name|>jquery.flot.fillbetween.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1<|fim▁hole|>oid sha256:054dbc79bbfc64911008a1e140813a8705dfc5cff35cbffd8bf7bc1f74c446b6
size 5257<|fim▁end|> | |
<|file_name|>ExampleUnitTest.java<|end_file_name|><|fim▁begin|>package com.iosdevlog.a94staticcalendarview;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).<|fim▁hole|> *
* @see <a href="http://d.android.com/tools/testing"... | |
<|file_name|>server.rs<|end_file_name|><|fim▁begin|>//! Serverteil der xMZ-Mod-Touch-Server Platform
//!
//! Hier werden alle Komponenten des Servers verwaltet.
//!
use chrono;
use chrono::prelude::*;
use server::configuration::Configuration;
use errors::*;
use exception::{Exception, ExceptionType};
use serde_json;
use... | pub fn new() -> Self { |
<|file_name|>BiPartite.js<|end_file_name|><|fim▁begin|>/**
* @author Yongnan
* @version 1.0
* @time 11/26/2014
* @name PathBubble_BiPartite
*/
PATHBUBBLES.BiPartite = function (x, y, w, h, data, name) {
var tmp;
PATHBUBBLES.BubbleBase.call(this, {
type: 'BiPartite',
mainMenu: true, cl... | saveString += tempKey[0][j];
saveString += "\t"; |
<|file_name|>vcsys.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from . import vcexceptions
from . import vcsimdata
<|fim▁hole|> def __init__(self, sim_data):
self.sim_data = sim_data
if type(self.sim_data) != vcsimdata.VCSimData:
raise vcexceptions.NoSimData(self.sim_dat... | #-------------------------------------------------------------------------------
# The base class for Virtual California simulation objects.
#-------------------------------------------------------------------------------
class VCSys(object): |
<|file_name|>CVDemo.Image.Overlay.cpp<|end_file_name|><|fim▁begin|>// CVDemo.Image.Overlay.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/video.hpp>
#include <stdio.h>
#in... | ProgramOptions options = ProgramOptions(argc, argv, configFile);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.