prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>pegs.py<|end_file_name|><|fim▁begin|># n peg hanoi tower problem, use bfs instead of dfs, and don't have a full # analytical solution import sys import copy<|fim▁hole|>def solutionWorks(currentSolution, stacksAfterSolution, initialStacks, finalStacks): for x in range(len(currentSolution)): i, j...
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#!python #-*- encoding=utf-8 -*- import sys, sqlite3, logging, os, os.path import wx, time, re, copy, webbrowser import wx.grid, wx.html import json, math from cfg import config from util import * from model import * from view import * class App(wx.App): instance =...
@staticmethod def GetInstance(): return App.instance def Quit(self):
<|file_name|>about_tuples.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutTuples(Koan): def test_creating_a_tuple(self): count_of_three = (1, 2, 5) self.assertEqual(5, count_of_three[2]) def test_tuples_are_immutable_so_item_...
count_of_three = tuple(list_count) self.assertEqual((1, 2, 5, 'boom'), count_of_three)
<|file_name|>VectorImageLayer.d.ts<|end_file_name|><|fim▁begin|>import { Coordinate } from '../../coordinate'; import { EventsKey } from '../../events'; import BaseEvent from '../../events/Event'; import Feature, { FeatureLike } from '../../Feature'; import Geometry from '../../geom/Geometry'; import Layer from '../../...
import Source from '../../source/Source'; import CanvasImageLayerRenderer from './ImageLayer'; export default class CanvasVectorImageLayerRenderer extends CanvasImageLayerRenderer {
<|file_name|>CalculatorTest.java<|end_file_name|><|fim▁begin|>package com.test.JUnit; import static org.junit.Assert.*; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; public class CalculatorTest { private static Calculator calculator = new Calculator(); <|fim▁hole|> } @Te...
@Before public void setUp() throws Exception { calculator.clear();
<|file_name|>Actions.ts<|end_file_name|><|fim▁begin|>export const MOVE_LEFT_ACTION = 0;<|fim▁hole|>export const HARD_DROP_ACTION = 3; export const ROTATE_ACTION = 4 export const HOLD_ACTION = 5;<|fim▁end|>
export const MOVE_RIGHT_ACTION = 1; export const SOFT_DROP_ACTION = 2;
<|file_name|>wincon.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian // Licensed under the MIT License <LICENSE.md> //! This module contains the public data structures, data types, and procedures exported by the NT //! console subsystem. STRUCT!{struct COORD { X: ::SHORT, Y: ::SHORT, }} pub t...
pub type PCONSOLE_FONT_INFO = *mut CONSOLE_FONT_INFO; STRUCT!{struct CONSOLE_FONT_INFOEX { cbSize: ::ULONG,
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The Prometheus 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 // ...
// Help: "Number of hard-disk errors.", // }, // []string{"device"}, // )
<|file_name|>UmlClassMetaModelNavigatorActionProvider.java<|end_file_name|><|fim▁begin|>/* * */ package umlClassMetaModel.diagram.navigator; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.emf.common.ui.URIEditorInput; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EObject; impo...
* @generated */
<|file_name|>smiley.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #simple smileys icon builder.. SMILEYS_INDEX=( """ # Default smileys [default] happy.png :) :-) excited.png :-D :-d :D :d sad.png :-( :( wink.png ;-) ;) tongue.png :P ...
moon.png (S) star.png (*) film.png (~)
<|file_name|>InspectStatsTable.tsx<|end_file_name|><|fim▁begin|>import React from 'react'; import { FieldType, formattedValueToString, getDisplayProcessor, GrafanaTheme, QueryResultMetaStat, TimeZone, } from '@grafana/data'; import { config } from 'app/core/config'; import { stylesFactory, useTheme } from '...
<tbody> {stats.map((stat, index) => { return ( <tr key={`${stat.displayName}-${index}`}>
<|file_name|>unexpected_after.py<|end_file_name|><|fim▁begin|>def foo(a): pass<|fim▁hole|><|fim▁end|>
foo(1)
<|file_name|>__manifest__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Point of Sale', 'version': '1.0.1', 'category': 'Point Of Sale', 'sequence': 20, 'summary': 'Touchscreen Interface for Shops', ...
'data': [ 'security/point_of_sale_security.xml', 'security/ir.model.access.csv', 'data/default_barcode_patterns.xml',
<|file_name|>ad.java<|end_file_name|><|fim▁begin|>package android.support.v7.a; final class ad implements Runnable { final /* synthetic */ ac a; ad(ac acVar) { this.a = acVar; } <|fim▁hole|> if ((this.a.I & 1) != 0) { ac.a(this.a, 0); } if ((this.a.I & 4096) != 0...
public final void run() {
<|file_name|>Validators.java<|end_file_name|><|fim▁begin|>/* * (C) Copyright 2015 Netcentric AG. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.ecli...
<|file_name|>Response.java<|end_file_name|><|fim▁begin|>/* * This file is part of rasdaman community. * * Rasdaman community 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...
private final int exit_code;
<|file_name|>roipooling.py<|end_file_name|><|fim▁begin|># ---------------------------------------------------------------------------- # Copyright 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 may obta...
} """
<|file_name|>each.js<|end_file_name|><|fim▁begin|>'use strict'; import eachLimit from './eachLimit'; import doLimit from './internal/doLimit'; /** * Applies the function `iteratee` to each item in `coll`, in parallel. * The `iteratee` is called with an item from the list, and a callback for when * it has finished....
* Note, that since this function applies `iteratee` to each item in parallel, * there is no guarantee that the iteratee functions will complete in order. * * @name each
<|file_name|>tbson.cpp<|end_file_name|><|fim▁begin|>/* Copyright (c) 2012-2013, AOYAMA Kazuharu * All rights reserved. * * This software may be used and distributed according to the terms of * the New BSD License, which is incorporated herein by reference. */ #include <TBson> #include <QDateTime> #include <QRegEx...
bson sub[1]; bson_iterator_subobject_init(it, sub, (bson_bool_t)true); ret[key] = fromBson(sub).values();
<|file_name|>out-of-stack-new-thread-no-split.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or //...
<|file_name|>python-tokenreader-test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- mode:python; tab-width:4; c-basic-offset:4; intent-tabs-mode:nil; -*- # ex: filetype=python tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent smartindent # # Universal Password Changer (UPwdChg) # Copyright (C) 20...
self.oToken.config('./resources/frontend-private.pem', './resources/backend-public.pem')
<|file_name|>gid.py<|end_file_name|><|fim▁begin|>#---------------------------------------------------------------------- # Copyright (c) 2008 Board of Trustees, Princeton University # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Wo...
if not self.parent.get_type().find('authority') == 0: raise GidInvalidParentHrn("This cert %s's parent %s is not an authority (is a %s)" % (self.get_hrn(), self.parent.get_hrn(), self.parent.get_type()))
<|file_name|>0010_auto_20170324_1304.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-24 16:04 from __future__ import unicode_literals from django.conf import settings<|fim▁hole|>class Migration(migrations.Migration): dependencies = [ migrations.swappable_dep...
from django.db import migrations, models import django.db.models.deletion
<|file_name|>set_led.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Copyright (c) 2015 Netforce Co. Ltd. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including...
# copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions:
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ from django.db.models.fields import FieldDoesNotExist from django.core.exceptions import ImproperlyConfigured from django.utils.timezone impor...
StatusField, MonitorField
<|file_name|>player_service.py<|end_file_name|><|fim▁begin|>import time<|fim▁hole|>import json import os import BaseHTTPServer HOST_NAME = 'localhost' PORT_NUMBER = 9400 class PlayerService(BaseHTTPServer.BaseHTTPRequestHandler): def do_POST(self): self.send_response(200) self.send_header("Conte...
import cgi
<|file_name|>ZkDeployMgr.java<|end_file_name|><|fim▁begin|>package com.baidu.disconf.web.service.zookeeper.service; import java.util.Map; import com.baidu.disconf.core.common.constants.DisConfigTypeEnum; import com.baidu.disconf.web.service.zookeeper.dto.ZkDisconfData; /** * * * @author liaoqiqi * @version 201...
*/
<|file_name|>command_test.go<|end_file_name|><|fim▁begin|>package run_test import ( "io/ioutil" "os" "path/filepath" "testing" "time" "github.com/influxdata/influxdb/cmd/influxd/run" ) func TestCommand_PIDFile(t *testing.T) { tmpdir, err := ioutil.TempDir(os.TempDir(), "influxd-test") if err != nil { t.Fat...
cmd := run.NewCommand() cmd.Getenv = func(key string) string {
<|file_name|>Button.test.ts<|end_file_name|><|fim▁begin|>import {Button, ColorValue, ImageValue, EventObject, Properties, FontValue} from 'tabris'; <|fim▁hole|>let alignment: 'centerX' | 'left' | 'right'; let autoCapitalize: 'default' | 'none' | 'all'; let image: ImageValue; let text: string; let textColor: ColorValue;...
let widget: Button = new Button(); // Properties
<|file_name|>Player.java<|end_file_name|><|fim▁begin|>package checkers.logic.main; import java.util.Scanner; public class Player { public static void main(String[] args) { consolePlayer(); } private static void consolePlayer(){ CheckersGame g = new CheckersGame(); Scanner in = new Scanner(System.in); in...
<|file_name|>dynamic_system_view.go<|end_file_name|><|fim▁begin|>package vault import "time" type dynamicSystemView struct { core *Core mountEntry *MountEntry } func (d dynamicSystemView) DefaultLeaseTTL() time.Duration { def, _ := d.fetchTTLs() return def } func (d dynamicSystemView) MaxLeaseTTL() time.D...
def = d.core.defaultLeaseTTL max = d.core.maxLeaseTTL
<|file_name|>explode.py<|end_file_name|><|fim▁begin|>#!/Users/Drake/dev/LouderDev/louderdev/bin/python3 # # The Python Imaging Library # $Id$ # # split an animation into a number of frame files # from __future__ import print_function from PIL import Image import os import sys class Interval(object): def __init...
<|file_name|>EntityCollection.hpp<|end_file_name|><|fim▁begin|>/******************************************************************************/ /* */ /* EntityCollection.hpp */ /* ...
#include <Fast/EntityEntry.hpp>
<|file_name|>NASMCommenter.java<|end_file_name|><|fim▁begin|>/*++ NASM Assembly Language Plugin Copyright (c) 2017-2019 Aidan Khoury. All rights reserved. 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 Foundat...
return null; } }
<|file_name|>simd-generics.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache....
use std::ops; #[simd] struct f32x4(f32, f32, f32, f32);
<|file_name|>generated_instance_console_input.go<|end_file_name|><|fim▁begin|>package client const ( INSTANCE_CONSOLE_INPUT_TYPE = "instanceConsoleInput" ) type InstanceConsoleInput struct { Resource } type InstanceConsoleInputCollection struct { Collection Data []InstanceConsoleInput `json:"data,omitempty"` ...
err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) resp.client = cc.client return resp, err }
<|file_name|>rubbishTests.js<|end_file_name|><|fim▁begin|>var Cat = require('../src/Cat'); require('chai').should(); describe('This should pass if mutated', function(){<|fim▁hole|> true.should.equal(true); }); });<|fim▁end|>
it('yes it should', function(){ var name = Math.random();
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse<|fim▁hole|> return HttpResponse(Template('You are an admin').render({})) return HttpResponse(Template('Access denied').render({}))<|fim▁end|>
from django.template import Template def admin_required_view(request): if request.user.is_staff:
<|file_name|>alt-borrowed_str.rs<|end_file_name|><|fim▁begin|>// xfail-test // xfail-fast // -*- rust -*- fn f1(ref_string: &str) { match ref_string { "a" => io::println("found a"), "b" => io::println("found b"), _ => io::println("not found") } } fn f2(ref_string: &str) { match ref_...
}
<|file_name|>GetNewsletterScheduleTime.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################### # # GetNewsletterScheduleTime # Get the scheduled delivery time of a specified Newsletter. # # Python version 2.6 # ############################...
class GetNewsletterScheduleTimeResultSet(ResultSet):
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[cfg(feature = "backend_session")] use std::cell::RefCell; use std::collections::HashSet; use std::convert::TryFrom; use std::os::unix::io::{AsRawFd, RawFd}; use std::sync::Arc; use drm::control::{connector, crtc, framebuffer, plane, property, Device as ControlDevice, ...
}
<|file_name|>common.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # import uuid from django.shortcuts import get_object_or_404 from rest_framework.views import APIView, Response from rest_framework.generics import ( ListAPIView, get_object_or_404, RetrieveAPIView ) from common.permissions import IsOrgAd...
user = get_object_or_404(User, id=user_id) return user
<|file_name|>plugins.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
module.exports = []
<|file_name|>client_config_update.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -u # # Copyright (c) 2008--2010 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties...
for line in fin.readlines(): kv = _parseConfigLine(line) if kv:
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var Theme = (function() { var Theme = function() { }; return Theme; })(); <|fim▁hole|><|fim▁end|>
module.exports = Theme;
<|file_name|>distance.cpp<|end_file_name|><|fim▁begin|>/* * distance.cpp * * Created on: 18 May 2016 * Author: junior */ #include "distance.hpp" using namespace std; using namespace cv; namespace clustering { namespace distance { DistanceCalculator::DistanceCalculator(calculator cal){ this->cal = cal; ...
} }
<|file_name|>CommandUtils.ts<|end_file_name|><|fim▁begin|>import { CommonExtensionWindowState } from "../extension/CommonExtensionState"; /* * Copyright 2019 Simon Edwards <simon@simonzone.com> * * This source code is licensed under the MIT license which is detailed in the LICENSE.txt file. */ export const EVENT_C...
}
<|file_name|>sum_over_array_opt.rs<|end_file_name|><|fim▁begin|>#![feature(core)] // Requires the use of the nightly rust // Compile with -O pub fn sum_array(x: &[i32]) -> i32 { unsafe { std::intrinsics::assume(x.as_ptr() as usize % 64 == 0); }<|fim▁hole|><|fim▁end|>
x.iter().fold(0, |sum, next| sum + *next) }
<|file_name|>builder.py<|end_file_name|><|fim▁begin|># This file is part of Buildbot. Buildbot 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. # # This program is distributed in the hope that it wi...
if not slavebuilder.remote: log.msg("slave disappeared before build could start")
<|file_name|>test_socket.rs<|end_file_name|><|fim▁begin|>use nix::sys::socket::{InetAddr, UnixAddr, getsockname}; use std::{mem, net}; use std::path::Path; use std::str::FromStr; use std::os::unix::io::AsRawFd; use ports::localhost; #[test] pub fn test_inetv4_addr_to_sock_addr() { let actual: net::SocketAddr = Fro...
match addr { InetAddr::V4(addr) => { let ip: u32 = 0x7f000001; let port: u16 = 3000;
<|file_name|>get_color_fns.ts<|end_file_name|><|fim▁begin|>import chalk from 'chalk' import { TestStepResultStatus } from '@cucumber/messages' export type IColorFn = (text: string) => string export interface IColorFns { forStatus: (status: TestStepResultStatus) => IColorFn location: IColorFn tag: IColorFn dif...
diffRemoved: IColorFn errorMessage: IColorFn errorStack: IColorFn
<|file_name|>solver052.rs<|end_file_name|><|fim▁begin|>// COPYRIGHT (C) 2017 barreiro. All Rights Reserved. // Rust solvers for Project Euler problems use euler::algorithm::bit::BitSet; use euler::algorithm::long::{digits_sum, from_digits, to_digits}; use euler::Solver; // It can be seen that the number, 125874, and ...
}
<|file_name|>url.ts<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2018 by Filestack * Some 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...
if (!params) { return url; }
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![crate_name = "rusoto"] #![crate_type = "lib"] #![cfg_attr(feature = "unstable", feature(custom_derive, plugin))] #![cfg_attr(feature = "unstable", plugin(serde_macros))] #![cfg_attr(feature = "nightly-testing", plugin(clippy))] #![cfg_attr(feature = "nightly-testing",...
*/
<|file_name|>JSONBoxTest.js<|end_file_name|><|fim▁begin|>const JSONBox = require("../JSONBox"); const rmdir = require("rmdir"); const appRootDir = require("app-root-dir"); const Q = require("q"); const path = require("path"); const async = require("asyncawait/async"); const await = require...
describe("JSONBox", function() { before(function() { this.uuid = sinon.stub(uuid, "v4").returns("53ccfe14-7916-11e6-8b77-86f30ca893d3");
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Copyright (C) 2014-2015 Bitergia # # 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 Licen...
# along with this program; if not, write to the Free Software
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import from .activation_maximization import visualize_activation_with_losses from .activation_maximization import visualize_activation from .saliency import visualize_saliency_with_losses from .saliency import visualize_saliency fr...
<|file_name|>WordNode.java<|end_file_name|><|fim▁begin|>/** * copyright * Inubit AG * Schoeneberger Ufer 89 * 10785 Berlin * Germany */ package com.inubit.research.textToProcess.textModel; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Shape; import java.awt.geom.Rec...
} }
<|file_name|>numeric_tools.py<|end_file_name|><|fim▁begin|>""" Diabicus: A calculator that plays music, lights up, and displays facts. Copyright (C) 2016 Michael Lipschultz 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...
)
<|file_name|>RenderCamera.cpp<|end_file_name|><|fim▁begin|>// BLAEngine Copyright (C) 2016-2020 Vincent Petrella. All rights reserved. #include "RenderCamera.h" using namespace BLA; void RenderCamera::AttachCamera(CameraComponent* camera) { this->m_attachedCamera = camera; } void PerspectiveCamera::SetAspect(bl...
<|file_name|>filterSinceSync.js<|end_file_name|><|fim▁begin|>function filterSinceSync(d) { var isValid = typeof d === 'number' || d instanceof Number || d instanceof Date; if (!isValid) { throw new Error('expected since option to be a date or a number'); } return file.stat && file.stat.mtime > d...
<|file_name|>figure_drifts.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from __future__ import absolute_import, print_function from grid_cell_model.submitting import flagparse import noisefigs<|fim▁hole|>parser = flagparse.FlagParser() parser.add_flag('--bumpDriftSweep') args = parser.parse_args() env = Nois...
from noisefigs.env import NoiseEnvironment import config_standard_gEE_3060 as config
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup import py2exe <|fim▁hole|><|fim▁end|>
setup(console=['newsputnik.py'])
<|file_name|>product.ts<|end_file_name|><|fim▁begin|>import * as categories from "./productCategory" export interface Product { name: string price: number category?: categories.ProductCategory } export class Initial implements Product { name = "Please select a product" price = 0 } export class Co...
} export class Hersey implements Product {
<|file_name|>client.py<|end_file_name|><|fim▁begin|>import logging from urllib.parse import urljoin import lxml.etree # noqa: S410 import requests<|fim▁hole|>from django.conf import settings as django_settings from django.utils import timezone logger = logging.getLogger(__name__) class ClientError(Exception): ...
<|file_name|>release.js<|end_file_name|><|fim▁begin|>/******************************* Release Config *******************************/ var requireDotFile = require('require-dot-file'), config,<|fim▁hole|> /******************************* Derived Values *******************************/ try { con...
npmPackage, version ;
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls.defaults import * from .views import * urlpatterns = patterns('', url(r'^signup/$', view=SignupLoginView.as_view( featured_form_mixin_class=SignupMultipleFormMixin), name='accounts_signup' ), url(r'^login/...
view=SignupLoginIframeView.as_view(), name='accounts_signup_login_iframe' ),
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>module.exports = function(config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '../', // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frame...
// if true, Karma captures browsers, runs the tests and exits
<|file_name|>formatCurrency.js<|end_file_name|><|fim▁begin|>/** * format currency * @ndaidong **/<|fim▁hole|> const { isNumber, } = require('bellajs'); const formatCurrency = (num) => { const n = Number(num); if (!n || !isNumber(n) || n < 0) { return '0.00'; } return n.toFixed(2).replace(/./g, (c, i, ...
<|file_name|>signalstrength.py<|end_file_name|><|fim▁begin|>r"""Functions for Higgs signal strengths."""<|fim▁hole|>from . import width prod_modes = { 'ggF': { 'desc': 'gluon fusion production', 'tex': 'gg', 'str': 'gg', }, 'hw': { 'desc': '$W$ boson associated production',...
import flavio from . import production from . import decay
<|file_name|>UpdateServiceActionRequestMarshaller.java<|end_file_name|><|fim▁begin|>/* * Copyright 2017-2022 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. A copy of the ...
} }
<|file_name|>incremental_repair_test.py<|end_file_name|><|fim▁begin|>import os import time from collections import Counter from re import findall from unittest import skip from cassandra import ConsistencyLevel from ccmlib.common import is_win from ccmlib.node import Node from nose.plugins.attrib import attr from ass...
def multiple_full_repairs_lcs_test(self):
<|file_name|>highlight.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licen...
use html::escape::Escape;
<|file_name|>character-statistics.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------- # reads the text from the given file, and outputs its # character statistics #o # (C) 2015 Frank Hofmann, Berlin, Germany # Released under GNU Public License (GPL) # email frank.hofmann@efho...
# open file for reading fileHandle = open(textfileName, "r", encoding=encoding)
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""URL config for business tool""" from django.conf.urls import url, patterns from nav.web.business import views urlpatterns = patterns('', url(r'^$', views.BusinessView.as_view(), name='business-index'), url('^device_availability/$', views.DeviceAvail...
url('^link_availability/$', views.LinkAvailabilityReport.as_view(), name='business-report-link-availability') )
<|file_name|>combinations.py<|end_file_name|><|fim▁begin|># Copyright 2018 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.apac...
versa. Test targets continuously run in TF2 thanks to the tensorflow.v2 TAP target.
<|file_name|>player.service.ts<|end_file_name|><|fim▁begin|>import {Player} from '../model/player/player.model'; export class PlayerService { private player: Player; public getLastAddedPlayer(): Player {<|fim▁hole|> } public setLastAddedPlayer(player: Player): void { this.player = player; } public c...
return this.player;
<|file_name|>sbml_confInput.cpp<|end_file_name|><|fim▁begin|>// Copyright Alex Holehouse 2011 // Distributed under the terms of the GNU general public license - see COPYING.txt for more details #include "sbml_confInput.h" #include <stdio.h> #include <fstream> #include <iostream> #include <sstream> #include <time.h> #i...
if (!stream_set){ cerr << "WARNING - Unlabe to reset_seek, no conf file currently loaded" << endl;
<|file_name|>boundary.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 `multipart` Crate Developers // // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or // http://opensource.org/licenses/MIT>, at your option. This file ma...
#[derive(Debug)] pub struct BoundaryReader<R> { source: BufReader<R, MinBuffered>, boundary: Vec<u8>,
<|file_name|>Notifications.java<|end_file_name|><|fim▁begin|>package com.example.murat.gezi_yorum.Fragments; import android.content.Context; import android.os.Bundle; import android.os.Handler; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; impor...
}
<|file_name|>skia_gold_properties.py<|end_file_name|><|fim▁begin|># Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Class for storing Skia Gold comparison properties. Examples: * git revision being tested...
@property def local_pixel_tests(self):
<|file_name|>upgradeDB_From0.7.1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- python -*- # # Git Version: @git@ #----------------------------------------------------------------------- # XALT: A tool that tracks users jobs and environments on a cluster. # Copyright (C) 2013-2014 University of Texas at A...
# If MySQL version < 4.1, comment out the line below cursor.execute("SET SQL_MODE=\"NO_AUTO_VALUE_ON_ZERO\"") cursor.execute("USE "+xalt.db())
<|file_name|>Combiners.py<|end_file_name|><|fim▁begin|>#%% Libraries: Built-In import numpy as np #% Libraries: Custom #%% class Combiner(object): def forward(self, input_array, weights, const): ## Define in child pass def backprop(self, error_array, backprop_array, learn_weight = 1e-0): ...
def forward(self, input_array, weights, const):
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Page', ...
<|file_name|>layout_debug.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/. */ //! Supports writing a trace file created during each la...
<|file_name|>enum_overflows.rs<|end_file_name|><|fim▁begin|>#[cxx::bridge] mod ffi { enum Good1 { A = 0xFFFF_FFFF_FFFF_FFFF, } enum Good2 { B = 0xFFFF_FFFF_FFFF_FFFF, C = 2020, } enum Bad { D = 0xFFFF_FFFF_FFFF_FFFE,<|fim▁hole|> E, F, } } fn main()...
<|file_name|>comparisonForManuallyOrderedInAttrsInheritance.py<|end_file_name|><|fim▁begin|>from attr import dataclass class A7: x: int = 1 def __lt__(self, other): pass @dataclass(cmp=True) class B7(A7): y: str = "1" print(A7() < B7()) print(B7() <error descr="'__lt__' not supported between ins...
@dataclass(cmp=True) class A9: x: int = 1
<|file_name|>UseInnerPortalHandler.java<|end_file_name|><|fim▁begin|>package handling.handlers; import java.awt.Point; import client.MapleClient; import handling.PacketHandler; import handling.RecvPacketOpcode; import server.MaplePortal; import tools.data.LittleEndianAccessor; public class UseInnerPortalHandler { ...
if (portal == null) { return;
<|file_name|>uploadwidget.py<|end_file_name|><|fim▁begin|>import os import tempfile import zipfile from PyQt5 import QtCore, QtWidgets import util from vaults.modvault import utils FormClass, BaseClass = util.THEME.loadUiType("vaults/modvault/upload.ui") class UploadModWidget(FormClass, BaseClass): def __init_...
def zipdir(path, zipf, fname):
<|file_name|>XPath2Language.java<|end_file_name|><|fim▁begin|>/* * Copyright 2005 Sascha Weinreuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/L...
<|file_name|>segment.rs<|end_file_name|><|fim▁begin|>/*use std::ops::{Add, Sub}; use num::Num; pub struct SegmentedString<L, S> where L: Num + Into<usize> { buffer: String, segments: Vec<(L, S)> } impl<L, S> SegmentedString<L, S> where L: Num + Into<usize> {<|fim▁hole|> self.buffer.push_str(string); self.segm...
pub fn push(&mut self, string: &str, segment: S) { let len = string.len() as L;
<|file_name|>game_container.py<|end_file_name|><|fim▁begin|>from pygame.locals import * from pypogs import player_area from pypogs import render class GameContainer(object): def __init__(self, world, dimensions): self._player_areas = [] self._world = world self._dimensions = dimensions ...
if not self._world.in_game(): return if self._is_online:
<|file_name|>person_interactor.rs<|end_file_name|><|fim▁begin|>use crate::userstore::entities::person::Person; use chrono::prelude::*; use postgres::transaction::Transaction; use std::time::Instant; use uuid; pub struct PersonInteractor(); #[allow(dead_code)] impl PersonInteractor { pub fn create_person<'a>( ...
.query(&[
<|file_name|>creds.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)] /// TODO: Remove the suppressed warnings. use std::ffi::CString; use std::mem; use std::ops::Drop; use gt::consts::*; use error::{ Error, AsGnutlsError }; use gt::gen::{gnutls_x509_crt_fmt_t, gnutls_certificate_credentials_...
Some(x) => x }; unsafe {
<|file_name|>ipc_perftest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3 # @begin:license # # Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de> # # 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 Softwa...
# (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of
<|file_name|>prettyprinter.py<|end_file_name|><|fim▁begin|>from __future__ import with_statement import sys from collections import deque from charpos import CharposStream from bindings import bindings import printervars __all__ = ["PrettyPrinter", "pprint"] class PrintLevelExceeded(StopIteration): pass class T...
<|file_name|>0016_auto_20151026_0851.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 = [ ('server', '0015_auto_20150819_1501'), ] operations = [ m...
name='key', field=models.CharField(null=True, editable=False, max_length=255, blank=True, unique=True, db_index=True),
<|file_name|>helpers.js<|end_file_name|><|fim▁begin|>import { EmailTemplate } from 'email-templates' import Promise from 'bluebird' const sendgrid = require('sendgrid')(process.env.SENDGRID_MAILER_KEY) const sendEmail = Promise.promisify(sendgrid.send, { context: sendgrid }) const DEVELOPMENT = process.env.NODE_ENV ===...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2020 Inderjit Gill <email@indy.io> // This file is part of Seni // Seni 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 versi...
expected_num_verts: usize, ) { let program = program_from_source(s).unwrap();
<|file_name|>rule.rs<|end_file_name|><|fim▁begin|>use sass::output_style::{SassOutputStyle, Streamable}; use expression_evaluator::ExpressionEvaluator; use sass::variable::SassVariable; use ast::node::Node; use token::Token; use token_offset::TokenOffset; use error::Result; use context::Context; use std::io::Write; #...