prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>test_ChangePassPhraseXmlBuilder.py<|end_file_name|><|fim▁begin|>from nose.tools import assert_raises
from endicia.builders.ChangePassPhraseXmlBuilder import ChangePassPhraseXmlBuilder
from endicia.builders.EndiciaXmlBuilder import ValueToLongError
def test_ChangePassPhraseXmlBuilder_invalid_values():<|fim... | |
<|file_name|>version-two_hard-tabs.rs<|end_file_name|><|fim▁begin|>// rustfmt-hard_tabs: true
// rustfmt-version: Two
impl<
Target: FromEvent<A> + FromEvent<B>,
A: Widget2<Ctx = C>,<|fim▁hole|>{
type Ctx = C;
type Event = Vec<Target>;
}
mod foo {
impl<
Target: FromEvent<A> + FromEvent<B>,
A: Widget2<Ctx = C>... | B: Widget2<Ctx = C>,
C: for<'a> CtxFamily<'a>,
> Widget2 for WidgetEventLifter<Target, A, B> |
<|file_name|>make_stl_data.py<|end_file_name|><|fim▁begin|>import os<|fim▁hole|>import dec
print 'Building HOG feature extractor...'
os.system('python setup_features.py build')
os.system('python setup_features.py install')
print 'Preparing stl data. This could take a while...'
dec.make_stl_data()<|fim▁end|> | |
<|file_name|>algo.py<|end_file_name|><|fim▁begin|>import bisect
from mahjong import bots, patterns, scoring
from mahjong.types import Tile
def can_win(context, player_idx=None, incoming_tile=None):
'''
Return if a player can win.
Unlike Hand.can_win(), this function does extra checking for special
w... | return tile
def _copy_scores(scores): |
<|file_name|>validate.js<|end_file_name|><|fim▁begin|>const isObjectId = objectId => objectId && /^[0-9a-fA-F]{24}$/.test(objectId)
const isEmail = email => email && /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(email.trim())
const isNick = nick => nick && /^[\u4E00-\u9FA5\uF900-\uFA2DA-Za-z0-9\-\_]{2,40}$/.test(nick.... | isEmail,
isNick, |
<|file_name|>validateSpec.js<|end_file_name|><|fim▁begin|>describe('uiValidate', function ($compile) {
var scope, compileAndDigest;
var trueValidator = function () {
return true;
};
var falseValidator = function () {
return false;
};
var passedValueValidator = function (valueToValidate... | expect(scope.form.input.$valid).toBeFalsy();
inputElm.val('true');
|
<|file_name|>min-max.test.js<|end_file_name|><|fim▁begin|>const test = require('tape')
const nlp = require('../_lib')
test('match min-max', function(t) {
let doc = nlp('hello1 one hello2').match('#Value{7,9}')
t.equal(doc.out(), '', 'match was too short')
doc = nlp('hello1 one two three four five hello2').match... | doc = nlp('hello1 one two three four five hello2').match('hello1 .{3}')
t.equal(doc.out(), 'hello1 one two three', 'unspecific greedy exact length') |
<|file_name|>StartPage_it.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="it" sourcelanguage="en">
<context>
<name>StartPage</name>
<message>
<location filename="StartPage.py" line="50"/>
<source>FreeCAD Start Center</source>
<... | <location filename="StartPage.py" line="58"/> |
<|file_name|>treewalker.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::callback::RethrowExceptions;
use dom::b... | match node.next_sibling() {
None => { |
<|file_name|>ResultWrapper.java<|end_file_name|><|fim▁begin|>/**
* JBoss, Home of Professional Open Source.
* Copyright 2014 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in comp... | |
<|file_name|>leechcoin.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding=utf-8
import argparse
import urllib2 # python 2.7
import re
import sqlite3
import traceback
import datetime
import csv
headers = { 'User-Agent' : 'Mozilla/5.0 (compatible; Googlebot/2.1;'
+' +http://w... | c = conn.cursor()
c.execute("SELECT * FROM config") |
<|file_name|>ratecounter.go<|end_file_name|><|fim▁begin|>package ratecounter
import "time"
// A RateCounter is a thread-safe counter which returns the number of times
// 'Incr' has been called in the last interval
type RateCounter struct {
counter Counter
interval time.Duration
}
<|fim▁hole|> }
}
// Add an event ... | // Constructs a new RateCounter, for the interval provided
func NewRateCounter(intrvl time.Duration) *RateCounter {
return &RateCounter{
interval: intrvl, |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|>{
'name': "Reminders and Agenda for Phonecalls",
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'category': 'Reminders and Agenda',
'website': 'https://yelizariev.github.io',<|fim▁hole|> 'currency': 'EUR',
'depends': ... | 'price': 6.00, |
<|file_name|>Myanmar_total_death.py<|end_file_name|><|fim▁begin|>"""Import Module Plotly To Ploting Graph"""
import plotly.plotly as py
import plotly.graph_objs as go
"""Open and Read CSV from database"""
data = open('Real_Final_database_02.csv')
alldata = data.readlines()<|fim▁hole|>listdata = []
for i in alldata:
... | |
<|file_name|>base-api.ts<|end_file_name|><|fim▁begin|>import { script } from 'dynamic-import';
export interface InitOptions {
version?: string;
apiKey?: string;
apiSecret?: string;
apiVersion?: string | number; // TODO: Deprecated, remove in next major version
}
export interface LoginOptions {
per... | createPosts: Array<'publish_actions'>;
readPosts: Array<'user_posts'>;
updatePosts: Array<'publish_actions'>;
deletePosts: Array<'publish_actions'>; |
<|file_name|>IfcTaskTypeEnum.java<|end_file_name|><|fim▁begin|>/**
* 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, either version 3 of... | |
<|file_name|>PredicateContextBuilder.java<|end_file_name|><|fim▁begin|>package pl.openrest.filters.query;
import java.io.Serializable;
import org.springframework.data.mapping.PersistentProperty;
import pl.openrest.predicate.parser.FilterPart;
import pl.openrest.predicate.parser.PredicateParts;
public interface Pred... |
PredicateContextBuilder withPredicateParts(PredicateParts predicateParts); |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | module.exports = require('./src/tracking'); |
<|file_name|>aws-elasticbeanstalk-applicationversion.go<|end_file_name|><|fim▁begin|>package cloudformation
import (
"encoding/json"
"errors"
"fmt"
)
// AWSElasticBeanstalkApplicationVersion AWS CloudFormation Resource (AWS::ElasticBeanstalk::ApplicationVersion)
// See: http://docs.aws.amazon.com/AWSCloudFormation... | if resType == "AWS::ElasticBeanstalk::ApplicationVersion" {
// The resource is correct, unmarshal it into the results |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>#define _IRR_STATIC_LIB_
#include <irrlicht.h>
#include <stdio.h>
#include <string>
#include <sstream>
#include <iostream>
#include "dc-config.h"
#include "manager_gui.h"
#include "manager_filesystem.h"
#include "manager_core.h"
#include "irrlicht_event_handler.h"
#in... | context.skin = fileManager->loadSkin(context.config[L"Skin"]); |
<|file_name|>request.go<|end_file_name|><|fim▁begin|>package common
import (
"io"
//"log"
"math/rand"
"net/url"
"reflect"
"strconv"
"strings"
"time"
)
const (
POST = "POST"
GET = "GET"
RootDomain = "tencentcloudapi.com"
Path = "/"
)
type Request interface {
GetAction() string
GetBodyReader() io... |
func (r *BaseRequest) GetVersion() string {
return r.version |
<|file_name|>mesh.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Gfx-rs Developers.
//
// 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... | end: self.len() as VertexCount,
prim_type: prim,
kind: SliceKind::$index(self.clone(), 0)
} |
<|file_name|>_network_management_client_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 inf... |
if response.status_code not in [200]: |
<|file_name|>test_connections.py<|end_file_name|><|fim▁begin|>import unittest
import unittest.mock
import functools
from g1.asyncs import kernels
from g1.operations.databases.bases import interfaces
from g1.operations.databases.servers import connections
# I am not sure why pylint cannot lint contextlib.asynccontext... | with self.assertRaises(ValueError):
async with self.manager.transacting():
tx_id = self.manager.tx_id
raise ValueError |
<|file_name|>Reshape.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2020 Google LLC. 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.apach... | |
<|file_name|>real.py<|end_file_name|><|fim▁begin|># Copyright (c) 2008 testtools developers. See LICENSE for details.
"""Test results and related things."""
__metaclass__ = type
__all__ = [
'ExtendedToOriginalDecorator',
'MultiTestResult',
'TestResult',
'ThreadsafeForwardingResult',
]
import date... | def wasSuccessful(self):
return self.decorated.wasSuccessful()
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | default_app_config = 'journeys.apps.JourneyConfig' |
<|file_name|>Drawable.py<|end_file_name|><|fim▁begin|>class Drawable(object):<|fim▁hole|><|fim▁end|> | def draw(self, display_screen, dT):
pass |
<|file_name|>util.go<|end_file_name|><|fim▁begin|>/* Vuls - Vulnerability Scanner
Copyright (C) 2016 Future Architect, Inc. Japan.
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... | dtable.AddRow("NVD", fmt.Sprintf("%s?vulnId=%s", nvdBaseURL, cveID))
dtable.AddRow("MITRE", fmt.Sprintf("%s%s", mitreBaseURL, cveID)) |
<|file_name|>GroupStore.js<|end_file_name|><|fim▁begin|>var Reflux = require('reflux');
var Firebase = require('firebase');
var GroupActions = require('../actions/GroupActions');
var DefaultStoreActions = require('../actions/DefaultStoreActions');
var _ = require('underscore');
var firebaseRef;
function updateWithSnap... | GroupStore.StoreActions.addSuccess(snapshot.key());
}
|
<|file_name|>shootout-binarytrees.rs<|end_file_name|><|fim▁begin|>// The Computer Language Benchmarks Game
// http://benchmarksgame.alioth.debian.org/
//
// contributed by the Rust Project Developers
// Copyright (c) 2012-2014 The Rust Project Developers
//
// All rights reserved.
//
// Redistribution and use in sourc... | for message in messages {
println!("{}", message.join().unwrap());
}
|
<|file_name|>curve.py<|end_file_name|><|fim▁begin|>'''
This file is part of GEAR_mc.
GEAR_mc is a fork of Jeremie Passerin's GEAR project.
GEAR 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 Foun... | # @param nurbscrv NurbsCurve - The nurbs curves to check.
# @return Boolean.
def isClosed(nurbscrv):
if nurbscrv.Degree == 3: |
<|file_name|>qwebsocketprotocol.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
**
** Copyright (C) 2014 Kurt Pattyn <pattyn.kurt@gmail.com>.
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtWebSockets module of the Qt Toolkit.
*... | \internal
*/
/*! |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('main', ['ngRoute', 'ngResource', 'ui.route', 'main.system', 'main.index', 'main.events']);
angular.module('main.system', []);
angular.module('main.index', []);
angular.module('main.events', []);
'use strict';
//Setting HTML5 Location Mode... | angular.module('main.events')
.factory('Event', [
'$resource', |
<|file_name|>daypicker.ts<|end_file_name|><|fim▁begin|>import {Component, OnInit} from 'angular2/core';
import {CORE_DIRECTIVES, FORM_DIRECTIVES, NgClass} from 'angular2/common';
import {Ng2BootstrapConfig, Ng2BootstrapTheme} from '../ng2-bootstrap-config';
import {DatePickerInner} from './datepicker-inner';
//write ... | |
<|file_name|>doc.py<|end_file_name|><|fim▁begin|>##
## This file is part of the libsigrok project.
##
## Copyright (C) 2014 Martin Ling <martin-sigrok@earth.li>
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free ... | |
<|file_name|>cache.rs<|end_file_name|><|fim▁begin|>use serde_json;
use utils::libindy::wallet::{add_record, get_record, update_record_value};
static CACHE_TYPE: &str = "cache";
static REV_REG_CACHE_PREFIX: &str = "rev_reg:";
///
/// Cache object for rev reg cache
///
#[derive(Serialize, Deserialize, Debug, Default, ... | }) |
<|file_name|>packetizer_test.go<|end_file_name|><|fim▁begin|>// Copyright 2018 ETH Zurich
//
// 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.... | } |
<|file_name|>aci_tenant_span_dst_group.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 = {'meta... | - Use C(present) or C(absent) for adding or removing.
- Use C(query) for listing an object or multiple objects. |
<|file_name|>test_exteriorfuelequipment.py<|end_file_name|><|fim▁begin|>import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.exterior_equipment import ExteriorFuelEquipment
log = logging.getLogger(__name__)
class TestExteriorFuelE... | |
<|file_name|>Offers.js<|end_file_name|><|fim▁begin|>'use strict';
var Offers = require('./OffersService');
<|fim▁hole|>
module.exports.offerlink = function offerlink (req, res, next) {
Offers.offerlink(req.swagger.params, res, next);
};
module.exports.offernew = function offernew (req, res, next) {
Offers.offern... | module.exports.offerinfo = function offerinfo (req, res, next) {
Offers.offerinfo(req.swagger.params, res, next);
}; |
<|file_name|>_hoverlabel.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class HoverlabelValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="hoverlabel", parent_name="scattercarpet", **kwargs):
super(HoverlabelValidator, self).__init__(
... | |
<|file_name|>lineStream.js<|end_file_name|><|fim▁begin|>// nodejs按行读取文件流
var Stream = require('stream').Stream,
util = require('util');
var LineStream = function() {
this.writable = true;
this.readable = true;
this.buffer = '';
};
util.inherits(LineStream, Stream);
LineStream.prototype.write = function(data, en... |
var parts = data.split(/\n/g); |
<|file_name|>api.py<|end_file_name|><|fim▁begin|>from django.http import JsonResponse
from user.models import User
from django.db.models import Q
from django.apps import apps
def user_filter(request, *args, **kwargs):
# 将来的にはpostで、結果に含めるタグを選択できるようにしたい。
query = Q()
user = request.user
tags = user.follo... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from sqlalchemy import create_engine
from sqlalchemy.pool import NullPool
import sqlalchemy
import sys
# This value must be incremented after schema changes on replicated tables!
SCHEMA_VERSION = 1
engine = None<|fim▁hole|> ... |
def init_db_engine(connect_str):
global engine |
<|file_name|>layout.py<|end_file_name|><|fim▁begin|>from essence3.util import clamp
class Align(object):
def __init__(self, h, v = None):
self.h = h
self.v = h if v is None else v
def __call__(self, node, edge):
if edge in ('top', 'bottom'):
return node.width * self.h
... | |
<|file_name|>browser.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2012 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
from splinter.driver.webdriver.firefox import WebDriver as FirefoxWebDriver
from sp... | _DRIVERS = {
'firefox': FirefoxWebDriver,
'remote': RemoteWebDriver,
'chrome': ChromeWebDriver, |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.signals import post_save
from django.utils.text import slugify
from django.utils.safestring import mark_safe
# Create your models here.
class ProductQuerySet(models.query... | products_two = self.get_queryset().filter(default=instance.default)
qs = (products_one | products_two).exclude(id=instance.id).distinct()
return qs
|
<|file_name|>test.py<|end_file_name|><|fim▁begin|># coding=utf-8
import sys
sys.path.append("bindings/python/")
from unittestpy import TeamcityTestRunner
from elliptics_proxy import *
import unittest
r = remote('localhost', 1025)
c = config()
c.groups.append(1)
c.groups.append(2)
c.log_path = 'log'
c.remotes.append(... | |
<|file_name|>cube_support.cpp<|end_file_name|><|fim▁begin|>// implementation for cube_support.h
#include <utils/multiindex.h>
#include <utils/fixed_array1d.h>
using MathTL::multi_degree;
using MathTL::FixedArray1D;
namespace WaveletTL
{
template <class IBASIS, unsigned int DIM>
inline
void
support(const Cube... | type[DIM-1] = 1; |
<|file_name|>object_instance.js<|end_file_name|><|fim▁begin|>/**
Copyright (c) 2013 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
**/
require("../base/extension_registry.js");
require("./event.js");
require("./object_snapsho... | |
<|file_name|>gyptest-analyzer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (c) 2014 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.
"""Tests for analyzer
"""
import json
import TestGyp
found = 'Found dependenc... | f = open('analyzer_output', 'r')
result = json.load(f)
f.close() |
<|file_name|>ecp.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ecp.py part of cellery (ceRNAs linking inference)
#
# Copyright 2016 Oscar Bedoya Reina <obedoya@igmm-linux-005>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>"use strict";
var $protobuf = require("../..");
module.exports = exports = $protobuf.descriptor = $protobuf.Root.fromJSON(require("../../google/protobuf/descriptor.json")).lookup(".google.protobuf");
var Namespace = $protobuf.Namespace,
Root = $protobuf.... | descriptor.options = toDescriptorOptions(this.options, exports.MessageOptions);
|
<|file_name|>apply_to_call_benchmark.js<|end_file_name|><|fim▁begin|>var Class = {
create: function() {
return function() { //vararg
this.initialize.apply(this, arguments);
}
}
};
Color = Class.create();
Color.prototype = {
red: 0, green: 0, blue: 0,
initialize: function(r,g,b) {
this.red ... | for (var i=0;i<1e8;i++) {
colors[i&0xf] = (new Color(1,2,3)); |
<|file_name|>build.go<|end_file_name|><|fim▁begin|>package server
import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"strconv"
"time"
"github.com/Sirupsen/logrus"
"github.com/cncd/pipeline/pipeline/rpc"
"github.com/cncd/pubsub"
"github.com/cncd/queue"
"github.com/drone/drone/remote"
"github.com/dro... | |
<|file_name|>protection_bitrate_calculator_unittest.cc<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional int... | // both equally, but only be half of max (since that ceiling should be hit).
protection_callback_.nack_rate_bps_ = kMaxBitrateBps;
target_bitrate = media_opt_.SetTargetRates(kMaxBitrateBps, 30, 128, 100);
EXPECT_EQ(kMaxBitrateBps / 2, target_bitrate); |
<|file_name|>gcexportdata.go<|end_file_name|><|fim▁begin|>// Copyright 2016 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 gcexportdata provides functions for locating, reading, and
// writing export data files con... | // within the export data to other packages are consistent. The caller
// must ensure that imports[path] does not exist, or exists but is
// incomplete (see types.Package.Complete), and Read inserts the
// resulting package into this map entry. |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import pandas as pd
<|fim▁hole|><|fim▁end|> | def handler(event, context):
return ':)' |
<|file_name|>issuers_async.py<|end_file_name|><|fim▁begin|># ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------<|fim▁hole|>from azure.keyvault.certificates import AdministratorContact
from azure.core.exceptions import Http... | import os
import asyncio
from azure.identity.aio import DefaultAzureCredential
from azure.keyvault.certificates.aio import CertificateClient |
<|file_name|>test_copy_package_category.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test copying a package category in the library editor
"""
def test(library_editor, helpers):
"""
Copy package category with "New Library Element" wizard
"""
le = library_editor
... | # Check metadata
widget_properties = {
('NameEdit', 'text'): 'C-SMT', |
<|file_name|>htmldatalistelement.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
use dom::bindings::codegen::Bindings::HTMLDataListElementBinding;
use dom::bindings::codegen::Bindings::HTMLDataListElementBinding::HTMLDataListElementMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bi... | /* 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/. */ |
<|file_name|>Keep2ShareCc.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import re
import urlparse
from module.plugins.captcha.ReCaptcha import ReCaptcha
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class Keep2ShareCc(SimpleHoster):
__name__ = "Keep2ShareCc"
__ty... | __config__ = [("use_premium", "bool", "Use premium account if available", True)]
__description__ = """Keep2Share.cc hoster plugin"""
__license__ = "GPLv3" |
<|file_name|>visualize_overlapping_sbs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter as ADHF
from sys import stdout, stderr, exit, maxint, argv
from os.path import join, dirname, basename, isfile
from itertools import izip, chain
from bisect im... | LOG.info('reading pairwise similarities... ')
dists = dict()
for f in pwsim_files: |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>//! Error and result type for SMTP clients
use std::{error::Error as StdError, fmt};
use crate::{
transport::smtp::response::{Code, Severity},
BoxError,
};
// Inspired by https://github.com/seanmonstar/reqwest/blob/a8566383168c0ef06c21f38cbc9213af6ff6db31/sr... | |
<|file_name|>RightToolbar.ts<|end_file_name|><|fim▁begin|>/*********************************************************************
* Copyright (c) 2019 Red Hat, Inc.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://... | |
<|file_name|>WorkerLocation.go<|end_file_name|><|fim▁begin|>package AutoMPI
import (
"time"
)
// WorkerLocation details
type WorkerLocation struct {
GUID string
CreationTimeStamp time.Time
ModifiedTimeStamp time.Time
parentNodeGUID string<|fim▁hole|> location := new(WorkerLocation)
location.GUID... | }
// CreateWorkerLocation as it says
func CreateWorkerLocation(GUID string, parentNodeGUID string) *WorkerLocation { |
<|file_name|>RotationGestureHandler.ts<|end_file_name|><|fim▁begin|>import Hammer from '@egjs/hammerjs';
import { DEG_RAD } from './constants';
import { HammerInputExt } from './GestureHandler';
import IndiscreteGestureHandler from './IndiscreteGestureHandler';
class RotationGestureHandler extends IndiscreteGestureHa... | return 'rotate';
}
|
<|file_name|>util.js<|end_file_name|><|fim▁begin|>/**
* Util of json ajax.
* author: firstboy
* require: jquery
*/
function Jsoncallback(url, callback, method, data, loadid) {
if (loadid) $('#'+loadid).fadeIn(200);
$.ajax({
type: method,
data: data,
scriptCharset: 'UTF-8',
dataType: 'json',
url: ur... | function getURLParameter(name) {
return decodeURI(
(RegExp(name + "=" + "(.+?)(&|$)").exec(location.search)||[,null])[1]
); |
<|file_name|>plane.rs<|end_file_name|><|fim▁begin|>use cgmath::{Quaternion, Rad, Rotation3};
use mint;
use three::{self, Object};
use {COLOR_BROWN, COLOR_BROWN_DARK, COLOR_RED, COLOR_WHITE};
pub struct AirPlane {
pub group: three::Group,
_cockpit: three::Mesh,
_engine: three::Mesh,<|fim▁hole|> _wing: t... | _tail: three::Mesh, |
<|file_name|>0002_auto__del_field_profile_mobile_provider__add_field_profile_description.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):
... | 'username': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'profiles.servicetype': { |
<|file_name|>ut_mbasicsheetheaderview.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (directui@nokia.com)
**
** This file is part o... | delete app;
}
void Ut_MBasicSheetHeaderView::init() |
<|file_name|>range.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2016 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... | #[cfg(target_pointer_width = "16")]
step_impl_no_between!(i32);
#[cfg(target_pointer_width = "64")]
step_impl_unsigned!(u64); |
<|file_name|>heat_iterations.py<|end_file_name|><|fim▁begin|>"""
Illustration of the heat equation<|fim▁hole|>Based on: https://commons.wikimedia.org/wiki/File:Heat_eqn.gif
"""
from __future__ import division, print_function
import numpy as np
from mayavi import mlab
def step_function(N, scale, X, Y, shape="crescent... |
Solve the heat equation using finite differences and Forward Euler.
|
<|file_name|>group_by_dsl.rs<|end_file_name|><|fim▁begin|>use expression::Expression;
use query_builder::{Query, AsQuery};
use query_source::QuerySource;
pub trait GroupByDsl<Expr: Expression> {
type Output: Query;
fn group_by(self, expr: Expr) -> Self::Output;
}<|fim▁hole|> T: QuerySource + AsQuery,
T... |
impl<T, Expr> GroupByDsl<Expr> for T where
Expr: Expression, |
<|file_name|>editor.js<|end_file_name|><|fim▁begin|>/* The Editor object manages the content of the editable frame. It
* catches events, colours nodes, and indents lines. This file also
* holds some functions for transforming arbitrary DOM structures into
* plain sequences of <span> and <br> elements
*/
var inter... | if (!fromKey && self.highlighted) {
unhighlight(self.highlighted[0]);
unhighlight(self.highlighted[1]); |
<|file_name|>ec2.py<|end_file_name|><|fim▁begin|># This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and ... |
""" Convert a flat dict of key:value pairs representing AWS resource tags to a boto3 list of dicts |
<|file_name|>S15.5.4.4_A4_T2.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.<|fim▁hole|> If pos is a value of Number type that is an integer, then the result of
x.charAt(pos) is equal to the result of x.substring(pos, pos+1)
es5id: 15.5.4.4_A4_T2
description: >
Co... | // This code is governed by the BSD license found in the LICENSE file.
/*---
info: | |
<|file_name|>packed-struct-transmute.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.ap... |
// error-pattern: transmute called on types with different size
#[packed] |
<|file_name|>VertexDialog.py<|end_file_name|><|fim▁begin|>__author__ = 'mwagner'
from PyQt4.Qt import Qt
from PyQt4.QtGui import QDialog, QIcon
from ..view.Ui_VertexDialog import Ui_VertexDialog
from ..model.VertexToolsError import *
class VertexDialog(QDialog, Ui_VertexDialog):
def __init__(self, plugin, paren... | |
<|file_name|>PSDraw.py<|end_file_name|><|fim▁begin|>#
# The Python Imaging Library
# $Id$
#
# simple postscript graphics interface
#
# History:
# 1996-04-20 fl Created
# 1999-01-10 fl Added gsave/grestore to image method
# 2005-05-04 fl Fixed floating point issue in image (from Eric Etheridge)
#
# Copyright (c) 1... | from . import EpsImagePlugin
|
<|file_name|>pref_util.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 serde_json::Value;
use std::collections::HashMap;
use ... | S: Fn(&mut P, V) + Sync + 'static,
{
Accessor {
getter: Box::new(getter), |
<|file_name|>IOErrorEvent.ts<|end_file_name|><|fim▁begin|>//////////////////////////////////////////////////////////////////////////////////////
//
// The MIT License (MIT)
//
// Copyright (c) 2017-present, cyder.org
// All rights reserved.
//<|fim▁hole|>// Software without restriction, including without limitation... | // 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 |
<|file_name|>register.js<|end_file_name|><|fim▁begin|>/*jslint browser: true, white: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, newcap: true, immed: true, indent: 4, onevar: false */
/*global window, $, jQuery, _ */
STUDIP.register = {
re_username : null,
re_email: null,<|fim▁... | re_name: null, |
<|file_name|>jsonrpc.go<|end_file_name|><|fim▁begin|>package goginjsonrpc
import (
"fmt"
"encoding/json"
"io/ioutil"
"net/http"
"reflect"
"github.com/gin-gonic/gin"
)
func jsonrpcError(c *gin.Context, code int, message string, data string, id string) {
c.JSON(http.StatusOK, map[string]interface{}{
"result"... | body, err := ioutil.ReadAll(c.Request.Body)
if nil != err {
jsonrpcError(c, -32700, "Parse error", "Error while reading request body", "null") |
<|file_name|>level3.py<|end_file_name|><|fim▁begin|># Learn Python -- level 2 logic
# Copyright (C) 2013 Cornell FB Hackathon Team.
#
# 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, eithe... | #
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
<|file_name|>form-directive.js<|end_file_name|><|fim▁begin|>goog.module('grrUi.cron.newCronJobWizard.formDirective');
goog.module.declareLegacyNamespace();
const {DEFAULT_PLUGIN_URL} = goog.require('grrUi.hunt.newHuntWizard.formDirective');
/**
* Controller for FormDirective.
*
* @param {!angular.Scope} $scope
... |
/** @private {!angular.Scope} */
this.scope_ = $scope;
|
<|file_name|>test_cache_backend_mongo.py<|end_file_name|><|fim▁begin|># Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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:... | self.assertRaises(exception.ValidationError, region.configure,
'keystone.cache.mongo',
arguments=self.arguments)
|
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render,get_object_or_404
from django.http import Http404
# Create your views here.
from django.http import HttpResponse<|fim▁hole|><|fim▁end|> |
def home(request):
return render(request,'index.html'); |
<|file_name|>chess.py<|end_file_name|><|fim▁begin|># coding=utf8
from __future__ import print_function
import re
import sys
import socket
from untwisted.mode import Mode
from untwisted.network import Work
from untwisted.event import DATA, BUFFER, FOUND, CLOSE, RECV_ERR
from untwisted.utils import std
from untwisted.... | if not target: return
for work in ch_work:
work.dump('%s <%s> %s\n' % (target, id.nick, args)) |
<|file_name|>scraper.py<|end_file_name|><|fim▁begin|>'''
Download Cricket Data<|fim▁hole|>
'''
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import csv
import sys
import time
import os
import unicodedata
from urlparse import urlparse
from BeautifulSoup import BeautifulSoup, SoupStrainer
BASE_URL = 'ht... | |
<|file_name|>CallFuncSpec.js<|end_file_name|><|fim▁begin|>/**YEngine2D<|fim▁hole|> * qq: 395976266
* blog:http://www.cnblogs.com/chaogex/
*/
describe("CallFunc", function () {
var action = null;
var sandbox = null;
beforeEach(function () {
sandbox = sinon.sandbox.create();
action = new YE... | * author:YYC
* date:2014-04-21
* email:395976266@qq.com |
<|file_name|>localsettings.py<|end_file_name|><|fim▁begin|>DEPLOY_MODE = "proddev"
COMPRESS_ENABLED = True
USE_CELERY = True<|fim▁hole|>DISABLE_REPORTING_DB = True
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.BaseSignalProcessor'
BASE_ABS_URL = "https://coursys-demo.cs.sfu.ca"<|fim▁end|> | |
<|file_name|>override.py<|end_file_name|><|fim▁begin|>from botapi.settings import *
<|fim▁hole|>ALLOWED_HOSTS = ['*']<|fim▁end|> | DEBUG = True |
<|file_name|>functionmanager.cpp<|end_file_name|><|fim▁begin|>/*
Q Light Controller
functionmanager.cpp
Copyright (C) Heikki Junnila
Copyright (C) Massimo Callegari
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may ob... | #include "scene.h"
#include "audio.h"
#include "show.h"
#include "doc.h" |
<|file_name|>unique-assign-drop.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.
//<|fim▁hole|>// except according to those terms.
#[allow(dead_assignment)];
pub fn main() ... | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed |
<|file_name|>types.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/L... | // Volume represents a named volume in a pod that may be accessed by any containers in the pod.
type Volume struct {
// Required: This must be a DNS_LABEL. Each volume in a pod must have |
<|file_name|>service.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 TiKV Project Authors. Licensed under Apache-2.0.
use collections::HashMap;
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::Mutex;
use kvproto::metapb::{Peer, Region, Store, StoreState};
use kvproto::pdpb::*;
use super::... |
fn ask_split(&self, _: &AskSplitRequest) -> Option<Result<AskSplitResponse>> {
let mut resp = AskSplitResponse::default(); |
<|file_name|>load_test_file.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from page_objects import *
from selenium import webdriver
import datetime
import time
import Queue
import threading
import traceback
tenders = Queue.Queue()
tenders_ids = []
tenders_threads = 2
bids = Queue.Qu... |
def run(self):
while True:
# Wait for start |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># The MIT License (MIT)
#
# Copyright (c) 2013 Numenta, 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 the Software without restriction, inclu... | #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.