prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>nileServer.js<|end_file_name|><|fim▁begin|>const express = require('express'); const path = require('path'); const fs = require('fs'); const bodyParser = require('body-parser') // const formidable = require('formidable'); // const createTorrent = require('create-torrent'); // const WebTorrent = require('we...
<|file_name|>_y.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators class YValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__(self, plotly_name="y", parent_name="bar", **kwargs): super(YValidator, self).__init__(<|fim▁hole|> parent_name=parent_name, ...
plotly_name=plotly_name,
<|file_name|>table_cache.py<|end_file_name|><|fim▁begin|>"""Cache util functions for ReSDKTables.""" import os import pickle import sys from shutil import rmtree from typing import Any from resdk.__about__ import __version__ def _default_cache_dir() -> str: """Return default cache directory specific for the curr...
cache_dir = cache_dir_resdk_base() if os.path.exists(cache_dir): rmtree(cache_dir)
<|file_name|>test_retention.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import types from datetime import datetime, timedelta from django.utils.timezone import now as timezone_now from zerver.lib.test_classes import ZulipTestCase from zerver.lib.upload import create_attachment from zerver.models import Mes...
# type: ()-> None
<|file_name|>eq_string.rs<|end_file_name|><|fim▁begin|>extern crate env_logger; extern crate must; use must::*; <|fim▁hole|> let _ = env_logger::init(); eq("", "").unwrap(); } #[test] #[should_panic(expected = "Diff: foo -bar baz +bar quux")] fn str_fail() { let _ = env_logger::init(); env::...
use std::env; #[test] fn ok() {
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. //<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/...
<|file_name|>EnemyFormation.ts<|end_file_name|><|fim▁begin|>import {scrheight, scrwidth} from "./canvas"; import {easeInOutQuad} from "./ease"; import Enemy, {IEnemyConfig} from "./Enemy"; import {addListener, emit, Events} from "./EventListener"; import {dt, player} from "./game"; import {images} from "./imageLoader";...
<|file_name|>Instance.hpp<|end_file_name|><|fim▁begin|>#ifndef INSTANCE_H #define INSTANCE_H #include "ECStd.hpp" #include "Graphics.hpp" #include "InputMan.hpp" class Instance { bool _running; public: const uint WIDTH = 1024, HEIGHT = 768; SDL_Surface* surface; InputMan* in; Bi...
// Called by the main loop. ALL RENDERING SHOULD BE DONE HERE. virtual void render(Graphics* g) = 0;
<|file_name|>util.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from twiml_server import app def make_json_app(): def make_json_error(ex): response = jsonify(message=str(ex)) response.status_code = (ex.code if isinstance(ex, HTTPException) ...
import types from flask import jsonify from werkzeug.exceptions import default_exceptions from werkzeug.exceptions import HTTPException
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>use {MessageBuilder, Priority}; use notification::NotificationBuilder; use std::collections::HashMap; #[test] fn should_create_new_message() { let msg = MessageBuilder::new("token").finalize(); assert_eq!(msg.to, "token"); } #[test] fn should_set_registratio...
assert_eq!(msg.priority, Some(Priority::Normal)); }
<|file_name|>subclass.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python3 # _*_ coding:utf8 _*_ # Power by zuosc 2016-10-23 'subclass demo 继承和多态'<|fim▁hole|> class Animal(object): def run(self): print('Animal is running......') class Dog(Animal): def run(self): print('Dog is running........
<|file_name|>patchDiff.js<|end_file_name|><|fim▁begin|>import * as R from 'ramda'; import { getPatchPath } from 'xod-project'; import { isAmong } from 'xod-func-tools'; import { def } from './types'; import { CHANGE_TYPES } from './constants'; const isEqualPatchPaths = def( 'isEqualPatchPaths :: Patch -> Patch -> B...
R.converge(R.unapply(R.unnest), [ calculateAdded, calculateModified,
<|file_name|>lib.js<|end_file_name|><|fim▁begin|>document.onmousemove = moveDefence; var width = 1200; var height = 600; var ballPerSeconds = 1; var canvas = document.getElementById('myCanvas'); var ctx = canvas.getContext('2d'); var allBalls = new Array(); var defence = { start: 0, end: (Math.PI) / 3, jiao...
ctx.fill()
<|file_name|>JPC.py<|end_file_name|><|fim▁begin|># coding: utf-8 from geventwebsocket.handler import WebSocketHandler from gevent import pywsgi, sleep import json import MySQLdb class JPC: # # 初期化 # def __init__(self, filepath_config): import hashlib # 設定ファイルをロード fp = open(file...
],
<|file_name|>filters.py<|end_file_name|><|fim▁begin|># encoding: utf-8 '''Template filters ''' def j(s): """Escape for JavaScript or encode as JSON""" pass <|fim▁hole|> from cjson import encode as _json except ImportError: try: from minjson import write as _json except ImportError: import re _RE =...
try:
<|file_name|>FrameworkObject.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ''' Copyright (c) 2013, LastSeal S.A. Copyright (c) 2011-2012, Joaquin G. Duo All rights reserved. This code is distributed under BSD 3-clause License. For details check the LICENSE file in the root of the project. ''' class Framewo...
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ...
operations = [ migrations.CreateModel( name='Comment',
<|file_name|>calibration.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Nov 15 14:09:59 2017 @author: SaintlyVi """ import pandas as pd import numpy as np from support import writeLog def uncertaintyStats(submodel): """ Creates a dict with statistics for obs...
hp_unit, euclid_hp, count_hp] log_lines = pd.DataFrame([loglineds, loglinehp], columns = ['year','experiment', 'submodel','min_answerid_count','min_valid_obsratio',
<|file_name|>word2vec_basic.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/lic...
# construction are also the most frequent.
<|file_name|>bitcoin_th_TH.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="th_TH" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Linkcoin</sour...
<context>
<|file_name|>factories.py<|end_file_name|><|fim▁begin|># pylint: disable=missing-docstring from datetime import datetime, timedelta import factory import pytz from factory.django import DjangoModelFactory from factory.fuzzy import FuzzyText from oauth2_provider.models import AccessToken, Application, RefreshToken f...
scopes = ['grades:read']
<|file_name|>api.py<|end_file_name|><|fim▁begin|><|fim▁hole|> mod = flask.Blueprint('api', __name__)<|fim▁end|>
import flask
<|file_name|>wow.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1<|fim▁hole|><|fim▁end|>
oid sha256:4fc049501415815d5fa555bc735c359c381441d2107851b32b30ae5ba192a892 size 11548
<|file_name|>wavedrom.hpp<|end_file_name|><|fim▁begin|>/** * @file wavedrom.hpp * @author Jeramie Vens * @date March 7, 2016: Initial version * @brief This is the main include for the Wavedrom C++ Library * */ #ifndef WAVEDROM_HPP #define WAVEDROM_HPP #include "../libwavedrom/group.hpp" #inclu...
<|file_name|>BlockLowPassVector.hpp<|end_file_name|><|fim▁begin|>/**************************************************************************** * * Copyright (C) 2012 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted pro...
<|file_name|>slugify.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Copyright © Val Neekman ([Neekware Inc.](http://neekware.com)) [ info@neekware.com, [@vneekman](https://twitter.com/vneekman) ] All rights reserved. Redistribution and use in source and binary forms, with or without modification,...
<|file_name|>env.js<|end_file_name|><|fim▁begin|>const defaultEnv = process.env.NODE_ENV || 'development'; function getEnv(name = defaultEnv) {<|fim▁hole|>} const env = getEnv(); module.exports = env;<|fim▁end|>
const isProduction = name === 'production' || name === 'prod'; const isDev = !isProduction; return { name, isProduction, isDev, getEnv };
<|file_name|>ArchiveNM.py<|end_file_name|><|fim▁begin|># Python 3: ArchiveNM.py # Function: # This will collect the files in /home/postgres that # need to be sent to a new Natural Message machine # that is being initialized. This currently grabs # directory server and shard server files. # It can also be used a...
'scan_shard_delete.sql',
<|file_name|>CMutex.cpp<|end_file_name|><|fim▁begin|>//============== IV: Multiplayer - http://code.iv-multiplayer.com ============== // // File: CMutex.cpp // Project: Shared // Author(s): jenksta // License: See LICENSE in root directory // //===========================================================================...
{ // Decrement the lock count
<|file_name|>jquery.squeezebox.js<|end_file_name|><|fim▁begin|>// Replacement for jquery.ui.accordion to avoid dealing with // jquery.ui theming. // // Usage: $('#container').squeezebox(options); // where the direct child elements of '#container' are // sequential pairs of header/panel elements, and options // is an...
panel.slideDown(options.speed); $(header).addClass(options.activeHeaderClass);
<|file_name|>main.go<|end_file_name|><|fim▁begin|>// Copyright 2017-2019 the u-root 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 main import ( "flag" "fmt" "log" "os" "path" "path/filepath" "github.com/u-root/u-roo...
// The third parameter, `guid`, is the partition GUID to look for.
<|file_name|>store.js<|end_file_name|><|fim▁begin|>/** * 对Storage的封装 * Author : smohan * Website : https://smohan.net * Date: 2017/10/12 * 参数1:布尔值, true : sessionStorage, 无论get,delete,set都得申明 * 参数1:string key 名 * 参数2:null,用作删除,其他用作设置 * 参数3:string,用于设置键名前缀 * 如果是sessionStorage,即参数1是个布尔值,且为true, * 无论设置/删除/获取都应该...
} let _value = undefined try { _value = JSON.parse(Storage.getItem(cacheKey))
<|file_name|>test_mullerbrownpot.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import copy import matplotlib.pyplot as plt import numpy as np import pytest from pysisyphus.plotters.AnimPlot import AnimPlot from pysisyphus.calculators.MullerBrownPot import MullerBrownPot #from pysisyphus.calculators.MullerBr...
convergence = { "rms_force_thresh": 2.4,
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use unix::bsd::O_SYNC; pub type clock_t = i64; pub type suseconds_t = ::c_long; pub type dev_t = i32; pub type sigset_t = ::c_uint; pub type blksize_t = ::int32_t; pub type fsblkcnt_t = ::uint64_t; pub type fsfilcnt_t = ::uint64_t; pub type pthread_attr_t = *mut ::c_voi...
pub fn pthread_main_np() -> ::c_int;
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>""" Django settings for CatyHIS project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside...
<|file_name|>application_ref_spec.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {APP_BOOTSTRAP_LISTENER, APP_INITIALIZER, C...
<|file_name|>server.rs<|end_file_name|><|fim▁begin|>use std::sync::mpsc::{self, Sender, Receiver}; use std::collections::{HashMap, HashSet}; use std::net::{TcpListener, TcpStream}; use std::fmt::Debug; use libc::EINPROGRESS; use net2::{TcpBuilder, TcpStreamExt}; use serde::{Serialize, Deserialize}; use msgpack::{Serial...
reader: FrameReader, writer: FrameWriter }
<|file_name|>load_balancer_certificates_data_source_test.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. // Licensed under the Mozilla Public License v2.0 package oci import ( "testing" "github.com/terraform-providers/terraform-provider-oci/httpreplay...
display_name = "-tf-subnet"
<|file_name|>multiple_tags.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> fn main() { } #[not_safe(a)] fn unsafe_method() { } fn wrapper() { unsafe_method() } #[not_safe(b)] fn unsafe_b_method() { } #[not_safe(a,c)] fn unsafe_ac_method() { } #[deny(not_tagged_safe)] #[req_safe(a,c)] fn caller() { wrapper(); /...
#![feature(custom_attribute,plugin)] #![plugin(tag_safe)] #![allow(dead_code)]
<|file_name|>boltzmann_reward_prediction_policy.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Copyright 2020 The TF-Agents 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 # # ...
@property def accepts_per_arm_features(self): return self._accepts_per_arm_features
<|file_name|>machineoperand.cpp<|end_file_name|><|fim▁begin|>#include "machineoperand.h" #include "basicblock.h" #include <cassert> #include <iostream> #include <new> using namespace TosLang::BackEnd; MachineOperand::MachineOperand() : mKind{ OperandKind::UNKNOWN } { } MachineOperand::MachineOperand(const unsigned...
assert((kind == OperandKind::IMMEDIATE) || (kind == OperandKind::STACK_SLOT)
<|file_name|>details.py<|end_file_name|><|fim▁begin|>from rest_framework.response import Response<|fim▁hole|>from rest_framework.views import APIView from .common import login_required from Requests import myudc # Student's details requests handler class Student(APIView): """ This only returns student's basic...
<|file_name|>certificate.rs<|end_file_name|><|fim▁begin|>// // Copyright 2021 The Project Oak 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/licen...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod analysis; pub mod traits; pub mod pa_source;<|fim▁hole|><|fim▁end|>
pub mod soundio_source; pub mod rms;
<|file_name|>statusbareventfilter.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************** * Copyright 2015-2020 Alexander Barthel alex@littlenavmap.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General...
* This program 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 * GNU General Public License for more details.
<|file_name|>0013_partecipazione_centrale_operativa.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('attivita', '0012_attivita_centrale_operativa'), ] ...
field=models.BooleanField(default=False, db_index=True), ), ]
<|file_name|>hivemind_vi_VN.ts<|end_file_name|><|fim▁begin|><TS language="vi_VN" version="2.0"> <context> <name>AddressBookPage</name> <message> <source>Create a new address</source> <translation>Tạo một địa chỉ mới</translation> </message> </context> <context> <name>AddressTableMode...
<name>SendCoinsDialog</name> </context> <context> <name>SendCoinsEntry</name>
<|file_name|>common.js<|end_file_name|><|fim▁begin|>global.requireWithCoverage = function (libName) { if (process.env.NODE_CHESS_COVERAGE) { return require('../lib-cov/' + libName + '.js'); } if (libName === 'index') { return require('../lib'); } else { return require('../lib/' + libName + '.js'); } };<|fim...
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals def get_client_ip(request): """ Given an HTTP request, returns the related IP address. """ x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR', None) if x_forwarded_for: ...
ip = request.META.get('REMOTE_ADDR') return ip
<|file_name|>runtests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # vim:ts=4:sw=4:et: # no unicode literals from __future__ import absolute_import, division, print_function import argparse import json import math import multiprocessing import os import os.path import random import shutil import signal impor...
json.dumps( { "op": "test_done", "status": "passed",
<|file_name|>xtc.rs<|end_file_name|><|fim▁begin|>//! This module serves as the entry point into Xt's main binary. // This file is part of Xt. // This is the Xt text editor; it edits text. // Copyright (C) 2016-2018 The Xt Developers // This program is free software: you can redistribute it and/or // modify it under...
use clap::{App, Arg, ArgMatches, SubCommand}; use xt::logging::init_logger; fn retrieve_arguments() -> ArgMatches<'static> {
<|file_name|>rdsinstance.go<|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/. */ package mapper import ( "github.com/ernestio/aws-defini...
<|file_name|>iterative_zoom.py<|end_file_name|><|fim▁begin|>from .fft_tools import zoom import numpy as np import matplotlib.pyplot as pl def iterative_zoom(image, mindiff=1., zoomshape=[10,10], return_zoomed=False, zoomstep=2, verbose=False, minmax=np.min, ploteach=False, return_center=True): """ ...
return_center : bool Return the center position in original image coordinates? If False, will retern the *offset from center* instead (but beware the conventions associated with the concept of 'center' for even images).
<|file_name|>validator.py<|end_file_name|><|fim▁begin|># Copyright (C) 2014 Universidad Politecnica de Madrid # # 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/li...
<|file_name|>events.rs<|end_file_name|><|fim▁begin|>macro_rules! struct_events { ( keyboard: { $( $k_alias:ident : $k_sdl:ident ),* }, // Match against a pattern else: { $( $e_alias:ident : $e_sdl:pat ),* } ) => { use ::sdl2::EventPump; pub struct ImmediateEvents...
pump: EventPump, pub now : ImmediateEvents,
<|file_name|>client.js<|end_file_name|><|fim▁begin|>import './turn-order-a2314c0f.js'; import 'redux'; import 'immer'; import './reducer-4d135cbd.js'; import './Debug-1ad6801e.js'; import 'flatted'; import './ai-ce6b7ece.js'; import './initialize-ec2b5846.js';<|fim▁hole|><|fim▁end|>
export { C as Client } from './client-abd9e531.js';
<|file_name|>fib_fac.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*- def factorial(n): """Return the factorial of n""" if n < 2: return 1 return n * factorial(n - 1) def fibonacci(n): """Return the nth fibonacci number""" if n < 2: return n return fibonacci(n - 1) + fi...
print "fibonacci({}):".format(x), fib print "factorial({}):".format(y), fac
<|file_name|>manifest.py<|end_file_name|><|fim▁begin|>from jsbuild.attrdict import AttrDict from time import strftime class Manifest(AttrDict): def __init__(self,*args,**kwargs): super(AttrDict, self).__init__(*args,**kwargs) self._buffer_ = None self._parent_ = None if not self.__contains__('_dict...
item = item%root._dict_
<|file_name|>command.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # from rest_framework import viewsets from rest_framework.exceptions import ValidationError from django.db import transaction from django.utils.translation import ugettext as _ from django.conf import settings from orgs.mixins.api import Root...
from perms.utils import AssetPermissionUtil from ..models import CommandExecution from ..serializers import CommandExecutionSerializer from ..tasks import run_command_execution
<|file_name|>util.go<|end_file_name|><|fim▁begin|>package vauth import ( "crypto/subtle"<|fim▁hole|>// SecureCompare performs a constant time compare of two strings to limit timing attacks. func SecureCompare(x string, y string) bool { if len(x) != len(y) { return false } return subtle.ConstantTimeCompare([]byt...
)
<|file_name|>test_agent.py<|end_file_name|><|fim▁begin|># Copyright 2012 OpenStack Foundation # 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:...
agent_mgr = dhcp_agent.DhcpAgentWithStateReport( 'testhost') eventlet.greenthread.sleep(1) agent_mgr.after_start()
<|file_name|>typeMatch.js<|end_file_name|><|fim▁begin|>"use strict"; const _ = require ('underscore') _.hasTypeMatch = true /* Type matching for arbitrary complex structures (TODO: test) ======================================================================== */ Meta.globalTag ('required') Meta.globalTag ('ato...
_.omit (type, '*')), value, pred) }
<|file_name|>test_database_upgrade_service.py<|end_file_name|><|fim▁begin|>''' Created on 28.06.2016 @author: michael ''' import unittest from alexandriabase.services import DatabaseUpgradeService from daotests.test_base import DatabaseBaseTest <|fim▁hole|> def setUp(self): super().setUp() self.up...
from alexandriabase.daos import RegistryDao class DatabaseUpgradeServiceTest(DatabaseBaseTest):
<|file_name|>cover.js<|end_file_name|><|fim▁begin|>/*! UIkit 2.27.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ (function (UI) { "use strict"; UI.component('cover', { defaults: { automute: true }, boot: function () { // auto init ...
this.element.css({width: width, height: height});
<|file_name|>22e4e60e03f_bug_867387_bixie_dra.py<|end_file_name|><|fim▁begin|>"""bug 867387 Bixie draft schema Revision ID: 22e4e60e03f Revises: 37004fc6e41e Create Date: 2013-05-10 13:20:35.750954 """ # revision identifiers, used by Alembic. revision = '22e4e60e03f' down_revision = '37004fc6e41e' from alembic impo...
sa.Column(u'signature', sa.TEXT(), nullable=False), sa.PrimaryKeyConstraint(u'id'), schema=u'bixie'
<|file_name|>links.py<|end_file_name|><|fim▁begin|># # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # Y...
field='cardinality', ): pass
<|file_name|>fortios_wanopt_profile.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publ...
<|file_name|>JobUtil.java<|end_file_name|><|fim▁begin|>/* * Copyright 2010-2011 Raisonne Techonologies. * * 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/lice...
<|file_name|>cas_manager.py<|end_file_name|><|fim▁begin|>""" file: cas_manager.py<|fim▁hole|>authors: Christoffer Rosen <cbr4830@rit.edu> date: Jan. 2014 description: This module contains the CAS_manager class, which is a thread that continously checks if there is work that needs to be done. Also contains supportin...
<|file_name|>fuzzy.js<|end_file_name|><|fim▁begin|>// Fuzzy utility 'use strict'; var filter = require('array-filter');<|fim▁hole|> query = query.toLowerCase(); var re = new RegExp(query, 'i'); return filter(items, function(item) { return re.test(item[key]); }); }; }; module.exports = fuzzy;...
var fuzzy = function(items, key) { return function (query) {
<|file_name|>smart-patcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # This programs is intended to manage patches and apply them automatically # through email in an automated fashion. # # Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com) # # This program is free software; you can redistribute ...
for messageId in ref_keys: referenceNode = patchMessageReferenceNode[messageId] utils.verboseOutput(verbose, "Managing Message Id:", referenceNode.get_node())
<|file_name|>Service.ts<|end_file_name|><|fim▁begin|>import { Barman } from '.'; export class Service { id?: number; startAt: Date; endAt: Date; nbMax: number;<|fim▁hole|> barmen?: Barman[]; constructor(values: Object = {}) { Object.assign(this, values); const castVal = values as Service; t...
// Association
<|file_name|>bitcoin_sq.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="sq" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Vector</source> <translation type="unfinished"/...
<translation type="unfinished"/> </message> <message>
<|file_name|>TestMax.java<|end_file_name|><|fim▁begin|>/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appl...
Double r = Max.of(Collections.<Double>emptyList(), false); assertEquals(Double.valueOf(0.0), r); }
<|file_name|>tls.go<|end_file_name|><|fim▁begin|>package autoconf import ( "context" "fmt" "net" "github.com/hashicorp/consul/agent/cache" cachetype "github.com/hashicorp/consul/agent/cache-types" "github.com/hashicorp/consul/agent/connect" "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/con...
if err := ac.updateTLSFromResponse(ac.autoConfigResponse); err != nil { return err }
<|file_name|>test_autotag.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Soft...
<|file_name|>redundant_field_names.rs<|end_file_name|><|fim▁begin|>use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::{meets_msrv, msrvs}; use rustc_ast::ast::{Expr, ExprKind}; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, EarlyLintPass}; use rustc_middle::lint::in_external_macro; us...
/// the field name is redundant. /// /// ### Example
<|file_name|>internals.go<|end_file_name|><|fim▁begin|>package builder // internals for handling commands. Covers many areas and a lot of // non-contiguous functionality. Please read the comments. import ( "crypto/sha256" "encoding/hex" "fmt" "io" "io/ioutil" "net/http" "net/url" "os" "path/filepath" "runti...
resPath = filepath.Join(destPath, filepath.Base(origPath))
<|file_name|>harmonic_potential_bond_type.py<|end_file_name|><|fim▁begin|>import simtk.unit as units from intermol.decorators import accepts_compatible_units<|fim▁hole|> __slots__ = ['length', 'k', 'order', 'c'] @accepts_compatible_units(None, None, length=units.nanometers, ...
from intermol.forces.abstract_bond_type import AbstractBondType class HarmonicPotentialBondType(AbstractBondType):
<|file_name|>magic-scroll.js<|end_file_name|><|fim▁begin|>(function(){<|fim▁hole|> var MagicScroll = function(selector, options) { if(!(this instanceof MagicScroll)) { return new MagicScroll(selector, options); } if(!selector) { console.log('WTF Bro! Give me selector!...
var active = scrolling = false;
<|file_name|>EnumTool.ts<|end_file_name|><|fim▁begin|>/** * Created by XD on 2016/7/24. */ export enum DeleteEnum{ //未删除 NotDel=0, //已删除 IsDel=1 } export function getDeleteEnumDisplayName(deleteEnum:DeleteEnum){ return { [DeleteEnum.IsDel]:'已删', [DeleteEnum.NotDel]:'未删' }[dele...
/// 未审核:0
<|file_name|>AndroidVersion.java<|end_file_name|><|fim▁begin|>package org.beryl.app; /** Convenience class for retrieving the current Android version that's running on the device. * * Code example on how to use AndroidVersion to load a multi-versioned class at runtime for backwards compatibility without using reflec...
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django import forms from django.contrib import admin from django.contrib.flatpages.models import FlatPage from django.utils.translation import ugettext_lazy as _ class FlatpageForm(forms.ModelForm): url = forms.RegexField(label=_("URL"), max_length=100, rege...
form = FlatpageForm fieldsets = ( (None, {'fields': ('url', 'title', 'content', 'sites')}), (_('Advanced options'), {'classes': ('collapse',), 'fields': ('enable_comments', 'registration_required', 'template_name')}),
<|file_name|>picture.server.routes.tests.js<|end_file_name|><|fim▁begin|>'use strict'; var should = require('should'), request = require('supertest'), path = require('path'), mongoose = require('mongoose'), User = mongoose.model('User'), Picture = mongoose.model('Picture'), express = require(path.resolve('...
}); it('should be able to get a single picture that has an orphaned user reference', function (done) { // Create orphan user creds
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup setup( name='django-tastypie', version='0.12.2-dev', desc...
package_data={ 'tastypie': ['templates/tastypie/*'], },
<|file_name|>MultiCloudPricingService.java<|end_file_name|><|fim▁begin|>package de.uniulm.omi.cloudiator.sword.multicloud.service; import com.google.common.base.Supplier; import com.google.common.collect.ImmutableSet; import com.google.inject.Inject; import de.uniulm.omi.cloudiator.sword.domain.Cloud; import de.uniulm...
builder.addAll(awsPricingSupplier.get()); }
<|file_name|>ConfigurationConverterTest.java<|end_file_name|><|fim▁begin|>package com.github.aureliano.evtbridge.converter; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.util.HashMap; import java.util.Map; import org.ju...
public class ConfigurationConverterTest { @Test public void testConvert() {
<|file_name|>disk.py<|end_file_name|><|fim▁begin|>import os from pi3bar.plugins.base import Plugin from pi3bar.utils import humanize_size_bytes class Disk(Plugin): """<|fim▁hole|> Available format replacements (``*_p`` = percentage): * ``%(size)s`` E.g. '100GB' * ``%(free)s`` E.g. '70GB' * ``%(fr...
:class:`pi3bar.app.Pi3Bar` plugin to disk usage.
<|file_name|>Tracker.ts<|end_file_name|><|fim▁begin|>import { Queue } from "../Queue/Queue"; import { EventHandler } from "../Event/Handler/EventHandler"; import { ObjectMerger } from "../Common/ObjectMerger"; export class Tracker { public static get SEND_COMMAND(): string { return "send"; } constructor(priva...
queue.consume((index, dataLayerElement) => { if (dataLayerElement.length >= 2) {
<|file_name|>remark-toc-tests.ts<|end_file_name|><|fim▁begin|>import remark = require('remark') import toc = require('remark-toc') remark().use(toc) remark().use(toc, {}) remark().use(toc, { heading: 'heading' }) remark().use(toc, { maxDepth: 2 }) remark().use(toc, { tight: true }) <|fim▁hole|>}) remark()....
remark().use(toc, { skip: 'skip-heading'
<|file_name|>rot.rs<|end_file_name|><|fim▁begin|>use super::Vec2; /// Rotation #[derive(Copy, Clone)] pub struct Rot { pub s: f32, pub c: f32 } impl Rot { pub fn new() -> Rot { Rot { s: 0.0, c: 1.0 } } /// Initialize from an angle in radians pub fn new_...
s: angle.sin(), c: angle.cos() }
<|file_name|>make_waterfalls.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import argparse import pathlib import numpy as np def waterfall(input_filename, output_filename): fs = 200 nfft = 8192 w = np.blackman(nfft) x = np.fromfile(input_filename, 'int16') x = (x[::2] + 1j*x[1::2])/2**1...
<|file_name|>gyptest-dirname.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies simple rules when using an explicit build target of 'all'. """ im...
# to an absolute path, making the tests below fail! if test.format != 'xcode' and test.format != 'make': test.must_match('relocate/src/subdir/foo/bar/baz.path', os.path.join('foo', 'bar', 'baz.printvars'))
<|file_name|>inventorypage.cpp<|end_file_name|><|fim▁begin|>#include "inventorypage.h" #include "ui_inventorypage.h" #include "fak.h" #include "inventorypage.h" #include <QtDebug> #include "QtDebug" #include <QSqlQuery> #include <QSqlError> #include <QSqlRecord> static const QString path = "C:/Sr.GUI/FAKKIT/db/fakdb4....
DbManager db(path);
<|file_name|>CombatLogParser.ts<|end_file_name|><|fim▁begin|>import { ArcaneIntellect, CancelledCasts, DivertedEnergy, ElementalBarrier, FocusMagic, GroundingSurge, IreOfTheAscended, MirrorImage, RuneOfPower, ShiftingPower, SiphonedMalice, TempestBarrier, } from '@wowanalyzer/mage'; import Core...
<|file_name|>test_versioning.py<|end_file_name|><|fim▁begin|>from nose.tools import * # flake8: noqa from api.base import settings from tests.base import ApiTestCase # The versions below are specifically for testing purposes and do not reflect the actual versioning of the API. # If changes are made to this list, o...
class VersioningTestCase(ApiTestCase):
<|file_name|>visEdge.js<|end_file_name|><|fim▁begin|>var _ = require('underscore'); var Backbone = require('backbone'); var GRAPHICS = require('../util/constants').GRAPHICS; var VisBase = require('../visuals/visBase').VisBase; var VisEdge = VisBase.extend({ defaults: { tail: null, head: null, animationS...
<|file_name|>AmahiModule.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2014 Amahi * * This file is part of Amahi. * * Amahi 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...
import org.amahi.anywhere.fragment.ServerFileDownloadingFragment; import org.amahi.anywhere.fragment.NavigationFragment; import org.amahi.anywhere.fragment.ServerAppsFragment; import org.amahi.anywhere.fragment.ServerFileImageFragment;
<|file_name|>main.js<|end_file_name|><|fim▁begin|>; (function() { var app = angular.module('dashboardApp', [ 'ngRoute', 'dashboard'<|fim▁hole|> var dashboard = angular.module('dashboard', []); dashboard.run(function($rootScope, invocationUtils, stringUtils, api, urls) { $rootScope....
]);
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
__author__ = 'matjaz'