prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>test_public_api.py<|end_file_name|><|fim▁begin|>"""Test the IPython.kernel public API Authors ------- * MinRK<|fim▁hole|># Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this s...
""" #-----------------------------------------------------------------------------
<|file_name|>Module.cpp<|end_file_name|><|fim▁begin|>// ================================================================================================= // ADOBE SYSTEMS INCORPORATED // Copyright 2011 Adobe Systems Incorporated // All Rights Reserved // // NOTICE: Adobe permits you to use, modify, and distribute this ...
<|file_name|>Codec.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2014 Ian Bondoc * * This file is part of Jen8583 * * Jen8583 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 ...
*/ void encode(ByteBuffer buf, T value);
<|file_name|>SpringCacheManagerWrapper.java<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2005-2012 https://github.com/zhangkaitao Licensed under the Apache License, Version 2.0 (the * "License"); */ package com.yang.spinach.common.utils.spring; import java.util.ArrayList; import java.util.Collection; import jav...
public Collection values() {
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Zinc, the bare metal stack for rust. // Copyright 2014 Vladimir "farcaller" Pouzanov <farcaller@gmail.com> // // 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 cop...
<|file_name|>admin_usuario_dir_envio.js<|end_file_name|><|fim▁begin|>function listar_dir_envio(){ $.ajax({ cache: false, url: administrador + "administrador_usuario.php?accion=listar_direccion_envio", type: 'POST', data: {"id_cliente": id_cliente_js}, dataType...
actualizar_cp(clave_estado, ciudad, colonia); });
<|file_name|>waker_ref.rs<|end_file_name|><|fim▁begin|>use super::arc_wake::{ArcWake}; use super::waker::waker_vtable; use alloc::sync::Arc; use core::mem::ManuallyDrop; use core::marker::PhantomData; use core::ops::Deref; use core::task::{Waker, RawWaker}; /// A [`Waker`] that is only valid for a given lifetime. /// ...
/// The resulting [`Waker`] will call /// [`ArcWake.wake()`](ArcWake::wake) if awoken. #[inline] pub fn waker_ref<W>(wake: &Arc<W>) -> WakerRef<'_>
<|file_name|>playlist-metadata-widget.service.ts<|end_file_name|><|fim▁begin|>import { Injectable, OnDestroy } from '@angular/core'; import { KalturaMultiRequest } from 'kaltura-ngx-client'; import { PlaylistWidget } from '../playlist-widget'; import { KalturaPlaylist } from 'kaltura-ngx-client'; import { Observable } ...
newData.description = this.data.description; newData.tags = this.data.tags; } }
<|file_name|>UriEnabledResource.java<|end_file_name|><|fim▁begin|>/***************************************************************************************** * *** BEGIN LICENSE BLOCK ***** * * Version: MPL 2.0 * * echocat Jomon, Copyright (c) 2012-2013 echocat * * This Source Code Form is subject to the terms of...
}
<|file_name|>concept.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """Provides concept object.""" from __future__ import absolute_import from .. import t1types from ..entity import Entity class Concept(Entity): """Concept entity.""" collection = 'concepts' resource = 'concept' _relations = ...
'name': None, 'status': t1types.int_to_bool, 'updated_on': t1types.strpt, 'version': int,
<|file_name|>messages_et.js<|end_file_name|><|fim▁begin|><|fim▁hole|>(function( factory ) { if ( typeof define === "function" && define.amd ) { define( ["jquery", "../jquery.validate"], factory ); } else if (typeof exports === "object") { factory(require("jquery")); } else { factory( jQuery ); } }(function( $...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>use cookie::Cookie as Cookie_M; use sapper::header::{Cookie, SetCookie}; use sapper::{Key, Request, Response, Result}; pub struct SessionVal; impl Key for SessionVal { type Value = String; } pub fn session_val(req: &mut Request, ckey: Option<&'static str>) -> Resul...
Some(()) }); Ok(())
<|file_name|>0009_auto_20201201_1412.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2.15 on 2020-12-01 13:12 from django.db import migrations import djmoney.models.fields class Migration(migrations.Migration): dependencies = [ ("projects", "0008_auto_20190220_1133"), ] operations = [ ...
("HUF", "Forint"),
<|file_name|>setup.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/licenses/LIC...
<|file_name|>gpa.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Class list file should be a csv with COURSE_ID,NUM_UNITS,GRADE # GRADE should be LETTER with potential modifiers after that # registrar.mit.edu/classes-grades-evaluations/grades/calculating-gpa import argparse import pandas as pd def get_parser(): # ...
# Quick script to calculate GPA given a class list file.
<|file_name|>test_metaplugin.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012, Nachi Ueno, NTT MCL, 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 ma...
<|file_name|>ValidatedTextBox.js<|end_file_name|><|fim▁begin|>import React from 'react'; import FormGroup from 'react-bootstrap/lib/FormGroup'; import FormControl from 'react-bootstrap/lib/FormControl'; import ControlLabel from 'react-bootstrap/lib/ControlLabel'; import HelpBlock from 'react-bootstrap/lib/HelpBlock'; ...
controlId={controlId} validationState={validationState}> <ControlLabel> {label} </ControlLabel>
<|file_name|>string_utils.rs<|end_file_name|><|fim▁begin|>//! Various utilities for string operations. /// Join items of a collection with separator. pub trait JoinWithSeparator<S> { /// Result type of the operation type Output; /// Join items of `self` with `separator`. fn join(self, separator: S) -> Self::Ou...
<|file_name|>gecko.mako.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/. */ // `data` comes from components/style/properties.mako.rs; ...
pub fn set_${ident}(&mut self, other: values::computed::Transform) {
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2012 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. import inspect import os import re import urlparse _next_page_id = 0 class Page(object): def __init...
self.startup_url = page_set.startup_url if page_set else ''
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>/** * * Web Starter Kit * Copyright 2014 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 * ...
gulp.task('serve', ['browserify'], function () {
<|file_name|>base.py<|end_file_name|><|fim▁begin|>from django import http from django.contrib.messages import constants, get_level, set_level, utils from django.contrib.messages.api import MessageFailure from django.contrib.messages.constants import DEFAULT_LEVELS from django.contrib.messages.storage import base, defau...
""" storage = self.get_existing_storage() self.assertFalse(storage.used)
<|file_name|>random.rs<|end_file_name|><|fim▁begin|>// The MIT License (MIT) // // Copyright (c) 2015 dinowernli<|fim▁hole|>// of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, pub...
// // Permission is hereby granted, free of charge, to any person obtaining a copy
<|file_name|>ServerEventHandler.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * Copyright (c) 2012, 2015 Pivotal Software, Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Apac...
}
<|file_name|>XMLModelParserException.java<|end_file_name|><|fim▁begin|>/** * This program and the accompanying materials * are made available under the terms of the License * which accompanies this distribution in the file LICENSE.txt */ package org.opengroup.archimate.xmlexchange; /** * XML Exception * * @aut...
super(message, cause); } }
<|file_name|>MainActivity.java<|end_file_name|><|fim▁begin|>package com.jota.patterns.singleton; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import com.jota.patterns.s...
setContentView(R.layout.activity_main);
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub use self::dependency::Dependency; pub use self::features::{ enable_nightly_features, maybe_allow_nightly_features, nightly_features_allowed, }; pub use self::features::{CliUnstable, Edition, Feature, Features}; pub use self::interning::InternedString; pub use sel...
pub mod dependency;
<|file_name|>test_svn.py<|end_file_name|><|fim▁begin|># coding=utf-8 import os import unittest from hashlib import md5 from django.conf import settings from djblets.testing.decorators import add_fixtures from kgb import SpyAgency from reviewboard.diffviewer.diffutils import patch from reviewboard.diffviewer.testing....
"""Testing SVN (<backend>) get_commits with branch"""
<|file_name|>ClangCompiler.java<|end_file_name|><|fim▁begin|>/* * Copyright 2015-present Facebook, 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 obtain * a copy of the License at * * http://www.apache.org/li...
<|file_name|>issue-61801-path-pattern-can-infer.rs<|end_file_name|><|fim▁begin|>// In this regression test we check that a path pattern referring to a unit variant // through a type alias is successful in inferring the generic argument. // check-pass enum Opt<T> { N, S(T), } type OptAlias<T> = Opt<T>; fn f1...
<|file_name|>pyunit_NOFEATURE_prostateGLM.py<|end_file_name|><|fim▁begin|>import sys sys.path.insert(1, "../../../") import h2o import pandas as pd import statsmodels.api as sm def prostate(ip,port): # Log.info("Importing prostate.csv data...\n") h2o_data = h2o.upload_file(path=h2o.locate("smalldata/logreg...
<|file_name|>mnist_mlp.py<|end_file_name|><|fim▁begin|>import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('data', one_hot=True)<|fim▁hole|>mnist_train = mnist.train mnist_val = mnist.validation p = 28 * 28 n = 10 h1 = 300 func_act = tf.nn.sigmoid x_p...
<|file_name|>GUIINV.py<|end_file_name|><|fim▁begin|># -*-python-*- # GemRB - Infinity Engine Emulator # Copyright (C) 2003-2004 The GemRB Project # # 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...
Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None)
<|file_name|>geo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import math EARTH_RADIUS = 6367009 METERS_PER_DEGREE = 111319.0 FEET_PER_METER = 3.2808399 <|fim▁hole|> def geographic_distance(loc1, loc2): """ Calculate the great circle distance between two points on the earth (specified in decima...
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from ampadb.support import Forms from django import forms from django.core.exceptions import ValidationError from . import ies_format from .ampacsv import InvalidFormat from .import_fmts import IEFormats class ExportForm(Forms.Form): FORMAT_CHOICES = [(IEFormats....
required=False, # 'Conservar' per defecte
<|file_name|>1.cc<|end_file_name|><|fim▁begin|>// { dg-options "-std=gnu++11" } // Copyright (C) 2011-2014 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License ...
// You should have received a copy of the GNU General Public License along // with this library; see the file COPYING3. If not see
<|file_name|>people.server.controller.js<|end_file_name|><|fim▁begin|>'use strict'; /** * Module dependencies. */ var path = require('path'), mongoose = require('mongoose'), Person = mongoose.model('Person'), errorHandler = require(path.resolve('./modules/core/server/controllers/errors.server.controller')), ...
res.jsonp(person); };
<|file_name|>importer_test.py<|end_file_name|><|fim▁begin|>from StringIO import StringIO import textwrap import importer def test_import_csv(): current = StringIO(textwrap.dedent('''\ status,qty,type,transaction_date,posting_date,description,amount A,,,2016/11/02,,This is a test,$4.53 ...
5/2/2007, Regal Theaters, $15.99 11/2/2016, This is a test , $4.53 5/2/2007, Regal Theaters, $15.99 '''))
<|file_name|>trees.py<|end_file_name|><|fim▁begin|>''' @author: Michael Wan @since : 2014-11-08 ''' from math import log import operator def createDataSet(): dataSet = [[1, 1, 'yes'], [1, 1, 'yes'], [1, 0, 'no'], [0, 1, 'no'], [0, 1, 'no']] ...
<|file_name|>MessageUtils.java<|end_file_name|><|fim▁begin|>package org.cohorte.herald.core.utils; import java.util.Iterator; import org.cohorte.herald.Message; import org.cohorte.herald.MessageReceived; import org.jabsorb.ng.JSONSerializer; import org.jabsorb.ng.serializer.MarshallException; import org.jabsorb.ng.se...
if (cont != null) { if (cont instanceof JSONObject || cont instanceof JSONArray) { wMsg.setContent(pSerializer.fromJSON(cont.toString()));
<|file_name|>test_strings.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010-2015 openpyxl # package imports from openpyxl.reader.strings import read_string_table from openpyxl.tests.helper import compare_xml def test_read_string_table(datadir): datadir.join('reader').chdir() src = 'sharedStrings.xml' ...
def test_write_string_table(datadir): from openpyxl.writer.strings import write_string_table
<|file_name|>count_zeros.rs<|end_file_name|><|fim▁begin|>use num::logic::traits::CountZeros;<|fim▁hole|> #[inline] fn count_zeros(self) -> u64 { u64::from($t::count_zeros(self)) } } }; } apply_to_primitive_ints!(impl_count_zeros);<|fim▁end|>
macro_rules! impl_count_zeros { ($t:ident) => { impl CountZeros for $t {
<|file_name|>intensity_regression_test.py<|end_file_name|><|fim▁begin|>import unittest import pandas as pd import nose.tools from mia.features.blobs import detect_blobs from mia.features.intensity import detect_intensity from mia.utils import preprocess_image from ..test_utils import get_file_path class IntensityTes...
msk_path = get_file_path("mias/masks/mdb154_mask.png") cls._img, cls._msk = preprocess_image(img_path, msk_path)
<|file_name|>BeaconIndexType.java<|end_file_name|><|fim▁begin|>// =================================================================================================== // _ __ _ _ // | |/ /__ _| | |_ _ _ _ _ __ _ // | ' </ _` | | _| || | '...
<|file_name|>server-map-diagram-with-cytoscapejs.class.ts<|end_file_name|><|fim▁begin|>import cytoscape from 'cytoscape'; import dagre from 'cytoscape-dagre'; import { from as fromArray, fromEvent, iif, zip, merge, Observable } from 'rxjs'; import { mergeMap, map, pluck, switchMap, take, reduce } from 'rxjs/operators';...
} setMapData(serverMapData: ServerMapData, baseApplicationKey = ''): void { this.serverMapData = serverMapData;
<|file_name|>main.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
uucore::bin!(uu_base32);
<|file_name|>no-control-regex.js<|end_file_name|><|fim▁begin|>/** * @fileoverview Rule to forbid control charactes from regular expressions. * @author Nicholas C. Zakas */ "use strict"; //------------------------------------------------------------------------------ // Rule Definition //---------------------------...
* Check if given regex string has control characters in it * @param {string} regexStr regex as string to check
<|file_name|>generated.pb.go<|end_file_name|><|fim▁begin|>/* Copyright The Kubernetes 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 Unless...
var l int _ = l l = m.ObjectMeta.Size() n += 1 + l + sovGenerated(uint64(l))
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- ''' @date: 2014-07-02 @author: shell.xu ''' import os, sys, json, logging import bottle from bottle import request, template, redirect from db import * logger = logging.getLogger('utils') app = bottle.default_app() sess = app....
start = (page - 1) * pagenum stop = min(start + pagenum, cnt) kw['pagemax'] = int((cnt-1) / pagenum) + 1
<|file_name|>DebuggerTestingTransform.cpp<|end_file_name|><|fim▁begin|>//===--- DebuggerTestingTransform.cpp - Transform for debugger testing ----===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors // Licensed under Apache Li...
} // end anonymous namespace void swift::performDebuggerTestingTransform(SourceFile &SF) {
<|file_name|>_configuration.py<|end_file_name|><|fim▁begin|># coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information.<|fim▁hole|>fr...
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # --------------------------------------------------------------------------
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Resolution of the entire dependency graph for a crate //! //! This module implements the core logic in taking the world of crates and //! constraints and creating a resolved graph with locked versions for all //! crates and their dependencies. This is separate from t...
let key = (id.name().to_string(), id.source_id().clone()); let prev = self.activations.entry(key).or_insert(Vec::new());
<|file_name|>dashboard.py<|end_file_name|><|fim▁begin|>""" This file was generated with the customdashboard management command and contains the class for the main dashboard. To activate your index dashboard add the following to your settings.py:: GRAPPELLI_INDEX_DASHBOARD = 'version3.dashboard.CustomIndexDashboard...
# limit=5 # )) # append a recent actions module
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (C) 2016 ycmd contributors # # This file is part of ycmd. # # ycmd 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 Lice...
def Wrapper( *args, **kwargs ):
<|file_name|>generic-exterior-unique.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.ap...
let rbfoo: Recbox<int> = reclift::<int>(foo); assert_eq!(*rbfoo.x, foo);
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import datetime import json from brake.decorators import ratelimit from django.utils.decorators import method_decorator from django.utils.translation import get_language from django.conf import settings from django.core.urlresolvers import reverse_lazy from django.htt...
"urn": latest_journey.urn, "name": latest_journey.name, "extra_data": {
<|file_name|>wm_touch.py<|end_file_name|><|fim▁begin|>''' Support for WM_TOUCH messages (Windows platform) ================================================ ''' __all__ = ('WM_MotionEventProvider', 'WM_MotionEvent') import os from kivy.input.providers.wm_common import WNDPROC, \ SetWindowLong_WndProc_wrapper, RECT...
<|file_name|>logging_ops.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/licens...
input_: A tensor passed through this op. data: A list of tensors to print out when op is evaluated.
<|file_name|>UpdateFieldFlags.cpp<|end_file_name|><|fim▁begin|>#pragma once #ifndef __TRINITY_UPDATEFIELDFLAGS_H__ #define __TRINITY_UPDATEFIELDFLAGS_H__ #include "UpdateFieldFlags.h" // Auto generated for version 17359 // > Object uint32 ObjectUpdateFieldFlags[OBJECT_END] = { UF_FLAG_PUBLIC, // OBJECT_FIELD_GUI...
UF_FLAG_PUBLIC, // UNIT_FIELD_BASE_MANA
<|file_name|>retrieve_stats.py<|end_file_name|><|fim▁begin|>import sys, csv, string<|fim▁hole|>def generate_R_input(report_path, output_path): confidence_values = [] report_file = open(report_path, 'r') first_line = True for line in report_file: if first_line: first_line = False ...
<|file_name|>mahalanobis.py<|end_file_name|><|fim▁begin|>import numpy as np ### 1: IH ### 2: EH ### 3: AE ### 4: AO ### 6: AH ### 7: UH ### ### 11: iyC beat ### 12: iyF be ### 21: eyC bait ### 22: eyF bay ### 41: ayV buy ### 47: ayO bite ### 61: oy boy ### 42: aw bough ### 62: owC boat ### 63: owF bow ### 72: uwC boot...
[15.52651, 30.4288, 0.4057237, 0.07124884], [7.784475, 81.06186, 0.07124884, 0.4493804]]), '24': np.matrix([[7187.811, 4778.768, 11.81843, 8.616023],
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod serialize; /// Handle to a dock #[derive(Debug, PartialEq, Clone, Copy)] pub struct DockHandle(pub u64); /// Holds information about the plugin view, data and handle #[derive(Debug, Clone)] pub struct Dock { pub handle: DockHandle, pub plugin_name: String, ...
} }
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages setup( name="RaspberryRacer", version="0.1", description="Raspberry Racer", author="Diez B. Roggisch", author_email="deets@web.de", entry_points= { 'console_scripts' : [ 'rrac...
<|file_name|>reproduce_state.py<|end_file_name|><|fim▁begin|>"""Reproduce an Switch state.""" import asyncio import logging from typing import Iterable, Optional from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON, STATE_OFF, STATE_ON, ) from homeassistant.core impor...
_LOGGER = logging.getLogger(__name__)
<|file_name|>toc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright © 2014 René Samselnig # # This file is part of Database Navigator. # # Database Navigator is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish...
toc.append('{}- [{}]({}-{})'.format('\t'*(d-2), t, f, c[f]))
<|file_name|>sites.py<|end_file_name|><|fim▁begin|>import numpy as np class Site(object): """A class for general single site Use this class to create a single site object. The site comes with identity operator for a given dimension. To build specific site, additional operators need be add with add...
n_up = self.operators["n_up"] n_down = self.operators["n_down"]
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import factory from test_utils import TestCase as BaseTestCase from mozillians.announcements import models class TestCase(BaseTestCase): pass class AnnouncementFactory(factory.DjangoModelFactory): FACTORY_FOR = models.Announcement title = factory.Se...
text = factory.Sequence(lambda n: 'Text for Announcement {0}'.format(n))
<|file_name|>ease.rs<|end_file_name|><|fim▁begin|>use std::f64::NAN; use std::f64::consts::{PI, FRAC_PI_2}; #[deriving(Clone)] pub enum Mode { In, Out, InOut } /// A trait for "easing" from one value to another. Easing is an interpolation /// between two values, usually non-linear. pub trait Ease: Clone {...
t * t
<|file_name|>italian.py<|end_file_name|><|fim▁begin|># Italian / Italiano - Translations - Python 3 Only! from seleniumbase import BaseCase from seleniumbase import MasterQA class CasoDiProva(BaseCase): def __init__(self, *args, **kwargs): super(CasoDiProva, self).__init__(*args, **kwargs) self._...
# "Manual Check" self.DEFAULT_VALIDATION_TITLE = "Controllo manuale"
<|file_name|>protocol_trait.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 Alexander Reece // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may...
<|file_name|>_35_TreeMapTest.java<|end_file_name|><|fim▁begin|>package edu.ptu.javatest._60_dsa; import org.junit.Test; import java.util.TreeMap; import static edu.ptu.javatest._20_ooad._50_dynamic._00_ReflectionTest.getRefFieldBool; import static edu.ptu.javatest._20_ooad._50_dynamic._00_ReflectionTest.getRefFieldO...
<|file_name|>BenchmarkTest16926.java<|end_file_name|><|fim▁begin|>/** * OWASP Benchmark Project v1.1 * * This file is part of the Open Web Application Security Project (OWASP) * Benchmark Project. For details, please see * <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>...
<|file_name|>Nav.js<|end_file_name|><|fim▁begin|>import React, { Component } from 'react'; import { Link } from 'react-router-dom' import { CSSTransition } from 'react-transition-group'; class Nav extends Component { constructor(props) { super(props); this.state = { menuActive: false } this.ha...
<div className="nav__shadowBackground"/> </CSSTransition> </div> );
<|file_name|>single-line-html-open.js<|end_file_name|><|fim▁begin|>// Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- esid: sec-html-like-comments description: SingleLineHTMLOpenComment info: | Comment :: MultiLineCom...
<!--
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __init__ import redis_db from werkzeug.security import generate_password_hash, check_password_hash from os import urandom from base64 import b64encode class User(object): def __init__(self): self.username = "" # required self.password_hash ...
redis_db.delete(self.username + ":contacts")
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'; import React from 'react'; import ReactDOM from 'react-dom'; import UIDropdownComponent from './component'; let uiDropdown = function (element) { ReactDOM.render( React.createElement( UIDropdownComponent, {'message': ...
export default uiDropdown;
<|file_name|>IconTheme.py<|end_file_name|><|fim▁begin|># encoding: utf-8 # module gtk._gtk # from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so # by generator 1.135 # no doc # imports import atk as __atk import gio as __gio import gobject as __gobject import gobject._gobject as __gobject__gobject class IconTh...
pass def list_icons(self, *args, **kwargs): # real signature unknown pass
<|file_name|>Find-Unusual-Scripts.py<|end_file_name|><|fim▁begin|># (c) 2016 Douglas Roark # Licensed under the MIT License. See LICENSE for the details. from __future__ import print_function, division # Valid as of 2.6 import sys sys.path.insert(0, '/home/droark/Projects/etotheipi-BitcoinArmory') import binascii, has...
rewindVal = 0 # Here only so that future changes are made obvious.
<|file_name|>data_manipulation.py<|end_file_name|><|fim▁begin|>import pandas import numpy import operator from sklearn.preprocessing import OneHotEncoder from typing import Mapping def one_hot_encode(vector, dtype='float32', categories=None, index=None): if isinstance(vector, pandas.Series): index = vector.index ...
>>> periodize(h, default='OP', AM=(6.5, 9), PM=(16, 19))
<|file_name|>main.cc<|end_file_name|><|fim▁begin|>#include <fstream> #include <iostream> #include <vector> <|fim▁hole|> std::vector<std::string> args(argv, argv + argc); std::ofstream tty; tty.open("/dev/tty"); if (args.size() <= 1 || (args.size() & 2) == 1) { std::cerr << "usage: maplabel [devlocal remote]...
int main(int argc, char **argv) {
<|file_name|>package_integrity_test.py<|end_file_name|><|fim▁begin|>import os import unittest<|fim▁hole|>from conans.test.utils.conanfile import TestConanFile from conans.test.utils.tools import TestClient, TestServer,\ NO_SETTINGS_PACKAGE_ID from conans.util.files import set_dirty class PackageIngrityTest(unitte...
from conans.model.ref import ConanFileReference, PackageReference
<|file_name|>transaction_queue.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity 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, ...
// when txq.remove_invalid(&tx1.hash(), &|_| default_nonce() + 1.into());
<|file_name|>HarvesterProfileSettings.java<|end_file_name|><|fim▁begin|>/* * Licensed to The Apereo Foundation under one or more contributor license * agreements. See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * The Apereo Foundation licenses this file ...
}
<|file_name|>renren.d.ts<|end_file_name|><|fim▁begin|>import * as React from 'react'; import { IconBaseProps } from 'react-icon-base';<|fim▁hole|><|fim▁end|>
declare class FaRenren extends React.Component<IconBaseProps> { } export = FaRenren;
<|file_name|>HttpClient.test.ts<|end_file_name|><|fim▁begin|>// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. import { HttpRequest } from "../src/HttpClient"; import { TestHttpClient } from "./TestHttpClient"; import { registerUnha...
expect(request.headers).toEqual({ "X-HEADER": "VALUE"}); }); });
<|file_name|>ping_.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python #Master-Thesis dot parsing framework (PING MODULE) #Date: 14.01.2014 #Author: Bruno-Johannes Schuetze #uses python 2.7.6 #uses the djikstra algorithm implemented by David Eppstein #Module does calculations to behave similar to ping, uses delay label...
<|file_name|>icons_rc.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Resource object code # # Created: Sat May 11 12:28:54 2013 # by: The Resource Compiler for PyQt (Qt v4.8.4) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = b"\ \x00\x00\x04\x58\ \...
\x73\x65\x00\x68\x74\x74\x70\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\
<|file_name|>graphs.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # SyConn - Synaptic connectivity inference toolkit # # Copyright (c) 2016 - now # Max Planck Institute of Neurobiology, Martinsried, Germany # Authors: Philipp Schubert, Joergen Kornfeld import itertools from typing import List, Any, Optional, ...
for e in nx.bfs_edges(g, n): n_subgraph.append(e[1]) nb_edges += 1
<|file_name|>rollup.config.js<|end_file_name|><|fim▁begin|><|fim▁hole|>import nodeResolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; import nodePolyfills from 'rollup-plugin-node-polyfills'; export default [ { input: 'support/demo_template/demo.js', output: { file: 'd...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod address; mod entry; mod table; mod huge; mod page; use alloc::boxed::Box; use alloc::vec::Vec; use sys::volatile::prelude::*; use pi::common::IO_BASE as _IO_BASE; use core::fmt; use aarch64; pub use self::entry::Entry; pub use self::table::{Table, Level, L0, L1,...
entry: Entry::INVALID, physical: None, } }
<|file_name|>vl_demo_sift_edge.py<|end_file_name|><|fim▁begin|>import Image import numpy import pylab import vlfeat from vlfeat.plotop.vl_plotframe import vl_plotframe if __name__ == '__main__': """ VL_DEMO_SIFT_EDGE Demo: SIFT: edge treshold """ I = numpy.zeros([100, 500]) for i in 10 * (1+numpy.arange(9)): d ...
pylab.show()
<|file_name|>ascii.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.org/lice...
unsafe fn into_ascii_nocheck(self) -> ~[Ascii] { cast::transmute(self) } }
<|file_name|>dex_to_bytes.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|># you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache...
<|file_name|>critical.py<|end_file_name|><|fim▁begin|>from JumpScale import j import JumpScale.baselib.watchdog.manager import JumpScale.baselib.redis import JumpScale.lib.rogerthat descr = """ critical alert<|fim▁hole|> REDIS_PORT = 9999 # API_KEY = j.application.config.get('rogerthat.apikey') redis_client = j.clien...
""" organization = "jumpscale" enable = True
<|file_name|>builtins.rs<|end_file_name|><|fim▁begin|>extern crate easy_strings; use self::easy_strings::EZString; /// /// Macro to mimick Python's slicing. /// macro_rules! slice { ( $e:expr , [ ; $end_expr:expr ] ) => { $e [..$end_expr] }; ( $e:expr , [ $start_expr:expr ; $end_expr:expr] ) => { ...
assert_eq!(super::any([2, 0, 4].iter()), true); assert_eq!(super::any([0, 0, 0].iter()), false); }
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals import csv import datetime from django.core.exceptions import PermissionDenied from django.http import HttpResponse from django.shortcuts import get_object_or_404, redirect, render from django.utils.encoding im...
def list_submissions(request, page_id):
<|file_name|>size.js<|end_file_name|><|fim▁begin|>import store from "@/store"; import { modV } from "@/modv"; import Vue from "vue"; const state = { width: 200, height: 200, previewX: 0, previewY: 0, previewWidth: 0, previewHeight: 0 }; // getters const getters = { width: state => state.width, height:...
const newWidthToHeight = newWidth / newHeight; if (newWidthToHeight > widthToHeight) {
<|file_name|>media.js<|end_file_name|><|fim▁begin|>import Helper from '@ember/component/helper'; import { inject as service } from '@ember/service'; import { get } from '@ember/object';<|fim▁hole|> constructor() { super(...arguments); this.media.on('mediaChanged', () => { this.recompute(); }); } ...
export default class MediaHelper extends Helper { @service() media;
<|file_name|>LinuxExporter.ts<|end_file_name|><|fim▁begin|>import {Exporter} from './Exporter'; import {GraphicsApi} from '../GraphicsApi'; import {Options} from '../Options'; import {Platform} from '../Platform'; import {Project} from '../Project'; import * as fs from 'fs-extra'; import * as path from 'path'; import {...
<|file_name|>BoundKind.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Pu...
public String toString() { return name; } }