prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>_delspecial.py<|end_file_name|><|fim▁begin|>#importacion de librerias import sys reload(sys) sys.setdefaultencoding('UTF8') if len(sys.argv)>1: #si el argumento existe archive = open(sys.argv[1],"r") <|fim▁hole|> for i in archive: text.append(i) for j in i: ...
text = []
<|file_name|>0003_auto_20141114_1441.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 = [ ('imagr_app', '0002_auto_20141106_1538'), ] operations = [ ...
<|file_name|>key_templates.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 The Tink-Rust 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/license...
value: serialized_format,
<|file_name|>textdecoder.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::TextDecoderBinding;...
encoding: EncodingRef, fatal: bool, }
<|file_name|>creatortypes.py<|end_file_name|><|fim▁begin|>############################################################################ # # Copyright (C) 2015 The Qt Company Ltd. # Contact: http://www.qt.io/licensing # # This file is part of Qt Creator. # # Commercial License Usage # Licensees holding valid commercial Q...
def qdump__CPlusPlus__StringLiteral(d, value): d.putSimpleCharArray(value["_chars"], value["_size"]) d.putPlainChildren(value)
<|file_name|>phe_exceptions.py<|end_file_name|><|fim▁begin|>''' Base module for all of the exceptions classes used internally. Created on 10 Dec 2013 @author: alex ''' class PheException(Exception): ''' This is the top level class that EVERYTHING must be derived from. In particular, this class contains ...
''' def __init__(self, msg, cause, phe_return_code=255):
<|file_name|>version.go<|end_file_name|><|fim▁begin|>// 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 // // http://www.apache.org/lic...
<|file_name|>altcoin_nb.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="nb" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="14"/><|fim▁hole|> <message> <location ...
<source>About Altcoin</source> <translation>Om Altcoin</translation> </message>
<|file_name|>display_list_builder.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/. */ //! Builds display lists from flows and fragment...
self.base.display_list_building_result = if self.fragment.establishes_stacking_context() {
<|file_name|>test_etags.py<|end_file_name|><|fim▁begin|>import cherrypy from cherrypy.test import helper class ETagTest(helper.CPWebCase): def setup_server(): class Root: def resource(self): return "Oh wah ta goo Siam." resource.exposed = True ...
self.getPage("/resource", headers=[('If-Match', "a bogus tag")]) self.assertStatus("412 Precondition Failed") # Test If-None-Match (both valid and invalid)
<|file_name|>plane-details.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit, Input, Output } from '@angular/core'; import {PlanesService} from '../planes/planes.service'; import {IPlane, AppStore} from '../interfaces'; @Component({ moduleId: module.id, selector: 'app-plane-details', // templa...
</table>
<|file_name|>test_manual_mqtt.py<|end_file_name|><|fim▁begin|>"""The tests for the manual_mqtt Alarm Control Panel component.""" from datetime import timedelta import unittest from unittest.mock import patch from homeassistant.setup import setup_component from homeassistant.const import ( STATE_ALARM_DISARMED, STA...
self.assertTrue(setup_component( self.hass, alarm_control_panel.DOMAIN, {'alarm_control_panel': {
<|file_name|>documentation.py<|end_file_name|><|fim▁begin|>import sys import requests from urllib.parse import urlparse docs_repos = [ "frappe_docs", "erpnext_documentation", "erpnext_com", "frappe_io", ] def uri_validator(x): result = urlparse(x) return all([result.scheme, result.netloc, result.path]) def d...
if title.startswith("feat") and head_sha and "no-docs" not in body:
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import threading import numpy as np def ros_ensure_valid_name(name): return name.replace('-','_') def lineseg_box(xmin, ymin, xmax, ymax): return [ [xmin,ymin,xmin,ymax], [xmin,ymax,xmax,ymax], [xmax,ymax,xmax,ymin], [xm...
# (The value could get read, then another thread could set it, # and only then might it get flagged as clear by this thread, # even though a new value is waiting.) val = self._val
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>fn main() {<|fim▁hole|>}<|fim▁end|>
let x:f32 = std::f32::MAX; let y:f64 = std::f64::MAX; println!("{:?}",x ); println!("{:?}",y );
<|file_name|>IneoRealTimeFileFormat.cpp<|end_file_name|><|fim▁begin|>/** IneoRealTimeFileFormat class implementation. @file IneoRealTimeFileFormat.cpp This file belongs to the SYNTHESE project (public transportation specialized software) Copyright (C) 2002 Hugues Romain - RCSmobility <contact@rcsmobility.com> Thi...
return transaction; } } }
<|file_name|>response.go<|end_file_name|><|fim▁begin|>/* Copyright 2017 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 Unles...
Message: e.Error(), } }
<|file_name|>value.py<|end_file_name|><|fim▁begin|># # Copyright 2009-2010 Goran Sterjov # This file is part of Myelin. # # Myelin is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either v...
type = self.get_type() atom = type.get_atom()
<|file_name|>pack.cc<|end_file_name|><|fim▁begin|>/* * nextpnr -- Next Generation Place and Route * * Copyright (C) 2018-19 gatecat <gatecat@ds0.me> * Copyright (C) 2020 Pepijn de Vos <pepijn@symbioticeda.com> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or w...
} else { // CIN from logic connect_port(ctx, ctx->nets[cin_netId].get(), packed_head.get(), id_B); connect_port(ctx, ctx->nets[cin_netId].get(), packed_head.get(), id_D);
<|file_name|>text-setting.test.tsx<|end_file_name|><|fim▁begin|>import { render } from '@testing-library/react'; import React from 'react'; import configureMockStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import { globalBeforeEach } from '../../../../__jest__/before-each';<|fim▁hole|>import { RootSt...
import { reduxStateForTest } from '../../../../__jest__/redux-state-for-test'; import { withReduxStore } from '../../../../__jest__/with-redux-store';
<|file_name|>Config.java<|end_file_name|><|fim▁begin|>package com.insane.levellingtools; import net.minecraftforge.common.config.Configuration;<|fim▁hole|> * Created by Michael on 11/08/2014. */ public class Config { public static int baseXP; public static int increasePerLevel; public static int maxLevel;...
import java.io.File; /**
<|file_name|>0020_auto__add_field_video2013_created.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Video2013.create...
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
<|file_name|>test_flaskpypi.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_flaskpypi ---------------------------------- <|fim▁hole|>""" import pytest from flaskpypi import flaskpypi # Code from https://wiki.python.org/moin/PyPISimple from xml.etree import ElementTree from urll...
Tests for `flaskpypi` module.
<|file_name|>TombRunaway.java<|end_file_name|><|fim▁begin|>import br.com.etyllica.EtyllicaFrame; import br.com.etyllica.core.context.Application; import br.com.runaway.menu.MainMenu; <|fim▁hole|>public class TombRunaway extends EtyllicaFrame { private static final long serialVersionUID = 1L; public TombRunaway() ...
<|file_name|>js.jquery.js<|end_file_name|><|fim▁begin|>js.Offset = function(rawptr) { this.rawptr = rawptr; } js.Offset.prototype = new konoha.Object(); js.Offset.prototype._new = function(rawptr) { this.rawptr = rawptr; } js.Offset.prototype.getTop = function() { return this.rawptr.top; } js.Offset.prototy...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>""" Views for PubSite app. """ from django.conf import settings from django.contrib.auth.views import ( PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView, ) from django.shortcuts import render import requests ...
except requests.ConnectionError:
<|file_name|>CFCCellToCellStencil.C<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | foam-extend: Open Source CFD \\ / O peration | Version: 3.2 \\ / A nd | Web: ...
faceI++; } }
<|file_name|>GithubActivity.java<|end_file_name|><|fim▁begin|>package com.meituan.davy.myapplication.github; import android.support.v4.app.Fragment; import com.meituan.davy.myapplication.ContainerActivity;<|fim▁hole|> @Override protected Fragment getFragment() { return new GithubFragment(); } }<|fi...
public class GithubActivity extends ContainerActivity {
<|file_name|>searcher.py<|end_file_name|><|fim▁begin|>from scipy.spatial import distance as dist<|fim▁hole|> self.index = index def search(self, queryFeature): results = {} for (k, feature) in self.index.items(): d = dist.euclidean(queryFeature, feature) results[k] = d results = sorted([(v, k) for (k, v) ...
class Searcher: def __init__(self, index):
<|file_name|>uuid.py<|end_file_name|><|fim▁begin|># Copyright 2013 OpenStack Foundation # # 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 # #...
class Provider(common.BaseProvider): def __init__(self, *args, **kwargs): super(Provider, self).__init__(*args, **kwargs)
<|file_name|>item.rs<|end_file_name|><|fim▁begin|>use std::any::Any; use std::any::TypeId; use std::fmt; use std::str::from_utf8; use super::cell::{OptCell, PtrMapCell}; use header::{Header, MultilineFormatter, Raw}; #[derive(Clone)] pub struct Item { raw: OptCell<Raw>, typed: PtrMapCell<Header + Send + Sync...
let tid = TypeId::of::<H>();
<|file_name|>storage.py<|end_file_name|><|fim▁begin|># # Kickstart module for the storage. # # Copyright (C) 2018 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at...
<|file_name|>fdFlow.cpp<|end_file_name|><|fim▁begin|>//---------------------------------------------------------------------------- // XC program; finite element analysis code // for structural analysis and design. // // Copyright (C) Luis Claudio Pérez Tato // // This program derives from OpenSees <http://opensee...
#include "material/nD/FiniteDeformation/fdFlow/fdFlow.h" #include <utility/matrix/nDarray/stresst.h>
<|file_name|>ExecutionServlet.java<|end_file_name|><|fim▁begin|>/* * cron4j - A pure Java cron-like scheduler * * Copyright (C) 2007-2010 Carlo Pelliccia (www.sauronsoftware.it) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License...
<|file_name|>printer.js<|end_file_name|><|fim▁begin|>/* @flow */ "use strict"; var _inherits = require("babel-runtime/helpers/inherits")["default"]; var _classCallCheck = require("babel-runtime/helpers/class-call-check")["default"]; var _getIterator = require("babel-runtime/core-js/get-iterator")["default"]; var _...
value: comment
<|file_name|>windows8_1StateMachine.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from statemachine import _Statemachine<|fim▁hole|> class Windows8_1StateMachine(_Statemachine): def __init__(self, params): _Statemachine.__init__(self, params) def _list...
<|file_name|>new_graphics3.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python ############################################################################### # NAME: new_graphics3.py # VERSION: 2.0.0b15 (18SEPTEMBER2006) # AUTHOR: John B. Cole, PhD (jcole@aipl.arsusda.gov) # LICENSE: LGPL ##############################...
print 'Starting pypedal.py at %s' % (pyp_nice_time())
<|file_name|>0006_case_rule_refactor.py<|end_file_name|><|fim▁begin|># Generated by Django 1.10.6 on 2017-04-04 12:54 import django.db.models.deletion from django.db import migrations, models import jsonfield.fields class Migration(migrations.Migration): dependencies = [ ('data_interfaces', '0005_remov...
migrations.AddField( model_name='automaticupdaterule', name='migrated',
<|file_name|>cuboid3d.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use na::Vector3; use ncollide3d::shape::Cuboid; fn main() { let cuboid = Cuboid::new(Vector3::new(2.0f32, 1.0, 3.0)); assert!(cuboid.half_extents.x == 2.0); assert!(cuboid.half_extents.y == 1.0); assert!(cuboid.half_extents.z == 3.0); }...
extern crate nalgebra as na;
<|file_name|>cache.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #-*- coding: utf8 -*- # Copyright 2009-2012 Kamil Winczek <kwinczek@gmail.com> # # This file is part of series.py. # # series.py is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as pub...
<|file_name|>node-rusage.cc<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2011 by Jakub Lekstan <kuebzky@gmail.com> * * 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 restrictio...
target->Set(v8::String::New("RUSAGE_CHILDREN"), v8::Number::New(RUSAGE_CHILDREN)); }
<|file_name|>boss_selin_fireheart.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/> * * 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; e...
}
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms from selectable.forms import AutoCompleteSelectField from selectable.forms import AutoCompleteSelectWidget from opendata.catalog.lookups import CityLookup, CountyLookup from .models import Request class SearchForm(forms.Form): text = for...
<|file_name|>County.java<|end_file_name|><|fim▁begin|>package com.kenshin.windystreet.db; import org.litepal.crud.DataSupport; /** * Created by Kenshin on 2017/4/3. */ public class County extends DataSupport { private int id; //编号 private String countyName; //县名 private String weatherId; //对应的天气id ...
this.cityId = cityId; }
<|file_name|>Folder.java<|end_file_name|><|fim▁begin|>/* * This file is part of Track It!. * Copyright (C) 2013 Henrique Malheiro * Copyright (C) 2015 Pedro Gomes * * TrackIt! is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Fre...
import java.util.List;
<|file_name|>PBSQuery.py<|end_file_name|><|fim▁begin|># # Authors: Roy Dragseth (roy.dragseth@cc.uit.no) # Bas van der Vlies (basv@sara.nl) # # SVN INFO: # $Id$ # """ Usage: from PBSQuery import PBSQuery This class gets the info from the pbs_server via the pbs.py module for the several batch objects. All g...
key = '%s.%s' %(a.name, a.resource) else: key = '%s' %(a.name)
<|file_name|>NettyWorkerPoolBuilder.java<|end_file_name|><|fim▁begin|>/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to ...
<|file_name|>diffu.py<|end_file_name|><|fim▁begin|>from collections import deque from sys import stdout import re contextLines = 3 class DiffLines: """A single span of lines from a chunk of diff, used to store either the original or the changed lines""" def __init__(self, start, lines): """Note...
<|file_name|>debugging.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # coding=utf-8 """ This module, debugging.py, will contain code related to debugging (such as printing error messages). """ #import sys #sys.path.insert(0, '/home/dev_usr/urbtek') #from universal_code import system_operations as so class ...
<|file_name|>matrix-tween.js<|end_file_name|><|fim▁begin|>import { Tween } from '../core'; import { mat4 } from '../math'; export class MatrixTween extends Tween { action() { for (let i = 0; i < this.from.length; i++) { this.object[i] = this.from[i] + this.current_step * (this.to[i] - this.from[i]); ...
super.pre_start();
<|file_name|>kifu.py<|end_file_name|><|fim▁begin|>class Kifu: def __init__(self): self.kifu = []<|fim▁hole|> def add(self, from_x, from_y, to_x, to_y, promote, koma): self.kifu.append((from_x, from_y, to_x, to_y, promote, koma)) def pop(self): return self.kifu.pop()<|fim▁end|>
<|file_name|>act_twitter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # TODO prog_base.py - A starting template for Python scripts # # Copyright 2013 Robert B. Hawkins # """ SYNOPSIS TODO prog_base [-h,--help] [-v,--verbose] [--version] DESCRIPTION TODO This describes how t...
if args.verbose: print time.asctime() if args.verbose: print 'TOTAL TIME IN MINUTES:', if args.verbose: print (time.time() - start_time) / 60.0
<|file_name|>KMeans.java<|end_file_name|><|fim▁begin|>package pl.edu.uwm.wmii.visearch.clustering; /* * * Z linii poleceń * /usr/local/mahout/bin/mahout kmeans -i kmeans/data1/in -c kmeans/data1/cl -o kmeans/data1/out -x 10 -k 2 -ow -cl * opcja -ow nadpisuje katalog wyjściowy (nie trzeba ręcznie kasować) * o...
import org.apache.mahout.math.SequentialAccessSparseVector;
<|file_name|>util.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # See: # https://github.com/codeforamerica/pittsburgh-purchasing-suite/blob/master/purchasing_test/unit/util.py import datetime from feedback.user.models import User def create_a_user(email='foo@foo.com'): return User(email=email, first_na...
user.save() return user
<|file_name|>bridge.controller.js<|end_file_name|><|fim▁begin|>/** * Using Rails-like standard naming convention for endpoints. * GET /api/bridges -> index * POST /api/bridges -> create * GET /api/bridges/:id -> show * PUT /api/bridges/:id -> upsert *...
<|file_name|>IInteractivity.d.ts<|end_file_name|><|fim▁begin|>import type { InteractivityDetect } from "../../../Enums";<|fim▁hole|> detect_on: InteractivityDetect | keyof typeof InteractivityDetect; detectsOn: InteractivityDetect | keyof typeof InteractivityDetect; events: IEvents; modes: IModes; }<|fim...
import type { IEvents } from "./Events/IEvents"; import type { IModes } from "./Modes/IModes"; export interface IInteractivity {
<|file_name|>network_test.py<|end_file_name|><|fim▁begin|># Copyright (C) 2008-2010 INRIA - EDF R&D # Author: Damien Garaud # # This file is part of the PuppetMaster project. It checks the module # 'network'. # # This script is free; you can redistribute it and/or modify it under the # terms of the GNU General Public L...
<|file_name|>datasource-arrayschema.js<|end_file_name|><|fim▁begin|>/* YUI 3.13.0 (build 508226d) Copyright 2013 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add('datasource-arrayschema', function (Y, NAME) { /** * Extends DataSource with schema-parsing on ar...
* @submodule datasource-arrayschema */
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>""" Configuration for bookmarks Django app """ <|fim▁hole|>from django.utils.translation import ugettext_lazy as _ from edx_django_utils.plugins import PluginSettings, PluginURLs from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType class B...
from django.apps import AppConfig
<|file_name|>0005_auto__add_field_idea_color.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Ad...
'creator_ip': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
<|file_name|>foo.rs<|end_file_name|><|fim▁begin|>// Copyright 2021 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. <|fim▁hole|>#[test] fn test_ok() { assert_eq!(do_subtract(12, 8), 4) }<|fim▁end|>
pub extern "C" fn do_subtract(a: u32, b: u32) -> u32 { a - b }
<|file_name|>mnist_mlp.py<|end_file_name|><|fim▁begin|>import theano import numpy as np from sklearn.preprocessing import OneHotEncoder from sklearn import cross_validation, metrics, datasets from neupy import algorithms, layers, environment environment.reproducible() theano.config.floatX = 'float32' mnist = dataset...
y_test = np.asarray(y_test.argmax(axis=1)).reshape(len(y_test)) print(metrics.classification_report(y_test, y_predicted)) score = metrics.accuracy_score(y_test, y_predicted)
<|file_name|>student_cnn_xe.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # -*- coding: utf-8 -*- """Student CNN encoder for XE training.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from models.en...
parameter_init=self.parameter_init, activation='relu')
<|file_name|>CONFIG_FIELD.go<|end_file_name|><|fim▁begin|>package FP256BN // Modulus types const NOT_SPECIAL int = 0 const PSEUDO_MERSENNE int = 1<|fim▁hole|>// Modulus details const MODBITS uint = 256 /* Number of bits in Modulus */ const MOD8 uint = 3 /* Modulus mod 8 */ const MODTYPE int = NOT_SPECIAL //NOT_SPECIA...
const MONTGOMERY_FRIENDLY int = 2 const GENERALISED_MERSENNE int = 3
<|file_name|>user.routes.js<|end_file_name|><|fim▁begin|>angular.module('phonebook') .config(['$urlRouterProvider','$stateProvider',function($urlRouterProvider,$stateProvider){ $stateProvider // Greeting State .state('user.main',{ url : '/', templateUrl : 'user/view/welcome.html', controller...
}) }]);
<|file_name|>FileListListAdapter.java<|end_file_name|><|fim▁begin|>/** * ownCloud Android client application * * @author Bartek Przybylski * @author Tobias Kaminsky * @author David A. Velasco * @author masensio * Copyright (C) 2011 Bartek Przybylski * Copyright (C) 2016 ownCloud Inc. * <p> * This p...
<|file_name|>text_packet.py<|end_file_name|><|fim▁begin|>import time from socketio import packet def test(): p = packet.Packet(packet.EVENT, 'hello') start = time.time() count = 0 while True:<|fim▁hole|> break return count if __name__ == '__main__': count = test() print('text_...
p = packet.Packet(encoded_packet=p.encode()) count += 1 if time.time() - start >= 5:
<|file_name|>msg_wrapper.py<|end_file_name|><|fim▁begin|>__author__ = 'oglebrandon' import logging as logger import types from ib.ext.EWrapper import EWrapper def showmessage(message, mapping): try: del(mapping['self']) except (KeyError, ): pass items = mapping.items() items.sort() ...
def tickGeneric(self, tickerId, field, price): pass def tickPrice(self, tickerId, field, price, canAutoExecute):
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from .mixins import FileMixin class BaseCategory(models.Model): title = models.CharField(max_length=100, unique=True) class Meta: abstract = True ordering = ('title',) def __str__(self): return self...
) image_height = models.PositiveIntegerField(editable=False)
<|file_name|>async_test.py<|end_file_name|><|fim▁begin|># import asyncio # # async def compute(x, y): # print("Compute %s + %s ..." % (x, y)) # await asyncio.sleep(1.0) # return x + y # # async def print_sum(x, y): # for i in range(10): # result = await compute(x, y) # print("%s + %s = %...
await asyncio.sleep(1) i += 1
<|file_name|>scripts.ts<|end_file_name|><|fim▁begin|>/** * Stadium mechanics inherit from gen 1 mechanics, but fixes some stuff. */ export const BattleScripts: ModdedBattleScriptsData = { inherit: 'gen1', gen: 1, // BattlePokemon scripts. Stadium shares gen 1 code but it fixes some problems with it. pokemon: { ...
} // Now we can save the partial trapping damage. if (pokemon.volatiles['partialtrappinglock']) {
<|file_name|>unknown-language-item.rs<|end_file_name|><|fim▁begin|>#![allow(unused)] #![feature(lang_items)] #[lang = "foo"] fn bar() -> ! {<|fim▁hole|>//~^^ ERROR definition of an unknown language item: `foo` loop {} } fn main() {}<|fim▁end|>
<|file_name|>image.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { var imageDialog = function( editor, dialogType ) { // Load image preview. var IMAGE = 1, ...
}
<|file_name|>dumpPHOTO.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3 import sys from gi.repository import GExiv2 phototags = { 'Exif.Photo.ExposureTime': "Belichtung:\t", 'Exif.Photo.FNumber': "Blende:\t\tF", # 'Exif.Photo.ExposureProgram', 'Exif.Photo.ISOSpeedRatings': "ISO:\t\t", # 'Exif.Ph...
# 'Exif.Photo.Flash', 'Exif.Photo.FocalLength': "Brennweite:\t" # 'Exif.Photo.MakerNote'
<|file_name|>Augur Installer.py<|end_file_name|><|fim▁begin|>import os import sys import shutil import binascii import traceback import subprocess from win32com.client import Dispatch LAUNCHER_PATH = "C:\\Program Files\\Augur" DATA_PATH = os.path.join(os.path.expanduser('~'), 'AppData', 'Roaming', "Augur") PASSFILE = ...
else: # we are running in a normal Python environment
<|file_name|>swagger.py<|end_file_name|><|fim▁begin|>""" Copyright (C) 2017-2021 Vanessa Sochat. 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/.<|fim▁hole|> """ from django...
<|file_name|>LocalStorage.js<|end_file_name|><|fim▁begin|>exports.setProperty =function(_args){ Ti.App.Properties.setString(_args.name, _args.value) }; exports.getProperty = function(_args){<|fim▁hole|>};<|fim▁end|>
return Ti.App.Properties.getString(_args.name)
<|file_name|>GameshowResults.java<|end_file_name|><|fim▁begin|>/* Copyright 2015 Michelle Mabuyo 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 Unle...
protected void clear() {
<|file_name|>ConfigHandler.hpp<|end_file_name|><|fim▁begin|>#pragma once // Description: // Notification interface for loading and saving configuration. // // Copyright (C) 2001 Frank Becker // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public Lice...
<|file_name|>19_TableStickyToolbarExample.js<|end_file_name|><|fim▁begin|>/* eslint-disable */ () => { const filterOptions = [ { id: 'In Stock, Out Of Stock', value: 'In Stock, Out Of Stock' }, { id: 'In Stock', value: 'In Stock' }, { id: 'Out Of Stock', value: 'Out Of Stock' },<|fim▁hole|> const [searc...
]; const [activeFilter, setActiveFilter] = React.useState(filterOptions[0].id);
<|file_name|>0013_auto__add_field_worker_ping_response_dts.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Worker.pi...
},
<|file_name|>domexception.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 https://mozilla.org/MPL/2.0/. */ use crate::dom::bindings::codegen::Bindings::DOMExcepti...
DOMErrorName::InvalidStateError => "The object is in an invalid state.",
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate libc; use self::libc::c_int; static mut HASKELL:Option<extern fn(c_int)> = None; /* Register the callback */ #[no_mangle] pub fn rs_register(cb: extern fn(c_int)) { unsafe { HASKELL = Some(cb); println!("callback registered"); } } ...
if val != 42 { println!("life, the universe, and everything");
<|file_name|>CopyingFileVisitor.java<|end_file_name|><|fim▁begin|>package cz.vhromada.utils.file.gui; import java.io.IOException; import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribu...
@Override public FileVisitResult preVisitDirectory(final Path dir, final BasicFileAttributes attrs) throws IOException {
<|file_name|>TopologyRunner.java<|end_file_name|><|fim▁begin|>/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you ...
<|file_name|>imp.py<|end_file_name|><|fim▁begin|>"""This module provides the components needed to build your own __import__ function. Undocumented functions are obsolete. In most cases it is preferred you consider using the importlib module's functionality over this module. """ # (Probably) need to stay in _imp from...
except ImportError: return None
<|file_name|>bipdersig-p2p.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Presidentielcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework im...
<|file_name|>identity.py<|end_file_name|><|fim▁begin|>from pyramid.view import view_config @view_config(name='sso', renderer='templates/login.pt') def sign_on(context, request): """ Perform the SAML2 SSO dance. - If the request already has valid credentials, process the 'SAMLRequest' query string value...
"""
<|file_name|>pe030-digit-fifth-powers.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding=utf-8 """30. Digit fifth powers https://projecteuler.net/problem=30 Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits: > 1634 = 14 \+ 64 \+ 34 \+ 44 > 8208 =...
of their digits. """
<|file_name|>RedLock_test.py<|end_file_name|><|fim▁begin|>import pytest from freezegun import freeze_time import demistomock as demisto integration_params = { 'url': 'http://test.com', 'credentials': {'identifier': 'test', 'password': 'pass'}, 'fetch_time': '3 days', 'proxy': 'false', 'unsecure': ...
def test_redlock_get_scan_results(mocker): """ Given - The response from the API call of redlock-get-scan-result command.
<|file_name|>hilo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Created on Mon Oct 10 06:32:29 2016 @author: hugo """ import threading <|fim▁hole|>def worker(count): for x in range(count): print "Programación matemática %s \n " % x return threads = list() t = threadin...
<|file_name|>tracey.go<|end_file_name|><|fim▁begin|>// `Tracey` is a simple library which allows for much easier function enter / exit logging package tracey import ( "fmt" "log" "os" "regexp" "strconv" "strings" "reflect" "runtime" ) // Define a global regex for extracting function names var RE_stripFnPream...
// If nesting is enabled, and the spaces are not specified, // use the "default" value
<|file_name|>UnknownSpellException.java<|end_file_name|><|fim▁begin|>package pl.mmorpg.prototype.client.exceptions; public class UnknownSpellException extends GameException<|fim▁hole|> public UnknownSpellException(String identifier) { super(identifier); } public UnknownSpellException(Class<?> type) { super(ty...
{
<|file_name|>_attributeToBoolean.js<|end_file_name|><|fim▁begin|>/** * * @description Convert attribute value to boolean value * @param attribute * @return {Boolean} * @private */ jDoc.engines.OXML.prototype._attributeToBoolean = function (attribute) { return (!!attribute && (attribute.value == 'true'...
};
<|file_name|>numbers.js<|end_file_name|><|fim▁begin|><|fim▁hole|>// check number && integer && strictly positive module.exports.isNatural = function (d) { return (typeof d === "number") && (d % 1 === 0) && (d > 0); }; module.exports.isPositive = function (d) { return (typeof d === "number") && (d > 0); };<|fim▁...
"use strict";
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redist...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod packet;<|fim▁hole|>mod connection; pub use self::packet::data_flags; pub use self::packet::message_type; pub use self::packet::Packet; pub use self::connection::Connection; pub use self::connection::ConnectionEvent;<|fim▁end|>
<|file_name|>three-effectcomposer.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for three.js (EffectComposer.js) // Project: https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/EffectComposer.js // Definitions by: Satoru Kimura <https://github.com/gyohk> // Definitions: https://github.com/bor...
readBuffer: WebGLRenderTarget; passes: any[];
<|file_name|>GetSliceTags.py<|end_file_name|><|fim▁begin|>from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Filter import Filter from PLC.SliceTags import SliceTag, SliceTags from PLC.Persons import Person, Persons from PLC.Sites import Site, Sites from PLC.Nodes...
# # if not valid_slice_ids: # return []
<|file_name|>test_auth.py<|end_file_name|><|fim▁begin|>from greencouriers.tests import * class TestAuthController(TestController): def test_index(self): response = self.app.get(url(controller='auth', action='index'))<|fim▁hole|><|fim▁end|>
# Test response...