prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>CreateUploadResultJsonUnmarshaller.java<|end_file_name|><|fim▁begin|>/* * Copyright 2010-2016 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 t...
<|file_name|>tensorflow_layer_ray_transform.py<|end_file_name|><|fim▁begin|>"""Example of how to convert a RayTransform operator to a tensorflow layer. <|fim▁hole|>""" from __future__ import print_function import tensorflow as tf import numpy as np import odl import odl.contrib.tensorflow sess = tf.InteractiveSession...
This example is similar to ``tensorflow_layer_matrix``, but demonstrates how more advanced operators, such as a ray transform, can be handled.
<|file_name|>lti.py<|end_file_name|><|fim▁begin|>""" Stub implementation of LTI Provider. What is supported: ------------------ 1.) This LTI Provider can service only one Tool Consumer at the same time. It is not possible to have this LTI multiple times on a single page in LMS. """ from uuid import uuid4 import tex...
</result> </resultRecord>
<|file_name|>constants.py<|end_file_name|><|fim▁begin|>__author__ = 'bharathramh'<|fim▁hole|><|fim▁end|>
EMAIL_VERIFICATION_EXPIRATION_DAYS = 1 FORGOT_PASSWORD_EXPIRATION_DAYS = 1
<|file_name|>test_gosper.py<|end_file_name|><|fim▁begin|>"""Tests for Gosper's algorithm for hypergeometric summation. """ from sympy import binomial, factorial, gamma, Poly, S, simplify, sqrt, exp, log, Symbol from sympy.abc import a, b, j, k, m, n, r, x from sympy.concrete.gosper import gosper_normal, gosper_sum, go...
n**2 + sqrt(2), (n, 0, m)) == (m + 1)*(2*m**2 + m + 6*sqrt(2))/6 def test_gosper_sum_iterated():
<|file_name|>solenoid.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ Deprecated since the solenoid was not strong enough. Was using: https://www.sparkfun.com/products/11015 5v, 4.5mm throw """ # Import required libraries<|fim▁hole|>import RPi.GPIO as GPIO # Use BCM GPIO references # instead of physical pi...
import time
<|file_name|>htmlheadingelement.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::Bindings::HTMLHeadingE...
<|file_name|>contact.py<|end_file_name|><|fim▁begin|>__author__ = 'admin' class ContactHelper: def __init__(self, app): self.app = app def create(self, contact): self.fill_contact_fields(contact) def modify(self, contact): # modify contact self.click_edit_button() ...
<|file_name|>race_test.go<|end_file_name|><|fim▁begin|>package testrace <|fim▁hole|> c := make(chan int) x := 1 go func() { x = 2 c <- 1 }() x = 3 <-c _ = x } } func BenchmarkRace(b *testing.B) { for i := 0; i < b.N; i++ { c := make(chan int) x := 1 go func() { x = 2 c <- 1 }() x =...
import "testing" func TestRace(t *testing.T) { for i := 0; i < 10; i++ {
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use std::cmp::Ordering; use std::collections::HashSet; use std::fmt::Display; use unicase::UniCase; use crate::command::Spec as CommandSpec; use crate::errors::GameError; pub use self::chain::*; pub mod chain; #[derive(Debug, PartialEq)] pub struct Output<'a, T> { ...
names: &[String],
<|file_name|>instance_lost_city_of_the_tolvir.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2013-2015 DeathCore <http://www.noffearrdeathproject.net/> * * 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 Sof...
SiamatFree(); if (Creature* siamat = instance->GetCreature(uiSiamatGUID)) siamat->AI()->Talk(YELL_FREE);
<|file_name|>lsf.py<|end_file_name|><|fim▁begin|>import os import time import logging import math from parsl.channels import LocalChannel from parsl.launchers import SingleNodeLauncher from parsl.providers.cluster_provider import ClusterProvider from parsl.providers.lsf.template import template_string from parsl.provi...
<|file_name|>query.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may ...
<|file_name|>importlib.go<|end_file_name|><|fim▁begin|>// Copyright 2018 The go-python Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Frozen version of importlib/_bootstrap.py package py import ( "github.com/go-python/gpython...
100, 35, 0, 100, 36, 0, 132, 0, 0, 90, 23, 0, 100, 37, 0, 100, 38, 0, 132, 0, 0, 90, 24, 0, 100, 39, 0, 101, 25, 0, 100, 40,
<|file_name|>EParameterImpl.cpp<|end_file_name|><|fim▁begin|>// -*- mode: c++; c-basic-style: "bsd"; c-basic-offset: 4; -*- /* * ecore/EParameterImpl.cpp * Copyright (C) Cátedra SAES-UMU 2010 <andres.senac@um.es> * * EMF4CPP is free software: you can redistribute it and/or modify it * under the terms of the GNU Le...
{ _any = m_eAnnotations->asEListOf< ::ecore::EObject > (); }
<|file_name|>dgels_gpu.cpp<|end_file_name|><|fim▁begin|>/* -- MAGMA (version 1.5.0-beta3) -- Univ. of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver @date July 2014 @generated from zgels_gpu.cpp normal z -> d, Fri Jul 18 17:34:16 2014 */ #include "c...
*info = 0;
<|file_name|>bgp_daemon.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4 # encoding: utf-8 # Copyright 2014 Orange # # 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 ...
catchAllLogHandler = LookingGlassLogHandler() # we inject this catch all log handler in all configured loggers for (loggerName, logger) in Logger.manager.loggerDict.iteritems():
<|file_name|>hu.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="hu_HU"> <context> <name>AboutDialog</name> <message> <source>About iTALC</source> <translation type="unfinished">Az iTALC névjegye</translation> </message> <me...
All computers in it will be removed as well!</source> <translation type="unfinished">Biztos benne, hogy törli a &quot;%1&quot; osztálytermet?
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Licensed under a 3-clause BSD style license - see LICENSE.rst """ astroquery.solarsystem.jpl -------------------------- <|fim▁hole|>from .sbdb import * from .horizons import * from . import *<|fim▁end|>
a collection of data services provided by JPL """
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate iron; extern crate persistent; #[macro_use] extern crate router; extern crate serde; extern crate serde_json; #[macro_use] extern crate serde_derive; extern crate hyper; extern crate rand; extern crate r2d2; extern crate postgres; extern crate r2d2_postgres...
cached_rows.push(DatabaseRow { id: row.get(0), randomNumber: row.get(1) });
<|file_name|>wcm-dashboardwidget-common.js<|end_file_name|><|fim▁begin|>var YDom = YAHOO.util.Dom; var YEvent = YAHOO.util.Event; var subChildren = null; var configTimeZone = null; if (typeof WcmDashboardWidgetCommon == "undefined" || !WcmDashboardWidgetCommon) { var WcmDashboardWidgetCommon = {}; } WcmD...
WcmDashboardWidgetCommon.editItem = function (matchedElement, isChecked) {
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .fb2_parser import FB2NoteParser from .pdf_parser import PDFNoteParser from .stat_parser import StatsAccessor <|fim▁hole|><|fim▁end|>
__all__ = ("FB2NoteParser", "PDFNoteParser", "StatsAccessor")
<|file_name|>0002_auto_20170929_1929.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-09-29 22:29 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('almoxarifado'...
<|file_name|>core.py<|end_file_name|><|fim▁begin|># Zed Attack Proxy (ZAP) and its related class files. # # ZAP is an HTTP/HTTPS proxy for assessing web application security. # # Copyright 2015 the ZAP development team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file excep...
return next(self.zap._request(self.zap.base + 'core/view/optionProxyChainRealm/').itervalues())
<|file_name|>data.py<|end_file_name|><|fim▁begin|>__author__ = 'g10k' """Потом убрать в миграции""" # ('Регистраторы','Регистраторы'), # ('Менеджеры','Менеджеры'), # ('Проф департамент','Проф департамент'), # ('Аналитика','Аналитика'), # ('Контроль качества','Контроль качества')...
<|file_name|>macros.rs<|end_file_name|><|fim▁begin|>#[macro_export] macro_rules! punctuator { ($lexer: ident, $p: ident) => ({ $lexer.iter.next(); Ok(Token::Punctuator(Punctuator::$p, $lexer.lo, $lexer.lo + 1)) }) } // Advance iter and hi position if pattern match #[macro_export] macro_rules! take ...
}); } // Advance iter if pattern match, keep hi position unchange
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>""" Copyright 2016, 2017 UFPE - Universidade Federal de Pernambuco Este arquivo é parte do programa Amadeus Sistema de Gestão de Aprendizagem, ou simplesmente Amadeus LMS <|fim▁hole|>Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título ...
O Amadeus LMS é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como publicada pela Fundação do Software Livre (FSF); na versão 2 da Licença. Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA GARANTIA; sem uma garantia implícita de...
<|file_name|>15.4.4.21-2-15.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 Ecma International. All rights reserved. // Ecma International makes this code available under the terms and conditions set // forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the // "Use Terms"). Any redistributio...
return (obj.length === 2); }
<|file_name|>footer-component.module.ts<|end_file_name|><|fim▁begin|>require("../core/core.module"); import { provide } from "../core"; import { FooterComponentEditorComponent } from "./footer-component-editor.component"; import { FooterComponentListComponent } from "./footer-component-list.component"; import { Footer...
}]);
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// rust-xmpp // Copyright (c) 2014-2015 Florian Zeitz // // This project is MIT licensed. // Please see the COPYING file for more information. use xml; use ns; pub use self::iq::Iq; pub use self::iq::IqType; pub use self::message::Message; pub use self::message::Messag...
DefinedCondition::NotAllowed => "not-allowed", DefinedCondition::NotAuthorized => "not-authorized", DefinedCondition::PolicyViolation => "policy-violation",
<|file_name|>ReplaceSchemaVersionEdges.java<|end_file_name|><|fim▁begin|>package com.gentics.mesh.changelog.changes; import static com.gentics.mesh.core.data.relationship.GraphRelationships.SCHEMA_CONTAINER_VERSION_KEY_PROPERTY; import com.gentics.mesh.changelog.AbstractChange; import com.tinkerpop.blueprints.Directi...
<|file_name|>ptr_offset_int_plus_ptr.rs<|end_file_name|><|fim▁begin|>// error-pattern: dangling pointer was dereferenced fn main() {<|fim▁hole|> // Can't start with an integer pointer and get to something usable unsafe { let _val = (1 as *mut u8).offset(ptr as isize); } }<|fim▁end|>
let ptr = Box::into_raw(Box::new(0u32));
<|file_name|>hmp_parity.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2015, ARM Limited and contributors. # # 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 Licens...
self.assertTrue( self.e_assert.assertFirstCpu(
<|file_name|>default.js<|end_file_name|><|fim▁begin|>var baseURL = window.location.pathname; var webRoot = "/"+baseURL.split("/")[1]; $(function(){ $('#logo_top').click(function() { window.location = webRoot; }); $('.link_formate').click(function() { $('.selected_menu').removeClass('selected_menu'); ...
$('.selected_menu').removeClass('selected_menu'); $(this).addClass('selected_menu'); window.location = webRoot+"/usuarios/perfil"; });
<|file_name|>felix_co2.py<|end_file_name|><|fim▁begin|>''' eqtime: 30 ''' def main(): info('Felix CO2 analysis') gosub('felix:WaitForCO2Access') gosub('felix:PrepareForCO2Analysis') set_motor('beam',beam_diameter) if analysis_type=='blank': info('is blank. not heating') ''...
<|file_name|>startup.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Tigera, 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/licen...
pool=(ipip_pool, None), host=hostname )
<|file_name|>tag.js<|end_file_name|><|fim▁begin|>var express = require('express'); var router = express.Router(); const env = require('env2')('./env.json'); var Tag = require('../mongo/tags') var IssueTag = require('../mongo/Issue') router.post('/removeTag', function (req, res, next) { var userID = req.body.user...
<|file_name|>post.socket.js<|end_file_name|><|fim▁begin|>/** * Broadcast updates to client when the model changes */ 'use strict'; var Post = require('./post.model'); exports.register = function(socket) { Post.schema.post('save', function (doc) { onSave(socket, doc); }); Post.schema.post('remove', functi...
<|file_name|>OSUtil.java<|end_file_name|><|fim▁begin|>/* * Copyright 2017 - 2019 Roman Borris (pcfreak9000), Paul Hagedorn (Panzer1119) * * 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 L...
}
<|file_name|>importDeclTypes.ts<|end_file_name|><|fim▁begin|>// @filename: /node_modules/@types/foo-bar/index.d.ts export interface Foo { bar: string; } // This should error<|fim▁hole|>// @filename: /a.ts import { Foo } from "@types/foo-bar";<|fim▁end|>
<|file_name|>tonality.js<|end_file_name|><|fim▁begin|>import React from 'react' import Icon from 'react-icon-base' const MdTonality = props => ( <Icon viewBox="0 0 40 40" {...props}> <g><path d="m32.9 23.4c0.1-0.6 0.2-1.2 0.3-1.8h-11.6v1.8h11.3z m-2.5 5c0.4-0.6 0.9-1.2 1.2-1.8h-10v1.8h8.8z m-8.8 4.8c1.8-0....
</Icon>
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>/** * Created by Deathnerd on 1/23/2015. */ var gulp = require('gulp'); var usemin = require('gulp-usemin'); var uglify = require('gulp-uglify'); var shell = require('gulp-shell'); var replace = require('gulp-replace'); gulp.task('usemin', function(){ gulp.sr...
<|file_name|>et.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
CKEDITOR.plugins.setLang("selectall","et",{toolbar:"Kõige valimine"});
<|file_name|>bad-aria-role-test.js<|end_file_name|><|fim▁begin|>module('BadAriaRole'); test('No elements === no problems.', function(assert) { var config = { ruleName: 'badAriaRole', expected: axs.constants.AuditResult.NA }; assert.runRule(config); }); test('No roles === no problems.', fun...
elements: [div] }; assert.runRule(config); });
<|file_name|>conversions.rs<|end_file_name|><|fim▁begin|>use hashing; impl<'a> From<&'a hashing::Digest> for crate::remote_execution::Digest { fn from(d: &hashing::Digest) -> Self { let mut digest = super::remote_execution::Digest::new(); digest.set_hash(d.0.to_hex()); digest.set_size_bytes(d.1 as i64); ...
#[cfg(test)]
<|file_name|>main_download.py<|end_file_name|><|fim▁begin|>''' Copyright (C) 2017 Quinn D Granfor <spootdev@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. This progr...
if json_message['Type'] == 'image': common_network.mk_network_fetch_from_url(json_message['URL'],
<|file_name|>utils.rs<|end_file_name|><|fim▁begin|>use ast::Node; pub fn format_vec(v: &[Node]) -> String { let mut a = String::new(); if !v.is_empty() { let last_idx = v.len() - 1; for (i, e) in v.iter().enumerate() { if i < last_idx { a.push_str(&format!("{} ", e))...
<|file_name|>kdcoplistview.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2000 by Ian Reinhart Geiser <geiseri@kde.org> * * Licensed under the Artistic License. */ #include "kdcoplistview.h" #include "kdcoplistview.moc" #include <kdebug.h> #include <qdragobject.h> #include <qstringlist.h> #include <qregexp.h>...
<|file_name|>mwmatching.py<|end_file_name|><|fim▁begin|>"""Weighted maximum matching in general graphs. The algorithm is taken from "Efficient Algorithms for Finding Maximum Matching in Graphs" by Zvi Galil, ACM Computing Surveys, 1986. It is based on the "blossom" method for finding augmenting paths and the "primal-d...
# If allowedge[k] is true, edge k has zero slack in the optimization # problem; if allowedge[k] is false, the edge's slack may or may not # be zero.
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
from djangothis.app import read_yaml, read_yaml_file, watchfile
<|file_name|>umsdevice.cpp<|end_file_name|><|fim▁begin|>/* * Cantata * * Copyright (c) 2011-2013 Craig Drummond <craig.p.drummond@gmail.com> * * ---- * * 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...
<< QLatin1String("Albums") << QLatin1String("ALBUMS"); foreach (const QString &d, dirs) { if (QDir(path+d).exists()) {
<|file_name|>template_ast.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 {AstPath} from '../ast_path'; import {CompileDirect...
} /**
<|file_name|>MercaderiaService.java<|end_file_name|><|fim▁begin|>package com.test.SERVICE; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; <|fim▁hole|> import com.test.BEAN.Mercaderia; @Service public class MercaderiaService implements IMercaderiaService{ @Aut...
import org.springframework.stereotype.Service; import com.test.DAO.IMercaderiaDAO;
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2013-2020 Blockstack PBC, a public benefit corporation // Copyright (C) 2020 Stacks Open Internet Foundation // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published...
<|file_name|>script.js<|end_file_name|><|fim▁begin|>import * as UTILS from '@utils'; const app = new WHS.App([ ...UTILS.appModules({ position: new THREE.Vector3(0, 40, 70) }) ]); const halfMat = { transparent: true, opacity: 0.5 }; const box = new WHS.Box({ geometry: { width: 30, height: 2, ...
);
<|file_name|>AtomicAlgebra.py<|end_file_name|><|fim▁begin|>from functools import reduce from itertools import chain, combinations, product, permutations # This class is used to represent and examine algebras on atom tables. # It is intended to be used for nonassociative algebras, but this is not assumed. class At...
failed_axioms.append("R09")
<|file_name|>define.py<|end_file_name|><|fim▁begin|>import urllib import ast import xchat __module_name__ = "Define" __module_author__ = "TingPing" __module_version__ = "2" __module_description__ = "Show word definitions" # based on google dictionary script by Sridarshan Shetty - http://sridarshan.co.cc <|fim▁hole|>de...
<|file_name|>strategy_test.go<|end_file_name|><|fim▁begin|>package build import ( "testing" "time" kapi "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" buildapi "github.com/openshift/origin/pkg/build/api" ) func TestBuildStrategy(t *testing.T) { ctx := kapi.NewDefaultContext() if !Strateg...
if Strategy.AllowCreateOnUpdate() { t.Errorf("Build should not allow create on update") }
<|file_name|>vorticity_and_diverg.py<|end_file_name|><|fim▁begin|>""" Load winds on pressure levels and calculate vorticity and divergence """ import os, sys import datetime import iris import iris.unit as unit diag = '30201' cube_name_u='eastward_wind' cube_name_v='northward_wind' pp_file_path='/projects/cascade/pwill...
#fu = '/projects/cascade/pwille/moose_retrievals/%s/%s/%s.pp' % (expmin1, experiment_id, diag)
<|file_name|>md5.filter.js<|end_file_name|><|fim▁begin|>(function() { 'use strict'; /* Filters */ var md5 = function (s) { if (!s) return ''; function L(k, d) { return (k << d) | (k >>> (32 - d)); } function K(G, k) { var I, d, F, H, x; F = (G & 2147483648); H = (k & 214...
return K(L(G, H), F); } function e(G) {
<|file_name|>domain_randomization_wrapper.py<|end_file_name|><|fim▁begin|>""" This file implements a wrapper for facilitating domain randomization over robosuite environments. """ import numpy as np from robosuite.utils.mjmod import CameraModder, DynamicsModder, LightingModder, TextureModder from robosuite.wrappers im...
"solimp_perturbation_ratio": 0.1, # Joint parameters "joint_names": None, # all joints randomized
<|file_name|>unique.rs<|end_file_name|><|fim▁begin|>use crate::convert::From; use crate::fmt; use crate::marker::{PhantomData, Unsize}; use crate::mem; use crate::ops::{CoerceUnsized, DispatchFromDyn}; /// A wrapper around a raw non-null `*mut T` that indicates that the possessor /// of this wrapper owns the referent....
/// `Unique` pointers are `Send` if `T` is `Send` because the data they
<|file_name|>package.py<|end_file_name|><|fim▁begin|>############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, t...
<|file_name|>imageContainer.test.js<|end_file_name|><|fim▁begin|>import imageContainer from '../server/api/helpers/imageContainer'; const entries = [ { html: '<img src="/img/60x30.png" alt="60x30" class="zoom" data-zoom-src="/img/60x30-original.png">', }, { html: `<div> <img src="/img/20x50.jpg"> </div...
});
<|file_name|>packed-struct-match.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...
let foo = Foo { bar: 1, baz: 2 }; match foo { Foo {bar, baz} => {
<|file_name|>LoadoutEdit.tsx<|end_file_name|><|fim▁begin|>import { t } from 'app/i18next-t'; import { D2BucketCategory, InventoryBucket } from 'app/inventory/inventory-buckets'; import { DimItem, PluggableInventoryItemDefinition } from 'app/inventory/item-types'; import { allItemsSelector, bucketsSelector, storesSelect...
const newLoadout = produce(loadout, (draftLoadout) => {
<|file_name|>mv.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- #<|fim▁hole|># # This file is part of MiG. # # MiG is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of ...
# --- BEGIN_HEADER --- # # mv - [insert a few words of module description on this line] # Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter
<|file_name|>test_greatest_common_divisor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import unittest import greatest_common_divisor as gcd class TestGreatestCommonDivisor(unittest.TestCase): def setUp(self): # use tuple of tuples instead of list of tuples because data won't change # ...
self.assertEqual(3, actual) actual = gcd.GreatestCommonDivisor.next_smaller_divisor(12, 3)
<|file_name|>GaussianKernel.java<|end_file_name|><|fim▁begin|>/* * GaussianKernel.java * * Created on September 25, 2004, 4:52 PM */ package jpview.graphics; /** * This class creates a kernel for use by an AffineTransformOp * * @author clyon */ public class GaussianKernel { private int radiu...
*/
<|file_name|>EmpView.java<|end_file_name|><|fim▁begin|>package com.samepage.view; import java.util.List; import com.samepage.model.EmpDTO; <|fim▁hole|> for (EmpDTO empDTO : emplist) { System.out.println(empDTO); } } public static void printOne(String title, EmpDTO empDTO){ System.out.println(title + ">>=...
public class EmpView { public static void print(String title, List<EmpDTO> emplist){ System.out.println(title + ">>========== ¿©·¯°Ç Ãâ·Â ===========<<");
<|file_name|>conn.go<|end_file_name|><|fim▁begin|>package proc import ( "bufio" "fmt" "io" "os" "os/exec" ) type StdioConn struct { io.ReadCloser io.WriteCloser waitErr chan error } // Close calls Close on both closers<|fim▁hole|> } if err := s.WriteCloser.Close(); err != nil { return err } return <-s.w...
func (s StdioConn) Close() error { if err := s.ReadCloser.Close(); err != nil { return err
<|file_name|>item_attribute.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe import _ clas...
if d.abbr in abbrs: frappe.throw(_("{0} must appear only once").format(d.abbr)) abbrs.append(d.abbr)
<|file_name|>issue-27268.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lic...
// except according to those terms. fn main() {
<|file_name|>initalize_db.py<|end_file_name|><|fim▁begin|>from Ponos import init_db from env_vars import *<|fim▁hole|>import os print(DB_PATH) open(DB_PATH, 'w').close() init_db()<|fim▁end|>
import sqlite3
<|file_name|>grid.js<|end_file_name|><|fim▁begin|>import { curry, range, always } from 'ramda' const FALSE = always(false) export const makeGrid = curry((cell, size) => { const r = range(0, size) return r.map((y) => r.map((x) => cell(y, x)))<|fim▁hole|>}) export const makeBlankGrid = makeGrid(FALSE)<|fim▁end|>
<|file_name|>test_departures.py<|end_file_name|><|fim▁begin|>"""Tests for the object departures module.""" import responses # initialize package, and does not mix up names import test as _test import navitia_client import requests class DeparturesTest(_test.TestCase): def setUp(self): self.user = 'leo' ...
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>""" Utility function to facilitate testing. """ from __future__ import division, absolute_import, print_function import os import sys import re import operator import warnings from functools import partial import shutil import contextlib from tempfile import mkdtemp,...
if re.match(r'\A'+d2[2:]+r'\Z', d1[2:]): continue diff_list.extend(l) continue
<|file_name|>gcp_pubsub_subscription_info.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # ...
- Array of scopes to be used type: list env_type: description:
<|file_name|>Entity.js<|end_file_name|><|fim▁begin|>/** * A 32-bit unsigned bitfield that describes an entity's classification(s) * @typedef {number} EntityClass */ /** * Enumerate entity classes */ const ENTITY = { NULL: 0x00, // Base celestial classes ASTEROID: 0x01, // floating rock in sp...
<|file_name|>files.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- """ File Operations """ from __future__ import with_statement import os import io import shutil import hashlib import zlib import base64 import tempfile import time import struct import sympy import mpmath import math from mathics.core.express...
evaluation.message('BinaryRead', 'format', typ)
<|file_name|>webpack.mix.js<|end_file_name|><|fim▁begin|>const mix = require('laravel-mix'); mix<|fim▁hole|>;<|fim▁end|>
.js('resources/assets/app.js', 'public/js') .extract(['vue', 'lodash'])
<|file_name|>runtests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ This script is used to run tests, create a coverage report and output the statistics at the end of the tox run. To run this script just execute ``tox`` """ import re from fabric.api import local, warn<|fim▁hole|> # Kept some files for b...
from fabric.colors import green, red if __name__ == '__main__':
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import gettext import __builtin__ import math __builtin__._ = gettext.gettext from shadowcraft.core import exceptions from shadowcraft.calcs import armor_mitigation from shadowcraft.objects import class_data from shadowcraft.objects import talents from shadowcraft...
if proc.proc_name == 'Rune of Re-Origination':
<|file_name|>create.py<|end_file_name|><|fim▁begin|># coding: utf-8 import sys reload(sys) sys.setdefaultencoding('utf-8') import sqlalchemy import ckan.plugins.toolkit as toolkit import ckan.lib.dictization.model_dictize as model_dictize from ckan.logic import NotAuthorized <|fim▁hole|> from sqlalchemy import Co...
import logging log = logging.getLogger(__name__)
<|file_name|>AbstractSequencer.java<|end_file_name|><|fim▁begin|>package com.github.kwoin.kgate.core.sequencer; import com.github.kwoin.kgate.core.message.Message; import com.github.kwoin.kgate.core.session.Session; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.annotation.Nullable; import java...
@Override
<|file_name|>astClone.cpp<|end_file_name|><|fim▁begin|>// // Created by admarkov on 09.05.17. // #include "mapping.h" Node* Node::clone(Node* r, Node* p) { if (r==nullptr) r = NodeToItsCopy[root];<|fim▁hole|> if (left!=nullptr) n->left = left->clone(r,n); if (right!=nullptr) n->right = right->clone(r,n); ...
Node *n = new Node (p, r, type, data, nullptr, nullptr); NodeToItsCopy[this] = n; CopyToClonedNode[n] = this; if (n->root==nullptr) n->root = n;
<|file_name|>setup.template.py<|end_file_name|><|fim▁begin|>from setuptools import setup from sample import __version__, __author__ setup(name='sample', version=__version__, description='an example of python module', url='http://github.com/josanly/python-module-project', author=__author__, ...
zip_safe=False)
<|file_name|>WNReliableNetworkTransportSocket.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2022, WNProject Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "WNNetworking/inc/WNReliableNetworkTransportSocket.h" #include ...
if (num_sent != static_cast<ssize_t>(total_bytes)) {
<|file_name|>serv.py<|end_file_name|><|fim▁begin|>################################################################################ # # # Coauthors: Antoine Eddi (@antoeddi) & Philippe Desmaison (@desmaisn) # # ...
<|file_name|>compile.rs<|end_file_name|><|fim▁begin|>use basm; use beast; use core::error::*; use std::env; use std::fs::File; use std::io::Write; use std::path::PathBuf; use std::str::FromStr; const BAKERVM_IMAGE_EXTENSION: &str = "img"; pub const DEFAULT_LANG: Lang = Lang::Beast; #[derive(Debug)] pub enum Lang { ...
// We don't want to fail at recognizing the language, so we just default to // Beast let lang = lang.unwrap_or_else(|| { if let Some(extension) = input.extension() {
<|file_name|>Rank.java<|end_file_name|><|fim▁begin|>package com.apixandru.rummikub.api; /** * @author Alexandru-Constantin Bledea * @since Sep 16, 2015 <|fim▁hole|> ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELVE, THIRTEEN; public int asNumber() { return ordinal() +...
*/ public enum Rank {
<|file_name|>flashx.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para flashx # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ # ------------------------------------------------------------ import ...
if url not in encontrados: logger.info(" url=" + url) devuelve.append([titulo, url, 'flashx']) encontrados.add(url)
<|file_name|>Hash.java<|end_file_name|><|fim▁begin|>/* * Copyright 2015 - FOCONIS AG * * 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...
try { return checksum(whose, "MD5"); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException("No MD5 algorithm present, why that?");
<|file_name|>stock_slot_verification_request.py<|end_file_name|><|fim▁begin|># Copyright 2017 Eficent Business and IT Consulting Services S.L. # (http://www.eficent.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models <|fim▁hole|>class SlotVerificationReques...
<|file_name|>fields.py<|end_file_name|><|fim▁begin|>from django import forms from django.conf import settings from django.utils.safestring import mark_safe from django.utils.translation import ugettext as _ import urllib2, urllib VERIFY_SERVER="http://api-verify.recaptcha.net/verify" class RecaptchaWidget(forms.Widge...
"invalid-request-cookie": _("The challenge parameter was filled incorrectly."), "incorrect-captcha-sol": _("Invalid Captcha solution."),
<|file_name|>day_09.rs<|end_file_name|><|fim▁begin|>use std::ptr::NonNull; type Link<T> = Option<NonNull<Node<T>>>; struct Node<T> { item: T, next: Link<T>, prev: Link<T>, } impl<T> Node<T> { fn new(item: T) -> Box<Self> { Box::new(Self { item, next: None, prev: None }) } } pub struct Un...
unsafe {
<|file_name|>autobahn.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for AutobahnJS v0.9.6 // Project: http://autobahn.ws/js/ // Definitions by: Elad Zelingher <https://github.com/darkl/>, Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com> // Definitions: https://github.com/bori...
reason: string; code: number; }
<|file_name|>mocktransfer.py<|end_file_name|><|fim▁begin|>def empty_reduce(rank, device_list, output, source=0): pass<|fim▁hole|><|fim▁end|>
def empty_sync_matrix(rank, device_list, output, source=0, collect=False): pass
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation # Copyright 2011 Nebula, 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 Lic...
<|file_name|>dummy.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function <|fim▁hole|> from sentry.identity.base import Provider from sentry.pipeline import PipelineView class AskEmail(PipelineView): def dispatch(self, request, pipeline): if 'email' in request.POST: ...
__all__ = ['DummyProvider'] from django.http import HttpResponse