prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>shannon.rs<|end_file_name|><|fim▁begin|>use super::Entropy;
/// Implementation of Shannon entropy
pub struct Shannon {
frequency: Vec<f64>,
probabilities: Vec<f64>,
entropy: Option<f64>,
data_len: usize,
}
impl Shannon {
pub fn new() -> Self {
Self {
frequency: vec... | fn input<T: AsRef<[u8]>>(&mut self, data: T) {
self.data_len += data.as_ref().len();
data.as_ref().into_iter().for_each(|v| {
self.frequency[*v as usize] += 1.0_f64; |
<|file_name|>16.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export { Error16 as default } from "../../"; |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>// Just re-export everything from the other files
export * from './base-table-name';
export * from './compound-constraint';
export * from './constraint';
export * from './constraint-type';
export * from './default-value';
export * from './error-response';
export * fro... | |
<|file_name|>vision-gen.go<|end_file_name|><|fim▁begin|>// Package vision provides access to the Google Cloud Vision API.
//
// See https://cloud.google.com/vision/
//
// Usage example:
//
// import "google.golang.org/api/vision/v1"
// ...
// visionService, err := vision.New(oauthHttpClient)
package vision // imp... | // View and manage your data across Google Cloud Platform services
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
) |
<|file_name|>Workspace.js<|end_file_name|><|fim▁begin|>import { bindActionCreators } from 'redux';<|fim▁hole|>import Workspace from '../components/Workspace';
function mapStateToProps(state) {
return {
workspace: state.workspace
};
}
function mapDispatchToProps(dispatch) {
return bindActionCreators({ ...ac... | import { connect } from 'react-redux';
import * as actionCreators from '../actions/workspace';
import { setActiveComponent } from '../actions/FileSystemActions'; |
<|file_name|>sequences.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8; -*-
#
# @file sequences
# @brief collgate
# @author Frédéric SCHERMA (INRA UMR1095)
# @date 2018-01-09
# @copyright Copyright (c) 2018 INRA/CIRAD<|fim▁hole|>
def fixture(fixture_manager, factory_manager):
acc_seq = "CREATE SEQUENCE IF NOT... | # @license MIT (see LICENSE file)
# @details
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding:utf8 -*-
from setuptools import setup
import picuplib<|fim▁hole|>
setup(
name = 'picuplib',
packages = ['picuplib'],
version = picuplib.__version__,
description = 'Picflash upload library',
author = 'Ar... | |
<|file_name|>update_doc_utils.py<|end_file_name|><|fim▁begin|>##############################################################################
# Name: misc/scripts/update_doc_utils.py
# Purpose: base utilities for others update_doc_*.py scripts
# Created: 2007-08-1
# RCS-ID: $Id$
# Copyright: (c) 2007 Fr... | |
<|file_name|>run.py<|end_file_name|><|fim▁begin|><|fim▁hole|> p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
out = p.stdout.read().strip()
return out<|fim▁end|> | import subprocess
def runBash(cmd): |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import base64
import cPickle as pickle
from django.db import models<|fim▁hole|>from django.utils.hashcompat import md5_constructor
class SessionManager(models.Manager):
def encode(self, session_dict):
"""
Returns the given session dictionary pic... | from django.utils.translation import ugettext_lazy as _
from django.conf import settings |
<|file_name|>flag.py<|end_file_name|><|fim▁begin|>import sys
#Se le pasa la flag deseada, y devuelve lo que hay que escribir en el binario. CUIDADO CON LAS BACKSLASHES; hay que escaparlas
<|fim▁hole|> print "Syntax: python2 flag.py <FLAG>"
sys.exit(0)
flag = sys.argv[1]
i = 0
j = len(flag)-1
l = j
flag2 = ""
w... | if len(sys.argv) != 2: |
<|file_name|>analyzer.py<|end_file_name|><|fim▁begin|>def get_related_fields(model):
pass
def get_table_size(model):<|fim▁hole|><|fim▁end|> | pass
def get_row_size(model):
pass |
<|file_name|>mongodb.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""
Collects all number values from the db.serverStatus() command, other
values are ignored.
#### Dependencies
* pymongo
"""
import diamond.collector
from diamond.collector import str_to_bool
import re
import zlib
try:
import pymongo
pym... | |
<|file_name|>gerritapi.rs<|end_file_name|><|fim▁begin|>use clap::{self, SubCommand, App, Arg};
use libgerrit::error::GGRResult;
use libgerrit::gerrit::Gerrit;
use config;
use libgerrit::entities;
pub fn menu<'a, 'b>() -> App<'a, 'b> {
SubCommand::with_name("gerritapi")
.about("Gerrit API interface (Only fo API... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# MIT license
#<|fim▁hole|># in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the ... | # Copyright (C) 2018 by XESS Corporation / Hildo Guillardi Júnior
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>import { StemLeafPlot } from "../../";<|fim▁hole|><|fim▁end|> |
export = StemLeafPlot; |
<|file_name|>course.py<|end_file_name|><|fim▁begin|>''' -- imports from python libraries -- '''
# from datetime import datetime
import datetime
import json
''' -- imports from installed packages -- '''
from django.http import HttpResponseRedirect # , HttpResponse uncomment when to use
from django.http import HttpResp... | collection_set_list[b], collection_set_list[a] = collection_set_list[a], collection_set_list[b]
node_collection.collection.update({'_id': parent_node._id}, {'$set': {'collection_set': collection_set_list }}, upsert=False, multi=False)
parent_node.reload()
response_dict["success"] = True |
<|file_name|>settings_editor.py<|end_file_name|><|fim▁begin|>#FIXME: UNDO, click time at end to undo
from PyQt4 import QtCore, QtGui
import sys, os
import volume_editor_layout, settings_layout, cPickle
import numpy as np
from utils import Utils
class SettingsEditWidget(QtGui.QDialog, settings_layout.Ui_Dialog):
#... | |
<|file_name|>nl2br.py<|end_file_name|><|fim▁begin|>"""
NL2BR Extension
===============
A Python-Markdown extension to treat newlines as hard breaks; like
GitHub-flavored Markdown does.
Usage:
>>> import markdown
>>> print markdown.markdown('line 1\\nline 2', extensions=['nl2br'])
<p>line 1<br />
line... | |
<|file_name|>useless_conversion.rs<|end_file_name|><|fim▁begin|>use clippy_utils::diagnostics::{span_lint_and_help, span_lint_and_sugg};
use clippy_utils::source::{snippet, snippet_with_macro_callsite};
use clippy_utils::sugg::Sugg;
use clippy_utils::ty::{is_type_diagnostic_item, same_type_and_consts};
use clippy_utils... | |
<|file_name|>float_cmp.rs<|end_file_name|><|fim▁begin|>#![warn(clippy::float_cmp)]
#![allow(<|fim▁hole|> clippy::no_effect,
clippy::op_ref,
clippy::unnecessary_operation,
clippy::cast_lossless,
clippy::many_single_char_names
)]
use std::ops::Add;
const ZERO: f32 = 0.0;
const ONE: f32 = ZERO + 1.0;
... | unused, |
<|file_name|>_policy_assignments_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 informatio... | |
<|file_name|>test_climatology.py<|end_file_name|><|fim▁begin|># Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Integration tests for loading and saving netcdf files."""
# I... | |
<|file_name|>public_api.d.ts<|end_file_name|><|fim▁begin|>export * from './table';
export * from './cell';
export * from './row';<|fim▁hole|>export { DataSource } from '@angular/cdk/collections';
export declare class CdkTableModule {
}<|fim▁end|> | /** Re-export DataSource for a more intuitive experience for users of just the table. */ |
<|file_name|>threaded.rs<|end_file_name|><|fim▁begin|>// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apa... | |
<|file_name|>signals.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""This file is part of the django ERP project.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF M... | This handler could be used to automatically create a related bookmark list
on given model class instance creation. i.e.: |
<|file_name|>UserInformationTestPage.tsx<|end_file_name|><|fim▁begin|>import { RootTestPage } from "v2/DevTools/RootTestPage"
export class UserInformationTestPage extends RootTestPage {
async clickSubmitButton() {
this.find("button[type='submit']").simulate("submit")
await this.update()
}
async changeEm... | async changeNameInput(value = "New name") { |
<|file_name|>generate_public.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import qa
import re
import numpy
have_use = re.compile("^\s{1,12}use\s")
remove_warn = re.compile('''(?!.*QA_WARN .+)''', re.VERBOSE)
unwanted = re.compile("(\s|&|\n)", re.VERBOSE)
def do_magic(files, options):
name = files[0]
... | lines = open(f, 'r').readlines()
temp = qa2.remove_amp(filter(remove_warn.match, lines), True)
uses = [f for f in filter(have_use.search, temp) if (
re.match("\s{0,9}use " + name, f))] |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licens... | |
<|file_name|>0007_auto__add_field_project_url.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):
# Adding field 'Project.url'
d... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#[link(name = "frog"
, vers = "0.0"
, author = "Benjamin Roux"
, uuid = "D4B7F5F0-6B78-4DF0-9CB5-EB65DDB43857")];
#[crate_type = "lib"];
#[warn(non_camel_case_types)]
extern mod extra;<|fim▁hole|>pub mod simulated_annealing;<|fim▁end|> | extern mod nalgebra;
pub mod ga;
pub mod dtw; |
<|file_name|>data_loader.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/. */
extern crate hyper;
extern crate hyper_serde;<|fim▁hole|>... | |
<|file_name|>ModalContent.js<|end_file_name|><|fim▁begin|>import PropTypes from 'prop-types';
import React from 'react';
import Icon from 'Components/Icon';
import Link from 'Components/Link/Link';
import { icons } from 'Helpers/Props';
import styles from './ModalContent.css';
function ModalContent(props) {
const {
... | {...otherProps}
>
{
showCloseButton && |
<|file_name|>issue-65679-inst-opaque-ty-from-val-twice.rs<|end_file_name|><|fim▁begin|>// compile-flags: -Zsave-analysis
// check-pass
#![feature(type_alias_impl_trait, rustc_attrs)]
type T = impl Sized;
// The concrete type referred by impl-trait-type-alias(`T`) is guaranteed
// to be the same as where it occurs, wh... | } |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md><|fim▁hole|><|fim▁end|> | fn main() {
println!("cargo:rustc-flags=-l wmvcore");
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>__version__ = "0.0.2"<|fim▁hole|><|fim▁end|> |
from .samplesubmod import * |
<|file_name|>HightEqWidthRounderImage.java<|end_file_name|><|fim▁begin|>package connect.view;
import android.content.Context;
import android.util.AttributeSet;
import connect.view.roundedimageview.RoundedImageView;
/**
* Created by Administrator on 2016/12/15.
*/
public class HightEqWidthRounderImage extends Round... | super(context); |
<|file_name|>constructor.py<|end_file_name|><|fim▁begin|>__all__ = ['BaseConstructor', 'SafeConstructor', 'Constructor',
'ConstructorError']
from error import *
from nodes import *
import datetime
import binascii, re, sys, types
class ConstructorError(MarkedYAMLError):
pass
class BaseConstruct... | value = self.construct_scalar(node)
try:
|
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 F... | except Exception:
current_plugin.logger.exception('Unable to load JSON from source %s', rawjson)
return default
|
<|file_name|>ComparableFilter.java<|end_file_name|><|fim▁begin|>package vizardous.delegate.dataFilter;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import vizardous.util.Converter;
/**
* Filter class that provides filter functi... |
return Converter.listToArray(list);
}
|
<|file_name|>PatternParserTest.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 this file to You un... | |
<|file_name|>bam.js<|end_file_name|><|fim▁begin|>!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Bam=... | empty object if no query params available.
*/ |
<|file_name|>CoreXT.Globals.ts<|end_file_name|><|fim▁begin|>// ###########################################################################################################################
// These are functions for creating global scope variables/references that eliminate/minimize collisions between conflicting scripts... | * instead which references the global variable within the CoreXT namespace related global scope (so as not to
* pollute the host's global scope).
* Some frameworks, such as the Google Maps API, support callbacks wit... |
<|file_name|>lookingGlass.js<|end_file_name|><|fim▁begin|>// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter;
const Cogl = imports.gi.Cogl;
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
const Gtk = imports.gi.Gtk;
const Meta = imports.gi.Meta;
const Pango = im... | const AutoComplete = new Lang.Class({
Name: 'AutoComplete', |
<|file_name|>sample_index.rs<|end_file_name|><|fim▁begin|>use std::{
cmp::Ordering,
error::Error,
fmt,
ops::{Add, AddAssign, Sub},
};
use metadata::Duration;
use super::{SampleIndexRange, Timestamp};
#[derive(Debug)]
pub struct DecrementError;
impl fmt::Display for DecrementError {
fn fmt(&self, ... | |
<|file_name|>filter.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2012 Dmitri Melikyan
*
* 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, including
* without... | |
<|file_name|>delete_user_by_id_parameters.go<|end_file_name|><|fim▁begin|>// Code generated by go-swagger; DO NOT EDIT.
package users
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/erro... | |
<|file_name|>frog_queue_videos.py<|end_file_name|><|fim▁begin|>##################################################################################################
# Copyright (c) 2012 Brett Dixon
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentat... | # copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
<|file_name|>model_b.py<|end_file_name|><|fim▁begin|>"""
model_b.py
by Ted Morin
contains a function to predict 2-year Incident Hypertension risks using Weibull beta coefficients from:
10.7326/0003-4819-148-2-200801150-00005
2008 A Risk Score for Predicting Near-Term Incidence of Hypertension
Framingham Heart Study
... | |
<|file_name|>_thicknessmode.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class ThicknessmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="thicknessmode",
parent_name="densitymapbox.colorbar",
**kwargs
):<|fi... | |
<|file_name|>register.js<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2011 Bruno Jouhier <bruno.jouhier@sage.com>
*
* 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|>aes_gcm_hkdf.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 The Tink-Rust 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... | let nw = noncebased::Writer::new(noncebased::WriterParams {
w,
segment_encrypter: Box::new(AesGcmHkdfSegmentEncrypter { cipher_key }),
nonce_size: AES_GCM_HKDF_NONCE_SIZE_IN_BYTES, |
<|file_name|>hakeandositeprecodescontowhiletemposimounao.py<|end_file_name|><|fim▁begin|>import urllib.request
import time
def pega_preço():
pagina = urllib.request.urlopen('http://beans.itcarlow.ie/prices-loyalty.html')<|fim▁hole|> texto = pagina.read().decode('utf8')
onde = texto.find('>$')
inicio= ond... | |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># encoding: 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):
# Adding model 'Actor'
db.create_table('actors_a... | 'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"},
'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields... |
<|file_name|>DSS.py<|end_file_name|><|fim▁begin|>#
# Signature/DSS.py : DSS.py
#
# ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, ar... | z = Integer.from_bytes(msg_hash.digest()[:self._order_bytes])
result = self._key._verify(z, (r_prime, s_prime))
if not result: |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
class Channel(models.Model):
channel_id = models.CharField(max_length=50, unique=True)
channel_name = models.CharField(max_length=50, null=True, blank=True)
rtmp_url = models.CharField(max_length=100, null=True, blank=True)
... | sort = models.IntegerField(null=False, blank=True, default=0) |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import json
from django_api_tools.APIModel import APIModel, UserAuthCode
from django_api_tools.APIView import APIUrl, ReservedURL, StatusCode
from django_api_tools.tests.models import Foo, Bar, Baz, Qux, TestProfile
from django_api_tools.tests.views import TestAPIView... | foo = Foo.objects.get(id=1) |
<|file_name|>KernelMulticoreTest.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2013-2014 Kametic <epo.jemba@kametic.com>
*
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3, 29 June 2007;
* or any later version
* you may not use this file except in compliance with the License.
* You ... | import io.nuun.kernel.core.pluginsit.dummy5.DummyPlugin5;
import java.util.concurrent.CountDownLatch;
|
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from couchpotato.api import addApiView
from couchpotato.core.event import addEvent, fireEvent, fireEventAsync
from couchpotato.core.helpers.encoding import ss
from couchpotato.core.helpers.request import jsonified
from couchpotato.core.logger import CPLog
from couchpota... | |
<|file_name|>socks5.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 The Phtevencoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Dummy Socks5 server for testing.
'''
from __future__ import print_function... | |
<|file_name|>test-generator.py<|end_file_name|><|fim▁begin|># ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache... | # See the License for the specific language governing permissions and
# limitations under the License. |
<|file_name|>v1_server_address_by_client_cidr.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https:/... | return self._client_cidr |
<|file_name|>animatedText.ts<|end_file_name|><|fim▁begin|>/*
* Power BI Visualizations
*
* Copyright (c) Microsoft Corporation
* All rights reserved.
* MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the ... |
if (!startValue) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | __version__ = '0.3.0' |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.sites.models import Site
# Create your models here.
class Link(models.Model):
url = models.URLField(max_length=512)
site = models.ForeignKey(Site, on_delete=models.SET_NULL, null=True)
request_times = mode... | |
<|file_name|>doc.rs<|end_file_name|><|fim▁begin|>// rustfmt-normalize_comments: true<|fim▁hole|>//sdffsdfasdf<|fim▁end|> | // Part of multiple.rs
// sadfsdfa |
<|file_name|>helloworld.py<|end_file_name|><|fim▁begin|># coding=utf-8
__author__ = 'litao'
# -*- coding:utf-8 -*-
import urllib
import urllib2
import re
import thread
import time
class QSBK:
def __init__(self):
self.pageIndex = 1
self.user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)... | #开始方法 |
<|file_name|>test_platforms.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import errno
import os
import sys
import signal
from celery import _find_option_with_arg
from celery import platforms
from celery.five import open_fqdn
from celery.platforms import (
get_fdmax,
ignore_errno,
... | |
<|file_name|>cpqScsiPhyDrv.py<|end_file_name|><|fim▁begin|>################################################################################
#
# This program is part of the HPMon Zenpack for Zenoss.
# Copyright (C) 2008, 2009, 2010, 2011 Egor Puzanov.
#
# This program can be used under the GNU General Public License ver... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
import sys
import warnings<|fim▁hole|>from setuptools import setup
version_contents = {}
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "shippo", "version.py"), encoding="utf-8") as f:
exec(f.read(), version_contents)
s... | |
<|file_name|>continent_manager.cpp<|end_file_name|><|fim▁begin|>// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License ... | |
<|file_name|>label_algo_test.cpp<|end_file_name|><|fim▁begin|>#include <boost/version.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <iostream>
#include <mapnik/geometry.hpp>
#include <mapnik/geom_util.hpp>
int main( int, char*[] )
{
// reused these for simplicity
double x,y;
// single point
... | |
<|file_name|>tutorial-10.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate glium;
#[path = "../book/tuto-07-teapot.rs"]
mod teapot;
fn main() {
#[allow(unused_imports)]
use glium::{glutin, Surface};
let event_loop = glutin::event_loop::EventLoop::new();
let wb = glutin::window::WindowBuilder:... | |
<|file_name|>app.spec.js<|end_file_name|><|fim▁begin|>describe( 'AppCtrl', function() {
describe( 'isCurrentUrl', function() {
var AppCtrl, $location, $scope;
beforeEach( module( 'app' ) );<|fim▁hole|>
beforeEach( inject( function( $controller, _$location_, $rootScope ) {
$location = _$location_;
... | |
<|file_name|>hba.rs<|end_file_name|><|fim▁begin|>use arch::memory;
use core::mem::size_of;
use core::u32;
use disk::Disk;
use drivers::io::{Io, Mmio};
use system::error::{Error, Result, EIO};
use super::fis::{FIS_TYPE_REG_H2D, FisRegH2D};
const ATA_CMD_READ_DMA_EXT: u8 = 0x25;
const ATA_CMD_WRITE_DMA_EXT: u8 = 0x... |
if self.is.readf(HBA_PORT_IS_TFES) { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
<|fim▁hole|>@author: jmjj (Jari Juopperi, jmjj@juopperi.org)
"""
from .main import *<|fim▁end|> | """
Created on Wed Mar 2 10:56:34 2016
|
<|file_name|>p081.py<|end_file_name|><|fim▁begin|># https://projecteuler.net/problem=81
from projecteuler.FileReader import file_to_2D_array_of_ints
# this problem uses a similar solution to problem 18, "Maximum Path Sum 1."
# this problem uses a diamond instead of a pyramid
matrix = file_to_2D_array_of_ints("p081.txt... | |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
<|fim▁hole|>Resources:
https://pythonhosted.org/an_example_pypi_project/sphinx.html
https://github.com/djungelorm/sphinx-csharp
https://sublime-and-sphinx-guide.readthedocs.io/en/latest/code_blocks.html
https://docutils.sourceforge.net/docs/user... | """ |
<|file_name|>issue-2445-b.rs<|end_file_name|><|fim▁begin|>// run-pass
#![allow(dead_code)]
#![allow(non_camel_case_types)]
// pretty-expanded FIXME #23616
<|fim▁hole|>}
impl<T> c1<T> {
pub fn f1(&self, _x: isize) {
}
}
fn c1<T>(x: T) -> c1<T> {
c1 {
x: x
}
}
impl<T> c1<T> {
pub fn f2(&se... | struct c1<T> {
x: T, |
<|file_name|>display.py<|end_file_name|><|fim▁begin|># (c) 2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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 ve... | |
<|file_name|>FileLister.java<|end_file_name|><|fim▁begin|>/**
*
*/
package topology.graphParsers.common;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
/**
* @author Omer Zohar
* This class returns names of files with given extention for a given directory
*/
public... | |
<|file_name|>lib.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... | pub const EBADRQC: c_int = 54;
pub const EBADSLT: c_int = 55; |
<|file_name|>OneWayLink.java<|end_file_name|><|fim▁begin|><|fim▁hole|>
import java.util.ArrayList;
import java.util.concurrent.Callable;
public class OneWayLink {
public OneWayLink(Location start, Location end) {
this(start, end, new ArrayList<Traversable>(), null);
}
public OneWayLink(Location st... | package org.booleanfloat.traveler.links;
import org.booleanfloat.traveler.Location;
import org.booleanfloat.traveler.interfaces.Traversable; |
<|file_name|>extendableevent.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::EventBinding::E... | return Err(Error::InvalidState);
}
// Step 2 |
<|file_name|>slam.py<|end_file_name|><|fim▁begin|># vim: set et sw=4 ts=4 ai:
import unittest
import utils
from testbin import TestBin
class TestBinSlam(TestBin, unittest.TestCase):
def setUp(self):
self.bin = 'slam'
<|fim▁hole|><|fim▁end|> | def tearDown(self):
pass |
<|file_name|>main_ode.py<|end_file_name|><|fim▁begin|># Copyright 2019 DeepMind Technologies Limited and 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.... | from absl import flags
from absl import logging |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# @Date : 2016-01-21 13:15
# @Author : leiyue (mr.leiyue@gmail.com)
# @Link : https://leiyue.wordpress.com/
from flask_wtf import Form
from wtforms import StringField, BooleanField, TextAreaField
from wtforms.validators import DataRequir... | return True |
<|file_name|>recommend.py<|end_file_name|><|fim▁begin|>"""
This script is responsible for generating recommendations for the users. The general flow is as follows:
The best_model saved in HDFS is loaded with the help of model_id which is fetched from model_metadata_df.
`spark_user_id` and `recording_id` are fetched fr... | self.recordings_df = recordings_df
self.model = model
self.top_artist_candidate_set_df = top_artist_candidate_set_df |
<|file_name|>api-creation-step1.component.ts<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
*
* 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
... | public shouldDisplayHint = shouldDisplayHint;
constructor(private ApiPrimaryOwnerModeService: ApiPrimaryOwnerModeService) {
'ngInject'; |
<|file_name|>tree_perf.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
*/
import {runBenchmark, verifyNoBrowserErrors} from 'e2e_util/p... | |
<|file_name|>gcp_healthcheck.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright 2017 Google Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_... | |
<|file_name|>robotremoteserver.py<|end_file_name|><|fim▁begin|># Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Lice... | def _announce_start(self, log, port_file):
self._log('started', log)
if port_file: |
<|file_name|>content_script.js<|end_file_name|><|fim▁begin|>console.log("VS: loading content_script.js..." + new Date());
<|fim▁hole|>// Check if the communication between page and background.js has broken.
var last_message_time = new Date().getTime();
new Promise((resolve) => setTimeout(resolve, 1000000)).then(() => {... | |
<|file_name|>Catalogs.py<|end_file_name|><|fim▁begin|>#
# Catalogs.py -- Catalogs plugin for fits viewer
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from ginga.mis... | |
<|file_name|>lexer.re2c.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2018 Nagisa Sekiguchi
*
* 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/LIC... | re2c:yyfill:enable = 0;
re2c:indent:top = 1;
re2c:indent:string = " "; |
<|file_name|>peer_status.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... | if s.lg != nil {
s.lg.Warn("peer became inactive (message send to peer failed)", zap.String("peer-id", s.id.String()), zap.Error(errors.New(msg)))
} else { |
<|file_name|>test_ipv4_strategy.py<|end_file_name|><|fim▁begin|>import sys
import pytest
from netaddr import INET_PTON, AddrFormatError
from netaddr.strategy import ipv4
def test_strategy_ipv4():
b = '11000000.00000000.00000010.00000001'
i = 3221225985
t = (192, 0, 2, 1)
s = '192.0.2.1'
bin_val ... | |
<|file_name|>IWebRequestPayload.ts<|end_file_name|><|fim▁begin|>export const WebRequestType = 'web-request';
export interface IWebRequestPayload {
protocol: {
identifier: string;
version: string;
};
url: string;
method: string;<|fim▁hole|> body: {
size: number;
form: ... | headers: { [key: string]: string }; |
<|file_name|>episodes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
Exodus Add-on
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
... | |
<|file_name|>test_iconpacker.py<|end_file_name|><|fim▁begin|>import os
from iconpacker import IconList
test_icon = "/media/hda7/Graphics/png/Classic_Truck/128.png"
icon_theme = IconList()
def initialization():
treestore = icon_theme.setup_treeview('data/legacy-icon-mapping.xml')
if treestore != None:
for i in ico... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.