prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>hello_world.rs<|end_file_name|><|fim▁begin|>extern crate cocoa;
use cocoa::base::{selector, nil, YES, NO};
use cocoa::foundation::{NSUInteger, NSRect, NSPoint, NSSize,
NSAutoreleasePool, NSProcessInfo, NSString};
use cocoa::appkit::{NSApp,
NSApplication, NSApplicationActivationPolicyRegular,
... | let _pool = NSAutoreleasePool::new(nil);
let app = NSApp(); |
<|file_name|>test_db.py<|end_file_name|><|fim▁begin|>import unittest
from loadsbroker.db import Project, Plan, Step, Database
class DatabaseTest(unittest.TestCase):
def setUp(self):
self.db = Database('sqlite:///:memory:')
def test_project(self):
session = self.db.session()
# a proje... | plan = Plan(name='s1', enabled=True)
project.plans.append(plan)
|
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
<|fim▁hole|>
class WSPayForm(forms.Form):
ShopID = forms.CharField(widget=forms.HiddenInput)
ShoppingCartID = forms.CharField(widget=forms.HiddenInput)
TotalAmount = forms.CharField(widget=form... | from django import forms
|
<|file_name|>index.spec.js<|end_file_name|><|fim▁begin|>import internalQuerySelector from '../src/query-selector';
import { querySelector } from '../src';
describe('exports', () => {
it('exports `querySelector`', () => {<|fim▁hole|><|fim▁end|> | expect(querySelector).toEqual(internalQuerySelector);
});
}); |
<|file_name|>dataSlice.ts<|end_file_name|><|fim▁begin|>import { createSlice, PayloadAction } from '@reduxjs/toolkit';
import _ from 'lodash';
import SampleJson from '../../samples/simple.json';
import { Path, EditMode, EditType } from '../../types';
import { isArray } from '../../utils/is';
/**
* State of dataSlice
*... | } |
<|file_name|>NPCManager.cpp<|end_file_name|><|fim▁begin|>/*
Copyright © 2011-2012 Clint Bellanger
This file is part of FLARE.
FLARE 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... |
/** |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>/*global getAccessToken*/
function notifyUser(user) {
browser.notifications.create({
"type": "basic",
"title": "Google info",
"message": `Hi ${user.name}`
});}
function logError(error) {
console.error(`Error: ${error}`);
}
/**<|fim▁hole|>- use it to... | When the button's clicked:
- get an access token using the identity API |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
# -*- coding: UTF-8 -*-
from dblog.handler import index_handler
from dblog.handler import cat_handler
from dblog.handler import back_article_handler
from dblog.handler import ckeditor_handler
from dblog.handler import front_handler
urls = [
# --... | # -------- 文章
(r"/admin/article/index", back_article_handler.Index),
(r"/admin/article/detail", back_article_handler.Detail), |
<|file_name|>NativeObject.ts<|end_file_name|><|fim▁begin|>import ChangeListeners from './ChangeListeners';
import {hint} from './Console';
import EventObject from './EventObject';
import {EventsClass} from './Events';
import Listeners from './Listeners';
import {PropertyTypes, types} from './property-types';
import * a... | isDisposed() {
return !!this._isDisposed; |
<|file_name|>user.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';<|fim▁hole|>})
export class UserComponent implements OnInit {
constructor(public router: Router) { }
ngOnInit() {
if (this.router.url === '/user') {
... |
@Component({
selector: 'app-user',
template: '<router-outlet></router-outlet>' |
<|file_name|>unwind-box-res.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/... | v: *int,
}
|
<|file_name|>column-shifter-spec.js<|end_file_name|><|fim▁begin|>var expect = require('chai').expect;
var sinon = require('sinon');
var ColumnShifter = require('component/grid/projection/column-shifter');
var Base = require('component/grid/projection/base');
var Response = require('component/grid/model/response');
des... | expect(model.set.calledWith({ 'column.skip': 0 })).to.be.true;
});
}); |
<|file_name|>Ship.js<|end_file_name|><|fim▁begin|>/* Ship.js
KC3改 Ship Object
*/
(function(){
"use strict";
var deferList = {};
window.KC3Ship = function( data, toClone ){
// Default object properties included in stringifications
this.rosterId = 0;
this.masterId = 0;
this.level = 0;
this.exp... | const isNightBattle = nightSpecialAttackType.length > 0;
const canNightAntisub = warfareType === "Antisub" && (isNightStart || isCombined);
|
<|file_name|>run_pipeline_on_spectrum_library.py<|end_file_name|><|fim▁begin|>#!../../../../virtualenv/bin/python3
# -*- coding: utf-8 -*-
# NB: The shebang line above assumes you've installed a python virtual environment alongside your working copy of the
# <4most-4gp-scripts> git repository. It also only works if yo... |
main(logger=logger,
input_library=args.input_library,
workspace=args.workspace, |
<|file_name|>run.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;
use std::vec::IntoIter;
use std::iter::Iterator;
use transit::StopTime;
#[derive(Debug, PartialEq)]
pub struct Run<'a> {
pub trip: String,
// TODO: StopTime is very verbose
// redundant info removed from StopTime (trip id, sequ... |
let runs = run_groups.drain().map(|e| e.1).collect::<Vec<Run>>();
RunIterator {
runs: runs.into_iter(), |
<|file_name|>verify-topo-devices.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
import requests
import sys
import urllib
from requests.auth import HTTPBasicAuth
if len(sys.argv) != 5:
print "usage: verify-topo-links onos-node cluster-id first-index last-index"
sys.exit(1)
node = sys.argv[1]
cluster = sys.argv[... | #! /usr/bin/env python |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
/*
try {
require(./newrelic)
require('newrelic')
} catch (e) {
// Don't load New Relic if the configuration file does't exist.
}
*/
/*
require('babel/register')({
only: new RegExp(__dirname + '/lib' + '|' +<|fim▁hole|> __d... | |
<|file_name|>json.rs<|end_file_name|><|fim▁begin|>/*
* Hi there !
*
* I found that handling Json was quite annoying, so I wrote this
* little lib to help. You can find an example of the usage in the
* tests at the end.
*
* I lacked inspiration on the naming of value() and item(), and got
* lost in the lifetimes... |
impl fmt::Default for ValueError {
fn fmt(obj: &ValueError, f: &mut fmt::Formatter) {
write!(f.buf, r#"Can't convert value: "{}" Reason: "{}""#, obj.value, obj.msg); |
<|file_name|>linear_operator_test_util.py<|end_file_name|><|fim▁begin|># Copyright 2016 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
#
# ht... | with self.session(graph=ops.Graph()) as sess: |
<|file_name|>types.hpp<|end_file_name|><|fim▁begin|>/*<|fim▁hole|>#define _TYPES_HPP
namespace fbi
{
namespace network
{
typedef boost::shared_ptr<string> ChatMessage;
typedef deque<ChatMessage> ChatMessageQueue;
}
}
#endif<|fim▁end|> | * types.hpp
*/
#ifndef _TYPES_HPP |
<|file_name|>script_thread.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/. */
//! The script thread is the thread that owns the DOM i... | let global_ref = GlobalRef::Window(window.r());
devtools::handle_evaluate_js(&global_ref, s, reply)
},
DevtoolScriptControlMsg::GetRootNode(id, reply) => |
<|file_name|>Block.js<|end_file_name|><|fim▁begin|>/**
* Copyright © 2009-2012 A. Matías Quezada
*/
use('sassmine').on(function(sas) {
var Block = Class.extend({
constructor: function(message, code) {
this.base();
this.message = message;
this.code = code;
this.before = [];
this.after = [];
},
... | |
<|file_name|>test_packages.py<|end_file_name|><|fim▁begin|>import pytest
@pytest.mark.parametrize("name", [
("apt-file"),
("apt-transport-https"),
("arandr"),
("atom"),
("blktrace"),
("ca-certificates"),
("chromium-browser"),
("cowsay"),
("cron"),
("curl"),
("deluge"),
("diod"),<|fim▁hole|> ("... | ("docker-ce"),
("dropbox"), |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>/**
* Module dependencies.
*/
var express = require('express');
var routes = require('./routes');
var user = require('./routes/user');
var http = require('http');
var path = require('path');
var app = express();
// all environments
app.set('port', process.env.PORT |... | app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(app.router); |
<|file_name|>PanelItem.hpp<|end_file_name|><|fim▁begin|>#ifndef PANELITEM_HPP
#define PANELITEM_HPP
#include "LevelMakerPanel.hpp"
#include "Button.hpp"
#include "InputString.hpp"
#include "Text.hpp"
class PanelItem : public LevelMakerPanel {
private:
Sprite* sprite_input_mass;
Button* button_input_mass;
lalge::R2... |
void update(); |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>"""All forms for the extension."""
from django.forms import ModelForm
from .models import WebResource
<|fim▁hole|>class WebResourceForm(ModelForm):
"""Form for a single web resource."""
class Meta:
"""Form meta."""
model = WebResource
... | |
<|file_name|>indicator.directive.js<|end_file_name|><|fim▁begin|>(function () {
'use strict';
angular.module('atacamaApp').directive('atacamaIndicator', indicatorDirective);
function indicatorDirective() {
return {
templateUrl: 'app/components/widgets/indicator/indicator.html',
link: linkFunc,
... | scope.selectedLocation = null;
scope.isLoaded = false; |
<|file_name|>test_aio.rs<|end_file_name|><|fim▁begin|>use libc::c_int;
use nix::{Error, Result};
use nix::errno::*;
use nix::sys::aio::*;
use nix::sys::signal::*;
use nix::sys::time::{TimeSpec, TimeValLike};
use std::io::{Write, Read, Seek, SeekFrom};
use std::os::unix::io::AsRawFd;
use std::{thread, time};
use tempfil... | }; |
<|file_name|>test_upload_hub.py<|end_file_name|><|fim▁begin|>import re
import pytest
from flask import url_for
from freezegun import freeze_time
from app.formatters import normalize_spaces
from tests.conftest import (
SERVICE_ONE_ID,
create_active_caseworking_user,
create_active_user_with_permissions,
... | 'Sending 1 January 2016 at 11:09am '
'1 text message waiting to send'
),
] |
<|file_name|>test_cons.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sugar_stats_consolidation<|fim▁hole|>from sugar_stats_consolidation.consolidation import *
db = DB_Stats('statistics', 'root', 'gustavo')
db.create();
con = Consolidation('/var/lib/sugar-stats/rrd', db)
con.process_rrds()<|fim▁end|> | from sugar_stats_consolidation.db import *
from sugar_stats_consolidation.rrd_files import * |
<|file_name|>api.go<|end_file_name|><|fim▁begin|>// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package appstream
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
)
const opAssociateFleet = "AssociateFlee... | HTTPMethod: "POST",
HTTPPath: "/",
}
|
<|file_name|>common.py<|end_file_name|><|fim▁begin|>from datetime import date
class YearInfo(object):
def __init__(self, year, months_ok, months_na):
self.year = year
self.months = set(range(1, 13))
self.months_ok = set(months_ok)
self.months_na = set(months_na)
self.months_... |
for payment in payments_list: |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
var matrix = require( 'dstructs-matrix' ),
ekurtosis = require( './../lib' );
var k,
mat,
out,
tmp,
i;
// ----
// Plain arrays...
k = new Array( 10 );
for ( i = 0; i < k.length; i++ ) {
k[ i ] = i;
}
out = ekurtosis( k );
console.log( 'Arrays: %s... | |
<|file_name|>harness_simple.py<|end_file_name|><|fim▁begin|>"""
The simple harness interface
"""
__author__ = """Copyright Andy Whitcroft, Martin J. Bligh 2006"""
import os, harness, time
class harness_simple(harness.harness):
"""
The simple server harness
Properties:
job
... | pre = 'AUTOTEST_STATUS:%s:' % (tag,)
self.status.write(pre + line + '\n') |
<|file_name|>ContactPersonalInfo.java<|end_file_name|><|fim▁begin|>/**
--| ADAPTIVE RUNTIME PLATFORM |----------------------------------------------------------------------------------------
(C) Copyright 2013-2015 Carlos Lozano Diez t/a Adaptive.me <http://adaptive.me>.
Licensed under the Apache License, Version 2.0... | @param name of the Contact
@since v2.0
*/
public void setName(String name) { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># mssql/__init__.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file><|fim▁hole|># the MIT License: http://www.opensource.org/licenses/mit-license.php
from sqlalchemy.dialects.mssql import base, pyodbc, adodbapi, \
pymssql, ... | #
# This module is part of SQLAlchemy and is released under |
<|file_name|>pod_converter_test.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2017-2020 Tigera, 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... | // See the License for the specific language governing permissions and
// limitations under the License.
|
<|file_name|>lexer.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# EDIS - a simple cross-platform IDE for C
#
# This file is part of Edis
# Copyright 2014-2015 - Gabriel Acosta <acostadariogabriel at gmail>
# License: GPLv3 (see http://www.gnu.org/licenses/gpl.html)
from PyQt4.Qsci import QsciLexerCPP
from P... | |
<|file_name|>PhoneticSymbolTable.java<|end_file_name|><|fim▁begin|>package de.jdellert.iwsa.sequence;
import java.io.Serializable;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
/**
* S... | {
return new TreeSet<String>(symbolToID.keySet());
} |
<|file_name|>domains.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
##
# domains.py: module for domains of model outcomes
##
# © 2017, Chris Ferrie (csferrie@gmail.com) and
# Christopher Granade (cgranade@cgranade.com).
#
# Redistribution and use in source and binary forms, with or wi... | |
<|file_name|>test_resource.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import budgetdatapackage
import datapackage
import datetime
from nose.tools import rais... | def test_bad_datePublished(self):
self.values['datePublished'] = 'batman'
budgetdatapackage.BudgetResource(**self.values) |
<|file_name|>questionGenerator.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Copyright 2011 Yaşar Arabacı
This file is part of packagequiz.
packagequiz 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... |
types = [getattr(q, t) for t in dir(q) if str(type(getattr(q, t))) == "<class 'type'>"]
questionTypes = [qtype for qtype in types if (issubclass(qtype, q.Question) and qtype is not q.Question)] |
<|file_name|>assert-eq-macro-fail.rs<|end_file_name|><|fim▁begin|>// error-pattern:left: 14 does not equal right: 15<|fim▁hole|>#[deriving(Eq)]
struct Point { x : int }
fn main() {
assert_eq!(14,15);
}<|fim▁end|> | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>(function () {
angular.module('app').controller('app.views.tenants.index', [
'$scope', '$uibModal', 'abp.services.app.tenant',
function ($scope, $uibModal, tenantService) {
var vm = this;
vm.tenants = [];
funct... | |
<|file_name|>gentrace.py<|end_file_name|><|fim▁begin|># gentrace.py
#
# Trace a generator by printing items received
def trace(source):
for item in source:
print item
yield item
<|fim▁hole|>if __name__ == '__main__':
from apachelog import *
lines = open("access-log")
log = trace(apach... | # Example use |
<|file_name|>bitcoin_ca.ts<|end_file_name|><|fim▁begin|><TS language="ca" version="2.0">
<context>
<name>AboutDialog</name>
<message>
<source>About Pesetacoin Core</source>
<translation type="unfinished"/>
</message>
<message>
<source><b>Pesetacoin Core</b> version</s... | |
<|file_name|>margin_test.go<|end_file_name|><|fim▁begin|>package geom
import "testing"
func TestMakeMargin(t *testing.T) {
if m := MakeMargin(0.5); m != (Margin{
Top: 0.5,
Bottom: 0.5,
Left: 0.5,
Right: 0.5,
}) {
t.Error("MakeMargin returned an invalid value:", m)
}
}
func TestMarginTopLeftZero(t ... | } |
<|file_name|>mysqlUtils_test.go<|end_file_name|><|fim▁begin|>package mysqlgoutils
<|fim▁hole|>import (
"testing"
)
func TestSplitHostOptionalPortAndSchema(t *testing.T) {
assertSplit := func(addr, expectHost string, expectPort int, expectSchema string, expectErr bool) {
host, port, sche... | |
<|file_name|>testutils.go<|end_file_name|><|fim▁begin|>// Copyright (C) 2019 The Syncthing Authors.
//
// 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/.
package testu... | |
<|file_name|>switcher.js<|end_file_name|><|fim▁begin|>jQuery(document).ready(function($){
/* Click Tab */
$( document.body ).on( 'click', '#fxb-switcher a.nav-tab', function(e){
e.preventDefault();
/* Bail */
if( $( this ).hasClass( 'nav-tab-active' ) ){
return false;
}
/* Confirm ? */
if( ! $( this... | $( this ).addClass( 'switch-confirmed' ); |
<|file_name|>mailman.py<|end_file_name|><|fim▁begin|>"""A Mailman newsletter subscription interface.
To use this plugin, enable the newsletter module and set the newsletter module and name settings
in the admin settings page.
"""
from django.utils.translation import ugettext as _
from Mailman import MailList, Errors
... | oldAttr.sort()
sub.update_attributes(attributes)
newAttr = [(a.name,a.value) for a in sub.attributes.all()]
newAttr.sort() |
<|file_name|>signals.py<|end_file_name|><|fim▁begin|>from django.dispatch import Signal
<|fim▁hole|>page_unpublished = Signal(providing_args=['instance'])
pre_page_move = Signal(providing_args=['instance', 'parent_page_before', 'parent_page_after', 'url_path_before', 'url_path_after'])
post_page_move = Signal(providin... | page_published = Signal(providing_args=['instance', 'revision']) |
<|file_name|>server.js<|end_file_name|><|fim▁begin|><|fim▁hole|>import cors from 'koa-cors'
import mongoose from 'mongoose'
import config from './config'
import mongooseConfig from './config/mongoose'
import routeRegistry from './routeRegistry'
const app = new Koa()
app.context.db = mongoose
mongooseConfig()
app.on('... | import Koa from 'koa'
import body from 'koa-bodyparser'
import convert from 'koa-convert' |
<|file_name|>do_proxy_barix_status.py<|end_file_name|><|fim▁begin|>import BaseHTTPServer
import logging
import os
import sys
import threading
import time
from chirp.common.conf import (BARIX_STATUS_HOST, BARIX_STATUS_PORT,
BARIX_HOST, BARIX_PORT)
from chirp.stream import barix
_TIM... | <tr><td>Status</td><td>%(status)s</td></tr>
<tr><td>Left Level</td><td>%(left_level)s (avg %(left_level_avg)s)</td></tr>
<tr><td>Right Level</td><td>%(right_level)s (avg %(right_level_avg)s)</td></tr> |
<|file_name|>forbidden-name.directive.ts<|end_file_name|><|fim▁begin|>import { Directive, Input, OnChanges, SimpleChanges } from '@angular/core';
import { AbstractControl, NG_VALIDATORS, Validator, ValidatorFn, Validators } from '@angular/forms';
export function forbiddenNameValidator(nameRe: RegExp): ValidatorFn {
... | private valFn = Validators.nullValidator; |
<|file_name|>interventionService.js<|end_file_name|><|fim▁begin|>'use strict';
define(['angular', 'lodash', 'moment'], function(angular, _, moment) {
var dependencies = [];
var InterventionService = function() {
var LOWER_BOUND_OPTIONS = [{
value: 'AT_LEAST',
label: 'At least (>=)',
shortLabe... | return _.isEmpty(constraint[constraintName]);
}); |
<|file_name|>SearchCovers.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from Plugins.Plugin import PluginDescriptor
from Components.ActionMap import *
from Components.Label import Label
from Components.Sources.StaticText import StaticText
from Components.MultiContent import Mul... | if not self.background:
self.callback_notfound(self.notfound)
|
<|file_name|>bitstring.rs<|end_file_name|><|fim▁begin|>/// Bit Strings are length/value pairs, so that bit strings with leading
/// zeros aren't conflated.
#[derive(Eq,PartialEq,Hash,Debug,Clone,Copy)]
pub struct BS {
pub length: i64,
pub value: i64,
}
pub trait BitString {
fn pow(_: i64, _: i64) -> i64;
... | let x = Self::pow(b, n / 2); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2022 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.test.utils import override_settings
from sis_provisioner.tests import (
fdao_pws_override, fdao_hrp_override, fdao_bridge_override)
from sis_provisioner.tests.acc... | user_file_name_override = override_settings( |
<|file_name|>basic-auth.ts<|end_file_name|><|fim▁begin|>import { FetchMiddleware } from './fetcher';
import * as base64 from '../util/base64';
export default (userName: string, password: string): FetchMiddleware => {
const basicAuthHeader = 'Basic ' + base64.encode(userName + ':' + password);
return (request, ne... | request.headers.set('Authorization', basicAuthHeader);
return next(request);
|
<|file_name|>download_data.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import os
import errno
import requests
url='http://www.jeep.com/hostd/getlocatedealers.json?zipCode=60202&zipDistance=2500'
directory_name=os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', 'data'))
try:
os... | response = requests.get(url, stream=True)
with open(file_name, 'wb') as fd:
for chunk in response.iter_content(chunk_size=1024): |
<|file_name|>0014_auto_20181122_1211.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-11-22 11:11
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('WorkflowEngine', '0001_initial... | operations = [
migrations.AddField(
model_name='tag', |
<|file_name|>app.route.js<|end_file_name|><|fim▁begin|>"use strict";
var router_1 = require('@angular/router');<|fim▁hole|>var authorize_component_1 = require('./authorize/authorize-component');
var user_component_1 = require('./User/user-component');
var welcome_component_1 = require('./welcome-component');
exports.ro... | |
<|file_name|>test_crt_2_vms_imgs_from_same_img.py<|end_file_name|><|fim▁begin|>'''
Create 2 VMs with same image. Then commit 2 new images from 2 VMs.
@author: Youyk
'''
import time
import os
import apibinding.inventory as inventory
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as ... | |
<|file_name|>0021_auto_20170712_0222.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-07-12 02:22
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('operation... | |
<|file_name|>repairperseuscitations.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
HipparchiaBuilder: compile a database of Greek and Latin texts
Copyright: E Gunderson 2016-21
License: GNU GENERAL PUBLIC LICENSE 3
(see LICENSE in the top level directory of the distribution)
"""
import re
from string... | |
<|file_name|>DeploymentUninstallPackageRequest.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2017, 2021 Red Hat Inc and others
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Publ... | private String version;
@Metric("job.id")
private long jobId; |
<|file_name|>RecyclerViewToViewPagerActivity.java<|end_file_name|><|fim▁begin|>package com.mikescamell.sharedelementtransitions.recycler_view.recycler_view_to_viewpager;<|fim▁hole|>import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.mikescamell.sharedelementtransitions.R;
public clas... | |
<|file_name|>Bird.java<|end_file_name|><|fim▁begin|>package org.demo.jdk.utilapis;
<|fim▁hole|>
@Override
public void fly() {
System.out.println("I'm Bird, my speed is " + speed + ".");
}
}<|fim▁end|> | public class Bird implements Flyable {
private int speed = 15; |
<|file_name|>RudePhysics.cpp<|end_file_name|><|fim▁begin|>/*
* RudePhysics.cpp
* golf
*
* Created by Robert Rose on 9/8/08.
* Copyright 2008 Bork 3D LLC. All rights reserved.
*
*/
#include "Rude.h"
#include "RudePhysics.h"
#include "RudePhysicsObject.h"
#include "RudeDebug.h"
inline btScalar calculateCombi... | |
<|file_name|>metrics.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 TiKV Project Authors. Licensed under Apache-2.0.
use prometheus::*;
use prometheus_static_metric::*;
make_auto_flush_static_metric! {
pub label_enum SnapType {
generate,
apply,
}
pub label_enum SnapStatus {
all,
... | appiled_term,
channel_full,
}
|
<|file_name|>Cylinder.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2005 All... |
# version |
<|file_name|>sidebar.customize-controls.js<|end_file_name|><|fim▁begin|>'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; i... | /******/
} |
<|file_name|>test_annos.py<|end_file_name|><|fim▁begin|>from __future__ import division
from __future__ import print_function
import numpy as np
import numpy.testing as npt
import pandas as pd
from deepcpg.data import annotations as annos
def test_join_overlapping():
f = annos.join_overlapping
s, e = f([],... |
x = [-1, 2, 2, 3, 4, 8, 15, 16]
expect = [-1, 0, 0, -1, 1, 1, 2, -1]
result = f(x, ys, ye) |
<|file_name|>vertex_type_2_10_10_10_rev.py<|end_file_name|><|fim▁begin|>from OpenGLCffi.GL import params
@params(api='gl', prms=['index', 'type', 'normalized', 'value'])
def glVertexAttribP1ui(index, type, normalized, value):
pass
@params(api='gl', prms=['index', 'type', 'normalized', 'value'])
def glVertexAttribP1u... | pass
|
<|file_name|>pd_load.py<|end_file_name|><|fim▁begin|>"""
load score-level asroutput files into a pandas df
"""
import re
import pandas as pd
def mr_csvs():
"""
load data/mr.p and generate two csv files.
:return:
"""
x = pickle.load(open('data/mr.p', "rb"))
revs, W, W2, word_idx_map, vocab = x[... | txts.append(orig_rev)
df = pd.DataFrame({'text': txts, 'score': scores})
df.to_csv(open(csvFile, 'wb'))
|
<|file_name|>handle-integrants.ts<|end_file_name|><|fim▁begin|>'use strict';
// dts
import {IGlobalSumanObj} from "suman-types/dts/global";
import {IIntegrantsMessage, ISumanModuleExtended} from "suman-types/dts/index-init";
// polyfills
const process = require('suman-browser-polyfills/modules/process');
const global... |
export const handleIntegrants = function (integrants: Array<string>, $oncePost: Array<string>,
integrantPreFn: Function, $module: ISumanModuleExtended) { |
<|file_name|>comment.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/license... | |
<|file_name|>url.js<|end_file_name|><|fim▁begin|>/*
url utils
@sha0coder
*/
exports.getUrlDir = function(url) {
return url.replace(/\/[^\/]*$/,'/')
}
exports.getBase = function(url) {
var spl = url.split('/');
return spl[0]+'//'+spl[2];
};
exports.getDomain = function(url) {
retu... | exports.fixDir = function(dir) { |
<|file_name|>DBP.user.js<|end_file_name|><|fim▁begin|>// ==UserScript==
// @name Discussion Board Patch
// @namespace https://lms.rmit.edu.au/webapps/discussionboard
// @version 3
// @grant none
// @match https://lms.rmit.edu.au/webapps/discussionboard/do/message*
// @match https://lms.rm... | function getId(string) {
return document.getElementById(string); |
<|file_name|>0331_auto_20200612_0849.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2.13 on 2020-06-12 06:49
import diventi.accounts.models
from django.db import migrations
<|fim▁hole|> ('accounts', '0330_auto_20200612_0843'),
]
operations = [
migrations.AlterModelManagers(
... |
class Migration(migrations.Migration):
dependencies = [ |
<|file_name|>PartyCogActivity.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.parties.PartyCogActivity
from panda3d.core import CollideMask, CollisionHandler, CollisionHandlerEvent, CollisionNode, CollisionSphere, NodePath, Point3, TextNode, Texture
from direct.inte... | for cog in self.cogManager.cogs:
cog.request('Static')
def hideCogs(self):
|
<|file_name|>676C.cpp<|end_file_name|><|fim▁begin|>#include <bits/stdc++.h>
using namespace std;
int count_consecutive(string &s, int n, int k, char x) {
int mx_count = 0;
int x_count = 0;
int curr_count = 0;
int l = 0;
int r = 0;
while (r < n) {
if (x_count <= k) {
if (s... | string s;
|
<|file_name|>bitcoin_fi.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="fi" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About inazuma</source>
... | |
<|file_name|>includes.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2009-2011, Dan "Ducky" Little & GeoMOOSE.org
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 wi... | dojo.require('GeoMOOSE.MapSource');
dojo.require('GeoMOOSE.MapSource.Vector');
dojo.require('GeoMOOSE.MapSource.Vector.WFS');
|
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from server import Serve
from utils import get_authenticated_user
import os
import sys
authenticated_user = None
try:<|fim▁hole|> authenticated_user = get_authenticated_user('server.cfg')
except IOError:
print ("File 'server.cfg' doesn't ... | |
<|file_name|>text-area-material-like.js<|end_file_name|><|fim▁begin|>import FormComponent from '../../form-component';
export class TextArea extends FormComponent {
constructor(context, options) {
super(
context,<|fim▁hole|> context.querySelector('.text-area__error'),
'Text Area',
options
... | context.querySelector('.text-area__input'), |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
""""
ProjectName: pydemi
Repo: https://github.com/chrisenytc/pydemi
Copyright (c) 2014 Christopher EnyTC
Licensed under the MIT license.
"""
# Dependencies
import uuid
from api import app
from hashlib import sha1
from flask import request<|fim... | from flask import jsonify as JSON
from api.models.user import User
from cors import cors
|
<|file_name|>XrdCmsLogin.cc<|end_file_name|><|fim▁begin|>/******************************************************************************/
/* */
/* X r d C m s L o g i n . c c */
/* ... | /******************************************************************************/
/* Public: L o g i n */ |
<|file_name|>error.go<|end_file_name|><|fim▁begin|>// Copyright 2016 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
... | )
var ( |
<|file_name|>visitor.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 Pierre Talbot (IRCAM)
// 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... | fn visit_external_non_terminal_symbol(&mut self, _this: usize, _rule: &syn::Path) -> R { R::default() }
fn visit_atom(&mut self, _this: usize) -> R { R::default() }
|
<|file_name|>access_control.py<|end_file_name|><|fim▁begin|>from functools import partial
from navmazing import NavigateToSibling, NavigateToAttribute
from cfme import Credential
from cfme.exceptions import CandidateNotFound, OptionNotAvailable
import cfme.fixtures.pytest_selenium as sel
import cfme.web_ui.toolbar as... | sel.click(form_buttons.retrieve)
|
<|file_name|>test.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from test_support import *
prove_all () |
<|file_name|>go_funcs_B.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from numpy import abs, cos, exp, log, arange, pi, roll, sin, sqrt, sum
from .go_benchmark import Benchmark
class BartelsConn(Benchmark):
r"""
Bartels-Conn objectiv... | |
<|file_name|>webpack.config.demo.js<|end_file_name|><|fim▁begin|>/* globals __dirname */
'use strict';
var autoprefixer = require('autoprefixer-core');
var Webpack = require('webpack');
var HtmlWebpack = require('html-webpack-plugin');
var path = require('path');
var npmPath = path.resolve(__dirname... | exclude : /node_modules/ |
<|file_name|>_ImageEdit3MultiProcess.py<|end_file_name|><|fim▁begin|>if __name__ == '__main__':
print("Loading Modules...")
from setuptools.command import easy_install
def install_with_easyinstall(package):
easy_install.main(["-U", package])
imported = False
tries = 0
while not imported:
try:
i... | g = 0
if g > 255:
g = 255
if b < 0: |
<|file_name|>JavapParser.d.ts<|end_file_name|><|fim▁begin|>export function JavapParser(input: any): this;
export class JavapParser {
constructor(input: any);
_interp: any;
ruleNames: string[];
literalNames: (string | null)[];
symbolicNames: (string | null)[];
constructor: typeof JavapParser;
... | accept(visitor: any): any;
} |
<|file_name|>handler.go<|end_file_name|><|fim▁begin|>package pages
import (
"encoding/json"
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
"github.com/rynorris/website/server/auth"
)
func AddRoutes(r *mux.Router, service Service, authService auth.Service) {
r.HandleFunc("/", func(w http.ResponseWriter, r *ht... | vars := mux.Vars(r)
key := vars["key"]
log.Printf("Received request to GET post %v", key) |
<|file_name|>tables.py<|end_file_name|><|fim▁begin|># Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | ("updating_password", pgettext_lazy("Task status of an Instance", |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># coding=utf-8
from __future__ import unicode_literals
from random import randint
from .. import Provider as AddressProvider
class Provider(AddressProvider):
address_formats = ['{{street_address}}, {{city}}, {{postcode}}']
building_number_formats = ['#',... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.