prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>geojson.component.d.ts<|end_file_name|><|fim▁begin|>/// <reference types="openlayers" />
import { OnInit } from '@angular/core';
import { source, ProjectionLike, format } from 'openlayers';
import { LayerVectorComponent } from '../layers';
import { SourceComponent } from './source.component';
export declar... | ngOnInit(): void;
} |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>import unittest
from contented.app import Application
class AppTests(unittest.TestCase):
def test_load_app(self):<|fim▁hole|> self.assertTrue(hasattr(app, "settings"))
self.assertTrue(hasattr(app, "content_map"))
self.assertTrue(hasattr(app, ... | app = Application({}) |
<|file_name|>defargs.cpp<|end_file_name|><|fim▁begin|>#line 3 "<stdout>"
#define YY_INT_ALIGNED short int
/* A lexical scanner generated by flex */
#define yy_create_buffer defargsYY_create_buffer
#define yy_delete_buffer defargsYY_delete_buffer
#define yy_flex_debug defargsYY_flex_debug
#define yy_init_buffer defa... | |
<|file_name|>check.py<|end_file_name|><|fim▁begin|>from importlib import import_module
from inspect import getdoc<|fim▁hole|> print 'Has __all__?', hasattr(mod, '__all__')
print 'Has __doc__?', hasattr(mod, '__doc__')
print 'doc: ', getdoc(mod)
if __name__=='__main__':
attribs('cairo')
attribs('... |
def attribs(name):
mod = import_module(name)
print name |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># Copyright 2015, Province of British Columbia
# License: https://github.com/bcgov/ckanext-bcgov/blob/master/license
from ckan.common import c, _
import pylons.config as config
import ckan.lib.base as base
import ckan.plugins as plugins
import ckan.plugins.toolkit... | package_controller = 'ckanext.bcgov.controllers.package:EDCPackageController' |
<|file_name|>WEDInterface.cpp<|end_file_name|><|fim▁begin|>/* Copyright (c) 2002-2012 Croteam Ltd.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as published by
the Free Software Foundation
This program is distributed in the hop... | |
<|file_name|>tcmalloc_debug.cc<|end_file_name|><|fim▁begin|><|fim▁hole|>#include <iostream>
using namespace std;
void foo(char* p){
memcpy(p, "01234567890", 32);
}
void foo2(char *p) {
for (int i = 0; i < 100; i++) {
cout << "start p[" << i << "]" << endl;
p[i] = 'a';
cout << "p[" << i << "] ok " <... | #include <unistd.h>
#include <string.h>
#include <stdio.h> |
<|file_name|>GraphInferenceGrpcClientTest.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2015-2018 Skymind, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0... | // sending request and getting result |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
import models<|fim▁hole|><|fim▁end|> |
admin.site.register(models.Testimonial) |
<|file_name|>server.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#-*- coding:utf-8 -*-
import logging, os.path
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import tornado.websocket
import tornado.gen
class Application(tornado.web.Application):
def __init__(se... | def check_origin(self, origin):
return True
|
<|file_name|>authorize.js<|end_file_name|><|fim▁begin|>function showErrorMessage(errorMessage) {
$("#authorize-prompt")
.addClass("error-prompt")
.removeClass("success-prompt")
.html(errorMessage);
}
function showSuccessMessage(message) {
$("#authorize-prompt")
.removeClass("err... |
$(function () {
$('[data-toggle="tooltip"]').tooltip() |
<|file_name|>directivesSpec.js<|end_file_name|><|fim▁begin|>'use strict';
/* jasmine specs for directives go here */
describe('directives', function () {
beforeEach(module('myApp.directives'));
describe('app-version', function () {
it('should print current version', function () {
module(f... | describe('Pagination directive', function () {
var element, $scope, lis;
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Generated with ./mk_vsl_tag from Varnish headers: include/tbl/vsl_tags.h include/tbl/vsl_tags_http.h include/vsl_int.h
// https://github.com/varnishcache/varnish-cache/blob/master/include/vapi/vsl_int.h
// https://github.com/varnishcache/varnish-cache/blob/master/incl... | display("Nom parser failed on {}: {}", record, nom_err)
} |
<|file_name|>Stage.js<|end_file_name|><|fim▁begin|>Stage.prototype = Object.create(MovieClip.prototype);
function Stage(canvas_id, args) {
// private vars
args = args || {};
args._name = 'stage';
var self = this,
_frameRate = args.frameRate || 0,
_interval = null,
_can... | // trigger focus events
self.trigger('onFocus');
});
_resize(); |
<|file_name|>view-full-height.js<|end_file_name|><|fim▁begin|>jQuery.each(param_obj, function (index, value) {
if (!isNaN(value)) {
param_obj[index] = parseInt(value);
}
});
function Portfolio_Gallery_Full_Height(id) {
var _this = this;
_this.container = jQuery('#' + id + '.view-full-he... | |
<|file_name|>post-link.js<|end_file_name|><|fim▁begin|>import React from "react"
import { Link } from "gatsby"
import numberToColor from "../utils/number-to-color"
import "./post-link.css"
const year = node => new Date(node.frontmatter.date).getFullYear()
const PostLink = ({ post }) => (
<div className="post-link"... | <Link to={post.frontmatter.path} style={{color: numberToColor(year(post))}}>
{post.frontmatter.title} |
<|file_name|>bootstrap-wysihtml5.sv-SE.js<|end_file_name|><|fim▁begin|>/**
* Swedish translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["sv-SE"] = {
font_styles: {
normal: "Normal Text",
h1: "Rubrik 1",
h2: "Rubrik 2",
h3: "Rubrik 3"
... | |
<|file_name|>plugin.ts<|end_file_name|><|fim▁begin|>///<reference path="../bower_components/dt-gulp-util/gulp-util.d.ts" />
import File = require('vinyl');
import gutil = require('gulp-util');
import through = require('through2');
import Configuration = require('./Configuration');
import ConfigurationOptions = requir... | return;
}
|
<|file_name|>issue_372.rs<|end_file_name|><|fim▁begin|>//! Checks that `__typename` field queries okay (and not okay) on root types.
//! See [#372](https://github.com/graphql-rust/juniper/issues/372) for details.
use futures::stream;
use juniper::{
execute, graphql_object, graphql_subscription, graphql_value, grap... | let schema = RootNode::new(Query, Mutation, Subscription);
|
<|file_name|>base_action_rule.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can re... | Return a wrapper around `old_create` calling both `old_create` and
`post_action`, in that order.
""" |
<|file_name|>upgrade042.py<|end_file_name|><|fim▁begin|>self.description = "Backup file relocation"
lp1 = pmpkg("bash")
lp1.files = ["etc/profile*"]
lp1.backup = ["etc/profile"]
self.addpkg2db("local", lp1)
p1 = pmpkg("bash", "1.0-2")
self.addpkg(p1)
lp2 = pmpkg("filesystem")
self.addpkg2db("local", lp2)
p2 = pmpkg... | self.args = "-U %s" % " ".join([p.filename() for p in (p1, p2)])
|
<|file_name|>issue-1696.rs<|end_file_name|><|fim▁begin|>// xfail-fast
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms. |
<|file_name|>string_expressions.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 u... | // "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at |
<|file_name|>default.py<|end_file_name|><|fim▁begin|># Microsoft Azure Linux Agent
#
# Copyright 2018 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.... | actions.append(DeprovisionAction(self.osutil.del_account, |
<|file_name|>persistable.rs<|end_file_name|><|fim▁begin|>use std::marker::PhantomData;
use expression::Expression;
use query_builder::{QueryBuilder, BuildQueryResult};
use query_source::{Table, Column};
use types::NativeSqlType;
/// Represents that a structure can be used to to insert a new row into the database.
///... | |
<|file_name|>helper.go<|end_file_name|><|fim▁begin|>package mediaupload
import (
"errors"
"fmt"
"os"
log "github.com/Sirupsen/logrus"
"github.com/rafael84/go-spa/backend/cfg"
"github.com/rafael84/go-spa/backend/random"
"github.com/rafael84/go-spa/backend/storage/location"
"github.com/rafael84/go-spa/backend/... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# © <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).<|fim▁hole|><|fim▁end|> | from . import account_invoice
from . import account_invoice_refund |
<|file_name|>_job.py<|end_file_name|><|fim▁begin|># -*- coding: ascii -*-
r"""
:Copyright:
Copyright 2014 - 2016
Andr\xe9 Malo or his licensors, as applicable
:License:
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... | self.attempts = attempts
self.not_before = not_before |
<|file_name|>kernel_density_estimation.py<|end_file_name|><|fim▁begin|>#<|fim▁hole|># SPDX-License-Identifier: BSD-2-Clause
#
from numba import njit, prange
import numpy as np
import argparse
import time
def kde(X):
b = 0.5
points = np.array([-1.0, 2.0, 5.0])
N = points.shape[0]
n = X.shape[0]
exp... | # Copyright (c) 2017 Intel Corporation |
<|file_name|>sendfn-spawn-with-fn-arg.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.
use std::cell::Cell;
use std::task;
... | // 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|>obj_rod.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import numpy as np
import mirheo as mir
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--axes', type=float, nargs=3)
parser.add_argument('--coords', type=str)
parser.add_argument('--vis', action='store_true', defa... | vv_ell = mir.Integrators.RigidVelocityVerlet("vv_ell") |
<|file_name|>reverse_xxd_dump_from_cc.py<|end_file_name|><|fim▁begin|># Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# htt... | |
<|file_name|>mp.go<|end_file_name|><|fim▁begin|>package mp
type MP struct {
*Server
*Client
CorpClient *Client
}
func New(id, appID, appSecret, token, aesKey string, urlPrefix ...string) *MP {
client := NewClient(appID, appSecret, true)
server := NewServer(token, aesKey, urlPrefix...)
server.SetClient(client)
... | |
<|file_name|>benchmark.py<|end_file_name|><|fim▁begin|>"""
Benchmarking and performance tests.
"""
import pytest
from pluggy import (_multicall, _legacymulticall, HookImpl, HookspecMarker,
HookimplMarker)
hookspec = HookspecMarker("example")
hookimpl = HookimplMarker("example")
def MC(methods, kw... | return [wrapper for i in range(request.param)]
|
<|file_name|>SuperTypeWildcards.java<|end_file_name|><|fim▁begin|>package generics;
//: generics/SuperTypeWildcards.java
import java.util.*;
public class SuperTypeWildcards {<|fim▁hole|> }
} ///:~<|fim▁end|> | static void writeTo(List<? super Apple> apples) {
apples.add(new Apple());
apples.add(new Jonathan());
// apples.add(new Fruit()); // Error |
<|file_name|>map.js<|end_file_name|><|fim▁begin|>'use strict';
function NavalMap(canvasId, imageMapUrl, imageCompassUrl, config) {
this.canvas = document.getElementById(canvasId);
this.imageMap = new Image();
this.imageCompass = new Image();
this.config = config;
this.itemsLoaded = false;
this.... | this.fpsLabel.y = 10; |
<|file_name|>clientset_generated.go<|end_file_name|><|fim▁begin|>/*
* Copyright 2018-2019, EnMasse authors.
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
clientset "github.com/enmasseproj... | cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
cs.AddReactor("*", "*", testing.ObjectReaction(o))
cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { |
<|file_name|>test_interdomain_pair.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2008,2009, Yale Laboratory of Networked Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* ... | delete ip;
} |
<|file_name|>lex_b_tree_sets_length_range.rs<|end_file_name|><|fim▁begin|>use itertools::Itertools;
use malachite_base::bools::exhaustive::exhaustive_bools;
use malachite_base::nevers::nevers;
use malachite_base::sets::exhaustive::lex_b_tree_sets_length_range;
use malachite_base::tuples::exhaustive::exhaustive_units;
u... | let xss_prefix = xss.clone().take(20).collect_vec();
assert_eq!(xss_prefix.into_iter().collect_vec().as_slice(), out);
assert_eq!(xss.count(), out_len); |
<|file_name|>test_cursor_fetchmany.py<|end_file_name|><|fim▁begin|>import ctds
from .base import TestExternalDatabase
class TestCursorFetchMany(TestExternalDatabase):
'''Unit tests related to the Cursor.fetchmany() method.
'''
def test___doc__(self):
self.assertEqual(
ctds.Cursor.fetch... | sequences. An empty sequence is returned when no more rows are available. |
<|file_name|>create.go<|end_file_name|><|fim▁begin|>package clusterreleaseversion
import (
"context"
"github.com/giantswarm/apiextensions/v3/pkg/annotation"
"github.com/giantswarm/conditions/pkg/conditions"
"github.com/giantswarm/microerror"
azopannotation "github.com/giantswarm/azure-operator/v5/pkg/annotation... | return nil
} |
<|file_name|>config.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> public secret: string;
public algorithm: string;
public host: string;
public masterKey: string;
constructor() {
this.port = process.env.PORT || 8080;
this.mongodb = 'mongodb://testuser:CFT^6yhn@ds161495.mlab.com:61495/m... | export default class Config {
public port: number;
public mongodb: string; |
<|file_name|>fix_raw_input.py<|end_file_name|><|fim▁begin|>"""Fixer that changes raw_input(...) into input(...)."""
# Author: Andre Roberge
<|fim▁hole|>from .. import fixer_base
from ..fixer_util import Name
class FixRawInput(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
power<... |
# Local imports
|
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate toml;
use std::{env, process};
use std::io::prelude::*;
use std::io::{BufReader, ErrorKind};
use std::collections::BTreeMap;
use std::fs::File;
use toml::Value;
static OVERRIDES_PATH : &'static str = ".multirust/overrides";
static SETTINGS_PATH : &'stati... | Plain(BTreeMap<String, String>),
Toml(BTreeMap<String, toml::Value>),
} |
<|file_name|>ClimbStairs70.py<|end_file_name|><|fim▁begin|>class Solution(object):<|fim▁hole|> :type n: int
:rtype: int
"""
nums = [0 for _ in xrange(n + 1)]
for i in xrange(1, n + 1):
if i == 1:
nums[1] = 1
elif i == 2:
nums... | def climbStairs(self, n):
""" |
<|file_name|>IntelHexWriter.java<|end_file_name|><|fim▁begin|>package ru.trolsoft.utils.files;
import ru.trolsoft.utils.StrUtils;
import java.io.*;
import java.util.Random;
/**
* Created on 07/02/17.<|fim▁hole|> *
*/
private int segmentAddress = 0;
public IntelHexWriter(Writer writer) {
if... | */
public class IntelHexWriter {
private final Writer writer;
/** |
<|file_name|>test_do_authorize_user_for_task_by_email.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import unittest
from werkzeug.exceptions import Forbidden, NotFound
from tests.logic_t.layer.LogicLayer.util import generate_ll
class AuthorizeUserForTaskByEmailTest(unittest.TestCase):
def setUp(self):
... | |
<|file_name|>policytree.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from pyparsing import *
from charm.toolbox.node import *
import string
objStack = []
def createAttribute(s, loc, toks):
if toks[0] == '!':
newtoks = ""
for i in toks:
newtoks += i
return BinNode(newtoks)... | atom = lpar + expr + rpar | (node).setParseAction( pushFirst )
term = atom + ZeroOrMore((Operator + term).setParseAction( pushFirst )) |
<|file_name|>SubAccount2.go<|end_file_name|><|fim▁begin|>package iso20022
// The subaccount of the safekeeping account<|fim▁hole|>
// Unique and unambiguous identification for the account between the account owner and the account servicer.
Identification *Max35Text `xml:"Id"`
}
func (s *SubAccount2) SetIdentificati... | type SubAccount2 struct { |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from django.apps import AppConfig
from django.db.models import signals
from django.contrib.auth import get_user_model
def populate_users(sender, **kwargs):
User = get_user_model()
for i in range(10):
username = "... | def ready(self): |
<|file_name|>inferredIndexerOnNamespaceImport.js<|end_file_name|><|fim▁begin|>//// [tests/cases/compiler/inferredIndexerOnNamespaceImport.ts] ////
//// [foo.ts]
export const x = 3;
export const y = 5;
//// [bar.ts]
import * as foo from "./foo";
function f(map: { [k: string]: number }) {
// ...
}
f(foo);
/... | exports.__esModule = true;
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>use std::collections::BTreeMap;
pub fn transform (input: &BTreeMap<i32, Vec<String>>) -> BTreeMap<String, i32> {
let mut output = BTreeMap::new();<|fim▁hole|> output.insert(name.to_lowercase(), *value);
}
}
output
}<|fim▁end|> |
for (value, names) in input {
for name in names { |
<|file_name|>InProcessMessagingSkeleton.js<|end_file_name|><|fim▁begin|>/*
* #%L
* %%
* Copyright (C) 2011 - 2017 BMW Car IT GmbH
* %%
* 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
* ... | * @function
* |
<|file_name|>brcd_fc_san_lookup_service.py<|end_file_name|><|fim▁begin|># (c) Copyright 2014 Brocade Communications Systems Inc.
# All Rights Reserved.
#
# Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complia... | |
<|file_name|>test_temperanotes.py<|end_file_name|><|fim▁begin|>import temperanotes
import pytest, bisect
@pytest.fixture
def idiot_temp():
temp = [1, 1.05, 1.1, 1.15, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9] # not a temperament, just a set of numbers for testing
assert len(temp) == 12 ... | assert len(temperanotes.note_names_flat) == 12
for note in "ABCDEFG":
assert note in temperanotes.note_names_sharp
assert note in temperanotes.note_names_flat |
<|file_name|>checkin.py<|end_file_name|><|fim▁begin|>import datetime
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from six import print_
import bigbro
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
... | with open(log_location, 'a') as outf:
while True:
try:
rfid = raw_input() |
<|file_name|>watcher.test.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*-----... | ];
|
<|file_name|>ack.py<|end_file_name|><|fim▁begin|># Copyright 2015 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/LICENS... | |
<|file_name|>ex1.js<|end_file_name|><|fim▁begin|>var DI = require('../');
function A(options) {
this.name = 'A';
this.options = options;
}
function B(options) {
if (! (this instanceof B)) {
return new B(options);
}
this.name = 'B';
this.options = options;
}
var di = new DI();
function S(msg) {
cons... | "f": {
"@class": "&A",
"test": "test3"
}, |
<|file_name|>Cap02_pagina_25_comp_interactiva.py<|end_file_name|><|fim▁begin|>'''
@author: Sergio Rojas
@contact: rr.sergio@gmail.com
--------------------------<|fim▁hole|> Atribución-NoComercial-CompartirIgual 3.0 Venezuela (CC BY-NC-SA 3.0 VE)
http://creativecommons.org/licenses/by-nc-sa/3.0/ve/
Creado en abril 19,... | Contenido bajo |
<|file_name|>account.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under The General Public License (GPL), version 3.
// Unless required by applicable law or agreed to in writing, the SAFE Network Software distributed
// under the GPL Licence... | |
<|file_name|>techno-date-cell-test.js<|end_file_name|><|fim▁begin|>/* jshint expr:true */
import { expect } from 'chai';
import {<|fim▁hole|>import hbs from 'htmlbars-inline-precompile';
describeComponent(
'techno-date-cell',
'Integration: TechnoDateCellComponent',
{
integration: true
},
function() {
... | describeComponent,
it
} from 'ember-mocha'; |
<|file_name|>generic.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
... | for curEp in actual_episodes:
epObj.append(show.getEpisode(actual_season, curEp))
|
<|file_name|>Stormpath.js<|end_file_name|><|fim▁begin|>import 'isomorphic-fetch'
import base64 from 'base-64'
import utf8 from 'utf8'
import Request from './Request'
function encodeAccount(username, password) {
let bytes = utf8.encode(`${ username }:${ password }`)
return base64.encode(bytes)
}
export default cla... | return Request.get(url, options) |
<|file_name|>email_parser.py<|end_file_name|><|fim▁begin|>from copy import deepcopy
from datetime import datetime
from datetime import timezone
from email.utils import mktime_tz
from email.utils import parsedate_tz
from io import BytesIO
from itertools import chain
from mimetypes import guess_type
from typing import Ca... | |
<|file_name|>MySQLDatabaseMeta.java<|end_file_name|><|fim▁begin|>package com.xxl.job.database.meta;
import com.xxl.job.database.dboperate.DBManager;
/**
* 基于mysql的一些特殊处理定义
*
*/
public class MySQLDatabaseMeta extends DatabaseMeta {
public MySQLDatabaseMeta() {<|fim▁hole|><|fim▁end|> | this.dbType = DBManager.MYSQL_DB;
}
} |
<|file_name|>Message.js<|end_file_name|><|fim▁begin|>/**
* Vasya Hobot
*
* Copyright (c) 2013-2014 Vyacheslav Slinko
* Licensed under the MIT License
*/
function Message(chat, body) {
this._chat = chat;
this._body = body;
}
Message.prototype.getChat = function() {
return this._chat;<|fim▁hole|> r... | };
Message.prototype.getBody = function() { |
<|file_name|>remote.py<|end_file_name|><|fim▁begin|>import time
import random
from random import randint
# from library import Trigger, Axis
# from library import PS4
from library import Joystick
import RPi.GPIO as GPIO # remove!!!
from emotions import angry, happy, confused
# from pysabertooth import Sabertooth
# fro... | ps4 = js.get()
btnSquare = ps4.buttons[0]
btnTriangle = ps4.buttons[1] |
<|file_name|>Content.js<|end_file_name|><|fim▁begin|>import React from 'react';
<<<<<<< HEAD
import { Switch, Route } from 'react-router-dom';
import Home from './Home';
import About from './About';
import Blog from './Blog';
import Resume from './Resume';
import Error404 from './Error404';
=======
// import GithubFo... | >>>>>>> 23d814bedfd5c07e05ea49d9a90053074a4c829a |
<|file_name|>px-validation-custom-tests.js<|end_file_name|><|fim▁begin|>// This is the wrapper for custom tests, called upon web components ready state
function runCustomTests() {
// Place any setup steps like variable declaration and initialization here
// This is the placeholder suite to place custom tests in
... | done();
});
}); |
<|file_name|>dsf_with_sic.py<|end_file_name|><|fim▁begin|>class DSF_SIC_Map(object):
"""docstring for SIC_Map"""
def __init__(self, dsffile = 'crsp/dsf.csv', sicfile = 'sic_codes.txt'):
self.dsf = pd.read_csv("dsf.csv", dtype = {'CUSIP': np.str, 'PRC': np.float}, na_values = {'PRC': '-'})
self.s... | self.dsf = self.dsf[to_keep]
def sic_merge(self):
self.clean_dsf = self.dsf.merge(self.sic, how = "left") |
<|file_name|>basicscroll.js<|end_file_name|><|fim▁begin|>var url = document.URL;
var array = url.split("/");
var base = array[3];
if (array[2] == 'localhost') {
var staticurl = '/' + base + '/client/dashboard/reporting';
//var url_action = array[6].split("?")[0];
} else {
var staticurl = '/client/dashboard/repor... | |
<|file_name|>test_copyonwrite_mkdir.py<|end_file_name|><|fim▁begin|>from __future__ import with_statement
from nose.tools import (
eq_ as eq,
)
from filesystem.test.util import (
maketemp,
assert_raises,
)
import errno
import os
import filesystem
import filesystem.copyonwrite
def test_mkdir():
... | assert not os.path.isdir(foo)
def test_mkdir_bad_exists():
tmp = maketemp() |
<|file_name|>_showexponent.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class ShowexponentValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="showexponent", parent_name="parcats.line.colorbar", **kwargs
):
super(ShowexponentValid... | parent_name=parent_name,
edit_type=kwargs.pop("edit_type", "colorbars"), |
<|file_name|>mesh2vtk.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import numpy as np
mdir = "mesh3d/"
fname = "out_p6-p4-p8"
####################
print "input mesh data file"
f1 = open(mdir+fname+".mesh", 'r')<|fim▁hole|>
for line in f1:
if line.startswith("Vertices"): break
pcount = int(f1.next())
xyz = np... | |
<|file_name|>validator.py<|end_file_name|><|fim▁begin|>import urllib.parse
from upol_search_engine.upol_crawler.tools import blacklist, robots
def validate_regex(url, regex):
"""Check if url is validate with regex"""
return regex.match(url)
def validate_anchor(url):
"""Check if url include anchor"""
... |
for url_keyword in url_keywords: |
<|file_name|>ppaux.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/... | fn repr(&self, tcx: &ctxt) -> String {
match *self {
ty::BrAnon(id) => format!("BrAnon({})", id),
ty::BrNamed(id, name) => { |
<|file_name|>iosxr.py<|end_file_name|><|fim▁begin|>#
# (c) 2016 Red Hat Inc.
#
# 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<|fim▁hole|># (at your option) any later version.
#
# Ansible is distrib... | # the Free Software Foundation, either version 3 of the License, or |
<|file_name|>fastcgi_test.go<|end_file_name|><|fim▁begin|>package fastcgi
import (
"net"
"net/http"
"net/http/fcgi"
"net/http/httptest"
"net/url"
"strconv"
"testing"
)
func TestServeHTTP(t *testing.T) {
body := "This is some test body content"
bodyLenStr := strconv.Itoa(len(body))
listener, err := net.List... | envExpected["REMOTE_ADDR"] = "192.168.0.10"
testBuildEnv(&r, rule, fpath, envExpected) |
<|file_name|>python-arithmetic-operators.py<|end_file_name|><|fim▁begin|>if __name__ == '__main__':
a = int(raw_input())<|fim▁hole|> b = int(raw_input())
print a + b
print a - b
print a * b<|fim▁end|> | |
<|file_name|>pages.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright(C) 2012 Romain Bignon
#
# This file is part of a weboob module.
#<|fim▁hole|># This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
... | |
<|file_name|>JavaScriptOperatorTest.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
... | *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
<|file_name|>paretto-edit.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';<|fim▁hole|> templateUrl: './paretto-edit.component.html',
styleUrls: ['./paretto-edit.component.scss']
})
export class ParettoEditComponent implements OnInit {
constructor() { }
ngOnInit() {
... |
@Component({
selector: 'app-paretto-edit', |
<|file_name|>module_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 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.
"""Tests for the module module, which contains Module and related classes.... | with fs:
my_module = loader.LoadModule(module_name='z.foo')
self.assertEquals(1, len(my_module.dependent_raw_scripts)) |
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>// this is a little Node program, running on a Node server
// require() will look inside of a folder and get information, similar to import
// NOTE: gulpfile.js must be in the main directory
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat ... | // to get SASS partials to trigger changes |
<|file_name|>FilerioCom.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from module.plugins.internal.XFSAccount import XFSAccount
class FilerioCom(XFSAccount):
__name__ = "FilerioCom"
__type__ = "account"
__version__ = "0.07"<|fim▁hole|> __status__ = "testing"
__description__ = """... | |
<|file_name|>test_endpoint.py<|end_file_name|><|fim▁begin|>from asyncio import coroutine
import pytest
from aiohttp import HttpBadRequest, HttpMethodNotAllowed
from fluentmock import create_mock
from aiohttp_rest import RestEndpoint
class CustomEndpoint(RestEndpoint):
def get(self):
pass
def patch(... |
@pytest.mark.asyncio
async def test_dispatch_raises_bad_request_when_match_info_does_not_exist(endpoint: RestEndpoint): |
<|file_name|>jp2kakadu.py<|end_file_name|><|fim▁begin|># Copyright 2014 NeuroData (http://neurodata.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
#
# http://www.apache.org/license... | subprocess.call( [ './kdu_expand' ,'-i', '{}'.format(name), '-o', '{}.tiff'.format(writelocation) ] ) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#
# Created by DraX on 2005.08.08
#
# Updated by ElgarL on 28.09.2005
#
print "importing village master data: Talking Island Village ...done"
import sys
from net.sf.l2j.gameserver.model.quest import State
from net.sf.l2j.gameserver.model.quest impor... | |
<|file_name|>benchmark.scipy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib 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 Lice... |
name = "arcsine:mean"
setup = "from scipy.stats import arcsine; from random import random; rv = arcsine(10.0, 20.0);" |
<|file_name|>Airy_root_finder.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
from scipy.special import airy
from numpy import abs
def f(xinput):
x0=xinput
xoutput=x0
Ai=abs(airy(-xoutput)[0])
while Ai>1e-12:<|fim▁hole|> Ai=ai[0]
Aip=ai[1]
xoutput=xoutput+Ai/Aip
retu... | ai=abs(airy(-xoutput)) |
<|file_name|>ml_error.py<|end_file_name|><|fim▁begin|>"""
ML Estimation of Spatial Error Model
"""
__author__ = "Luc Anselin luc.anselin@asu.edu, Serge Rey srey@asu.edu"
import numpy as np
import numpy.linalg as la
import pysal as ps
from pysal.spreg.utils import RegressionPropsY, RegressionPropsVM
import diagnostics... | WW = ww.todense() |
<|file_name|>DescribeAlgorithmRequest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is l... | if (other.getAlgorithmArn() == null ^ this.getAlgorithmArn() == null)
return false; |
<|file_name|>SamplingAccuracyEvaluation.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import operator
def populationListGenerate(filePath, target):
print('Generate Population List')
populationList = []
populationFile = open(filePath, 'r')
while True:
line = populationFile.readline()
if n... | from SamplingAccuracyEvaluation import SamplingAlgorithm as SA
from SamplingAccuracyEvaluation import AccuracyEvaluation as AE
from SamplingAccuracyEvaluation import PrintGraph as PG
from SamplingAccuracyEvaluation import StatisticalCalculation as SC |
<|file_name|>content_type_collection.py<|end_file_name|><|fim▁begin|>from office365.runtime.client_object_collection import ClientObjectCollection
from office365.sharepoint.content_type import ContentType
<|fim▁hole|> super(ContentTypeCollection, self).__init__(context, ContentType, resource_path)<|fim▁end|> | class ContentTypeCollection(ClientObjectCollection):
"""Content Type resource collection"""
def __init__(self, context, resource_path=None): |
<|file_name|>gen_generic_lpu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Create generic LPU and simple pulse input signal.
"""
from itertools import product
import sys
import numpy as np
import h5py
import networkx as nx
def create_lpu_graph(lpu_name, N_sensory, N_local, N_proj):
"""
Create a ... | dt : float |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#![feature(auto_traits)]
#![deny(warnings)]
use crate::sync::SyncResult;
/// Mononoke Cr... | let wait_for_target_repo_hg_sync = sub_m.is_present(ARG_HG_SYNC_BACKPRESSURE);
Ok(Self {
backsync_repos,
wait_for_target_repo_hg_sync, |
<|file_name|>cookie.js<|end_file_name|><|fim▁begin|>/*\
|*|
|*| :: cookies.js ::
|*|
|*| A complete cookies reader/writer framework with full unicode support.
|*|
|*| Revision #1 - September 4, 2014
|*|
|*| https://developer.mozilla.org/en-US/docs/Web/API/document.cookie
|*| https://developer.mozilla.org/User:fusi... | |*|
|*| * docCookies.setItem(name, value[, end[, path[, domain[, secure]]]]) |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db import models
import mozdns
from mozdns.domain.models import Domain
from mozdns.view.models import View
from mozdns.mixins import ObjectUrlMixin, DisplayMixin
from mozdns.validation... | if fail:
raise ValidationError(
"The zone you are trying to assign this record into does " |
<|file_name|>UserServiceImpl.java<|end_file_name|><|fim▁begin|>package org.currconv.services.impl;
import java.util.List;
import org.currconv.dao.UserDao;
import org.currconv.entities.user.User;
import org.currconv.services.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springfr... | public User findByUserName(String name){
return dao.findByUserName(name);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.