prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>json_bench_test.go<|end_file_name|><|fim▁begin|>/*
* 说明:
* 作者:zhe
* 时间:2018-09-02 3:27 PM
* 更新:
*/
package json_iterator
import "testing"
var data []byte
func BenchmarkNode_String(b *testing.B) {
n := Node{
Name: "root",
Value: 1,
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
data = []by... | |
<|file_name|>jira_software_create_latest_deb.go<|end_file_name|><|fim▁begin|>package main
import (
"flag"
"fmt"
"runtime"
"github.com/bborbe/atlassian_utils/jira_software"
atlassian_utils_latest_information "github.com/bborbe/atlassian_utils/latest_information"
atlassian_utils_latest_tar_gz_url "github.com/bbor... |
err := do(
latestDebianPackageCreator.CreateLatestDebianPackage, |
<|file_name|>mman.rs<|end_file_name|><|fim▁begin|>//! Memory management declarations.
use crate::Result;
#[cfg(not(target_os = "android"))]
use crate::NixPath;
use crate::errno::Errno;
#[cfg(not(target_os = "android"))]
#[cfg(feature = "fs")]
use crate::{fcntl::OFlag, sys::stat::Mode};
use libc::{self, c_int, c_void, ... | MAP_HUGE_2GB; |
<|file_name|>brokerlib.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 Apach... | def on_disconnected(self, event):
self.broker.notice("Disconnected from {0}", event.connection) |
<|file_name|>schemes.rs<|end_file_name|><|fim▁begin|>use valico::json_schema;
use typemap;
use super::super::framework;
<|fim▁hole|>pub struct SchemesScope;
impl typemap::Key for SchemesScope {
type Value = json_schema::Scope;
}
fn build_schemes(handlers: &mut framework::ApiHandlers, scope: &mut json_schema::Sco... | |
<|file_name|>results.py<|end_file_name|><|fim▁begin|>import easygui_qt as easy
import pandas as pd
import numpy as np
import geoplot
from matplotlib import pyplot as plt
import math
from matplotlib.colors import LinearSegmentedColormap
MTH = {'sum': np.sum, 'max': np.max, 'min': np.min, 'mean': np.mean}
class Spatia... | (3, 16, 47, 56))
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User<|fim▁hole|>
class Post(models.Model):
title = models.CharField(max_length=255)
body = models.TextField()
user = models.ForeignKey(User)<|fim▁end|> | |
<|file_name|>MapFull.js<|end_file_name|><|fim▁begin|>import React, {Component} from 'react';
import {connect} from 'react-redux';
class MapFull extends Component {
constructor() {
super();
this.state = {
htmlContent: null
};
}
componentDidMount() {
this.getMapHtml();
}<|fim▁hole|> i... |
componentDidUpdate(prevProps, prevState) { |
<|file_name|>inventory.cpp<|end_file_name|><|fim▁begin|>/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redis... | if (currentValue > 150) {
valueDelta >>= 1;
} |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2021 Google LLC
#
# 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/LICENS... | |
<|file_name|>io.py<|end_file_name|><|fim▁begin|>"""Microscoper is a wrapper around bioformats using a forked
python-bioformats to extract the raw images from Olympus IX83
CellSense .vsi format, into a more commonly used TIFF format.
Images are bundled together according to their channels.
This code is used internally... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate libc;
use libc::*;
#[link(name = "genrl_kernels", kind = "static")]<|fim▁hole|> x: *const f32,
y: *mut f32,
);
pub fn genrl_volatile_average_f32(
n: size_t,
alpha: f32,
x: *const f32,
y: *mut f32,
);
}<|fim▁end|> | extern "C" {
pub fn genrl_volatile_add_f32(
n: size_t, |
<|file_name|>clean_data_for_academic_analysis.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# This file is part of OpenHatch.
# Copyright (C) 2010 OpenHatch, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
#... |
import mysite.profile.models
import django.contrib.auth.models
|
<|file_name|>true_primitives.py<|end_file_name|><|fim▁begin|>from som.interp_type import is_ast_interpreter
from som.primitives.primitives import Primitives
from som.vm.globals import trueObject, falseObject, nilObject
from som.vmobjects.primitive import UnaryPrimitive, BinaryPrimitive, TernaryPrimitive
if is_ast_inte... | return true_block
|
<|file_name|>distinfo.py<|end_file_name|><|fim▁begin|># This library 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 Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This li... | from unittest import TestCase |
<|file_name|>FtpResponse.java<|end_file_name|><|fim▁begin|>package org.matmaul.freeboxos.ftp;<|fim▁hole|>public class FtpResponse {
public static class FtpConfigResponse extends Response<FtpConfig> {}
}<|fim▁end|> |
import org.matmaul.freeboxos.internal.Response;
|
<|file_name|>nondefaultNamespaces-05.js<|end_file_name|><|fim▁begin|>var assert = require('assert')<|fim▁hole|> , feed = __dirname + '/feeds/unknown-namespace.atom'
, meta = {}
, articles = {}
;
describe('feedparser', function(){
describe('nondefaultnamespace Test case 3: default namespace Atom; XHTML namespa... | , FeedParser = require('../')
, feedparser = new FeedParser() |
<|file_name|>bitcoin_sv.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="sv" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About bitconnect</source>
<translation>Vad du behöver... | |
<|file_name|>configs.go<|end_file_name|><|fim▁begin|>// ./docker/api/types/configs.go //peter
package types
import "github.com/docker/docker/api/types/container"
// configs holds structs used for internal communication between the
// frontend (such as an http server) and the backend (such as the
// docker daemon).... | type ExecConfig struct {
User string // User that will run the command
Privileged bool // Is the container in privileged mode |
<|file_name|>IteratorPageDownstreamTest.java<|end_file_name|><|fim▁begin|>/*
* Licensed to Crate.IO GmbH ("Crate") under one or more contributor
* license agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership. Crate licenses
* this file to you under ... | @Override
public void needMore() {
rowReceiver.finish();
} |
<|file_name|>MinimalTuringMachineTest.java<|end_file_name|><|fim▁begin|>package dk.itu.ejuuragr.tests;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import com.anji.util.Properties;
import dk.itu.ejuuragr.turing.MinimalTuringMachine;
public class MinimalTuringMachineTest {
MinimalTuring... |
lastRoundRead = act(d + lastRoundRead[0],s + b + lastRoundRead[1], 1-b, b, 0, b ,1-b);
double roundResult = lastRoundRead[0]; |
<|file_name|>basereferenceintegrationtest.py<|end_file_name|><|fim▁begin|>'''
Created on 01.12.2016
@author: michael
'''
from alex_test_utils import MODE_SIMPLE
from alexandriabase import baseinjectorkeys
from alexandriabase.domain import Event, AlexDateRange, AlexDate, Document, \
DocumentType
from alexpresenters... | from integration.baseintegrationtest import BaseIntegrationTest |
<|file_name|>test_20x4.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
import sys
from RPLCD_i2c import CharLCD
from RPLCD_i2c import Alignment, CursorMode, ShiftMode
from RPLCD_i2c import cursor, cleared
... | lcd.write_string('Hello world!')
input('"Hello world!" should be on the LCD. ')
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from tilequeue.query.fixture import make_fixture_data_fetcher
from tilequeue.query.pool import DBConnectionPool
from tilequeue.query.postgres import make_db_data_fetcher
from tilequeue.query.rawr import make_rawr_data_fetcher
from tilequeue.query.split import make_s... | def __call__(self, tile):
# returns a "tables" object, which responds to __call__(table_name) |
<|file_name|>any.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licens... | |
<|file_name|>BasicGroup.java<|end_file_name|><|fim▁begin|>package com.github.kolandroid.kol.model.elements.basic;
import com.github.kolandroid.kol.model.elements.interfaces.ModelGroup;
import java.util.ArrayList;
import java.util.Iterator;
public class BasicGroup<E> implements ModelGroup<E> {
/**
* Autogene... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import politube.views
urlpatterns = patterns('',
url(r'^$', politube.views.home, name='home'),
url(r'... | # Uncomment the admin/doc line below to enable admin documentation:
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin: |
<|file_name|>checked_count_ones.rs<|end_file_name|><|fim▁begin|>use integer::Integer;
use malachite_base::num::logic::traits::CountOnes;
impl Integer {
/// Counts the number of ones in the binary expansion of an `Integer`. If the `Integer` is
/// negative, the number of ones is infinite, so `None` is returned.... | ///
/// Additional memory: worst case O(1)
/// |
<|file_name|>lldpparam.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.apache.org/li... | try : |
<|file_name|>direct.go<|end_file_name|><|fim▁begin|>package ray
import (
"github.com/v2ray/v2ray-core/common/alloc"
)
const (
bufferSize = 16
)
// NewRay creates a new Ray for direct traffic transport.
func NewRay() Ray {
return &directRay{
Input: make(chan *alloc.Buffer, bufferSize),
Output: make(chan *allo... | Output chan *alloc.Buffer |
<|file_name|>EnterKey.js<|end_file_name|><|fim▁begin|>module("tinymce.EnterKey", {
setupModule: function() {
QUnit.stop();
tinymce.init({
selector: "textarea",
plugins: wpPlugins,
add_unload_trigger: false,
disable_nodechange: true,
indent: false,
skin: false,
entities: 'raw',
schema: 'htm... | |
<|file_name|>history_tags.py<|end_file_name|><|fim▁begin|>import six
from django import template
from oscar.core.loading import get_model
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import resolve, Resolver404
from oscar.apps.customer import history
from oscar.core.compat impo... | |
<|file_name|>TestConfigProcessor.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2005-2008 The Kuali Foundation
*
*
* Licensed under the Educational Community 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|>invalid.rs<|end_file_name|><|fim▁begin|>//extern crate test;
extern crate caliburn;
use self::caliburn::rfc2812;
use self::caliburn::rfc2812_types;
#[test]
#[should_panic(expected = "assertion failed: `(left == right)`")]
fn localhost_is_not_user() {
let testcase = rfc2812_types::Message {
... | }
|
<|file_name|>LockFactory.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2010-2014. Axon Framework
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/li... | /** |
<|file_name|>AgentCLITest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017 ThoughtWorks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/license... |
@Test
public void shouldPassIfCorrectArgumentsAreProvided() throws Exception { |
<|file_name|>specialization_marker.rs<|end_file_name|><|fim▁begin|>// Test that `rustc_unsafe_specialization_marker` is only allowed on marker traits.
#![feature(rustc_attrs)]
#[rustc_unsafe_specialization_marker]
trait SpecMarker {
fn f();
//~^ ERROR marker traits
}
#[rustc_unsafe_specialization_marker]
tra... | |
<|file_name|>cpu_stats.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# test libvirt cpu stats
import libvirt
from libvirt import libvirtError
from src import sharedmod
from utils import utils
required_params = ('cpuNum',)<|fim▁hole|>
STATFILE = "/proc/stat"
GETCPUSTAT = "cat /proc/stat | grep cpu%s"
USR_POS ... | optional_params = {'conn': '', } |
<|file_name|>static.py<|end_file_name|><|fim▁begin|>python manage.py collectstatic<|fim▁hole|> (r'^static/suit/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.DJANGO_SUIT_TEMPLATE}),
)
urlpatterns += patterns('',
(r'^static/admin/(?P<path>.*)$', 'django.views.static.serve', {'document_roo... |
python manage.py runserver --nostatic
urlpatterns += patterns('', |
<|file_name|>session.py<|end_file_name|><|fim▁begin|>__author__ = 'dako'
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_elemen... | wd = self.app.wd
if self.is_logged_in(): |
<|file_name|>issue-45296.rs<|end_file_name|><|fim▁begin|>fn main() {
let unused = ();<|fim▁hole|>
#![allow(unused_variables)] //~ ERROR not permitted in this context
fn foo() {}
}<|fim▁end|> | |
<|file_name|>HomeServlet.java<|end_file_name|><|fim▁begin|>package web;
import entities.User;
import services.UserService;
import javax.inject.Inject;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;... | " <title>Title</title>\n" +
" </head>\n" +
" <body>\n" + |
<|file_name|>overrides.spec.ts<|end_file_name|><|fim▁begin|>import Configuration = require('../../../lib/Configuration');
import overrides = require('../../../lib/overrides/all');
import Rule = require('../../../lib/Rule');
import s = require('../../../lib/helpers/string');
import sinonChai = require('../../sinon-chai... | }); |
<|file_name|>City.java<|end_file_name|><|fim▁begin|>package com.errorplayer.lala_weather.db;
import org.litepal.crud.DataSupport;
/**
* Created by linze on 2017/7/7.
*/
public class City extends DataSupport {
private int id;
private String cityName;
private int cityCode;
private int provinceId;... | |
<|file_name|>point.rs<|end_file_name|><|fim▁begin|>use super::{Vector3D, AsVector, Direction3D};
#[derive(PartialEq, PartialOrd, Clone, Debug)]
pub struct Point3D {
pub x: f32,
pub y: f32,
pub z: f32
}
static POINT3D_ORIGIN: Point3D = Point3D {
x: 0.0, <|fim▁hole|>impl Point3D {
pub fn from_xyz(x:... | y: 0.0,
z: 0.0
};
|
<|file_name|>RestPathConstants.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2013 the original author or authors.<|fim▁hole|> * You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed unde... | * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. |
<|file_name|>test_reporter.py<|end_file_name|><|fim▁begin|>##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2017 Stanford University and the Authors
#
# Authors: Rob... | from simtk.openmm import LangevinIntegrator, Platform
from simtk.openmm.app import PDBFile, ForceField, Simulation, CutoffNonPeriodic, CutoffPeriodic, HBonds |
<|file_name|>archivo.py<|end_file_name|><|fim▁begin|>import urllib2
def sumaDos():
print 10*20
def division(a,b):
result=a/b
print result
def areatriangulo(base,altura):
result2=(base*altura)/2
print result2
def cast():
lista=[1,2,3,"hola"]
tupla=(1,2,3)
diccinario={"key1":"Diego","k... | try:
web=urllib2.urlopen("http://itjiquilpan.edu.mx/")
print web.read() |
<|file_name|>html.py<|end_file_name|><|fim▁begin|>"""
Configuration parameters:
path.internal.ansi2html
"""
import sys
import os
import re
from subprocess import Popen, PIPE
MYDIR = os.path.abspath(os.path.join(__file__, '..', '..'))
sys.path.append("%s/lib/" % MYDIR)
# pylint: disable=wrong-import-position
fr... | "unknown" : '',
}
def visualize(answer_data, request_options): |
<|file_name|>test_prepared_statements.py<|end_file_name|><|fim▁begin|># Copyright 2013-2015 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/L... | def test_missing_primary_key_dicts(self): |
<|file_name|>SOCRejectConnection.java<|end_file_name|><|fim▁begin|>/**
* Java Settlers - An online multiplayer version of the game Settlers of Catan
* Copyright (C) 2003 Robert S. Thomas <thomas@infolab.northwestern.edu>
* Portions of this file Copyright (C) 2014,2017,2020 Jeremy D Monin <jeremy@nand.net>
*
* Thi... | */
private String text; |
<|file_name|>abi.rs<|end_file_name|><|fim▁begin|>//! ARM 64 ABI implementation.
use ir;<|fim▁hole|>use regalloc::AllocatableSet;
use settings as shared_settings;
use super::registers::{GPR, FPR};
/// Legalize `sig`.
pub fn legalize_signature(
_sig: &mut ir::Signature,
_flags: &shared_settings::Flags,
_cur... | use isa::RegClass; |
<|file_name|>refcount.rs<|end_file_name|><|fim▁begin|>#pragma version(1)<|fim▁hole|>#pragma rs java_package_name(foo)
rs_font globalAlloc;
rs_font globalAlloc2;
static void foo() {
rs_font fontUninit;
rs_font fontArr[10];
fontUninit = globalAlloc;
for (int i = 0; i < 10; i++) {
fontArr[i] = g... | |
<|file_name|>protocol.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/. */
//! Low-level wire protocol implementation. Currently only s... | //! [JSON packets] |
<|file_name|>selector_matching.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 url::Url;
use selectors::bloom::BloomFilter;
u... | self.rules_source_order = 0;
for stylesheet in self.stylesheets.iter() { |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-06 21:26
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import taggit.managers
class Migration(... | ],
options={
'verbose_name': 'Resposta', |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import datetime
from flask.ext.bcrypt import generate_password_hash
from flask.ext.login import UserMixin
from peewee import *
DATABASE = SqliteDatabase(':memory:')
class User(Model):
email = CharField(unique=True)
password = CharField(max_lengt... |
def initialize():
DATABASE.connect()
|
<|file_name|>confirmation.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2013-2014 Didotech SRL (info at didotech.com)
# All Rights Reserved.
#
# WARNING: This program as such is intended... | # This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License |
<|file_name|>SearchContainer.js<|end_file_name|><|fim▁begin|>import React from 'react';
import { Icon } from 'design-react-kit';
import { createUseStyles } from 'react-jss';
import { SearchProvider } from '../../contexts/searchContext.js';
import { ALL_SITE } from '../../utils/constants.js';
import { useModal } from '.... | <SearchModal onClose={closeModal} />
</SearchProvider>
)}
</> |
<|file_name|>PoolTest.py<|end_file_name|><|fim▁begin|>from multiprocessing import Pool
import os, time, random
def long_time_task(name):
print 'Run task %s (%s)...' % (name, os.getpid())
start = time.time()
time.sleep(random.random() * 3)
end = time.time()<|fim▁hole|>if __name__ == '__main__':
pr... | print 'Task %s runs %0.2f seconds.' % (name, (end - start))
|
<|file_name|>random.rs<|end_file_name|><|fim▁begin|>use rand::{<|fim▁hole|> prelude::{Rng, SeedableRng, StdRng},
};
const OPERATORS: &[char] = &[
'+', '-', '<', '>', '(', ')', '*', '/', '&', '|', '!', ',', '.',
];
pub struct Rand(StdRng);
impl Rand {
pub fn new(seed: usize) -> Self {
Rand(StdRng::... | distributions::Alphanumeric, |
<|file_name|>offset.py<|end_file_name|><|fim▁begin|>#
# ida_kernelcache/offset.py
# Brandon Azad
#
# Functions for converting and symbolicating offsets.
#
import re
import idc
import idautils
import ida_utilities as idau
import internal
import kernel
import stub
_log = idau.make_log(1, __name__)
def initialize_dat... | # This is not a previously named offset.
if idau.is_mapped(offset, value=False):
_process_offset(offset, ea, next_offset) |
<|file_name|>images.js<|end_file_name|><|fim▁begin|>import config from '../config';
import changed from 'gulp-changed';
import gulp from 'gulp';
import gulpif from 'gulp-if';
import imagemin from 'gulp-imagemin';
import browserSync from 'browser-sync';
function images(src, dest) {
return gu... |
gulp.task('modulesImages', function() { |
<|file_name|>full-screen.src.js<|end_file_name|><|fim▁begin|>/**
* @license Highstock JS v9.0.0 (2021-02-02)
* @module highcharts/modules/full-screen
* @requires highcharts
*<|fim▁hole|> * (c) 2010-2019 Highsoft AS
* Author: Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
import '../../E... | * Advanced Highstock tools
* |
<|file_name|>token.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2014 ikawaha.
// 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 ... | // String returns a string representation of a token.
func (t Token) String() string {
return fmt.Sprintf("%v(%v, %v)%v[%v]", t.Surface, t.Start, t.End, t.Class, t.Id) |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>import os
from datetime import timedelta
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
###########################################################################
# [ Application ]
####################################################... | |
<|file_name|>PluginDisconnectEvent.java<|end_file_name|><|fim▁begin|>package org.monstercraft.irc.ircplugin.event.events;
import java.util.EventListener;
import org.monstercraft.irc.ircplugin.event.EventMulticaster;
import org.monstercraft.irc.ircplugin.event.listeners.IRCListener;
import org.monstercraft.irc.plugin.... |
public class PluginDisconnectEvent extends IRCEvent {
private static final long serialVersionUID = 8708860642802706979L; |
<|file_name|>ConsumerGroupsListByEventHubSamples.java<|end_file_name|><|fim▁begin|>// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.eventhubs.generated;
import com.azure.core.ut... | } |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
@login_required(login_url='/accounts/login/')
def home(request):
return render(request, "base/index.html", {})<|fim▁hole|> return render(reques... |
def home_files(request, filename): |
<|file_name|>route.go<|end_file_name|><|fim▁begin|>package network
import (
"fmt"
"sort"
"syscall"
"time"
log "github.com/sirupsen/logrus"
"github.com/kelda/kelda/counter"
"github.com/kelda/kelda/db"
"github.com/kelda/kelda/minion/ipdef"
"github.com/kelda/kelda/minion/nl"
"github.com/kelda/kelda/util"
)
v... | |
<|file_name|>cluster.py<|end_file_name|><|fim▁begin|>#
# 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 required by applicable law o... | |
<|file_name|>test5.py<|end_file_name|><|fim▁begin|>__author__ = 'phoetrymaster'
import subprocess
nodatain = -3000
nodataout = -3000
inputshape = "'/Users/phoetrymaster/Documents/School/Geography/Thesis/Data/DepartmentSelection/ARG_adm/pellegrini.shp'"<|fim▁hole|>
#Need to reproject input shapefile to outprj before... | inputimg = "'/Users/phoetrymaster/Documents/School/Geography/Thesis/Data/MODIS 7_2012-2013/argentina_1/test.tif'"
outputimg = "'/Users/phoetrymaster/Documents/School/Geography/Thesis/Data/MODIS 7_2012-2013/argentina_1/MODIS_pellegrini_clip.tif'"
outprj = "'+proj=utm +zone=20 +datum=WGS84'"
outformat = "ENVI" |
<|file_name|>storage-rpc-client.go<|end_file_name|><|fim▁begin|>/*
* Minio Cloud Storage, (C) 2016 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | switch err.Error() { |
<|file_name|>surfaceGenerator.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|>from math import sqrt
import numpy as np
from random import randint
# .............................................................................
class SurfaceGenerator(object):
"""
@summary: This class is used to generate a surface t... | @summary: This script will generate a surface using cones and ellipsoids
@author: CJ Grady
""" |
<|file_name|>lower_bound.hpp<|end_file_name|><|fim▁begin|>#ifndef BOOST_MPL_LOWER_BOUND_HPP_INCLUDED
#define BOOST_MPL_LOWER_BOUND_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2001-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.b... | Distance
, lower_bound_step_impl<Distance,Predicate,T,DeferredIterator>
, DeferredIterator |
<|file_name|>addBrand-modal.component.js<|end_file_name|><|fim▁begin|>(function(angular) {
'use strict';
//-----------------------------Controller Start------------------------------------
function AddBrandModalController($state, $http) {
var ctrl = this;
ctrl.init = function() {
... |
ctrl.cancel = function() {
ctrl.modalInstance.close(); |
<|file_name|>ConfigurationStateController.java<|end_file_name|><|fim▁begin|>package org.apereo.cas.web.report;
import org.apereo.cas.web.report.util.ControllerUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.endpoint.mvc.AbstractNamedMvcEndpoint;
import org.... | import org.springframework.web.servlet.ModelAndView; |
<|file_name|>clicontext.go<|end_file_name|><|fim▁begin|>package app
import (
"time"
"github.com/urfave/cli"
)
type innerContext interface {
Args() cli.Args
Bool(name string) bool
BoolT(name string) bool
Duration(name string) time.Duration
FlagNames() (names []string)
Float64(name string) float64
Generic(nam... | return ctx.Context.Command
} |
<|file_name|>euproperties.py<|end_file_name|><|fim▁begin|># Software License Agreement (BSD License)
#
# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the follow... | |
<|file_name|>note.cpp<|end_file_name|><|fim▁begin|>/*******************************************************************
Part of the Fritzing project - http://fritzing.org
Copyright (c) 2007-2014 Fachhochschule Potsdam - http://fh-potsdam.de
Fritzing is free software: you can redistribute it and/or modify
it under the... | if (viewGeometry.rect().width() == 0 || viewGeometry.rect().height() == 0) { |
<|file_name|>users.js<|end_file_name|><|fim▁begin|>// © 2000 NEOSYS Software Ltd. All Rights Reserved.//**Start Encode**
function form_postinit() {
//enable/disable password changing button
neosyssetexpression('button_password', 'disabled', '!gusers_authorisation_update&&gkey!=gusername')
//force ... | if (signatureimageelement) {
|
<|file_name|>user.js<|end_file_name|><|fim▁begin|>var mongoose = require('mongoose');
var bcrypt = require('bcrypt');
var saltRounds = 10;
var userSchema = new mongoose.Schema({
email: {
type: String,
index: {unique: true}
},
password: String,
name: String
});<|fim▁hole|>}
userSchema.methods.validPassword = f... |
//hash password
userSchema.methods.generateHash = function(password){
return bcrypt.hashSync(password, bcrypt.genSaltSync(saltRounds)); |
<|file_name|>build.server.prod.ts<|end_file_name|><|fim▁begin|>import * as gulp from 'gulp';
import * as gulpLoadPlugins from 'gulp-load-plugins';
import * as merge from 'merge-stream';
import { join/*, sep, relative*/ } from 'path';
import Config from '../../config';
import { makeTsProject, TemplateLocalsBuilder } fr... | const plugins = <any>gulpLoadPlugins();
|
<|file_name|>uart.rs<|end_file_name|><|fim▁begin|>use Core;
use Addon;
use io;
pub struct Uart
{
/// The baud rate (bits/second)
pub baud: u64,
/// The number of CPU ticks in a single second (ticks/second)
pub cpu_frequency: u64,
/// Number of ticks between each bit.
ticks_between_bits: u64,
... | let ticks_between_bits = cpu_frequency / baud; |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var Action = require('./../actions/action.create.js');
var RouteConfig = require('./route.create.config');<|fim▁hole|><|fim▁end|> | var RouteCreate = require('./route.default.js')(Action, RouteConfig); |
<|file_name|>chmod.rs<|end_file_name|><|fim▁begin|>#![crate_name = "uu_chmod"]
/*
* This file is part of the uutils coreutils package.
*
* (c) Arcterus <arcterus@mail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
extern cr... | let recursive = matches.opt_present("recursive");
let fmode = matches.opt_str("reference").and_then(|fref| {
let s = CString::new(fref).unwrap_or_else( |_| {
crash!(1, "reference file name contains internal nul byte") |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>"""
Generalized Linear models.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Vincent Michel <vincent.michel@inria.fr>
# Peter P... | L1-regularizing estimators should inherit this.
"""
|
<|file_name|>args.rs<|end_file_name|><|fim▁begin|>pub const USAGE: &'static str = "
Usage: jswag build [options] [<file>...]
jswag run [options] [<file>...]
jswag [options] <file>...
jswag raw [<file>...]
jswag (--help | --version)
Commands:
build Compiles all files and runs simpl... | pub flag_verbose: bool, |
<|file_name|>zapwallettxes.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the zapwallettxes functionality.
- sta... |
# Stop node0 and restart with zapwallettxes and persistmempool. The unconfirmed
# transaction is zapped from the wallet, but is re-added when the mempool is reloaded.
self.stop_node(0) |
<|file_name|>PropertiesToolBar.java<|end_file_name|><|fim▁begin|>/*
* PropertiesToolBar.java
*
* Copyright (C) 2002-2017 Takis Diakoumis
*
* 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; ... | }
} // class NameCellRenderer |
<|file_name|>rc_buffer_arc.rs<|end_file_name|><|fim▁begin|>#![warn(clippy::rc_buffer)]
use std::ffi::OsString;
use std::path::PathBuf;<|fim▁hole|>use std::sync::{Arc, Mutex};
struct S {
// triggers lint
bad1: Arc<String>,
bad2: Arc<PathBuf>,
bad3: Arc<Vec<u8>>,
bad4: Arc<OsString>,
// does not... | |
<|file_name|>test_routing.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from nose.tools import raises, eq_, ok_
from werkzeug.test import Client
from werkzeug.wrappers import BaseResponse
from clastic import Application, render_basic
from clastic.application import B... | yield eq_, client.get('/api/a/b').data, 'api: a/b'
|
<|file_name|>test_docker.py<|end_file_name|><|fim▁begin|>import unittest
import json
import time
from celery import current_app
from django.conf import settings
from django.utils import timezone
from ep.models import DPMeasurements, DeviceParameter
from ep.tasks import send_msg
from django.test import TestCase, mod... | |
<|file_name|>jquery.fastconfirm.js<|end_file_name|><|fim▁begin|>/*
* jQuery Fast Confirm
* version: 2.1.1 (2011-03-23)
* @requires jQuery v1.3.2 or later
*
* Examples and documentation at: http://blog.pierrejeanparra.com/jquery-plugins/fast-confirm/
* Dual licensed under the MIT and GPL licenses:
* http://www.... | confirmBoxArrowBorderClass = params.fastConfirmClass + '_top';
$arrow.addClass(confirmBoxArrowClass).css('left', $confirmBox.outerWidth() / 2 - $arrow.outerWidth() / 2);
$arrowBorder.addClass(confirmBoxArrowBorderClass).css('left', $confirmBox.outerWidth() / 2 - $arrowBorder.outerWi... |
<|file_name|>0002_post_user.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-01-05 03:11
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
... | name='user', |
<|file_name|>traversal.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! Traversing the DOM tree; the bloom filter.
use context... | if traversal_flags.for_animation_only() {
return data.map_or(false, |d| d.has_styles()) &&
(el.has_animation_only_dirty_descendants() ||
data.as_ref().unwrap().restyle.hint.has_animation_hint_or_recascade()); |
<|file_name|>morestack-address.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.
//<|fim▁hole|>// option. This file may not be copied, modified, or distributed
// except accor... | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
<|file_name|>family_tree_controller.js<|end_file_name|><|fim▁begin|>module.exports = function(app) {
app.controller('FamilyTreeController', ['$scope', 'leafletData', '$http',
function($scope, leafletData, $http) {
var mapQuestKey = 'qszwthBye44A571jhqvCn4AWhTsEILRT';
// required for cypher parser
... | |
<|file_name|>bydpconfigure.cpp<|end_file_name|><|fim▁begin|>#include "bydpconfigure.h"
#include <Button.h>
#include <StringView.h>
#include <SpLocaleApp.h>
#include "globals.h"
const uint32 BUTTON_OK = 'BuOK';
const uint32 BUTTON_CANCEL = 'BuCA';
const uint32 CCOLOR_MSG = 'ColM';
const uint32 SLIDER = 'Slid';
by... | // printf("update config in dialog\n");
if (myColour > -1) {
// printf("update colour %i\n",myColour); |
<|file_name|>ConfirmRequestWriterV20.java<|end_file_name|><|fim▁begin|>/***************************** BEGIN LICENSE BLOCK ***************************
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You... | /**
* KVP Request
*/
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.