prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>JMSTransactionalClientWithRollbackTest.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 licens...
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|>from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("form_designer", "__first__"), ("fluent_contents", "0001_initial")] operations = [ migrations.CreateModel( name="FormDesignerLink", ...
to="fluent_contents.ContentItem", ), ), (
<|file_name|>run_stats_types.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2011-2017 Redis Labs Ltd. * * This file is part of memtier_benchmark. * * memtier_benchmark 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 So...
one_second_stats::one_second_stats(unsigned int second) : m_set_cmd(),
<|file_name|>nacl_utils_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # 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. """Unit tests for nacl_utils.py.""" import fileinput import mox impor...
self.assertRaises(ValueError, nacl_utils.ToolchainPath,
<|file_name|>rc2fd.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************** * Copyright (C) 2007 by Anton Maksimenko * * antonmx@post.kek.jp * * ...
* it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. *
<|file_name|>ManagedLedgerFactoryConfig.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 fi...
<|file_name|>suite_test.go<|end_file_name|><|fim▁begin|>package context_test import (<|fim▁hole|> "testing" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) func TestAppConfigHelpers(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "types/context Suite") }<|fim▁end|>
<|file_name|>celeryconfig.py<|end_file_name|><|fim▁begin|>""" Global Settings """ settings = {} # try: # conf = __import__("django.conf") # settings = conf.conf.settings<|fim▁hole|> # Broker - amqp, BROKER_URL = getattr(settings, "BROKER_URL", "amqp://guest@127.0.0.1//") # file storage path (default: memory...
# except ImportError: # settings = {}
<|file_name|>default_permissions.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | ...
declare_visual_permissions('dashboards', _("dashboards"))
<|file_name|>list.js<|end_file_name|><|fim▁begin|>;(function(Form) { /** * List editor * * An array editor. Creates a list of other editor items. * * Special options: * @param {String} [options.schema.itemType] The editor type for each item in the list. Default: 'Text' * @param {String...
<|file_name|>websocket.py<|end_file_name|><|fim▁begin|># versione 0.5 import socket import threading import hashlib import base64 import json class BadWSRequest(Exception): pass class BadWSFrame(Exception): pass class BadCmdCall(Exception): pass class BadCmdParam(Exception): pass class Client(th...
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ 下载后的漫画整理模块 ==================== 请参考注释部分的整理步骤。 """ from __future__ import print_function, unicode_literals import os, re import shutil import random, string from hcomic.lib.filetool.files import WinDir, FileCollecti...
""" if winfile.ext == ".cbz":
<|file_name|>generate_make.py<|end_file_name|><|fim▁begin|>""" ``editquality generate_make -h`` :: Code-generate Makefile from template and configuration :Usage: generate_make -h | --help generate_make [--config=<path>] [--main=<filename>] ...
<|file_name|>app.po.ts<|end_file_name|><|fim▁begin|>import { browser, element, by } from 'protractor';<|fim▁hole|>export class WebPage { navigateTo() { return browser.get('/'); } getParagraphText() { return element(by.css('ava-app h1')).getText(); } }<|fim▁end|>
<|file_name|>group_details_view.js<|end_file_name|><|fim▁begin|>var _ = require('underscore-cdb-v3'); var cdb = require('cartodb.js-v3'); var pluralizeString = require('../../../view_helpers/pluralize_string') module.exports = cdb.core.View.extend({ initialize: function() { _.each(['permission', 'isUsingVis'], ...
var usersCount = this.model.users.length;
<|file_name|>TestDagTypeConverters.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 *...
import org.junit.Test; public class TestDagTypeConverters {
<|file_name|>campus_serializer.py<|end_file_name|><|fim▁begin|>from rest_framework import serializers from feti.models.campus import Campus from feti.serializers.course_serializer import CourseSerializer __author__ = 'irwan' class CampusSerializer(serializers.ModelSerializer): class Meta: model = Campus ...
<|file_name|>pattern.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding=utf-8 # lachesis automates the segmentation of a transcript into closed captions # # Copyright (C) 2016-2017, Alberto Pettarin (www.albertopettarin.it) # # This program is free software: you can redistribute it and/or modify # it under...
<|file_name|>implicitgrant.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*- from .grant import Grant from ..endpoint import AuthorizationEndpoint class ImplicitGrant(Grant):<|fim▁hole|> support the issuance of refresh tokens) and is optimized for public clients known to operate a particular redirection ...
""" The implicit grant type is used to obtain access tokens (it does not
<|file_name|>crossrefs.cpp<|end_file_name|><|fim▁begin|>/* ** Copyright (©) 2018- Matt Postiff. ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 3 of the License, or ...
<|file_name|>QtScript.py<|end_file_name|><|fim▁begin|><|fim▁hole|># proxy module from pyface.qt.QtScript import *<|fim▁end|>
<|file_name|>effects.pulsate.js<|end_file_name|><|fim▁begin|>/* * jQuery UI Effects Pulsate 1.7.2 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Effects/Pulsate * * Depends: * ef...
(function($) { $.effects.pulsate = function(o) {
<|file_name|>filelock.rs<|end_file_name|><|fim▁begin|>//! Lock files for editing. use remacs_macros::lisp_fn; use crate::{ lisp::LispObject, remacs_sys::Qstringp, remacs_sys::{lock_file, unlock_file}, threads::ThreadState, }; /// Lock FILE, if current buffer is modified. /// FILE defaults to current ...
} include!(concat!(env!("OUT_DIR"), "/filelock_exports.rs"));
<|file_name|>align.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> #[cfg_attr(any(target_pointer_width = "32", target_arch = "x86_64", target_arch = "powerpc64", target_arch = "mips64", target_arch = "s39...
macro_rules! expand_align { () => { s! {
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|>"""Wechatkit exception module.""" class WechatKitBaseException(Exception): """Wechatkit base Exception.""" def __init__(self, error_info): """Init.""" super(WechatKitBaseException, self).__init__(error_info) self.error_info = err...
<|file_name|>SDKConstants.java<|end_file_name|><|fim▁begin|>/** * * Licensed Property to China UnionPay Co., Ltd. * * (C) Copyright of China UnionPay Co., Ltd. 2010 * All Rights Reserved. * * * Modification History: * ============================================================================= * Auth...
/** 收货地址-地区. */ public static final String param_shippingDistrictCode = "shippingDistrictCode"; /** 收货地址-详细. */ public static final String param_shippingStreet = "shippingStreet";
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2015, The Rust-GNOME Project Developers. // See the COPYRIGHT file at the top-level directory of this distribution. // Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT> extern crate gcc; extern crate pkg_con...
<|file_name|>token.rs<|end_file_name|><|fim▁begin|>/// Associates readiness events with [`event::Source`]s. /// /// `Token` is a wrapper around `usize` and is used as an argument to /// [`Registry::register`] and [`Registry::reregister`]. /// /// See [`Poll`] for more documentation on polling. /// /// [`event::Source`]...
/// use mio::{Events, Interest, Poll, Token}; /// use mio::net::TcpListener; /// /// use std::thread;
<|file_name|>loader.py<|end_file_name|><|fim▁begin|>"""Template loader for app-namespace""" import errno import io import os from collections import OrderedDict import django from django.apps import apps try: from django.template import Origin except ImportError: # pragma: no cover class Origin(object): ...
def get_contents(self, origin): """
<|file_name|>index.js<|end_file_name|><|fim▁begin|>export * from './PostProcessor.js'; export * from './EffectComposer.js'; export * from './pass/index.js';<|fim▁hole|>export * from './shader/index.js';<|fim▁end|>
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import {NgbdAlertBasic} from './basic/alert-basic'; import {NgbdAlertCloseable} from './closeable/alert-closeable'; import {NgbdAlertCustom} from './custom/alert-custom'; import {NgbdAlertSelfclosing} from './selfclosing/alert-selfclosing'; import {NgbdAlertConfig} fro...
code: require('!!prismjs-loader?lang=typescript!./custom/alert-custom'), markup: require('!!prismjs-loader?lang=markup!./custom/alert-custom.html')
<|file_name|>mdc.checkbox.js<|end_file_name|><|fim▁begin|>/*! Material Components for the web Copyright (c) 2017 Google Inc. License: Apache-2.0 */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof ...
} /** @return {!MDCRipple} */
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # ...
import report import wizard
<|file_name|>MainActivity.java<|end_file_name|><|fim▁begin|>package br.com.k19.android.cap3; import android.app.Activity; import android.os.Bundle; public class MainActivity extends Activity {<|fim▁hole|> super.onCreate(savedInstanceState); setContentView(R.layout.frame); } }<|fim▁end|>
@Override public void onCreate(Bundle savedInstanceState) {
<|file_name|>http.py<|end_file_name|><|fim▁begin|>import rinocloud import requests from requests_toolbelt import MultipartEncoder, MultipartEncoderMonitor from clint.textui.progress import Bar as ProgressBar from clint.textui import progress import json def upload(filepath=None, meta=None): encoder = MultipartEnc...
'query': query, 'truncate_metadata': truncate_metadata, 'limit': limit, 'offset': offset
<|file_name|>t_Normal_wrongarg.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python <|fim▁hole|> TESTPREAMBLE() try : try : # Instanciate one distribution object meanPoint = NumericalPoint(1) meanPoint[0] = 1.0 sigma = NumericalPoint(1) sigma[0] = 1.0 R = Correla...
from openturns import *
<|file_name|>MissingListSeparators.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
a = [1 2 3]
<|file_name|>test_enum.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*- import unittest, sys, os sys.path[:0] = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) from saklient.cloud.enums.eserverinstancestatus import EServerInstanceStatus class TestEnum(unittest.TestCase): def test_should_be_...
<|file_name|>utmpx.rs<|end_file_name|><|fim▁begin|>#![allow(non_camel_case_types)] #![allow(dead_code)] extern crate libc; pub use self::utmpx::{DEFAULT_FILE,USER_PROCESS,BOOT_TIME,c_utmp}; #[cfg(target_os = "linux")] mod utmpx { use super::libc; pub static DEFAULT_FILE: &'static str = "/var/run/utmp"; ...
#[cfg(target_os = "macos")]
<|file_name|>_Module.py<|end_file_name|><|fim▁begin|>import threading import time import logging class _Module(threading.Thread): def __init__(self, parent, name): threading.Thread.__init__(self)<|fim▁hole|> self.running = True self._className = self.__class__.__name__ self.name = name def run(se...
self.logger = logging.getLogger() self.parent = parent self.daemon = False self.event = threading.Event()
<|file_name|>assumptions.py<|end_file_name|><|fim▁begin|>from facts import FactRules from sympy.core.compatibility import cmp class CycleDetected(Exception): """(internal) used to detect cycles when evaluating assumptions through prerequisites """ pass class AssumeMeths(object): """ Define de...
<|file_name|>position.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/. */ <%! from data import to_rust_ident %> <%namespace name=...
<|file_name|>test_recorder.py<|end_file_name|><|fim▁begin|>"""The tests for the Recorder component.""" # pylint: disable=too-many-public-methods,protected-access import unittest import json from datetime import datetime, timedelta from unittest.mock import patch from homeassistant.const import MATCH_ALL from homeassis...
"""Add a few events for testing.""" now = datetime.now() five_days_ago = now - timedelta(days=5)
<|file_name|>entity.go<|end_file_name|><|fim▁begin|>package mysql import ( "database/sql" "time" "crypto/md5" "encoding/hex" "github.com/cloudbirds/comments/closure-comments/store" ) type entityStore struct { db *sql.DB } func byte2string(in [16]byte) []byte { return in[:16] } // New create a new entity f...
entity, err := s.scanEntity(rows)
<|file_name|>SystemsBeanLoader.java<|end_file_name|><|fim▁begin|>package de.nl.moo.data.loader.systems; import de.nl.moo.data.beans.systems.SystemsApplyerBean; import de.nl.moo.data.beans.systems.SystemsBean; import de.nl.moo.data.beans.systems.SystemsSystemBean; import de.nl.moo.data.dao.GameBeanDAO; import de.nl.moo...
SystemsSystemBean systemBean = beanLoader.load(path);
<|file_name|>collect.js<|end_file_name|><|fim▁begin|>module.exports = collect function collect (stream) { if (stream._collected) return stream._collected = true stream.pause() stream.on("data", save) stream.on("end", save) var buf = [] function save (b) { if (typeof b === "string") b = new Buffer(b...
stream.on("proxy", proxyPause) function proxyPause (p) { p.pause()
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import datetime import six try: from django.contrib.sites.requests import RequestSite except ImportError: # Django < 1.9 from django.contrib.sites.models import RequestSite from django.core.exceptions import ObjectDoesNotExist from django.core.serializers.js...
return model_to_dict(e)
<|file_name|>BigUnsignedInABase.hh<|end_file_name|><|fim▁begin|>#ifndef BIGUNSIGNEDINABASE_H #define BIGUNSIGNEDINABASE_H #include "NumberlikeArray.hh" #include "BigUnsigned.hh" #include <string> /* * A BigUnsignedInABase object represents a nonnegative integer of size limited * only by available memory, represente...
* (2) Both use the management features of NumberlikeArray. (In fact, my desire * to add a BigUnsignedInABase class without duplicating a lot of code led me to * introduce NumberlikeArray.) *
<|file_name|>MixinNetHandlerLoginServer.java<|end_file_name|><|fim▁begin|>/* * This file is part of Sponge, licensed under the MIT License (MIT). * * Copyright (c) SpongePowered <https://www.spongepowered.org> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a...
// Move this check up here, so that the UUID isn't null when we fire the event if (!this.loginGameProfile.isComplete()) { this.loginGameProfile = this.getOfflineProfile(this.loginGameProfile); }
<|file_name|>show_neighbors.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.7 # -*- coding: utf-8 -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the L...
<|file_name|>legacy_aggregate_test.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-...
my_dict = slices[(('language', 'chinese'))]
<|file_name|>test.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/L...
<|file_name|>test_mail.py<|end_file_name|><|fim▁begin|># Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for large portions of L{twisted.mail}. """ import os import errno import shutil import pickle import StringIO import email.message import email.parser import tempfile import signal ...
def test_listOneMessage(self): """
<|file_name|>insert_movies.py<|end_file_name|><|fim▁begin|>import json import os from processes.postgres import Postgres from processes.gather_exception import GatherException try:<|fim▁hole|> DB_USER = os.environ['DB_USER'] DB_PASSWORD = os.environ['DB_PASSWORD'] except KeyError: try: from proce...
DB_SERVER = os.environ['DB_SERVER'] DB_PORT = os.environ['DB_PORT'] DB_DATABASE = os.environ['DB_DATABASE']
<|file_name|>iLQR.hh<|end_file_name|><|fim▁begin|>// // Implements iLQR (on a traditional chain) for nonlinear dynamics and cost. // // Arun Venkatraman (arunvenk@cs.cmu.edu) // December 2016 // #pragma once #include <ilqr/ilqr_taylor_expansions.hh> #include <Eigen/Dense> #include <tuple> #include <vector> namesp...
std::vector<Eigen::VectorXd> ks_;
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use wasm_core::value::Value; #[allow(dead_code)] #[repr(i32)] #[derive(Debug, Copy, Clone)] pub enum ErrorCode { Success = 0, Generic = 1, Eof = 2, Shutdown = 3, PermissionDenied = 4, OngoingIo = 5, InvalidInput = 6, BindFail = 7, ...
<|file_name|>test_network_basic_ops.py<|end_file_name|><|fim▁begin|># Copyright 2012 OpenStack Foundation # Copyright 2013 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the ...
@classmethod
<|file_name|>document.rs<|end_file_name|><|fim▁begin|>use std::io::Write; use html5ever::{ParseOpts, parse_document};<|fim▁hole|>use html5ever::tendril::TendrilSink; use serializer::{SerializeDocument, DocumentSerializer}; use super::{Dom, Handle}; #[derive(Clone, Debug, PartialEq)] pub struct Document { node: H...
use html5ever::tree_builder::TreeSink;
<|file_name|>script.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals from pre_commit.languages import helpers from pre_commit.xargs import xargs ENVIRONMENT_DIR = None get_default_version = helpers.basic_get_default_version healthy = helpers.basic_healthy install_environment = helpers.no_insta...
def run_hook(repo_cmd_runner, hook, file_args): cmd = helpers.to_cmd(hook) cmd = (repo_cmd_runner.prefix_dir + cmd[0],) + cmd[1:] return xargs(cmd, file_args)
<|file_name|>configuration.ts<|end_file_name|><|fim▁begin|>/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *----...
export interface AutoRestConfiguration { }
<|file_name|>client.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals import json import mimetypes import os import re import sys from copy import copy from importlib import import_module from io import BytesIO from django.conf import settings from django.core.handlers.base import BaseHandler fr...
] class RequestFactory(object):
<|file_name|>sets.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- __author__ = 'Sergey Sobko' class HashSet(object): _set_dict = None def __init__(self): self._set_dict = dict() def add(self, key, value): self._set_dict[hash(key)] = value def get(self, key): return ...
self.next_letters = list()
<|file_name|>DorkboxCode.cpp<|end_file_name|><|fim▁begin|>// pinout #define SCLK_PIN 13 #define SIN_PIN 14 #define PCLK_PIN 15 // only to selected board, others are high uint8_t update_required=0; uint16_t switches[48]; void setup() { pinMode(SCLK_PIN, OUTPUT); pinMode(SIN_PIN, OUTPUT); digitalWrite(PCLK_PIN, HIG...
else if (pin < 32) chip = 16; else if (pin < 48) chip = 0; else return; if (signal >= 16) return;
<|file_name|>ResetCursorJob.java<|end_file_name|><|fim▁begin|>package com.tommytony.war.job; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import com.tommytony.war.War; import com.tommytony.war.volume.BlockInfo; public class ResetCursorJob implements Runnable { private final Block cornerBlock; ...
this.cornerBlock.getRelative(War.legacyBlockFace ? BlockFace.SOUTH : BlockFace.EAST).setData(this.originalCursorBlocks[2].getData()); }
<|file_name|>zhtta2.rs<|end_file_name|><|fim▁begin|>//Andy Alexander, Mark Capobianco // zhtta.rs // // Starting code for PA3 // Revised to run on Rust 1.0.0 nightly - built 02-21 // // Note that this code has serious security risks! You should not run it // on any system with access to sensitive files. // // Brande...
let openq_vec = openq_split.collect::<Vec<&str>>(); //println!("{}", openq_vec[1]); //cmd for gash is in openq_vec[1] let command = openq_vec[1];
<|file_name|>L0OneIpaPass.ts<|end_file_name|><|fim▁begin|>import ma = require('vsts-task-lib/mock-answer'); import tmrm = require('vsts-task-lib/mock-run'); import path = require('path'); import fs = require('fs'); var Readable = require('stream').Readable var Stats = require('fs').Stats var nock = require('nock'); l...
.reply(200, {
<|file_name|>MineComponent.java<|end_file_name|><|fim▁begin|>package com.almasb.fxglgames.geowars.component; import com.almasb.fxgl.dsl.FXGL; import com.almasb.fxgl.dsl.components.HealthIntComponent; import com.almasb.fxgl.entity.component.Component; import com.almasb.fxgl.texture.Texture; import com.almasb.fxgl.time....
return false;
<|file_name|>configs-tab_spaces-4.rs<|end_file_name|><|fim▁begin|>// rustfmt-tab_spaces: 4 // rustfmt-max_width: 30 // rustfmt-array_layout: Block // Tab spaces <|fim▁hole|>fn lorem() { let ipsum = dolor(); let sit = vec![ "amet", "consectetur", "adipiscing", "elit." ]; }<|fim▁end|>
<|file_name|>InstrumentsTraceParser.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.7 from __future__ import print_function import struct import sys import numpy class Analyzer: """ The binary format is time since the beginning of the measurement : double unknown and irrelevant field :...
with open(file_path, "r") as f: binary = bytearray(f.read()) for i in range(0, len(binary) - 24, 24):
<|file_name|>compare_cube.py<|end_file_name|><|fim▁begin|>from spectral_cube import SpectralCube import glob from astropy.convolution import Box1DKernel import astropy.units as u from corner import corner import numpy as np import matplotlib.pyplot as plt import scipy.stats as ss empdir = '/mnt/space/erosolow/surveys/...
# import pdb; pdb.set_trace() # degas
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*- # This file based on MIT licensed code at: https://github.com/imwilsonxu/fbone from functools import wraps from flask import abort from flask.ext.login import current_user <|fim▁hole|> def decorated_function(*args, **kwargs): ...
def admin_required(f): @wraps(f)
<|file_name|>git_diff.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package models import ( "bufio" "bytes" "fmt" "html" "html/template" "io" "io/ioutil" "os" "os...
} } else if lineType == DIFF_LINE_ADD {
<|file_name|>extract_elp_prons.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ Extract pronunciations from the ELP items. Outputs a CSV with the orthographic and phonological form on each line. The phonological form is stripped of syllabification and stress markers. """ # Copyright 2013 Constantine Lignos ...
elp = ELP(input_path)
<|file_name|>ValidateInstrumentDefinitionFiles.py<|end_file_name|><|fim▁begin|># Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - ...
xsdTreeWrapperList.append(xsdTreeWrapper) self._validateXmlInput (xmlInputFile, inputTreeWrapper, xsdTreeWrapperList)
<|file_name|>WxEntrustPapServiceTest.java<|end_file_name|><|fim▁begin|>package com.github.binarywang.wxpay.service.impl; import com.github.binarywang.wxpay.bean.request.*; import com.github.binarywang.wxpay.bean.result.*; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.s...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use std::io; use calloop::{EventSource, Interest, Mode, Poll, PostAction, Readiness, Token, TokenFactory}; use dbus::{ blocking::LocalConnection, channel::{BusType, Channel, Watch}, Message, }; #[cfg(feature = "backend_session_logind")] pub mod logind; //...
poll.unregister(self.current_watch.fd)?;
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import asyncio from abc import ABCMeta from collections.abc import MutableMapping from aiohttp import web from aiohttp.web_request import Request from aiohttp_session import get_session from collections.abc import Sequence AIOLOGIN_KEY = '__aiologin__' ON_LOGIN =...
<|file_name|>ProjectView.js<|end_file_name|><|fim▁begin|>/*** AppView ***/ define(function(require, exports, module) { var View = require('famous/core/View'); var Surface = require('famous/core/Surface'); var Transform = require('famous/core/Transform'); var StateModifier = require('famous/modifiers/St...
module.exports = ProjectView; });
<|file_name|>Excel2PdfConversion.py<|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. #if __name__ == "__main__": # print "Hello World"<|fim▁hole|> asposeapispath...
from WorkingWithFiles import Excel2PdfConversion import jpype import os.path
<|file_name|>ProductoUtil.js<|end_file_name|><|fim▁begin|>function ProductoUtil() { var URL_BASE = "/productos"; this.agregar = function(p, callback) { $.ajax(URL_BASE, { type: "post", data: JSON.stringify(p), contentType: "application/json" }).done(callback) .fail(function() { window.alert("Error...
this.eliminar = function(id, callback) {
<|file_name|>abiquo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- ''' External inventory script for Abiquo ==================================== Shamelessly copied from an existing inventory script. This script generates an inventory that Ansible can understand by making API requests t...
# MAKE ABIQUO API CALLS #
<|file_name|>player.rs<|end_file_name|><|fim▁begin|>use eventual::{self, Async}; use portaudio; use std::sync::{mpsc, Mutex, Arc, Condvar, MutexGuard}; use std::thread; use vorbis; use metadata::{Track, TrackRef}; use session::Session; use audio_decrypt::AudioDecrypt; use util::{self, SpotifyId, Subfile}; use spirc::{...
}
<|file_name|>header.rs<|end_file_name|><|fim▁begin|>/* Copyright (C) 2017 Chris Jones This program is free software: you can redistribute it and/or modify<|fim▁hole|> the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in...
it under the terms of the GNU General Public License as published by
<|file_name|>ProjectFeatureService.java<|end_file_name|><|fim▁begin|>package org.osforce.connect.service.system; import org.osforce.connect.entity.system.ProjectFeature; /** * * @author gavin * @since 1.0.0 * @create Feb 12, 2011 - 9:23:35 PM * <a href="http://www.opensourceforce.org">开源力量</a> */ public inter...
}
<|file_name|>authorization_test.py<|end_file_name|><|fim▁begin|>from pulsar.tools.authorization import get_authorizer from .test_utils import get_test_toolbox, TestCase def test_allow_any_authorization(): authorizer = get_authorizer(None) authorization = authorizer.get_authorization('tool1') authorization...
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals from django.forms import ValidationError from django.core.exceptions import NON_FIELD_ERRORS from django.forms.formsets import TOTAL_FORM_COUNT from django.forms.models import ( BaseModelFormSet, modelformset_factory, Mo...
widgets = None kwargs = { 'extra': cls.extra_form_count,
<|file_name|>pyglet_view.py<|end_file_name|><|fim▁begin|>from pyglet.window import key, mouse from pyglet.libs.darwin.quartzkey import keymap, charmap from pyglet.libs.darwin.cocoapy import * NSTrackingArea = ObjCClass('NSTrackingArea') # Event data helper functions. def getMouseDelta(nsevent): dx = nsevent.del...
self._window.context.update_geometry()
<|file_name|>MedianUI.py<|end_file_name|><|fim▁begin|>########################################################################## # # Copyright (c) 2017, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the...
<|file_name|>config.py<|end_file_name|><|fim▁begin|># .oooooooo .oooo. oooooooo .ooooo. .ooooo. # 888' `88b `P )88b d'""7d8P d88' `88b d88' `88b # 888 888 .oP"888 .d8P' 888ooo888 888ooo888 # `88bod8P' d8( 888 .d8P' .P 888 .o 888 .o # `8oooooo. `Y888""8o d8888888P `Y8bod8P' `Y8bod8P'...
<|file_name|>auth-guard.service.ts<|end_file_name|><|fim▁begin|>import { CanActivate, Router } from '@angular/router'; import { Observable } from 'rxjs/Rx'; import { AngularFireAuth } from 'angularfire2/auth'; <|fim▁hole|>// Do not import from 'firebase' as you'd lose the tree shaking benefits import * as firebase from...
<|file_name|>bitcoin_es_419.ts<|end_file_name|><|fim▁begin|><TS language="es_419" version="2.1"> <context> <name>AddressBookPage</name> <message> <source>Right-click to edit address or label</source> <translation>Haga clic para editar la dirección o etiqueta</translation> </message> <mes...
<|file_name|>node-to-box-spec.js<|end_file_name|><|fim▁begin|>/*global describe, it, expect, require*/<|fim▁hole|> 'use strict'; it('should convert node to a box', function () { expect(nodeToBox({x: 10, styles: ['blue'], y: 20, width: 30, height: 40, level: 2})).toEqual({left: 10, styles: ['blue'], top: 20, width: 3...
const nodeToBox = require('../../../src/core/layout/node-to-box'); describe('nodeToBox', function () {
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import errno import os import shutil<|fim▁hole|> try: os.mkdir(path, mode) except OSError as e: if not exist_ok or e.errno != errno.EEXIST or not os.path.isdir(path): raise def makedirs(path, mode=0o777, exist_ok=False): try:...
def mkdir(path, mode=0o777, exist_ok=False):
<|file_name|>test_proxying.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from foo_receiver import FooReceiver from foo_listener_bf import FooListenerBfHelper from PyCFFIlib_cffi import ffi, lib import gc class FooListenerBfIm...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/** * Created by gjrwcs on 10/25/2016. */ 'use strict'; /** * Game Behavior and Logic for Warp * @module pulsar.warp */ var warp = require('angular').module('pulsar.warp', []); const ADT = require('../app.dependency-tree.js').ADT; ADT.warp = { Level: 'warp.L...
require('./level.svc'); require('./scoring.svc'); require('./ship.svc'); require('./ship-effects.svc');
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>trait Shape { fn area(&self) -> i32; fn is_shape(&self) -> bool { true } } struct Square { side_length: i32, } impl Shape for Square { fn area(&self) -> i32 {<|fim▁hole|> fn main() { let square = Square { side_length: 2 }; println!...
self.side_length * self.side_length } }
<|file_name|>missing-lifetimes-in-signature-2.rs<|end_file_name|><|fim▁begin|>// Regression test for #81650 struct Foo<'a> { x: &'a mut &'a i32, } impl<'a> Foo<'a> { fn bar<F, T>(&self, f: F) where F: FnOnce(&Foo<'a>) -> T, F: 'a, {} }<|fim▁hole|>} fn func<T: Test>(foo: &Foo, t: T) { ...
trait Test { fn test(&self);
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from setuptools import setup, find_packages REPO_NAME = 'chickenzord/dotenvy' VERSION = '0.2.0' ARCHIVE_URL = 'https://github.com/%s/archive/v%s.tar.gz' % (REPO_NAME, VERSION) setup( # packaging packages=find_packages('src'), packa...
], entry_points={
<|file_name|>index-compiled.js<|end_file_name|><|fim▁begin|>'use strict'; function posix(path) { return path.charAt(0) === '/'; }; function win32(path) {<|fim▁hole|> // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\...
<|file_name|>number.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python <|fim▁hole|> =============================================================================== Copyright (C) 2015-2021 Rudolf Cardinal (rudolf@pobox.com). This file is part of CRATE. CRATE is free software: you can redistribute it an...
""" crate_anon/nlp_manager/number.py