prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>Data_CSV.py<|end_file_name|><|fim▁begin|>#File to read the data from mysql and push into CSV.
# Python imports
import datetime as dt
import csv
import copy
import os
import pickle
# 3rd party imports
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# QSTK imports
from QSTK.qstkutil... | |
<|file_name|>unwind-uninitialized.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.apach... |
fn main() {
f();
let _a = @0; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 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://www.apache.o... | |
<|file_name|>app-stats.state.ts<|end_file_name|><|fim▁begin|>import {summary, stats} from '../../cloud/app-stats/app-stats.interface';<|fim▁hole|>import {App} from '../../cloud/apps/app.interface';
export const appStats = {
isFetchingAppStats: true,
isRefreshingAppStats: false,
isScalingApp: false,
sho... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># pylint: disable=invalid-unary-operand-type
from collections import OrderedDict
import json
import logging
from copy import deepcopy
from datetime import datetime, timedelta
from six import string_types
import requests
import sqlalchemy as sa
from sqlalchemy import ... | |
<|file_name|>anim-scroll.js<|end_file_name|><|fim▁begin|>/*
YUI 3.8.0 (build 5744)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('anim-scroll', function (Y, NAME) {
/**
* Adds support for the <code>scroll</code> property in <code>to</code>
*... | if (val[0]) {
node.set('scrollLeft', val[0]);
}
|
<|file_name|>Colors_test.py<|end_file_name|><|fim▁begin|># Tests for Pmw color handling.
import Tkinter
import Test
import Pmw
Test.initialise()
testData = ()
defaultPalette = Pmw.Color.getdefaultpalette(Test.root)
c = Tkinter.Button
colors = ('red', 'orange', 'yellow', 'green', 'blue', 'purple', 'white')
normalco... | # Restore the default colors.
kw = {} |
<|file_name|>MorsHtmlHighlighter.cpp<|end_file_name|><|fim▁begin|>#include "MorsHtmlHighlighter.h"
enum Construct {
DocType,
Entity,
Tag,
Comment,
AttributeName,
AttributeValue
};
enum State {
State_Text = -1,
State_DocType,
State_Comment,
State_TagStart,
State_TagName,
... | |
<|file_name|>smallcommitmetadata.py<|end_file_name|><|fim▁begin|># Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the<|fim▁hole|># GNU General Public License version 2.
# smallcommitmetadata.py - stores a small amount of metadata associated with... | |
<|file_name|>chip-grid-harness.spec.ts<|end_file_name|><|fim▁begin|>import {HarnessLoader} from '@angular/cdk-experimental/testing';
import {TestbedHarnessEnvironment} from '@angular/cdk-experimental/testing/testbed';
import {Component} from '@angular/core';<|fim▁hole|>import {MatChipsModule} from '../index';
import {M... | import {ComponentFixture, TestBed} from '@angular/core/testing'; |
<|file_name|>runConfigs.py<|end_file_name|><|fim▁begin|>#Constants<|fim▁hole|>PROD = 'prod'
LOCAL = 'local'
NOPI = 'nopi'
#Set configs here
ENV = PROD
loggingEnabled = True<|fim▁end|> | |
<|file_name|>DOThumbnailPriority.java<|end_file_name|><|fim▁begin|>/*
* PS3 Media Server, for streaming any medias to your PS3.
* Copyright (C) 2012 Ph.Waeber
*
* 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... | |
<|file_name|>test_compat.py<|end_file_name|><|fim▁begin|>from morepath import compat
def test_text_type():
assert isinstance(u'foo', compat.text_type)
assert not isinstance(b'foo', compat.text_type)
def test_string_types():
assert isinstance('foo', compat.string_types)
assert isinstance(u'foo', comp... | |
<|file_name|>Crypto.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Crypto.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope th... | pass
@property
def enableSmartCardEvents(self): |
<|file_name|>keyframes.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/. */
//! Keyframes: https://drafts.csswg.org/css-animations/#key... | }
}
/// A keyframes step value. This can be a synthetised keyframes animation, that |
<|file_name|>htmltableheadercellelement.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 dom::bindings::codegen::Bindings::HTML... | }
}
|
<|file_name|>0003_auto__del_field_customuser_email_on_new_foller__add_field_customuser_e.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
... |
def backwards(self, orm): |
<|file_name|>fn_to_numeric_cast_any.rs<|end_file_name|><|fim▁begin|>use clippy_utils::diagnostics::span_lint_and_sugg;
use clippy_utils::source::snippet_with_applicability;
use rustc_errors::Applicability;
use rustc_hir::Expr;
use rustc_lint::LateContext;
use rustc_middle::ty::{self, Ty};
use super::FN_TO_NUMERIC_CAST... | ty::FnDef(..) | ty::FnPtr(_) => {
let mut applicability = Applicability::MaybeIncorrect;
let from_snippet = snippet_with_applicability(cx, cast_expr.span, "..", &mut applicability);
|
<|file_name|>quick_switcher.py<|end_file_name|><|fim▁begin|>#-*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
OpenSesame 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, ... | from quick_switcher_dialog.dialog import quick_switcher
self.d = quick_switcher(self.main_window)
self.set_busy(False) |
<|file_name|>Utils.ts<|end_file_name|><|fim▁begin|>import { gt } from 'ramda';
export function Update<T>(initialState:T, overrideObject:Partial<T>):T {
return Object.assign({}, initialState, overrideObject);
}
export type Element = 'input' | 'textarea' | 'select' | 'tab-selection' | 'toggle' | 'checkbox' | 'radio... |
classNames.push(baseClassName, elementClassName, addClassName); |
<|file_name|>cssrulelist.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 dom::bindings::cell::DOMRefCell;
use dom::bindings::c... | }
#[allow(unrooted_must_root)]
pub fn new(window: &Window, parent_stylesheet: &CSSStyleSheet, |
<|file_name|>homework_3_chipotle.py<|end_file_name|><|fim▁begin|>'''
Python Homework with Chipotle data
https://github.com/TheUpshot/chipotle
'''
'''
BASIC LEVEL
PART 1: Read in the file with csv.reader() and store it in an object called 'file_nested_list'.
Hint: This is a TSV file, and csv.reader() needs to be told h... | '''
|
<|file_name|>test_webserver_command.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 un... | def _clean_pidfiles(self):
pidfile_webserver = setup_locations("webserver")[0]
pidfile_monitor = setup_locations("webserver-monitor")[0] |
<|file_name|>Things.java<|end_file_name|><|fim▁begin|>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package clay;
import java.util.ArrayList;
import java.util.HashMap;
import java.... |
// get locations of both of my ends
// get my distortion from my resting length |
<|file_name|>InvestmentAccountOwnershipInformation4.go<|end_file_name|><|fim▁begin|>package iso20022
<|fim▁hole|>// Characteristics of the ownership of an investment account.
type InvestmentAccountOwnershipInformation4 struct {
// Organised structure that is set up for a particular purpose, eg, a business, government... | |
<|file_name|>exception_window.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restric... | |
<|file_name|>backend.go<|end_file_name|><|fim▁begin|>package mqttpubsub
import (
"encoding/json"
"fmt"
"sync"
"time"
log "github.com/Sirupsen/logrus"
"github.com/brocaar/loraserver/api/gw"
"github.com/brocaar/lorawan"
"github.com/eclipse/paho.mqtt.golang"
)
// Backend implements a MQTT pub-sub backend.
type ... | return nil
} |
<|file_name|>rdio.py<|end_file_name|><|fim▁begin|>import urllib.request, urllib.parse, urllib.error
from oauth2 import Request as OAuthRequest, SignatureMethod_HMAC_SHA1
try:
import json as simplejson
except ImportError:<|fim▁hole|> import simplejson
except ImportError:
from django.utils import... | try: |
<|file_name|>language-container-directive.js<|end_file_name|><|fim▁begin|>// NOTE: nbApp is defined in app.js
nbApp.directive("languageContainerDirective", function() {
return {
restrict : 'E',
templateUrl : 'js/templates/language-container.html',
scope: {
color: "@",
lan... | Speak: the ability to produce speech in the language and be understood by its speakers.
*/ |
<|file_name|>PlatformGameObstacleMove.cpp<|end_file_name|><|fim▁begin|>#include "PlatformGameObstacleMove.h"
#include "../Utils/StringUtility.h"
PlatformGameObstacleMove::PlatformGameObstacleMove(Node& parentNode, const Vec2& localPosition, string csbPath, string colliderSpritePath)
<|fim▁hole|> name = "let... | : GameObject(parentNode, localPosition, csbPath, colliderSpritePath)
{
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>extern crate wireless;
mod json;
mod stdin;
use self::wireless::{Countries, Country, LTECell, LTECells, Network, Networks};
pub struct Data {
pub countries: Countries,
pub lte_cells: LTECells,
pub networks: Networks,
}
impl Data {
pub fn add_country(&... | }
}
} |
<|file_name|>fileinput_locale_cz.js<|end_file_name|><|fim▁begin|>/*!
* FileInput Czech Translations
*
* This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or
* any HTML markup tags in the messages must not be converted or translated.
*
* @see http://github.com/kartik-v/bootstrap-fileinp... | msgLoading: 'Nahrávání souboru {index} z {files} …',
msgProgress: 'Nahrávání souboru {index} z {files} - {name} - {percent}% dokončeno.',
|
<|file_name|>figure_gamma.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import absolute_import, print_function
import copy
import matplotlib
from grid_cell_model.submitting import flagparse
import noisefigs
from noisefigs.env import NoiseEnvironment
import config
parser = flagparse.FlagParse... | |
<|file_name|>ipfix.js<|end_file_name|><|fim▁begin|>//IP Flow Information Export (IPFIX) Entities
// Last Updated 2013-01-15
// http://www.iana.org/assignments/ipfix/ipfix.xml
var entities = [];
//ipfix-information-elements
entities['elements'] = {
"1":{"name":"octetDeltaCount","dataType":"unsigned64","dataTypeSemant... | "251":{"name":"pseudoWireControlWord","dataType":"unsigned32","dataTypeSemantics":"identifier"},
"252":{"name":"ingressPhysicalInterface","dataType":"unsigned32","dataTypeSemantics":"identifier"},
"253":{"name":"egressPhysicalInterface","dataType":"unsigned32","dataTypeSemantics":"identifier"}, |
<|file_name|>postCouchPotato.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
import os
import logging
from extensions import valid_tagging_extensions
from readSettings import ReadSettings
from mkvtomp4 import MkvtoMp4
from tmdb_mp4 import tmdb_mp4
from autoprocess import plex
from post_processor impor... | except:
logpath = os.path.dirname(sys.argv[0]) |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>/* Aurélien DESBRIÈRES
aurelien(at)hackers(dot)camp
License GNU GPL latest */
// Rust experimentations
// HOF - Higher Order Functions in Rust
fn is_odd(n: u32) -> bool {
n % 2 == 1
}
fn main() {
println!("Find the sum of all the squared odd numbers under 100... | } |
<|file_name|>migrated_0010.run.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | esprima.tokenize(null); |
<|file_name|>vrootgraphes.js<|end_file_name|><|fim▁begin|>"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const React = require("react");
const vgraph_1 = require("./vgraph");
const vrootgraph_list_1 = require("../../components/graph/vrootgraph.list");
const cabeiri_lang_1 = require("cabeir... | |
<|file_name|>keywords.py<|end_file_name|><|fim▁begin|>import Tkinter as tk
def foo(*args):
print "foo!", args
import sys; sys.stdout.flush()
def __extend__(app):
extension = KeywordExtension(app)
app.bind_class("all", "<F5>", extension.make_keyword)
# this needs to add something to the tools menu..... | |
<|file_name|>parser.rs<|end_file_name|><|fim▁begin|>peg_file! ply_rustpeg("ply.rustpeg");
pub fn parse(s: &str) -> Result<PLY, String> {
let (f, v, mut counted_elems, data) = try!(ply_rustpeg::parse(s));
let mut counter = 0us;
for &mut (count, ref mut elem) in counted_elems.iter_mut() {
//let (count, ref mut ele... | |
<|file_name|>itSystemService.ts<|end_file_name|><|fim▁begin|>module Kitos.Services {
"use strict";
interface ISystemRoleModel {
Id: number;
HasReadAccess: boolean;
HasWriteAccess: boolean;
Name: string;
IsActive: boolean;
Description?: any;
ObjectOwnerId... | GetSystemDataByIdFiltered = (id: number, orgId: number) => { |
<|file_name|>TeX.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1
oid sha256:558005fd55405d3069b06849812a921274543d712676f42ad4a8c122034c02e4<|fim▁hole|><|fim▁end|> | size 819 |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from apps.employees import ajax
from . import views
urlpatterns = (
url(r'^home/$', login_required(views.home), name="employee_home_redirect"),
url(r'^(?P<pk>[\d]+)/$', ... | url(r'^schedule/$', login_required(views.schedule), name="employee_schedule"),
url(r'^admin/$', login_required(views.EmployeeAdminPanel.as_view()), name="employee_admin"),
url(r'^sub-board/$', login_required(views.SubBoard.as_view()), name="sub_board"), |
<|file_name|>test_sym_char_class.py<|end_file_name|><|fim▁begin|>###############################################################################
# test_sym_char_class.py: Test module for PATTERN MATCH - symbol char class
# class
# Copyright (C) 2011 Brno University of Technology, ANT @ FIT
# ... | # Check return correct representation. |
<|file_name|>runbook.go<|end_file_name|><|fim▁begin|>package automation
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at... | // DeletePreparer prepares the Delete request.
func (client RunbookClient) DeletePreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { |
<|file_name|>factories.py<|end_file_name|><|fim▁begin|>from django.contrib.contenttypes.models import ContentType
import factory
from glitter.models import Version
from glitter.pages.models import Page
class PageFactory(factory.DjangoModelFactory):
url = factory.Sequence(lambda n: '/page-{}/'.format(n))
tit... | page.save() |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>import os
from flask import Flask, Response, request, url_for
import psycopg2
import urlparse
import plivo
import plivoxml
<|fim▁hole|>MY_URL = 'http://morning-ocean-4669.herokuapp.com/report/'
app = Flask(__name__)
@app.route('/response/speak/', methods=['GET'])
def ... | AUTH_ID = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
AUTH_TOKEN = 'YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY'
CALLER_ID = '+12345678901'
BOX_ID = '+12345678901' |
<|file_name|>net.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use std::io::{self, Write};
use std::mem;
use std::net::Ipv4Addr;
use std::os::raw::c_uint;
use std::r... | let mut write_error = || { |
<|file_name|>CustomGraphicsUtil.java<|end_file_name|><|fim▁begin|>package org.cytoscape.cg.model;
import java.awt.Image;
public class CustomGraphicsUtil {
public static Image getResizedImage(Image original, Integer w, Integer h, boolean keepAspectRatio) {
if (original == null)
throw new IllegalArgumentExceptio... | |
<|file_name|>dailymotion.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#------------------------------------------------------------
# beta.1 Dailymotion
# Version 0.1 (10.12.2014)
#------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Gracias... | |
<|file_name|>networking.py<|end_file_name|><|fim▁begin|># Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# 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 ver... | So we replace these below.
"""
rn = h.rnh_treetop
|
<|file_name|>test_fork1.py<|end_file_name|><|fim▁begin|>"""This test checks for correct fork() behavior.
"""
import _imp as imp
import os
import signal
import sys
import threading
import time
import unittest
from test.fork_wait import ForkWait
from test.support import reap_children, get_attribute, verbose
# Skip te... | sys.modules[fake_module_name] = partial_module
import_started.set()
time.sleep(0.01) # Give the other thread time to try and acquire.
sys.modules[fake_module_name] = complete_module |
<|file_name|>SIOCC-TS.d.ts<|end_file_name|><|fim▁begin|>declare module ioc {
/**
* A base class for applications using an IOC Container
*/
abstract class ApplicationContext implements IApplicationContext {
/**
* A base class for applications using an IOC Container
* @param ap... | * @returns {}
*/ |
<|file_name|>query.go<|end_file_name|><|fim▁begin|>package query
import (
"Yearning-go/src/handler/commom"
"Yearning-go/src/lib"
"Yearning-go/src/model"
"github.com/cookieY/yee"
"net/http"
"time"
)
func FetchQueryRecord(c yee.Context) (err error) {
u := new(commom.PageInfo)
if err = c.Bind(u); err != nil {
... | u := new(commom.PageInfo) |
<|file_name|>parser.copy.rs<|end_file_name|><|fim▁begin|>use scaly::containers::{Array, HashSet, Ref, String, Vector};
use scaly::io::Stream;
use scaly::memory::Region;
use scaly::Page;
use scalyc::errors::ParserError;
use scalyc::lexer::Lexer;
use scalyc::lexer::Position;
pub struct Parser {
lexer: Ref<Lexer>,
... | let node = self.parse_statement(&_r, _rp);
match node {
None => break,
Some(node) => { |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>/**
* Module dependencies.
*/
var express = require('express')
var MemoryStore = express.session.MemoryStore
var mongoStore = require('connect-mongo')(express)
var path = require('path')
var fs = require('fs')
var _ = require('underscore')
var mongoose = require('mongo... | var app = express()
var store = new mongoStore({ url : config.db, collection : 'sessions' });
//var store = new MemoryStore() |
<|file_name|>storage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright(C) 2011-2016 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# in... | k = self.db_utxo.get_next(key)
p = self.get_path(k) |
<|file_name|>serve_js.js<|end_file_name|><|fim▁begin|>/**
* @fileoverview client模式,serve时js文件处理
* @author liweitao
*/
'use strict';
module.exports = function ($, appConf, moduleConf, args) {
return function (mod, modulePath, appPath) {
return new Promise(function (resolve, reject) {
var vfs = require('vi... | athenaMate.concat({ |
<|file_name|>0356_add_webautn_auth_type.py<|end_file_name|><|fim▁begin|>"""
<|fim▁hole|>"""
from alembic import op
revision = '0356_add_webautn_auth_type'
down_revision = '0355_add_webauthn_table'
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.execute("INSERT INTO auth_type V... | Revision ID: 0356_add_webautn_auth_type
Revises: 0355_add_webauthn_table
Create Date: 2021-05-13 12:42:45.190269
|
<|file_name|>atari5200.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import os, struct, array
from fcntl import ioctl
SDL_JOY_0_SELECT = 8
SDL_JOY_0_START = 9
SDL_JOY_0_TRIGGER1 = 0
SDL_JOY_0_TRIGGER2 = 1
SDL_JOY_0_ASTERISK = 2
SDL_JOY_0_HASH = 3
SDL_JOY_0_SECOND_AXIS = 2
# Iterate over the joystick devices.
# p... | elif line.startswith("SDL_JOY_0_HASH"):
line = "SDL_JOY_0_HASH=%s" % SDL_JOY_0_HASH
elif line.startswith("SDL_JOY_0_SECOND_AXIS"): |
<|file_name|>ixbx.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
lantz.drivers.legacy.olympus.ixbx
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When talking about the z-axis of a microscope, use "near" and "far" instead of "up" and "down." "Nearer" always means the objective ends closer to the sample; "f... | |
<|file_name|>login.rs<|end_file_name|><|fim▁begin|>use command_prelude::*;
use std::io::{self, BufRead};
use cargo::core::{Source, SourceId};
use cargo::sources::RegistrySource;
use cargo::util::{CargoError, CargoResultExt};
use cargo::ops;
pub fn cli() -> App {
subcommand("login")
.about(
"S... | let registry = args.registry(config)?;
|
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
const signup = require('./signup');
const handler = require('feathers-errors/handler');
const notFound = require('./not-found-handler');
const logger = require('./logger');
module.exports = function() {
// Add your custom middleware here. Remember, th... | app.use(handler()); |
<|file_name|>derive_getable.rs<|end_file_name|><|fim▁begin|>extern crate env_logger;
#[macro_use]
extern crate gluon_codegen;
extern crate gluon;
extern crate serde;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate gluon_vm;
mod init;
use gluon::{
import,
vm::{
self,
api::{
... |
fn extract_str(either: Either<String, String>) -> String {
match either { |
<|file_name|>disk.rs<|end_file_name|><|fim▁begin|>use peripheral_card::PeripheralCard;
use std::io::Read;
/* Disk has 35 concentric tracks.
* Outer = $00, inner = $22
*
* 16 sectors per track.
* $0 to $F
*
* 256 bytes can be stored in each sector.
* $00 to $100
*/
/* The rom for the Disk2.
* It will be "cop... | |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import django
import time
from uuid import uuid1
from datetime import timedelta
from threading import Thread
from django.template import Template
from django.test import TestCase, TransactionTestCase
from django.contrib.auth.models import User, Group
from django.util... | self.assertTrue(alert_that_should_fail.failed)
self.assertFalse(alert_that_should_fail.is_sent) |
<|file_name|>gt.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
// pub trait FixedSizeArray<T> {
// /// Converts the array to immutable slice
// fn as_slice(&self) -> &[T];
// /// Converts the array to mutable slice
// fn as_mut_slice(&m... | // } |
<|file_name|>performance.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 dom::bindings::codegen::Bindings::PerformanceBinding;... | reflector_: Reflector::new(),
timing: JS::from_ref(&*PerformanceTiming::new(window,
navigation_start, |
<|file_name|>AbstractCDOIDByteArray.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribu... | /**
* @author Eike Stepper |
<|file_name|>component_len.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use malachite_base_test_util::generators::common::{GenConfig, GenMode};
use malachite_base_test_util::generators::unsigned_rational_sequence_gen;
use malachite_base_test_util::runner::Runner;
pub(crate) fn register(runner: &mut Runner) {
regist... | use malachite_base_test_util::bench::bucketers::rational_sequence_len_bucketer;
use malachite_base_test_util::bench::{run_benchmark, BenchmarkType}; |
<|file_name|>Socket.js<|end_file_name|><|fim▁begin|>/**
* Websocket Client
*/
(function() {
window.Socket = window.Socket || {}
var PacketTypes = {
Command : 0,
Status : 1
}
class Socket {
constructor(uri, game) {
uri = uri || ""
if(uri.length <= 0... | } |
<|file_name|>TestSea6Task1.java<|end_file_name|><|fim▁begin|>public class TestSea6Task1 {
public static void main(String[] args) {
String text = "Sun is shining. Today is a good day for test. Sun is shining. The students are happy. The birds are blue.";
int indexSent = -1;
int lengthSen = 0;<|fim▁hole|> for (i... | int counterSen = 0;
int indexLast = 0;
int maxLengthSen = 0;
|
<|file_name|>manager.rs<|end_file_name|><|fim▁begin|>use super::*;
use crate::app::{ddns, settings, user, vfs};
#[derive(Clone)]
pub struct Manager {
settings_manager: settings::Manager,
user_manager: user::Manager,
vfs_manager: vfs::Manager,
ddns_manager: ddns::Manager,
}
impl Manager {
pub fn new(
settings_m... | |
<|file_name|>survey_data_define.go<|end_file_name|><|fim▁begin|>package models
type SurveyResult struct {
SurveyId int
Answers []Answer
DeviceInfo DeviceInfomation
}
type Question struct {
QuestionId int
Type int //0代表单选题,1代表多选题,2代表填空题
Title string
Content []string
// CreatedTime int64
}<|f... | |
<|file_name|>error_mutex.rs<|end_file_name|><|fim▁begin|>use std::sync::Mutex;
lazy_static! {<|fim▁hole|><|fim▁end|> | pub static ref ERROR_MUTEX: Mutex<()> = Mutex::new(());
} |
<|file_name|>no-implied-eval.js<|end_file_name|><|fim▁begin|>/**
* @fileoverview Rule to flag use of implied eval via setTimeout and setInterval
* @author James Allardice
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//----------------------------... | |
<|file_name|>jodirectsend.component.ts<|end_file_name|><|fim▁begin|>import {Component} from '@angular/core'
import {JoDirectService, JoDirectResponse, JoDirectCode} from '../../services/jodirect.service'
@Component({
selector: `jodirect-send-page`,
template: `
<div id="parent">
<span [styl... | margin-top: 10px; |
<|file_name|>SharedBuffer.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
* Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the ... | |
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity 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 versi... | |
<|file_name|>$VirtualScrollExample.ts<|end_file_name|><|fim▁begin|>import { Behavior } from '@aelea/core'
import { $text, component, style } from '@aelea/dom'
import { $card, $column, $row, $seperator, $TextField, $VirtualScroll, layoutSheet, ScrollRequest, ScrollResponse } from '@aelea/ui-components'
import { pallete ... | containerOps: style({ padding: '8px', maxHeight: '400px' })
})({
scrollIndex: scrollRequestTether(),
}) |
<|file_name|>htmllinkelement.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 crate::dom::attr::Attr;
use crate::dom::bindings:... | |
<|file_name|>landing-page.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit, HostListener } from '@angular/core';
@Component({<|fim▁hole|>export class LandingPageComponent implements OnInit {
constructor() { }
@HostListener('window:scroll', ['$event'])
onScroll(event) {
const wScroll = wi... | selector: 'app-landing-page',
templateUrl: './landing-page.component.html',
styleUrls: ['./landing-page.component.scss']
}) |
<|file_name|>PathStageN.py<|end_file_name|><|fim▁begin|>'''author@esilgard'''
#
# Copyright (c) 2014-2016 Fred Hutchinson Cancer Research Center
#
# Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
#
from OneFieldPerReport import OneFieldPerReport
import global_strings as gb
... | self.table = gb.PATHOLOGY_TABLE
self.value_type = 'match' |
<|file_name|>test_frame.py<|end_file_name|><|fim▁begin|>"""
Test basic DataFrame functionality.
"""
import pandas as pd
import pytest
import weld.grizzly as gr
def get_frames(cls, strings):
"""
Returns two DataFrames for testing binary operators.
The DataFrames have columns of overlapping/different name... |
expect = pd_op(df1, df2)
result = gr_op(gdf1, gdf2).to_pandas() |
<|file_name|>RoleRepository.java<|end_file_name|><|fim▁begin|>package com.doctorAppointmentBookingSystem.repository;
import com.doctorAppointmentBookingSystem.entity.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**<|fim▁hole|> */
@Repository
pub... | * Created by Edi on 16-Apr-17. |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import Vue from 'vue'
import Router from 'vue-router'
import Resource from'vue-resource'
import { sync } from 'vuex-router-sync'
Vue.use(Router)
Vue.use(Resource)
// components
import App from './components/App.vue'
import Login from './components/Login/Login.vue'
im... | |
<|file_name|>label.cpp<|end_file_name|><|fim▁begin|>/* _______ __ __ __ ______ __ __ _______ __ __
* / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\
* / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / /
* ... | |
<|file_name|>options.js<|end_file_name|><|fim▁begin|>// ------------------------------------
// #POSTCSS - LOAD OPTIONS - OPTIONS
// ------------------------------------
'use strict'
/**
*
* @method options
*
* @param {Object} options PostCSS Config
*
* @return {Object} options PostCSS Options
*/
module.expor... | }
if (options.syntax) {
options.syntax = require(options.syntax) |
<|file_name|>htmltableelement.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::attr::Attr;
use crate::dom::binding... | if let Some(caption) = new_caption {
let node = self.upcast::<Node>(); |
<|file_name|>ex2-comments-and-pound-characters.py<|end_file_name|><|fim▁begin|># A comment, this is so you can read your program later.
# Anything after the # is ignored by python.
print "I could have code like this." # and the comment after is ignored
# You can also use a comment to "disable" or comment out a piece... | |
<|file_name|>_managed_database_queries_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 info... | """Get query execution statistics by query id. |
<|file_name|>mathLawObject.ts<|end_file_name|><|fim▁begin|>import { MathObject } from "../index";
export abstract class MathLawObject implements MathObject {
item: MathObject;
args: any[];
constructor(item: MathObject, args: any[]) {
this.item = item;
this.args = args;
}
abstr... |
toLiteral(): string {
return this.definition(); |
<|file_name|>termcolors.py<|end_file_name|><|fim▁begin|>"""
termcolors.py
"""
from django.utils import six
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = {color_names[x]: '3%s' % x for x in range(8)}
background = {color_names[x]: '4%s' % x for x in range(8)}
RESET ... |
Specifying a named palette is the same as manually specifying the individual
definitions for each role. Any individual definitions following the pallete
definition will augment the base palette definition. |
<|file_name|>test_detci-4.py<|end_file_name|><|fim▁begin|>import pytest
from forte.solvers import solver_factory, HF, ActiveSpaceSolver<|fim▁hole|> """CASCI test of Forte DETCI using the SparseList algorithm to build the sigma vector"""
ref_hf_energy = -99.977636678461636
ref_fci_energy = -100.113732484560... |
def test_detci_4(): |
<|file_name|>info.cpp<|end_file_name|><|fim▁begin|>#include <ctype.h>
#include "driver.h"
#include "sound/samples.h"
#include "info.h"
#include "datafile.h"
/* Output format indentation */
/* Indentation */
#define INDENT "\t"
/* Possible output format */
#define OUTPUT_FORMAT_UNFORMATTED 0
#define OU... | |
<|file_name|>match-range-fail.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.or... | "bar" ... "foo" => { }
};
//~^^ ERROR only char and numeric types are allowed in range |
<|file_name|>AuthTokenProvider.js<|end_file_name|><|fim▁begin|>"use strict";
/**
* Copyright 2017 Google 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.or... | this.app_['INTERNAL']['addAuthTokenListener'](listener);
};
AuthTokenProvider.prototype.removeTokenChangeListener = function (listener) {
this.app_['INTERNAL']['removeAuthTokenListener'](listener); |
<|file_name|>module_dumper.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: iso-8859-15 -*-
#
# module_dumper.py - WIDS/WIPS framework file dumper module
# Copyright (C) 2009 Peter Krebs, Herbert Haas
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GN... | # Helper values.
self.DUMPFILE = None |
<|file_name|>LocationCursor.java<|end_file_name|><|fim▁begin|>package com.daviancorp.android.data.database;
import android.database.Cursor;<|fim▁hole|>/**
* A convenience class to wrap a cursor that returns rows from the "locations"
* table. The {@link getLocation()} method will give you a Location instance
* repre... | import android.database.CursorWrapper;
import com.daviancorp.android.data.classes.Location;
|
<|file_name|>plans.py<|end_file_name|><|fim▁begin|>'''
plans.py
'''
from forex_python.converter import CurrencyCodes
from .base import Base
class Plan(Base):
'''
Plan class for making payment plans
'''
interval = None
name = None
amount = None
plan_code = None
currency = None
id = ... | description = None
__interval_values = ('hourly', 'daily', 'weekly', 'monthly', 'annually') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.