prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>envvar.go<|end_file_name|><|fim▁begin|>/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless requi...
return &EnvVarApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value
<|file_name|>preprocess.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import re, csv, sys from urlparse import urlparse from nltk.corpus import stopwords from nltk.tokenize import word_tokenize, sent_tokenize from nltk.text import TextCollection #process command line arguments if len(sys.argv) < 2: print...
emots_neg = [emot.lower() for emot in emots_neg] gaz_pos = []
<|file_name|>sendControllerSpec.js<|end_file_name|><|fim▁begin|>'use strict'; var expect = chai.expect; function run(scope,done) { done(); } describe('SendCtrl', function(){ var rootScope, scope, controller_injector, dependencies, ctrl, sendForm, network, timeout, spy, stub, mock, res, transaction, data; ...
transaction: {
<|file_name|>adding_prob_src.rs<|end_file_name|><|fim▁begin|>extern crate rand; use rand::distributions::{Range, IndependentSample}; use af; use af::{Array, Dim4, MatProp, DType}; use std::cell::{RefCell, Cell}; use initializations::uniform; use utils; use data::{Data, DataSource, DataParams, Normalize, Shuffle}; pu...
self.get_train_iter(num_batch)
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># Copyright 2012 Big Switch Networks, 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...
def _map_state_and_status(self, resource): resource = copy.copy(resource)
<|file_name|>power_digit_sum.py<|end_file_name|><|fim▁begin|>def power_digit_sum(exponent):<|fim▁hole|><|fim▁end|>
power_of_2 = str(2 ** exponent) return sum([int(x) for x in power_of_2])
<|file_name|>interface.py<|end_file_name|><|fim▁begin|>""" Easy-to-use UMFPACK interface ============================= .. currentmodule:: scikits.umfpack The following functions can be used for LU decompositions and solving equation systems: .. autosummary:: :toctree: reference/ spsolve splu UmfpackLU ...
if isspmatrix(b): b = b.toarray() if b.shape[0] != self._A.shape[1]:
<|file_name|>gu.js<|end_file_name|><|fim▁begin|>/** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'a11yhelp', 'gu', { title: 'એક્ક્ષેબિલિટી ની વિગતો', contents: ...
numpad6: 'Numpad 6', // MISSING numpad7: 'Numpad 7', // MISSING
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import setuptools with open("README.md", "r") as fh: long_description = fh.read() <|fim▁hole|> author="Logan Raarup", author_email="logan@logan.dk", description="Amazon AWS API Gateway WSGI wrapper", long_description=long_description, long_descr...
setuptools.setup( name="serverless-wsgi", version="3.0.0", python_requires=">3.6",
<|file_name|>Ekhem.cpp<|end_file_name|><|fim▁begin|>#include <iostream> #include <string> #include <tuple> std::tuple<int,int> wczytaj_liczby(); int main () { std::string opcja; do { int a,b; std::cout << "wybierz opcje przeliczania" << std::endl; std::cout << "dodawanie, odejmowanie, mnozenie czy dzielenie?...
} else std::cout << "nieznana opcja" << std::endl; } while(opcja!="koniec");
<|file_name|>test_document_missing_changesets.py<|end_file_name|><|fim▁begin|># MajorMajor - Collaborative Document Editing Library # Copyright (C) 2013 Ritchie Wilson # # 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 Fr...
<|file_name|>u16.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/LI...
#![stable] #![doc(primitive = "u16")]
<|file_name|>journal.py<|end_file_name|><|fim▁begin|>from django.contrib import admin from django.contrib.admin.widgets import AdminIntegerFieldWidget from django.core.validators import MaxValueValidator, MinValueValidator from modeltranslation.admin import TranslationAdmin from django.urls import reverse from django.u...
<|file_name|>SffIO.py<|end_file_name|><|fim▁begin|># Copyright 2009-2010 by Peter Cock. All rights reserved. # Based on code contributed and copyright 2009 by Jose Blanca (COMAV-UPV). # # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been i...
>>> print record.id, len(record) E3MFGYR02F7Z7G 130 >>> print record.seq[:10], "..."
<|file_name|>config-v18_test.go<|end_file_name|><|fim▁begin|>/* * Minio Cloud Storage, (C) 2016, 2017 Minio, 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.apa...
t.Errorf("Expecting access key to be `minio` found %s", cred.AccessKey) } if cred.SecretKey != "minio123" {
<|file_name|>app.py<|end_file_name|><|fim▁begin|>from lib import incrementer<|fim▁hole|><|fim▁end|>
print(incrementer(2))
<|file_name|>clipped_relu.py<|end_file_name|><|fim▁begin|>from chainer import cuda from chainer import function from chainer import utils from chainer.utils import type_check import numpy class ClippedReLU(function.Function): """Clipped Rectifier Unit function. Clipped ReLU is written as :math:`ClippedReLU(...
# z must be positive. assert z > 0 self.cap = z
<|file_name|>checker.py<|end_file_name|><|fim▁begin|># Azure will execute first file. # sys.path.append is required by Azure Web Jobs. It requires that all packages are provided to it in zip file. # env\Lib\site-packages is virtual env path in Windows import sys sys.path.append("env\Lib\site-packages") import logging ...
for row in rows: sensor_id = row[0]
<|file_name|>battlefieldutils.cpp<|end_file_name|><|fim▁begin|>/* =========================================================================== Copyright (c) 2010-2014 Darkstar Dev Teams This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as p...
return false; }
<|file_name|>fancy_getopt.py<|end_file_name|><|fim▁begin|>"""distutils.fancy_getopt Wrapper around the standard getopt module that provides the following additional features: * short and long options are tied together * options have help strings, so fancy_getopt could potentially create a complete usage summar...
import getopt from distutils.errors import *
<|file_name|>test_tetengo2.iterator.polymorphic_forward_iterator.cpp<|end_file_name|><|fim▁begin|>/*! \file \brief Test of class tetengo2::iterator::observable_forward_iteratorpolymorphic_forward_iterator. Copyright (C) 2007-2019 kaoru $Id$ */ #include <sstream> #include <string> #include <bo...
BOOST_AUTO_TEST_CASE(operator_not_equal)
<|file_name|>accordion.js<|end_file_name|><|fim▁begin|>var accordion = function() {<|fim▁hole|><|fim▁end|>
var e = new Foundation.Accordion($('.accordion')); }
<|file_name|>PopulationAggregationMetaDataProvider.java<|end_file_name|><|fim▁begin|>package org.obiba.mica.search.aggregations;<|fim▁hole|>import org.obiba.mica.micaConfig.service.helper.AggregationMetaDataProvider; import org.obiba.mica.micaConfig.service.helper.PopulationIdAggregationMetaDataHelper; import org.sprin...
<|file_name|>analyzer_wysinwyx.rs<|end_file_name|><|fim▁begin|>//! This module offers structs and traits for valueset analysis as inctroduced //! in "Analyzing Memory Access in x86 Executables" by Gogul Balakrishnan and //! Thomas Reps //! For a more complete work on this topic, see the dissertation(!) (there is //! al...
warn!("Fallthrough"); StridedInterval_u::Undefined
<|file_name|>image.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # Copyright (C) 2009-2010 Nicolas P. Rougier # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, dis...
<|file_name|>xfixes-selection-notify.py<|end_file_name|><|fim▁begin|><|fim▁hole|># # examples/xfixes-selection-notify.py -- demonstrate the XFIXES extension # SelectionNotify event. # # Copyright (C) 2019 # Tony Crisci <tony@dubstepdish.com> # # This library is free software; you can redistribute it and/or # mo...
#!/usr/bin/python3
<|file_name|>change_publishers.py<|end_file_name|><|fim▁begin|>from casexml.apps.case.xform import get_case_ids_from_form from corehq.apps.change_feed import topics from corehq.apps.change_feed.producer import producer from corehq.apps.change_feed import data_sources from corehq.form_processor.interfaces.dbaccessors im...
def change_meta_from_ledger_v2(ledger_value): return ChangeMeta( document_id=ledger_value.ledger_reference.as_id(),
<|file_name|>gcc.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/licenses/LI...
// iOS on armv7 is using SjLj exceptions and therefore requires to use // a specialized personality routine: __gcc_personality_sj0
<|file_name|>test_forms.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.models import User from django.core import mail from django.test.client import RequestFactory from mock import ANY, patch from nose.tools import eq_, ok_ from test_utils import TestCase from remo.dashboard.forms import EmailRepsForm from...
<|file_name|>table.go<|end_file_name|><|fim▁begin|>package lua type lValueArraySorter struct { L *LState Fn *LFunction Values []LValue } func (lv lValueArraySorter) Len() int { return len(lv.Values) } func (lv lValueArraySorter) Swap(i, j int) { lv.Values[i], lv.Values[j] = lv.Values[j], lv.Values[i] }...
return LNil
<|file_name|>CommonMetricsFactory.java<|end_file_name|><|fim▁begin|>package org.cache2k.core; /* * #%L * cache2k core implementation * %% * Copyright (C) 2000 - 2021 headissue GmbH, Munich * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance wit...
* @author Jens Wilke
<|file_name|>agent.go<|end_file_name|><|fim▁begin|>/* Blackbox agent is a client side program which encrypt/decrypt files. It request blackbox server for encryption keys when need to do operations. Agent never keeps the key. */ package main import ( "flag" "github.com/ksang/blackbox/agent/cli" "github.com/ksang/bla...
log.Print(err) flag.PrintDefaults()
<|file_name|>SocketAppenderBuilderTest.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 t...
<|file_name|>0020_auto__add_field_question_order.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Question.order' ...
'Meta': {'ordering': "['order']", 'unique_together': "(('survey', 'order'),)", 'object_name': 'Page'}, u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'order': ('django.db.models.fields.IntegerField', [], {}), 'question': ('django.db.models.fiel...
<|file_name|>test_interval.py<|end_file_name|><|fim▁begin|>import operator import numpy as np import pytest from pandas.core.dtypes.common import is_list_like import pandas as pd from pandas import ( Categorical, Index, Interval, IntervalIndex, Period, Series, Timedelta, Timestamp, ...
def test_compare_scalar_interval(self, op, array): # matches first interval other = array[0]
<|file_name|>user-resource.go<|end_file_name|><|fim▁begin|>package main import ( "log" "net/http" restfulspec "github.com/emicklei/go-restful-openapi/v2" "github.com/emicklei/go-restful/v3" "github.com/go-openapi/spec" ) type UserResource struct { // normally one would use DAO (data access object) users map[s...
ws.Route(ws.GET("/").To(u.findAllUsers). // docs
<|file_name|>278_test_io.py<|end_file_name|><|fim▁begin|>"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests ...
<|file_name|>storage-mocked.js<|end_file_name|><|fim▁begin|>/** * Convenient Redis Storage mock for testing purposes */ var util = require ('util'); function StorageMocked(data){ data = data || {}; this.currentOutage = data.currentOutage; } exports = module.exports = StorageMocked; StorageMocked.prototype.sta...
<|file_name|>search.js<|end_file_name|><|fim▁begin|>'use strict'; const assert = require('assert'); const context = require('../helpers/context'); describe('ctx.search=', () => { it('should replace the search', () => { const ctx = context({ url: '/store/shoes' }); ctx.search = '?page=2&color=blue'; asse...
});
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::env; use std::process; extern crate concurrent_prime_sieve; use concurrent_prime_sieve::filter::prime_filter; mod draw_spiral; fn help() -> !{ println!("Can only use up to 2 environment variables. E.G."); println!(">>>cargo run <size> <write_to_path>");...
let is_prime_iter = prime_filter(num_primes); draw_spiral::prime_filter_to_spiral_png(size, is_prime_iter, path); // for (i, j) in is_prime_iter.iter().enumerate(){
<|file_name|>_001570_dotProdSparseVectors.cpp<|end_file_name|><|fim▁begin|>class SparseVector { unordered_map<int, int> repr; int size = 0; public: SparseVector(vector<int> &nums) { size = nums.size(); for (int i=0; i<nums.size(); i++) { if (nums[i] == 0) { continue; } ...
// Your SparseVector object will be instantiated and called as such: // SparseVector v1(nums1); // SparseVector v2(nums2); // int ans = v1.dotProduct(v2);
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render_to_response from django.http import HttpResponseRedirect from django.core.paginator import Paginator from uwcs_website.choob.models import * def quotes_page(request): quoters = map(lambda q:q[0],QuoteObject.objects.all().values...
'breadcrumbs': [('/','home'),('/irc/','irc'),('/irc/all_quotes/1/','all')], 'user':request.user, 'page':paginator.page(page_num),
<|file_name|>live_timers.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap; use platform::time::time_now; use super::StartTime; use super::Timing; #[derive(Debug, Clone, PartialEq)] pub struct LiveTimers { timers: HashMap<String, StartTime>, } impl LiveTimers { pub fn new() -> LiveTimers { ...
let start_time = opt.unwrap(); let duration = stop_time - start_time;
<|file_name|>post_list_test.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. package model import ( "strings" "testing" ) func TestPostListJson(t *testing.T) { pl := PostList{} p1 := &Post{Id: NewId(), Message: NewId()} pl.A...
pl.AddOrder(p2.Id)
<|file_name|>block.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library 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 S...
UncleHash *common.Hash `json:"sha3Uncles"`
<|file_name|>pycbc_phenomC_tmplt.py<|end_file_name|><|fim▁begin|># Copyright (C) 2012 Prayush Kumar # # 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 2 of the License, or # (...
pfa3 = -16.0*lal.PI + (113./3.)*Xi - 38.*eta*Xisum/3. pfa4 = (152.93365/5.08032) - 50.*Xi2 + eta*(271.45/5.04 + 1.25*Xiprod) + \
<|file_name|>query_issuer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Copyright 2014 Philipp Winter <phw@nymity.ch> # # This file is part of atlas tools. # # atlas tools is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Fre...
# # atlas tools is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for EcoNet products.""" from datetime import timedelta import logging from aiohttp.client_exceptions import ClientError from pyeconet import EcoNetApiInterface from pyeconet.equipment import EquipmentType from pyeconet.errors import ( GenericHTTPErro...
) from homeassistant.config_entries import ConfigEntry
<|file_name|>tst_updateshaderdatatransformjob.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************** ** ** Copyright (C) 2016 Paul Lemire <paul.lemire350@gmail.com> ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt3D module of the Qt Toolk...
QVERIFY(root); QScopedPointer<Qt3DRender::TestAspect> test(new Qt3DRender::TestAspect(root.data()));
<|file_name|>aws_logs.py<|end_file_name|><|fim▁begin|># Copyright 2018 PerfKitBenchmarker 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...
create_cmd = util.AWS_PREFIX + [
<|file_name|>histogram_builder.py<|end_file_name|><|fim▁begin|>"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Histogram class which lets you build your histograms just passing the arguments to the Chart class and calling the proper functions. """...
"""Generates one to many histograms with unique attributes. The HistogramBuilder is responsible for producing a chart containing one to many histograms from table-like inputs.
<|file_name|>pltag.py<|end_file_name|><|fim▁begin|>from openflow.optin_manager.sfa.rspecs.elements.element import Element class PLTag(Element): fields = [ 'tagname',<|fim▁hole|><|fim▁end|>
'value', ]
<|file_name|>test_helper_misc.py<|end_file_name|><|fim▁begin|># coding: utf-8 import os.path from datetime import datetime from django.conf import settings from django.test.client import RequestFactory from django.test.utils import override_settings import pytest from django_jinja.backend import Jinja2 from jinja2 i...
self.assertIn(u'data-src="https://www.test.com/test.png"', markup) self.assertNotIn(u'data-srcset="', markup)
<|file_name|>lzwhutf16-min.js<|end_file_name|><|fim▁begin|>// Copyright © 2016 Gary W. Hudson Esq. // Released under GNU GPL 3.0 var lzwh = (function() {var z={ Decode:function(p) {function f(){--h?k>>=1:(k=p.charCodeAt(q++)-32,h=15);return k&1}var h=1,q=0,k=0,e=[""],l=[],g=0,m=0,c="",d,a=0,n,b; do{m&&(e[g-1]...
<|file_name|>AutoGridNoWrap.tsx<|end_file_name|><|fim▁begin|>import React from 'react'; import Paper from '@material-ui/core/Paper'; import { makeStyles, createStyles, Theme } from '@material-ui/core/styles'; import Grid from '@material-ui/core/Grid'; import Avatar from '@material-ui/core/Avatar'; import Typography fro...
<Grid container wrap="nowrap" spacing={2}> <Grid item> <Avatar>W</Avatar>
<|file_name|>post_import_image.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import unicode_literals import json import os from osbs.api ...
kwargs = {} if 'namespace' in metadata: kwargs['namespace'] = metadata['namespace']
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may us...
** from this software without specific prior written permission. ** **
<|file_name|>bootstrap.py<|end_file_name|><|fim▁begin|># Copyright 2018 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...
<|file_name|>test_relationship.py<|end_file_name|><|fim▁begin|>from sqlalchemy.orm import create_session, relationship, mapper, \ contains_eager, joinedload, subqueryload, subqueryload_all,\ Session, aliased, with_polymorphic from sqlalchemy import Integer, String, ForeignKey from sqlalchemy.engine import defa...
engineers_to_org = Table('engineers_to_org', metadata, Column('org_id', Integer,
<|file_name|>test_run_new.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of the VecNet OpenMalaria Portal. # For copyright and licensing information about this package, see the # NOTICE.txt and LICENSE.txt files in its top-level directory; they are # available at https://github.com/vecnet...
simulation.refresh_from_db()
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// build.rs use std::env; use std::fs::File; use std::io::Write; use std::path::Path; use glsl::syntax::{SingleDeclaration, StorageQualifier, TypeQualifierSpec }; use glsl::visitor::{Visit, Visitor}; struct Counter { var_nb: usize } impl Visitor for Count...
print!("fn shader_pbr() {{\n"); print!("let vscode = \"{}\";\n", vs); print!("let vsshader = gl.create_shader(t).jsok()?;\n",); print!("gl.shader_source(&vsshader, vscode);\n");
<|file_name|>BrowserPermissionService.test.ts<|end_file_name|><|fim▁begin|>import {container} from "tsyringe"; import {BrowserPermissionService} from "../../../src/service/browser/BrowserPermissionService"; describe("BrowserPermissionServiceTest", (): void => { let testee: BrowserPermissionService; beforeEac...
<|file_name|>worker.js<|end_file_name|><|fim▁begin|>var http = require('http') , https = require('https') , url = require('url') , vm = require('vm') , cluster = require('cluster') , util = require('util') , haikuConsole = require('./haikuConsole.js') , sandbox = require('./sandbox.js') var shutdown , shutdown...
var handlerRequest; var processResponse = function(res) {
<|file_name|>end.js<|end_file_name|><|fim▁begin|>const EventEmitter = require('events'); /** * Ends the session. Uses session protocol command. * * @example * this.demoTest = function (browser) { * browser.end(); * }; * * @method end<|fim▁hole|> * @param {function} [callback] Optional callback function to be...
* @syntax .end([callback])
<|file_name|>TODO.py<|end_file_name|><|fim▁begin|># mesa - toolkit for building dynamic python apps with zero downtime # basis: package is inspected for all instances of specified abc and each added to internal mesa list # Casa is a mesa obj is instantiated as holder of dynamic obj list, one for each abc type in specif...
# ie no passing from interface to host back to interface like it is in unit test right now # TODO: meta methods that build on the basic iterating methods to abstract away iteration from caller # TODO: check for abc type conformance # TODO: at minute convention is that dynamic module contains one class of same...
<|file_name|>improviser.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- """ *** Description *** Converts a progression to chords, orchestrates them and plays them using fluidsynth. Make sure to set SF2 to a valid soundfont file. Based on play_progression.py """ from mingus...
n = Note(choice(c).name) fluidsynth.play_Note(n, solo_channel, randrange(80, 110))
<|file_name|>pyborg.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # PyBorg: The python AI bot. # # Copyright (c) 2000, 2006 Tom Morton, Sebastien Dailly # # # This bot was inspired by the PerlBorg, by Eric Bock. # # This program is free software; you can redistribute it and/or # modify it under the terms of...
def unlearn(self, context):
<|file_name|>latexexport.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # import the main window object (mw) from ankiqt from aqt import mw # import the "show info" tool from utils.py from aqt.utils import showInfo<|fim▁hole|>from anki.exporting import * from anki.hooks import addHook class LatexNoteExporter...
# import all of the Qt GUI library from aqt.qt import *
<|file_name|>frmSelec.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'C:/Users/Gaspar/.qgis/python/plugins/delPropiedad/forms_ui/frmSelec.ui' # # Created: Wed Jul 18 12:50:20 2012 # by: PyQt4 UI code generator 4.8.6 # # WARNING! All changes made...
self.tableWidget.setRowCount(0)
<|file_name|>example-oauthenticator.py<|end_file_name|><|fim▁begin|>""" Example OAuthenticator to use with My Service """ import json from jupyterhub.auth import LocalAuthenticator from oauthenticator.oauth2 import OAuthLoginHandler, OAuthenticator from tornado.auth import OAuth2Mixin from tornado.httputil import ur...
# it could also be in the response to the token request, # making this request unnecessary.
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>from .models import Project,Member,Contact,Technology,Contributor from rest_framework import serializers class ContactSerializer(serializers.ModelSerializer): class Meta: model = Contact<|fim▁hole|>class MemberSerializer(serializers.ModelSerializer):...
fields = ('name', 'link')
<|file_name|>region-bounds-on-objects-and-type-parameters.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACH...
<|file_name|>TipoServicio.java<|end_file_name|><|fim▁begin|>/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 2016 Oracle and/or its affiliates. All rights reserved. * * Oracle and Java are registered trademarks of Oracle and/or its affiliates. * Other names may be trademarks of th...
<|file_name|>map-port.ts<|end_file_name|><|fim▁begin|>export class MapPort {<|fim▁hole|> name: string; portNumber: number; shortName: string; }<|fim▁end|>
adapterNumber: number; linkType: string;
<|file_name|>bitcoin_it.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="it" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Bitcoin</source> ...
</message> <message> <location line="+3"/>
<|file_name|>test_column.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.utils.tests.test_metadata import MetaBaseTest import operator import pytest import numpy as np from numpy.testing import assert_array_equal from astropy.tests....
<|file_name|>script.js<|end_file_name|><|fim▁begin|>$(function () {<|fim▁hole|>}) $(function () { $('[data-toggle="popover"]').popover() })<|fim▁end|>
$('[data-toggle="tooltip"]').tooltip()
<|file_name|>davis_log.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # reflect input bytes to output, printing as it goes import serial, sys, optparse, time parser = optparse.OptionParser("davis_log") parser.add_option("--baudrate", type='int', default=57600, help='baud rate') opts, args = parser.parse_args(...
while True: line = port.readline()
<|file_name|>WorldMapArea.java<|end_file_name|><|fim▁begin|>package com.gromstudio.treckar.model; import java.net.URL; public class WorldMapArea { URL mBitmapUrl;<|fim▁hole|> }<|fim▁end|>
<|file_name|>var-captured-in-nested-closure.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // h...
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
<|file_name|>ex-walking-01.js<|end_file_name|><|fim▁begin|>// Copyright © 2014 John Watson // Licensed under the terms of the MIT License var GameState = function(game) { }; // Load images and sounds GameState.prototype.preload = function() { this.game.load.image('ground', 'assets/gfx/ground.png'); this.game....
// Capture certain keys to prevent their default actions in the browser. // This is only necessary because this is an HTML5 game. Games on other
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::io; fn stdinln_i32() -> i32 { // 이 함수는 하나의 줄을 stdin으로 받아 단 하나의 integer를 리턴합니다. let mut buffer = String::new(); std::io::stdin().read_line(&mut buffer).expect("Failed to read stdin."); buffer.trim().parse::<i32>().unwrap() } fn stdinln_vec_i32() -> Vec<i32...
} let mut problem = TelBox::new_from_vec_i32(tels, nr_tel);
<|file_name|>type-alias-impl-trait-fn-type.rs<|end_file_name|><|fim▁begin|>#![feature(type_alias_impl_trait)] #![allow(dead_code)] // FIXME: this is ruled out for now but should work type Foo = fn() -> impl Send; //~^ ERROR: `impl Trait` not allowed outside of function and method return types<|fim▁hole|> fn main() {}...
fn make_foo() -> Foo { || 15 }
<|file_name|>designer-controller.js<|end_file_name|><|fim▁begin|>/* * Electronic Logistics Management Information System (eLMIS) is a supply chain management system for health commodities in a developing country setting. * * Copyright (C) 2015 John Snow, Inc (JSI). This program was produced for the U.S. Agency for ...
* 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 the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, ...
<|file_name|>sti.go<|end_file_name|><|fim▁begin|>package builder import ( "github.com/fsouza/go-dockerclient" "github.com/golang/glog" stiapi "github.com/openshift/source-to-image/pkg/api" sti "github.com/openshift/source-to-image/pkg/build/strategies" "github.com/openshift/origin/pkg/build/api" ) // STIBuilder...
build: build,
<|file_name|>FacetParams.java<|end_file_name|><|fim▁begin|>/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under t...
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::error::Error; use std::fs::File; use std::io::BufReader; use std::io::prelude::*; use std::path::Path; use std::collections::HashMap; extern crate regex; use regex::Regex; enum Ineq { Equals(i32), GreaterThan(i32), LessThan(i32), } // -------------------...
<|file_name|>sync.py<|end_file_name|><|fim▁begin|>__copyright__ = """ Copyright (C) 2006, Catalin Marinas <catalin.marinas@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This p...
<|file_name|>oobe_ui.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 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. #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" #include "ash/ash_switches.h" #inclu...
ThemeSource* theme = new ThemeSource(profile); content::URLDataSource::Add(profile, theme);
<|file_name|>area_frame_allocator.rs<|end_file_name|><|fim▁begin|>use core::ops::Range; use mem::{Frame, FrameAllocator}; use multiboot2::{MemoryArea, MemoryAreaIter}; pub struct AreaFrameAllocator { area: Option<&'static MemoryArea>, areas: MemoryAreaIter, next: Frame, kernel: Range<Frame>, multi...
let last_frame = { let last_address = area.base_addr + area.length - 1;
<|file_name|>htmlcanvaselement.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 canvas_traits::{CanvasMsg, FromLayoutMsg, Canva...
let encoder: PNGEncoder<&mut Vec<u8>> = PNGEncoder::new(&mut encoded); encoder.encode(&raw_data, self.Width(), self.Height(), ColorType::RGBA(8)).unwrap(); }
<|file_name|>sandbox.js<|end_file_name|><|fim▁begin|>'use es6'; const dotenv = require('dotenv'); const Lyft = require('./build/index'); dotenv.load(); const lyft = new Lyft(process.env.LYFT_CLIENT_ID, process.env.LYFT_CLIENT_SECRET); const query = { start: { latitude: 37.7833, longitude: -122.4167, },...
}, rideType: 'lyft_line',
<|file_name|>test_SLPn.py<|end_file_name|><|fim▁begin|>import numpy as np import scipy.io as sio import matplotlib.pyplot as plt from matplotlib import path from quadr import quadr from LapSLPmatrix import LapSLPmatrix def test_SLPn(): # test data dir import os dir_path = os.path.dirname(os.path.realpath(...
if __name__ == '__main__': test_SLPn()
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Definitions for the ESP-IDF framework.<|fim▁hole|>#![stable(feature = "raw_ext", since = "1.1.0")] pub mod fs; pub mod raw;<|fim▁end|>
<|file_name|>cgmath_augment.rs<|end_file_name|><|fim▁begin|>use cgmath::{Point2, Vector2}; pub trait Cross<T, S> { fn cross(&self, other: &T) -> S; } pub trait Dot<T, S> { fn dot(&self, other: &T) -> S; } //stupid type rules won't let me add std::ops::Add for f32/f64 pub trait AddScalar<T, S> { fn add_sc...
<|file_name|>E0275.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>// http://rust-lang.org/COPYRIGHT. // // 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 h...
// file at the top-level directory of this distribution and at
<|file_name|>node_chain.py<|end_file_name|><|fim▁begin|># coding=utf-8 """ NodeChains are sequential orders of :mod:`~pySPACE.missions.nodes` .. image:: ../../graphics/node_chain.png :width: 500 There are two main use cases: * the application for :mod:`~pySPACE.run.launch_live` and the :mod:`~pySPACE....
def _train_check_iterables(self, data_iterables):
<|file_name|>index3.js<|end_file_name|><|fim▁begin|>import {TextFileLoader} from './painter/TextFileLoader' import {InstancedGrid} from './painter/InstancedGrid' import {QCurve} from './painter/QCurve' import {QCurveObj} from './painter/QCurve' import {StrokePath} from './painter/StrokePath' import {Particle} from './p...
<|file_name|>union.js<|end_file_name|><|fim▁begin|>/** @jsx jsx */ import { Editor } from 'slate' import { jsx } from '../..' export const input = ( <editor><|fim▁hole|> n <mark key="b"> e<focus /> </mark> </block> </editor> ) export const run = editor => { return Array.from(Editor...
<block> <mark key="a"> <anchor />o </mark>
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls.defaults import * <|fim▁hole|>urlpatterns = patterns('transaction.views', (r'^create/(?P<pid>.*)$', 'create'), (r'^edit/(?P<tid>.*)$', 'edit'), )<|fim▁end|>