prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>CreateJson.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Creates and saves a JSON file to update the D3.js graphs
import MySQLdb
import MySQLdb.cursors
import json
import Reference as r
import logging
def CreateSentimentIndex(NegativeWords, PositiveWords, TotalWords):
''' Creates a senti... | passwd=r.DB_PASSWORD,
db=r.DB_NAME,
cursorclass=MySQLdb.cursors.DictCursor
) |
<|file_name|>CellularEmporium.tsx<|end_file_name|><|fim▁begin|>import { useBackend } from '../backend';
import { Button, Section, Icon, Stack, LabeledList, Box, NoticeBox } from '../components';
import { Window } from '../layouts';
type CellularEmporiumContext = {
abilities: Ability[];
can_readapt: boolean;
gene... | }
}; |
<|file_name|>convert.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##
# wrapping: A program making it easy to use hyperparameter
# optimization software.
# Copyright (C) 2013 Katharina Eggensperger and Matthias Feurer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | |
<|file_name|>reframe.js<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> @author Jeff Wainwright <yowainwright@gmail.com> (http://jeffry.in)
@license MIT
**/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && d... | reframe.js - Reframe.js: responsive iframes for embedded content
@version v3.0.0
@link https://github.com/yowainwright/reframe.ts#readme |
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>module.exports = function (config) {
'use strict';
<|fim▁hole|>
basePath: '../',
files: [
// Angular libraries.
'app/assets/lib/angular/angular.js',
'app/assets/lib/angular-ui-router/release/angular-ui-route... | config.set({ |
<|file_name|>issue-3979-generics.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// 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:... | |
<|file_name|>ContextManagerAsyncTrack.ts<|end_file_name|><|fim▁begin|>'use strict';
import { IContextManager, IRunInContextCallback } from './IContextManager';
import { ContextManagerBase } from './ContextManagerBase';
import { IAsyncTrack, IAsyncTrackEvents, getAsyncTrack } from './../async-track/async-track';
import... | |
<|file_name|>dns.rs<|end_file_name|><|fim▁begin|>use std::io;
use std::net::{SocketAddr, ToSocketAddrs};
use std::vec;
use ::futures::{Future, Poll};
use ::futures_cpupool::{CpuPool, CpuFuture};
#[derive(Clone)]
pub struct Dns {
pool: CpuPool,
}
impl Dns {
pub fn new(threads: usize) -> Dns {
Dns {
... |
pub fn resolve(&self, host: String, port: u16) -> Query { |
<|file_name|>pagination.py<|end_file_name|><|fim▁begin|>from collections import OrderedDict
from rest_framework import pagination
from rest_framework.response import Response
__author__ = 'alexandreferreira'
class DetailPagination(pagination.PageNumberPagination):
def get_paginated_response(self, data):
... | |
<|file_name|>HttpUtils.java<|end_file_name|><|fim▁begin|>package com.netsun.labuy.utils;
import java.io.IOException;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
/**
* Created by Administrator on 2017/2/24.<|fim▁hole|>
public clas... | */ |
<|file_name|>http.service.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import 'rxjs/add/operator/toPromise';
import 'rxjs/add/operator/catch';
@Injectable()
export class HttpService{
private headers = new Headers({'Content-Type': 'application/json'});
constructor(private http: Http){ }
getData(): Promise<Perso... | import {Injectable} from '@angular/core';
import {Headers, Http, RequestOptions} from '@angular/http';
import {Person} from './person'; |
<|file_name|>AbsenceStatusType.java<|end_file_name|><|fim▁begin|><|fim▁hole|> * 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 License, or
* (at your option) any later ... | /*
* Copyright (C) 2016 Douglas Wurtele
* |
<|file_name|>p5.clickable.js<|end_file_name|><|fim▁begin|>// _____ _ _ _ _ _
// | ___| | (_) | | | | | |
// _ __ |___ \ ___| |_ ___| | ____ _| |__ | | ___
// | '_ \ \ \/ __| | |/ __| |/ / _` | '_ \| |/ _ \
// | |_) /\__/ / (__| | | (__| < (_| | |_) | | __/
// |... | }
if(!cl_mouseWasPressed && cl_lastClicked != null){
cl_lastClicked.onPress();
} |
<|file_name|>celery.py<|end_file_name|><|fim▁begin|>import datetime
import mock
from django.utils import timezone
from mock import Mock, call, PropertyMock
from django.test import TestCase
from django.contrib.sessions.models import Session
from mysite.celery import send_outcome, check_anonymous
<|fim▁hole|>
@mock... | class CeleryTasksTest(TestCase): |
<|file_name|>coroutine.rs<|end_file_name|><|fim▁begin|>use ffi::Timeout;
use core::{AsIoContext, IoContext, ThreadIoContext, Cancel};
use handler::{Handler};
use strand::{Strand, StrandImmutable, StrandHandler};
use SteadyTimer;
use context::{Context, Transfer};
use context::stack::{ProtectedFixedSizeStack, Stack, Sta... | )
};
if data != 0 {
if let Some(ctx) = unsafe { &mut *(data as *mut Option<CancelRef>) }.take() { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) The University of Strathclyde 2019
# Author: Leighton Pritchard
#
# Contact:
# leighton.pritchard@strath.ac.uk
#
# Leighton Pritchard,
# Strathclyde Institute of Pharmaceutical and Biomedical Sciences
# The Univers... | # If we do not catch warnings here, then we often get the following warning:
# ClusterWarning: scipy.cluster: The symmetric non-negative hollow |
<|file_name|>String Incrementer.py<|end_file_name|><|fim▁begin|>"""
Your job is to write a function which increments a string, to create a new string. If the string already ends with a number, the number should be incremented by 1. If the string does not end with a number the number 1 should be appended to the new stri... | |
<|file_name|>util_iperf.go<|end_file_name|><|fim▁begin|>/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unl... | framework.Logf("Warning: no data in bandwidth map")
} |
<|file_name|>rpc.rs<|end_file_name|><|fim▁begin|>extern crate crypto;
use bytes::BytesMut;
use crypto::digest::Digest;
use encoding::{all::ISO_8859_1, DecoderTrap, EncoderTrap, Encoding};
use futures::SinkExt;
use tokio::{
io::{AsyncRead, AsyncWrite},
net::TcpStream,
stream::StreamExt,
};
use tokio_util::c... | |
<|file_name|>git.go<|end_file_name|><|fim▁begin|>package test
import (
"io/ioutil"
"net/url"
"os"
"path/filepath"
"testing"
"github.com/openshift/source-to-image/pkg/api"
)
// FakeGit provides a fake Git
type FakeGit struct {
ValidCloneSpecSource string
ValidCloneSpecResult bool
CloneSource string
CloneTa... | f.SubmoduleUpdateRecursive = recursive
f.SubmoduleUpdateInit = init
return f.SubmoduleUpdateError |
<|file_name|>empty-class-layout.cpp<|end_file_name|><|fim▁begin|>// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify
#define SA(n, p) int a##n[(p) ? 1 : -1]
struct A { int a; };
SA(0, sizeof(A) == 4);
struct B { };
SA(1, sizeof(B) == 1);
struct C : A, B { };
SA(2, sizeof(C) == 4);
struct D ... |
struct I : Empty {
Empty e; |
<|file_name|>connection.py<|end_file_name|><|fim▁begin|>from omnibus.factories import websocket_connection_factory
<|fim▁hole|>def mousemove_connection_factory(auth_class, pubsub):
class GeneratedConnection(websocket_connection_factory(auth_class, pubsub)):
def close_connection(self):
self.pubs... | |
<|file_name|>JQueryAdapter.ts<|end_file_name|><|fim▁begin|>import UtilMath = require('./UtilMath');
import Timer = require('./Timer');
import Browser = require('./Browser');
import BaserElement = require('./BaserElement');
import AlignedBoxes = require('./AlignedBoxes');
import BackgroundContainer = require('./Backgrou... | return true; |
<|file_name|>submission.go<|end_file_name|><|fim▁begin|>// Copyright 2012 Jimmy Zelinskie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package geddit
import (
"fmt"
)
// Submission represents an individual post from the perspective
// ... | |
<|file_name|>web_platform_test_server.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014, Canon 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:
# 1. Redistributions of source code must ... | _log = logging.getLogger(__name__)
|
<|file_name|>demo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Natural Language Toolkit: Transformation-based learning
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Marcus Uneson <marcus.uneson@gmail.com>
# based on previous (nltk2) version by
# Christopher Maloof, Edward Loper, Steven Bird
# URL:... | Writes a file with context for each erroneous word after tagging testing data
"""
postag(error_output="errors.txt") |
<|file_name|>ConfigSet.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2010 (ita)
"""
ConfigSet: a special dict
The values put in :py:class:`ConfigSet` must be lists
"""
import copy, re, os
from waflib import Logs, Utils
re_imp = re.compile('^(#)*?([^#=]*?)\ =\ (.*?)$', r... | """Dict interface (unknown purpose)""" |
<|file_name|>presupuesto_parcial.py<|end_file_name|><|fim▁begin|>#-------------------------------------------------------------------------------<|fim▁hole|># Creado: 12/11/2015
# Copyright: (c) programar 2015
# Licence: <your licence 1.1>
#---------------------------------------------------------------------... | # Name: presupuesto parcial#1
# Author: programar
# |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use self::api_request_processor::ApiReply;
use crate::commands::CommandHelpers;
use crate::entity::EntityRef;
use crate::entity::Realm;
use crate::player_output::PlayerOutput;
use crate::sessions::SessionOutput;
mod api_request_processor;
mod entity_create_command;
mod ... | mod entity_list_command;
mod entity_set_command;
mod property_set_command; |
<|file_name|>artifact.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"io/ioutil"
"net/http"
"strings"
ct "github.com/flynn/flynn/controller/types"
hh "github.com/flynn/flynn/pkg/httphelper"
"github.com/flynn/flynn/pkg/postgres"
"github.com/flynn/flynn/pkg/random"
"github.com/flynn/flynn/pkg/veri... | return err
} |
<|file_name|>Demux.cpp<|end_file_name|><|fim▁begin|>// This file is part of Aspect-Oriented-IP.
//
// Aspect-Oriented-IP is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
//... |
namespace ipstack {
|
<|file_name|>dnotify.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# class to allow watching multiple files and
# calling a callback when any change (size or mtime)
#
# We take exclusive use of SIGIO and maintain a global list of
# watched files.
# As we cannot get siginfo in python, we check every file
# ever... | |
<|file_name|>LdapParser.java<|end_file_name|><|fim▁begin|>package io.skysail.server.queryfilter.parser;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.service.component.annotations.Component;
import io.s... | filterstring);
} |
<|file_name|>common.js<|end_file_name|><|fim▁begin|>/**
* Common utilities
* @module glMatrix
*/
// Configuration Constants
export var EPSILON = 0.000001;
export var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;
export var RANDOM = Math.random;
/**
* Sets the type of array used when c... | *
|
<|file_name|>wordcount.py<|end_file_name|><|fim▁begin|>import sys
from operator import add
from pyspark import SparkContext
if __name__ == "__main__":
if len(sys.argv) < 3:
print >> sys.stderr, \
"Usage: PythonWordCount <master> <file>"
exit(-1)
sc = SparkContext(sys.argv[1], "Pyt... | counts = lines.flatMap(lambda x: x.split(' ')) \
.map(lambda x: (x, 1)) \
.reduceByKey(add)
output = counts.collect() |
<|file_name|>font_template.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<|fim▁hole|>use platform::font::FontHandle;
use platform::font_template::FontTemplateData;
use sync::{Arc, Weak};
use f... | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use style::computed_values::font_weight;
use platform::font_context::FontContextHandle; |
<|file_name|>walruses.py<|end_file_name|><|fim▁begin|>import boto,sys,euca_admin
from boto.exception import EC2ResponseError
from euca_admin.generic import BooleanResponse
from euca_admin import EucaAdmin
from optparse import OptionParser
SERVICE_PATH = '/services/Configuration'
class Walrus():
def __init__(se... | return parser
|
<|file_name|>SystemParams.java<|end_file_name|><|fim▁begin|>package eg.utils;
import java.io.File;
import java.awt.Toolkit;
/**
* Static system properties
*/<|fim▁hole|> /**
* The Java version */
public static final String JAVA_VERSION;
/**
* True if the Java version is higher than 8, false otherwis... | public class SystemParams {
/**
* True if the OS is Windows, false otherwise */
public static final boolean IS_WINDOWS; |
<|file_name|>HybridVAControl.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
@file HybridVAControl.py
@author Craig Rafter
@date 19/08/2016
class for fixed time signal control
"""
import signalControl, readJunctionData, traci
from math import atan2, degrees, hypot
import numpy as np
from collections ... | self.newVehicleInfo = {} |
<|file_name|>ws_test.go<|end_file_name|><|fim▁begin|>// +build websocket
/*
* ws_test.go
*
* Copyright 2017 Bill Zissimopoulos
*/<|fim▁hole|> *
* It is licensed under the MIT license. The full license text can be found
* in the License.txt file at the root of this project.
*/
package netchan
import (
"net/ur... | /*
* This file is part of netchan. |
<|file_name|>Colors.java<|end_file_name|><|fim▁begin|>/* Copyright (c) 2015 Sai Jayanthi
This source file is licensed under the "MIT license".
Please see the file COPYING in this distribution for license terms.
*/
/*
This program provides the functionality to implement sound and swipe features for Colors activit... | }
} |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import Vue from 'vue';
import Router from 'vue-router';
import Home from '@/views/Home.vue';
import Sms from '@/views/SMS.vue';
import Services from '@/views/Services.vue';
import Settings from '@/views/Settings.vue';
import Wlan from '@/views/settings/wlan.vue';
impor... | {
path: '/',
redirect: { name: 'home' }, |
<|file_name|>O_RelaxEdge.java<|end_file_name|><|fim▁begin|>package operations;
import data.Collector;
import graph.implementation.Edge;
import utility.GraphFunctions;
/**
* Set the curve point to an ideal position.
* If source and destination are equal, it would be a line.
* If not, it is a noose on top of the ve... | @Override
public void setEdge(Edge edge) {
this.edge = edge; |
<|file_name|>0007_auto_20160118_0017.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import absolute_import
# Generated by Django 1.9 on 2016-01-18 00:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies =... | ]
operations = [
migrations.AddField( |
<|file_name|>gradients_test.py<|end_file_name|><|fim▁begin|>"""Tests for tensorflow.ops.gradients."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import warnings
import tensorflow.python.platform
import numpy as np
from tensorflow.python.framework imp... | return float_grad
ops.RegisterShape("TestOp")(None)
|
<|file_name|>BaseManagementService.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to You u... | |
<|file_name|>graph.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.... | |
<|file_name|>encryptionprotectors.go<|end_file_name|><|fim▁begin|>package sql
// 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 Lice... | "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
|
<|file_name|>interface.py<|end_file_name|><|fim▁begin|>from tkinter import *
import tkinter
import HoursParser
class UserInterface(tkinter.Frame):
def __init__(self, master):
self.master = master
self.events_list = []
# Set window size
master.minsize(width=800, height... | # Clear text box from previous event details
# if self.text_area.get(END) is not "\n":
|
<|file_name|>geomDecomp.H<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM... | |
<|file_name|>Rickshaw.Graph.Axis.Y.Scaled.js<|end_file_name|><|fim▁begin|>Rickshaw.namespace('Rickshaw.Graph.Axis.Y.Scaled');
Rickshaw.Graph.Axis.Y.Scaled = Rickshaw.Class.create( Rickshaw.Graph.Axis.Y, {
initialize: function($super, args) {
if (typeof(args.scale) === 'undefined') {
throw new Error('Scal... | |
<|file_name|>_azure_firewalls_operations.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
... | else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters) |
<|file_name|>config-dist.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# encoding: utf-8
'''
pvaurora configuration file
'''
LATITUDE = 42.6<|fim▁hole|><|fim▁end|> | LONGITUDE = 12.9
API_KEY = "api_key_value"
SYSTEM_ID = -1 |
<|file_name|>sun.py<|end_file_name|><|fim▁begin|>from random import random, randint
from PIL import Image, ImageDraw, ImageFont
import perlin
def draw_background(setup) :
canvas = setup['canvas']
image = Image.new('RGBA', canvas, tuple(setup['color']['back']))
background = Image.new('RGBA', canvas, (0,0,0,0))
dra... | |
<|file_name|>io.rs<|end_file_name|><|fim▁begin|>//
// imag - the personal information management suite for the commandline
// Copyright (C) 2015-2020 Matthias Beyer <mail@beyermatthias.de> and contributors
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser... | |
<|file_name|>mini_racer_extension.cc<|end_file_name|><|fim▁begin|>#include <stdio.h>
#include <ruby.h>
#include <ruby/thread.h>
#include <v8.h>
#include <libplatform/libplatform.h>
#include <ruby/encoding.h>
#include <pthread.h>
#include <unistd.h>
#include <mutex>
#include <math.h>
using namespace v8;
class ArrayBuf... | current_platform = platform::CreateDefaultPlatform();
V8::InitializePlatform(current_platform);
V8::Initialize(); |
<|file_name|>backports.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module contains backports to support older Python versions.
They contain the backported code originally developed for Python. It is
therefore distributed under the PSF license, as follows:
PYTHON SOFTWARE FOUNDATION LICENSE VERSI... |
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS |
<|file_name|>Question_168_Excel_Sheet_Column_Title.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# coding: utf-8
<|fim▁hole|> :rtype: str
"""
return "" if n == 0 else self.convertToTitle((n - 1) / 26) + chr((n - 1) % 26 + ord('A'))<|fim▁end|> | class Solution(object):
def convertToTitle(self, n):
"""
:type n: int |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for dj_bookmarks project.
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.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import g... | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dj_bookmarks.settings")
application = get_wsgi_application() |
<|file_name|>Gulpfile.js<|end_file_name|><|fim▁begin|>const
{series} = require("gulp"),<|fim▁hole|> replace_version = require("./gulp_modules/task-replace-version"),
make_pot = series(replace_version, require("./gulp_modules/task-pot")),
// pot = series(make_pot, require("./gulp_modules/task-clean-pot")),
pot = mak... | bump = require("./gulp_modules/task-bump"),
bump_minor = require("./gulp_modules/task-bump-minor"),
bump_major = require("./gulp_modules/task-bump-major"),
readme = require("./gulp_modules/task-readme"), |
<|file_name|>TestScript.py<|end_file_name|><|fim▁begin|># encoding= utf-8
##
# VisibilityCheck.
# <p>
# Description of the test.
#
# @data INSTANCE_ID [String] instance id
##
from qtaste import *
import time
# update in order to cope with the javaGUI extension declared in your testbed configuration.
javaguiMI = tes... |
def step1(): |
<|file_name|>soundcloud-search.server.model.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema;<|fim▁hole|>
/**
* SoundcloudSearch Schema
*/
var SoundcloudSearchSchema = new Schema({
// SoundcloudSearch model fields
// ...
... | |
<|file_name|>Stones.js<|end_file_name|><|fim▁begin|>import styled from 'styled-components';
import Stones from '../Stones';
const StyledStones = styled(Stones)`
display: inline-block;
width: 100%;
min-height: 30px;
div {
display: inline-block;
width: 20px;
height: 20px;
border: 1px solid #000... | } |
<|file_name|>parseit.py<|end_file_name|><|fim▁begin|># This file is part of Mylar.
#
# Mylar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | |
<|file_name|>pkgutil.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Alexander Winkler <mail () winkler-alexander.de>
# based on svr4pkg by
# Boyd Adamson <boyd () boydadamson.com> (2012)
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.tx... | msg = out |
<|file_name|>clusterinstance_binding.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2008-2015 Citrix Systems, 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... |
def _get_nitro_response(self, service, response) :
ur""" converts nitro response into object and returns the object array in case of get request.
""" |
<|file_name|>determineTestFilesToRun.js<|end_file_name|><|fim▁begin|>const determineTestFilesToRun = ({ inputFile, inputArgs = [], config }) => {<|fim▁hole|>
if (inputFile) {
filesToRun.push(inputFile);
} else if (inputArgs.length > 0) {
inputArgs.forEach(inputArg => filesToRun.push(inputArg));
}
if (f... | const path = require("path");
const fs = require("fs");
const glob = require("glob");
let filesToRun = []; |
<|file_name|>plot_raw_read_alignment.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Plot information needed file"""
########################################################################
# File: plot_raw_read_alignment.py
# executable: plot_raw_read_alignment.py
#
# Author: Andrew Bailey
# History: Created... |
handles.append(handle1) |
<|file_name|>UserService.py<|end_file_name|><|fim▁begin|>from datetime import datetime
import random
import string
from bson import ObjectId
class DuplicateUserException(Exception):
def __init__(self, message='User name/email already exits'):
Exception.__init__(self, message)
pass
class UserService... | |
<|file_name|>pytester.py<|end_file_name|><|fim▁begin|>""" (disabled by default) support for testing pytest and pytest plugins. """
from __future__ import absolute_import, division, print_function
import codecs
import gc
import os
import platform
import re
import subprocess
import sys
import time
import traceback
from ... | elif rep.skipped:
skipped.append(rep)
elif rep.failed:
failed.append(rep) |
<|file_name|>ExternalToolsCollectionView.js<|end_file_name|><|fim▁begin|>define('jst/ExternalTools/ExternalToolsCollectionView', ["compiled/handlebars_helpers"], function (Handlebars) {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['ExternalTools/Extern... | return "<table class=\"table table-striped\">\n <thead>\n <tr>\n <th>Name</th>\n <th>Extensions</th>\n <th> </th>\n </tr>\n </thead>\n <tbody class=\"collectionViewItems\"></tbody>\n</table>\n<div class=\"paginatedLoadingIndicator\" style=\"display: none\"></div>\n";});
|
<|file_name|>sign.rs<|end_file_name|><|fim▁begin|>use nodes;
use eval::array_helpers::{simple_monadic_array};
use eval::eval::{AplFloat, AplInteger, AplComplex, AplArray, Value, eval_monadic};
use eval::divide::divide;
use eval::magnitude::magnitude;
pub fn sign(first: &Value) -> Result<~Value, ~str> {
match firs... | |
<|file_name|>DinerMenu.java<|end_file_name|><|fim▁begin|>package com.arthurb.iterator.dinermergergery;
import java.util.Iterator;
/**
* Created by Blackwood on 07.03.2016 18:16.
*/
public class DinerMenu implements Menu {<|fim▁hole|>
public DinerMenu() {
menuItems = new MenuItem[MAX_ITEMS];
ad... | static final int MAX_ITEMS = 6;
int numberOfItems = 0;
MenuItem[] menuItems; |
<|file_name|>spatial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import division
from math import sqrt, floor, ceil, sin, cos, tan, radians, asin, acos, atan, atan2, degrees
import numpy as np
import copy
from .utils import array_from_function, almost_zero
from array_utils i... | |
<|file_name|>TableConversionsTest.ts<|end_file_name|><|fim▁begin|>import { Assert, UnitTest } from '@ephox/bedrock-client';
import { Optional, OptionalInstances } from '@ephox/katamari';
import { Css, Insert, Remove, SugarBody, SugarElement, Width } from '@ephox/sugar';
import * as TableConversions from 'ephox/snooker/... | [ '100%' ]
], SugarElement.fromHtml(pixelTable), false); |
<|file_name|>MyEmbeddedEventLoop.java<|end_file_name|><|fim▁begin|>package cz.znj.kvr.sw.exp.java.netty.netty;
/*
* Copyright 2012 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the Li... | throw new NullPointerException("command");
} |
<|file_name|>textAngular-sanitize.js<|end_file_name|><|fim▁begin|>/**
* @license AngularJS v1.3.10
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, angular, undefined) {'use strict';
var $sanitizeMinErr = angular.$$minErr('$sanitize');
/**
* @ngdoc module
* @name ngSanitize
... | /**
* decodes all entities into regular string
* @param value
* @returns {string} A string with decoded entities. |
<|file_name|>MeterReadingsList.java<|end_file_name|><|fim▁begin|>package nl.galesloot_ict.efjenergy.MeterReading;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.... | import java.util.ArrayList;
/** |
<|file_name|>interop.rs<|end_file_name|><|fim▁begin|>//! Defines functions that are exported to the JavaScript frontend, allowing access to the engine during runtime from the JS side.
use std::convert::TryInto;
use std::ffi::CStr;
use std::mem;
use std::slice;
use serde_json;
use super::*;
use libcomposition::compos... | emscripten_pause_main_loop(); |
<|file_name|>daemon_test.go<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: jouyouyun <jouyouwen717@gmail.com>
*
* 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
* ... | import (
"testing" |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>extern crate serde;
extern crate serde_json;
extern crate tera;
use std::io::prelude::*;
use std::fs::File;
use self::tera::Template;
#[derive(Debug)]
pub struct Product {
name: String,
manufacturer: String,
price: i32,<|fim▁hole|> #[allow(dead_code)]
... | summary: String
}
impl Product { |
<|file_name|>html_table_import.js<|end_file_name|><|fim▁begin|>var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : ty... | // loop through attributes and apply them on div
for (var i in attributes) { |
<|file_name|>vivopump.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
vivopump -- module of helper functions for the pump
"""
import sys
import csv
import string
import random
import logging
__author__ = "Michael Conlon"
__copyright__ = "Copyright (c) 2016 Michael Conlon"
__license__... | else:
outfile.write(item["short"]["value"][skip:-trim] + "\t" + item["vivo"]["value"] + "\n")
outfile.close() |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>##################################################################
# Copyright 2018 Open Source Geospatial Foundation and others #
# licensed under MIT, Please consult LICENSE.txt for details #
#################################################################... | self._handler,
identifier='ultimate_question',
title='Ultimate Question', |
<|file_name|>test_ValueIterationGS.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Sat Aug 24 15:08:01 2013
@author: steve
"""
import numpy as np
import mdptoolbox
from .utils import SMALLNUM, P_forest, R_forest, P_small, R_small, P_sparse
from .utils import P_forest_sparse, R_forest_sparse
... | |
<|file_name|>environ_settings.py<|end_file_name|><|fim▁begin|>import os
def get(var, default, type_=None):
"""Return a function to recover latest env variable contents."""
def _env_getter():
"""Recover the latest setting from the environment."""
val = os.environ.get(var, default)
if ty... |
ELASTICSEARCH_HOST = get('ELASTICSEARCH_HOST', 'localhost') |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | # -*- coding: utf-8 -*-
__author__ = 'Sergey Efimov' |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
import sys<|fim▁hole|>from distutils.sysconfig import get_python_lib
def fullsplit(path, result=None):
"""
Split a pathname into components (the opposite of os.path.join)
in a platform-neutral way.
"""
if result is None:
result =... |
from distutils.core import setup |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![allow(unused_variables)]
fn main() {
let v = vec![100, 32, 57];
// immutable iteration
for i in &v {<|fim▁hole|> println!("{}", i);
}
let mut v = vec![100, 32, 57];
// mutable iteration
for i in &mut v {
*i += 50;
}
for i in &v... | |
<|file_name|>classify.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/licens... | /*
Predicates on exprs and stmts that the pretty-printer and parser use
*/ |
<|file_name|>proxy.rs<|end_file_name|><|fim▁begin|>//! A proxy that forwards data to another server and forwards that server's
//! responses back to clients.
//!
//! You can showcase this by running this in one terminal:
//!
//! cargo run --example proxy
//!
//! This in another terminal
//!
//! cargo run --exam... | use tokio::reactor::Core; |
<|file_name|>prototype_nested_form.js<|end_file_name|><|fim▁begin|>document.observe('click', function(e, el) {
if (el = e.findElement('form a.add_nested_fields')) {
// Setup
var assoc = el.readAttribute('data-association'); // Name of child
var target = el.readAttribute('data-target');
var... | |
<|file_name|>epydocTagsMiddle.after.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | def foo(bar):
""" @param """ |
<|file_name|>StoreIndexedNode.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU Gen... | import com.oracle.graal.nodes.spi.*;
import com.oracle.graal.nodes.type.*; |
<|file_name|>delete.go<|end_file_name|><|fim▁begin|>// Copyright 2016 Tim Shannon. All rights reserved.
// Use of this source code is governed by the MIT license
// that can be found in the LICENSE file.
package bolthold
import (
"reflect"
"github.com/boltdb/bolt"
)
// Delete deletes a record from the bolthold, d... | return err
} |
<|file_name|>file.py<|end_file_name|><|fim▁begin|># #######
# Copyright (c) 2016-2020 Cloudify Platform Ltd. 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
#
# htt... | storage_account,
share_name)
utils.runtime_properties_cleanup(ctx)
except CloudError as cr: |
<|file_name|>globals.js<|end_file_name|><|fim▁begin|>// Based on https://github.com/chrisvfritz/vue-enterprise-boilerplate/blob/master/src/components/_globals.js
// Globally register all base components for convenience, because they
// will be used very frequently. Components are registered using the
// PascalCased ver... | .replace(/^\.\/_/, '')
// Remove the file extension from the end |
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>// Generated on 2015-03-17 using generator-angular 0.11.1
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
modul... | dist: {
html: ['<%= yeoman.dist %>/*.html'] |
<|file_name|>dyn_trait.rs<|end_file_name|><|fim▁begin|>#![feature(dyn_trait)]
fn main() {
// #2506
// checks rustfmt doesn't remove dyn
trait MyTrait {
fn method(&self) -> u64;
}
fn f1(a: Box<dyn MyTrait>) {}
// checks if line wrap works correctly
trait Very_______________________L... |
fn f2(a: Box<dyn Very_______________________Long__________________Name____________________Trait+ 'static,>) {} |
<|file_name|>rule.py<|end_file_name|><|fim▁begin|># Copyright 2015 Rafe Kaplan
#
# 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 req... | # See the License for the specific language governing permissions and |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.