prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>validation.go<|end_file_name|><|fim▁begin|>/* Copyright 2016 The Kubernetes Authors All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licen...
// Whether manually or automatically generated, the selector of the job must match the pods it will produce.
<|file_name|>clipComb.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # create pipeline # pl3d = vtk.vtkMultiBlockPLOT3DReader() pl3d.SetXYZFileName(VTK_DATA_ROOT + "/Data/combxyz.bin") pl3...
<|file_name|>common-chunks-bundle.js<|end_file_name|><|fim▁begin|>/******/ (function(modules) { // webpackBootstrap /******/ // install a JSONP callback for chunk loading /******/ var parentJsonpFunction = window["webpackJsonp"]; /******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules, ...
/******/ enumerable: true, /******/ get: getter /******/ }); /******/ }
<|file_name|>rv64f_instr.py<|end_file_name|><|fim▁begin|>""" Copyright 2020 Google LLC Copyright 2020 PerfectVIPs 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/...
""" from pygen_src.riscv_defines import DEFINE_FP_INSTR
<|file_name|>rss-feed.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import { IconBaseProps } from 'react-icon-base'; export default class MdRssFeed extends React.Component<IconBaseProps, any> { }<|fim▁end|>
import * as React from 'react';
<|file_name|>_brain.py<|end_file_name|><|fim▁begin|># Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Eric Larson <larson.eric.d@gmail.com> # Oleh Kozynets <ok7mailbox@gmail.com> # Guillaume Favelier <guillaume.favelier@gmail.com> # jona-sassenhagen <jona.sassenhagen@gmai...
Force an update of the plot. Defaults to True.
<|file_name|>parserEDNA.py<|end_file_name|><|fim▁begin|>"This program will parse matrix files to convert them into objects usable by JS files" # libraries' imports for create the parser ## librairy to create the json object import json import os ## library for using regular expressions import re # opening of all file...
<|file_name|>db.py<|end_file_name|><|fim▁begin|>import logging from datetime import datetime from core import app from sqlalchemy import inspect from flask.ext.sqlalchemy import SQLAlchemy db = SQLAlchemy(app) class Show(db.Model): show_id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String...
<|file_name|>activate.go<|end_file_name|><|fim▁begin|>package commands import (<|fim▁hole|> "github.com/codegangsta/cli" "github.com/ryo33/zenv/environment" "github.com/ryo33/zenv/util" ) var activate = cli.Command{ Name: "activate", Usage: "activate the environment", Description: ` `, Action: doActivate, } ...
<|file_name|>draw_PES.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import matplotlib as mpl from matplotlib import pyplot as plt import argparse def add_adiabatic_map_to_axis(axis, style, energies, color): """ add single set of energies to plot """ # Energy horizontal decks x = style['START'] ...
parser.add_argument('-c', '--colors', nargs='+', help='Color codes') args = parser.parse_args()
<|file_name|>redirect-rename.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org...
// @has - '//p/a' '../../foo/baz/struct.Thing.html' pub struct Thing {}
<|file_name|>rm_dirs_contains_only_if_xml.py<|end_file_name|><|fim▁begin|>''' This script will remove the directories if that contains only xml files. ''' <|fim▁hole|>srcpath = raw_input("Enter the source path : ") for root, sub, files in os.walk(os.path.abspath(srcpath)): if files: files = [f for f in fil...
import os
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|><|fim▁hole|> from django.db import migrations, models import multiselectfield.db.fields class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Book', ...
# Generated by Django 2.2.6 on 2019-10-31 08:31
<|file_name|>badge_maker.py<|end_file_name|><|fim▁begin|>""" Drone.io badge generator. Currently set up to work on Mac.<|fim▁hole|>""" import os from PIL import Image, ImageDraw, ImageFont SIZE = (95, 18) def hex_colour(hex): if hex[0] == '#': hex = hex[1:] return ( int(hex[:2], 16), ...
Requires Pillow.
<|file_name|>regions-addr-of-self.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.apach...
impl dog { pub fn chase_cat(&mut self) { let p: &'static mut uint = &mut self.cats_chased; //~ ERROR cannot infer an appropriate lifetime
<|file_name|>media.js<|end_file_name|><|fim▁begin|>jQuery(document).ready(function(jQuery){ jQuery('.smile-upload-media').click(function(e) { _wpPluploadSettings['defaults']['multipart_params']['admin_page']= 'customizer'; var button = jQuery(this); var id = 'smile_'+button.attr('id'); var uid = button.data('...
}, multiple: false, });
<|file_name|>sub.py<|end_file_name|><|fim▁begin|>from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax1 = fig.add_subplot(1, 2, 1, projection="3d")<|fim▁hole|>z = np.cos(x) ax1.plot(x, y, z) ax2 = fig.add_subplot(1, 2, 2, projection="3d") X = np.arange(-2...
x = np.linspace(-6 * np.pi, 6 * np.pi, 1000) y = np.sin(x)
<|file_name|>FRZZ.cpp<|end_file_name|><|fim▁begin|>#include "simulation/Elements.h" //#TPT-Directive ElementClass Element_FRZZ PT_FRZZ 100 Element_FRZZ::Element_FRZZ() { Identifier = "DEFAULT_PT_FRZZ"; Name = "FRZZ"; Colour = PIXPACK(0xC0E0FF); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled ...
for (ry=-1; ry<2; ry++) if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) {
<|file_name|>react-proper-lifecycle-methods.test.js<|end_file_name|><|fim▁begin|>// @ts-check const { ESLintUtils } = require('@typescript-eslint/experimental-utils') const RuleTester = ESLintUtils.RuleTester const rule = require('../react-proper-lifecycle-methods') // -----------------------------------------------...
export class CloningRepositoryView extends React.Component<{}, IWindowControlState> { public componentWillUpdate(bar: string) { }
<|file_name|>update_asset.js<|end_file_name|><|fim▁begin|><|fim▁hole|> * Copyright (c) 2005-2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except * in compliance with the Licens...
/*
<|file_name|>cache.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate lazy_static; #[macro_use] extern crate named_type_derive; #[macro_use] extern crate derivative; #[macro_use] extern crate serde_derive; #[macro_use] extern crate serde_json; extern crate byteorder; extern crate indyrs as indy; extern crat...
&options_json ).unwrap(); let _cred_def: CredentialDefinition = serde_json::from_str(&cred_def_json1).unwrap();
<|file_name|>tcc_utils.py<|end_file_name|><|fim▁begin|>from lxml import etree from anansi.xml import XMLMessage,gen_element,XMLError class TCCError(Exception): def __init__(self,msg): super(TCCError,self).__init__(msg) class TCCMessage(XMLMessage): def __init__(self,user,comment=""): super(TCC...
md_east.append(gen_element("state",text=md_east_state))
<|file_name|>test_exception_interception.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ test ~~~~ Sanic-CORS is a simple extension to Sanic allowing you to support cross origin resource sharing (CORS) using a simple decorator. :copyright: (c) 2020 by Ashley Sommer (based on flask-cors ...
to normal responses, and should be wrapped by CORS headers if the
<|file_name|>swscale.go<|end_file_name|><|fim▁begin|>// Use of this source code is governed by a MIT license that can be found in the LICENSE file. // Giorgis (habtom@giorgis.io) //Package swscale performs highly optimized image scaling and colorspace and pixel format conversion operations. //Rescaling: is the process...
cdr := (*C.int)(unsafe.Pointer(dr)) cb := (*C.int)(unsafe.Pointer(b))
<|file_name|>aixc++.py<|end_file_name|><|fim▁begin|>"""SCons.Tool.aixc++ Tool-specific initialization for IBM xlC / Visual Age C++ compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) ...
path, _cxx, version = get_xlc(env) if path and _cxx: xlc = os.path.join(path, _cxx) if os.path.exists(xlc):
<|file_name|>manage.py<|end_file_name|><|fim▁begin|><|fim▁hole|>if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "corponovo.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other re...
#!/usr/bin/env python import os import sys
<|file_name|>x86_64.rs<|end_file_name|><|fim▁begin|>#![allow(unused_imports)] use core::intrinsics; // NOTE These functions are implemented using assembly because they using a custom // calling convention which can't be implemented using a normal Rust function // NOTE These functions are never mangled as they are no...
#[cfg(all(windows, target_env = "gnu", not(feature = "mangled-names")))]
<|file_name|>configmap.go<|end_file_name|><|fim▁begin|>/* Copyright 2019 The Knative 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 r...
untyped := ctx.Value(Key{}) if untyped == nil { logging.FromContext(ctx).Panicf(
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os import re import time from django.template import RequestContext as RC from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.shortcuts import render_to_response from django.db.models imp...
for line in loglines: if ptn.search(line): request.websocket.send(line)
<|file_name|>task_executor.py<|end_file_name|><|fim▁begin|># (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation...
task=async_task, connection=self._connection, connection_info=self._connection_info, loader=self._loader,
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url from django.conf import settings from django.conf.urls.static import static from django.contrib import admin admin.autodiscover() import views urlpatterns = patterns('',<|fim▁hole|> url(r'^words', views.words, { ...
url(r'^pis', views.pis),
<|file_name|>es.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals import time import logging import ujson as json from elasticsearch import Elasticsearch from elasticsearch.client import IndicesClient from elasticsearch.exceptions import ConnectionTimeo...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># # ICRAR - International Centre for Radio Astronomy Research # (c) UWA - The University of Western Australia, 2015 # Copyright by UWA (in the framework of the ICRAR) # All rights reserved # # This library is free software; you can redistribute it and...
This package contains all python modules implementing the DROP Manager concepts, including their external interface, a web UI and a client """
<|file_name|>test_MetaData.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ 本测试模块用于测试与 :class:`sqlite4dummy.schema.MetaData` 有关的方法 class, method, func, exception ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ from sqlite4dummy import * from sqlit...
Column("_int", dtype.INTEGER), Column("_float", dtype.REAL), Column("_str", dtype.TEXT),
<|file_name|>move-type-alias.cpp<|end_file_name|><|fim▁begin|>// RUN: mkdir -p %T/move-type-alias // RUN: cp %S/Inputs/type_alias.h %T/move-type-alias/type_alias.h // RUN: echo '#include "type_alias.h"' > %T/move-type-alias/type_alias.cpp // RUN: cd %T/move-type-alias // // --------------------------------------------...
<|file_name|>ItemViewHtmlBody.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react'; import * as Kurve from 'kurvejs'; import * as ScopedStyles from './ScopedStylePolyfill'; interface ItemViewHtmlBodyProps extends React.Props<ItemViewHtmlBody> { style: React.CSSProperties body?: string; attachme...
});
<|file_name|>DemoHLS.java<|end_file_name|><|fim▁begin|>/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. * See the copyright.txt in the distribution for a full listing * of individual contributors. * This copyri...
if (!_id.isEmpty()) { _id.pop();
<|file_name|>views.py<|end_file_name|><|fim▁begin|># Licensed to Hortonworks, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Hortonworks, Inc. licenses this file # to you under the Apache License, Ve...
hue_location = ustep.hue_location
<|file_name|>PluggableProjectWriter.java<|end_file_name|><|fim▁begin|>// Copyright (c) 1996-2002 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written // agreement is hereby grante...
// California. The software program and documentation are supplied "AS
<|file_name|>SimilarityExampleSet.java<|end_file_name|><|fim▁begin|>/* * RapidMiner * * Copyright (C) 2001-2008 by Rapid-I and the contributors * * Complete list of developers available at our web site: * * http://rapid-i.com * * This program is free software: you can redistribute it and/or ...
this.attributes.addRegular(secondIdAttribute); firstIdAttribute.setTableIndex(0); secondIdAttribute.setTableIndex(1);
<|file_name|>attention.py<|end_file_name|><|fim▁begin|>import theano import numpy import scipy from theano import tensor from blocks.bricks import Initializable, Linear from blocks.bricks.parallel import Parallel from blocks.bricks.base import lazy, application from blocks.bricks.attention import ( GenericSequence...
axis=1)]
<|file_name|>signals.py<|end_file_name|><|fim▁begin|>""" mock_django.signals ~~~~~~~~~~~~~~~~ :copyright: (c) 2012 DISQUS. :license: Apache License 2.0, see LICENSE for more details. """ import contextlib import mock @contextlib.contextmanager def mock_signal_receiver(signal, wraps=None, **kwargs): """<|fim▁hole...
<|file_name|>test_volume_type_access.py<|end_file_name|><|fim▁begin|># # 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 # # Unl...
raise exception.VolumeTypeAccessNotFound(volume_type_id=type_id, project_id=project_id) self.stubs.Set(db, 'volume_type_access_remove',
<|file_name|>demo.js<|end_file_name|><|fim▁begin|>$(window).load(function(){FusionCharts.ready(function () { var revenueChart = new FusionCharts({ type: 'column2d', renderAt: 'chart-container', width: '500', height: '300', dataFormat: 'json', dataSource: { ...
"label": "January", "value": "420000" }, {
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|>from openslides.core.config import config from openslides.motions.exceptions import WorkflowError from openslides.motions.models import Motion, State, Workflow from openslides.users.models import User from openslides.utils.test import TestCase class ModelTest(T...
self.assertEqual(motion._text, 'text')
<|file_name|>introspection.py<|end_file_name|><|fim▁begin|>from django.db.backends import BaseDatabaseIntrospection class DatabaseIntrospection(BaseDatabaseIntrospection):<|fim▁hole|> def get_table_list(self, cursor): "Returns a list of table names in the current database." cursor.execute("SHOW TA...
<|file_name|>ports.rs<|end_file_name|><|fim▁begin|>use core_foundation::base::OSStatus; use coremidi_sys::{MIDIPortConnectSource, MIDIPortDisconnectSource, MIDIPortDispose, MIDISend}; <|fim▁hole|>use crate::endpoints::destinations::Destination; use crate::endpoints::sources::Source; use crate::object::Object; use crat...
use std::ops::Deref; use std::ptr; use crate::callback::BoxedCallback;
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>"""Tests for the fido component."""<|fim▁end|>
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>extern crate regex; pub struct Prefix { pub nick: String, pub user: String, pub host: String } impl Prefix {<|fim▁hole|> pub fn parse(prefix: &str) -> Option<Prefix> { let re = match regex::Regex::new(r"^:(.+)!(.+)@(.+)$") { Ok(re) =>...
/// Attempts to parse a prefix, e.g. ":aleph!user@example.com"
<|file_name|>BulkIndexingStressTest.java<|end_file_name|><|fim▁begin|>/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the A...
}
<|file_name|>climate.py<|end_file_name|><|fim▁begin|>""" Support for KNX/IP climate devices. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.knx/ """ import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant...
return self.device.is_on return None async def async_turn_on(self):
<|file_name|>invalid_char.rs<|end_file_name|><|fim▁begin|>fn main() { assert!(std::char::from_u32(-1_i32 as u32).is_none());<|fim▁hole|> 'a' => {true}, 'b' => {false}, _ => {true}, }; }<|fim▁end|>
let _val = match unsafe { std::mem::transmute::<i32, char>(-1) } { //~ ERROR encountered 4294967295, but expected something less or equal to 1114111
<|file_name|>fib.py<|end_file_name|><|fim▁begin|>import sys def genfib(): first, second = 0, 1 while True: yield first first, second = second, first + second def fib(number): fibs = genfib() for i in xrange(number + 1): retval = fibs.next() return retval <|fim▁hole|> w...
if __name__ == '__main__': inputfile = sys.argv[1]
<|file_name|>control-bar.tsx<|end_file_name|><|fim▁begin|>import { Component, Prop, PropDidChange, Element } from '@stencil/core'; @Component({ tag: 'control-bar',<|fim▁hole|> styleUrl: 'control-bar.scss' }) export class ControlBar { @Prop() visible = true; @Element() element: HTMLElement; componen...
<|file_name|>sslocal.rs<|end_file_name|><|fim▁begin|>//! This is a binary running in the local environment //! //! You have to provide all needed configuration attributes via command line parameters, //! or you could specify a configuration file. The format of configuration file is defined //! in mod `config`. <|fim▁ho...
use clap::Command; use shadowsocks_rust::service::local;
<|file_name|>gfile_z_time_test.go<|end_file_name|><|fim▁begin|>// Copyright GoFrame Author(https://goframe.org). All Rights Reserved. // // This Source Code Form is subject to the terms of the MIT License. // If a copy of the MIT was not distributed with this file, // You can obtain one at https://github.com/gogf/gf. ...
fileobj os.FileInfo
<|file_name|>py3.py<|end_file_name|><|fim▁begin|>import sys class outPip(object): def __init__(self, fileDir): self.fileDir = fileDir self.console = sys.stdout def write(self, s): self.console.write(s) with open(self.fileDir, 'a') as f: f.write(s) def flush(self): ...
print('This will appear on your console and your file.') print('So is this line.')
<|file_name|>5288513.cpp<|end_file_name|><|fim▁begin|>//Language: GNU C++ /** Be name Khoda **/ #include <iostream> #include <iomanip> #include <fstream> #include <sstream> #include <map> #include <vector> #include <list> #include <set> #include <queue> #include <deque> #include <algorithm> #inclu...
#define Y second #define PI (3.141592654)
<|file_name|>preferences-assistant.js<|end_file_name|><|fim▁begin|>function PreferencesAssistant() { /* this is the creator function for your scene assistant object. It will be passed all the additional parameters (after the scene name) that were passed to pushScene. The reference to the scene contro...
disabledProperty: 'oldInterfaceToggleDisabled'
<|file_name|>test_reactor.rs<|end_file_name|><|fim▁begin|>use tokio::io::Ready; use tokio::reactor::{self, Config, Reactor, Task, Tick}; use std::io; use std::sync::mpsc::{self, Sender}; #[test] fn test_internal_source_state_is_cleaned_up() { use mio::{Evented, EventSet, Poll, PollOpt, Token}; struct Foo; ...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>ES_INDEX_NAME = "brainiak"<|fim▁hole|>ES_TYPE_NAME = "query"<|fim▁end|>
<|file_name|>f1-tests.ts<|end_file_name|><|fim▁begin|>import F1 = require("f1"); var ui = F1(); ui.states({ out: { itemToAnimate1: { variableToAnimate: 0 }, itemToAnimate2: { variableToAnimate: 0 } }, idle: { itemToAnimate1: { va...
<|file_name|>model_get_universe_regions_region_id_ok.go<|end_file_name|><|fim▁begin|><|fim▁hole|>type GetUniverseRegionsRegionIdOk struct { /* constellations array */ Constellations []int32 `json:"constellations,omitempty"` /* description string */ Description string `json:"description,omitempty"` /* name st...
package esilegacy /* 200 ok object */
<|file_name|>ext-settings_menu.js<|end_file_name|><|fim▁begin|>ace.define("ace/ext/menu_tools/overlay_page",[], function(require, exports, module) { 'use strict'; var dom = require("../../lib/dom"); var cssText = "#ace_settingsmenu, #kbshortcutmenu {\ background-color: #F7F7F7;\ color: black;\ box-shadow: -5px 4px 5px ...
return control;
<|file_name|>index.py<|end_file_name|><|fim▁begin|>__author__ = 'oier' import json from flask import Flask, make_response app = Flask(__name__) import seaborn as sns import numpy as np import pandas as pd import os from datetime import datetime import matplotlib.pyplot as plt import sys from matplotlib.figure impo...
def form_values(request):
<|file_name|>webpack.config.js<|end_file_name|><|fim▁begin|><|fim▁hole|> app : './app/app.js' }, output: { filename: '[name]_bundle.js', path: './dist' } };<|fim▁end|>
module.exports = { entry: {
<|file_name|>requests.rs<|end_file_name|><|fim▁begin|>use std::slice::Iter; use super::{ Request }; pub struct Requests<'a> { request: Option<&'a Request>, requests: Iter<'a, Request>, } impl<'a> Requests<'a> { pub fn new(request: &'a Request, requests: &'a Vec<Request>) -> Requests<'a> { Requests { r...
self.request = None; request
<|file_name|>environprovider.go<|end_file_name|><|fim▁begin|>// Copyright 2013 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package azure import ( "github.com/juju/loggo" "github.com/juju/core/environs" "github.com/juju/core/environs/config" ) // Register the Azure provider with Juj...
logger.Debugf("opening environment %q.", cfg.Name()) // We can't return NewEnviron(cfg) directly here because otherwise,
<|file_name|>handshake.js<|end_file_name|><|fim▁begin|>"use strict" var util = require('util') var MessageEvent = require('./messageevent') var Config = require('./config') /** * Coordinate the connection of a new chat client to the server. * Different chat clients send the information differently, so far this cha...
this.version = data.toString().substring(1, data.length - 2)
<|file_name|>0014_rename_schema_from_forum_to_askbot.py<|end_file_name|><|fim▁begin|># encoding: utf-8 import os import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models app_dir_name = os.path.basename(os.path.dirname(os.path.dirname(__file__))) class Migration(SchemaM...
}, 'forum.flaggeditem': { 'Meta': {'unique_together': "(('content_type', 'object_id', 'user'),)", 'object_name': 'FlaggedItem', 'db_table': "u'flagged_item'"},
<|file_name|>unixtostr.js<|end_file_name|><|fim▁begin|>'use strict'; angular.module('eshttp') .filter('unixtostr', function() { return function(str){ var dt; dt = Date.create(str * 1000).format('{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}'); if (dt == "Invalid Date") { return 'N/A';<|fim▁...
} else { return dt; }
<|file_name|>app.js<|end_file_name|><|fim▁begin|>const core = require('brigadehub-core') var pkg = require('./package.json')<|fim▁hole|>const bhConfig = { dotenv: require('./dotenv')(), info: '[Brigadehub]', version: pkg.version, brigade: brigade } core(bhConfig)<|fim▁end|>
var brigade = require('./brigade')()[0]
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>"""A setuptools based setup module.<|fim▁hole|>""" # Always prefer setuptools over distutils try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup, find_packages # To use a consistent encoding from codecs import...
See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/tk_nosy
<|file_name|>generate_volcano_evac_zone.py<|end_file_name|><|fim▁begin|><|fim▁hole|>H = read_layer('/data_area/InaSAFE/public_data/hazard/Marapi.shp') print H.get_geometry() # Generate evacuation circle (as a polygon): radius = 3000 center = H.get_geometry()[0] Z = make_circular_polygon(center, radius) Z.write_to_file...
from safe.engine.interpolation import make_circular_polygon from safe.storage.core import read_layer
<|file_name|>2082002.js<|end_file_name|><|fim▁begin|>engine.eval("load('nashorn:mozilla_compat.js');"); /* This file is part of the OdinMS Maple Story Server Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc> Matthias Butz <matze@odinms.de> Jan Christian Meyer <vimes@odinms.de> This program ...
<|file_name|>level_bar.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use Buildable; #[cfg(any(feature = "v3_6", feature = "dox"))] use LevelBarMode; use Orientable; use Widget; use ffi; use glib; ...
}
<|file_name|>cluster.go<|end_file_name|><|fim▁begin|>// Copyright 2016 The etcd 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....
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>extern crate discotech; #[macro_use] extern crate log; extern crate log4rs; use discotech::{Serverset, DiscoConfig, read_config}; use std::env; fn initialize_logging() { let root = log4rs::config::Root::builder(log::LogLevelFilter::Debug) .appender("stderr".to_s...
<|file_name|>ec2_vpc_subnet.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # This is a 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, or # (at your option) any later version...
<|file_name|>filter.ts<|end_file_name|><|fim▁begin|>import * as m from './model' import * as f from './factories' export function filterModules(moduleNames: string[]|((moduleName: string) => boolean), modules: m.KeyValue<f.ModuleFactory>): m.KeyValue<f.ModuleFactory> { // TODO: Temporary hack to get a demo ready r...
// } // // function processTypeAliasConstructor(typeAliasConstructor: f.TypeAliasConstructorFactory<any>) {
<|file_name|>MaritalStatus.java<|end_file_name|><|fim▁begin|>/** * DynamicReports - Free Java reporting library for creating reports dynamically * * Copyright (C) 2010 - 2012 Ricardo Mariaca * http://dynamicreports.sourceforge.net * * This file is part of DynamicReports. *<|fim▁hole|> * DynamicReports is free so...
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-25 16:19 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependen...
('address_type', models.CharField(choices=[('BU', 'Business'), ('PE', 'Personal')], max_length=2)), ('city', models.CharField(max_length=32, null=True)),
<|file_name|>Entry.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # __COPYRIGHT__ # # 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 # without limitatio...
# tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4:
<|file_name|>conversion_generated.go<|end_file_name|><|fim▁begin|>/* Copyright 2015 The Kubernetes Authors All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache...
<|file_name|>segment.py<|end_file_name|><|fim▁begin|>from . import strip <|fim▁hole|> def __init__(self, strip, length, offset=0): if offset < 0 or length < 0: raise ValueError('Segment indices are non-negative.') if offset + length > len(strip): raise ValueError('Segment t...
class Segment(strip.Strip): """Represents an offset, length segment within a strip."""
<|file_name|>value.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, ParserInput};<|fim▁hole|>use style::sty...
use style::context::QuirksMode; use style::parser::ParserContext;
<|file_name|>SkyXManager.cpp<|end_file_name|><|fim▁begin|>/* This source file is part of Rigs of Rods Copyright 2005-2012 Pierre-Michel Ricordel Copyright 2007-2012 Thomas Fischer Copyright 2013-2014 Petr Ohlidal For more information, see http://www.rigsofrods.com/ Rigs of Rods is free software: you can redistr...
RoR::App::GetOgreSubsystem()->GetOgreRoot()->addFrameListener(mSkyX); RoR::App::GetOgreSubsystem()->GetRenderWindow()->addListener(mSkyX); }
<|file_name|>l2t_csv.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2012 The Plaso Project Authors. # Please see the AUTHORS file for details on individual authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complian...
<|file_name|>carmen.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Copyright 2013 Sumana Harihareswara # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or ...
return self.player.location == self.nemesis.location def playturn(self): print "%s, you are now in %s and you can head to:" % (self.player.name, self.player.location.name)
<|file_name|>0004_waiter_days_worked.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [<|fim▁hole|> migrations.AddField( model_name='waiter', ...
('demo_models', '0003_auto_20150419_2110'), ] operations = [
<|file_name|>df_interpreter.py<|end_file_name|><|fim▁begin|># coding: utf-8 # # drums-backend a simple interactive audio sampler that plays vorbis samples # Copyright (C) 2009 C.D. Immanuel Albrecht # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gene...
def __init__(self,globalvars,locals=None): vars = globalvars code.InteractiveInterpreter.__init__(self, locals) self.tracebacked = False
<|file_name|>angular-app.js<|end_file_name|><|fim▁begin|>"use strict"; (function() { // "todos-angular" is just a hard-code id for storage var LOCAL_STORAGE_KEY = 'todos-angular'; var ENTER_KEY = 13; var ESC_KEY = 27; var internalFilters = { active: function(toDoItem) { return ...
}, function(newValue) { if (newValue == null) { $scope.remainingLabel = ''; } else {
<|file_name|>pin.rs<|end_file_name|><|fim▁begin|>// Zinc, the bare metal stack for rust. // Copyright 2014 Lionel Flandrin <lionel@svkt.org> // // 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 a...
<|file_name|>reddit_db_scraper.py<|end_file_name|><|fim▁begin|>from pymongo import MongoClient import json import requests import time from datetime import datetime def subredditInfo(sr, limit=100, sorting="top", period="day", user_agent="ChicagoSchool's scraper", **kwargs): """retrieves X (max ...
<|file_name|>test_america.py<|end_file_name|><|fim▁begin|>from datetime import date from . import GenericCalendarTest from ..america import ( Argentina, Barbados, Chile, Colombia, Mexico, Panama, Paraguay ) class ArgentinaTest(GenericCalendarTest): cal_class = Argentina def test_holidays_2018(self): ...
def test_dia_malvinas_label(self): _, label = self.cal.get_malvinas_day(2020)
<|file_name|>AuthController.js<|end_file_name|><|fim▁begin|>/** * Created by Roman on 16.12.13. */ var moment = require('moment'); function AuthController($scope, $api) { var ctrl = this; $scope.client_id = store.get('client_id'); $scope.api_key = store.get('api_key'); $scope.api_secret = store.get...
$scope.err = null;
<|file_name|>Start.py<|end_file_name|><|fim▁begin|>from vt_manager_kvm.communication.sfa.util.xrn import urn_to_hrn from vt_manager_kvm.communication.sfa.trust.credential import Credential from vt_manager_kvm.communication.sfa.trust.auth import Auth <|fim▁hole|> def __init__(self, xrn, creds, **kwargs): ...
class Start:
<|file_name|>vector.rs<|end_file_name|><|fim▁begin|>use ndarray::*; use ndarray_linalg::*; #[test]<|fim▁hole|> #[test] fn vector_norm_l1() { let a = arr1(&[1.0, -1.0]); assert_rclose!(a.norm_l1(), 2.0, 1e-7); let b = arr2(&[[0.0, -1.0], [1.0, 0.0]]); assert_rclose!(b.norm_l1(), 2.0, 1e-7); } #[test] f...
fn vector_norm() { let a = Array::range(1., 10., 1.); assert_rclose!(a.norm(), 285.0.sqrt(), 1e-7); }
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Utilities for handling shell surfaces with the `wlr_layer_shell` protocol //! //! This interface should be suitable for the implementation of many desktop shell components, //! and a broad number of other applications that interact with the desktop. //! //! ### Initi...
NewLayerSurface { /// the surface
<|file_name|>Hr.test.tsx<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRA...
* Copyright 2018 The Kubeflow Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.