prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>xsky_path23.py<|end_file_name|><|fim▁begin|>import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=8, path_list=[<|fim▁hole|> [TestAction.create_volume, 'volume1', 'flag=scsi'], [TestAction.at...
[TestAction.create_vm, 'vm1', ],
<|file_name|>document_renderer.py<|end_file_name|><|fim▁begin|># Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os from document_parser import ParseDocument from third_party.json_schem...
<|file_name|>fig08_10.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # fig08_10.py # # Author: Billy Wilson Arante # Created: 2016/10/10 from rational import Rational def main(): """Main""" # Objects of class Rational rational1 = Rational() # 1/1 rational2 = Rational(...
<|file_name|>OscReceiver.cpp<|end_file_name|><|fim▁begin|>/* TUIO C++ Library Copyright (c) 2005-2014 Martin Kaltenbrunner <martin@tuio.org> This 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 Software Foundatio...
else ProcessMessage( ReceivedMessage(*i), remoteEndpoint);
<|file_name|>reference.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals from amaascore.core.amaas_model import AMaaSModel class Reference(AMaaSModel): def __init__(self, reference_value, reference_primary=False, *args, **kwargs): self.ref...
<|file_name|>expression.cpp<|end_file_name|><|fim▁begin|>#include "expression.h" #include "opt.h"<|fim▁hole|> std::vector<vv::vm::command> vv::ast::expression::code() const { auto vec = generate(); optimize(vec); return vec; }<|fim▁end|>
#include "vm/instruction.h"
<|file_name|>array_init.js<|end_file_name|><|fim▁begin|>//------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. ...
<|file_name|>macro-pat.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://www.apache.org/...
}
<|file_name|>mvn.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (C) 2013 The Android Open Source Project # # 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...
print(' '.join(exe), file=stderr) check_output(exe)
<|file_name|>owdistancemap.py<|end_file_name|><|fim▁begin|>import sys import itertools from functools import reduce from operator import iadd import numpy<|fim▁hole|> QFormLayout, QGraphicsRectItem, QGraphicsGridLayout, QFontMetrics, QPen, QIcon, QPixmap, QLinearGradient, QPainter, QColor, QBrush, QTransfor...
from PyQt4.QtGui import (
<|file_name|>tools.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 # # Unless required by applicable law o...
def stop_timers(self): pass
<|file_name|>options.cc<|end_file_name|><|fim▁begin|>#include <mimosa/options/options.hh> #include "options.hh" namespace hefur { const uint32_t & MAX_PEERS = *mo::addOption<uint32_t>( "", "max-peers", "the maximum number of peers per torrent", 30000); const uint32_t & MAX_TORRENT_SIZE = *mo::addOption<u...
<|file_name|>KerberosTypeConverter.java<|end_file_name|><|fim▁begin|>package com.sequenceiq.freeipa.entity.util;<|fim▁hole|>public class KerberosTypeConverter extends DefaultEnumConverter<KerberosType> { @Override public KerberosType getDefault() { return KerberosType.FREEIPA; } }<|fim▁end|>
import com.sequenceiq.cloudbreak.converter.DefaultEnumConverter; import com.sequenceiq.freeipa.api.v1.kerberos.model.KerberosType;
<|file_name|>manage-journey.guard.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core'; import { Router, CanActivate, CanActivateChild, ActivatedRouteSnapshot } from '@angular/router'; import { JourneyService } from '../journey.service'; @Injectable() export class ManageJourneyGuard implements Ca...
constructor(
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>""" Scrapy settings for RecipesScraper project. """ # Names BOT_NAME = 'RecipesScraper' SPIDER_MODULES = ['RecipesScraper.spiders'] NEWSPIDER_MODULE = 'RecipesScraper.spiders' # Obey robots.txt rules ROBOTSTXT_OBEY = True # Disable cookies (enabled by default) ...
# Enable showing throttling stats for every response received: #AUTOTHROTTLE_DEBUG = False
<|file_name|>CWE762_Mismatched_Memory_Management_Routines__new_free_struct_54a.cpp<|end_file_name|><|fim▁begin|>/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE762_Mismatched_Memory_Management_Routines__new_free_struct_54a.cpp Label Definition File: CWE762_Mismatched_Memory_Management_Routines__new_free.label.xml T...
{
<|file_name|>generate_provider_logos_collage_image.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # 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 ownersh...
resized_images = resize_images(logo_files=logo_files, output_path=output_path) assemble_final_image(resized_images=resized_images, output_path=output_path)
<|file_name|>catalog.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core'; import { Headers, Http, Response } from '@angular/http'; import { Floss } from '../models/floss'; import { DB } from '../models/db'; @Injectable() export class CatalogService { private flossUrl = 'app/floss'; ...
localData[name] = data; localStorage.setItem('sara', JSON.stringify(localData))
<|file_name|>TradeboardFragment.java<|end_file_name|><|fim▁begin|>package com.hacks.collegebarter.fragments; import android.app.Activity; import android.app.Fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.hacks.collegebarter.R...
bundle.putInt(ARG_SECTION_NUMBER, 0);
<|file_name|>filter_xroar_trace.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # encoding:utf-8 """ Filter Xroar trace files. see README for more information. :created: 2014 by Jens Diemer - www.jensdiemer.de :license: GNU GPL v3 or above, see LICENSE for more details. """ import os import ti...
return if args.start_stop:
<|file_name|>driver_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org...
fakeSink := NewFakeOpenTSDBSink(true, true) err := fakeSink.StoreTimeseries([]sink_api.Timeseries{}) assert.NoError(t, err) assert.Equal(t, 0, len(fakeSink.fakeClient.receivedDataPoints))
<|file_name|>test_featurecursor.py<|end_file_name|><|fim▁begin|>import pytest from roam_tests import objects from roam.infodock import FeatureCursor, NoFeature layer = objects.newmemorylayer() layer = objects.addfeaturestolayer(layer, 2) features = layer.getFeatures() featureone = next(features) featuretwo = next(fe...
def test_next_should_wrap_to_start_when_on_last(cursor): last = len(cursor.features) - 1 cursor.index = last assert cursor.index == last
<|file_name|>styles.js<|end_file_name|><|fim▁begin|>import styled from 'styled-components'; export const Container = styled.div` width: 100%; height: 100%; `; export const EditorContainer = styled.div` ${''/* padding: 30px 30px; */} width: 100%; box-sizing: border-box; position: relative; ...
& ul { padding-left: 24px;
<|file_name|>pyunit_h2oH2OFrame_ascharacter.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.utils.typechecks import assert_is_type from h2o.frame import H2OFrame def h2o_H2OFrame_ascharacter(): """ ...
newFrame = h2oframe['cylinders'].ascharacter()
<|file_name|>create_bidder_mutation.ts<|end_file_name|><|fim▁begin|>import { GraphQLNonNull, GraphQLString } from "graphql" import { mutationWithClientMutationId } from "graphql-relay" import Bidder from "schema/v2/bidder" import { ResolverContext } from "types/graphql" export default mutationWithClientMutationId<any,...
<|file_name|>20.d.ts<|end_file_name|><|fim▁begin|>import * as React from "react"; import { CarbonIconProps } from "../../../"; declare const WatsonHealthNominate20: React.ForwardRefExoticComponent< CarbonIconProps & React.RefAttributes<SVGSVGElement><|fim▁hole|><|fim▁end|>
>; export default WatsonHealthNominate20;
<|file_name|>secondView.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import {Content} from "./content"; export class SecondView extends Content { constructor() { super("View #2", ` <div> <p>This is view #2</p> </div> `); } }<|fim▁end|>
<|file_name|>venn-diagram.component.ts<|end_file_name|><|fim▁begin|>import { Component, Input, OnInit, NgZone } from '@angular/core'; // import model classes import {Diagram} from '../models/diagram'; import {Topic} from '../models/topic'; @Component({ selector: 'venn-diagram', templateUrl: './venn-diagram.compon...
<|file_name|>test_ovs_neutron_agent.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 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....
notifier_cls.return_value = self.notifier cfg.CONF.set_default('firewall_driver',
<|file_name|>DynamicScriptExecutor.java<|end_file_name|><|fim▁begin|>package org.webbuilder.web.service.script; import org.springframework.stereotype.Service; import org.webbuilder.utils.script.engine.DynamicScriptEngine; import org.webbuilder.utils.script.engine.DynamicScriptEngineFactory; import org.webbuilder.utils...
}
<|file_name|>rejuv_histogram_overheal.rs<|end_file_name|><|fim▁begin|>extern crate wow_combat_log; extern crate chrono; use std::fs::File; use std::io::BufReader; use std::collections::HashMap; use std::fmt; use chrono::Duration; static REJUV_AURAS: &'static [u32] = &[ 774, // Rejuv 155777, // Rejuv (Germ) ...
<|file_name|>event.rs<|end_file_name|><|fim▁begin|>use crate::Token; use super::Ready; pub type SysEvent = Event; #[derive(Debug, Clone)] pub struct Event { token: Token, readiness: Ready, } impl Event { pub(crate) fn new(readiness: Ready, token: Token) -> Event { Event { token, readiness } ...
<|file_name|>encoder.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 Adam Greig // Licensed under the MIT license, see LICENSE for details. //! This module provides the encoding function for turning data into codewords. //! //! Please refer to the `encode` and `copy_encode` methods on //! [`LDPCCode`](../codes/enum....
for x in parityblock.iter_mut().rev() {
<|file_name|>DelimitedPayloadTokenFilterFactory.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 un...
* */
<|file_name|>UntagResourceResult.java<|end_file_name|><|fim▁begin|>/* * Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is locate...
<|file_name|>chunkwriting.go<|end_file_name|><|fim▁begin|>package azblob import ( "bytes" "context" "encoding/base64" "encoding/binary" "errors" "fmt" "io" "sync" "sync/atomic" guuid "github.com/google/uuid" ) // blockWriter provides methods to upload blocks that represent a file to a server and commit the...
// TODO(someone): The existing model provides a buffer size and buffer limit as limiting factors. The buffer size is probably // useless other than needing to be above some number, as the network stack is going to hack up the buffer over some size. The // max buffers is providing a cap on how much memory we use (by mu...
<|file_name|>app.js<|end_file_name|><|fim▁begin|>/* * Copyright 2016 e-UCM (http://www.e-ucm.es/) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * This project has received funding from the European Union’s Horizon * 2020 rese...
$scope.$on('selectGame', function (event, params) {
<|file_name|>app.js<|end_file_name|><|fim▁begin|>var app = angular.module('AtWork', [ 'atwork.system', 'atwork.users', 'atwork.posts', 'atwork.streams', 'atwork.chats', 'atwork.activities', 'atwork.notifications', 'atwork.settings', 'ngMaterial']); app.controller('AppCtrl', [ '$scope', '...
};
<|file_name|>cmp.rs<|end_file_name|><|fim▁begin|>#![feature(core)] extern crate core; // macro_rules! e {<|fim▁hole|> // ($( // $Tuple:ident { // $(($idx:tt) -> $T:ident)+ // } // )+) => { // $( // #[stable(feature = "rust1", since =...
// ($e:expr) => { $e } // } // macro_rules! tuple_impls {
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![crate_name = "mockstream"] #![crate_type = "lib"] //! A reader/writer streams to mock real streams in tests. use std::cell::RefCell; use std::io::{Cursor, Error, ErrorKind, Read, Result, Write}; use std::mem::swap; use std::rc::Rc; use std::sync::atomic::{AtomicBool,...
<|file_name|>select_node.go<|end_file_name|><|fim▁begin|>/* Copyright 2018 The OpenEBS 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...
<|file_name|>object.py<|end_file_name|><|fim▁begin|>""" Copyright (C) 2014 Maruf Maniruzzaman Website: http://cosmosframework.com<|fim▁hole|><|fim▁end|>
Author: Maruf Maniruzzaman License :: OSI Approved :: MIT License """
<|file_name|>func.js<|end_file_name|><|fim▁begin|>function timenow(){ var timenow1 = Date.getHours();<|fim▁hole|>}<|fim▁end|>
return timenow1;
<|file_name|>api-functions.js<|end_file_name|><|fim▁begin|>const request = require('request-promise'); const oauth = require('./config').auth; const rootUrl = 'https://api.twitter.com/1.1'; let allItems = []; <|fim▁hole|> /** * Search for tweets * @param options {Object} Options object containing: * -...
/* API methods */ const API = {
<|file_name|>main.js<|end_file_name|><|fim▁begin|>if (Meteor.isClient) { // counter starts at 0 Template.main.helpers({ }); Template.main.events({<|fim▁hole|>if (Meteor.isServer) { Meteor.startup(function () { // code to run on server at startup }); }<|fim▁end|>
}); }
<|file_name|>gen_rst.py<|end_file_name|><|fim▁begin|>""" Example generation for the scikit learn Generate the rst files for the examples by iterating over the python example files. Files that generate images should start with 'plot' """ from __future__ import division, print_function from time import time import ast...
unsorted = unsorted.astype(np.object) for count, exmpl in enumerate(new_list): docstr_lines, total_lines = extract_line_count(exmpl, target_dir) unsorted[count][1] = total_lines - docstr_lines
<|file_name|>TAnimateColor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import string import logging<|fim▁hole|>from .HTMLElement import HTMLElement log = logging.getLogger("Thug") class TAnimateColor(HTMLElement): def __init__(self, doc, tag): self.doc = doc self.tag = tag self...
<|file_name|>main.js<|end_file_name|><|fim▁begin|>//{block name="backend/create_backend_order/controller/main"} // Ext.define('Shopware.apps.SwagBackendOrder.controller.Main', { /** * extends from the standard ExtJs Controller */ extend: 'Ext.app.Controller', snippets: { error: { ...
var valueField = columns[6].valueField; var displayField = columns[6].displayField;
<|file_name|>executor_test.go<|end_file_name|><|fim▁begin|>package gb import ( "errors" "fmt" "io" "path/filepath" "reflect" "testing" ) func TestExecuteBuildAction(t *testing.T) { tests := []struct { pkg string err error }{{ pkg: "a", err: nil, }, { pkg: "b", // actually command err: nil, }, { ...
<|file_name|>get_universe_planets_planet_id_position.go<|end_file_name|><|fim▁begin|>/* * EVE Swagger Interface * * An OpenAPI for EVE Online * * OpenAPI spec version: 0.5.5 * * Generated by: https://github.com/swagger-api/swagger-codegen.git * * Licensed under the Apache License, Version 2.0 (the "License"); ...
package esi
<|file_name|>test_comb_factorials.py<|end_file_name|><|fim▁begin|>from sympy import (Symbol, symbols, factorial, factorial2, binomial, rf, ff, gamma, polygamma, EulerGamma, O, pi, nan, oo, simplify, expand_func) from sympy.functions.combinatorial.factorials import subfactorial from...
<|file_name|>js_epbrEI_0goJi4R57mtzv1h04XFGpS-jRxZzMGykmego.js<|end_file_name|><|fim▁begin|>(function ($) { /** * Drag and drop table rows with field manipulation. * * Using the drupal_add_tabledrag() function, any table with weights or parent * relationships may be made into draggable tables. Columns containing a...
$('.tabledrag-toggle-weight').text(Drupal.t('Show row weights'));
<|file_name|>test_script_optimizer2.py<|end_file_name|><|fim▁begin|>from FireGirlOptimizer import * FGPO = FireGirlPolicyOptimizer() ###To create, uncomment the following two lines: FGPO.createFireGirlPathways(10,50) #FGPO.saveFireGirlPathways("FG_pathways_20x50.fgl") <|fim▁hole|> #Setting Flags FGPO.NORMALIZED_WEIGHT...
###To load (already created data), uncomment the following line #FGPO.loadFireGirlPathways("FG_pathways_20x50.fgl")
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
package net.sf.esfinge.metadata.validate.minValue;
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url <|fim▁hole|>urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^list/$', views.list, name='list'), url(r'^search/$', views.search, name='search'), url(r'^add/$', views.add, name='add'), url(r'^restaurant/(?P...
from . import views
<|file_name|>line.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 The CGMath Developers. For a full listing of the authors, // refer to the Cargo.toml file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in...
// collinear, intersection is line dest
<|file_name|>util.js<|end_file_name|><|fim▁begin|>"use strict"; var GLOBAL_MOUNT_POINT_MAX = Math.pow(2, 53); var util = { uuid: function(){ return Math.ceil(Math.random() * GLOBAL_MOUNT_POINT_MAX); } }; <|fim▁hole|>module.exports = util;<|fim▁end|>
<|file_name|>plugin.js<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2013, Yahoo! Inc. All rights reserved. * Copyrights licensed under the New BSD License. * See the accompanying LICENSE.txt file for terms. */ /*jslint nomen:true, node:true */ 'use strict'; var core = require('./core'); module.exports = { ...
// trying to write the destination file which will fulfill or reject the initial promise api.writeFileInBundle(bundleName, destination_path,
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages import sys, os setup(name='nanoweb', version="1.0", description="The nano web framework", long_description="""\ The nano framework provides some glue for Webob and Routes.""", classifiers=[], ke...
author='Eric Moritz', author_email='eric@themoritzfamily.com', url='https://github.com/ericmoritz/nanoweb/', license='BSD',
<|file_name|>char.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-APACHE or // http://www.apache.org/licenses/L...
<|file_name|>nugetrestore.ts<|end_file_name|><|fim▁begin|>import * as path from "path"; import * as tl from "vsts-task-lib/task"; import {IExecOptions, IExecSyncResult} from "vsts-task-lib/toolrunner"; import * as auth from "packaging-common/nuget/Authentication";<|fim▁hole|>import peParser = require("packaging-common...
import * as commandHelper from "packaging-common/nuget/CommandHelper"; import {NuGetConfigHelper2} from "packaging-common/nuget/NuGetConfigHelper2"; import * as ngToolRunner from "packaging-common/nuget/NuGetToolRunner2";
<|file_name|>product.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2017 Houssine BAKKALI - Coop IT Easy # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import fields, models class ProductTemplate(models.Model): _inherit = "product.template" <|fim▁hole|><|fi...
default_code = fields.Char(related='product_variant_ids.default_code', string='Internal Reference', store=True)
<|file_name|>views.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.http import HttpResponsePermanentRedirect from django.conf import settings from django.core.urlresolvers import reverse from readthedocs.builds.models import Build, Version from readthedocs.builds.filters import BuildFilter from readthedocs.pro...
import logging from django.shortcuts import get_object_or_404 from django.views.generic import ListView, DetailView
<|file_name|>List.react.js<|end_file_name|><|fim▁begin|><|fim▁hole|> render: function() { var listItems = []; _.each(this.props.value, function(data, index) { listItems.push(<li>{JSON.stringify(data)}</li>); }); return ( <div> <strong>{this.pr...
var React = require('react'); var _ = require('underscore'); var List = React.createClass({
<|file_name|>comb_sort.py<|end_file_name|><|fim▁begin|>""" This is pure Python implementation of comb sort algorithm. Comb sort is a relatively simple sorting algorithm originally designed by Wlodzimierz Dobosiewicz in 1980. It was rediscovered by Stephen Lacey and Richard Box in 1991. Comb sort improves on bubble sor...
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># Django from administrator.models import Administrator # local Django from django.contrib import admin<|fim▁hole|> class AdministratorAdmin(admin.ModelAdmin): pass admin.site.register(Administrator, AdministratorAdmin)<|fim▁end|>
<|file_name|>encoder.go<|end_file_name|><|fim▁begin|>package encoding import ( "bytes" "encoding/binary" "errors" "fmt" "io" "math" "github.com/SermoDigital/golang-neo4j-bolt-driver/structures" ) const ( // NilMarker represents the encoding marker byte for a nil object NilMarker = 0xC0 // TrueMarker repre...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: UTF-8 -*- # (c) 2014 Rajat Agarwal import os, sys import unittest import sqoot if 'PUBLIC_API_KEY' in os.environ and 'PRIVATE_API_KEY' in os.environ: PUBLIC_API_KEY = os.environ['PUBLIC_API_KEY'] PRIVATE_API_KEY = os.en...
<|file_name|>job.go<|end_file_name|><|fim▁begin|>package module import ( "bufio" "encoding/base64" "encoding/json" "errors" "fmt" "io" "io/ioutil" "net/http" "net/url" "strings" "sync" "time" . "github.com/logrusorgru/aurora" homeDir "github.com/mitchellh/go-homedir" apiv1 "k8s.io/api/core/v1" "k8s.io...
Name: randomContainerName, },
<|file_name|>setup.rs<|end_file_name|><|fim▁begin|>// This file is part of rust-web/twig // // For the copyright and license information, please view the LICENSE // file that was distributed with this source code. //! Stores the Twig configuration. use std::path::Path; use std::rc::Rc; use extension; use extension::a...
#[derive(Debug)]
<|file_name|>tensor_array_grad.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www...
<|file_name|>filter.py<|end_file_name|><|fim▁begin|># This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it wil...
<|file_name|>test_blasdot.py<|end_file_name|><|fim▁begin|>from __future__ import division, absolute_import, print_function import sys from itertools import product import numpy as np from numpy.core import zeros, float64 from numpy.testing import dec, TestCase, assert_almost_equal, assert_, \ assert_raises, asse...
r = np.empty((1024, 32), dtype=np.float32)
<|file_name|>computechecksums.py<|end_file_name|><|fim▁begin|>from nbgrader import utils from nbgrader.preprocessors import NbGraderPreprocessor<|fim▁hole|> class ComputeChecksums(NbGraderPreprocessor): """A preprocessor to compute checksums of grade cells.""" def preprocess_cell(self, cell, resources, cell_in...
<|file_name|>step_3_complete.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import csv import json import requests def main(): # We'll use a local version of this file from now on to save on # bandwith. with open('bills.json', 'r') as f: data = json.load(f) objects = data['objects'...
<|file_name|>extension.py<|end_file_name|><|fim▁begin|>""" the flask extension """ import warnings from functools import wraps import logging from flask import request, current_app, g, Blueprint from werkzeug.http import http_date from limits.errors import ConfigurationError from limits.storage import storage_from_st...
<|file_name|>lesson2-2.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- """ Домашнее задание по уроку 2-2 «Работа с разными форматами данных» Выполнил Мартысюк Илья PY-3 """ import re import glob import chardet from os.path import join from xml.etree.cElementTree import XMLParser, parse def open_data_file(pat...
<|file_name|>dns-controller.js<|end_file_name|><|fim▁begin|>angular.module('dnsControllers', ['dnsServices', 'dnsModels']) .controller('dnsCtrl', function($scope, $location, socket, Hosts, Zone) { $scope.dns = { zone : Zone.get(), hosts : Hosts.list() }; socket.on('new:host', fu...
for (var i = 0 ; i < $scope.dns.hosts.records.length ; ++i) { if ($scope.dns.hosts.records[i].name === host.name) { found = true;
<|file_name|>nl.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.lang['nl'] = { "editor": "Tekstverwerker", "editorPanel": "Tekstverwerker beheerpaneel", "common": { ...
"windowMode": "Venster modus", "windowModeOpaque": "Ondoorzichtig", "windowModeTransparent": "Doorzichtig",
<|file_name|>lmmanalysisave_septcut4and2ifsame.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os,sys,glob,re import numpy as np import scipy from scipy import stats import datetime import time from datetime import timedelta #import matplotlib #matplotlib.use('Agg') #import matplotlib.pyplot as plt #from matpl...
# or section = adaytappostbdaytappre102 if k.startswith("ratio"): continue section = k.split('.')[0].split('_')[-1]
<|file_name|>control.component.ts<|end_file_name|><|fim▁begin|>import { Component, ElementRef, ChangeDetectionStrategy, ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core'; import { Control } from 'ol/control'; import { MapComponent } from './map.component'; @Component({ selector: 'ol-map > ol-control', ...
} ngOnInit() {
<|file_name|>20170106.py<|end_file_name|><|fim▁begin|>a = "python" print(a*2) try: print(a[-10]) except IndexError as e: print("인덱스 범위를 초과 했습니다.") print(e) print(a[0:4]) print(a[1:-2]) # -10은 hi뒤로 10칸 print("%-10sjane." % "hi") b = "Python is best choice." print(b.find("b")) print(b.find("B")) try: ...
<|file_name|>Q424.py<|end_file_name|><|fim▁begin|>a=['999','1'] max_length=len(max(a,key=len)) tem=0 carry=0 for i in xrange(len(a)): while len(a[i])<max_length: a[i]='0'+a[i] for x in xrange(len(a)):<|fim▁hole|> a[x]=a[x][::-1] out='' for x in xrange(max_length): for i in a: tem+=int(i[x]) print(i[x],carry)...
<|file_name|>textattributes.rs<|end_file_name|><|fim▁begin|>// This file is part of rgtk. // // rgtk is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by<|fim▁hole|>// // rgtk is distributed in the hope that it will be useful, // but WITH...
// the Free Software Foundation, either version 3 of the License, or // (at your option) any later version.
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var path = require('path'); var async = require('async'); module.exports = function(content) { var cb = this.async(); var json = JSON.parse(content); async.mapSeries( json.imports, function(url, callback) { this.loadModule(url, function(err, source, map, modu...
callback(null, this.exec(source, url)); }.bind(this)) }.bind(this), function(err, results) {
<|file_name|>demo_CH_coords.py<|end_file_name|><|fim▁begin|>#------------------------------------------------------------------------------<|fim▁hole|># # Created: 1/01/2019 # Copyright: (c) ProjectChrono 2019 #------------------------------------------------------------------------------ print ("First tutorial ...
# Name: pychrono example # Purpose: # # Author: Alessandro Tasora
<|file_name|>ssupplier.js<|end_file_name|><|fim▁begin|>/** * Copyright (C) 2013 Emay Komarudin * 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 * (at you...
**/
<|file_name|>alert.js<|end_file_name|><|fim▁begin|>angular.module('ui.bootstrap.alert', []) .controller('UibAlertController', ['$scope', '$attrs', '$timeout', function($scope, $attrs, $timeout) { $scope.closeable = !!$attrs.close; if (angular.isDefined($attrs.dismissOnTimeout)) { $timeout(function() { $...
return { controller: 'UibAlertController', controllerAs: 'alert', templateUrl: function(element, attrs) {
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React, {Component, PropTypes} from 'react' import style from './style.js' import ErrorStackParser from 'error-stack-parser' import assign from 'object-assign' import {isFilenameAbsolute, makeUrl, makeLinkText} from './lib' export default class RedBox extends Co...
</div> ) })
<|file_name|>a301_readfile.py<|end_file_name|><|fim▁begin|>""" download a file named filename from the atsc301 downloads directory and save it as a local file with the same name. command line example:: python -m a301utils.a301_readfile photon_data.csv module example:: from a301utils.a301_readfile im...
filepath = Path('./{}'.format(filename)) if filepath.exists():
<|file_name|>list-nodes.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # LIST NODES PY # Extract just the nodes from the JSON file for human inspection import argparse, json parser = argparse.ArgumentParser() parser.add_argument('plan', type=str, help='Plan data file') args = parser.parse_args() <|fim▁hole|> ...
try: with open(args.plan) as fp:
<|file_name|>test_integration_tester.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # encoding: utf-8 """ Functional tests of the RabbitMQ Workers """ import mock import json import unittest import ADSDeploy.app as app from ADSDeploy.pipeline.workers import IntegrationTestWorker, \ DatabaseWriterWorker fr...
<|file_name|>ss_3par_cpg.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Copyright: (c) 2018, Hewlett Packard Enterprise Development LP # 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 __metaclass__ = ty...
description: - Specifies the set size in the number of chunklets.
<|file_name|>enable_feature_flag_test.go<|end_file_name|><|fim▁begin|>package featureflag_test import ( "errors" fakeflag "github.com/cloudfoundry/cli/cf/api/feature_flags/fakes" "github.com/cloudfoundry/cli/cf/command_registry" "github.com/cloudfoundry/cli/cf/configuration/core_config" testcmd "github.com/cloud...
}) It("Sets the flag", func() {
<|file_name|>BaseModels.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ''' Created on Mar 12, 2012 @author: moloch Copyright 2012 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the Lice...
<|file_name|>cast_sign_loss.rs<|end_file_name|><|fim▁begin|>use clippy_utils::consts::{constant, Constant}; use clippy_utils::diagnostics::span_lint; use clippy_utils::{method_chain_args, sext}; use if_chain::if_chain; use rustc_hir::{Expr, ExprKind}; use rustc_lint::LateContext; use rustc_middle::ty::{self, Ty}; use ...
<|file_name|>collections.py<|end_file_name|><|fim▁begin|>from pypom import Region from selenium.webdriver.common.by import By<|fim▁hole|> class Collections(Base): """Collections page.""" _item_locator = (By.CSS_SELECTOR, '.item') def wait_for_page_to_load(self): self.wait.until(lambda _: len(self....
from base import Base
<|file_name|>CheckCards.tsx<|end_file_name|><|fim▁begin|>//Libraries import React, {FunctionComponent} from 'react' //Components import CheckCard from 'src/alerting/components/CheckCard' import FilterList from 'src/shared/components/Filter' import { EmptyState, ResourceList, Panel, Gradients, Button, IconF...
} > {cards(filtered)}
<|file_name|>_fetch_new_rt_data.py<|end_file_name|><|fim▁begin|>import json import os import time from rottentomatoes import RT BOX_OFFICE_COUNTRIES = [ "us", "in", "uk", "nl", ] LIMIT = 50 # max allowed by rotten tomatoes OUTPUT_FILE = "download/more_movies.json" def main(): ...
result = { "total": total, "movies": movies,
<|file_name|>issue-2063-resource.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT.<|fim▁hole|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT...
// // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or