prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>terrain.js<|end_file_name|><|fim▁begin|>(function(){ function render (context, points) { console.log ('render called'); var angle = 0, center = new Point3D (400,400,400); return function () { context.clearRect(0,0,800,600); if (points.leng...
function (pt) {
<|file_name|>msd_rs.go<|end_file_name|><|fim▁begin|>package msd import ( "encoding/base64" "github.com/bluefw/blued/discoverd/api" "github.com/gin-gonic/gin" "log" "net/http" ) type ServiceResource struct { repo *DiscoverdRepo logger *log.Logger } func NewServiceResource(dr *DiscoverdRepo, l *log.Logger) *S...
sr.repo.Register(&as)
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms from order.models import Pizza, Bread, Customer class PizzaForm(forms.ModelForm): class Meta: model = Pizza fields = ('size', 'toppings', 'crust') widgets = { 'size': forms.RadioSelect(), 'crust': f...
<|file_name|>match-duration.pipe.ts<|end_file_name|><|fim▁begin|>import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'matchDuration', }) export class MatchDurationPipe implements PipeTransform { transform(value: number, args?: any): any { return (value / 60).toFixed();<|fim▁hole|><|fim▁end|>
} }
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import os import pytest @pytest.fixture(scope='session') def testdata(): """ Simple fixture to return reference data<|fim▁hole|> class TestData(): def __init__(self): self.datadir = os.path.join(os.path.dirname(os.path.realpath(__fi...
:return: """
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 Michael Yang. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. #![feature(concat_idents)] //! BLAS bindings and wrappers. //! //! Bindings are split by BLAS level and contained...
mod prefix;
<|file_name|>Comments.js<|end_file_name|><|fim▁begin|>import { GET_COMMENTS, GET_COMMENT, SUBMIT_VOTE_COMMENT, DELETE_COMMENT, EDIT_COMMENT, ADD_COMMENT, } from '../actions'; import _ from 'lodash'; function commentsReducer(state = {}, action) { switch (action.type) { case GET_COMMENTS: let com...
<|file_name|>RemoveButton.tsx<|end_file_name|><|fim▁begin|>import React, { MouseEvent, FunctionComponent } from 'react'; import classnames from 'classnames'; import rcFont from '../../assets/RcFont/RcFont.scss'; import styles from './styles.scss'; export interface RemoveButtonProps { className?: string;<|fim▁hole|> ...
<|file_name|>tkmain.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python __author__ = 'Markus Bajones' __license__ = 'GPL' __version__ = '1.0.0' __email__ = 'markus.bajones@gmail.com' """ - download ROS key from keyserver and install it - show settings (mirror/package selection/ROS distro) - install selected packages - ...
('packages.ros.org.ros.informatik.uni-freiburg.de', 'http://packages.ros.org.ros.informatik.uni-freiburg.de'), ('mirror.umd.edu/packages.ros.org', 'http://mirror.umd.edu/packages.ros.org'), ('mobilerobots.case.edu/mirror/packages.ros.org', 'http://mobilerobots.case.edu/mirror/package...
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from flask.ext.admin.contrib.mongoengine import ModelView from .models import Prediction from app.management.mixins import AdminMixin <|fim▁hole|><|fim▁end|>
class PredictionView(AdminMixin, ModelView): column_searchable_list = ('text',)
<|file_name|>input.ts<|end_file_name|><|fim▁begin|>namespace N { const M1 = {} export module M1 {} const { M2 } = {}<|fim▁hole|> export module M2 {} }<|fim▁end|>
<|file_name|>acct_stop_process.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding=utf-8 from twisted.python import log from toughradius.radiusd.settings import * import logging import datetime def process(req=None,user=None,radiusd=None,**kwargs): if not req.get_acct_status_type() == STATUS_TYPE_STOP: ...
<|file_name|>provisioner.go<|end_file_name|><|fim▁begin|>package shell import ( "context" "github.com/hashicorp/hcl/v2/hcldec" sl "github.com/hashicorp/packer/common/shell-local" "github.com/hashicorp/packer/packer" ) type Provisioner struct { config sl.Config } func (p *Provisioner) ConfigSpec() hcldec.Object...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- <|fim▁hole|># @author: David Coninckx <david@coninckx.com> # # The licence is in the file __openerp__.py # ############################################################################## from . import contracts from . import pr...
############################################################################## # # Copyright (C) 2015 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name
<|file_name|>CrawlChart.js<|end_file_name|><|fim▁begin|>import React from 'react'; import PropTypes from 'prop-types'; import _get from 'lodash.get'; import _words from 'lodash.words'; import { VictoryAxis, VictoryBar, VictoryChart, VictoryTheme } from 'victory'; export class CrawlChart extends React.Component...
<|file_name|>default.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp'); var argv = require('yargs').argv; var config = require('../config.js');<|fim▁hole|>console.log(' Building for distribution: ' + dist); console.log(''); gulp.task('default', ['images', 'lib', 'sass', 'watch', 'code', 'html']);<|fim▁end...
var dist = config.release = !!argv.dist; console.log('_________________________________________'); console.log('');
<|file_name|>manifest_injector_test.go<|end_file_name|><|fim▁begin|>package api import ( "testing" "github.com/stretchr/testify/assert" manifest "github.com/estafette/estafette-ci-manifest" ) func TestLabelSelectorMatches(t *testing.T) { t.Run("ReturnsTrueIfNoLabelSelectorHasBeenDefined", func(t *testing.T) { ...
<|file_name|>page.rs<|end_file_name|><|fim▁begin|>use std::convert; use std::fmt; use std::path::{Path, PathBuf}; use serde_json::{self, Value}; #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Slug { slug: String, } impl Slug { pub fn new(slug: String) -> Self { Slug { slug: slug } } ...
format!("{}{}", slug_prefix, dest) } }
<|file_name|>aci_interface_policy_leaf_policy_group.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Bruno Calogero <brunocalogero@hotmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_i...
- Choice of l2_interface_policy to be used as part of the leaf policy group to be created. aliases: [ l2_interface_policy_name ] port_security_policy:
<|file_name|>issue-34798.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lic...
<|file_name|>asp_module_tests.py<|end_file_name|><|fim▁begin|>import unittest2 as unittest import asp.jit.asp_module as asp_module import asp.codegen.cpp_ast as cpp_ast from mock import Mock class TimerTest(unittest.TestCase): def test_timer(self): pass # mod = asp_module.ASPModule() # mod...
def test_adding_and_calling(self): m = asp_module.ASPModule() m.add_function("foo", "PyObject* foo(){Py_RETURN_TRUE;}") self.assertTrue(m.foo())
<|file_name|>MessageHeader.java<|end_file_name|><|fim▁begin|>/********************************************************************************** * $URL$ * $Id$ *********************************************************************************** * * Copyright (c) 2003, 2004, 2005, 2006, 2008 The Sakai Foundation * ...
/** * Serialize the resource into XML, adding an element to the doc under the top of the stack element.
<|file_name|>emailList.js<|end_file_name|><|fim▁begin|>define(['react','app','dataTable','dataTableBoot'], function (React,app,DataTable,dataTableBoot) { return React.createClass({ mixins: [app.mixins.touchMixins()], getInitialState : function() { var dataSet = []; return { dataSet:dataSet, ...
} }
<|file_name|>sha1.rs<|end_file_name|><|fim▁begin|>// Implements http://rosettacode.org/wiki/SHA-1 // straight port from golang crypto/sha1 // library implementation #![feature(core)] use std::num::Wrapping as wr; use std::slice::bytes::copy_memory; use std::io::{Write, Result}; // The size of a SHA1 checksum in bytes...
Ok(()) } fn flush(&mut self) -> Result<()> { Ok(()) }
<|file_name|>lat_long.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ Assorted utilities for manipulating latitude and longitude values """ from __future__ import unicode_literals __version__ = "1.4" import math, struct def signbit(value): """ Test whether the sign bit of the given floating-poin...
return FORMAT2.format(degrees, minutes, direction)
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main import ( "io" "net/http" "net/url" "os" "os/exec" "strconv" "strings" "github.com/Sirupsen/logrus" "github.com/samalba/dockerclient" ) // goproxy main purpose is to be a daemon connecting the docker daemon // (remote API) and the custom Minecraf...
}
<|file_name|>md3.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2007 by Kai Blin # # Plunger 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 of the Li...
self.ident = MD3_IDENT self.version = MD3_VERSION self.name = "" self.num_frames = 0
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp'); var babel = require('gulp-babel'); var concat = require('gulp-concat'); var merge = require('merge-stream'); var stylus = require('gulp-stylus'); var rename = require("gulp-rename"); var uglify = require("gulp-uglify"); var cssmin = requi...
.pipe(gulp.dest('dist'));
<|file_name|>PrimaPlay_unittest.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import unittest import os, sys import PrimaPlay import urllib2 os.chdir(os.path.dirname(sys.argv[0])) user = 'text@example.com'; password = 'password'; class mockTime: def time(self): return 1450875766 class mockUse...
self.assertEqual(prima_play.get_video_link('p135603'), 'http://prima-vod-prep.service.cdn.cra.cz/vod_Prima/_definst_/0000/5314/cze-ao-sd1-sd2-sd3-sd4.smil/playlist.m3u8') def test_get_video_link__hd(self):
<|file_name|>augmentations.py<|end_file_name|><|fim▁begin|># Copyright 2021 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
<|file_name|>MyCollections.java<|end_file_name|><|fim▁begin|>package kata; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; public class MyCollections { public static String join(Collection collection) { return join(collection, ""); } publ...
<|file_name|>entry.rs<|end_file_name|><|fim▁begin|>#![feature(core, collections)] extern crate core; extern crate collections; #[cfg(test)] mod tests { use core::fmt::Formatter; use core::fmt::Debug; use core::fmt::Result; use core::fmt::DebugSet; use collections::vec::Vec; use core::slice::I...
<|file_name|>no-callback-literal.js<|end_file_name|><|fim▁begin|>/** * Ensures that the callback pattern is followed properly * with an Error object (or undefined or null) in the first position. */ 'use strict' // ------------------------------------------------------------------------------<|fim▁hole|> /** * Det...
// Helpers // ------------------------------------------------------------------------------
<|file_name|>bitcoin_da.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="da" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Bitcoin</source> ...
<message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Rediger Adresse</translation>
<|file_name|>router.go<|end_file_name|><|fim▁begin|>package queier <|fim▁hole|> "fmt" "strconv" "broker-gateway/entities" "github.com/satori/go.uuid" ) type Router interface { Start(port int) } type router struct { q Querier http *httprouter.Router } func NewRouter(q Querier) Router { r := httprouter.New() ...
import ( "github.com/julienschmidt/httprouter" "net/http" "encoding/json"
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod controller; pub use controller::{AreaEvent, Controller}; <|fim▁hole|>pub use dispatcher::Dispatcher; mod waveform_with_overlay; pub use waveform_with_overlay::WaveformWithOverlay; use crate::UIEventChannel; #[derive(Debug)] pub enum Event { Area(AreaEvent)...
mod dispatcher;
<|file_name|>word_count.py<|end_file_name|><|fim▁begin|>from collections import defaultdict import re import sys from stop_words import STOP_WORD_SET from collections import Counter PUNCTUATION_RE = re.compile("[%s]" % re.escape( """!"&()*+,-\.\/:;<=>?\[\\\]^`\{|\}~]+""")) DISCARD_RE = re.compile("^('{|`|git@|@|ht...
top_n = keep_top_n_words(word_counts, 100) print ' Filtering to top 100 words' return top_n
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from flask import Flask from flask_socketio import SocketIO # создаем экземпляр класса Flask <|fim▁hole|># создаем экземпляр класса SocketIO socketio = SocketIO(app) from app.views import home<|fim▁end|>
app = Flask(__name__)
<|file_name|>main.js<|end_file_name|><|fim▁begin|>//= require ./src/module //= require_tree ./src/services //= require_tree ./src/controllers<|fim▁hole|>//= require_tree ./src/directives<|fim▁end|>
<|file_name|>backup_handler.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::{ event_store::EventStore, ledger_store::LedgerStore, metrics::{ BACKUP_EPOCH_ENDING_EPOCH, BACKUP_STATE_SNAPSHOT_LEAF_IDX, BACKUP_STATE_SNAPSHOT...
<|file_name|>map-style.js<|end_file_name|><|fim▁begin|>import {fromJS} from 'immutable'; import MAP_STYLE from '../assets/map-style-basic-v8.json'; // export multi object.. export const polyLayer = fromJS({ id: 'polyLayer', source: 'polyLayer', type: 'fill', interactive: true, paint: { 'fill-color': '#ff...
}, ] })
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for non-npm package Node.js 14.14 // Project: http://nodejs.org/<|fim▁hole|>// Alvis HT Tang <https://github.com/alvis> // Andrew Makarov <https://github.com/r3nya> // Benjamin Toueg <https://github....
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft> // DefinitelyTyped <https://github.com/DefinitelyTyped> // Alberto Schiabel <https://github.com/jkomyno> // Alexander T. <https://github.com/a-tarasyuk>
<|file_name|>eAddresses.py<|end_file_name|><|fim▁begin|>""" Demonstrates how to use the labjack.ljm.eAddresses (LJM_eAddresses) function. """ from labjack import ljm # Open first found LabJack handle = ljm.open(ljm.constants.dtANY, ljm.constants.ctANY, "ANY") #handle = ljm.openS("ANY", "ANY", "ANY") info = ljm.get...
start = 0 for i in range(numFrames): end = start + aNumValues[i] print(" Address - %i, data type - %i, write - %i, values: %s" % \
<|file_name|>interface.py<|end_file_name|><|fim▁begin|>__license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' import os from collections import namedtuple from calibre.customize import Plugin from calibre.constants import iswindows class DevicePlugin(Plugin): """ Defines the in...
pass def shutdown(self): '''
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import *<|fim▁hole|> class Guidance(MakefilePackage): ...
import glob
<|file_name|>C[ Inna and Dima ].cpp<|end_file_name|><|fim▁begin|>#include <bits/stdc++.h> using namespace std; #define sd(x) scanf("%d",&x) #define su(x) scanf("%u",&x) #define slld(x) scanf("%lld",&x) #define sc(x) scanf("%c",&x) #define ss(x) scanf("%s",x) #define sf(x) scanf("%f",&x) #define slf(x) scan...
<|file_name|>stp.py<|end_file_name|><|fim▁begin|># $Id: stp.py 23 2006-11-08 15:45:33Z dugsong $ # -*- coding: utf-8 -*- """Spanning Tree Protocol.""" import dpkt class STP(dpkt.Packet): __hdr__ = ( ('proto_id', 'H', 0), ('v', 'B', 0), ('type', 'B', 0), ('flags', 'B', 0), ...
assert stp.age == 0 assert stp.max_age == 20
<|file_name|>release.go<|end_file_name|><|fim▁begin|>// -*- Mode: Go; indent-tabs-mode: t -*- /* * Copyright (C) 2014-2015 Canonical Ltd * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free Software Fou...
// readOSRelease returns the os-release information of the current system. func readOSRelease() OS { // TODO: separate this out into its own thing maybe (if made more general)
<|file_name|>campaign_target_service_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: UTF-8 -*- # # Copyright 2010 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.<|fim▁hole|># ...
# You may obtain a copy of the License at #
<|file_name|>app.js<|end_file_name|><|fim▁begin|>define(["globals", "ember", "core_ext", "ember-i18n", "ember-bootstrap",<|fim▁hole|> "mediaelement", "jquery.highlight-search-results", "jquery.autogrow-textarea", "jquery.anchorlinks", "jquery.hashta...
"select2", "moment",
<|file_name|>radiusrand.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ''' Copyright (C) 2005 Aaron Spike, aaron@ekips.org 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 ...
x += math.cos(a)*rx y += math.sin(a)*ry return [x, y]
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>// Copyright 2018, 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // U...
export function youtube(version: 'v3'): youtube_v3.Youtube; export function youtube(options: youtube_v3.Options): youtube_v3.Youtube;
<|file_name|>je_os_segmentandintegrate_smartsigma_dropout.py<|end_file_name|><|fim▁begin|>"""Single slice vgg with normalised scale. """ import functools import lasagne as nn import numpy as np import theano import theano.tensor as T import data_loader import deep_learning_layers import image_transform import layers ...
init = nn.init.Orthogonal() rnn_layer = functools.partial(nn.layers.RecurrentLayer,
<|file_name|>ProcessorMock.java<|end_file_name|><|fim▁begin|>package org.ak.gitanalyzer.http.processor; import org.ak.gitanalyzer.util.writer.CSVWriter; import org.ak.gitanalyzer.util.writer.HTMLWriter; <|fim▁hole|>import java.util.Collection; import java.util.function.BiConsumer; import java.util.function.Function; ...
import java.text.NumberFormat;
<|file_name|>recipe-577863.py<|end_file_name|><|fim▁begin|>from contextlib import contextmanager @contextmanager def failnow(): try: yield<|fim▁hole|><|fim▁end|>
except Exception: import sys sys.excepthook(*sys.exc_info()) sys.exit(1)
<|file_name|>foto.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { FotoComponent } from './foto.component'; describe('FotoComponent', () => { let component: FotoComponent; let fixture: ComponentFixture<FotoComponent>; beforeEach(a...
declarations: [ FotoComponent ] })
<|file_name|>store.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go. // source: meta.proto // DO NOT EDIT! /* Package internal is a generated protocol buffer package. It is generated from these files: meta.proto It has these top-level messages: Series Tag MeasurementFields Field */ package ...
func (m *Field) Reset() { *m = Field{} }
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|><|fim▁hole|># 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 under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR COND...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
<|file_name|>flopy_swi2_ex5.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import math import collections import numpy as np import flopy import matplotlib.pyplot as plt # --modify default matplotlib settings updates = {'font.family': ['Univers 57 Condensed', 'Arial'], ...
outfig = os.path.join(workspace, 'Figure11_swi2ex5.{0}'.format(fext)) xsf.savefig(outfig, dpi=300)
<|file_name|>cloudwatchlogs_log_group_info.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Copyright: 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 ANSIBLE_METADATA...
returned: always type: int
<|file_name|>test_mlbam_util.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from unittest import TestCase, main from pitchpx.mlbam_util import MlbamUtil, MlbAmHttpNotFound __author__ = 'Shinichi Nakagawa' class TestMlbamUtil(TestCase): """ MLBAM Util Class Test """ def...
self.assertEqual(req.status_code, 200)
<|file_name|>mini_dateutil.py<|end_file_name|><|fim▁begin|># This module is a very stripped down version of the dateutil # package for when dateutil has not been installed. As a replacement # for dateutil.parser.parse, the parsing methods from # http://blog.mfabrik.com/2008/06/30/relativity-of-time-shortcomings-in-pyth...
# * Neither the name of Red Innovation nor the names of its contributors # may be used to endorse or promote products derived from this software
<|file_name|>AWSAPIGatewayDeployer.java<|end_file_name|><|fim▁begin|>package org.devspark.aws.tools; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.regex.Matcher; import ...
} return apis.iterator().next().getAnnotationsByType(ApiGateway.class)[0].name(); }
<|file_name|>FeatureDisplayLayout.cpp<|end_file_name|><|fim▁begin|>/* -*-c++-*- */ /* osgEarth - Dynamic map generation toolkit for OpenSceneGraph * Copyright 2016 Pelican Mapping * http://osgearth.org * * osgEarth is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Gener...
} return 0L; }
<|file_name|>cache.js<|end_file_name|><|fim▁begin|>function MemoryCache() { } MemoryCache.prototype.get = function() { } MemoryCache.prototype.set = function() { } <|fim▁hole|> return new MemoryCache(); } exports['@singleton'] = true; exports.MemoryCache = MemoryCache;<|fim▁end|>
exports = module.exports = function() {
<|file_name|>mylogger.py<|end_file_name|><|fim▁begin|>import os import logging.config class MyLogger(object): # set logging to both file and screen def __init__(self): logging.config.fileConfig('../config/logging.conf') self.logger = logging.getLogger('scrapeforum') self.logger.addHand...
self.logger.fatal(msg) self.errorIndicated = True
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate nom; extern crate regex; #[macro_use]<|fim▁hole|>pub mod types; pub mod parser;<|fim▁end|>
extern crate log; #[macro_use] mod internals;
<|file_name|>db_utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Python DB APIs: #for more: http://www.mikusa.com/python-mysql-docs/index.html #and more: http://zetcode.com/db/mysqlpython/ #and else: http://mysql-python.sourceforge.net/MySQLdb.html import MySQLdb as mdb import itertools from pprint import ppr...
cur = db.cursor()
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|> """ Copyright (C) 2012 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """<|fim▁end|>
# -*- coding: utf-8 -*-
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls.defaults import patterns, include, url urlpatterns = patterns('', url('^$', 'actionkit_raplet.views.raplet',<|fim▁hole|><|fim▁end|>
name='raplet'), )
<|file_name|>build.py<|end_file_name|><|fim▁begin|>import os import subprocess import sys import threading try: os.mkfifo("/tmp/shutdown",0666) except OSError: pass try: os.mkfifo("/tmp/abort",0666) except OSError: pass subprocess.check_call(["go","build", "-ldflags", "-X main.FALLBACK_SHUTDOWN_PIPE /tm...
thread.start()
<|file_name|>java.security.ProtectionDomain.d.ts<|end_file_name|><|fim▁begin|>declare namespace java { namespace security { class ProtectionDomain { readonly key: java.security.ProtectionDomain$Key public constructor(arg0: java.security.CodeSource, arg1: java.security.PermissionCollection) publ...
impliesWithAltFilePerm(arg0: java.security.Permission): boolean impliesCreateAccessControlContext(): boolean public toString(): java.lang.String
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages from pkg_resources import parse_version def check_dependencies(): ''' setuptools causes problems for installing packages (especially ...
<|file_name|>st_chunk_io.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python from optparse import OptionParser import filecmp import json import of_daemon import of_node import of_util import os import subprocess import sys import tempfile import time of_util.check_python_version() parser = OptionParser() (opts, args, ...
sys.stderr.write("you must give a Redfish build directory\n") sys.exit(1)
<|file_name|>expr-alt-struct.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org...
assert!((rs.i == 100)); }
<|file_name|>decode.go<|end_file_name|><|fim▁begin|>package jsonutil import ( "github.com/buger/jsonparser" "strconv" ) func GetString(data []byte, keys ...string) (string, error) { return jsonparser.GetString(data, keys...) } func MustGetString(data []byte, keys ...string) string { s, err := GetString(data, key...
return i } func GetBoolean(data []byte, keys ...string) (bool, error) {
<|file_name|>estimator.py<|end_file_name|><|fim▁begin|># Copyright 2017 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.apache....
def __init__(self, make_distribution_fn, label_dimension,
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # mediawiki-utilities documentation build configuration file, created by # sphinx-quickstart on Thu Apr 10 17:31:47 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that ...
exclude_patterns = ['_build']
<|file_name|>DoctorLogin.java<|end_file_name|><|fim▁begin|>package cn.edu.hhu.reg.vo; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="do...
public Integer getDoctorId() { return doctorId; }
<|file_name|>DoubleType.java<|end_file_name|><|fim▁begin|>/** * Copyright (C) 2009-2014 BIMserver.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * Li...
* GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>.
<|file_name|>server.cpp<|end_file_name|><|fim▁begin|>#include "serverBase.h" int main(int argc, char** argv) { unsigned portNumber = 12943; if(argc >= 2) { portNumber = atoi(argv[1]); } try { asio::io_service io_service; asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), portNumb...
<|file_name|>kiss-simple-infobox-hider.user.js<|end_file_name|><|fim▁begin|>// ==UserScript== // @name Kiss Simple Infobox hider // @description Hides the infobox on kissanime.com, kisscartoon.me and kissasian.com player sites // @include https://kissanime.ru/Anime/*/* // @include ...
<|file_name|>backend.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """Simple functions for dealing with posts, replies, votes and subscriptions within Redis and MongoDB :license: AGPL v3, see LICENSE for more details :copyright: 2014-2021 Joe Doherty """ # 3rd party imports from flask import current_app ...
r.delete(k.POST_SUBSCRIBERS.format(post.get('_id')))
<|file_name|>webglrenderingcontext.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use canvas_traits::{CanvasCommonMsg, CanvasMsg,...
constants::TRIANGLE_STRIP | constants::TRIANGLE_FAN | constants::TRIANGLES => { self.ipc_renderer .send(CanvasMsg::WebGL(WebGLCommand::DrawElements(mode, count, type_, offset)))
<|file_name|>timeline.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react'; import { IAnimationKey } from 'babylonjs/Animations/animationKey'; import { Controls } from './controls'; interface ITimelineProps { keyframes: IAnimationKey[] | null; selected: IAnimationKey | null; currentFrame: numbe...
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import unittest from probe import SearchApi, CompanyApi class TestProbeAPI(unittest.TestCase): <|fim▁hole|> api = SearchApi() companies = api.companies_get('1.1', filters='{"nameStartsWith": "loanzen"}') #print type(companies.data), companies.d...
def test_search_company_loanzen(self):
<|file_name|>model_tests.rs<|end_file_name|><|fim▁begin|>extern crate env_logger; use std::collections::HashMap; use super::*; use core_rules::attack_result::AttackResult; use core_rules::weapon::{Weapon, WeaponComponent}; use dice::Dice; use quantity::Quantity; #[test] fn is_alive_returns_true_for_a_model_at_full_...
false, // flying None, // save vs. regular wounds None, // save vs. mortal wounds 10, // bravery
<|file_name|>getter.go<|end_file_name|><|fim▁begin|>// Getter is a tool to automate the creation of getter and setter methods for each unexported field // in a struct // Mostly copied from stringer.go package main // import "bramp.net/dsector/tools/getter" import ( "bufio" "bytes" "flag" "fmt" "go/ast" "go/buil...
<|file_name|>reducer.ts<|end_file_name|><|fim▁begin|>import { Action } from './action'; /** * Interface which defines the reducer service * * @export * @interface Reducer * @template T */ export interface Reducer<T> { /**<|fim▁hole|> * Method to update the state of the store * * @param {T} state - Curr...
<|file_name|>tensor.py<|end_file_name|><|fim▁begin|>import sympy.core.cache # Why doesn't it work to use "import sympy.core.compatibility" and call "with_metaclass" as "sympy.core.compatibility.with_metaclass"? from sympy.core.compatibility import with_metaclass from sympy.core.function import AppliedUndef, FunctionCl...
def test_isTensor(self): t=self.t; tf=self.tf; a=self.a; b=self.b; x=self.x; f=self.f self.assertFalse( isTensor(a) )
<|file_name|>runhcs.go<|end_file_name|><|fim▁begin|>package runhcs import ( "bytes" "context" "fmt" "os" "os/exec" "path/filepath" "strings" "sync" "sync/atomic" irunhcs "github.com/Microsoft/hcsshim/internal/runhcs" "github.com/containerd/go-runc" ) // Format is the type of log formatting options availab...
apath, err := filepath.Abs(path) if err != nil {
<|file_name|>LangDeclarationValidityChecker.java<|end_file_name|><|fim▁begin|>/* * Asqatasun - Automated webpage assessment * Copyright (C) 2008-2020 Asqatasun.org * * This file is part of Asqatasun. * * Asqatasun is free software: you can redistribute it and/or modify * it under the terms of the GNU Aff...
<|file_name|>htmlobjectelement.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::attr::Attr; use dom::bindings::cell::DOMRe...
<|file_name|>solution.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap; // #[derive(Debug)] // struct Solution {} impl Solution { pub fn roman_to_int(s: String) -> i32 { let mut sum: i32 = 0; let table: HashMap<char, i32> = [ ('I', 1), ('V', 5), ('...
// println!("{}", Solution::roman_to_int(String::from("MCMXCIV"))); // println!("{}", Solution::roman_to_int(String::from("MCDLXXVI"))); // }
<|file_name|>navtreeindex5.js<|end_file_name|><|fim▁begin|>var NAVTREEINDEX5 = { "structcrossbow_1_1serializer__into__array.html#a055a25fc545818f211721c9c1897e710":[2,0,0,58,0], "structcrossbow_1_1serializer__into__array.html#a0df5a581aa43a0e27b9a198959273f3f":[2,0,0,58,1], "structcrossbow_1_1serializer__into__array.ht...
"structcrossbow_1_1size__policy_3_01_archiver_00_01boost_1_1optional_3_01_t_01_4_01_4.html":[2,0,0,63],
<|file_name|>sagas.js<|end_file_name|><|fim▁begin|>import { takeLatest, call, put } from 'redux-saga/effects'; import { gql } from 'react-apollo'; import { push } from 'react-router-redux'; import jwtDecode from 'jwt-decode'; import { setJwtToken } from '../../utils/auth'; import { bootstrap } from '../../utils/sagas'...
yield put(loginSuccess(userInfo));
<|file_name|>color-picker-class.js<|end_file_name|><|fim▁begin|>import { extend, colorRgbToHex, colorRgbToHsl, colorHslToHsb, colorHslToRgb, colorHsbToHsl, colorHexToRgb, nextTick, deleteProps, } from '../../shared/utils'; import Framework7Class from '../../shared/class'; import $ from '../../shared/d...
self.$el = $(self.render()); self.$el[0].f7ColorPicker = self;
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import json from app import models from django.test import Client, TestCase from django.contrib.auth.hashers import make_password from django.contrib.auth.models import User from django.core.urlresolvers import reverse # Create your tests here. class TestLecturerWeb(...
url = reverse('lecturer:api-exercise-store') + '?action=group&gid=1' response = self.client.get(url) self.assertEqual(200, response.status_code)
<|file_name|>adam.py<|end_file_name|><|fim▁begin|># Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the s...
@register_optimizer('adam')
<|file_name|>file_util_test.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Copyright 2022 The Google Research 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.apa...
""" input_lines = ['hello world', '(hello) "world"', '(hello) !!!!!!!!!!! @~#$%^&*()_+"world"',