prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>CredentialsCode.java<|end_file_name|><|fim▁begin|>package com.thilko.springdoc; @SuppressWarnings("all") public class CredentialsCode { Integer age; double anotherValue; public Integer getAge() { return age; } public void setAge(Integer age) {<|fim▁hole|> public double get...
this.age = age; }
<|file_name|>coderunner.py<|end_file_name|><|fim▁begin|>import code import signal import sys import greenlet import logging class SigintHappened(object): pass class SystemExitFromCodeThread(SystemExit): pass class CodeRunner(object): """Runs user code in an interpreter, taking care of stdout/in/err""" ...
self.interp = interp or code.InteractiveInterpreter() self.source = None
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/env/bin/ python3 from setuptools import setup, Extension # #CXX_FLAGS = "-O3 -std=gnu++11 -Wall -Wno-comment" # ## List of C/C++ sources that will conform the library #sources = [ # # "andrnx/clib/android.c", # #]<|fim▁hole|>setup(name="andrnx", versi...
<|file_name|>synth.rs<|end_file_name|><|fim▁begin|>use audiobuffer::*; use processblock::ProcessBlock; use port::Port; use jack::prelude::RawMidi; use synthconfig::SynthConfig; #[derive(Debug, Clone, Copy)] pub struct BlockId(usize); #[derive(Debug, Clone)] pub struct Connection{ buffer_id: usize, block: Bloc...
}
<|file_name|>macroJs.test.ts<|end_file_name|><|fim▁begin|>import { parseExpression } from "@babel/parser" import * as types from "@babel/types" import MacroJs from "./macroJs" function createMacro() { return new MacroJs({ types }, { i18nImportName: "i18n" }) } describe("js macro", () => { describe("tokenizeTempla...
type: "text", value: "Message ", },
<|file_name|>DomElementAnnotationHolder.java<|end_file_name|><|fim▁begin|>/* * Copyright 2000-2009 JetBrains s.r.o. * * 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.apach...
<|file_name|>SampleScript.py<|end_file_name|><|fim▁begin|># oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. # Copyright (c) 2016, Gluu # # Author: Yuriy Movchan # from org.gluu.model.custom.script.type.user import CacheRefreshType from org.gluu.util import String...
<|file_name|>randomplayer.cpp<|end_file_name|><|fim▁begin|>#include "randomplayer.h" #include <QDirIterator> void RandomPlayer::start() { this->setMedia(QUrl::fromLocalFile(fileList.takeFirst())); this->play(); this->_readyToPlay = true; } void RandomPlayer::quitPlayMode() { this->_readyToPlay = false...
}
<|file_name|>version.py<|end_file_name|><|fim▁begin|><|fim▁hole|># 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 or agreed to in writing, software # distributed u...
# Copyright 2014, Doug Wiegley, A10 Networks. # # Licensed under the Apache License, Version 2.0 (the "License"); you may
<|file_name|>teams.client.controller.js<|end_file_name|><|fim▁begin|>'use strict'; // Teams controller angular.module('teams').controller('TeamsController', ['$scope', '$stateParams', '$location', 'Authentication', 'Teams', 'Players', '$filter', function($scope, $stateParams, $location, Authentication, Teams, Players...
// Redirect after save team.$save(function(response) {
<|file_name|>PermitSearchResultsAddresses.js<|end_file_name|><|fim▁begin|>import React from 'react';<|fim▁hole|> if (props.data === null) { return <p>No results found</p>; } if (!props.data.length) { return <p>No results found</p>; } const addressList = props.data.map((result, index) => { const ...
import PermitSearchResultsByAddress from './PermitSearchResultsByAddress' function PermitSearchResultsAddress(props) {
<|file_name|>SiteUtils.java<|end_file_name|><|fim▁begin|>package com.example.stackexchange.util; import java.nio.file.Path; import java.nio.file.Paths; public class SiteUtils { private static String siteName; public static String getSiteName(String dir) { if (siteName == null) { Path path = Paths.get(dir); ...
} public static void setSiteName(String siteName) { SiteUtils.siteName = siteName;
<|file_name|>VasyaAndPetyasGame.cpp<|end_file_name|><|fim▁begin|>#include <bits/stdc++.h> #define EL cerr << endl; #define DB(x) cerr << "#" << (#x) << ": " << (x) << " "; #define DEB(x) cerr << "#" << (#x) << ": " << (x) << endl; #define PR(x) cout << (x) << endl #define X first #define Y second #define PB push_back ...
<|file_name|>0017_comment.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('website', '0016_auto_20151128_2006'), ] operations = [ migrations....
], ), ]
<|file_name|>norace.go<|end_file_name|><|fim▁begin|><|fim▁hole|> //go:build !race // +build !race package testutil const RaceEnabled = false<|fim▁end|>
// Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
<|file_name|>test.array.js<|end_file_name|><|fim▁begin|>/* global describe, it, require */<|fim▁hole|>// MODULES // var // Expectation library: chai = require( 'chai' ), // Deep close to: deepCloseTo = require( './utils/deepcloseto.js' ), // Module to be tested: log10 = require( './../lib/array.js' ); // VARI...
'use strict';
<|file_name|>DocumentationNestedScrollLayout.tsx<|end_file_name|><|fim▁begin|>// NOTE(jim): // GETTING NESTED SCROLL RIGHT IS DELICATE BUSINESS. THEREFORE THIS COMPONENT // IS THE ONLY PLACE WHERE SCROLL CODE SHOULD BE HANDLED. THANKS. import { Global, css } from '@emotion/core'; import { theme } from '@expo/styleguide...
overflow: auto; }
<|file_name|>no-unexpected-multiline.js<|end_file_name|><|fim▁begin|>/** * @fileoverview Rule to spot scenarios where a newline looks like it is ending a statement, but is not. * @author Glen Mailer * @copyright 2015 Glen Mailer<|fim▁hole|>//---------------------------------------------------------------------------...
*/ "use strict";
<|file_name|>layout.module.js<|end_file_name|><|fim▁begin|><|fim▁hole|> .module('brew_journal.layout', [ 'brew_journal.layout.controllers' ]); angular .module('brew_journal.layout.controllers', []); })();<|fim▁end|>
(function () { 'use strict'; angular
<|file_name|>gdrive.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the Google Drive database plugin.""" from __future__ import unicode_literals import unittest from plaso.formatters import gdrive as _ # pylint: disable=unused-import from plaso.lib import definitions from...
unittest.main()
<|file_name|>mir_codegen_switch.rs<|end_file_name|><|fim▁begin|>// run-pass enum Abc { A(u8), B(i8), C, D, }<|fim▁hole|> Abc::D => 4, Abc::B(_) => 2, Abc::A(_) => 1, } } fn foo2(x: Abc) -> bool { match x { Abc::D => true, _ => false } } fn main() { ...
fn foo(x: Abc) -> i32 { match x { Abc::C => 3,
<|file_name|>reforms.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """Reforms controller""" import collections from .. import contexts, conv, model, wsgihelpers @wsgihelpers.wsgify def api1_reforms(req): ctx = contexts.Ctx(req) headers = wsgihelpers.handle_cross_origin_resource_sharing(ctx) ...
method = req.script_name, params = inputs, reforms = reforms,
<|file_name|>clear.js<|end_file_name|><|fim▁begin|>'use strict'; const test = require('ava'); const hashSet = require('../index'); const MySet = hashSet(x => x); test('should not change empty set', t => { const set = new MySet(); set.clear(); t.is(set.size, 0); }); <|fim▁hole|> set.clear(); t.i...
test('should clear set', t => { const set = new MySet(); set.add(1);
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // // Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0 // Changes may cause incorrec...
* Test Infrastructure for AutoRest.
<|file_name|>argumentToUnnamedParameter.py<|end_file_name|><|fim▁begin|>from typing import NewType SomeType = NewType("SomeType", bytes)<|fim▁hole|><|fim▁end|>
SomeType(b"va<caret>lue")
<|file_name|>test_repositories.py<|end_file_name|><|fim▁begin|>import pytest from cfme.infrastructure import repositories from utils.update import update from utils.wait import TimedOutError, wait_for @pytest.mark.tier(2) @pytest.mark.meta(blockers=[1188427]) def test_repository_crud(soft_assert, random_string, requ...
repo.name = repo_name # delete
<|file_name|>demand.py<|end_file_name|><|fim▁begin|># coding: utf-8 from sqlalchemy import Column, Float, Integer, Numeric, String, Table, Text from geoalchemy2.types import Geometry from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() metadata = Base.metadata class EgoDemandFederalstate...
geom_surfacepoint = Column(Geometry('POINT', 3035)) geom_centre = Column(Geometry('POINT', 3035)) geom = Column(Geometry('POLYGON', 3035), index=True)
<|file_name|>webgluniformlocation.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/. */ <|fim▁hole|>use dom::bindings::global::GlobalRef;...
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl use dom::bindings::codegen::Bindings::WebGLUniformLocationBinding;
<|file_name|>throwIfNonUnexpectedError.js<|end_file_name|><|fim▁begin|>module.exports = function throwIfNonUnexpectedError(err) { if (err && err.message === 'aggregate error') {<|fim▁hole|> throw err; } };<|fim▁end|>
for (var i = 0 ; i < err.length ; i += 1) { throwIfNonUnexpectedError(err[i]); } } else if (!err || !err._isUnexpected) {
<|file_name|>errors.go<|end_file_name|><|fim▁begin|>package iternada <|fim▁hole|>import ( "errors" ) var ( errNilReceiver = errors.New("Nil Receiver") )<|fim▁end|>
<|file_name|>ex_synchronize.py<|end_file_name|><|fim▁begin|># # A test file for the `processing` package # import time, sys, random from Queue import Empty import processing # may get overwritten #### TEST_VALUE def value_func(running, mutex): random.seed() time.sleep(random.ran...
except Empty:
<|file_name|>util.js<|end_file_name|><|fim▁begin|>'use strict'; // 頑シミュさんの装飾品検索の結果と比較しやすくする function simplifyDecombs(decombs) { return decombs.map(decomb => { let torsoUp = Object.keys(decomb).map(part => decomb[part]).some(comb => { if (comb == null) return false; return comb.skill...
let decos = comb ? comb.decos : []; if (torsoUp && part === 'body') decos = decos.map(deco => deco += '(胴)'); names = names.concat(decos); });
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup setup( name = "smbios_validation_tool", author = "Xu Han", author_email = "", license = "Apache", url = "https://github.com/google/smbios-validation-tool",<|fim▁hole|>)<|fim▁end|>
packages=['smbios_validation_tool', 'dmiparse'], scripts=['smbios_validation'],
<|file_name|>osutil.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import collections import logging import os import platform import re import subprocess import types import util import json from ebstall.versions import Version from ebstall.util imp...
<|file_name|>err.rs<|end_file_name|><|fim▁begin|>use sys; pub struct Error { priv n:int } pub enum ErrorResult<T> { Ok(T), Err(Error) } impl Error { #[inline(always)] pub fn is_err(&self) -> bool { self.n != 0 } #[inline(always)] pub fn msg(&self) -> &'static str { ms...
"Exchange full", "No anode", "Invalid request code",
<|file_name|>analysis.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Katsuya Noguchi # # 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...
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE.
<|file_name|>convert_gromacs2espp.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (C) 2012,2013,2015(H),2016 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. #...
fout.close() def _args():
<|file_name|>GridStoreAdapter.js<|end_file_name|><|fim▁begin|>/** GridStoreAdapter Stores files in Mongo using GridStore Requires the database adapter to be based on mongoclient @flow weak */ import { MongoClient, GridStore, Db} from 'mongodb'; import { FilesAdapter } from './FilesAdapter'; import d...
export default GridStoreAdapter;
<|file_name|>jsonfeedparser.ts<|end_file_name|><|fim▁begin|>import { Writable } from 'stream'; import { default as clarinet } from 'clarinet'; import { Parser, Feed } from './parser'; type JSONValue = string | boolean | null; type JSONObject = { [key: string]: JSONValue | JSONObject | JSONObject[]; } type JSONArray...
if (obj.$t !== undefined) {
<|file_name|>lint-missing-doc.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 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.or...
pub fn baz() {}
<|file_name|>rainbow_random_circles.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2 from pypixel import *<|fim▁hole|> h = 0 while True: x = random(WIDTH) y = random(HEIGHT) r = random(50, 100) h += 1 h %= 360 s = 100 v = 100 c = hsv2rgb((h, s, v)) circle(c, (x, y), r) u...
show()
<|file_name|>answerer.py<|end_file_name|><|fim▁begin|>from sys import version_info from functools import reduce from operator import mul from flask_babel import gettext if version_info[0] == 3: unicode = str keywords = ('min', 'max', 'avg', 'sum', 'prod') # requi...
# returns information about the answerer def self_info(): return {'name': gettext('Statistics functions'),
<|file_name|>simple.js<|end_file_name|><|fim▁begin|>import Ember from 'ember'; import ColumnDefinition from 'ember-table/models/column-definition'; export default Ember.Controller.extend({ tableColumns: Ember.computed(function() { var dateColumn = ColumnDefinition.create({ savedWidth: 150, textAlign:...
headerCellName: 'Low', getCellContent: function(row) { return row.get('low').toFixed(2); }
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). // Licensed under the Apache License, Version 2.0 (see LICENSE). mod hash; pub use hash::Fingerprint; mod snapshot; pub use snapshot::{GetFileDigest, Snapshot}; mod store; pub use store::{Digest, Store}...
<|file_name|>CreateConstructorRequest.java<|end_file_name|><|fim▁begin|>// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.lang.jvm.actions; public interface CreateConstructorRequest extends CreateExecutableR...
}
<|file_name|>event.rs<|end_file_name|><|fim▁begin|>/* TOOD: Implement for other kqueue based systems */ use {Errno, Result}; #[cfg(not(target_os = "netbsd"))] use libc::{timespec, time_t, c_int, c_long, intptr_t, uintptr_t}; #[cfg(target_os = "netbsd")] use libc::{timespec, time_t, c_long, intptr_t, uintptr_t, size_t...
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 Agile Business Group sagl # (<http://www.agilebg.com>) # # This program is free software: you can redistribute it and/or modify ...
<|file_name|>qgsgeometry.cpp<|end_file_name|><|fim▁begin|>/*************************************************************************** qgsgeometry.cpp - Geometry (stored as Open Geospatial Consortium WKB) ------------------------------------------------------------------- Date : 02 May 2005 Copyrigh...
}
<|file_name|>account_reconcile.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can r...
""" It opens the write off wizard form, in that user can define the journal, account, analytic account for reconcile
<|file_name|>background.tsx<|end_file_name|><|fim▁begin|><|fim▁hole|> const fragShader = ` precision mediump; `; class Background extends React.Component<any, any> { } export { Background };<|fim▁end|>
import * as React from 'react';
<|file_name|>pygame.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: UTF-8 -*- from __future__ import absolute_import from __future__ import with_statement from __future__ import division from __future__ import print_function ''' Collected utilities for pygame It is difficult to write pixels directly i...
numpy_surface[...] = np.frombuffer(draw)
<|file_name|>slice-2.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/license...
let x = Foo; x[]; //~ ERROR cannot take a slice of a value with type `Foo` x[Foo..]; //~ ERROR cannot take a slice of a value with type `Foo`
<|file_name|>dev_runner.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # 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://ww...
"""Starts all the components then logs stderr to the console forever.
<|file_name|>planets4.py<|end_file_name|><|fim▁begin|>f = open("data/planetsc.txt", "r") earth = 0 for line in f: planet = line.strip().lower() if planet[0] == "#": continue earth += 1 if planet == "earth":<|fim▁hole|><|fim▁end|>
break print "Earth is planet #%d" % earth
<|file_name|>num.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/LI...
fn digit(&self, x: u8) -> u8;
<|file_name|>derive_object_with_raw_idents.rs<|end_file_name|><|fim▁begin|>use juniper::{ execute, graphql_object, graphql_value, EmptyMutation, EmptySubscription, GraphQLInputObject, RootNode, Value, Variables, }; pub struct Query; #[graphql_object] impl Query { fn r#type(r#fn: MyInputType) -> Vec<String...
println!("Result: {:#?}", result); result
<|file_name|>types.go<|end_file_name|><|fim▁begin|>/* Copyright 2014 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/licenses/L...
type PriorityArgument struct { // The priority function that ensures a good spread (anti-affinity) for pods belonging to a service // It uses a label to identify nodes that belong to the same "group" ServiceAntiAffinity *ServiceAntiAffinity `json:"serviceAntiAffinity"`
<|file_name|>test_feedexport.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import import os import csv import json from io import BytesIO import tempfile import shutil from six.moves.urllib.parse import urlparse from zope.interface.verify import verifyObject from twisted.trial import unittest from tw...
data = yield self.run_and_export(TestSpider, settings)
<|file_name|>HttpError.spec.js<|end_file_name|><|fim▁begin|>const describe = require("mocha").describe; const it = require("mocha").it; const assert = require("chai").assert; const HttpError = require("./HttpError"); describe("HttpError", function () { it("should be instance of Error", function () { const testSu...
assert.isOk(testSubject instanceof Error);
<|file_name|>abortable.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use super::assert_stream; use crate::stream::{AbortHandle, Abortable}; use crate::Stream; /// Creates a new `Abortable` stream and an `AbortHandle` which can be used to stop it. /// /// This function is a convenient (but less flexible) alternative to c...
<|file_name|>phone.spec.ts<|end_file_name|><|fim▁begin|>describe('validation phone', function () { var $scope, $compile, element; beforeEach(angular.mock.module('dd.ui.validation.phone')); beforeEach(inject(function ($rootScope, _$compile_) { $scope = $rootScope; $compile = _$compile_; })); ...
$scope.phone = ''; $scope.$digest();
<|file_name|>meta.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- class AutocompleteMeta: """ Simple meta class to allow the model to define aspects of the autocomplete. :var name: used for the named url<|fim▁hole|> * if ``permissions`` ``False`` (default) no authentication is checked. * ...
:var path: the path to autocomplete view :var follow_fks: when searching should ForeignKey fields be followed. :var fields: list of fields, if empty then all searchable fields are used :var permissions: bool, string or iter
<|file_name|>tasks.go<|end_file_name|><|fim▁begin|>package store import ( "strconv" "strings" "github.com/docker/swarmkit/api" "github.com/docker/swarmkit/api/naming" "github.com/docker/swarmkit/manager/state" memdb "github.com/hashicorp/go-memdb" ) const tableTask = "task" func init() { register(ObjectStore...
sa.Target = &api.StoreAction_Task{ Task: v.Task, }
<|file_name|>conv_test.go<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
package conv
<|file_name|>daemon.py<|end_file_name|><|fim▁begin|># -*- encoding: utf8 -*- # A daemon to keep SSH forwarding connected from __future__ import print_function, absolute_import import os<|fim▁hole|>import logging class Daemon(object): def __init__(self): self.heartbeat = 50 def run(self): log...
import sys import time import socket
<|file_name|>rand_augment.py<|end_file_name|><|fim▁begin|># Copyright 2019 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # U...
return tf.convert_to_tensor(self.level) if self.num_levels is None: return tf.random.uniform(shape=[], dtype=tf.float32) else:
<|file_name|>get_bom_grid.py<|end_file_name|><|fim▁begin|># Fetch BoM gridded files from the Bureau server. import sys from datetime import datetime import calendar import subprocess import os.path R = 'http://www.bom.gov.au/web03/ncc/www/awap' WGET = '/usr/bin/wget' <|fim▁hole|>vars = { 'rain/day' : R+'/rainfall/t...
# Append yyyymmddyyyymmdd.grid.Z to these URLs to get the file
<|file_name|>search_result.go<|end_file_name|><|fim▁begin|>package main import ( "fmt" "sort" ) // I haven't included fields I don't think are relevant in these Structs, even though // they might be part of the data GNIP store in the Archive. // This is mostly a Twitter tweet but includes some more information like...
}
<|file_name|>demo.js<|end_file_name|><|fim▁begin|>module.exports = function(locker) { /* locker.add(function(callback) { //Return content in format: callback({ name: "Vehicle Speed", type: "metric", content: { ...
},
<|file_name|>market_sim.py<|end_file_name|><|fim▁begin|>import datetime as dt import numpy as np import pandas as pd # QSTK Imports import QSTK.qstkutil.DataAccess as da import QSTK.qstkutil.qsdateutil as du def get_orders_list(s_file_path): l_columns = ["year", "month", "day", "sym", "type", "num"] df_orders...
df_orders = df_orders.sort() dt_start = df_orders.ix[0].name dt_end = df_orders.ix[-1].name
<|file_name|>ember-cli-build.js<|end_file_name|><|fim▁begin|>/* eslint-env node */ 'use strict'; const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); module.exports = function(defaults) { let app = new EmberAddon(defaults, { 'ember-cli-babel': { includePolyfill: true }<|fim▁hole|> app.i...
});
<|file_name|>storedPixelDataToCanvasImageDataRGBA.js<|end_file_name|><|fim▁begin|>import now from './now.js'; /**<|fim▁hole|> * @param {Image} image A Cornerstone Image Object * @param {Array} lut Lookup table array * @param {Uint8ClampedArray} canvasImageDataData canvasImageData.data buffer filled with white pixels...
* This function transforms stored pixel values into a canvas image data buffer * by using a LUT. *
<|file_name|>OAuthRequest.java<|end_file_name|><|fim▁begin|>package org.jinstagram.auth.model; import org.jinstagram.http.Request; import org.jinstagram.http.Verbs; import java.util.HashMap; import java.util.Map; /** * The representation of an OAuth HttpRequest. * * Adds OAuth-related functionality to the {@link...
*/ public void addOAuthParameter(String key, String value) { oauthParameters.put(checkKey(key), value);
<|file_name|>app.routes.ts<|end_file_name|><|fim▁begin|>// ====== ./app/app.routes.ts ====== // Imports import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { ActivationComponent } from './user/activation/activation.component'; import { AdminComponent } f...
import { SigninComponent } from './user/signin/signin.component'; import { PageNotFoundComponent } from './pageNotFound/pageNotFound.component';
<|file_name|>sender_test.go<|end_file_name|><|fim▁begin|>package channels<|fim▁hole|> import "testing" import "time" func TestSender(t *testing.T) { type args struct { ch chan string done chan bool } tests := []struct { name string args args }{ {"base-case", args{make(chan string, 10), make(chan bool)}...
<|file_name|>qa_config.py<|end_file_name|><|fim▁begin|># # # Copyright (C) 2007, 2011 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at you...
<|file_name|>flexuin_fill2.rs<|end_file_name|><|fim▁begin|>grid_pattern = { {0, 0.028, "C", "floatiss_"}, {0.024, 0.040, "B", "floatiss_"}, {0.024, 0.028, "C", "floatiss_"}, {0.024, 0.028, "B", "floatiss_"}, {0.024, 0.028, "C", "floatiss_"}, {0.024, 0.028, "B", "floatiss_"}, {0.024, 0.028, "...
<|file_name|>azure-arm-subscription.ts<|end_file_name|><|fim▁begin|>import tl = require('azure-pipelines-task-lib/task'); import msRestAzure = require('./azure-arm-common'); import azureServiceClientBase = require('./AzureServiceClientBase'); import depolymentsBase = require('./DeploymentsBase'); export class Subscrip...
<|file_name|>secret.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity 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 vers...
inner: H256, } impl fmt::Debug for Secret {
<|file_name|>leaflet.timedimension.player.js<|end_file_name|><|fim▁begin|>/*jshint indent: 4, browser:true*/ /*global L*/ /* * L.TimeDimension.Player */ //'use strict'; L.TimeDimension.Player = (L.Layer || L.Class).extend({ includes: (L.Evented || L.Mixin.Events), initialize: function(options, timeDimensio...
console.log('Buffer is fully loaded!'); this.fire('running'); this._waitingForBuffer = false;
<|file_name|>users.js<|end_file_name|><|fim▁begin|>var express = require('express'); var user = require('../model/user'); var jsonReturn = require('../common/jsonReturn'); var router = express.Router(); /* GET users listing. */ router.get('/', function(req, res, next) { user.getUsers(function(err, rows, fields){ ...
res.json(jsonReturn({ users : rows } )); }) }
<|file_name|>HF_Sim_Book.py<|end_file_name|><|fim▁begin|>''' Created on Sep 15, 2010 @author: duncantait ''' from SimPy.Simulation import * import numpy as np import random import math class G(): #Settings for HF Stations num_channels = 18 num_stations = 10 class Network(): stations = [] cla...
returnInfo = self.responseSize(returnInfo)
<|file_name|>CaseFactorySpec.ts<|end_file_name|><|fim▁begin|>import CaseFactory from 'domains/CaseFactory' import Case from 'domains/Case' import * as assert from 'power-assert' describe("ThenFactory", function() { describe("create", () => { before(() => { this.newCase = CaseFactory.create<number,number>(...
}) describe("createNone", () => {
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate littletest; use littletest::{Runnable, TestResult, TestRunner}; struct TestCase { result: TestResult, } impl TestCase { fn new(result: TestResult) -> TestCase { TestCase { result: result } } } impl Runnable for TestCase { fn run(&...
}
<|file_name|>bitwiseNotOperatorWithEnumType.ts<|end_file_name|><|fim▁begin|>// ~ operator on enum type enum ENUM1 { 1, 2, "" }; // enum type var var ResultIsNumber1 = ~ENUM1; // enum type expressions<|fim▁hole|> // multiple ~ operators var ResultIsNumber4 = ~~~(ENUM1[1] + ENUM1[2]); // miss assignment operators ~EN...
var ResultIsNumber2 = ~ENUM1[1]; var ResultIsNumber3 = ~(ENUM1[1] + ENUM1[2]);
<|file_name|>recorder.py<|end_file_name|><|fim▁begin|>import re import datetime from pymongo import MongoClient from bson import ObjectId from .exception import RecorderException, StructureException __all__ = ['get_database', 'Recorder', 'Structure'] def get_database(db_name, host, port=27017): return MongoClien...
class Meta:
<|file_name|>server.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010-2011 OpenStack, LLC. # Copyright (c) 2008-2011 Gluster, 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 # # ht...
<|file_name|>CalenderUtils.py<|end_file_name|><|fim▁begin|>''' Created on 2016年9月16日 @author: Administrator ''' import calendar #返回year的日历 def getYear(year): return calendar.calendar(year) #返回year-month的日历 def getMonth(year, month): return calendar.month(year, month) #返回某年某月的第一天是星期几(从0开始, 0是星期一,6是星期日)和该月天数 ...
print(getMonth(2016, 10))
<|file_name|>test_region.py<|end_file_name|><|fim▁begin|>import numpy as np import pytest import xarray as xr from aospy import Region from aospy.region import ( _get_land_mask, BoundsRect, ) from aospy.internal_names import ( LAT_STR, LON_STR, SFC_AREA_STR, LAND_MASK_STR ) from aospy.utils imp...
region = Region( name='test',
<|file_name|>add_sponsorship.py<|end_file_name|><|fim▁begin|>__author__ = 'tbri' from openerp import models, fields, api, _ class add_sponsorship_wizard(models.TransientModel): _name = 'add_sponsorship_wizard' def _get_all_children(self): c = [] children = self.env['res.partner'].search([('...
start_date = fields.Date(_('Start date')) end_date = fields.Date(_('End date'))
<|file_name|>WaitForAuthorizationRes.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * The MIT License (MIT) * * Copyright (c) 2015 - 2019 Dr. Marc Mültin (V2G Clarity) * * Permission is hereby granted, free of charge, to any person obtaining a...
V2GMessage v2gMessageRes = (V2GMessage) message; AuthorizationResType authorizationRes = (AuthorizationResType) v2gMessageRes.getBody().getBodyElement().getValue();
<|file_name|>commands.cpp<|end_file_name|><|fim▁begin|>#include "commands.h" Commands* Commands::Instance () { static Commands t; return &t; } Commands::Commands() { settings = Settings::Instance(); critterselection = Critterselection::Instance(); registerCmd("quit", &Commands::quit); registerCmd("decreaseene...
c->commandtype = T_WORLD; c->argtype = A_NOARG; c->worldMember = pt2Func;
<|file_name|>persistent.py<|end_file_name|><|fim▁begin|># 2017 Red Hat Inc. # (c) 2017 Ansible Project # 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__ = type DOCUMENTATION = """ author: Ansibl...
<|file_name|>CheckBox.py<|end_file_name|><|fim▁begin|># Copyright 2006 James Tauber and contributors # # 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<|fim▁hole|># Unless required by applicable...
# # http://www.apache.org/licenses/LICENSE-2.0 #
<|file_name|>interpreter.rs<|end_file_name|><|fim▁begin|>use std::io::{Read, Write}; use state::State; use common::BfResult; use traits::Interpretable; use super::*; impl Interpretable for Program { fn interpret_state<R: Read, W: Write>( &self, mut state: State, mut input: R, mut output: W) -> BfResult<()...
OffsetAddRight(offset) => {
<|file_name|>_sql_virtual_machine_management_client.py<|end_file_name|><|fim▁begin|># coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license in...
**kwargs: Any ) -> Awaitable[AsyncHttpResponse]:
<|file_name|>science_verification.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # ========================================================================== # This script performs the ctools science verification. It creates and # analyses the pull distributions for a variety of spectral and spatial # models. T...
self.append(self.spat_const, 'Test diffuse isotropic model') self.append(self.spat_map, 'Test diffuse map model') self.append(self.spat_map_roi, 'Test diffuse map model (small ROI)') self.append(self.spat_map_nn, 'Test diffuse map model (not normalized and scaled)')
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod bulk; mod client; mod coll; mod connstring; mod crud_spec; mod db;<|fim▁hole|>mod wire_protocol;<|fim▁end|>
mod cursor; mod error; mod gridfs;
<|file_name|>timezones.py<|end_file_name|><|fim▁begin|>import pytz priorities = ('US/Pacific', 'US/Mountain', 'US/Central', 'US/Eastern', 'Brazil/East', 'UTC') all_tz = pytz.all_timezones_set.copy() for priority in priorities: all_tz.remove(priority)<|fim▁hole|>all_tz = sorted(list(all_tz)) all_tz[...
<|file_name|>vpn_validator.py<|end_file_name|><|fim▁begin|># Copyright 2014 Cisco Systems, 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...
for subnet in subnets: