prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>16.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python from typing import List, Optional """ 16. 3Sum Closest https://leetcode.com/problems/3sum-closest/ """ def bsearch(nums, left, right, res, i, j, target): while left <= right: middle = (left + right) // 2 candidate = nums[i] + num...
if __name__ == '__main__':
<|file_name|>cgnv6_lsn_stun_timeout_udp.py<|end_file_name|><|fim▁begin|>from a10sdk.common.A10BaseClass import A10BaseClass class Udp(A10BaseClass): """Class Description:: Set UDP STUN timeout. Class udp supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT...
self.port_end = "" self.timeout = "" self.uuid = ""
<|file_name|>River Valley Gold Bar_neighbor.js<|end_file_name|><|fim▁begin|>var RiverValleyGoldBar = { "type": "FeatureCollection", "features": [ { "geometry": { "type": "Polygon", "coordinates": [ [ [ -113.40145458936446, 53.55763251534...
<|file_name|>column.cpp<|end_file_name|><|fim▁begin|>/* * Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> * * 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 I...
* you may not use this file except in compliance with the License. * You may obtain a copy of the License at
<|file_name|>kir.py<|end_file_name|><|fim▁begin|>''' *** Ki Renamer *** usage: kir <filter> <rule> [-p] [-r] <filter> Regex - Filter the files to rename <rule> Renaming rule Options: --version Displays the current version of Ki Renamer -h, --help Show usage and ...
<|file_name|>show-trial-signup.js<|end_file_name|><|fim▁begin|>var utils = require('../../lib/utils'); // if they agree to the ULA, notify hubspot, create a trial and send verification link module.exports = function trialSignup(request, reply) { var postToHubspot = request.server.methods.npme.sendData, getCusto...
<|file_name|>measured.cpp<|end_file_name|><|fim▁begin|>/* pbrt source code Copyright(c) 1998-2012 Matt Pharr and Greg Humphreys. This file is part of pbrt. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:...
and the normal, and delta theta and delta phi are the offset in theta and phi of one of the two directions. (Note that the offset would be the same for the other direction, since it's from the half-angle vector.)
<|file_name|>proto.py<|end_file_name|><|fim▁begin|>import contextlib from uuss.server import model from lolapps.common import uums from lolapps.util import json import os import simplejson import struct import time try: # Try importing the C++ extension version import uuss_pb except: # The dynamic python v...
<|file_name|>email-input.js<|end_file_name|><|fim▁begin|>"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descripto...
}; EmailInput.defaultProps = {
<|file_name|>test.js<|end_file_name|><|fim▁begin|>/** * author: Shawn * time : 2017/8/15 17:19<|fim▁hole|> var testJar = require('./testJar'); for (let i = 0; i < 10; i++) { testJar.tt(); } // testJar.tt(); // testJar.tt(); // testJar.tt();<|fim▁end|>
* desc : */
<|file_name|>test_docs.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Money doctests as unittest Suite """ # RADAR: Python2 from __future__ import absolute_import import doctest import unittest # RADAR: Python2 import money.six FILES = ( '../../README.rst',<|fim▁hole|> def load_tests(loader, tests, ...
)
<|file_name|>instrument-mappings.test.js<|end_file_name|><|fim▁begin|>/* eslint-disable no-undef,no-unused-expressions */ const request = require('supertest') const expect = require('chai').expect const app = require('../../bin/www') const fixtures = require('../data/fixtures') describe('/api/mappings', () => { bef...
name: 'DatabaseError' })
<|file_name|>action_batcher.rs<|end_file_name|><|fim▁begin|>// OpenAOE: An open source reimplementation of Age of Empires (1997) // Copyright (c) 2016 Kevin Fuller // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), ...
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
<|file_name|>motion_metrics_ops_test.py<|end_file_name|><|fim▁begin|># Copyright 2021 The Waymo Open Dataset 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 # # ...
val = self._RunEval(pred_score, pred_trajectory)
<|file_name|>app-paths.js<|end_file_name|><|fim▁begin|>const fs = require('fs') const { normalize, resolve, join, sep } = require('path') function getAppDir () {<|fim▁hole|> let dir = process.cwd() while (dir.length && dir[dir.length - 1] !== sep) { if (fs.existsSync(join(dir, 'quasar.conf.js'))) { retur...
<|file_name|>test_bleuscore.py<|end_file_name|><|fim▁begin|># ---------------------------------------------------------------------------- # Copyright 2015-2016 Nervana Systems Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You...
<|file_name|>test_schedule_jobs.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- # This file is part of PYBOSSA. # # Copyright (C) 2015 Scifabric LTD. # # PYBOSSA 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 Softwa...
# PYBOSSA is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
<|file_name|>interface_sg.py<|end_file_name|><|fim▁begin|>import os from src.core import prep from sgprocessor import * def ProcessSg(p, opts): if opts.anno == True: if 'BEDDB' not in os.environ: p.error('$BEDDB Not Exist. See README') str_path_sgfq = opts.sg str_nm = os.path.basename(o...
<|file_name|>error_handler_test.js<|end_file_name|><|fim▁begin|>process.env.NODE_ENV = 'test'; var chai = require('chai'); var chaihttp = require('chai-http'); chai.use(chaihttp); var expect = chai.expect; require(__dirname + '/../app.js'); describe('the error handler function', function() { it('should return a s...
<|file_name|>FileNameUtil.java<|end_file_name|><|fim▁begin|>/* * Copyright 2006-2016 The MZmine 3 Development Team * * This file is part of MZmine 3. * * MZmine 3 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 Foun...
<|file_name|>SurvivalAlertWin.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #PYTHON 3 only # Sample Windows Startup check -- Mail alert # SurvivalAlert v1.0 # By thxer.com # N-pn.fr Community and Hexpresso CTF team import os import socket import ctypes import smtplib #Global Variables HOSTNAME = str(socket...
<|file_name|>login_view.js<|end_file_name|><|fim▁begin|>/** A modal view for handling user logins @class LoginView @extends Discourse.ModalBodyView @namespace Discourse @module Discourse **/ Discourse.LoginView = Discourse.ModalBodyView.extend({ templateName: 'modal/login', siteBinding: 'Discourse.site',...
if (this.get('loggingIn')) { return Em.String.i18n('login.logging_in'); } return Em.String.i18n('login.title');
<|file_name|>R$primitive$attr$assign.java<|end_file_name|><|fim▁begin|>package org.renjin.primitives; import org.renjin.eval.Context; import org.renjin.eval.EvalException; import org.renjin.primitives.annotations.processor.ArgumentException; import org.renjin.primitives.annotations.processor.ArgumentIterator; import o...
extends BuiltinFunction
<|file_name|>jupyterhub_config.py<|end_file_name|><|fim▁begin|># THIS FILE IS CONTROLLED BY ELASTICLUSTER # local modifications will be overwritten # the next time `elasticluster setup` is run! # # # Configuration file for jupyterhub. # #------------------------------------------------------------------------------ #...
# Use with ssl_cert c.JupyterHub.ssl_key = '/etc/jupyterhub/jupyterhub.key.pem' #------------------------------------------------------------------------------
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
__author__ = 'ralmn'
<|file_name|>seatmyself.py<|end_file_name|><|fim▁begin|>############################## # # # Instructions # # # ############################## # To run, use the following command: # $ python seating.py <input_file> # where <input_file> is the filename...
<|file_name|>deps.py<|end_file_name|><|fim▁begin|>from collections import OrderedDict, defaultdict, deque from typing import List, Dict, Deque from acbs.find import find_package from acbs.parser import ACBSPackageInfo, check_buildability # package information cache pool: Dict[str, ACBSPackageInfo] = {} def tarjan_s...
def prepare_for_reorder(package: ACBSPackageInfo, packages_list: List[str]) -> ACBSPackageInfo: """This function prepares the package for reordering. The idea is to move the installable dependencies which are in the build list to the "uninstallable" list. """
<|file_name|>SmartHouseConfigReadError.java<|end_file_name|><|fim▁begin|>package si.majeric.smarthouse.xstream.dao; public class SmartHouseConfigReadError extends RuntimeException { private static final long serialVersionUID = 1L; public SmartHouseConfigReadError(Exception e) { super(e);<|fim▁hole|><|fim▁end|>
} }
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import string import random import json from collections import defaultdict from django.http import HttpResponse from django.shortcuts import render_to_response from django.template.context import RequestContext from catmaid.fields import Double3D from catmaid.mode...
""" Joins to URL parts a and b while making sure this exactly one slash inbetween. """ if a[-1] != '/':
<|file_name|>svgreader.cpp<|end_file_name|><|fim▁begin|>/** * Phoebe DOM Implementation. * * This is a C++ approximation of the W3C DOM model, which follows * fairly closely the specifications in the various .idl files, copies of * which are provided for reference. Most important is this one: * * http://www.w3....
<|file_name|>wiki.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 """ Wikipedia lookup plugin for Botty. Example invocations: <|fim▁hole|> #general | Me: wtf is water #general | Botty: wikipedia says, "Water (chemical formula: H2O) is a transparent fluid which forms the world's streams, lakes, oce...
#general | Me: what is fire #general | Botty: wikipedia says, "Fire is the rapid oxidation of a material in the exothermic chemical process of combustion, releasing heat, light, and various reaction products. Slower oxidative processes like rusting or digestion are not included by this definition." #g...
<|file_name|>code_location.go<|end_file_name|><|fim▁begin|>package codelocation<|fim▁hole|> "runtime" "runtime/debug" "strings" "github.com/mysza/go-service-template/Godeps/_workspace/src/github.com/onsi/ginkgo/types" ) func New(skip int) types.CodeLocation { _, file, line, _ := runtime.Caller(skip + 1) stackTra...
import ( "regexp"
<|file_name|>markdown.rs<|end_file_name|><|fim▁begin|>// This code is heavily inspired by hoedown. // // Performance observations: //<|fim▁hole|> static SP: u8 = b' '; static NL: u8 = b'\n'; static CR: u8 = b'\r'; static TAB: u8 = b'\t'; static STAR: u8 = b'*'; static DASH: u8 = b'-'; static UNDERSCORE: u8 = b'_'; sta...
// Note that buf.head() == Some(&ch) is much faster than buf[0] == ch. //
<|file_name|>DiscoveryPacket.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export default interface DiscoveryPacket { timestamp: number; apiVersion: number; port: number; }<|fim▁end|>
<|file_name|>bitcoin_ca_ES.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="ca_ES" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About ShardScrypt</s...
<message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<|file_name|>view_major.py<|end_file_name|><|fim▁begin|>from flask import * from playhouse.flask_utils import * import string from app import app from model import Major, Minor, Store, Transaction, Item @app.route('/major', methods=['GET', 'POST']) def major_list(): query = Major \ .select(Major, Min...
<|file_name|>time-until-element.ts<|end_file_name|><|fim▁begin|>import RelativeTime from './relative-time' import RelativeTimeElement from './relative-time-element' import {localeFromElement} from './utils' export default class TimeUntilElement extends RelativeTimeElement { getFormattedDate(): string | undefined { ...
'time-until': TimeUntilElement } }
<|file_name|>input-base.js<|end_file_name|><|fim▁begin|>var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; (funct...
{ type: config_1.Config, }, { type: form_1.Form, }, { type: item_1.Item, }, { type: app_1.App, },
<|file_name|>stoplossorder.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from .baserequest import BaseRequest from oandapyV20.types import TradeID, PriceValue from oandapyV20.definitions.orders import TimeInForce, OrderType class StopLossOrderRequest(BaseRequest): """create a StopLossOrderRequest. ...
>>> ordr = StopLossOrderRequest(tradeID="1234", price=1.07)
<|file_name|>top.py<|end_file_name|><|fim▁begin|>import os, sys from datetime import datetime from typing import List import boto3 import botocore.exceptions from . import register_parser from .util import ThreadPoolExecutor from .util.printing import format_table, page_output def get_stats_for_region(region): t...
def top(args): table = [] # type: List[List] columns = ["Region", "Instances", "AMIs", "VPCs", "Network interfaces", "EBS volumes"] executor = ThreadPoolExecutor()
<|file_name|>Globals.cpp<|end_file_name|><|fim▁begin|>//////////////////////////////////////////////////////////////////////////////////////////////////////// // Part of Injectable Generic Camera System // Copyright(c) 2017, Frans Bouma // All rights reserved. // https://github.com/FransBouma/InjectableGenericCameraSys...
// list of conditions and the following disclaimer. // // * Redistributions in binary form must reproduce the above copyright notice,
<|file_name|>login-new.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { LoginNewComponent } from './login-new.component'; describe('LoginNewComponent', () => { let component: LoginNewComponent; let fixture: ComponentFixture<LoginNewC...
it('should create', () => { expect(component).toBeTruthy(); });
<|file_name|>tsv-convert.py<|end_file_name|><|fim▁begin|>#!bin/python # TSV to Dublin Core/McMaster Repository conversion tool # Matt McCollow <mccollo@mcmaster.ca>, 2011 # Nick Ruest <ruestn@mcmaster.ca>, 2011 from DublinCore import DublinCore import csv from sys import argv from xml.dom.minidom import Document from...
doc.appendChild(root) oldnid = doc.createElement('macrepo:oldNid') oldnid.appendChild(doc.createTextNode(row.get('macrepo:oldNid', ''))) root.appendChild(oldnid)
<|file_name|>api_permissions.py<|end_file_name|><|fim▁begin|>from rest_framework.permissions import BasePermission class HasValidProjectToken(BasePermission): """ Return True if the request has a valid project token. """<|fim▁hole|><|fim▁end|>
def has_permission(self, request, view): return bool(request.auth)
<|file_name|>utils.cpp<|end_file_name|><|fim▁begin|>// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // ht...
termios old_termios;
<|file_name|>TrackingLiteVoAssembler.java<|end_file_name|><|fim▁begin|>//############################################################################# //# # //# Copyright (C) <2014> <IMS MAXIMS> # //# ...
return valueObjectSrc; } valueObjectDest.setID_Tracking(valueObjectSrc.getID_Tracking()); valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE());
<|file_name|>user.ts<|end_file_name|><|fim▁begin|>export class User { constructor( public login: string,<|fim▁hole|>}<|fim▁end|>
public avatar: string ) {}
<|file_name|>DslField.java<|end_file_name|><|fim▁begin|>/* * Copyright 2017 Courtanet * * 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...
public interface DslField<T> extends Readable {
<|file_name|>search.py<|end_file_name|><|fim▁begin|>""" /** * Ossec Framework * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any l...
# unset($_POST['finaldate']);
<|file_name|>to_TO_test.go<|end_file_name|><|fim▁begin|>package to_TO import ( "testing" "time" "github.com/go-playground/locales" "github.com/go-playground/locales/currency" ) func TestLocale(t *testing.T) { trans := New() expected := "to_TO" if trans.Locale() != expected { t.Errorf("Expected '%s' Got '%...
// v: 3, // currency: currency.USD, // expected: "$221,123,456.564", // },
<|file_name|>viewport_rule.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/. */ //! The [`@viewport`][at] at-rule and [`meta`][meta] el...
iter.next().unwrap().to_css(&mut CssWriter::new(dest))?; for declaration in iter {
<|file_name|>quartet_sampling.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- # vim:fileencoding=utf-8 """ quartet_samping.py: Quartet Sampling method for phylogenetic branch support evaluation <http://www.github.com/FePhyFoFum/quartetsampling> """ import argparse import os import sys ...
pool.join() del pool # print("")
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! FFI bindings for `energymon-osp-polling.h`. extern crate libc; extern crate energymon_sys; pub use energymon_sys::energymon; use libc::{c_int, uint64_t, c_char, size_t}; extern "C" { pub fn energymon_init_osp_polling(em: *mut energymon) -> c_int; <|fim▁hole|> ...
pub fn energymon_read_total_osp_polling(em: *const energymon) -> uint64_t;
<|file_name|>0024_auto_20160325_1916.py<|end_file_name|><|fim▁begin|><|fim▁hole|># -*- coding: utf-8 -*- from __future__ import unicode_literals import django.utils.timezone from django.db import migrations from django.db import models class Migration(migrations.Migration): dependencies = [ ('orchestra'...
<|file_name|>DoubleList.java<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2016 QAware GmbH * * 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/...
* @return a clone of this <tt>LongList</tt> instance */ public DoubleList copy() { DoubleList v = new DoubleList(size);
<|file_name|>client.go<|end_file_name|><|fim▁begin|>// Copyright 2017 Istio 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 //...
_, err := os.Stat(kubeconfig) if err != nil { kubeconfig = defaultCfg
<|file_name|>qgsvertextool.cpp<|end_file_name|><|fim▁begin|>/*************************************************************************** qgsvertextool.cpp -------------------------------------- Date : February 2017 Copyright : (C) 2017 by Martin Dobias Email : wonder ...
QgsVertexId vid;
<|file_name|>registry.go<|end_file_name|><|fim▁begin|>package proxy import ( "fmt" "github.com/hashicorp/serf/command" "github.com/mitchellh/cli" "math/rand" "strings" ) // Service contains all the addresses for a current service. // The Service current supports random retrieval of available services. type Servi...
}
<|file_name|>demo_satpy_ndvi_decorate.py<|end_file_name|><|fim▁begin|>#from satpy import Scene from satpy.utils import debug_on debug_on() #from glob import glob #base_dir="/data/COALITION2/database/meteosat/radiance_HRIT/case-studies/2015/07/07/" #import os #os.chdir(base_dir) #filenames = glob("*201507071200*__") #p...
print dir(global_scene)
<|file_name|>info_fn_imps.hpp<|end_file_name|><|fim▁begin|>// -*- C++ -*- // Copyright (C) 2005-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms // of the GNU General Public License as pub...
inline typename PB_DS_CLASS_C_DEC::size_type PB_DS_CLASS_C_DEC:: max_size() const {
<|file_name|>Font.js<|end_file_name|><|fim▁begin|>/* ************************************************************************ Copyright: <|fim▁hole|> ************************************************************************ */ qx.Theme.define("qjide.theme.Font", { extend : qx.theme.modern.Font, fonts ...
License: Authors:
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import json from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.urls import reverse from django.db import models from django.utils.html import strip_tags<|fim▁hole|>from six import text_type class Note(models.M...
from opaque_keys.edx.django.models import CourseKeyField
<|file_name|>test_mlresult.py<|end_file_name|><|fim▁begin|>import os import unittest import numpy as np from tfsnippet.examples.utils import MLResults from tfsnippet.utils import TemporaryDirectory def head_of_file(path, n): with open(path, 'rb') as f: return f.read(n) class MLResultTestCase(unittest....
results.save_image('test.jpg', im) file_path = os.path.join(tmpdir, 'test.jpg')
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>/// <reference types="node" /> declare module 'sqlite3' { // Type definitions for sqlite3 3.1 // Project: http://github.com/mapbox/node-sqlite3 // Definitions by: Nick Malaguti <https://github.com/nmalaguti> // Sumant Manne <https://github.co...
sql: string, params: any, callback?: (this: RunResult, err: Error | null) => void
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian // Licensed under the MIT License <LICENSE.md><|fim▁hole|><|fim▁end|>
fn main() { println!("cargo:rustc-flags=-l els"); }
<|file_name|>sample.js<|end_file_name|><|fim▁begin|>var KeyVault = require('azure-keyvault'); var util = require('util'); var Crypto = require('crypto'); var AuthenticationContext = require('adal-node').AuthenticationContext; var clientId = '<to-be-filled>'; var clientSecret = '<to-be-filled>'; var vaultUri = '<to-be-...
// Update the key with new tags client.updateKey(keyBundle.key.kid, {tags: {'tag1': 'this is tag1', 'tag2': 'this is tag2'}}, function (getErr, updatedKeyBundle) {
<|file_name|>Module.py<|end_file_name|><|fim▁begin|># Copyright 2015 John Reese # Licensed under the MIT license<|fim▁hole|> from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import sys class Module: """ This class provides a generic interface...
<|file_name|>nedb.repository.ts<|end_file_name|><|fim▁begin|>import IModelRepository from '../engine/IModelRepository'; import Model from '../entities/model.entity'; import { IWhereFilter } from "../engine/filter/WhereFilter"; var DataStore = require('NeDb'); /** * This class is a simple implementation of the NeDB d...
* @param: [where] IWhereFilter * Optional where filter, like { key: val, key2: {gt: 'val2'}, ...} * see Where filter. */
<|file_name|>JobContext.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 this file to You under th...
* (the "License"); you may not use this file except in compliance with
<|file_name|>general.js<|end_file_name|><|fim▁begin|>// Copyright 2014 The Oppia 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...
exports.checkForConsoleErrors = checkForConsoleErrors;
<|file_name|>bucket.rs<|end_file_name|><|fim▁begin|>// TODO: Remove when the routing table uses the new bucket iterators. #![allow(unused)] use std::iter::Filter; use std::net::{Ipv4Addr, SocketAddrV4, SocketAddr}; use std::slice::Iter; use bip_util::bt::{self, NodeId}; use routing::node::{Node, NodeStatus}; /// Ma...
#[test] fn positive_resist_good_node_churn() { let mut bucket = Bucket::new();
<|file_name|>auto_seq2seq.py<|end_file_name|><|fim▁begin|># # Copyright 2018 Analytics Zoo 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...
remote_dir=None, ): """ Create an AutoSeq2Seq.
<|file_name|>issue-3743.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/lice...
<|file_name|>test_stock_cycle_count.py<|end_file_name|><|fim▁begin|># Copyright 2017 ForgeFlow S.L. # (http://www.forgeflow.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from datetime import datetime, timedelta from odoo.exceptions import AccessError, ValidationError from odoo.tests impo...
self.count_loc = self.stock_location_model.create(
<|file_name|>city.cpp<|end_file_name|><|fim▁begin|>/* * File: city.cpp * Author: matthew * * Created on 24 October 2013, 20:28 */ #include <gtk/gtk.h> #include <iostream> #include <stdlib.h> /* abs */<|fim▁hole|>#include "city.h" #include "unit_ref.h" #include "includes.h" using namespace std; cCity::cC...
<|file_name|>global.rs<|end_file_name|><|fim▁begin|>//! The global state. use parking_lot::Mutex; use std::collections::HashSet; use std::{mem, panic}; use {rand, hazard, mpsc, debug, settings}; use garbage::Garbage; lazy_static! { /// The global state. /// /// This state is shared between all the threads...
/// currently active in the hazards. fn try_gc(&self) -> Result<(), ()> { // Lock the "garbo" (the part of the state needed to GC). if let Some(mut garbo) = self.garbo.try_lock() {
<|file_name|>WellTile.js<|end_file_name|><|fim▁begin|>"use strict"; class WellTile extends Tile { constructor(row, column) { super("brunnen.gif", row, column); this.tooltip_name = "WELL"; this.build_costs = { humansidle: 5 }; this.production = { water: 1 }; this.counter = 1;...
}
<|file_name|>1.cc<|end_file_name|><|fim▁begin|>// 20020717 gdr // Copyright (C) 2002-2021 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by t...
// any later version. // This library is distributed in the hope that it will be useful,
<|file_name|>espressopp_polymer_melt.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: iso-8859-1 -*- ########################################################################### # # # ESPResSo++ Benchmark Python script for a pol...
system.storage.addParticles(new_particles, *props)
<|file_name|>registerCtrl.js<|end_file_name|><|fim▁begin|>capstone.controller("RegisterCtrl", function($scope,$http,AuthFactory,$location,user1){ // $(".button-collapse").sideNav(); $http.get(`states.json`) .then((data)=>{ $scope.stateName = data.data console.log($scope.stateName) $('input.autocomplete').autocompl...
<|file_name|>instance_molten_core.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: http://github.com/azerothcore/azerothcore-wotlk/LICENSE-GPL2 * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2...
}
<|file_name|>pyprops.cpp<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> #include <string> #include <sstream> using std::string; using std::ostringstream; // 'cache' is a global c-string -> python unicode name cache. This // conversion is relatively costly in python3, so this cache save // repeating the work many times ...
* C++ interface to a python PropertyNode() */ #include "pyprops.h"
<|file_name|>WarehouseProductDAO.java<|end_file_name|><|fim▁begin|>package com.storage.mywarehouse.Dao; import com.storage.mywarehouse.View.WarehouseProduct; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.criterion.Restrictions; import java.util.List; public class WarehouseProdu...
.add(Restrictions.eq("quantity", quantity)) .list();
<|file_name|>block.js<|end_file_name|><|fim▁begin|>class Block { constructor(x, y, width, colour) { this.x = x; this.y = y;<|fim▁hole|> this.occupied = false; } draw() { fill(this.colour); rect(this.x, this.y, this.width, this.width); } }<|fim▁end|>
this.width = width; this.colour = colour;
<|file_name|>table.rs<|end_file_name|><|fim▁begin|>use std::cmp::max; use std::env; use std::ops::Deref; use std::sync::{Mutex, MutexGuard}; use datetime::TimeZone; use zoneinfo_compiled::{CompiledData, Result as TZResult}; use lazy_static::lazy_static; use log::*; use users::UsersCache; use crate::fs::{File, fields...
} pub fn widths(&self) -> &TableWidths {
<|file_name|>get_snmp_name_desc.py<|end_file_name|><|fim▁begin|>''' get_snmp_name_desc.py ''' from snmp_helper import snmp_get_oid,snmp_extract PORT=161 COMMUNITY='galileo'<|fim▁hole|>for rtr in rtrs.keys(): print rtr for oid in oids.keys(): print " " + oid + " = " + snmp_extract(snmp_get_oid((rtrs...
rtrs={'pynet-rtr1':'184.105.247.70', 'pynet-rtr2':'184.105.247.71'} oids={'sysName':'1.3.6.1.2.1.1.5.0', 'sysDescr':'1.3.6.1.2.1.1.1.0'}
<|file_name|>comments.py<|end_file_name|><|fim▁begin|>from django.shortcuts import redirect from portfolio.models.comments import PhotoComment from portfolio.models.photos import Photo from portfolio.views.base import AuthenticatedView class CommentPhotoView(AuthenticatedView): """ View that handles commenting o...
return redirect('portfolio.photo.view', photo_id=photo)
<|file_name|>log.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free * Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WA...
/* Copyright (C) 2018 Open Information Security Foundation
<|file_name|>nasm_spec.js<|end_file_name|><|fim▁begin|>var expect = require('chai').expect; var runner = require('../runner'); describe('nasm runner', function() { describe('.run', function() { it('should handle basic code evaluation (no libc)', function(done) { runner.run({ language: 'nasm', ...
' mov rdx, 25', ' syscall', ' mov eax, 60', ' xor rdi, rdi',
<|file_name|>method.go<|end_file_name|><|fim▁begin|>package main import ( "go/ast" "go/token" "strings" ) type method struct { name *ast.Ident params []arg results []arg structsResolved bool } func (m method) definition(ifc iface) ast.Decl { notImpl := fetchFuncDecl("ExampleEndpoi...
<|file_name|>reservation.js<|end_file_name|><|fim▁begin|>import React, {Component} from 'react'; import {View, Text} from 'react-native'; import {xdateToData} from '../../interface'; import XDate from 'xdate'; import dateutils from '../../dateutils'; import styleConstructor from './style'; class ReservationListItem ex...
const firstItem = date ? true : false; content = this.props.renderItem(reservation, firstItem);
<|file_name|>GetFormat.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public L...
private static void assertEquals(Object a, Object b) throws Exception
<|file_name|>PatchFileType.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.apache.org/license...
* See the License for the specific language governing permissions and * limitations under the License.
<|file_name|>router.js<|end_file_name|><|fim▁begin|>import React from 'react'; import { applyRouterMiddleware, Router, Route } from 'dva/router'; import { useScroll } from 'react-router-scroll'; import App from '@/app/App';<|fim▁hole|> function RouterConfig({ history }) { return ( <Router history={history} rende...
<|file_name|>test_decorators.py<|end_file_name|><|fim▁begin|>from datetime import datetime, timedelta from django import http from django.conf import settings from django.core.exceptions import PermissionDenied import mock import pytest from olympia.amo.tests import BaseTestCase, TestCase from olympia.amo import dec...
def test_not_set_modified_on(self): yesterday = datetime.today() - timedelta(days=1) qs = UserProfile.objects.all()
<|file_name|>OpenHillShade_September_noon_Listener.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
energymodels.OpenHillShade_September_noon_Listener
<|file_name|>run_test.go<|end_file_name|><|fim▁begin|>package integration_test import ( "fmt" "regexp" "runtime" "strings" . "github.com/onsi/ginkgo" "github.com/onsi/ginkgo/types" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" "github.com/onsi/gomega/gexec" ) var _ = Describe("Running Specs", f...
if strings.Contains(line, "Random Seed:") { randomSeeds = append(randomSeeds, strings.Split(line, ": ")[1]) }
<|file_name|>poll_token_derive.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #![recursion_limit = "128"] extern crate proc_macro; use proc_macro2::{Ident, TokenStr...
// Generates the function body for `from_raw_token`. fn generate_from_raw_token(enum_name: &Ident, variants: &[Variant]) -> TokenStream {
<|file_name|>setUpNavigator.js<|end_file_name|><|fim▁begin|>/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow strict<|fim▁hole|> * @format */ 'use strict'; const {polyfil...
<|file_name|>VersionedHashRevisionTracker.cc<|end_file_name|><|fim▁begin|>// ---------------------------------------------------------------------- // File: VersionedHashRevisionTracker.cc // Author: Georgios Bitzes - CERN // ---------------------------------------------------------------------- /*********************...
* You should have received a copy of the GNU General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>.* ************************************************************************/