prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>batch.py<|end_file_name|><|fim▁begin|>uname = ParseFunction('uname -a > {OUT}') for group in ('disc', 'ccl', 'gh'): batch_options = 'requirements = MachineGroup == "{0}"'.format(group) uname(outputs='uname.{0}'.format(group), environment={'BATCH_OPTIONS': batch_options}) #for group in ('disc', 'c...
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>""" Django settings for example_site project. Generated by 'django-admin startproject' using Django 1.8.dev20150302062936. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values...
"django.contrib.messages.middleware.MessageMiddleware",
<|file_name|>test_lua1_basics.py<|end_file_name|><|fim▁begin|># coding: utf-8 # Copyright 2015 Jonathan Goble # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including...
def test_dot_plus_backtrack1(): assert luapatt.match("aaa", ".+a") == "aaa" def test_dot_plus_failzero():
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ibtokin.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above imp...
try: import django
<|file_name|>tokenizers.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Copyright 2022 The Google Research 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....
"""Library containing Tokenizer definitions. The RougeScorer class can be instantiated with the tokenizers defined here. New
<|file_name|>task-comm-13.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.o...
<|file_name|>logger.go<|end_file_name|><|fim▁begin|>// This file is part of the GOfax.IP project - https://github.com/MatteoMynet/gofaxip // Copyright (C) 2014 GONICUS GmbH, Germany - http://www.gonicus.de // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU Genera...
LOG_FLAGS = log.Lshortfile )
<|file_name|>search.ts<|end_file_name|><|fim▁begin|>// // Copyright 2015 Ilkka Oksanen <iao@iki.fi> // // 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...
} if (!elasticSearchClient) { elasticSearchClient = require('./elasticSearch').getClient(); // Module is slow to require
<|file_name|>app.js<|end_file_name|><|fim▁begin|>var React = require('react'); var Router = require('react-router'); var whenKeys = require('when/keys'); var EventEmitter = require('events').EventEmitter; var { Route, DefaultRoute, RouteHandler, Link } = Router; var API = 'http://addressbook-api.herokuapp.com'; var lo...
clearTimeout(timer); this.setState({ loading: false }); });
<|file_name|>pool.py<|end_file_name|><|fim▁begin|># |ALPHA| Hub - an authorization server for alpha-ioq3 # See files README and COPYING for copyright and licensing details. """ A throwaway thread pool with thread-local storage. Throwaway Tasks =============== A throwaway task is one you'd *like* to get done, but it'...
doesn't care if they finish and it certainly doesn't care
<|file_name|>issue-174.ts<|end_file_name|><|fim▁begin|>import "reflect-metadata"; import {createTestingConnections, closeTestingConnections, reloadTestingDatabases} from "../../utils/test-utils"; import {Connection} from "../../../src/connection/Connection"; import {expect} from "chai"; import {Organisation} from "./en...
const organisations = await connection .getRepository(Organisation) .createQueryBuilder("organisation")
<|file_name|>_strcmp95.py<|end_file_name|><|fim▁begin|># Copyright 2014-2020 by Christopher C. Little. # This file is part of Abydos. # # Abydos 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...
# Optionally adjust for long strings. # After agreeing beginning chars, at least two more must agree and
<|file_name|>message.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8 import copy from rapidsms.connection import Connection from rapidsms.person import Person from datetime import datetime from rapidsms import utils class StatusCodes: '''Enum for representing st...
# keep on iterating until all of # the messages have been sent
<|file_name|>lists.py<|end_file_name|><|fim▁begin|>""" This file contains code for working on lists and dictionaries. """ def moreThanOne(dict, key): """ Checks if a key in a dictionary has a value more than one. Arguments: dict -- the dictionary key -- the key Returns: True if the key exists in the ...
""" Sorts a list of tuples in reverse alphabetical order by the first key in the tuple.
<|file_name|>JSONBoolean.java<|end_file_name|><|fim▁begin|>/* * Copyright 2006-2016 Edward Smith * * 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/...
<|file_name|>packetLogin.py<|end_file_name|><|fim▁begin|>from struct import pack, unpack from time import time from communication.ComAPI.packet import Packet class PacketLogin(Packet): """Class for constructing binary data based on a common API between client / server.""" def __init__(self): super().__init__() ...
bContainer = bContainer.__add__(pack(">f", position[0])) bContainer = bContainer.__add__(pack(">f", position[1]))
<|file_name|>main_pop_corr_fig.py<|end_file_name|><|fim▁begin|>import numpy as np import pandas as pd # from matplotlib.pyplot import plot,show,draw import scipy.io from functions import * from pylab import * from sklearn.decomposition import PCA import _pickle as cPickle import time import os, sys import ipyparallel i...
main_dir = "/mnt/DataGuillaume/corr_pop/"
<|file_name|>CollapsibleToolbar.js<|end_file_name|><|fim▁begin|>define( ({ "collapse": "Spusti traku s alatima editora", "expand": "Proširi traku s alatima editora"<|fim▁hole|>}) );<|fim▁end|>
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// =================================================================<|fim▁hole|>// // This file is generated! // // Changes made to this file will be overwritten. If changes are // required to the generated code, the service_crategen project // must...
// // * WARNING *
<|file_name|>subpub.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################## # The MIT License (MIT) # Copyright (c) 2018 Kevin Walchko # see LICENSE for full details ############################################## from pygecko.multiprocessing import ...
print("sub:", data) rate.sleep()
<|file_name|>game_leaderboards.py<|end_file_name|><|fim▁begin|>__author__ = 'leif' from game_models import HighScore, UserProfile from ifind.common.utils import encode_string_to_url from django.contrib.auth.models import User from django.db.models import Max, Sum, Avg # ranking based on highest total score (top x pl...
def __str__(self):
<|file_name|>sequence.js<|end_file_name|><|fim▁begin|>var _extend = function(obj, source) { for (var prop in source) { obj[prop] = source[prop]; } return obj; }; var STATUS = { blank: 'blank', booked: 'booked', overflowing: 'overflowing' }; var ACTION = { initialBook: 'initialBook',...
};
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.contrib import messages from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models import F, Q from django.db.models.aggregates import Max f...
<|file_name|>solar_system_acquisition_form.py<|end_file_name|><|fim▁begin|>from django import forms from django.utils.translation import ugettext_lazy as _ from astrobin.models import SolarSystem_Acquisition class SolarSystem_AcquisitionForm(forms.ModelForm): error_css_class = 'error' date = forms.DateField...
'cmiii', 'seeing',
<|file_name|>test_eval_measures.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Created on Tue Nov 08 22:28:48 2011 @author: josef """ from statsmodels.compat.python import zip import numpy as np from numpy.testing import assert_equal, assert_almost_equal, assert_ from statsmodels.tools.eval_measures imp...
<|file_name|>preprocess.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Created on Fri Jun 25 16:20:12 2015 @author: Balázs Hidasi @lastmodified: Loreto Parisi (loretoparisi at gmail dot com) """ import sys import os import numpy as np import pandas as pd import datetime as dt # To redirect output to fil...
valid.to_csv(PATH_TO_PROCESSED_DATA + 'rsc15_train_valid.txt', sep='\t', index=False)
<|file_name|>debug.js<|end_file_name|><|fim▁begin|>/*global define*/ define(["hbs/handlebars"], function (Handlebars) { "use strict"; function debug (optionalValue) { console.log("===================="); console.log("Current Context"); console.log(this); <|fim▁ho...
<|file_name|>operators.cpp<|end_file_name|><|fim▁begin|>/** * @brief * * @file * @ingroup python */ #include <src/common.hpp> #include "genesis/genesis.hpp" using namespace ::genesis::tree; PYTHON_EXPORT_FUNCTIONS( tree_function_operators_export, ::genesis::tree, scope ) { scope.def( "convert", ...
pybind11::arg("rhs")
<|file_name|>service.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- #import modułów konektora msg_stream_connector from ComssServiceDevelopment.connectors.tcp.msg_stream_connector import InputMessageConnector, OutputMessageConnector #import modułów klasy bazowej Service oraz kontrolera u...
frame_obj = video_input.read() #odebranie danych z interfejsu wejściowego
<|file_name|>gl_buffer_funcs.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************** * The MIT License (MIT) * * Copyright (c) 2015-2018 Baldur Karlsson * Copyright (c) 2014 Crytek * * Permission is hereby granted, free of charge, to any person obtaining a ...
m_Buffers[GetResourceManager()->GetID(buffer)].curType = eGL_ARRAY_BUFFER;
<|file_name|>FtpCesarFtpd.py<|end_file_name|><|fim▁begin|>import re from ztag.annotation import Annotation from ztag.annotation import OperatingSystem from ztag import protocols import ztag.test class FtpCesarFtpd(Annotation): protocol = protocols.FTP subprotocol = protocols.FTP.BANNER port = None im...
<|file_name|>test_netcat_reverse_tcp.py<|end_file_name|><|fim▁begin|>from routersploit.modules.payloads.cmd.netcat_reverse_tcp import Payload # netcat reverse tcp payload with lhost=192.168.1.4 lport=4321 reverse_tcp = ( "nc 192.168.1.4 4321 -e /bin/sh" )<|fim▁hole|> payload = Payload() payload.lhost = "1...
def test_payload_generation(): """ Test scenario - payload generation """
<|file_name|>tasks.js<|end_file_name|><|fim▁begin|>// Generated by CoffeeScript 1.8.0 (function() { var TaskSchema, mongoose; mongoose = require('./mongoose'); TaskSchema = mongoose.Schema({ id: { type: Number, unique: true }, title: { type: String }, url: { type: Str...
unique: true },
<|file_name|>serial.js<|end_file_name|><|fim▁begin|>'use strict'; goog.provide('Blockly.JavaScript.serial'); goog.require('Blockly.JavaScript'); Blockly.JavaScript.serial_print = function() { var content = Blockly.JavaScript.valueToCode(this, 'CONTENT', Blockly.JavaScript.ORDER_ATOMIC) || '\"\"' var code = 'seria...
Blockly.JavaScript.serial_readstr_until = function() { var char_marker = this.getFieldValue('char_marker');
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages setup( name='abl.pivotal_client', version='1.1.0', description='A simple client for Pivotal Tracker', author='Ableton Web Team', author_email='webteam@ableton.com', url='http://ableton.com/', zip_...
license='MIT', entry_points={
<|file_name|>activateCurrentLink.js<|end_file_name|><|fim▁begin|>// This code will add an event listener to each anchor of the topbar after being dynamically replaced by "interchange" $("body").on("click", function(event){ // If the active element is one of the topbar's links continues if($(event.target).hasClass(...
}
<|file_name|>post_nodes_identifier_obm_identify_parameters.go<|end_file_name|><|fim▁begin|>package identify // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "time" "github.com/go-openapi/errors" "github.com/go-openapi/run...
<|file_name|>UIExplorerList.js<|end_file_name|><|fim▁begin|>/** * The examples provided by Facebook are for non-commercial testing and * evaluation purposes only. * * Facebook reserves all rights not expressly granted. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCL...
// Register suitable examples for snapshot tests COMPONENTS.concat(APIS).forEach((Example) => { if (Example.displayName) {
<|file_name|>build-target-scripts.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # --- # 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 lic...
<|file_name|>cocoa.py<|end_file_name|><|fim▁begin|># ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the...
<|file_name|>ends-before.tsx<|end_file_name|><|fim▁begin|>import { Path } from 'slate' <|fim▁hole|> another: [1, 2], } export const test = ({ path, another }) => { return Path.endsAt(path, another) } export const output = false<|fim▁end|>
export const input = { path: [0],
<|file_name|>test_marginal_tax_rate.py<|end_file_name|><|fim▁begin|>import logging from openfisca_core.tools import assert_near from openfisca_country_template import CountryTaxBenefitSystem from openfisca_survey_manager.tests.test_scenario import ( create_randomly_initialized_survey_scenario ) log = loggin...
logging.basicConfig(level = logging.DEBUG, stream = sys.stdout)
<|file_name|>webserver.go<|end_file_name|><|fim▁begin|>/* Copyright 2011 The Perkeep 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 ...
mu sync.Mutex
<|file_name|>DgsListing.js<|end_file_name|><|fim▁begin|>/**! * LibreMoney DgsListing api 0.2 * Copyright (c) LibreMoney Team <libremoney@yandex.com> * CC0 license */ /* import nxt.Account; import nxt.Attachment; import nxt.Constants; import nxt.NxtException; import nxt.util.Convert; import org.json.simple.JSONStre...
<|file_name|>CognitoIdentityProviderClientConfig.java<|end_file_name|><|fim▁begin|>package com.xminds.aws.cognito; /** * Maintains SDK configuration. */ public final class CognitoIdentityProviderClientConfig { /** * Maximum threshold for refresh tokens, in milli seconds. */ private static long REFR...
refreshThreshold = threshold; }
<|file_name|>spin_box.hpp<|end_file_name|><|fim▁begin|>// spin_box.hpp /* neoGFX Resource Compiler Copyright(C) 2019 Leigh Johnston This program is free software: you can redistribute it and / or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either ver...
ui_element<>::parse(aName, aData);
<|file_name|>remove.rs<|end_file_name|><|fim▁begin|>use crate::database::models::ToU64; use diesel::prelude::*; use lalafell::commands::prelude::*; use lalafell::error::*; use serenity::model::id::GuildId; pub struct RemoveCommand; #[derive(Debug, StructOpt)] pub struct Params { #[structopt(help = "The ID of the...
}).chain_err(|| "could not delete auto_replies")?;
<|file_name|>ByteArrayJavaClass.java<|end_file_name|><|fim▁begin|>package v2ch10.compiler; <|fim▁hole|>import java.io.OutputStream; import java.net.URI; import javax.tools.SimpleJavaFileObject; /** * A Java class that holds the byte codes in a byte array. Created by ZHEN on 16/9/18. */ public class ByteArrayJavaClas...
import java.io.ByteArrayOutputStream;
<|file_name|>BrokenNQueensBenchmarkTest.java<|end_file_name|><|fim▁begin|>/* * Copyright 2013 Red Hat, Inc. and/or its affiliates. * * 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 * * ...
.setStepCountLimit(-100); // Intentionally crash the solver return benchmarkFactory;
<|file_name|>tree.rs<|end_file_name|><|fim▁begin|>use ai; use ai::value; use ai::StatelessAI; use game; use game::Position2; pub fn recursive_judgement( state: &game::State, my_color: game::Color, depth: u8, value_function: value::Simple, ) -> i32 { if depth == 0 || !state.victory_state.active() ...
let values = state.legal_actions().map(|action| { let mut new_state = state.clone();
<|file_name|>calculator.rs<|end_file_name|><|fim▁begin|>//! # Simple 4-function calculator //! //! This demonstrates usage of Peresil, and also shows how you can //! write a recursive-descent parser that handles left-associative //! operators. //! //! For an extra wrinkle, input numbers must be integers in the range //...
} }
<|file_name|>out.rs<|end_file_name|><|fim▁begin|>#[doc = "Register `OUT` reader"] pub struct R(crate::R<OUT_SPEC>); impl core::ops::Deref for R { type Target = crate::R<OUT_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<OUT_SPEC>> for R { #[inline(...
} #[doc = r"Writes raw bits to the field"]
<|file_name|>MutableAlteredFiles.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2012-2018 Red Hat, Inc. * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 * which is available at https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identif...
if (alteredFilesStatuses.put(file, status) == null) { // it's not a status change, new file was added alteredFilesList.add(file);
<|file_name|>urlfind.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import re import os import os.path import sys def main(): already_found = [] url_matcher = re.compile(r'(https?://(www.)?)?((youtu.be|youtube.(com|de|ch|at))/watch\?v=[-_0-9A-Za-z]{11}|youtu.be/[-_0-9A-Za-z]{11})') backup_matcher...
print("Error: hit infinite loop while attempting to create files. Exiting.", file=sys.stderr) sys.exit(1) num_backup_candidates = 0
<|file_name|>gym_test_2.py<|end_file_name|><|fim▁begin|>#! .env/bin/python # -*- coding: utf8 -*- from __future__ import unicode_literals # import time import random import itertools # from collections import defaultdict import gym import numpy as np # implementation of the sarsa algorithm on the mountain car using...
<|file_name|>chacha.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses...
// Test vectors 1 and 2 from // http://tools.ietf.org/html/draft-nir-cfrg-chacha20-poly1305-04 let seed : &[_] = &[0u32, ..8]; let mut ra: ChaChaRng = SeedableRng::from_seed(seed);
<|file_name|>get_profile.rs<|end_file_name|><|fim▁begin|>//! [GET /_matrix/client/r0/profile/{userId}](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-profile-userid) use ruma_api::ruma_api; use ruma_identifiers::UserId; ruma_api! { metadata { description: "Get all profile informati...
request { /// The user whose profile will be retrieved.
<|file_name|>BackupStore.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 un...
private int createNewMemoryBlock(int requestedSize, int minSize) { int allocatedSize = ramManager.reserve(requestedSize, minSize); usedSize = 0; if (allocatedSize == 0) {
<|file_name|>cors.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/. */ //! A partial implementation of CORS //! For now this library is...
let new_buf: Vec<CORSCacheEntry> =
<|file_name|>bench_test.go<|end_file_name|><|fim▁begin|>package decision import ( "math" "testing" key "github.com/ipfs/go-ipfs/blocks/key" "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" "github.com/ipfs/go-ipfs/util/testutil" "gx/ipfs/QmUBogf4nUefBjmYjn6jfsfPJRkmDGSeMhNj4usRKq69f4/go-libp2p/p2p/peer" )<|f...
// FWIW: At the time of this commit, including a timestamp in task increases // time cost of Push by 3%. func BenchmarkTaskQueuePush(b *testing.B) {
<|file_name|>addMemberToInterface.ts<|end_file_name|><|fim▁begin|>/// <reference path="fourslash.ts" /> <|fim▁hole|>//// //// interface MyInterface { //// /*insert*/ //// } edit.disableFormatting(); goTo.marker('check'); verify.quickInfoIs('namespace Mod'); goTo.marker('insert'); edit.insert("x: numb...
//// //// namespace /*check*/Mod{ //// }
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>declare enum CurveStyle { "ios" = "ios", "ios9" = "ios9" } export declare type Options = { container: HTMLElement; style?: CurveStyle; ratio?: number; speed?: number; amplitude?: number; frequency?: number; color?: string; cove...
ctx: CanvasRenderingContext2D; animationFrameId: number | undefined; timeoutId: ReturnType<typeof setTimeout> | undefined; constructor({ container, ...rest }: Options);
<|file_name|>network_test.py<|end_file_name|><|fim▁begin|># Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apac...
self.l1 = self.add_layer(core.Dense(1, use_bias=False)) def call(self, x):
<|file_name|>test_path_add.py<|end_file_name|><|fim▁begin|>from chiplotle.geometry.core.path import Path from chiplotle.geometry.core.coordinate import Coordinate from chiplotle.core import errors from py.test import raises def test_path_add_01( ): '''A Path and an int cannot be added.''' assert raises(TypeErr...
def test_path_iadd_01( ): '''A float and a Path cannot be added.'''
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
from .base import ApplicationVersion, package_version # noqa
<|file_name|>Euler_002.py<|end_file_name|><|fim▁begin|>#Problem 2 Project Euler<|fim▁hole|> if second % 2 == 0: FiboNumSum += second first, second = second, first + second print FiboNumSum<|fim▁end|>
FiboNumSum = 0 first, second, end = 0, 1, 4000000 while second < end:
<|file_name|>xmlcsv2xy.py<|end_file_name|><|fim▁begin|>from sys import argv from xml.dom import minidom import csv stem = argv[1][:-4] if argv[1].endswith('.xml') else argv[1] xmldoc = minidom.parse('%s.xml'%stem) labellist = xmldoc.getElementsByTagName('label') labels = [l.attributes['name'].value for l in labellist...
y.write("%s\n"%ybuf)
<|file_name|>dead.js<|end_file_name|><|fim▁begin|>module.exports = (function () { 'use strict'; var strings = require('../../strings').dead, style = require('../../style'); return { create: function(){ this.game.world.width = this.game.canvas.width; this.game.world.height = this.game.canvas....
<|file_name|>firmwareupdater.js<|end_file_name|><|fim▁begin|>$(function() { function FirmwareUpdaterViewModel(parameters) { var self = this; self.settingsViewModel = parameters[0]; self.loginState = parameters[1]; self.connection = parameters[2]; self.printerState = paramete...
<|file_name|>merge.py<|end_file_name|><|fim▁begin|>#--------------------------------- #Joseph Boyd - joseph.boyd@epfl.ch #--------------------------------- import os ; import sys ; import pickle def main(): num_partitions = 8 unique_users = {} print "Merging..." for filename in os.listdir("."):<|fim▁h...
if filename[filename.rfind('.')+1:] == 'pickle': f = open(filename, 'rb') users = pickle.load(f)
<|file_name|>WinUtility.cpp<|end_file_name|><|fim▁begin|>#include <Gosu/WinUtility.hpp> #include <Gosu/Utility.hpp> #include <stdexcept> #include <vector> namespace { typedef std::vector<std::tr1::function<bool (MSG&)> > Hooks; Hooks hooks; bool handledByHook(MSG& message) { for (H...
return false; }
<|file_name|>main.js<|end_file_name|><|fim▁begin|>/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. * global ko */<|fim▁hole|>// Name:"David", // LastName:"Desmaisons", // Local...
//var viewmodelraw= //{
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import pytest from click.testing import CliRunner from parkour import cli import md5 def file_checksums_equal(file1, file2): with open(file1) as f: checksum1 = md5.new(f.read()).digest() with open(file2) as f: checksum2 = md5.new(f.read())....
return checksum1==checksum2 def test_trimmed_output():
<|file_name|>est_release_series_internal_db.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from datetime import timedelta import logging from sqlalchemy import desc, func from flexget i...
# Estimate next episode comes out about same length as last ep span, with a little leeway return episodes[0].first_seen + multiply_timedelta(last_diff, 0.9)
<|file_name|>grid-test.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>/* Generated class for the GridTestPage page. See http://ionicframework.com/docs/v2/components/#navigation for more info on Ionic pages and navigation. */ @Component({ templateUrl: 'build/pages/grid-test/grid-test.html', }) export class GridTes...
import { Component } from '@angular/core'; import { NavController } from 'ionic-angular';
<|file_name|>map_reduce.py<|end_file_name|><|fim▁begin|>import time import requests from collectors.lib import utils from collectors.lib.collectorbase import CollectorBase # reference by https://hadoop.apache.org/docs/r2.7.2/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredAppMasterRest.html REST_API = {"YAR...
# "reducesCompleted": 0, # "mapProgress": 48.335266, # "reduceProgress": 0.0, # "mapsPending": 0,
<|file_name|>irc.py<|end_file_name|><|fim▁begin|>import re import sys import socket from src.config import * class IRC: def __init__(self, queue): self.queue = queue def end_connection(self): """Send a goodbye message through irc and close the socket.""" try: self.send_cus...
try: self.sock.send('USER {0}\r\n'.format(config['irc']['username'])) self.sock.send('PASS {0}\r\n'.format(config['irc']['oauth_password'])) self.sock.send('NICK {0}\r\n'.format(config['irc']['username']))
<|file_name|>windows_version.hpp<|end_file_name|><|fim▁begin|>/* * Copyright Andrey Semashev 2007 - 2015. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) */ /*! * \file windows_ve...
#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif
<|file_name|>dash_widgets.py<|end_file_name|><|fim▁begin|>__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>' __copyright__ = 'Copyright (c) 2013 Artur Barseghyan' __license__ = 'GPL 2.0/LGPL 2.1' __all__ = ( 'BaseDummyWidget', 'Dummy1x1Widget', 'Dummy1x2Widget', 'Dummy2x1Widget', 'Dummy2x2Widget', 'Du...
rows = 2
<|file_name|>image-patches-differential-rotation-scale.py<|end_file_name|><|fim▁begin|># Image Patches Differential Optical Flow Rotation/Scale # # This example shows off using your OpenMV Cam to measure # rotation/scale by comparing the current and the previous # image against each other. Note that only rotation/scale...
# # However, this examples goes beyond doing optical flow on the whole # image at once. Instead it breaks up the process by working on groups # of pixels in the image. This gives you a "new" image of results.
<|file_name|>test_no_emulator.py<|end_file_name|><|fim▁begin|>def test_dummy_request(): from rasa.nlu.emulators.no_emulator import NoEmulator em = NoEmulator() norm = em.normalise_request_json({"text": ["arb text"]}) assert norm == {"text": "arb text", "time": None} norm = em.normalise_request_jso...
em = LUISEmulator()
<|file_name|>duolingo_model.py<|end_file_name|><|fim▁begin|>from aqt.utils import askUser, showInfo _field_names = ["Gid", "Gender", "Source", "Target", "Target Language", "Pronunciation"] _model_name = "Duolingo Sync" def create_model(mw): mm = mw.col.models m = mm.new(_(_model_name)) for field_name in...
t = mm.newTemplate("Card 1")
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|>#include <glibmm/main.h> #include "MyArea.h" int main(int argc, char** argv) { auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example"); Gtk::Window win; win.set_title("Cairo example"); MyArea my_area; win.add(my_area); my_area.show(); ...
#include <gtkmm/application.h> #include <gtkmm/window.h>
<|file_name|>dishadr.cc<|end_file_name|><|fim▁begin|>#include <cmath> #include <iostream> #include <fstream> #include <cstdlib> #include "params.h" #include "pdg_name.h" #include "parameters.h" #include "LeptonMass.h" //#include "jednostki.h" #include "grv94_bodek.h" #include "dis_cr_sec.h" #include "fragmentation.h" #...
// PARJ(33)-PARJ(34)(D=0.8GeV, 1.5GeV) are, with quark masses added, used to define the remaining energy below which //the fragmentation of a parton system is stopped and two final hadrons formed. pythia2->SetPARJ (34, 0.5);
<|file_name|>packages.py<|end_file_name|><|fim▁begin|>import unittest import warnings from tests.baseclass import ParserTest from pykickstart.constants import KS_MISSING_IGNORE from pykickstart.errors import KickstartParseError from pykickstart.version import F21, RHEL6 from pykickstart.parser import Group class Grou...
ks = """
<|file_name|>screen_error_message.js<|end_file_name|><|fim▁begin|>// Copyright (c) 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. /** * @fileoverview Offline message screen implementation. */ login.createScreen(...
ERROR_SCREEN_UI_STATE.LOCAL_STATE_ERROR ];
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import re class Solution: def isPalindrome(self, s: str) -> bool: ret = re.findall(r'[\da-zA-Z]+', s) final = ''.join(ret).lower()<|fim▁hole|><|fim▁end|>
return final == final[::-1]
<|file_name|>try_init.rs<|end_file_name|><|fim▁begin|>use { serde_json, string }; use dispatch::{ add_node, connect_nodes, get }; use error::*;<|fim▁hole|>use libflo_std::LIBFLO; pub unsafe fn try_init() -> Result<()> { if ACTION_MAPPER.is_set()? && LIBFLO.is_set()? { let action_mapper = ACTION_MAPPER.read...
use action::{ AddNode, ConnectNodes }; use libflo_action_std::{ ACTION_MAPPER, BasicAction, dispatch_fn, DispatchMap, DISPATCH_MAP, parse_fn, ParseMap, PARSE_MAP };
<|file_name|>photo.rs<|end_file_name|><|fim▁begin|>//! WARNING: This file is generated, derived from table bazaar.photo, DO NOT EDIT use chrono::datetime::DateTime; use chrono::offset::utc::UTC; use gen::column; use gen::schema; use gen::table; use rustc_serialize::json::Json; use rustc_serialize::json::ToJson; use ru...
<|file_name|>range_return.hpp<|end_file_name|><|fim▁begin|>// Copyright Neil Groves 2009. Use, modification and // distribution is subject to the Boost Software License, Version // 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // // For more information, see http...
<|file_name|>OcorrenciaBD.java<|end_file_name|><|fim▁begin|>package com.eng.univates.bd; import java.util.List;<|fim▁hole|>import javax.ejb.Remote; import com.eng.univates.pojo.Filter; import com.eng.univates.pojo.Ocorrencia; import com.eng.univates.pojo.Usuario; import com.vividsolutions.jts.geom.Point; @Remote pub...
<|file_name|>javascript.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # encoding: utf-8 """Copyright (C) 2013 COLDWELL AG This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of t...
def loads(data):
<|file_name|>swak.H<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------*\ ## #### ###### | ## ## ## | Copyright: ICE Stroemungsfoschungs GmbH ## ## #### | ## ## ## | http://www.ice-sf.at ## #### ###### | -----...
<|file_name|>overloaded-index.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.or...
fn index(&self, z: isize) -> &isize { if z == 0 { &self.x
<|file_name|>MetaPrimitiveTypeTest.java<|end_file_name|><|fim▁begin|>package io.katharsis.jpa.meta; import java.io.Serializable; import java.util.UUID; import org.junit.Assert; import org.junit.Test; import io.katharsis.meta.model.MetaPrimitiveType; public class MetaPrimitiveTypeTest { @Test public void testStri...
@Test public void testDouble() {
<|file_name|>SimpleObjectsFixturesService.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 th...
}
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># This file is part of OpenHatch. # Copyright (C) 2010 Parker Phinney # Copyright (C) 2010 Jack Grigg # Copyright (C) 2011 Krzysztof Tarnowski (krzysztof.tarnowski@ymail.com) # Copyright (C) 2009, 2010, 2011 OpenHatch, Inc. # Copyright (C) 2011 Jairo E. Lopez # # This ...
stdout=subprocess.PIPE, cwd=dir_with_git)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># This file is part of ConfigFile - Parse and edit configuration files. # Copyright (C) 2011-present Dario Giovannetti <dev@dariogiovannetti.net> # Licensed under MIT # https://github.com/kynikos/lib.py.configfile/blob/master/LICENSE """ This library provides the ...
return True
<|file_name|>SeekableDemo.java<|end_file_name|><|fim▁begin|>/* * Copyright 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apac...
<|file_name|>hefesto_temp_fix.py<|end_file_name|><|fim▁begin|>import os def replace_temp(inputfile_folder): os.chdir(inputfile_folder) home_dir = os.getcwd() for i in os.listdir(os.getcwd()): if os.path.isdir(i): os.chdir(i) print("In folder: {}".format(os.getcwd())) ...
with open(z, 'r') as infile: with open("temp.txt", 'w') as outfile: print("\nChanging string in file: {}".format(z)) infile_text = infile.read()