prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>guest1_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
u"""Test auth.guest
:copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import pytest
def te... | pkeq(True, d.authState.isLoggedIn) |
<|file_name|>persistenthashmap.test.ts<|end_file_name|><|fim▁begin|>/// <reference path="../../d.ts/DefinitelyTyped/jasmine/jasmine.d.ts"/>
import basilisk = require('../basilisk');
import Hash = basilisk.HashMap;
var freeze = (obj:any):any => { return (Object.freeze) ? Object.freeze(obj) : obj; };
// given a map o... |
it("Collisions one deep should function correctly.", function () { |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>"""
Nonlinear cartoon+texture decomposition ipol demo web app
"""
from lib import base_app, build, http, image
from lib.misc import ctime
from lib.misc import prod
from lib.base_app import init_app
import shutil
import cherrypy
from cherrypy import TimeoutError
import o... | """
program build/update
""" |
<|file_name|>getTemp.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import re, os, time
# function: read and parse sensor data file
def read_sensor(path):
value = "U"
try:
f = open(path, "r")
line = f.readline()
if re.match(r"([0-9a-f]{2} ){9}: crc=[0-9a-f]{2} YES", line):
... |
flag = 1
temp = 0
temp2 = 0 |
<|file_name|>stdlib_demo.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use diem_framework::{encode_peer_to_peer_with_metadata_script, ScriptCall};
use diem_types::{AccountAddress, Identifier, StructTag, TypeTag};
use serde_bytes::ByteBuf as Bytes;
f... | |
<|file_name|>integration_account_map_paged.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|>settings.py<|end_file_name|><|fim▁begin|># Django settings for mcjsms project.
import os
DEBUG = False
TEMPLATE_DEBUG = DEBUG
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
ADMINS = []
MANAGERS = ADMINS
if DEBUG:
DATABASES = {
'default': {
'ENGINE': 'django.db.backend... | |
<|file_name|>client_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENS... | |
<|file_name|>help.option.ts<|end_file_name|><|fim▁begin|>import {Option} from "./option";
<|fim▁hole|>export class HelpOption extends Option {
/**
*
*/
constructor() {
super();
this.shortName = 'h';
this.longName = 'help';
this.argument = '';
}
}<|fim▁end|> | |
<|file_name|>compile.js<|end_file_name|><|fim▁begin|>/*
* oskari-compile
*/
module.exports = function(grunt) {
grunt.registerMultiTask('compile', 'Compile appsetup js', function() {
var starttime = (new Date()).getTime();
var options = this.data.options;
// Run some sync stuff.
... | }
var fs = require('fs'),
UglifyJS = require('uglify-js'), |
<|file_name|>exception.rs<|end_file_name|><|fim▁begin|>//! Exceptions
use asm;
<|fim▁hole|> /// Non-maskable interrupt
pub fn __nmi();
/// Hard fault
pub fn __hard_fault();
}
/// Default exception handler
#[no_mangle]
pub unsafe extern "C" fn __default_handler() {
asm::bkpt();
}
/// Program entry ... | extern "C" {
/// Reset
pub fn start() -> !; |
<|file_name|>list sort strings.java<|end_file_name|><|fim▁begin|>//<|fim▁hole|>import java.util.Comparator;
abc.sort(Comparator.naturalOrder());
//<|fim▁end|> | |
<|file_name|>account.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.models import AnonymousUser
from core.models import Identity
<|fim▁hole|>from api.v2.views.base import AdminAuthViewSet
class AccountViewSet(AdminAuthViewSet):
"""
API endpoint that allows providers to be viewed or edited.
"""
... | from api.v2.serializers.post import AccountSerializer |
<|file_name|>resampled_source.cc<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2007-2017 Paul Davis <paul@linuxaudiosystems.com>
* Copyright (C) 2008-2011 David Robillard <d@drobilla.net>
* Copyright (C) 2010 Carl Hetherington <carl@carlh.net>
* Copyright (C) 2013-2016 John Emmas <john@creativepost.co.uk>
* Copy... | _src_data.input_frames = 0;
_src_data.data_in = _input; |
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>module.exports = function(grunt) {
grunt.initConfig({
// !! This is the name of the task 'requirejs' (grunt-contrib-requirejs module)
requirejs: {
dist: {
// !! You can drop your app.build.js config wholesale into 'options'
options:... | } |
<|file_name|>joystick_controller.py<|end_file_name|><|fim▁begin|>import sdl2
from mgl2d.input.game_controller import GameController
class JoystickController(GameController):
_DEBUG_CONTROLLER = False
AXIS_DEAD_ZONE = 4000
AXIS_MIN_VALUE = -32768
AXIS_MAX_VALUE = 32767
def __init__(self):
... | sdl2.SDL_GameControllerClose(self._sdl_controller)
self._sdl_controller = None
self._sdl_joystick = None
self._sdl_joystick_id = None |
<|file_name|>push-animator.js<|end_file_name|><|fim▁begin|>/*
Copyright 2013-2015 ASIAL CORPORATION
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
Un... | .wait(this.delay)
.queue({
display: 'none' |
<|file_name|>worker.js<|end_file_name|><|fim▁begin|>// The worker we construct depends on the environment we're in (nodejs or webbrowser);
module.exports = function makeChessWorker() {
try {
// Reference error if in nodejs
Worker;
const worker = new Worker('scalachessworker.js');
ret... | } catch (e) {
const rootDir = `${__dirname.replace('ctrl', '')}/`;
const path =`${rootDir}vendor/scalachessjs/scalachess.js`;
const ChessWorker = require('tiny-worker'); |
<|file_name|>position.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/. */
//! Generic types for CSS handling of specified and compute... | ToAnimatedZero, |
<|file_name|>options.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# * Copyright (C) 2012-2014 Croissance Commune
# * Authors:
# * Arezki Feth <f.a@majerti.fr>;
# * Miotte Julien <j.m@majerti.fr>;
# * TJEBBES Gaston <g.t@majerti.fr>
#
# This file is part of Autonomie : Progiciel de gestion d... | return {'polymorphic_identity': camel_case_to_name(name)} |
<|file_name|>4-first-mesh.js<|end_file_name|><|fim▁begin|>var Mesh = require('../../lib/mesh');
var config = {
name: 'remoteMesh',
dataLayer: {
port: 3001,
authTokenSecret: 'a256a2fd43bf441483c5177fc85fd9d3',
systemSecret: 'mesh',
secure: true,
adminPassword: 'guessme',
},
endpoints: {},
... |
console.log('READY');
}); |
<|file_name|>simplysupplements.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import os
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from urllib impor... | import re |
<|file_name|>sftp.py<|end_file_name|><|fim▁begin|>import os
import stat
import socket
import paramiko
from transfert.statresult import stat_result
from transfert.resources._resource import _Resource
from transfert.exceptions import TransfertFileExistsError, TransfertFileNotFoundError
class SftpResource(_Resource):
... | return False |
<|file_name|>soy2html.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# This script is designed to be invoked by soy2html.sh.
# Usage:
#
# buck/docs$ python soy2html.py <output_dir>
#
# This will write all of the static content to the specified output directory.
# You may want to verify that things worked co... | output_subdir = os.path.join(output_dir, path[:last_slash])
if not os.path.exists(output_subdir):
os.makedirs(output_subdir) |
<|file_name|>1_generateImage.py<|end_file_name|><|fim▁begin|># coding: utf-8
import random
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
import sys
import os
# how many pictures to generate
num = 10
if len(sys.argv) > 1:
num = int(sys.argv[1])
<|fim▁hole|> '''
generate one line... | def genline(text, font, filename): |
<|file_name|>CertificateExpiredExceptionTest.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses ... | public CertificateExpiredExceptionTest(String arg0) {
super(arg0); |
<|file_name|>data-source.js<|end_file_name|><|fim▁begin|>const escapeStringRegexp = require('escape-string-regexp');
const query = require('../query/query');
const Sort = require('../helpers/sort');
const StringScore = require('../helpers/string-score');
const DataSource = {
cells: (name) => {
return new Promise... | ;
}
});
}, |
<|file_name|>ProductCreate.java<|end_file_name|><|fim▁begin|>package weixin.popular.bean.scan.crud;
import weixin.popular.bean.scan.base.ProductGet;<|fim▁hole|>public class ProductCreate extends ProductGet {
private BrandInfo brand_info;
public BrandInfo getBrand_info() {
return brand_info;
}
... | import weixin.popular.bean.scan.info.BrandInfo;
|
<|file_name|>services.js<|end_file_name|><|fim▁begin|>const https = require('https')
const cookie = require('cookie');
var exports = module.exports = {}
exports.getResponseHeaders = function(httpOptions, formData) {
if (formData) {
httpOptions.headers = formData.getHeaders()
}
return new Promise((resolve,... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from zope.i18nmessageid import MessageFactory
PloneMessageFactory = MessageFactory('plone')<|fim▁hole|>
from Products.CMFCore.permissions import setDefaultRoles
setDefaultRoles('signature.portlets.gdsignature: Add GroupDocs Signature portlet',
('Mana... | |
<|file_name|>compat.py<|end_file_name|><|fim▁begin|># flake8: noqa
###############################################################################
# Compat file to import the correct modules for each platform and python
# version.
#
# author: Thomas Moreau and Olivier grisel
#
import sys<|fim▁hole|> import Queue as ... |
if sys.version_info[:2] >= (3, 3):
import queue
else: |
<|file_name|>events.py<|end_file_name|><|fim▁begin|>#
# Copyright 2015-2016 Red Hat, Inc.
#<|fim▁hole|># This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 2 of the License, or
... | |
<|file_name|>address-create.component.spec.ts<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2014-2021 Bjoern Kimminich.
* SPDX-License-Identifier: MIT
*/
import { TranslateModule, TranslateService } from '@ngx-translate/core'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { MatCardM... | fixture.detectChanges()
})
it('should create', () => { |
<|file_name|>Destructor.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | # TODO : Faire l'agent destructeur |
<|file_name|>platform.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.
*---------... | |
<|file_name|>p1.rs<|end_file_name|><|fim▁begin|>use rust_utils::*;
pub fn main() {
let decoded = to_bytes::from_hex("49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d");
let encoded = from_bytes::to_b64(&decoded);
let matches = encoded == "SSdtIGtpbGxpbmcgeW... | println!("{}\nEncoded string matches: {}", encoded, matches);
} |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'CryptoKnocker.views.home', name='home'),
# url(r'^blog/', includ... | url(r'^management/$', "management.views.index"),
url(r'^management/login$', "management.views.user_login"),
url(r'^logout/$', "management.views.user_logout"),
url(r'^management/registration/$', "management.views.registration"), |
<|file_name|>TestMriServer.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import unittest
from mri import MriServe... | |
<|file_name|>superclass.py<|end_file_name|><|fim▁begin|>class Foo:
def __init__(self):
pass
class Bar(Foo):
pass<|fim▁hole|>
Bar()
#<ref><|fim▁end|> | |
<|file_name|>msvs_emulation.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primaril... | else:
return None
def GetNoImportLibrary(self, config):
|
<|file_name|>vlantransparent.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 Cisco Systems, Inc. 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
#
# ... | """Vlan Transparency not supported by all mechanism drivers."""
message = _("Backend does not support VLAN Transparency.") |
<|file_name|>jquery.atwho.js<|end_file_name|><|fim▁begin|>/*
Implement Github like autocomplete mentions
http://ichord.github.com/At.js
Copyright (c) 2013 chord.luo@gmail.com
Licensed under the MIT license.
*/
/*
本插件操作 textarea 或者 input 内的插入符
只实现了获得插入符在文本框中的位置,我设置
插入符的位置.
*/
/**
* --------------------
* V... | view.prev(); |
<|file_name|>tower_of_hanoi.rs<|end_file_name|><|fim▁begin|>fn main() {
tower_of_hanoi(5,"A","C","B");
}
fn tower_of_hanoi(n:u32, from: &str, to: &str, aux: &str) {
if n >= 1 {<|fim▁hole|> println!("Move {}, from: {} to from {}",n,from,to );
tower_of_hanoi(n-1,aux,to,from);
}
}<|fim▁end|> | tower_of_hanoi(n-1, from, aux, to); |
<|file_name|>backend.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## publi... |
return value |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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/.
#
# Copyr... | super(AgentCreationForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_tag = False |
<|file_name|>cdn.js<|end_file_name|><|fim▁begin|>(() => {
// packages/alpinejs/src/scheduler.js
var flushPending = false;
var flushing = false;
var queue = [];
function scheduler(callback) {
queueJob(callback);
}
function queueJob(job) {
if (!queue.includes(job))
queue.push(job);
queueFl... | transition(el, setFunction, {
during: this.enter.during, |
<|file_name|>GetRest.java<|end_file_name|><|fim▁begin|>package org.elasticsearch.action.get;
import com.bazaarvoice.elasticsearch.client.core.spi.RestExecutor;
import com.bazaarvoice.elasticsearch.client.core.spi.RestResponse;
import com.bazaarvoice.elasticsearch.client.core.util.UrlBuilder;
import org.elasticsearch.a... |
/**
* The inverse of {@link org.elasticsearch.rest.action.get.RestGetAction} |
<|file_name|>lint-output-format.rs<|end_file_name|><|fim▁begin|>// Copyright 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.... | // aux-build:lint_output_format.rs
extern crate lint_output_format; //~ ERROR: use of unmarked item
use lint_output_format::{foo, bar}; |
<|file_name|>opening-tag.hpp<|end_file_name|><|fim▁begin|>// opening-tag.hpp
// Started 14 Aug 2018<|fim▁hole|>namespace client {
// namespace fusion = boost::fusion;
// namespace phoenix = boost::phoenix;
namespace qi = boost::spirit::qi;
namespace ascii = boost::spirit::ascii;
template<typename Iterator>
struc... | #pragma once
#include <string>
#include <boost/spirit/include/qi.hpp>
|
<|file_name|>updater.py<|end_file_name|><|fim▁begin|>import urllib.request
import pickle
import sys
import ast
try:
import variables as v
except:
class var():
def __init__(self):
self.screen = None
v = var()
import pygame as py
class textLabel(py.sprite.Sprite):
def __... | z.extractall("Update/")
|
<|file_name|>fudge.py<|end_file_name|><|fim▁begin|># -*- mode: python; indent-tabs-mode: nil; tab-width: 3 -*-
# vim: set tabstop=3 shiftwidth=3 expandtab:
#
# Copyright (C) 2001-2005 Ichiro Fujinaga, Michael Droettboom,
# and Karl MacMillan
#
# This program is free software; you can redistribu... | int.__init__(self, value) |
<|file_name|>filepath-utils.ts<|end_file_name|><|fim▁begin|>import { lstatSync } from 'fs';
import { sep } from 'path';
const reNormalize = sep !== '/' ? new RegExp(sep.replace(/\\/g, '\\\\'), 'g') : null;
import logUtils from '../utils/log-utils';
const log = logUtils.log;
const normalizePath = function(pat... | };
}
return false;
|
<|file_name|>slugify.go<|end_file_name|><|fim▁begin|>package slugify
import (
"bytes"
"strings"
"unicode/utf8"
)
var (
defaultSlugger = New(Configuration{})
)
// Slugify creates the slug for a given value
func Slugify(value string) string {
return defaultSlugger.Slugify(value)
}
func validCharacter(c rune) boo... | 'ĸ': "k",
'Ĺ': "l", |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# 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 b... | # import os
# import sys |
<|file_name|>MultiChangeHistoryValues.java<|end_file_name|><|fim▁begin|>package org.scada_lts.dao.model.multichangehistory;
import java.util.Objects;
/**
* @author grzegorz.bylica@abilit.eu on 16.10.2019
*/
public class MultiChangeHistoryValues {
private int id;
private int userId;
private String user... |
@Override
public boolean equals(Object o) { |
<|file_name|>akamai_test.go<|end_file_name|><|fim▁begin|>// Package akamai provideds a gramework.Behind implementation
// developed for Gramework.
// This is not an official Akamai-supported implementation.
// If you having any issues with this package, please
// consider to contact Gramework support first.
// Akamai d... | // Note: those IP CIDRs are fake. |
<|file_name|>clientdetails.component.ts<|end_file_name|><|fim▁begin|>import 'rxjs/add/operator/switchMap';
import {Component, ElementRef, OnInit, AfterViewInit} from '@angular/core';
import { Location } from '@angular/common';
import { LocalDataSource } from 'ng2-smart-table';
import { ActivatedRoute, Params } from... | this.inputDeliveryPostcode = res.json()["items"][0]["postal_postcode"];
// Address
var address = res.json()["items"][0]["address1"] + "," + res.json()["items"][0]["address2"] + "," + res.json()["items"][0]["city"] + "," + res.json()["items"][0]["state"]; |
<|file_name|>IfcSubContractResourceTypeEnum.java<|end_file_name|><|fim▁begin|><|fim▁hole|> * Copyright (C) 2009-2014 BIMserver.org
*
* 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 Software Foundation, e... | /** |
<|file_name|>rpcwallet.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "wallet.h"
#include "w... | throw std::runtime_error("Failed: Wallet must be unlocked.");
|
<|file_name|>chat.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2011, Regents of the University of California
# BSD license, See the COPYING file for more information
# Written by: Derek Kulinski <takeda@takeda.tk>
#
import curses, curses.wrapper, curses.textpad, threading, time, sys
from ChatNet import ChatNet, C... | gui = ChatGUI(sys.argv[1])
curses.wrapper(gui.curses_code) |
<|file_name|>rev_jac_sparsity.hpp<|end_file_name|><|fim▁begin|># ifndef CPPAD_CORE_REV_JAC_SPARSITY_HPP
# define CPPAD_CORE_REV_JAC_SPARSITY_HPP
/* --------------------------------------------------------------------------
CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
CppAD is distribu... | input_empty ,
! transpose , |
<|file_name|>todo.model.ts<|end_file_name|><|fim▁begin|>'use strict';<|fim▁hole|> done: boolean;
text: string;
}<|fim▁end|> |
export interface ITodo { |
<|file_name|>strconv.rs<|end_file_name|><|fim▁begin|>// Copyright 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/license... | 'e' | 'E' | 'p' | 'P' => {
exp_found = true;
break; // start of exponent |
<|file_name|>jvm.py<|end_file_name|><|fim▁begin|>"""
pygments.lexers.jvm
~~~~~~~~~~~~~~~~~~~
Pygments lexers for JVM languages.
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, i... |
# find the remaining variables |
<|file_name|>StandardDeviationExecutionModelRegressionAlgorithm.py<|end_file_name|><|fim▁begin|># QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ... | ### <summary> |
<|file_name|>unwind-box.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lice... | }
|
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pysia documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possibl... | #texinfo_no_detailmenu = False |
<|file_name|>development.js<|end_file_name|><|fim▁begin|>function normalizePort(val) {
var port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
return port;
}
return false;
}
var port = normalizePort(process.env.PORT || '3000');
<|fim▁... | module.exports = {
port: port,
db: 'mongodb://'+process.env.IP+'/nexus' |
<|file_name|>size_hint.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
use core::slice::SliceExt;
use core::slice::Iter;
// fn size_from_ptr<T>(_: *const T) -> usize {
// mem::size_of::<T>()
// }
// macro_rules! slice_offset {
// ($ptr... | |
<|file_name|>related_descriptors.py<|end_file_name|><|fim▁begin|>"""
Accessors for related objects.
When a field defines a relation between two models, each model class provides
an attribute to access related instances of the other model class (unless the
reverse accessor has been disabled with related_name='+').
Acc... | fk_val = self.target_field.get_foreign_related_value(obj)[0]
old_ids.add(fk_val)
else: |
<|file_name|>git.go<|end_file_name|><|fim▁begin|>package vcs
import (
"bytes"
"fmt"
"io"
"log"
"os/exec"
"path/filepath"
"strings"
)
const defaultRef = "master"
func init() {
Register(newGit, "git")
}
type GitDriver struct{}
func newGit(b []byte) (Driver, error) {
return &GitDriver{}, nil
}
func (g *GitD... | |
<|file_name|>ReplyActivity.java<|end_file_name|><|fim▁begin|>package bolianeducation.bolianchild.view;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import... | ToastUtil.showToast(this, "请输入回复内容"); |
<|file_name|>zfssaiscsi.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014, 2015, Oracle and/or its affiliates. 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... | if not self._verify_clone_size(snapshot, volume['size'] * units.Gi):
exception_msg = (_('Error verifying clone size on '
'Volume clone: %(clone)s '
'Size: %(size)d on' |
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>function initialize(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
exec: {
build: {
command: 'make build'
},
// 'build-types': { command: 'make build-types' },
... | },
nodemon: {
application: { |
<|file_name|>fast-forward.d.ts<|end_file_name|><|fim▁begin|>// TypeScript Version: 2.1
<|fim▁hole|><|fim▁end|> | import * as React from 'react';
import { IconBaseProps } from 'react-icon-base';
export default class FaFastForward extends React.Component<IconBaseProps, any> { } |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import Y... | do so via calling thisObj._set_unknown_subtlv() directly.
YANG Description: An unknown SubTLV within the context. Unknown Sub-TLV
are defined to be the set of SubTLVs that are not modelled |
<|file_name|>structured.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The Cockroach Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/L... | start := i |
<|file_name|>LeaderBoard.java<|end_file_name|><|fim▁begin|>package com.comp.ninti.sportsmanager;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.wi... | |
<|file_name|>vec.rs<|end_file_name|><|fim▁begin|>use std::vec::IntoIter;
use std::marker::PhantomData;
use super::{Set, SetManager};
use super::sort::SortManager;
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum Error {
IndexOutOfRange { index: usize, total: usize },
}
pub struct VecSetIter<T, E> {
iter:... | fn make_set(&mut self, size_hint: Option<usize>) -> Result<Self::S, Self::E> {
Ok(match size_hint { |
<|file_name|>filereader.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::bindings::cell::DomRefCell;
use crate::do... | label: Option<String>, |
<|file_name|>elastic.py<|end_file_name|><|fim▁begin|>from elasticsearch import Elasticsearch
from django.conf import settings
def get_es_client(silent=False):
"""
Returns the elasticsearch client which uses the configuration file
"""
es_client = Elasticsearch([settings.ELASTIC_SEARCH_HOST],
... | |
<|file_name|>amqp9_0.rs<|end_file_name|><|fim▁begin|>// Generated by build.rs script in amqp0-parser-nom
// Pre-generated files are used by default. Generation is done with the amqp0-codegen crate
//
// To regenerate, and not use pre-generated files, use: cargo --features="amqp0-build-parser"
// To format and replace t... | type Output = Self; |
<|file_name|>u32.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LI... | pub use core::u32::{BITS, BYTES, MIN, MAX};
uint_module!(u32) |
<|file_name|>Plugin.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Plugin.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... |
def __getstate__(self): |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms
from django.forms.forms import BoundField
from .helpers import LMIForAllClient
from .fields import MultiCharField
class FieldSet(object):
"""
Taken from stackoverflow.com/questions/10366745/django-form-field-grouping
Helper clas... | self, list(soc_codes), keyword)) |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>/*
* MaiKe Labs (2016 - 2026)
*
* Written by Jack Tan <jiankemeng@gmail.com>
*
* Connect VCC of the SSD1306 OLED to 3.3V
* Connect GND to Ground
* Connect SCL to i2c clock - GPIO21
* Connect SDA to i2c data - GPIO22
* Connect DC to GND (The scanned i2c ... | |
<|file_name|>split_queue_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The Cockroach Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/lice... | }
copy := *tc.rng.Desc()
copy.StartKey = test.start |
<|file_name|>IosHeart.js<|end_file_name|><|fim▁begin|>import React from 'react';
import IconBase from './../components/IconBase/IconBase';
export default class IosHeart extends React.Component {
render() {
if(this.props.bare) {
return <g>
<path d="M359.385,80C319.966,80,277.171,97.599,256,132.8C234.83,97.599,192.... | };IosHeart.defaultProps = {bare: false} |
<|file_name|>student-routing.module.ts<|end_file_name|><|fim▁begin|>import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';
import {StudentListComponent} from './student-list/student-list.component';
import {StudentDetailComponent} from './student-detail/student-detail.component';... | { |
<|file_name|>gofish.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import print_function
from builtins import input
import sys
import pmagpy.pmag as pmag
def main():
"""
NAME
gofish.py
DESCRIPTION
calculates fisher parameters from dec inc data
INPUT FORMAT
... | #
fpars=pmag.fisher_mean(DIs) |
<|file_name|>command.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2018 Pietro Albini
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your opt... | Ok((&captures[0]).parse()?)
}
}
|
<|file_name|>Exit.java<|end_file_name|><|fim▁begin|>package edu.isep.sixcolors.view.listener;
import edu.isep.sixcolors.model.Config;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* A popup window asking if the player want's to exit Six Colors
*/
public class Ex... | } |
<|file_name|>test_ironic.py<|end_file_name|><|fim▁begin|>#
# Copyright 2014 Red Hat, Inc
#
# Author: Chris Dent <chdent@redhat.com>
#
# 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
#
# ht... | modulo "voltage". |
<|file_name|>display_list_builder.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/. */
//! Builds display lists from flows and fragment... | create_perspective_matrix(d)
}
transform::ComputedOperation::Scale(sx, sy, sz) => { |
<|file_name|>brightnessfilter.rs<|end_file_name|><|fim▁begin|>#pragma version(1)
#pragma rs java_package_name(com.dss.renderscripttest)
float brightnessValue;<|fim▁hole|>rs_script gScript;
static int mImageWidth;
const uchar4 *gPixels;
void root(const uchar4 *v_in, uchar4 *v_out, const void *usrData, uint32_t x, uin... |
rs_allocation gIn;
rs_allocation gOut; |
<|file_name|>issue-4333.rs<|end_file_name|><|fim▁begin|>// Copyright 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/lice... |
fn main() {
let stdout = &io::stdout() as &io::WriterUtil;
stdout.write_line("Hello!"); |
<|file_name|>test_create_server.py<|end_file_name|><|fim▁begin|># Copyright 2012 OpenStack Foundation
# 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
#
# ... | {'uuid': net2['network']['id']},
{'uuid': net1['network']['id']}]
server_multi_nics = self.create_test_server( |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>/*
*Resize the graph container
*/
function resizegraph(){
var windowHeight = $( window ).innerHeight();
$("#stacked").css('min-height',(windowHeight * 0.35) );
}
//From facebook
window.fbAsyncInit = function(){
FB.init({
appId: facebook_api_key, status:... | }
});
|
<|file_name|>menudata.js<|end_file_name|><|fim▁begin|>/*
@licstart The following is the entire license notice for the
JavaScript code in this file.
Copyright (C) 1997-2019 by Dimitri van Heesch
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Pub... | |
<|file_name|>Vector.java<|end_file_name|><|fim▁begin|>package fr.aumgn.bukkitutils.geom;
import fr.aumgn.bukkitutils.geom.direction.VectorDirection;
import fr.aumgn.bukkitutils.geom.vector.VectorIterator;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.bukkit.Location;
import org.bukkit.World;
impor... | public double getX() { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.