prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>read_pages.py<|end_file_name|><|fim▁begin|>import re, csv
header_end = re.compile("\s+START\s+END\s+")
## p. 1172 is missing a space between the final date and the description. Can't understand why the layout option does this; a space is clearly visible. I dunno.
five_data_re = re.compile("\s*([\w\d]+)\... | |
<|file_name|>groups.js<|end_file_name|><|fim▁begin|>if (typeof com == "undefined") {
var com = {};
}
com.sppad = com.sppad || {};
com.sppad.booky = com.sppad.booky || {};
com.sppad.booky.Groups = new function() {
var self = this;
this.bookmarkInfoMap = new com.sppad.collections.Map();
this.groupIdMa... | if(launcher) {
launcher.setBookmarks(com.sppad.booky.Bookmarks.getBookmarks(parentId));
launcher.updateAttributes();
} |
<|file_name|>ClassManager.js<|end_file_name|><|fim▁begin|>/**
* @class Ext.ClassManager
*
* @author Jacky Nguyen <jacky@sencha.com>
* @aside guide class_system
* @aside video class-system
*
* Ext.ClassManager manages all classes and handles mapping from string class name to
* actual class objects throughout th... | |
<|file_name|>schedulers.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Schedulers determine how worker's queues get filled. They control which
locations get scanned, in what order, at what time. This allows further
optimizations to be easily added, without having to modify the existing
o... |
# This will pull the last few steps back to the front of the list,
# so you get a "center nugget" at the beginning of the scan, instead
# of the entire nothern area before the scan spots 70m to the south. |
<|file_name|>config_test.go<|end_file_name|><|fim▁begin|>package sessions
import (
"net/http"
"reflect"
"testing"
"time"
)
func TestConfigDoesNotChangeGivenBlankValues(t *testing.T) {
c := testConfig()
exp := testConfig()
c.Update(&SessionTrackingConfiguration{})
tt := []struct {
name string
expected ... | |
<|file_name|>security_examples.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate log;
extern crate env_logger;
extern crate serde_json;
extern crate rwinstructs;
use rwinstructs::security;
use std::io::Cursor;
fn ace_example_01() {
let buffer: &[u8] = &[
0x00,0x13,0x24,0x00,0x3F,0x00,0x0F,0x00,0x01... | |
<|file_name|>uas-answer-183-without-to-tag.py<|end_file_name|><|fim▁begin|># $Id$
#
import inc_const as const
PJSUA = ["--null-audio --max-calls=1 --no-tcp $SIPP_URI"]<|fim▁hole|><|fim▁end|> |
PJSUA_EXPECTS = [[0, "Audio updated", ""]] |
<|file_name|>test_logging.py<|end_file_name|><|fim▁begin|>"""Basic tests for the CherryPy core: request handling."""
from cherrypy.test import test
test.prefer_parent_path()
import os
localDir = os.path.dirname(__file__)
import cherrypy
access_log = os.path.join(localDir, "access.log")
error_log = os.pat... |
def testTracebacks(self):
# Test that tracebacks get written to the error log.
|
<|file_name|>GetTransaction.java<|end_file_name|><|fim▁begin|>package nxt.http;
import nxt.Nxt;
import nxt.Transaction;
import nxt.util.Convert;
import org.json.simple.JSONObject;
import org.json.simple.JSONStreamAware;
import javax.servlet.http.HttpServletRequest;
import static nxt.http.JSONResponses.INCORRECT_TRAN... | |
<|file_name|>getHover.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------... |
export function getHover(model: IReadOnlyModel, position: Position): TPromise<Hover[]> {
|
<|file_name|>patch-third_party__pdfium__core__src__fxge__ge__fx_ge_linux.cpp<|end_file_name|><|fim▁begin|>--- third_party/pdfium/core/src/fxge/ge/fx_ge_linux.cpp.orig 2014-06-03 08:56:34.153169044 -0500<|fim▁hole|>+++ third_party/pdfium/core/src/fxge/ge/fx_ge_linux.cpp 2014-06-03 08:58:33.262158629 -0500
@@ -238,9 +238... | |
<|file_name|>fun_return.py<|end_file_name|><|fim▁begin|>def my_max(a, b):
<|fim▁hole|> if a > b:
return a
elif b > a:
return b
else:
return None
x = my_max(1, 2)
print x
print my_max(3, 2)<|fim▁end|> | |
<|file_name|>CommunistWorker.js<|end_file_name|><|fim▁begin|>L.CommunistWorker = L.AbstractWorker.extend({
statics: {
// number of web workers, not using web workers when falsy
NUM_WORKERS: 2
},
initialize: function (workerFunc) {
this.workerFunc = workerFunc;
},
onAdd: fu... | tile.datum = null;
callback(null, tile); |
<|file_name|>derive.rs<|end_file_name|><|fim▁begin|>use crate::syntax::{derive, Enum, Struct, Trait};
use proc_macro2::{Ident, Span, TokenStream};
use quote::{quote, quote_spanned, ToTokens};<|fim▁hole|>
pub use crate::syntax::derive::*;
pub fn expand_struct(strct: &Struct, actual_derives: &mut Option<TokenStream>) ->... | |
<|file_name|>service.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('<%= name %>')
.service('<%= serviceName %>', function ($q, $http) {
// A private cache key.
var cache = {};
// Update broadcast name.
var broadcastUpdateEventName = '<%= serviceName %>Change';
/**
* Return t... | * |
<|file_name|>LdapConnectionLivenessValidator.java<|end_file_name|><|fim▁begin|>/**********************************************************************************
* $URL$
* $Id$
***********************************************************************************
*
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008 ... | |
<|file_name|>4_Expert-itinerant.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# @Author: Adrien Chardon
# @Date: 2014-11-16 14:29:10
# @Last Modified by: Adrien Chardon
# @Last Modified time: 2014-11-16 16:31:32
import time as t
########################################################... | |
<|file_name|>fixed_length_vec_glue.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.apac... | // xfail-fast: check-fast screws up repr paths
use std::repr;
|
<|file_name|>buttonable_model_admin.py<|end_file_name|><|fim▁begin|>#by mamat and tsaylor on djangosnippets.org
import re
from django.conf.urls.defaults import patterns, url
from django.contrib import admin
from django.http import HttpResponseRedirect
from django.utils.functional import update_wrapper
class Button(o... | buttons=[]
def change_view(self, request, object_id, extra_context={}): |
<|file_name|>leave_message.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import cgi
from redis import Connection
from socket import gethostname
from navi import *
fields = cgi.FieldStorage()
title = "Message Box"
msg_prefix = 'custom.message.'
def insert_msg(cust, tm, msg):
conn = Connection(host=gethostnam... | import time, os
ret = "" |
<|file_name|>reboot.rs<|end_file_name|><|fim▁begin|>//! Reboot/shutdown or enable/disable Ctrl-Alt-Delete.
use {Error, Result};
use errno::Errno;
use libc;
use void::Void;
use std::mem::drop;
libc_enum! {<|fim▁hole|> ///
/// See [`set_cad_enabled()`](fn.set_cad_enabled.html) for
/// enabling/disabling Ctrl... | /// How exactly should the system be rebooted. |
<|file_name|>enums3.rs<|end_file_name|><|fim▁begin|>// enums3.rs
// Address all the TODOs to make the tests pass!
// I AM NOT DONE
enum Message {
// TODO: implement the message variant types based on their usage below
}
struct Point {
x: u8,
y: u8
}
struct State {
color: (u8, u8, u8),
position: ... | |
<|file_name|>customize_juropa_icc_libxc.py<|end_file_name|><|fim▁begin|>compiler = './icc.py'
mpicompiler = './icc.py'
mpilinker = 'MPICH_CC=gcc mpicc'
scalapack = True
library_dirs += ['/opt/intel/Compiler/11.0/074/mkl/lib/em64t']<|fim▁hole|> 'mkl_scalapack_lp64', 'mkl_blacs_intelmpi_lp64',
... | libraries = ['mkl_intel_lp64' ,'mkl_sequential' ,'mkl_core',
'mkl_lapack', |
<|file_name|>storecellrenderer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008-2010 Zuza Software Foundation
#
# This file is part of Virtaal.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... | "The unit",
"The unit that this renderer is currently handling", |
<|file_name|>BarSeries.js<|end_file_name|><|fim▁begin|>/**
* The BarSeries class renders bars positioned vertically along a category or time axis. The bars'
* lengths are proportional to the values they represent along a horizontal axis.
* and the relevant data points.
*
* @module charts
* @class BarSeries
* @ex... | markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);
markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);
config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.height, offset); |
<|file_name|>object.js<|end_file_name|><|fim▁begin|>const EventEmitter = require('events')
const stable = require('stable')
const glMatrix = require('gl-matrix')
const Transform = require('./transform')
const AnimatedNumber = require('./animated-number')
const AnimatedBoolean = require('./animated-boolean')
const Utils... | hasChild (childNode) { |
<|file_name|>test_serving.py<|end_file_name|><|fim▁begin|># Copyright 2013 Donald Stufft
#
# 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... | from warehouse import serving
from warehouse.serving import WSGIRequestHandler |
<|file_name|>build_heap.py<|end_file_name|><|fim▁begin|># python3
class HeapBuilder:
def __init__(self):
self._swaps = []
self._data = []
def ReadData(self):
n = int(input())
self._data = [int(s) for s in input().split()]
assert n == len(self._data)
def WriteResponse(self):
print(len(se... | |
<|file_name|>test_gradebook_navigation.py<|end_file_name|><|fim▁begin|>import pytest
from six.moves.urllib.parse import quote
from ...api import MissingEntry
from .base import BaseTestFormgrade
from .manager import HubAuthNotebookServerUserManager
@pytest.mark.formgrader
@pytest.mark.usefixtures("all_formgraders")
... | self._wait_for_formgrader("submissions/{}/?index=0".format(submission.id))
|
<|file_name|>AdminFamilySearch.js<|end_file_name|><|fim▁begin|>// @flow
import React, { Component } from 'react';
import { Grid, Row, Col, FormGroup, FormControl, HelpBlock, ControlLabel } from 'react-bootstrap';
export default class AdminFamilySearch extends Component {
render() {
return (
<div>
... | </Grid>
</div>
);
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*-
#
# Copyright (C) 2014 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# 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 the Free Soft... | import test_purchase_group_by_period |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import os
from qmpy import *
from django.test import TestCase
peak_locations = []
class MiedemaTestCase(TestCase):
def setUp(self):
read_elements()
def test_methods(self):
## test that it generally works
self.assertEqual(Miedema("Fe... | def test_voronoi(self): |
<|file_name|>gdb.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
... |
else: |
<|file_name|>external_item.py<|end_file_name|><|fim▁begin|>import curses
from cursesmenu import clear_terminal
from cursesmenu.items import MenuItem
class ExternalItem(MenuItem):
"""
A base class for items that need to do stuff on the console outside of curses mode.
Sets the terminal back to standard mod... | def __init__(self, text, menu=None, should_exit=False):
# Here so Sphinx doesn't copy extraneous info from the superclass's docstring
super(ExternalItem, self).__init__(text=text, menu=menu, should_exit=should_exit) |
<|file_name|>color-base.js<|end_file_name|><|fim▁begin|>YUI.add('color-base', function (Y, NAME) {
/**
Color provides static methods for color conversion.
Y.Color.toRGB('f00'); // rgb(255, 0, 0)
Y.Color.toHex('rgb(255, 255, 0)'); // #ffff00
@module color
@submodule color-base
@class Color
@since 3.8.0
**/
... | }
}
if (method) { |
<|file_name|>example.rs<|end_file_name|><|fim▁begin|>pub fn build_proverb(items: &[&str]) -> String {
let mut stanzas = Vec::with_capacity(items.len());
for index in 0..items.len() {
if index == items.len() - 1 {
stanzas.push(format!("And all for the want of a {}.", items[0]));
} els... | items[index],
items[index + 1] |
<|file_name|>trt_convert_windows.py<|end_file_name|><|fim▁begin|># Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://w... | NotImplementedError: TRT is not supported on Windows. |
<|file_name|>io.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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/license... |
impl Seek for SeekableMemWriter {
#[inline] |
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
<|fim▁hole|>
class REvd(RPackage):
"""evd: Functions for Extreme V... | from spack import *
|
<|file_name|>os.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/license... |
// start all the threads |
<|file_name|>53bbd27ec841_extra_dhcp_opts_supp.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 OpenStack Foundation
#
# 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
#... | migration_for_plugins = [ |
<|file_name|>ternary_search.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2015-2017 Pavel Dolgov
*<|fim▁hole|>
typedef long double LLD;
int Vp, Vf;
LLD Oy;
LLD getTime(LLD coordinate) {
LLD field_dist = std::sqrt(
coordinate * coordinate + (1 - Oy) * (1 - Oy)
);
LLD forest_dist = std::sqrt... | * See the LICENSE file for terms of use.
*/
#include <bits/stdc++.h> |
<|file_name|>m2urllib.py<|end_file_name|><|fim▁begin|>"""M2Crypto enhancement to Python's urllib for handling
'https' url's.
Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved."""
import string, sys, urllib
from urllib import *
import SSL
import httpslib
DEFAULT_PROTOCOL='sslv23'
def open_https(self, url... | self.ctx = SSL.Context(DEFAULT_PROTOCOL)
user_passwd = None |
<|file_name|>version.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 or... | # Properties |
<|file_name|>generate_manifest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2016 Sam Yaple
#
# 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/... | import sys |
<|file_name|>spreadmindaysconstraintsfivedaysform.cpp<|end_file_name|><|fim▁begin|>//
//
// Description: This file is part of FET
//
//
// Author: Lalescu Liviu <Please see http://lalescu.ro/liviu/ for details about contacting Liviu Lalescu (in particular, you can find here the e-mail address)>
// Copyright (C) 2003 Li... | |
<|file_name|>view.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
__author__ = 'hmizumoto'
from flask import Blueprint, request, render_template, abort
from app.utils import jwt_decode
from app.views.auth import check_login, authorized_user, login
from app.models import DOMAIN
from app import app
from app.decor... | @module.route("/tags/<tag_name>")
@login_required |
<|file_name|>Scene.cpp<|end_file_name|><|fim▁begin|>#include "Scene.h"
#include "Screen.h"
Scene::Scene()
{
}
void Scene::Update()
{
Object::AddPreparedObjects();
for (Object* obj : Object::objects)
{
if (obj->IsActive())
obj->Update();
}
for (auto iter = Object::objects.begin(); iter != Object::objects.... | |
<|file_name|>filepropsdialog.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@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
the Free Software Foundation; either ... | }
else {
ui->openWith->hide();
ui->openWithLabel->hide(); |
<|file_name|>tiny_mce_src.js<|end_file_name|><|fim▁begin|>(function(win) {
var whiteSpaceRe = /^\s*|\s*$/g,
undefined, isRegExpBroken = 'B'.replace(/A(.)|B/, '$1') === '$1';
var tinymce = {
majorVersion : '3',
minorVersion : '4.2',
releaseDate : '2011-04-07',
_init : function() {
var t = this, d = do... | |
<|file_name|>keyboard.js<|end_file_name|><|fim▁begin|>var Keyboard_Space = new function(){
this.initKeyboard = function(testing){
testmode = testing;
return new Keyboard();
}
var Keyboard = function(){
for(var i = 0; i < numChains; i++)
currentSounds.push([]);
... | Keyboard.prototype.loadNotes = function(){ |
<|file_name|>OutdoorPvP.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.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
* the Free Software Foundation; either version 2 of th... | @param world state to update
@param new world state value |
<|file_name|>example_move_test.go<|end_file_name|><|fim▁begin|>package llrb_test
import (
"fmt"
"github.com/gyuho/goraph/llrb"
)
func Example_rotateToLeft() {
node3 := llrb.NewNode(llrb.Float64(3))
node3.Black = true
node1 := llrb.NewNode(llrb.Float64(1))
node1.Black = true
node13 := llrb.NewNode(llrb.Float... | // [[1(true)] 2(true) [2.5(true)]]
// [[[1(true)] 2(true) [2.5(true)]] 3(true) [[9(true)] 13(true) [[15(true)] 16(false) [[17(false)] 25(true)]]]]
// [[9(true)] 13(true) [[15(true)] 16(false) [[17(false)] 25(true)]]] |
<|file_name|>0003_remove_advertiser_logo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
<|fim▁hole|> dependencies = [
('deals', '0002_advertiser_logo'),
]
operations = ... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
import re
from setuptools import setup
base_path = os.path.dirname(__file__)
def get_long_description():
readme_md = os.path.join(base_path, "README.md")
with open(readme_md) as f:
return f.read()
with open(os.path.join(base_path, "cfscra... | long_description=get_long_description(), |
<|file_name|>vulcanup.js<|end_file_name|><|fim▁begin|>/**
* jQuery object.
* @external jQuery
* @see {@link http://api.jquery.com/jQuery/}
*/
/**
* The jQuery plugin namespace.
* @external "jQuery.fn"
* @see {@link http://docs.jquery.com/Plugins/Authoring The jQuery Plugin Guide}
*/
/**
* The plugin global c... |
$(document).on('drop dragover', function (e) { |
<|file_name|>ng-minmax.js<|end_file_name|><|fim▁begin|>function isEmpty(value) {
return angular.isUndefined(value) || value === '' || value === null || value !== value;
}
angular.module('Aggie')
.directive('ngMin', function () {
return {
restrict: 'A',
require: 'ngModel',
link: function (scope, elem... | ctrl.$setViewValue(ctrl.$viewValue);
});
var minValidator = function (value) {
var min = scope.$eval(attr.ngMin) || 0; |
<|file_name|>read_file_to_string.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
use super::File;<|fim▁hole|>/// Reads a file into a string.
pub fn... | use super::FileSourceResult;
use crate::errors::{Error, Result};
|
<|file_name|>test_stdout.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Messages are written to stdout instead of the normal stderr.
"""
import logging
from themelog import init_log<|fim▁hole|>logger = logging.getLogger()
init_log(stdout=True)
logger.debug('This is a debug message')
logger.info('This is a in... | |
<|file_name|>tradingStore.js<|end_file_name|><|fim▁begin|>'use strict';
var Dispatcher = require('../core/appDispatcher');
var EventEmitter = require('events').EventEmitter;
var ActionTypes = require('./actionTypes');
var CHANGE_EVENT = 'change';
var utils = require('../core/utils');
function TradingStore() {
var ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from .sitemap import *<|fim▁end|> | |
<|file_name|>clock-format.pip.ts<|end_file_name|><|fim▁begin|>import {Pipe, PipeTransform} from 'angular2/core';
@Pipe({name: 'clockFormat'})
export class ClockFormat implements PipeTransform {
transform(value:number, args:string[]) : string {
if (isNaN(value)) {
return "00:00:00";
}
let sec: number = v... | return extended.substr(extended.length-2);
}
} |
<|file_name|>creategeom.js<|end_file_name|><|fim▁begin|>L.mapbox.accessToken = 'pk.eyJ1IjoibHVkby1hdXJnIiwiYSI6IjE0QzlVekkifQ.FK86sgWfTNbDC-Z-O-hTww';
var osm = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');
var ggl = L.tileLayer('http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}',{
maxZoom: 20,... | type: "POST",
url: url+'/creategeom', |
<|file_name|>selectors.js<|end_file_name|><|fim▁begin|>/**
* Created by Yang on 2/11/16.
*/
import { createSelector } from 'reselect';
const selectForgetPasswordPage = () => (state) => state.get('forgetpassword');
const selectEmail = () => createSelector(
selectForgetPasswordPage(),<|fim▁hole|>);
const selectErr... | (forgetPasswordState) => forgetPasswordState.get('email') |
<|file_name|>DebitTest.java<|end_file_name|><|fim▁begin|>package unit.com.bitdubai.fermat_dmp_plugin.layer.basic_wallet.bitcoin_wallet.developer.bitdubai.version_1.structure.BitcoinWalletBasicWalletAvailableBalance;
import com.bitdubai.fermat_api.layer.dmp_basic_wallet.common.exceptions.CantRegisterDebitException;
im... | private BitcoinWalletTransactionRecord mockTransactionRecord;
|
<|file_name|>uuids.rs<|end_file_name|><|fim▁begin|>extern crate cassandra;
use cassandra::CassSession;
use cassandra::CassUuid;
use cassandra::CassStatement;
use cassandra::CassResult;
use cassandra::CassError;
use cassandra::CassUuidGen;
use cassandra::CassCluster;
static INSERT_QUERY:&'static str = "INSERT INTO exa... | |
<|file_name|>0_doc.go<|end_file_name|><|fim▁begin|>// Package sdio provides interface to SD host Interface.<|fim▁hole|>package sdio
// DO NOT EDIT THIS FILE. GENERATED BY stm32xgen.<|fim▁end|> | |
<|file_name|>test-rational-matrix-factory.C<|end_file_name|><|fim▁begin|>/* tests/test-det.C
* Copyright (C) 2002 Bradford Hovinen
*
* Written by Bradford Hovinen <hovinen@cis.udel.edu>
*
* --------------------------------------------------------
*
*
* ========LICENCE========
* This file is part of the librar... | return ret;
} |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms
from . import models
from apps.utils import forms as utils, constants
from django.forms import models as models_form
from apps.personas import models as persona_models
class VacanteForm(utils.BaseFormAllFields):
title = 'Vacante'
fech... |
def get_formacion_trabajo_persona_formset(form,
formset=models_form.BaseInlineFormSet, |
<|file_name|>session.cpp<|end_file_name|><|fim▁begin|>#include "session.h"
// This file is part of MCI_Host.
// MCI_Host 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 ... | void Session::requestedToClose(uint sesId) |
<|file_name|>producer.py<|end_file_name|><|fim▁begin|># Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except ... | np(layer=CORE, pod=NULL, left_right=LEFT, number=1)]) |
<|file_name|>State.ts<|end_file_name|><|fim▁begin|>import * as sudoku from './lib/SudokuSolver';
export interface SudokuCell extends sudoku.Sudoku.SolvedCell {
initial?: boolean;
};
export interface Message {
messageString: string;
messageType: string;<|fim▁hole|>
export interface SudokuState {
initialCells:... | } |
<|file_name|>Story.js<|end_file_name|><|fim▁begin|>import { observable, action } from 'mobx';
import Fuse from 'fuse.js';
import Activity from './../utils/Activity';
import noop from 'lodash/noop';
import uniqBy from 'lodash/uniqBy';
const inactive = Activity(500);
export default class Story {
@observable keyword =... | |
<|file_name|>html2canvas.js<|end_file_name|><|fim▁begin|>/*
html2canvas 0.5.0-alpha1 <http://html2canvas.hertzen.com>
Copyright (c) 2015 Niklas von Hertzen
Released under MIT License
*/
(function(window, document, exports, global, define, undefined){
/*!
* @overview es6-promise - a tiny implementation of Prom... | |
<|file_name|>IssueTransaction.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
Description:
Issue Transaction
Usage:
from AntShares.Core.IssueTransaction import IssueTransaction
"""
from AntShares.Core.AssetType import AssetType
from AntShares.Helper import *
from AntShares.Core.Transaction import Tra... | self.TransactionType = TransactionType.IssueTransaction # 0x40
self.Nonce = self.genNonce()
|
<|file_name|>DriveWithCamera.java<|end_file_name|><|fim▁begin|>package org.usfirst.frc.team4453.robot.commands;
import org.usfirst.frc.team4453.library.Vision;
import org.usfirst.frc.team4453.robot.Robot;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
/**
*... | |
<|file_name|>Asteroids.hpp<|end_file_name|><|fim▁begin|>/* *****************************************************************************
* A.L.E (Arcade Learning Environment)
* Copyright (c) 2009-2013 by Yavar Naddaf, Joel Veness, Marc G. Bellemare and
* the Reinforcement Learning and Artificial Intelligence L... | // is end of game
bool isTerminal() const;
// get the most recently observed reward
|
<|file_name|>EditorService.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
angular.module('journal.component.editor')
.service('EditorService', ['$http', 'AuthService', 'CONFIG', EditorService]);
<|fim▁hole|> this.apiUrl = CONFIG.API_URL;
this.checkSlug = function(title, id)... | function EditorService($http, AuthService, CONFIG) { |
<|file_name|>client.rs<|end_file_name|><|fim▁begin|>//! # Client
//!
//! Main module to handle HTTP request signing
//! and Rest calls
//!
extern crate serde;
extern crate serde_json;
use config::Credential;
use std::io::Read;
#[cfg(not(feature = "curl"))]
use reqwest;
#[cfg(not(feature = "curl"))]
use reqwest::Resp... | let client = reqwest::Client::new().unwrap(); |
<|file_name|>ParticleDevice.java<|end_file_name|><|fim▁begin|>package io.particle.android.sdk.cloud;
import android.annotation.SuppressLint;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.MainThread;
import android.support.annotation.Nullable;
import android.support.annotatio... | IOException, VariableDoesNotExistException, ClassCastException {
VariableRequester<Integer, ReadIntVariableResponse> requester = |
<|file_name|>recipe-439094.py<|end_file_name|><|fim▁begin|>import socket<|fim▁hole|>def get_ip_address(ifname):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
return socket.inet_ntoa(fcntl.ioctl(
s.fileno(),
0x8915, # SIOCGIFADDR
struct.pack('256s', ifname[:15])
)[20:24])
>>>... | import fcntl
import struct
|
<|file_name|>http-errors_v1.x.x.js<|end_file_name|><|fim▁begin|>// flow-typed signature: 573c576fe34eb3c3c65dd7a9c90a46d2
// flow-typed version: b43dff3e0e/http-errors_v1.x.x/flow_>=v0.25.x
declare module 'http-errors' {
declare class SpecialHttpError extends HttpError {
constructor(): SpecialHttpError;
}
de... | Conflict: typeof SpecialHttpError;
Gone: typeof SpecialHttpError;
LengthRequired: typeof SpecialHttpError; |
<|file_name|>mayberef.rs<|end_file_name|><|fim▁begin|>use std::ops::Deref;
use self::MaybeRef::*;
<|fim▁hole|>}
impl<'a, T: Clone> MaybeRef<'a, T> {
pub fn take(self) -> T {
match self {
Val(t) => t,
Ref(t) => t.clone(),
}
}
}
impl<'a, T> Deref for MaybeRef<'a, T> {
... | pub enum MaybeRef<'a, T: 'a> {
Ref(&'a T),
Val(T), |
<|file_name|>mouse.rs<|end_file_name|><|fim▁begin|>use std::ptr;
use get_error;<|fim▁hole|>use video;
use sys::mouse as ll;
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
#[repr(u32)]
pub enum SystemCursor {
Arrow = ll::SDL_SYSTEM_CURSOR_ARROW,
IBeam = ll::SDL_SYSTEM_CURSOR_IBEAM,
Wait = ll::SDL_SYST... | use SdlResult;
use surface::SurfaceRef; |
<|file_name|>noise_test.py<|end_file_name|><|fim▁begin|># This file is part of pyderiv. http://forre.st/pyderiv
#
# pyderiv 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
#... | print cov_matrix(r)
print |
<|file_name|>test_live_customer.py<|end_file_name|><|fim▁begin|>import random
from authorize import Customer, Transaction
from authorize import AuthorizeResponseError
from datetime import date
from nose.plugins.attrib import attr
from unittest import TestCase
FULL_CUSTOMER = {
'email': 'vincent@vincentcatalano.... | 'credit_card': {
'card_number': '4111111111111111',
'expiration_date': '04/{0}'.format(date.today().year + 1),
'card_code': '456', |
<|file_name|>polygon.rs<|end_file_name|><|fim▁begin|>//! Draw polygon
use types::Color;
use {types, triangulation, Graphics, DrawState};
use math::{Matrix2d, Scalar};
/// A polygon
#[derive(Copy, Clone)]
pub struct Polygon {
/// The color of the polygon
pub color: Color,
}
impl Polygon {
/// Creates new ... | /// Draws polygon using the default method. |
<|file_name|>verbosity.py<|end_file_name|><|fim▁begin|>import os
from django.core.management.color import supports_color
from django.utils import termcolors
class VerboseCommandMixin(object):
def __init__(self, *args, **kwargs):
super(VerboseCommandMixin, self).__init__(*args, **kwargs)
self.dry... | |
<|file_name|>cell.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 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/licen... | let borrow = self.parent.borrow.get();
debug_assert!(borrow != WRITING && borrow != UNUSED);
self.parent.borrow.set(borrow - 1);
} |
<|file_name|>geocount.py<|end_file_name|><|fim▁begin|>import logging
import server.util.tags as tag_utl
from server.cache import cache
from server.auth import user_admin_mediacloud_client
import server.views.sources.apicache as apicache
from server.views.stories import QUERY_LAST_MONTH, QUERY_ENGLISH_LANGUAGE
logger ... | |
<|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/. */
//! Traversals over the DOM and flow trees, running the lay... | // [1] For example, the WorkQueue type needs to be parameterized on the concrete type of |
<|file_name|>playlist.component.ts<|end_file_name|><|fim▁begin|>/*
* Angular 2 decorators and services
*/
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { CardComponent } from './../common/card/card.component';
import {DynamicOutlet} from './../dynamicOutlet/dynamicOutlet.component';
... | }
persistVariation(variationData) {
this.onChanged.emit({ |
<|file_name|>util.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010 ActiveState Software Inc. All rights reserved.
"""
pypm.common.util
~~~~~~~~~~~~~~~~
Assorted utility code
"""
import os
from os import path as P
import sys
import re
from contextlib import contextmanager
import logging
import tim... | if sys.platform.startswith('win'):
assert absolute_path[1:3] == ':\\'
return absolute_path[3:] # remove the DRIVE
else: |
<|file_name|>dbc.py<|end_file_name|><|fim▁begin|>import re
import os
import struct
import sys
import numbers
from collections import namedtuple, defaultdict
def int_or_float(s):
# return number, trying to maintain int format
if s.isdigit():
return int(s, 10)
else:
return float(s)
DBCSignal = namedtuple... | if shift_amount < 0:
continue
tmp = (tmp >> shift_amount) & ((1 << signal_size) - 1) |
<|file_name|>SimpleBetterSpringSolutionDaoTest.java<|end_file_name|><|fim▁begin|>package pl.java.scalatech.basic;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.runners.MethodSorters.NAME_ASCENDING;<|fim▁hole|>import java.util.List;
import java.util.Map;
import org.junit.FixMethodOr... | |
<|file_name|>mock.go<|end_file_name|><|fim▁begin|>package mocknet
import (
logging "github.com/ipfs/go-ipfs/vendor/QmXJkcEXB6C9h6Ytb6rrUTFU56Ro62zxgrbxTT3dgjQGA8/go-log"
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"<|fim▁hole|>
// WithNPeers constructs a Mocknet with N peers.
func... | )
var log = logging.Logger("mocknet") |
<|file_name|>test_bandstructure.py<|end_file_name|><|fim▁begin|># coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
import os
import json
from io import open
import warnings
from pymatgen.electronic_structure.bandstructure import Kpoint
from py... | self.assertEqual(self.kpoint.b, 0.4)
self.assertEqual(self.kpoint.c, -0.5)
self.assertEqual(self.lattice, Lattice.cubic(10.0))
self.assertEqual(self.kpoint.cart_coords[0], 1.0) |
<|file_name|>shape.py<|end_file_name|><|fim▁begin|>__all__ = ['view_as_blocks', 'view_as_windows']
import numpy as np
from numpy.lib.stride_tricks import as_strided
def view_as_blocks(arr_in, block_shape):
"""Block view of the input n-dimensional array (using re-striding).
Blocks are non-overlapping views o... | if (block_shape <= 0).any(): |
<|file_name|>frontend_ip_configuration_py3.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 informati... | |
<|file_name|>player.actions.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import { Action } from '@ngrx/store';
import { Player } from '../models/player.model';
import { Track } from '../models/track.model';
@Injectable()
export class PlayerActions {
static VOLUME_CHANGE = '[Player] V... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.