prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>FormText.d.ts<|end_file_name|><|fim▁begin|>import * as React from 'react';
import { CSSModule } from '../index';
export type FormTextProps<T = {}> = React.HTMLAttributes<HTMLElement> & {
inline?: boolean;
tag?: React.ReactType;
color?: string;
className?: string;<|fim▁hole|>} & T;
declare class F... | cssModule?: CSSModule; |
<|file_name|>test_threadable.py<|end_file_name|><|fim▁begin|># Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.threadable}.
"""
from __future__ import division, absolute_import
import sys, pickle
try:
import threading
except ImportError:
threadingSkip = "... | threadable.synchronize(TestObject)
|
<|file_name|>eg2_real_world_data.py<|end_file_name|><|fim▁begin|>from collections import Counter
from imblearn.datasets import make_imbalance
from imblearn.metrics import classification_report_imbalanced
from imblearn.pipeline import make_pipeline
from imblearn.under_sampling import ClusterCentroids
from imblearn.unde... | ax1 = fig.add_subplot(211)
ax1.scatter_plot(X[:, [1, 2]], y, pipeline)
# print (classification_report_imbalanced(y_test, pipeline.predict(X_test)))
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from AutoNetkit.examples.examples import *
import AutoNetkit.examples.examples |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>casper.test.begin('BAS GeoMap Features site shows a home page and has 1 or more Features', 5, function suite(test) {
casper.start("https://geomap-features.web.bas.ac.uk", function() {
// Basic checks
test.assertTitle("BAS GeoMap Features", "homepage ... | }); |
<|file_name|>mapentity.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# File: mapentity.py
# import pygtk
# pygtk.require('2.0')
from gi.repository import Gtk, Gdk
class MapEntity:
# self.x = None<|fim▁hole|>
def getCoords(self):
return self.x,self.y
def getx(self):
return self.x
def gety(self):
return... | # self.y = None
# self.name = None
# self.texture = None |
<|file_name|>ipkernel.py<|end_file_name|><|fim▁begin|>"""The IPython kernel implementation"""
import getpass
import sys
import traceback
from IPython.core import release
from IPython.html.widgets import Widget
from IPython.utils.py3compat import builtin_mod, PY3
from IPython.utils.tokenutil import token_at_cursor, li... | "Exception in apply request:\n%s", '\n'.join(reply_content['traceback']))
result_buf = [] |
<|file_name|>electrode_ocv_gen.py<|end_file_name|><|fim▁begin|>import pickle
from matplotlib import pyplot as plt
plt.style.use('classic')
import matplotlib as mpl
fs = 12.
fw = 'bold'
mpl.rc('lines', linewidth=2., color='k')
mpl.rc('font', size=fs, weight=fw, family='Arial')
mpl.rc('legend', fontsize='small')
imp... | |
<|file_name|>archive_migration.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.7
#! -*- encoding: utf-8 -*-
import simplejson as json
import threading
from sqlobject import SQLObject, connectionForURI
from sqlobject.sqlbuilder import Insert, Select, Delete
from octopus.dispatcher.model.node import FolderNod... | RenderNodes.q.ramSize.fieldName: element.ramSize,
RenderNodes.q.caracteristics.fieldName: json.dumps(element.caracteristics),
RenderNodes.q.performance.fieldName: element.performance}
insertElementIntoStatDB(RenderNodes,fields) |
<|file_name|>plugin.js<|end_file_name|><|fim▁begin|>// @require core/widget/helpers.js
(function ( $, _, Svelto ) {
/* PLUGIN */
let Plugin = {
call ( Widget, $ele, args ) {
let options = args[0],
isMethodCall = ( _.isString ( options ) && options.charAt ( 0 ) !== '_' ); // Methods starting... | if ( !_.isNil ( returnValue ) ) return returnValue;
} |
<|file_name|>AnimationToolbox.hh<|end_file_name|><|fim▁begin|>#include <ui_animationControls.hh>
#if QT_VERSION >= 0x050000 <|fim▁hole|>#endif
class AnimationToolboxWidget : public QWidget, public Ui::AnimationControls
{
Q_OBJECT
public:
AnimationToolboxWidget(QWidget *parent = 0);
};<|fim▁end|> | #include <QtWidgets>
#else
#include <QtGui> |
<|file_name|>stack1.go<|end_file_name|><|fim▁begin|>// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package runtime
import "unsafe"
const (
// stackDebug == 0: no logging
// == 1: logging of pe... | casgstatus(gp, _Gwaiting, _Gcopystack)
// The concurrent GC will not scan the stack while we are doing the copy since |
<|file_name|>test_fields.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
from django import forms
try:
from django.utils.encoding import smart_unicode as smart_text
except ImportError:
from django.utils.encoding import smart_text
from cached_modelforms.tests.utils import SettingsTestCase
from cached_mo... | # ``choices`` should be a list as ``[(smart_text(pk1), smart_text(obj1)), ...]``
self.assertEqual(
choices_without_empty_label,
[(smart_text(x.pk), smart_text(x)) for x in self.cached_list] |
<|file_name|>test_v3_two_factor_auth.py<|end_file_name|><|fim▁begin|># Copyright (C) 2015 Universidad Politecnica de Madrid
#
# 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... | self._create_two_factor_key(user_id=self.user_id)
self._delete_two_factor_key(user_id=self.user_id)
|
<|file_name|>models.go<|end_file_name|><|fim▁begin|>package main
import (
"errors"
"log"
"os"
_ "github.com/go-sql-driver/mysql"
"github.com/go-xorm/xorm"
)
// Account 银行账户
type Account struct {
Id int64
Name string `xorm:"unique"`
Balance float64
Version int `xorm:"version"` // 乐观锁
}
// BeforeInse... | _, err := x.Insert(&Account{Name: name, Balance: balance})
return err
}
|
<|file_name|>selectionSort.py<|end_file_name|><|fim▁begin|># idea is to scan the elments from left to right
# partition the list into two lists
# one with emtpy [ where we shall keep things sorted ] and the other the given list
# scan and swap elments in two lists
def ss(a):
for i in range(0,len(a)-1):
sma... | a=[3,4,3,5,-1]
ss(a) |
<|file_name|>config.js<|end_file_name|><|fim▁begin|>'use strict';
var program = require('commander');
var Q = require('q');
var fs = require('fs');
var resolve = require('path').resolve;
var stat = Q.denodeify(fs.stat);
var readFile = Q.denodeify(fs.readFile);
var writeFile = Q.denodeify(fs.writeFile);<|fim▁hole|>
pro... | var assign = require('./util/assign'); |
<|file_name|>dependencies.go<|end_file_name|><|fim▁begin|>// Code generated by zanzibar
// @generated
// Copyright (c) 2018 Uber Technologies, Inc.
//
// 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 t... | // Dependencies contains dependencies for the bar client module |
<|file_name|>node.js<|end_file_name|><|fim▁begin|>import {Parser} from "./state"
import {SourceLocation} from "./locutil"
export class Node {
constructor(parser, pos, loc) {<|fim▁hole|> this.end = 0
if (parser.options.locations)
this.loc = new SourceLocation(parser, loc)
if (parser.options.directSou... | this.type = ""
this.start = pos |
<|file_name|>accounts.py<|end_file_name|><|fim▁begin|>"""
sentry.web.forms.accounts
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import pytz
import six
from datetime import... | label=_('Stacktrace order'),
choices=( |
<|file_name|>require_recaptcha.js<|end_file_name|><|fim▁begin|>function recaptcha_verified () {<|fim▁hole|>}
function recaptcha_expired () {
document.querySelector('.recaptcha_submit').setAttribute('disabled', 'disabled')
}<|fim▁end|> | document.querySelector('.recaptcha_submit').removeAttribute('disabled') |
<|file_name|>feature_nulldummy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2016-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test NULLDUMMY softfork.
Connect to a s... | tx.vin[0].scriptSig = CScript(newscript) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import IRT
print "Loading comatmor version 0.0.1"<|fim▁end|> | # module includes
import elliptic
import heat |
<|file_name|>RenderTableSection.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 1997 Martin Jones (mjones@kde.org)
* (C) 1997 Torben Weis (weis@kde.org)
* (C) 1998 Waldo Bastian (bastian@kde.org)
* (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@k... | cell->setNeedsLayout(true);
if (!table()->selfNeedsLayout() && cell->checkForRepaintDuringLayout()) {
if (!statePusher.didPush()) {
// Technically, we should also push state for the row, but since |
<|file_name|>vaccines.js<|end_file_name|><|fim▁begin|>import { fromJS, OrderedMap } from 'immutable';
const vaccines = fromJS([
{
name: 'AVA (BioThrax)',
id: '8b013618-439e-4829-b88f-98a44b420ee8',
diseases: ['Anthrax'],
},
{
name: 'VAR (Varivax)',
id: 'f3e08a56-003c-4b46-9dea-216298401ca0',
... | }, |
<|file_name|>InvFFT.java<|end_file_name|><|fim▁begin|>/*
* Zorbage: an algebraic data hierarchy for use in numeric processing.
*
* Copyright (c) 2016-2021 Barry DeZonia All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the foll... | long aSize = a.size();
long bSize = b.size(); |
<|file_name|>parse-server.py<|end_file_name|><|fim▁begin|>import json
import sys
import requests
from collections import Counter
from wapy.api import Wapy
from http.server import BaseHTTPRequestHandler, HTTPServer
wapy = Wapy('frt6ajvkqm4aexwjksrukrey')
def removes(yes):
no = ["Walmart.com", ".", ","]
for x i... | for x in c: |
<|file_name|>unreachable-arm.rs<|end_file_name|><|fim▁begin|>#![feature(box_patterns)]
#![feature(box_syntax)]
#![allow(dead_code)]
#![deny(unreachable_patterns)]
enum Foo { A(Box<Foo>, isize), B(usize), }
fn main() {
match Foo::B(1) {<|fim▁hole|> Foo::A(_, 1) => { } //~ ERROR unreachable pattern
_... | Foo::B(_) | Foo::A(box _, 1) => { } |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># Standard library imports
import logging
# Third party imports
from django.contrib import messages
from django.contrib.auth.decorators import user_passes_test
from django.contrib.admin.utils import NestedObjects
from django.urls import reverse
from django.db import D... | form = DeleteGITHUBConfForm(instance=github_instance) |
<|file_name|>components.py<|end_file_name|><|fim▁begin|>"""
Checking for connected components in a graph.
"""
__author__ = "Sergio J. Rey <srey@asu.edu>"
__all__ = ["check_contiguity"]
from operator import lt
def is_component(w, ids):
"""Check if the set of ids form a single connected component
Parameters
... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8; -*-
#
# @file models.py
# @brief coll-gate accession module models.
# @author Frédéric SCHERMA (INRA UMR1095), Medhi BOULNEMOUR (INRA UMR1095)
# @date 2016-09-01
# @copyright Copyright (c) 2016 INRA/CIRAD
# @license MIT (see LICENSE file)
# @detai... | |
<|file_name|>WSQueryImpl.java<|end_file_name|><|fim▁begin|><|fim▁hole|> * Copyright SAIC
*
* Distributed under the OSI-approved BSD 3-Clause License.
* See http://ncip.github.com/cacore-sdk-pre411/LICENSE.txt for details.
*/
package gov.nih.nci.system.webservice;
import gov.nih.nci.system.applicationservice.Ap... | /*L
* Copyright Ekagra Software Technologies Ltd. |
<|file_name|>grammar.rs<|end_file_name|><|fim▁begin|>use crate::parser::Parser;
use crate::syntax::SyntaxKind;
pub(crate) mod atom;
pub(crate) mod block;
pub(crate) mod container;
pub(crate) mod error_recovery;
pub(crate) mod expr;
pub(crate) mod items;
pub(crate) mod macros;
pub(crate) mod stmt;
pub(crate) mod var;
<... | pub(super) fn root(p: &mut Parser) {
let m = p.mark();
self::block::parse_block(p, false);
m.complete(p, SyntaxKind::NODE_SOURCE_FILE); |
<|file_name|>tree.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use cargo::ops::tree::{self, EdgeKind};
use cargo::ops::Packages;
use cargo::util::print_available_packages;
use cargo::util::CargoResult;
use std::collections::HashSet;
use std::str::FromStr;
pub fn cli() -> App {
subcommand("tree")
.about("Dis... | use crate::cli;
use crate::command_prelude::*;
use anyhow::{bail, format_err};
use cargo::core::dependency::DepKind; |
<|file_name|>htmlstyleelement.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 cssparser::Parser as CssParser;
use dom::binding... | |
<|file_name|>category_tags.py<|end_file_name|><|fim▁begin|>from django import template
from django.shortcuts import render_to_response, redirect, get_object_or_404
# from product.models import Slide
register = template.Library()
# @register.inclusion_tag('slides/slides.html')
# def get_main_slides():
# sli... | |
<|file_name|>buffer.rs<|end_file_name|><|fim▁begin|>use buffer::{BufferView, BufferViewAny, BufferType, BufferCreationError};
use uniforms::{AsUniformValue, UniformValue, UniformBlock, UniformType};
use std::ops::{Deref, DerefMut};
use backend::Facade;
/// Buffer that contains a uniform block.
#[derive(Debug)]
pub s... | })
} |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var DB = require('./lib/db.js');
function SQLContext(options) {
this.readOnly = options.isReadOnly;
this.db = options.db;
}
function _put(db, key, value, callback) {
db.createOrUpdate(key, value, function(err) {
if(err) {
return callback(err);
}
... | |
<|file_name|>axis_demux_wrap.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Generates an AXI Stream demux wrapper with the specified number of ports
"""
import argparse
from jinja2 import Template
def main():
parser = argparse.ArgumentParser(description=__doc__.strip())
parser.add_argument('-p', '... | |
<|file_name|>nmap_scannner.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
Author: Christopher Duffy
Date: February 2015
Name: nmap_scanner.py
Purpose: To scan a network
Copyright (c) 2015, Christopher Duffy All rights reserved.
Redistribution and use in source and binary forms, with or without modification... | print("The host's IP address is %s and it's hostname is %s") % (host, scanner[host].hostname()) |
<|file_name|>mod.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/licens... | closure_id: ast::NodeId,
closure_span: Span,
upvar_def: ast::Def)
-> mc::cmt { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2001 by Tarjei Mikkelsen. All rights reserved.
# Copyright 2007 by Michiel de Hoon. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as p... | |
<|file_name|>test_storage.py<|end_file_name|><|fim▁begin|>from nose.plugins.skip import SkipTest<|fim▁hole|>from oyster.storage.gridfs import GridFSStorage
from oyster.storage.dummy import DummyStorage
def _simple_storage_test(StorageCls):
kernel = Kernel(mongo_db='oyster_test')
kernel.doc_classes['default'] ... |
from oyster.conf import settings
from oyster.core import Kernel |
<|file_name|>Cache.py<|end_file_name|><|fim▁begin|>from __future__ import generators
import ConfigParser
import copy
import email.Message
import email.Parser
import email.Utils
import errno
import hmac
import inspect
import md5
import os
import popen2
import random
import re
import select
import sha
import shutil
impor... | # see if they've all been filled or timed out
# debug(str(self.req))
if not self.req:
# okay, all done -- touch the file so ISFS knows |
<|file_name|>model.py<|end_file_name|><|fim▁begin|>import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'MODEL0912503622.xml')
<|fim▁hole|> sbmlString = f.read()
def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return... | with open(sbmlFilePath,'r') as f: |
<|file_name|>community-modlog.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import {Router, ActivatedRoute} from '@angular/router';
import {CommunityService} from '../../services';
import {ToasterService} from 'angular2-toaster/angular2-toaster';
import {CommunityRole, Com... | styleUrls: ['./community-modlog.component.css'],
})
export class CommunityModlogComponent implements OnInit { |
<|file_name|>setup.js<|end_file_name|><|fim▁begin|>//configure requirejs
var requirejs = require('requirejs');<|fim▁hole|>global.RENDER = false;
//export requirejs
module.exports = {
require: requirejs
};<|fim▁end|> | requirejs.config({ baseUrl: __dirname + '/../javascripts', nodeRequire: require });
//turn off rendering for commandline unit tests
var global = requirejs('global'); |
<|file_name|>weka.py<|end_file_name|><|fim▁begin|># Natural Language Toolkit: Interface to Weka Classsifiers
#
# Copyright (C) 2001-2008 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: naivebayes.py 2063 2... | s = '\n@DATA\n'
for (tok, label) in tokens: |
<|file_name|>SMB2_Header.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# ============================================================================ #
# SMB2_Header.py
#
# Copyright:
# Copyright (C) 2016 by Christopher R. Hertel
#
# $Id: SMB2_Header.py; 2019-06-18 17:56:20 -0... | |
<|file_name|>aws_lambda.py<|end_file_name|><|fim▁begin|>import hashlib
import json
import logging
import os
import subprocess
import sys
import time
from collections import defaultdict
from shutil import copy
from shutil import copyfile
from shutil import copystat
from shutil import copytree
from tempfile import mkdte... | aws_secret_access_key=aws_secret_access_key,
region_name=region,
) |
<|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... | # sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
|
<|file_name|>train_utils.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Un... | |
<|file_name|>neutron_port_update.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# This script updates the allowed address pairs in Neutron with the
# 'neutron port-update' command. This is required by Calico in OpenStack,
# otherwise BGP will not be working. We query OpenStack API directly to prevent
# installin... | r = requests.put(auth_url, headers=headers, data=json.dumps(payload))
parsed_json = json.loads(r.text) |
<|file_name|>type.js<|end_file_name|><|fim▁begin|>module.exports = {
name: 'basis.type',
test: [
require('./type/string.js'),
require('./type/number.js'),
require('./type/int.js'),
require('./type/enum.js'),
require('./type/array.js'),
require('./type/object.js'),
require('./type/date.js... |
assert(!warnedAgain); |
<|file_name|>url_scraper_dict.py<|end_file_name|><|fim▁begin|>UL_CATEGORY_LI = '//ul[@class="category"]/li'
H2_A_TITLELINK = './h2/a[@class="titlelink"]'
SPAN_A_TITLELINK = './span/a[@class="titlelink"]'
DIV_BODYFIELD_P = '//div[contains(@class,"bodyfield")]/p'
CATEGORY_H2_XPATH = [ UL_CATEGORY_LI, H2_A_TITLELINK ]
BO... | |
<|file_name|>preferences.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""
Preferences Frame
Copyright (c) 2014, 2015 Andrew Hawkins
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 r... | flag=wx.BOTTOM|wx.ALIGN_RIGHT, border=5) |
<|file_name|>pearson-3d-main.cpp<|end_file_name|><|fim▁begin|>#include <algorithm>
#include <map>
#include <math.h>
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#ifndef HUGE_JOB_MODE
#include <fj_tool/fapp.h>
#include <fjcoll.h>
#endif
using namespace std;
#include ... | V[ix][iy][iz] = 0.0;
double g=0;
for (int i=0;i<NI*NJ;++i) {
double oz=ozs[i], oy=oys[i],ox=oxs[i]; |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>// (C) Copyright 2009, Chong Wang, David Blei and Li Fei-Fei
// written by Chong Wang, chongw@cs.princeton.edu
// This file is part of slda.
// slda is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as pu... | settings setting;
char * setting_filename = argv[4];
printf("setting_filename %s\n", setting_filename);
|
<|file_name|>condvar.rs<|end_file_name|><|fim▁begin|>// Copyright 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... | }
|
<|file_name|>types.py<|end_file_name|><|fim▁begin|># Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (... | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT |
<|file_name|>zhttpto.rs<|end_file_name|><|fim▁begin|>//
// zhttpto.rs
//
// Starting code for PS1
// Running on Rust 0.9
//
// Note that this code has serious security risks! You should not run it
// on any system with access to sensitive files.
//
// University of Virginia - cs4414 Spring 2014
// Weilin Xu and Davi... | |
<|file_name|>viewport_array.py<|end_file_name|><|fim▁begin|>from OpenGLCffi.GLES3 import params
@params(api='gles3', prms=['first', 'count', 'v'])
def glViewportArrayvNV(first, count, v):
pass
<|fim▁hole|>@params(api='gles3', prms=['index', 'x', 'y', 'w', 'h'])
def glViewportIndexedfNV(index, x, y, w, h):
pass
@pa... | |
<|file_name|>MessageDigestHashFunctionTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2011 The Guava 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.ap... | |
<|file_name|>export.filter.func.import.js<|end_file_name|><|fim▁begin|>require("kaoscript/register");
var Type = require("@kaoscript/runtime").Type;
module.exports = function() {
var Shape = require("../export/export.class.default.ks")().Shape;
function foobar() {
if(arguments.length === 1 && Type.isString(argument... | }
}; |
<|file_name|>rfc2045.rs<|end_file_name|><|fim▁begin|>//! Module for dealing with RFC2045 style headers.
use super::rfc5322::Rfc5322Parser;
use std::collections::HashMap;
/// Parser over RFC 2045 style headers.
///
/// Things of the style `value; param1=foo; param2="bar"`
pub struct Rfc2045Parser<'s> {
parser: Rfc... |
assert!(value == expected_value.to_string(), test.name);
assert!(parameters == expected_params, test.name);
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
run tests against a webserver running in the same reactor
NOTE: this test uses port 8888 on localhost
"""
import os
import ujson as json
import cyclone.httpclient
from twisted.internet import defer
from twisted.application import internet
from twisted.trial.un... | |
<|file_name|>backbone.states.js<|end_file_name|><|fim▁begin|>var State = Backbone.State = function(options) {
options || (options = {});
};
_.extend(State.prototype, Backbone.Events, {
classes: [],
before: null,
on: null,
after: null,
events: {},
triggers: [],
multistate: [],... | // Private method for cleaning up the previous state
_removeState: function( state ) {
this.events = _.difference( this.events, state.events ); |
<|file_name|>JavaFxControllerFieldSearcher.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2013 JetBrains s.r.o.
*
* 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.ap... | import com.intellij.util.Processor; |
<|file_name|>content.py<|end_file_name|><|fim▁begin|># coding: utf-8
from django.db import models
from django.utils.translation import ugettext_lazy as _, pgettext_lazy
class ContentBase(models.Model):
"""
Base class for models that share content attributes
The attributes added by this mixin are ``title`... | |
<|file_name|>compress.py<|end_file_name|><|fim▁begin|>"""
Demonstrates how the bz2 module may be used to create a compressed object
which represents a bitarray.
"""
import bz2
from bitarray import bitarray
def compress(ba):
"""
Given a bitarray, return an object which represents all information
within th... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var prependChar = '#';
var util = require('util');
function convertToLines(str) {
return str.split('\n').map(function(newStr) {
return prependChar + newStr;
});
}
var newConsole = {
log : function log() {
convertToLines(util.format.apply(this, arguments... | },
error : function error() {
convertToLines(util.format.apply(this, arguments)).forEach(function(line) {
console.error(line); |
<|file_name|>net.py<|end_file_name|><|fim▁begin|># Copyright 2018 Flight Lab 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
This works on both Linux and Windows platforms, and doesn't require working
internet connection. |
<|file_name|>bool.py<|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/.
from ..._input_field import InputField
class BoolInput(InputField):
... | It can be implemented as a switch or a checkbox, for example.
"""
_false_strings = ("f", "false") |
<|file_name|>Server.java<|end_file_name|><|fim▁begin|>/*
Copyright 2011-2012 Frederic Menou and others referred in AUTHORS file.
This file is part of Magrit.
Magrit 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 Fou... | public String getName() {
return "SSH Service";
} |
<|file_name|>context_processors.py<|end_file_name|><|fim▁begin|><|fim▁hole|>def site_news(request):
"""
Inserts the currently active news items into the template context.
This ignores MAX_SITE_NEWS_ITEMS.
"""
# Grab all active items in proper date/time range.
items = SiteNewsItem.current_an... | from django.conf import settings
from site_news.models import SiteNewsItem
|
<|file_name|>file_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 Google 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
http://www.apache.org/licenses/LICENSE-... |
func TestExtractFromDir(t *testing.T) {
manifest, expectedPod := ExampleManifestAndPod("1") |
<|file_name|>integration_tests.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Cinchapi Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | }
assert_equal(data.get(record1), expected)
assert_equal(data.get(record2), expected) |
<|file_name|>sinusoid_regression.py<|end_file_name|><|fim▁begin|>'''
This file loads in data from /data/interim/interim_data.hdf and then
applies a sinusoidal regression model to the temperature data to remove
the yearly predictable variation.
NOTE: This file is intended to be executed by make from the top
level of th... | '''
Loads in a pandas dataframe from the key location in the hdf store |
<|file_name|>en_tune.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys,time
import numpy as np
import bitarray
import tables as tb
import logging
import yaml
import matplotlib.pyplot as plt
import monopix_daq.scan_base as scan_base
import monopix_daq.analysis.interpreter as interpreter
local_config... | description=description, filters=self.filter_tables)
scan_param_id=0 |
<|file_name|>taylor.py<|end_file_name|><|fim▁begin|>''' A taylor series visualization graph. This example demonstrates
the ability of Bokeh for inputted expressions to reflect on a chart.
'''
import numpy as np
import sympy as sy
from bokeh.core.properties import value
from bokeh.io import curdoc
from bokeh.layouts i... | LegendItem(label=value(f"{expr}"), renderers=[line_f]),
LegendItem(label=value(f"taylor({expr})"), renderers=[line_t]),
]
p.add_layout(legend) |
<|file_name|>importfavs.ts<|end_file_name|><|fim▁begin|>import { RootState } from '../reducers';<|fim▁hole|><|fim▁end|> |
export const importfavsSelector = (s: RootState) => s.importfavs; |
<|file_name|>download.py<|end_file_name|><|fim▁begin|><|fim▁hole|>"""
Download NLTK data
"""
__author__ = "Manan Kalra"
__email__ = "manankalr29@gmail.com"
import nltk
nltk.download()<|fim▁end|> | #!/usr/bin/env python
|
<|file_name|>GetStockHistoryInfoTask.py<|end_file_name|><|fim▁begin|># coding=utf-8
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), "..")))
from db.MysqlUtil import initMysql, execute, select, batchInsert, disconnect
from common.JsonHelper import loadJsonConfig
from api.tushareApi i... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
const fs = require('fs');
const path = require('path');
const Router = require('koa-router');
const apiRouter = require('./api');
const ask = require('../lib/ask');
const config = require('config');
const indexFilePath = path.resolve(__dirname,... | }
module.exports = router; |
<|file_name|>rosalind_gs.py<|end_file_name|><|fim▁begin|>import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../tools'))
import files
import graphs
def main(argv):
k, Gs = files.read_graphs(argv[0])
sinks = []
for G in Gs:
n, m = G[:2]
edges = G[2]
node... | |
<|file_name|>async-auto-completer-test.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
/*
The Cedric's Swiss Knife (CSK) - CSK terminal toolbox test suite
Copyright (c) 2009 - 2015 Cédric Ronvel
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this so... | |
<|file_name|>34.py<|end_file_name|><|fim▁begin|>import json
with open("birthdays.json", "r") as damnJson:
birthDays = json.load(damnJson)
print("We know the birth days of: ")
for i in birthDays:
print(i)
print("\nWould you like to add or retrieve a birth day?")
lol = input().strip().lower()
if lol == "add":
perso... | |
<|file_name|>display.py<|end_file_name|><|fim▁begin|>def __load():
import imp, os, sys
ext = 'pygame/display.so'
for path in sys.path:
if not path.endswith('lib-dynload'):
continue
ext_path = os.path.join(path, ext)
if os.path.exists(ext_path):
mod = imp.load_... | else:
raise ImportError(repr(ext) + " not found")
__load() |
<|file_name|>0073_remove_product_order_index.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2.24 on 2021-10-02 14:40
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('products', '0072_product_order_index'),
]<|fim▁hole|> model_name='produc... |
operations = [
migrations.RemoveField( |
<|file_name|>Flyby.py<|end_file_name|><|fim▁begin|>import Gears as gears
from .. import *
try:
from OpenGL.GL import *
from OpenGL.GLU import *
except:
print ('ERROR: PyOpenGL not installed properly.')
import random
def box() :
glBegin(GL_QUADS)
glColor3f(0.0,1.0,0.0)
glVertex3f(1.0, 1.0,-1.0)
... | |
<|file_name|>hyperstart.go<|end_file_name|><|fim▁begin|>package libhyperstart
import (
"io"
"syscall"
hyperstartapi "github.com/hyperhq/runv/hyperstart/api/json"
)
type Hyperstart interface {
Close()
LastStreamSeq() uint64<|fim▁hole|> ProcessAsyncEvents() (<-chan hyperstartapi.ProcessAsyncEvent, error)
NewCont... |
APIVersion() (uint32, error) |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from django.utils import unittest
from restclients.test.uwnetid.subscription import EmailForwardingTest
from restclients.test.util.date_formator import formatorTest
from restclients.test.hfs.idcard import HfsTest
from restclients.test.library.mylibinfo import MyLibInf... | |
<|file_name|>schema.d.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* Options for Bazel Builder
*/
export interface Schema {... | * If true, watch the filesystem using ibazel.
*/ |
<|file_name|>test_person.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 Data... | |
<|file_name|>visit.rs<|end_file_name|><|fim▁begin|>use rustc_middle::thir::{self, *};
use rustc_middle::ty::Const;
pub trait Visitor<'a, 'tcx: 'a>: Sized {
fn thir(&self) -> &'a Thir<'tcx>;
fn visit_expr(&mut self, expr: &Expr<'tcx>) {
walk_expr(self, expr);
}
fn visit_stmt(&mut self, stmt: &... | |
<|file_name|>1763.js<|end_file_name|><|fim▁begin|>var __v=[
{
"Id": 3568,
"Panel": 1763,
"Name": "紋理動畫",<|fim▁hole|> "Sort": 0,
"Str": ""
},
{
"Id": 3569,
"Panel": 1763,
"Name": "相關API",
"Sort": 0,
"Str": ""
},
{
"Id": 3570,
"Panel": 1763,
"Name": "Example",
"Sort": 0,... | |
<|file_name|>util.js<|end_file_name|><|fim▁begin|>import { expect } from 'chai'
import browser from '../../src/util/browser'<|fim▁hole|>describe('util (node)', () => {
describe('browser', () => {
it('is false', () => {
expect(browser).to.be.false
})
})
})<|fim▁end|> | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># mailstat.utils
# Utilities and functions for the mailstat package
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Sun Dec 29 17:27:38 2013 -0600
#
# Copyright (C) 2013 Bengfort.com
# For license information, see LICENSE.txt<|fim▁hole|>#
# ID: _... | |
<|file_name|>nested.rs<|end_file_name|><|fim▁begin|>// edition:2018
// compile-flags: --crate-version 1.0.0
// @is nested.json "$.crate_version" \"1.0.0\"
// @is - "$.index[*][?(@.name=='nested')].kind" \"module\"
// @is - "$.index[*][?(@.name=='nested')].inner.is_crate" true
// @count - "$.index[*][?(@.name=='nested'... | } |
<|file_name|>Lambda.java<|end_file_name|><|fim▁begin|>package com.jason.showcase.lambdas;
/**
* Created by Qinjianf on 2016/7/19.
*/
public class Lambda {
public void execute(Action action) {<|fim▁hole|> action.run("Hello Lambda!");
}
public void test() {
execute(System.out::println);
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.