prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>mock_test.go<|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 /...
} resp, err := c.ListJobs(context.Background(), request).Next()
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from django.contrib.auth.models import User from django.utils.html import escape from django.db.models import Q from datetime import date from datetime import datetime from MessagesApp.models import Thread from BlockPages.models import Blo...
#Methods related to notifications def getNotifications(self): """Returns all entries from Notifications table for this user sorted by timestamp"""
<|file_name|>ring.rs<|end_file_name|><|fim▁begin|>use super::util::{CacheKeyPath, ConfigOptCacheKeyPath}; use configopt::ConfigOpt; use structopt::StructOpt; #[derive(ConfigOpt, StructOpt)] #[structopt(no_version)] /// Commands relating to Habitat rings pub enum Ring { Key(Key), } #[derive(Confi...
Generate { /// Ring key name #[structopt(name = "RING")]
<|file_name|>etcd_error.rs<|end_file_name|><|fim▁begin|>use hyper; use std::io; use std::convert::From; use rustc_serialize::json; #[derive(Debug)] pub enum EtcdError { Unsuccessful(hyper::status::StatusCode), HttpError(hyper::error::HttpError), IOError(io::Error), DecodingError(json::DecoderError), JsonPars...
}
<|file_name|>compatibility.ts<|end_file_name|><|fim▁begin|>export const acceptInputDate = checkInputType("date", "not-a-date") export const acceptInputDateTimeLocal = checkInputType("datetime-local", "not-a-datetime") export const acceptInputTime = checkInputType("time", "not-a-time") function checkInputType(type: s...
input.setAttribute('type',type); input.setAttribute('value', invalidValue); return (input.value !== invalidValue); }
<|file_name|>clients$.js<|end_file_name|><|fim▁begin|>const browserSync = require('../../../'); const utils = require('../utils'); const register = require('../../../dist/plugins/clients').ClientEvents.register; const assert = require('chai').assert; describe('Client connection stream', function () { ...
<|file_name|>ChainManager.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. import threading from typing import Optional, Tuple from pyqrllib.pyqrllib import bin2hstr from pyqryptonight...
class ChainManager:
<|file_name|>psar.rs<|end_file_name|><|fim▁begin|>use std::f64::NAN; use error::Err; /// Parabolic SAR /// iaf : increment acceleration factor / starting acceleration. Usually 0.02 /// maxaf : max acceleration factor. Usually 0.2 /// Hypothesis : assuming long for initial conditions /// Formula : pub fn psar(high: &[...
let mut sar; let mut extreme;
<|file_name|>test_vmutilsv2.py<|end_file_name|><|fim▁begin|># Copyright 2014 Cloudbase Solutions Srl # # 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.or...
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations
<|file_name|>GenLayerTropiVoronoiZoom.java<|end_file_name|><|fim▁begin|>package net.tropicraft.world.genlayer; import net.minecraft.world.gen.layer.IntCache; public class GenLayerTropiVoronoiZoom extends GenLayerTropicraft { public enum Mode { CARTESIAN, MANHATTAN; } public Mode zoomMode; public GenLayerT...
int scaledY = y >> 2; int scaledWidth = (width >> 2) + 2; int scaledLength = (length >> 2) + 2; int[] parentValues = this.parent.getInts(scaledX, scaledY, scaledWidth, scaledLength);
<|file_name|>event-type.ts<|end_file_name|><|fim▁begin|>import {WebSocketConnectionState} from 'interface'; export enum EventTypeKey { APP_STATE_UPDATED = 'APP_STATE_UPDATED', LOGIN = 'LOGIN', UNKNOWN_ERROR = 'UNKNOWN_ERROR', WEB_SOCKET_CONNECTION_STATE_CHANGED = 'WEB_SOCKET_CONNECTION_STATE_CHANGED', SOMEON...
}; return event; };
<|file_name|>equals.test.js<|end_file_name|><|fim▁begin|>/* eslint-env mocha */ import { Controller } from '../' import assert from 'assert' import { equals } from './' import { state, props } from '../tags' describe('operator.equals', () => { it('should go down path based on props', () => { let count = 0 co...
foo: 'bar', },
<|file_name|>checkSU.java<|end_file_name|><|fim▁begin|>package com.infamous.performance.activities; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android.os.AsyncTask; import android.os.Bundle; import android.os.SystemClock; import android.preference.Prefe...
private TextView info;
<|file_name|>liveness-or-init.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licens...
// file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. //
<|file_name|>Label.java<|end_file_name|><|fim▁begin|>/** * Copyright 2017 Kaloyan Raev * * This file is part of chitanka4kindle. * * chitanka4kindle 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, eit...
public void setNumberOfTexts(int nrOfTexts) { this.nrOfTexts = nrOfTexts; }
<|file_name|>series_actors.py<|end_file_name|><|fim▁begin|># coding: utf-8 """ Copyright 2015 SmartBear Software 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.apac...
<|file_name|>goto_plugin_cern_hr_documents.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2012 CERN. ## ## Invenio 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 Sof...
return bibrecdocs.get_bibdoc(documents[document]).get_file('.pdf').get_url()
<|file_name|>pppm_omp.cpp<|end_file_name|><|fim▁begin|>/* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sand...
suffix_flag |= Suffix::OMP; } /* ----------------------------------------------------------------------
<|file_name|>preconditions.min.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1<|fim▁hole|><|fim▁end|>
oid sha256:20e35c5c96301564881e3f892b8c5e38c98b131ea58889ed9889b15874e39cbe size 8394
<|file_name|>IsEmptyInterface.spec.ts<|end_file_name|><|fim▁begin|>/** * unit testing for IsEmptyInterface utility type */ import { IsEmptyInterface } from '@material-ui/styles/makeStyles'; // $ExpectType true type EmptyInterfaceIsValid = IsEmptyInterface<{}>; // $ExpectType false type ObjectIsValid = IsEmptyInterf...
<|file_name|>tabmenu.py<|end_file_name|><|fim▁begin|># from pytigon_js.tools import history_push_state, correct_href, remove_element, process_resize # from pytigon_js.ajax_region import mount_html class Page: def __init__(self, id, page): self.id = id self.page = page def set_href(self, href)...
else: self.register(title)
<|file_name|>MBGF.py<|end_file_name|><|fim▁begin|>#!/Library/Frameworks/Python.framework/Versions/3.1/bin/python3 import os, sys sys.path.append(os.getcwd().split('slps')[0]+'slps/shared/python') import slpsns, BGF3 import xml.etree.ElementTree as ET cx = {} class TopModel: def getData(self, id): if id in self.dat...
# <src name="dcg,sdf,rsc">vertical</src> # </top-choice> class TopChoice (SrcSimpleModel): def __init__(self, xml):
<|file_name|>scrape.go<|end_file_name|><|fim▁begin|>package scrape import ( "bytes" "compress/gzip" "context" "encoding/json" "errors" "fmt" "io" "io/ioutil" "net/http" "regexp" "strings" "sync" "time" "github.com/PuerkitoBio/goquery" "github.com/slotix/dataflowkit/errs" "github.com/slotix/dataflowkit...
<|file_name|>eq.rs<|end_file_name|><|fim▁begin|>#![feature(core)] extern crate core; // macro_rules! e { // ($e:expr) => { $e } // } // macro_rules! tuple_impls { // ($( // $Tuple:ident { // $(($idx:tt) -> $T:ident)+ // } // )+) => { // ...
// } // } //
<|file_name|>_conformal_layout.py<|end_file_name|><|fim▁begin|>import numpy as np from ._layout import Layout from ._multivector import MultiVector class ConformalLayout(Layout): r""" A layout for a conformal algebra, which adds extra constants and helpers. Typically these should be constructed via :fun...
<|file_name|>compiler.py<|end_file_name|><|fim▁begin|>from django.db.models.sql import compiler from datetime import datetime import re from django.db.models.base import Model REV_ODIR = { 'ASC': 'DESC', 'DESC': 'ASC' } SQL_SERVER_8_LIMIT_QUERY = \ """SELECT * FROM ( SELECT TOP %(limit)s * FROM ( %(or...
# Oracle Spatial needs to remove some values due to #10888 params = self.connection.ops.modify_insert_params(placeholders, params) if self.return_id and self.connection.features.can_return_id_from_insert:
<|file_name|>AbstractMapRowMapper.java<|end_file_name|><|fim▁begin|>/* * Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute * Copyright [2016-2019] EMBL-European Bioinformatics Institute * * Licensed under the Apache License, Version 2.0 (the "License"); * you may...
import java.util.HashMap;
<|file_name|>request.rs<|end_file_name|><|fim▁begin|>//! Types for the [`m.secret.request`] event. //! //! [`m.secret.request`]: https://spec.matrix.org/v1.2/client-server-api/#msecretrequest use std::convert::TryFrom; use ruma_macros::EventContent; use ruma_serde::StringEnum; use serde::{ser::SerializeStruct, Deseri...
/// Cross-signing self-signing key (m.cross_signing.self_signing). #[ruma_enum(rename = "m.cross_signing.self_signing")] CrossSigningSelfSigningKey,
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[allow(dead_code)] // FIXME pub mod environment; #[macro_use] pub mod logger; #[macro_use] pub mod term; #[cfg(test)] pub mod test; pub mod table;<|fim▁hole|>macro_rules! update_json_map_opt_key { ($map:expr, $key:expr, $val:expr) => (match $val { Some(val) ...
#[macro_export] //TODO move to more relevant place
<|file_name|>LaborTracker.js<|end_file_name|><|fim▁begin|>var READONLY = false // How much labor you generate per minute var LABORGENRATE = 2; if (READONLY){ // This is just for setting up a display-only example of this app Characters = new Meteor.Collection(null) Timers = new Meteor.Collection(null) } else { ...
var matches = re.exec(timerstring); if(matches) { totaltime += Number(matches[1]);
<|file_name|>DeliveryChannelParserTest.java<|end_file_name|><|fim▁begin|>/** * #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# * This file is part of the Smart Developer Hub Project: * http://www.smartdeveloperhub.org/ <|fim▁hole|> * http://www.centeropenmiddleware.com/ * ...
* * Center for Open Middleware
<|file_name|>repository.screen.js<|end_file_name|><|fim▁begin|>/* eslint-disable no-shadow */ import React, { Component } from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { StyleSheet, RefreshControl, Share } from 'react-native'; import { ListItem } from 'react-nat...
<|file_name|>eq.rs<|end_file_name|><|fim▁begin|>#![feature(core)] extern crate core; #[cfg(test)] mod tests { // pub trait FixedSizeArray<T> { // /// Converts the array to immutable slice // fn as_slice(&self) -> &[T]; // /// Converts the array to mutable slice // fn as_mut_slice(&m...
// }
<|file_name|>persistent_volumes-gce.go<|end_file_name|><|fim▁begin|>/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICE...
// Testing configurations of single a PV/PVC pair attached to a GCE PD var _ = utils.SIGDescribe("PersistentVolumes GCEPD", func() {
<|file_name|>apivideos2csv.py<|end_file_name|><|fim▁begin|>'''Convert video JSON data into CSV list. The JSON documents should be from https://api.twitch.tv/kraken/videos/top?limit=20&offset=0&period=all ''' import argparse import csv import json import glob def main(): arg_parser = argparse.ArgumentParser() ...
<|file_name|>mk_foo1_static.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import sys sys.path.append('..') from bcert_pb2 import * import binascii # fill out a minimal bitcoin cert cert = BitcoinCert() # first the data part (the part is later signed by the "higher level cert" or "the blockchain") cert.data.vers...
# this is standard in bitcoin ripemd(sha256()) from bitcoin import hash_160 # add signature to cert
<|file_name|>test_map.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # @Author: Brian Cherinka, José Sánchez-Gallego, and Brett Andrews # @Date: 2017-07-02 # @Filename: test_map.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) # # @Last modified by: andrew...
assert tuple(map_.shape) == tuple(map_restored.shape) @pytest.mark.parametrize('property_name, channel',
<|file_name|>nul-characters.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.org/...
// sizes for two should suffice assert_eq!(all_nuls1.len(), 4); assert_eq!(all_nuls2.len(), 4);
<|file_name|>Util.py<|end_file_name|><|fim▁begin|># encoding: utf-8 import sys import os import signal from openpyxl.utils import get_column_letter from openpyxl import Workbook,load_workbook ItemList=[] ## {{{ http://code.activestate.com/recipes/410692/ (r8) # This class provides the functionality we want. You only ...
self.Direction = None
<|file_name|>mapstory_tm_world_config.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals # do this when > 1.6!!! # from django.db import migrations, models from gazetteer.models import GazSource,GazSourceConfig,LocationTypeField,CodeFieldConfig,NameFieldConfig from skosxl....
try: GazSourceConfig.objects.filter(name="TM_WorldBoundaries").delete() except:
<|file_name|>create_module_documentation.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2008-2013 AvanzOSC S.L. All Rights Reserved # # This program is free softw...
search_ids = doc_obj.search(cr, uid, [('module_id', '=', id)], context=context) if not search_ids: created_id = doc_obj.create(cr, uid, {'module_id': id},
<|file_name|>field_test.rs<|end_file_name|><|fim▁begin|>use crate::construct_field::construct_field; use crate::field::{self, Field, Pos}; use crate::player::Player; use crate::zobrist::Zobrist; use rand::seq::SliceRandom; use rand::SeedableRng; use rand_xorshift::XorShiftRng; use std::sync::Arc; const SEED: [u8; 16] ...
<|file_name|>DBCellRecord.hpp<|end_file_name|><|fim▁begin|>// Generated from /POI/java/org/apache/poi/hssf/record/DBCellRecord.java #pragma once #include <fwd-POI.hpp> #include <java/lang/fwd-POI.hpp> #include <org/apache/poi/hssf/record/fwd-POI.hpp> #include <org/apache/poi/util/fwd-POI.hpp> #include <org/apache/poi...
<|file_name|>level0_source.py<|end_file_name|><|fim▁begin|># # Dalton Burke, CU Denver # # CONUS = [-124.7844079,-66.9513812,24.7433195,49.3457868] from __future__ import absolute_import from utils import ensure_dir, symlink_unless_exists from .downloader import download_url, DownloadError, get_dList # fast searching...
<|file_name|>transform.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 https://mozilla.org/MPL/2.0/. */ //! Generic types for CSS values that are related to trans...
<|file_name|>webpack.server.js<|end_file_name|><|fim▁begin|>'use strict'; /** * Created by x on 11/23/15. */ var path = require('path'); var webpack = require('webpack'); var os = require('os'); var WebpackDevServer = require('webpack-dev-server'); var config = require('./webpack.config.dev'); var pathToBuild = path...
} }*/ })
<|file_name|>Packages.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ C.5 Classes, Packages, and Page Styles (p176) """ import codecs, sys, os from plasTeX import Command, Environment, DimenCommand, Token from plasTeX.Logging import getLogger # Put the plasTeX packages into the path from plasTeX import Pa...
return [] class IfFileExists(Command): args = 'file:str true:nox false:nox'
<|file_name|>run.py<|end_file_name|><|fim▁begin|>""" Exim SES Transport Entry Points """ # Copyright 2013, Jayson Vantuyl <jvantuyl@gmail.com> # # This file is part of exim_ses_transport. # # exim_ses_transport is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Publi...
# You should have received a copy of the GNU Lesser General Public License # along with exim_ses_transport. If not, see <http://www.gnu.org/licenses/>.
<|file_name|>cancel.py<|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/licenses/LIC...
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
<|file_name|>chat_client.cpp<|end_file_name|><|fim▁begin|>// // chat_client.cpp // ~~~~~~~~~~~~~~~ //<|fim▁hole|>// Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include <cstdlib> #include <deque> #include <iost...
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) //
<|file_name|>ByteBufferOutputStream.java<|end_file_name|><|fim▁begin|>package net.ihiroky.reservoir.coder; import java.io.IOException; import java.io.OutputStream; import java.nio.ByteBuffer; /** * Created on 12/10/04, 19:26 * * @author Hiroki Itoh */ public class ByteBufferOutputStream extends OutputStream { ...
ByteBuffer t = ByteBuffer.allocate(newSize); byteBuffer.flip(); t.put(byteBuffer); byteBuffer = t;
<|file_name|>nova.api.js<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. */ var rest = require('../../../common/rest.api'), config = require('../../../../../config/config.global.js'), authApi = require('../../../common/auth.api'), url = require('url'), ...
req.res.redirect('/logout');
<|file_name|>tools.ts<|end_file_name|><|fim▁begin|>import {SinonStub} from "sinon";<|fim▁hole|> const stub = (t: any): SinonStub => t; const restore = (t: any) => t.restore(); export {stub, restore};<|fim▁end|>
export * from "./logger";
<|file_name|>hawkular.py<|end_file_name|><|fim▁begin|>import re from widgetastic_patternfly import Input, BootstrapSelect from wrapanapi.hawkular import Hawkular from cfme.common import TopologyMixin from cfme.common.provider import DefaultEndpoint, DefaultEndpointForm from cfme.utils.appliance import Navigatable fro...
<|file_name|>QueryResult.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2011-2015 ArkCORE <http://www.arkania.net/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or mod...
default: m_rows[uint32(m_rowPosition)][fIndex].SetByteValue( 0,
<|file_name|>cropService.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> public canvas: HTMLCanvasElement; public ctx: CanvasRenderingContext2D; // todo: Unused? public static DEG2RAD = 0.0174532925; public init(canvas: HTMLCanvasElement) { this.canvas = canvas; this.ctx = this.canvas....
export class CropService {
<|file_name|>internal.rs<|end_file_name|><|fim▁begin|>use crate::specs::*; use amq_protocol_types::*; use serde::Deserialize; use serde_json::Value; use std::collections::BTreeMap; type MethodDefaults = (&'static str, &'static [&'static str]); type ClassDefaults = (&'static str, &'static [MethodDefaults]); const EN...
if let Some(confirmation) = class_md .and_then(|c| c.get(&self.name.replace("-ok", "")))
<|file_name|>OAMesh.js<|end_file_name|><|fim▁begin|>/** * @author mrdoob / http://mrdoob.com/ * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as */ THREE.OAMesh = function ( geometry, material ) { THREE.Mesh.call( this, geometry, material ); ...
return 0;
<|file_name|>driver.go<|end_file_name|><|fim▁begin|>package bridge import ( "fmt" "io/ioutil" "net" "os" "sync" "github.com/docker/docker/engine" "github.com/docker/docker/nat" "github.com/docker/docker/pkg/iptables" "github.com/docker/docker/pkg/networkfs/resolvconf" log "github.com/flynn/flynn/Godeps/_wor...
// release an interface for a select ip func Release(job *engine.Job) engine.Status { var ( id = job.Args[0]
<|file_name|>datasets.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit, AfterContentInit, ViewChild } from '@angular/core';<|fim▁hole|>import { Response } from '@angular/http'; import { Messenger } from '../common/services/messenger.service'; import { IDataSet } from 'slamby-sdk-angular2'; import {...
<|file_name|>Traceparent.java<|end_file_name|><|fim▁begin|>/* * Copyright © 2009 HotPads (admin@hotpads.com) * * 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.o...
this(traceId, parentId, createDefaultTraceFlag()); }
<|file_name|>index.tsx<|end_file_name|><|fim▁begin|>import React from 'react'; import {WithRouterProps} from 'react-router/lib/withRouter'; import {disablePlugin, enablePlugin, fetchPlugins} from 'app/actionCreators/plugins'; import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; import {t} from 'app/lo...
<SentryDocumentTitle title={title} objSlug={orgId} /> <SettingsPageHeader title={title} /> <PermissionAlert />
<|file_name|>0037_auto__add_field_purplerobotdevice_first_reading_timestamp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def fo...
'frequency': ('django.db.models.fields.FloatField', [], {'default': '1.0'}),
<|file_name|>import_.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import class DummyException(Exception): pass def import_global( name, modules=None, exceptions=DummyException, locals_=None, globals_=None, level=-1): '''Import the requested items into the global scope ...
try:
<|file_name|>EngineImplDefine.cpp<|end_file_name|><|fim▁begin|>#include "EngineImplDefine.h" void BlendColor::Init(D3DCOLOR defaultColor, D3DCOLOR disabledColor, D3DCOLOR hiddenColor) { for (decltype(States.size()) i = 0; i != States.size(); ++i) { States[i] = defaultColor; } States[STATE_DISABLED] = disabledCo...
this->iTexture = iTexture;
<|file_name|>status.py<|end_file_name|><|fim▁begin|>import itertools from zope.interface import implements from allmydata.interfaces import IDownloadStatus class ReadEvent: def __init__(self, ev, ds): self._ev = ev self._ds = ds def update(self, bytes, decrypttime, pausetime): self._ev[...
self._ds = ds def finished(self, received, when): self._ev["finish_time"] = when
<|file_name|>cnxbase.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #! -*- coding: utf-8 -*- ### # Copyright (c) Rice University 2012-13 # This software is subject to<|fim▁hole|># Public License version 3 (AGPLv3). # See LICENCE.txt for details. ### """ THis exists solely to provide less typing for a "leaf no...
# the provisions of the GNU Affero General
<|file_name|>input-number-format.jquery.js<|end_file_name|><|fim▁begin|>(function($){ $.fn.extend({ inputNumberFormat: function(options) { this.defaultOptions = { 'decimal': 2, 'decimalAuto': 2, 'separator': '.', 'separatorAuthorize...
<|file_name|>TestAddDTEDtoElevationMosaicDataset.py<|end_file_name|><|fim▁begin|>#------------------------------------------------------------------------------ # Copyright 2013 Esri # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # Yo...
print("Geodatabase path: " + str(TestUtilities.geodatabasePath))
<|file_name|>impl-const.rs<|end_file_name|><|fim▁begin|>#![feature(generic_const_exprs)] pub struct Num<const N: usize>; // Braces around const expression causes crash impl Num<{5}> { pub fn five(&self) { }<|fim▁hole|><|fim▁end|>
}
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import locale import os import re import subprocess import sys import platform import time # init libs PROGRAM_DIR = os.path.dirname(os.path.normpath(os.path.abspath(os.path.join(__file__, os.pardir)))) LIBS_DIR = os.path.join(PROGRAM_DIR, 'libs') sys.path.insert(0...
try:
<|file_name|>generate_lininteg_ext.py<|end_file_name|><|fim▁begin|>file = "../_ser/lininteg.py" out = ["namespace mfem {"] fid = open(file, 'r') for line in fid.readlines(): if line.startswith("class"): cname = (line.split(' ')[1]).split('(')[0] <|fim▁hole|> elif line.find(", QG") != -1: ...
if line.startswith(" def __init__"): pp = "" if line.find("*args") != -1: pp = " self._coeff = args"
<|file_name|>screen.py<|end_file_name|><|fim▁begin|>import pygame import math class Screen: ''' Se encarga de controlar lo que ve el jugador en la pantalla. Parameters ---------- size : List[int] Tamaño de la pantalla, ``[w, h]``. Notes ----- Primero se debe crear una instanci...
screen = toledo.graphics.Screen(screen_size) ... def loop(): ...
<|file_name|>fix-logs.js<|end_file_name|><|fim▁begin|>var through = require('through2') var split = require('split2') var duplexer = require('duplexer2') module.exports = function (opt) {<|fim▁hole|> opt = opt || {} var out = through() var parse = split() .on('data', function (buf) { var str = buf.toSt...
<|file_name|>execute.py<|end_file_name|><|fim▁begin|># This file is part of Pimlico # Copyright (C) 2020 Mark Granroth-Wilding # Licensed under the GNU LGPL v3.0 - https://www.gnu.org/licenses/lgpl-3.0.en.html from builtins import str from builtins import zip from pimlico.core.external.java import Py4JInterface, JavaP...
<|file_name|>DumpModelAsXmlChoiceFilterRouteTest.java<|end_file_name|><|fim▁begin|>/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses...
public class DumpModelAsXmlChoiceFilterRouteTest extends ContextTestSupport { public void testDumpModelAsXml() throws Exception { String xml = ModelHelper.dumpModelAsXml(context.getRouteDefinition("myRoute"));
<|file_name|>TextEvent.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2007 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the...
, m_pastingFragment(pastingFragment) , m_shouldSmartReplace(shouldSmartReplace)
<|file_name|>dryrun.go<|end_file_name|><|fim▁begin|>/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless ...
} out, _, err := tryUpdate(ptrToType, storage.ResponseMeta{ResourceVersion: rev})
<|file_name|>dirac-dms-show-fts-status.py<|end_file_name|><|fim▁begin|>#!/bin/env python """ Showing last hour history of FTS transfers. """ import sys import DIRAC from DIRAC import gLogger, gConfig, S_OK from DIRAC.Core.Base import Script from DIRAC.Core.DISET.RPCClient import RPCClient from DIRAC.ConfigurationSyste...
timeScale = int( timeScale["Value"] ) accFailureRate = gConfig.getOption( taSection + "/StrategyHandler/AcceptableFailureRate", 75 ) if not accFailureRate["OK"]:
<|file_name|>github.go<|end_file_name|><|fim▁begin|>// Copyright 2013 The go-github AUTHORS. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package github import ( "bytes" "encoding/json" "errors" "fmt" "io/ioutil" "net/http" "net...
case `rel="first"`: r.FirstPage, _ = strconv.Atoi(page)
<|file_name|>MemTreeBuilder.java<|end_file_name|><|fim▁begin|>/* * eXist Open Source Native XML Database * Copyright (C) 2001-2014 Wolfgang M. Meier * wolfgang@exist-db.org * http://exist.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GN...
* @param attributes DOCUMENT ME! * @return the node number of the created element */
<|file_name|>uk_UA.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="uk_UA" version="2.1"> <context> <name>GM_AddScriptDialog</name> <message> <location filename="../gm_addscriptdialog.ui" line="14"/> <source>GreaseMonkey Installation</source> <translation>...
<source>Are you sure you want to install it?</source> <translation>Ви впевнені, що хочете встановити цей скрипт?</translation> </message>
<|file_name|>CALOAD.java<|end_file_name|><|fim▁begin|>package me.coley.bmf.insn.impl; import me.coley.bmf.insn.Instruction; import me.coley.bmf.insn.OpType; public class CALOAD extends Instruction { public CALOAD() { super(OpType.ARRAY, Instruction.CALOAD, 1);<|fim▁hole|>}<|fim▁end|>
}
<|file_name|>JobEntryDeleteFolders.java<|end_file_name|><|fim▁begin|>/*! ****************************************************************************** * * Pentaho Data Integration * * Copyright (C) 2002-2017 by Pentaho : http://www.pentaho.com * *******************************************************************...
.valueOf( id_jobentry ) ), dbe ); } }
<|file_name|>savetransferfunction.py<|end_file_name|><|fim▁begin|><|fim▁hole|> tf = inviwopy.app.network.VolumeRaycaster.transferFunction tf.save( inviwopy.app.getPath( inviwopy.PathType.TransferFunctions) + "/transferfunction.itf" )<|fim▁end|>
# Inviwo Python script import inviwopy
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core'; import { Cordova, Plugin } from '@ionic-native/core'; export interface ILocalNotification { /** * A unique identifier required to clear, cancel, update or retrieve the local notification in the future * Default: 0 ...
/** * Updates a previously scheduled notification. Must include the id in the options parameter. * @param options {ILocalNotification} optional */
<|file_name|>utils.js<|end_file_name|><|fim▁begin|>var utils = { handleError: function(dataToLogToConsole, errorMessage, errorObj) { console.log(dataToLogToConsole || errorMessage); if (errorMessage) { var alertMessage = errorMessage; // if error object is passed, then append error message in the ...
alertMessage += ". " + errorJSON.message; } else { alertMessage += ". " + errorObj.message;
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
from plugins.qlprofile.qlprofile import get_profile
<|file_name|>admissionconfig_test.go<|end_file_name|><|fim▁begin|>package integration import ( "fmt" "io" "io/ioutil" "reflect" "testing" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" kyaml "k8s.io/apimachinery/...
configObj := &testtypes.TestPluginConfig{ Data: value,
<|file_name|>LDR.ts<|end_file_name|><|fim▁begin|>class LDR extends Instruction { getName() { return "LDR"; } getOperandCount() { return 3; } getInstructionBits(operands: Operand[]) { return "0110" + Program.toBinaryPadded(operands[0].getRegisterNumber(), 3) + Program.toBi...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'; const debug = require('debug')('WechatController'); const EventEmitter = require('events').EventEmitter; const Cache = require('../../service/Cache'); const Wechat = require('../../service/Wechat'); const config = require('../../config'); const _ = requi...
workflow.on('getSubscriberInfo', () => {
<|file_name|>build.js<|end_file_name|><|fim▁begin|>const fs = require('fs') const Log = require('log') const browserify = require('browserify') const babelify = require('babelify') const errorify = require('errorify') const cssNext = require('postcss-cssnext') const cssModulesify = require('css-modulesify') const exec ...
errorify ],
<|file_name|>annotate_features.py<|end_file_name|><|fim▁begin|>from django.core.management.base import BaseCommand, CommandError from django.db import transaction import sys import json<|fim▁hole|> class Command(BaseCommand): """Annotate tweets and load into database.""" help = __doc__ #def add_arguments...
from twit.models import User, Tweet, Mention, UserMention from javanlp.models import Sentence, Sentiment from javanlp.util import AnnotationException, annotate_document_with_sentiment
<|file_name|>attachments.ts<|end_file_name|><|fim▁begin|>import { fromNullable } from 'fp-ts/lib/Option'; import { queryK } from 'sdi/shape'; import { uuid } from 'sdi/source'; const attachments = queryK('data/attachments'); export const getAttachments =<|fim▁hole|><|fim▁end|>
() => attachments(); export const getAttachment = (id: uuid) => fromNullable(attachments().find(a => a.id === id));
<|file_name|>spikes-treeview-helper.ts<|end_file_name|><|fim▁begin|>import { ITreeviewItem, ITreeviewLevel, TreeviewLevel } from './' export class TreeviewHelper{ static getTreeviewSelectedItems(items: Array<ITreeviewItem>): Array<ITreeviewItem>{ let selectedItems: Array<ITreeviewItem> = []; ite...
}); return levels }
<|file_name|>util.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # # TheVirtualBrain-Scientific Package. This package holds all simulators, and # analysers necessary to run brain-simulations. You can use it stand alone or # in conjunction with TheVirtualBrain-Framework Package. See content of the # documen...
<|file_name|>string_traits.hpp<|end_file_name|><|fim▁begin|>/*============================================================================= Copyright (c) 2001-2014 Joel de Guzman Copyright (c) 2001-2011 Hartmut Kaiser Copyright (c) 2010 Bryce Lelbach Distributed under the Boost Software Licen...
<|file_name|>prettyprint_ops.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.a...
print_shape, summarize_indicator_vector) if data is not None:
<|file_name|>paxinos.py<|end_file_name|><|fim▁begin|>import re from collections import defaultdict, Counter from ttlser import natsort from pyontutils.core import LabelsBase, Collector, Source, resSource, ParcOnt from pyontutils.core import makePrefixes from pyontutils.config import auth from pyontutils.namespaces impo...
<|file_name|>MatcherGroupCount.java<|end_file_name|><|fim▁begin|>// Test case for Issue 291 // https://code.google.com/p/checker-framework/issues/detail?id=291 // @skip-test import java.util.regex.*; import org.checkerframework.checker.regex.RegexUtil; public class MatcherGroupCount { public static void main(Strin...
}