prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>main.py<|end_file_name|><|fim▁begin|>## Adding ./getresults to the Python path so that the modules in folder can be imported import sys sys.path.insert(0, './getresults') import datetime from flightsearch import flightsearch, flightresult import os import uuid import time from pprint import pprint def ma...
searchuuid = uuid.uuid4() searchbegintime = time.time()
<|file_name|>0039_auto__add_field_course_riw_style.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): ...
'position': ('django.db.models.fields.IntegerField', [], {'default': '100', 'null': 'True', 'blank': 'True'}),
<|file_name|>app.component.js<|end_file_name|><|fim▁begin|>"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect ==...
<|file_name|>fake_cpu_manager.go<|end_file_name|><|fim▁begin|>/* Copyright 2017 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....
} func (m *fakeManager) RemoveContainer(containerID string) error { klog.Infof("[fake cpumanager] RemoveContainer (container id: %s)", containerID)
<|file_name|>gui.py<|end_file_name|><|fim▁begin|># # Copyright (C) 2014 Tommy Winther # http://tommy.winther.nu # # Modified for FTV Guide (09/2014 onwards) # by Thomas Geppert [bluezed] - bluezed.apps@gmail.com # # This Program is free software; you can redistribute it and/or modify # it ...
debug('setFocus %d' % control.getId())
<|file_name|>karma-dist-minified.conf.js<|end_file_name|><|fim▁begin|>// Karma configuration // Generated on Thu Aug 21 2014 10:24:39 GMT+0200 (CEST) module.exports = function(config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', // frameworks...
};
<|file_name|>tls.rs<|end_file_name|><|fim▁begin|>#![allow(unused_variables)] #![allow(unused_imports)] /// Note: Fred must be compiled with the `enable-tls` feature for this to work. extern crate fred; extern crate tokio_core; extern crate futures; use fred::RedisClient; use fred::owned::RedisClientOwned; use fred::...
println!("Got foo: {:?}", result); client.set("foo", "bar", Some(Expiration::PX(1000)), Some(SetOptions::NX)) })
<|file_name|>writer.py<|end_file_name|><|fim▁begin|>from mediaviewer.models.person import Person<|fim▁hole|> db_table = 'writer'<|fim▁end|>
class Writer(Person): class Meta: app_label = 'mediaviewer'
<|file_name|>AbstractConfigValue.java<|end_file_name|><|fim▁begin|>/** * Copyright (C) 2011-2012 Typesafe Inc. <http://typesafe.com> */ package org.deephacks.confit.internal.core.property.typesafe.impl; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; im...
<|file_name|>type-ascription.rs<|end_file_name|><|fim▁begin|>fn main() { let xxxxxxxxxxx = yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy : SomeTrait<AA, BB, CC>;<|fim▁hole|> let xxxxxxxxxxxxxxx = yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA; let z = funk(...
<|file_name|>reconstructor.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010-2015 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
<|file_name|>data_class.py<|end_file_name|><|fim▁begin|># DATA class v1.0 written by HR,JB@KIT 2011, 2016 ''' DATA exchange class, also holds global variables for thread management. Generalized version based on TIP. ''' # This program is free software; you can redistribute it and/or modify # it under the terms of t...
self.log_lock = Lock() self.url_timestamps = None
<|file_name|>DecisionAlternative_XNEWARRAY_Wrong.java<|end_file_name|><|fim▁begin|>package jbse.tree; public final class DecisionAlternative_XNEWARRAY_Wrong extends DecisionAlternative_XNEWARRAY { private static final String WRONG_ID = "XNEWARRAY_Wrong"; private static final int HASH_CODE = 2; DecisionAltern...
} if (obj == null) {
<|file_name|>fareRules.js<|end_file_name|><|fim▁begin|>const uAPI = require('../../index'); const config = require('../../test/testconfig'); const AirService = uAPI.createAirService( { auth: config, debug: 2, production: false, } ); const AirServiceQuiet = uAPI.createAirService( { auth: config, ...
}
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2016-2017 Red Hat, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.or...
if (this.prefixOffLogger) { Log.disablePrefix();
<|file_name|>proxy.py<|end_file_name|><|fim▁begin|>import uuid from path_helpers import path import numpy as np try: from base_node_rpc.proxy import ConfigMixinBase, StateMixinBase import arduino_helpers.hardware.teensy as teensy from .node import (Proxy as _Proxy, I2cProxy as _I2cProxy, ...
<|file_name|>task_7_6.py<|end_file_name|><|fim▁begin|>#Задача 7. Вариант 6 #компьютер загадывает название одного из семи городов России, имеющих действующий метрополитен, а игрок должен его угадать. #Борщёва В.О #28.03.2016 import random subways=('Москва','Санкт-Петербург','Нижний Новгород','Новосибирск','Сама...
break input(" Нажмите Enter для выхода")
<|file_name|>fr-MU.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ // THIS CODE IS GENERATED - DO NOT MODIFY // See angular/tools/gu...
],
<|file_name|>tableButton.js<|end_file_name|><|fim▁begin|>//ButtonTable is a very very special case, because I am still not sure why it is a table :-) // alternate design is to make it a field. Filed looks more logical, but table is more convenient at this time. // we will review this design later and decide, meanwhile ...
//zap options first ele.innerHTML = '';
<|file_name|>spawn-types.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/lic...
Make sure we can spawn tasks that take different types of parameters. This is based on a test case for #520 provided by Rob Arnold. */
<|file_name|>plot.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import sys import numpy as np<|fim▁hole|>from matplotlib import pyplot as plt def main(): infile = open(sys.argv[1]) data = np.array(map(lambda x:map(float, x.strip('\n').split('\t')), infile.readlines())) X = data[:, 0:-1] (N,...
<|file_name|>privateIdentifierChain.1.js<|end_file_name|><|fim▁begin|>//// [privateIdentifierChain.1.ts] class A { a?: A #b?: A; getA(): A { return new A(); } constructor() { this?.#b; // Error this?.a.#b; // Error this?.getA().#b; // Error }...
this?.#b; // Error this?.a.#b; // Error this?.getA().#b; // Error
<|file_name|>python_move_group_ns.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2012, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fo...
def plan(self, target):
<|file_name|>example_test.go<|end_file_name|><|fim▁begin|>package html2data_test import ( "bufio" "fmt" "log" "os" "github.com/msoap/html2data" ) func ExampleFromURL() { doc := html2data.FromURL("http://example.com") if doc.Err != nil { log.Fatal(doc.Err) } // or with config doc = html2data.FromURL("htt...
log.Fatal(doc.Err) } }
<|file_name|>short-fibonacci.rs<|end_file_name|><|fim▁begin|>use short_fibonacci::*; #[test] fn test_empty() { assert_eq!(create_empty(), Vec::new()); } #[test] #[ignore] fn test_buffer() { for n in 0..10 { let zeroized = create_buffer(n); assert_eq!(zeroized.len(), n); assert!(zeroized...
#[ignore] fn test_fibonacci() {
<|file_name|>style.tsx<|end_file_name|><|fim▁begin|>import { CSSProperties } from "react" export let ulStyles: CSSProperties = { display: "flex", listStyle: "none" } export let liStyles: CSSProperties = { padding: "0 10px" } export let activeLinkStyle: CSSProperties = { fontWeight: "bold", textDe...
}
<|file_name|>block-copy-example.component.ts<|end_file_name|><|fim▁begin|>import { Component, ViewEncapsulation } from '@angular/core';<|fim▁hole|> encapsulation: ViewEncapsulation.None, selector: 'block-copy-example', templateUrl: './block-copy-example.component.html' }) export class BlockCopyExampleComponent...
import { TabDirective } from 'ngx-bootstrap/tabs'; @Component({
<|file_name|>server.py<|end_file_name|><|fim▁begin|># Copyright 2019 gRPC 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<|fim▁hole...
# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
<|file_name|>SvnTreeConflictDataTest.java<|end_file_name|><|fim▁begin|>// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.idea.svn; import com.intellij.openapi.vcs.VcsConfiguration; import ...
changeListManager.ensureUpToDate(false); VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myWorkingCopyDir.getPath(), conflictFile)); Assert.assertNotNull(vf);
<|file_name|>EntityGraphBean.java<|end_file_name|><|fim▁begin|>package com.cosium.spring.data.jpa.entity.graph.repository.support; import com.google.common.base.MoreObjects; import org.springframework.core.ResolvableType; import org.springframework.data.jpa.repository.query.JpaEntityGraph; import static java.util.Obj...
return primary; } @Override
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>use protocol::cmd::Cmd; use protocol::cmd::Delete; use protocol::cmd::FlushAll; use protocol::cmd::Get; use protocol::cmd::GetInstr; use protocol::cmd::Inc; use protocol::cmd::IncInstr; use protocol::cmd::Resp; use protocol::cmd::Set; use protocol::cmd::SetInstr; use p...
let cmd = transport.read_cmd().unwrap();
<|file_name|>uint.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/L...
/// /// A convenience form for basic repetition. Given a uint `x`, /// `x.times(|| { ... })` executes the given block x times. ///
<|file_name|>test_ossaudiodev.py<|end_file_name|><|fim▁begin|>from test import test_support test_support.requires('audio') from test.test_support import verbose, findfile, TestFailed, TestSkipped import errno import fcntl import ossaudiodev import os import sys import select import sunaudio import time import audioop...
except IOError, msg: if msg[0] in (errno.EACCES, errno.ENOENT, errno.ENODEV, errno.EBUSY):
<|file_name|>storage.py<|end_file_name|><|fim▁begin|>""" Comprehensive Theming support for Django's collectstatic functionality. See https://docs.djangoproject.com/en/1.8/ref/contrib/staticfiles/ """ from __future__ import absolute_import import os.path import posixpath import re from django.conf import settings from...
""" Returns either a themed or unthemed version of the given asset name, depending on several factors.
<|file_name|>plotnormal.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import matplotlib.pyplot as plt import numpy as np import scipy.stats as stats import math mu = 0 variance1 = 20000**2 variance2 = 2000**2 sigma1 = math.sqrt(variance1) sigma2 = math.sqrt(variance2) x = np.linspace(mu - 3*sigma1, mu + 3*s...
#x2 = [i for i in x2]
<|file_name|>CompileMojoTest.java<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2013 OpenJST Project * * 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 Licen...
FileUtils.deleteDirectory(resourcesPath); }
<|file_name|>production.js<|end_file_name|><|fim▁begin|>'use strict';<|fim▁hole|>// ================================= module.exports = { // Server IP ip: process.env.OPENSHIFT_NODEJS_IP || process.env.IP || undefined, // Server port port: process.env.OPENSHIFT_NODEJS_PORT || ...
// Production specific configuration
<|file_name|>fuzz_planner.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
from battle_tested.beta.input_type_combos import input_type_combos
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> styles: [`h1 { color: white; background: darkgray; padding: 20px; } `], template: ` <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="E...
import { Component } from '@angular/core'; @Component({ selector: 'my-app',
<|file_name|>qe_apidoc.py<|end_file_name|><|fim▁begin|>""" Our version of sphinx-apidoc @author : Spencer Lyon @date : 2014-07-16 This file should be called from the command line. It accepts one additional command line parameter. If we pass the parameter `single` when running the file, this file will create a single ...
equals = "=" * len(mod)
<|file_name|>conversion.go<|end_file_name|><|fim▁begin|>package main import ( "fmt" "io" "log" "os" "runtime" "sort" "strings" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" pkg_runtime "k8s.io/kubernetes/pkg/runtime" "github.com/golang/glog" flag "github.com/spf13/pflag" _ "github...
apiShort = generator.AddImport("k8s.io/kubernetes/pkg/api")
<|file_name|>stories.js<|end_file_name|><|fim▁begin|>'use strict'; /** * Developed by Engagement Lab, 2019 * ============== * Route to retrieve data by url * @class api * @author Johnny Richardson * * ========== */ const keystone = global.keystone, mongoose = require('mongoose'), Bluebird = require('blu...
sortOrder: -1 }).limit(1);
<|file_name|>renderMenu.js<|end_file_name|><|fim▁begin|>'use strict'; module.exports = function renderMenu(props) { if (!props.menu) { return; } return props.menu({<|fim▁hole|> gridColumns: props.columns }); };<|fim▁end|>
className: 'z-header-menu-column',
<|file_name|>SecretSanta.java<|end_file_name|><|fim▁begin|>import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Random; /** * Randomly generates Secret Santa assignments for a given group. * <p> * All valid possible assignments are equally likely to be generated ...
<|file_name|>resample.go<|end_file_name|><|fim▁begin|>package filter import ( "fmt" "github.com/200sc/klangsynthese/audio/filter/supports" ) // Speed modifies the filtered audio by a speed ratio, changing its sample rate // in the process while maintaining pitch. func Speed(ratio float64, pitchShifter PitchShifter...
pitchShifter.PitchShift(2.0)(senc) }
<|file_name|>TwistedChat.py<|end_file_name|><|fim▁begin|>from twisted.internet.protocol import Factory from twisted.protocols.basic import LineReceiver from twisted.internet import reactor class NonAnonChat(LineReceiver): def __init__(self, protocols): self.users = {'john':'john', 'adastra':'adastra'} self.userNa...
else: self.sendLine('Wrong Password') elif self.userLogged == True: for protocol in self.protocols:
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType class AppConfig(AppConfig): name = '.'.join(__name__.split('.')[:-1]) ...
# TODO This is a hack, find a better way
<|file_name|>070-E-ClimbingStairs.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? # # Note: Given n will be a positive integer. # # Example 1: # # Input: 2 # Output: 2 # Explanation: There are two ways to climb to the top. ...
# You are climbing a stair case. It takes n steps to reach to the top. #
<|file_name|>stylieeditor.js<|end_file_name|><|fim▁begin|>/* * stylie.treeview * https://github.com/typesettin/stylie.treeview * * Copyright (c) 2015 Yaw Joseph Etse. All rights reserved. */ 'use strict'; var extend = require('util-extend'), CodeMirror = require('codemirror'), StylieModals = require('stylie.mod...
// this.getTreeHTML = this.getTreeHTML; };
<|file_name|>MentorsTableSeederinitial.js<|end_file_name|><|fim▁begin|>/*global NULL*/ 'use strict'; var sha1 = require('sha1'); module.exports = { up: function (queryInterface, Sequelize) { return queryInterface.bulkInsert('Mentors', [{ nameFirst: 'Betty', nameLast: 'Coder', email: 'betty...
email: 'taylor@coderevolution.com', password: sha1('password'), githubLink: 'http://github.com/djackson',
<|file_name|>goma_numeric_types_gen.go<|end_file_name|><|fim▁begin|>package entity import ( "database/sql" ) // NOTE: THIS FILE WAS PRODUCED BY THE // GOMA CODE GENERATION TOOL (github.com/kyokomi/goma) // DO NOT EDIT // GomaNumericTypes is generated goma_numeric_types table. type GomaNumericTypes struct { ID ...
}
<|file_name|>cast_metrics_test_helper.cc<|end_file_name|><|fim▁begin|>// Copyright 2014 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 "chromecast/base/metrics/cast_metrics_test_helper.h" #include "base/loggin...
void CastMetricsHelperStub::LogTimeToBufferAv(BufferingType buffering_type, base::TimeDelta time) { }
<|file_name|>constants.js<|end_file_name|><|fim▁begin|>/** * constants.js<|fim▁hole|> */ // TODO: update these to better colors var SHIELD_COLOR = vec4.fromValues(0.0, 0.0, 1.0, 1.0); var ARMOR_COLOR = vec4.fromValues(0.0, 1.0, 0.0, 1.0); var HULL_COLOR = vec4.fromValues(1.0, 0.0, 1.0, 1.0);<|fim▁end|>
<|file_name|>pie.js<|end_file_name|><|fim▁begin|>(function () { var color = window.color; var getset = color.getset; color.pie = function () { var options = { height: color.available( "height" ), width: color.available( "width" ), value: null, color: ...
return d; }); return data;
<|file_name|>declaration_block.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/. */ //! A property declaration block. #![deny(missing_...
/// which should be maintained whenever `declarations` is changed. pub fn any_normal(&self) -> bool {
<|file_name|>test_del_group.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from random import randrange from model.group import Group<|fim▁hole|>def test_delete_some_group(app, db, check_ui): if len(db.get_group_list()) == 0: app.group.create(Group(name = "test")) with pytest.allure.step("Given...
import random import pytest
<|file_name|>ui_profile_dialog.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/Users/lee/backups/code/iblah_py/ui/ui_profile_dialog.ui' # # Created: Fri May 6 21:47:58 2011 # by: PyQt4 UI code generator 4.8.3 # # WARNING! All changes made in this fil...
self.cellphone_no_line_edit.setText(_fromUtf8("")) self.cellphone_no_line_edit.setReadOnly(True) self.cellphone_no_line_edit.setObjectName(_fromUtf8("cellphone_no_line_edit")) self.fetion_no_line_edit = QtGui.QLineEdit(ProfileDialog)
<|file_name|>PDBConst.py<|end_file_name|><|fim▁begin|># Schema DB = "db" Name = "name" Tables = "tables" Table = "table" Columns = "columns" Column = "column" Attributes = "attributes" Initials = "initials" Initial = "initial" InitialValue = "initialvalue"<|fim▁hole|>PrimaryKey = "primarykey"<|fim▁end|>
Value = "value"
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>module.exports = function(grunt) { grunt.initConfig({ // insert the bower files in your index.html wiredep: { target: { src: 'index.html' } } });<|fim▁hole|> grunt.registerTask('default', ['wiredep']); };<|fim▁end|>
grunt.loadNpmTasks('grunt-wiredep');
<|file_name|>destroySession.js<|end_file_name|><|fim▁begin|>'use babel' export default function destroySession(self, sharedSession) { // Checks if shared session in the stack let shareStackIndex = self.shareStack.indexOf(sharedSession) if (shareStackIndex !== -1) { // Removes share session from the stack and...
} }
<|file_name|>constants.py<|end_file_name|><|fim▁begin|>import datetime import os.path kDirName, filename = os.path.split(os.path.abspath(__file__)) kFixtureFile = os.path.join(kDirName, 'types.db') kTestFile = os.path.join(kDirName, 'test.db') kTestDirectory = os.path.join(kDirName, 'tempdir', 'child') kConfigFile = o...
}
<|file_name|>whooshsearch.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ sphinx.websupport.search.whooshsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Whoosh search adapter. :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ fro...
def init_indexing(self, changed=[]):
<|file_name|>analysis2dSim.cpp<|end_file_name|><|fim▁begin|>/* * Software License Agreement (New BSD License) * * Copyright (c) 2013, Keith Leung, Felipe Inostroza * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the follow...
<|file_name|>plugins.rs<|end_file_name|><|fim▁begin|>use settings; use indy::ErrorCode; static INIT_PLUGIN: std::sync::Once = std::sync::Once::new(); pub fn init_plugin(library: &str, initializer: &str) { settings::set_config_value(settings::CONFIG_PAYMENT_METHOD, settings::DEFAULT_PAYMENT_METHOD); <|fim▁hole|> ...
INIT_PLUGIN.call_once(|| { if let Ok(lib) = _load_lib(library) { unsafe {
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|># -*- encoding: utf-8 -*- # # Copyright (c) 2017 Stephen Bunn (stephen@bunn.io) # GNU GPLv3 <https://www.gnu.org/licenses/gpl-3.0.en.html> from ._common import * from .rethinkdb import RethinkDBPipe from .mongodb import MongoDBPipe<...
<|file_name|>production.py<|end_file_name|><|fim▁begin|>from .base import * DEBUG = False ALLOWED_HOSTS = ['*'] DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis',#'django.db.backends.postgresql_psycopg2', 'NAME': 'bauth', 'USER': 'postgres', 'ADMINUSER':...
'dsn': 'https://5fa65a7464454dcbadff8a7587d1eaa0:205b12d200e24b39b4c586f7df3965ba@app.getsentry.com/29978',
<|file_name|>purefa_volume.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Simon Dodsley (simon@purestorage.com) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metacla...
if state == 'present' and not volume and size: create_volume(module, array)
<|file_name|>20_validators.py<|end_file_name|><|fim▁begin|># coding: utf-8 from smarthumb import SMARTHUMB from gluon.contrib.imageutils import RESIZE # Noticias db.noticias.titulo.requires = [ IS_NOT_EMPTY(error_message=T('Este campo não pode ficar vazio!')), IS_NOT_IN_DB(db, db.noticias.titulo, ...
error_message=T('Por favor selecione uma das opções') ) db.apoiadores.logo.requires = [
<|file_name|>mountedfilesystem_test.go<|end_file_name|><|fim▁begin|>// -*- Mode: Go; indent-tabs-mode: t -*- /* * Copyright (C) 2019 Canonical Ltd * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free So...
<|file_name|>dmt_structs.go<|end_file_name|><|fim▁begin|>// Copyright 2013 The Changkong Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package dmt const VersionNo = "20131207" /* 图片分类 */ type PictureCategory struct { Created ...
PicturePath string `json:"picture_path"`
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|>"""Test registry for builders.""" # These need to register plugins so, pylint: disable=unused-import from grr.lib.builders import signing_test # pylint: enable=unused-import<|fim▁end|>
<|file_name|>cajbook.py<|end_file_name|><|fim▁begin|>""" Loadable.Loadable subclass """ # This file is part of Munin. # Munin 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, ...
loadable.loadable.__init__(self, client, conn, cursor, 50) self.paramre = re.compile(r"^\s*(\d+)[. :-](\d+)[. :-](\d+)\s+(\d+)(\s+(yes))?")
<|file_name|>day17.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 """ http://adventofcode.com/day/17 Part 1 ------ The elves bought too much eggnog again - 150 liters this time. To fit it all into your refrigerator, you'll need to move it into smaller containers. You take an inventory of the capacities of the ...
containers = list() with open(INFILE) as f: for line in f:
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*-<|fim▁hole|> Dummy conftest.py for graph_stix. If you don't know what this is for, just leave it empty. Read more about conftest.py under: https://pytest.org/latest/plugins.html """ from __future__ import ...
"""
<|file_name|>type-param-constraints.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://ww...
<|file_name|>n2dp.py<|end_file_name|><|fim▁begin|>""" =========== N2D+ fitter =========== Reference for line params: Dore (priv. comm.) line frequencies in CDMS, line strength can also be obtained from Splatalogue L. Dore, P. Caselli, S. Beninati, T. Bourke, P. C. Myers and G. Cazzoli A&A 413, 1177-1181 (2004) http:/...
<|file_name|>v1beta1_replica_set_spec.py<|end_file_name|><|fim▁begin|># coding: utf-8 """ OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in complia...
<|file_name|>DataCollector.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python ''' Saves relevant data fed back from TwitterStream etc next to its PID and timestamp ready for analysis Needs to do limited analysis to work out which keywords in the tweet stream correspond to which programme ''' from datetime import date...
# Cycle through the tweets, fixing their URLs as before, and storing them if they aren't a status message for tweet in twitdata:
<|file_name|>build.py<|end_file_name|><|fim▁begin|>import os from os.path import join, getctime, dirname import glob import subprocess import argparse def newest_file(root): path = join(root, "*tar.bz2") newest = max(glob.iglob(path), key=getctime) return newest def upload(pkg, user): cmd = ["binstar"...
build("conda.recipe", args.build_dir, args.py, args.plat, args.binstar_user) #build("../into/conda.recipe", args.build_dir, args.py, args.plat, args.binstar_user) """
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import urllib.parse import sys from ccs import core from ccs import constants from . import response def ticker(): s = __name__.split(".")[1] r = sys._getframe().f_code.co_name # complete request cr = core.request(s, r) return core.get(core....
# return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
<|file_name|>rpc_signrawtransaction.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test transaction signing using the ...
<|file_name|>store_kube_token.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import base64 from cloudify.state import ctx_parameters as inputs from cloudify.manager import get_rest_client client = get_rest_client() client.secrets.create( 'kubernetes_token', base64.b64decode(inputs['kube_token']), update_if_...
<|file_name|>126 Word Ladder II.py<|end_file_name|><|fim▁begin|>''' Given two words (beginWord and endWord), and a dictionary's word list, find all shortest transformation sequence(s) from beginWord to endWord, such that: Only one letter can be changed at a time Each intermediate word must exist in the word list ...
for c in 'abcdefghijklmnopqrstuvwxyz': for i in range(len(word)): new_word = word[:i] + c + word[i + 1:] if new_word in end_level:
<|file_name|>viewer-options-spec.js<|end_file_name|><|fim▁begin|>/* * Copyright 2015 Trim-marks Inc. * * This file is part of Vivliostyle UI. * * Vivliostyle UI 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 Softwar...
other.fontSize(20); other.zoom(ZoomOptions.createFromZoomFactor(1.2)); options.copyFrom(other);
<|file_name|>api.py<|end_file_name|><|fim▁begin|># Copyright © 2019 José Alberto Orejuela García (josealberto4444) # # 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 th...
# along with this program. If not, see <http://www.gnu.org/licenses/>. import configparser import datetime
<|file_name|>consoleauth.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Intel, Inc. # Copyright (c) 2013 OpenStack Foundation # 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 co...
<|file_name|>max_difference.py<|end_file_name|><|fim▁begin|>import unittest """ Given a binary tree, we need to find maximum value we can get by subtracting value of node B from value of node A, where A and B are two nodes of the binary tree and A is ancestor of B. Expected time complexity is O(n). """ <|fim▁hole|>clas...
<|file_name|>util.js<|end_file_name|><|fim▁begin|>// Utility functions<|fim▁hole|>}; String.prototype.contains = function(it) { return this.indexOf(it) != -1; }; if (!String.prototype.trim) { String.prototype.trim = function () { return this.replace(/^\s+|\s+$/g, ''); }; String.prototype.ltrim = functio...
String.prototype.endsWith = function (suffix) { return this.indexOf(suffix, this.length - suffix.length) !== -1;
<|file_name|>postcodes.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ crate_anon/preprocess/postcodes.py =============================================================================== Copyright (C) 2015-2021 Rudolf Cardinal (rudolf@pobox.com). This file is part of CRATE. CRATE is free softw...
<|file_name|>issue-16643.rs<|end_file_name|><|fim▁begin|>#![crate_type = "lib"] <|fim▁hole|>impl<H> TreeBuilder<H> { pub fn process_token(&mut self) { match self { _ => for _y in self.by_ref() {} } } } impl<H> Iterator for TreeBuilder<H> { type Item = H; fn next(&mut self) ...
pub struct TreeBuilder<H> { pub h: H }
<|file_name|>bundle.js<|end_file_name|><|fim▁begin|>var socket = io() var app = angular.module('alcohol', ['ui.router', 'ui.router.grant', 'ngStorage']) app.run(['grant', 'authService', function (grant, authService) { grant.addTest('auth', function () { console.log(authService.isLoggedIn()) return authServi...
<|file_name|>TestDrive.java<|end_file_name|><|fim▁begin|>/***************************************************************************** * Course: CS 27500 * Name: Adam Joseph Cook<|fim▁hole|> * Assignment: 1 * * The <CODE>TestDrive</CODE> Java application simulates a car being driven * depending on its provided fu...
* Email: cook5@purduecal.edu
<|file_name|>prevector_tests.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2015 The Bitcoin Core developers // Copyright (c) 2015-2017 The Bitcoin Unlimited developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include...
void shrink_to_fit() {
<|file_name|>Zoom.js<|end_file_name|><|fim▁begin|>/** * @module ol/control/Zoom */ import {inherits} from '../index.js'; import {listen} from '../events.js'; import EventType from '../events/EventType.js'; import Control from '../control/Control.js'; import {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js'; import...
* @param {Event} event The event to handle * @private */
<|file_name|>htmlstyleelement.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 cssparser::Parser as CssParser; use dom::binding...
use std::sync::Arc; use string_cache::Atom; use style::media_queries::parse_media_query_list; use style::parser::ParserContextExtraData;
<|file_name|>step5_tco.rs<|end_file_name|><|fim▁begin|>use std::rc::Rc; //use std::collections::HashMap;<|fim▁hole|>extern crate lazy_static; extern crate regex; extern crate itertools; extern crate fnv; extern crate rustyline; use rustyline::error::ReadlineError; use rustyline::Editor; #[macro_use] mod types; use ty...
use fnv::FnvHashMap; use itertools::Itertools; #[macro_use]
<|file_name|>incident-form.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core'; import { NavParams, ViewController, ToastController } from 'ionic-angular'; import { Remote } from '../../app/remote'; import { Incident } from '../../app/incident'; import { notify } from '../../app/utils'; @Componen...
selector: 'page-incident-form', templateUrl: 'incident-form.html' }) export class IncidentFormPage {
<|file_name|>access_flags.go<|end_file_name|><|fim▁begin|>package heap const ( ACC_PUBLIC = 0x0001 ACC_PRIVATE = 0x0002 ACC_PROTECTED = 0x0004 ACC_STATIC = 0x0008 ACC_FINAL = 0x0010 ACC_SUPER = 0x0020 ACC_SYNCHRONIZED = 0x0020 ACC_VOLATILE = 0x0040 ACC_BRIDGE = 0x00...
ACC_NATIVE = 0x0100 ACC_INTERFACE = 0x0200
<|file_name|>namespaced-enum-glob-import.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.<|fim▁hole|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LIC...
// // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
<|file_name|>tunnel_calls.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...