prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>V3Param.cpp<|end_file_name|><|fim▁begin|>// -*- mode: C++; c-file-style: "cc-mode" -*- //************************************************************************* // DESCRIPTION: Verilator: Replicate modules for parameterization // // Code available from: https://verilator.org // //************************...
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import Permission from django.contrib.auth.forms import PasswordResetForm from .models import MyUser from forms import CustomUserRegistrationForm class Pe...
('email', 'first_name', 'last_name', 'password1', 'password2'), }),) search_fields = ('email', 'first_name', 'last_name',) ordering = ('last_name', 'first_name',)
<|file_name|>orchid.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Data preprocessing for ORCHID corpus """ from typing import List, Tuple # defined strings for special characters, # from Table 4 in ORCHID paper CHAR_TO_ESCAPE = { " ": "<space>", "+": "<plus>", "-": "<minus>", "=": "<equal...
<|file_name|>test_pd_client.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0. use grpcio::EnvBuilder; use kvproto::metapb::*; use pd_client::{PdClient, RegionInfo, RegionStat, RpcClient}; use security::{SecurityConfig, SecurityManager}; use test_pd::{mocker::*, util::*,...
cfg.update_interval = ReadableDuration(Duration::from_secs(100));
<|file_name|>icon.py<|end_file_name|><|fim▁begin|>import cStringIO import zlib import wx #---------------------------------------------------------------------- def getMailData(): return zlib.decompress( "x\xda\x01M\x01\xb2\xfe\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\ \x00\x00 \x08\x06\x00\x0...
<|file_name|>test_configexc.py<|end_file_name|><|fim▁begin|># vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2015-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of t...
<pre> Fake traceback </pre>
<|file_name|>upnp_listener.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/. */ //! UPnP listener for IP camera. //! extern crate url;...
// This will called each time that the device advertises itself using UPNP.
<|file_name|>guiappwizarddialog.cpp<|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 va...
} void GuiAppWizardDialog::setLowerCaseFiles(bool l) {
<|file_name|>config.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- try: # Python 2.7 from collections import OrderedDict except: # Python 2.6 from gluon.contrib.simplejson.ordered_dict import OrderedDict from gluon import current from gluon.storage import Storage from gluon.validators import ...
)), ("hms", Storage( name_nice = T("Hospitals"),
<|file_name|>cloned_instead_of_copied.rs<|end_file_name|><|fim▁begin|>// run-rustfix #![warn(clippy::cloned_instead_of_copied)] fn main() { // yay let _ = [1].iter().cloned(); let _ = vec!["hi"].iter().cloned(); let _ = Some(&1).cloned(); let _ = Box::new([1].iter()).cloned();<|fim▁hole|> // nay...
let _ = Box::new(Some(&1)).cloned();
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python #encoding=UTF-8 ''' Created on 2014-5-15 @author: XIAO Zhen ''' '''哈哈''' import Tkinter as tk import time import random class Application(tk.Frame): def __init__(self, master=None): tk.Frame.__init__(self, master) self.winfo_top...
re.append(list[i]) for i in range (len(re),5):
<|file_name|>window-header-menu.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core'; @Component({ selector: 'window-header-menu', templateUrl: './window-header-menu.component.html', styleUrls: ['./window-header-menu.component.scss'] }) export class WindowHeaderMenuCompone...
}
<|file_name|>mock.py<|end_file_name|><|fim▁begin|># mock.py # Test tools for mocking and patching. # Copyright (C) 2007-2012 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # mock 0.8.0 # http://www.voidspace.org.uk/python/mock/ # Released subject to the BSD License # Please see http://ww...
<|file_name|>table_test.py<|end_file_name|><|fim▁begin|>import unittest import os from sqltxt.table import Table from sqltxt.column import Column, ColumnName, AmbiguousColumnNameError from sqltxt.expression import Expression class TableTest(unittest.TestCase): def setUp(self): self.data_path = os.path.j...
# add a command, then output
<|file_name|>cache.go<|end_file_name|><|fim▁begin|>package api import ( "github.com/johnny-morrice/godless/crdt" ) type CacheCloser interface { CloseCache() error } type Cache interface { HeadCache IndexCache NamespaceCache CacheCloser } type HeadCache interface { SetHead(head crdt.IPFSPath) error GetHead()...
Len() int Enqueue(request Request, data interface{}) error Drain() <-chan interface{}
<|file_name|>workerglobalscope.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 devtools_traits::{DevtoolScriptControlMsg, Scri...
} pub fn handle_fire_timer(&self, timer_id: TimerEventId) {
<|file_name|>index.js<|end_file_name|><|fim▁begin|>const { QUERY_PROFILE_PROJECT, QUERY_PROFILE_ENVIRONMENT, QUERY_PROFILE_SETTINGS, MUTATION_LOG, MUTATION_SESSION, } = require('constants/permissions/values'); const { PRIVATE, } = require('constants/permissions/entries'); const app = require('...
}, { value: QUERY_PROFILE_ENVIRONMENT, entries: [PRIVATE]
<|file_name|>imagecollection.py<|end_file_name|><|fim▁begin|># coding=utf-8 """ Module holding tools for ee.ImageCollections """ import ee import ee.data import pandas as pd import math from . import date, ee_list from . import image as image_module from . import collection as eecollection from ..utils import castImage...
fill2 = fob.where(fill, fill) fill3 = fo.where(fill2, fill2)
<|file_name|>variance-cell-is-invariant.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www...
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms.
<|file_name|>suggestion_registry_test.py<|end_file_name|><|fim▁begin|># Copyright 2018 The Oppia 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://...
'translation_html': '<p>This is the updated translated html.</p>',
<|file_name|>set_version.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python import os import sys import glob version = (int(sys.argv[1]), int(sys.argv[2]), int(sys.argv[3]), int(sys.argv[4])) def substitute_file(name): subst = '' f = open(name) for l in f: if '#define LIBTORRENT_VERSION_MAJOR' in l and name....
<|file_name|>parser.py<|end_file_name|><|fim▁begin|>from pymuco.midiio import * from pymuco.midi import representation class MidiParser(MidiOutStream.MidiOutStream): """ This class listens to a select few midi events relevant for a simple midifile containing a pianomelody """ def __init__(self, midifile): ...
self.ctrack = n_track def end_of_track(self):
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'<|fim▁hole|>exports.Schemas = require('./schemas') exports.Validator = require('./validator')<|fim▁end|>
exports.Utils = require('./utils')
<|file_name|>test_index_drawing.cpp<|end_file_name|><|fim▁begin|>// ========================================================================== // SeqAn - The Library for Sequence Analysis // ========================================================================== // Copyright (c) 2006-2015, Knut Reine...
<|file_name|>install_plugin_command_test.go<|end_file_name|><|fim▁begin|>package plugin import ( "bytes" "fmt" "io/ioutil" "log" "net/http" "os" "path/filepath" "code.cloudfoundry.org/cli/integration/helpers" "code.cloudfoundry.org/cli/util/generic" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" . ...
<|file_name|>INetworkReachabilityCallbackError.ts<|end_file_name|><|fim▁begin|>/** --| ADAPTIVE RUNTIME PLATFORM |---------------------------------------------------------------------------------------- (C) Copyright 2013-2015 Carlos Lozano Diez t/a Adaptive.me <http://adaptive.me>. Licensed under the Apache License,...
}
<|file_name|>attribute-form.js<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2008-2009 The Open Source Geospatial Foundation * * Published under the BSD license. * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text * of the license. */ /** api: example[attribute-form] * Attribute Form...
form = new Ext.form.FormPanel({ renderTo: document.body,
<|file_name|>storageinterface.py<|end_file_name|><|fim▁begin|>from config import cloudplatform storage_adapter = None if cloudplatform == "google": import googlestorage storage_adapter = googlestorage elif cloudplatform == "aws": import awsstorage storage_adapter = awsstorage elif cloudplatform == "az...
:param string filename: destination file :param string text: text to upload :return boolean: true if succeed """
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), "README.md")) as readme: README = readme.read() with open(os.path.join(os.path.dirname(__file__), "requirements.in")) as requirements: REQUIREMENTS = [ req.split...
"Topic :: Internet :: WWW/HTTP :: Dynamic Content", ], )
<|file_name|>post_install.js<|end_file_name|><|fim▁begin|>/* eslint-disable */<|fim▁hole|>var fs = require('fs'); // Node 0.10 check if (!execSync) { execSync = require('sync-exec'); } function exec(command) { execSync(command, { stdio: [0, 1, 2] }); } fs.stat('dist', function(error, stat) { // Skip buil...
// adapted based on rackt/history (MIT) // Node 0.10+ var execSync = require('child_process').execSync;
<|file_name|>plugin-trust.e2e.js<|end_file_name|><|fim▁begin|>'use strict'; const { expect } = require('chai'); const kadence = require('..'); const network = require('./fixtures/node-generator'); const trust = require('../lib/plugin-trust'); const sinon = require('sinon'); const async = require('async'); describe('...
it('should allow the non-blacklisted contact', function(done) { node2.trust.addTrustPolicy({
<|file_name|>param_header.go<|end_file_name|><|fim▁begin|>package sctp import ( "encoding/binary" "fmt" ) type paramHeader struct { typ paramType len int raw []byte } const (<|fim▁hole|> paramLengthPlusHeader := paramHeaderLength + len(p.raw) rawParam := make([]byte, paramLengthPlusHeader) binary.BigEndian.P...
paramHeaderLength = 4 ) func (p *paramHeader) marshal() ([]byte, error) {
<|file_name|>mysql_replication.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to manage mysql replication (c) 2013, Balazs Pocze <banyek@gawker.com> Certain parts are taken from Mark Theunissen's mysqldb module This file is part of Ansible Ansible is free software: you ...
DOCUMENTATION = ''' --- module: mysql_replication
<|file_name|>TestImpGPSI_MNIST.py<|end_file_name|><|fim▁begin|>################################################################## # Code for testing the variational Multi-Stage Generative Model. # ################################################################## # basic python import numpy as np import numpy.random a...
########################## # Get some training data # ########################## # rng = np.random.RandomState(1234)
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it. import fn from '../../isWeekend/index'<|fim▁hole|>export default convertToFP(fn, 1)<|fim▁end|>
import convertToFP from '../_lib/convertToFP/index'
<|file_name|>all.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
//= require mes/modeler
<|file_name|>Tools.Type.Spec.ts<|end_file_name|><|fim▁begin|>/// <reference path="../typings/tsd.d.ts" /> import Forge = require('forge-di'); import Smithy = require('../src/index'); class CustomType {}; describe('Smithy.Tools.Type', () => { beforeEach(() => {<|fim▁hole|> var tool = new Smithy.Tools.Type({name:...
}); it('should set targetType property to Smithy.TargetType.Type on new instance', () => {
<|file_name|>Lab2InputOutput.java<|end_file_name|><|fim▁begin|>// John Meyer // CSE 271 F // Dr. Angel Bravo import java.util.Scanner; import java.io.*; /** * Copies a file with line numbers prefixed to every line */ public class Lab2InputOutput { public static void main(String[] args) throws Exception { ...
// Start copying
<|file_name|>usage.py<|end_file_name|><|fim▁begin|># coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated b...
<|file_name|>EntityToAnalyticalServiceMapper.java<|end_file_name|><|fim▁begin|>/*L * Copyright Georgetown University, Washington University. * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/cab2b/LICENSE.txt for details. */ package edu.wustl.cab2b.server.analyticals...
serviceDetailClassList.addAll(serviceDetailClassNameList);
<|file_name|>slot.py<|end_file_name|><|fim▁begin|># This file is part of PARPG. # PARPG 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 # (at your option) any lat...
def _setImage(self, source): self._image = source
<|file_name|>assertType.js<|end_file_name|><|fim▁begin|>var Accumulator, errorTypes, isConstructor, isType, isValidator, throwFailedValidator, throwFailure, throwInvalidType; throwFailure = require("failure").throwFailure; Accumulator = require("accumulator"); isConstructor = require("./isConstructor"); isValidator...
};
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from utils import (FeedRecordUpdater, FeedRecordCleaner)<|fim▁end|>
from readers import (autodiscover, FeedReader, TimestampedModelFeedReader, RSSFeedReader) from library import (FeedLibrary) from dispatch import (SubscriptionDispatcher, SubscriptionEmailer)
<|file_name|>UTC2GPS.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2/3/2015 @author: Antonio Hermosilla Rodrigo. @contact: anherro285@gmail.com @organization: Antonio Hermosilla Rodrigo. @copyright: (C) 2015 by Antonio Hermosilla Rodrigo @version: 1.0.0 ''' def UTC2GPS(...
<|file_name|>ConfWriter.py<|end_file_name|><|fim▁begin|>from itertools import chain from pyprint.ClosableObject import ClosableObject from coalib.parsing.StringProcessing import escape from coalib.settings.Section import Section class ConfWriter(ClosableObject): def __init__(self, file_name, ...
self.__write_section_name(section.name)
<|file_name|>model.py<|end_file_name|><|fim▁begin|>import codecs import os import re import json from . import WIKI_DIR from collections import defaultdict def _get_filename(slug): return os.path.join(WIKI_DIR, '%s.md' % (slug,)) class Index(object): def __init__(self): self.texts, self.words = {}, ...
tmp.append(w) wordsinphrase = tmp
<|file_name|>qt_gui.py<|end_file_name|><|fim▁begin|># Irish Dictionary GUI app # saved as qt_gui.py # Last edit by Davis Sandefur 15.07.2015 import sys import os from PyQt5 import QtCore, QtWidgets, QtGui, QtMultimedia from PyQt5 import QtNetwork from irish_dictionary import irish_dictionary, gaeilge_gaeilge from audi...
self.setLayout(grid) self.setWindowFlags(QtCore.Qt.WindowMinimizeButtonHint) self.setWindowFlags(QtCore.Qt.WindowCloseButtonHint)
<|file_name|>references_and_borrowing.rs<|end_file_name|><|fim▁begin|>pub fn references_and_borrowing() { println!("***References and Borrowing***"); let v1 = vec![1, 2, 3, 4]; let v2 = vec![3, 4, 5, 6]; let res = foo_one(&v1, &v2); // borrowing a reference println!("result is {}", res); print...
}
<|file_name|>header.component.spec.ts<|end_file_name|><|fim▁begin|>import {async, ComponentFixture, TestBed} from '@angular/core/testing'; <|fim▁hole|> let component: HeaderComponent; let fixture: ComponentFixture<HeaderComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: ...
import {HeaderComponent} from './header.component'; describe('HeaderComponent', () => {
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! This module contains things that aren't really part of the gba //! but are part of the emulator. e.g. the debug module should actually be in //! here but it's temporary until I can start using a better UI library so //! it gets to stay where it is for now. pub mod s...
use ::util::sync_unsafe_cell::SyncUnsafeCell; lazy_static! { pub static ref PYRITE_SETTINGS: SyncUnsafeCell<settings::PyriteSettings> = SyncUnsafeCell::new(Default::default());
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for lodash.camelCase 4.3 // Project: http://lodash.com/ // Definitions by: Brian Zengel <https://github.com/bczengel>, Ilya Mochalov <https://github.com/chrootsu>, Stepan Mikhaylyuk <https://github.com/stepancar> // Definitions: https://github.com...
<|file_name|>gridlayout.py<|end_file_name|><|fim▁begin|>''' Grid Layout =========== .. only:: html .. image:: images/gridlayout.gif :align: right .. only:: latex .. image:: images/gridlayout.png :align: right .. versionadded:: 1.0.4 The :class:`GridLayout` arranges children in a matrix. It...
<|file_name|>converter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding=utf-8 import sys import argparse parser = argparse.ArgumentParser( description='convert a non-standord hostname like xx-xx-[1-3] to a ' 'expansion state', formatter_class=argparse.RawDescriptionHelpFormatter, epilog=""...
<|file_name|>instructions.rs<|end_file_name|><|fim▁begin|>/// A 16-bit address `NNN` pub struct Address; /// 8-bit information in an opcode. `NN` pub struct Byte; /// 4-bit information in an opcode. `N` pub struct Nibble; /// Represents an arbitrary 8-bit register. pub type Vx = u8; /// Represents an arbitrary 8-bi...
/// Skip the following instruction if the key corresponding to
<|file_name|>metadata.ts<|end_file_name|><|fim▁begin|>import {Type, DirectiveMetadata} from 'angular2/core'; import {DirectiveResolver} from 'angular2/compiler'; import {stringify} from './util'; var COMPONENT_SELECTOR = /^[\w|-]*$/; var SKEWER_CASE = /-(\w)/g; var directiveResolver = new DirectiveResolver(); export ...
for (var i = 0; i < names.length; i++) { var parts = names[i].split(':'); var prop = parts[0].trim();
<|file_name|>one.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-gogo. // source: combos/unmarshaler/one.proto // DO NOT EDIT! /* Package one is a generated protocol buffer package. It is generated from these files: combos/unmarshaler/one.proto It has these top-level messages: Subby Sampl...
if iNdEx > l {
<|file_name|>gl_headers.hpp<|end_file_name|><|fim▁begin|>#ifndef GL_HEADER_HPP #define GL_HEADER_HPP #define GLEW_STATIC extern "C" {<|fim▁hole|>} #include <cinttypes> #if defined(__APPLE__) # include <OpenGL/gl.h> # include <OpenGL/gl3.h> # define OGL32CTX # ifdef GL_ARB_instanced_arrays # define...
#include <GL/glew.h>
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>/** * Angular 2 decorators and services */ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { environment } from 'environments/environment'; import { AppState } from './app.service'; /** * App Component * Top Level Component */...
</a> </nav>
<|file_name|>admin.py<|end_file_name|><|fim▁begin|><|fim▁hole|> class QuoteAdmin(admin.ModelAdmin): list_display = ('message', 'name', 'program', 'class_of', 'submission_time') admin.site.register(Quote, QuoteAdmin)<|fim▁end|>
from quotes.models import Quote from django.contrib import admin
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
from .plot import *
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>try: from django.conf.urls import * except ImportError: # django < 1.4 from django.conf.urls.defaults import * <|fim▁hole|> url(r"^$", EventList.as_view(template_name='events/event_list_calendar.html'), name='list'), ...
from .views import EventDetail, EventList, EventCreate, EventCreateJSON, EventDelete, EventUpdate urlpatterns = patterns("events.views",
<|file_name|>download_entered_data_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from selenium import webdriver from selenium.webdriver.common.by import By from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoAlertPresentException import unittest, time, r...
finally: self.accept_next_alert = True
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#~ # -*- coding: utf-8 -*- #~ from os.path import join from distutils.core import setup from yamlweb import __version__, __progname as name # readme is needed at register/upload time, not install time try: with open('readme.rst') as f: long_description =...
<|file_name|>graph.py<|end_file_name|><|fim▁begin|>from typing import ( IO, Any, BinaryIO, Iterable, Optional, TextIO, Union, Type, cast, overload, Generator, Tuple, ) import logging from warnings import warn import random from rdflib.namespace import Namespace, RDF from ...
subject and object. Return True if all nodes have been visited and False if it cannot continue and there are still unvisited nodes left. """ all_nodes = list(self.all_nodes())
<|file_name|>fetcher.go<|end_file_name|><|fim▁begin|>/* Copyright 2011 Google Inc. Modifications Copyright (c) 2014 Simon Zimmermann 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<|fim▁hole|>distri...
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
<|file_name|>gtest-printers.cc<|end_file_name|><|fim▁begin|>// Copyright 2007, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must re...
<|file_name|>TZlibTransport.py<|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 under the ...
The purpose of this caching is to allocate only one TZlibTransport where only one is really needed (since it must have separate read/write buffers),
<|file_name|>paymentflowhistorydialog.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2010 Async Open Source <http://www.async.com.br> ## All rights reserved ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GN...
COALESCE(payments_paid.count, 0) as paid_payments, COALESCE(payments_paid.paid, 0) as paid,
<|file_name|>inspect.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The rkt 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...
<|file_name|>null_parameter_test.cpp<|end_file_name|><|fim▁begin|>#include <csapex/param/parameter.h> #include <csapex/param/value_parameter.h> #include <csapex/param/interval_parameter.h> #include <csapex/param/string_list_parameter.h> #include <csapex/param/null_parameter.h> #include <csapex/param/parameter_factory.h...
#include <csapex/utility/delegate.h> #include <csapex/serialization/parameter_serializer.h> #include <csapex/utility/yaml.h>
<|file_name|>importer_test.go<|end_file_name|><|fim▁begin|>package importer import ( "flag" "fmt" "io/ioutil" "os" "path/filepath" "strings" "testing" "github.com/anz-bank/sysl/pkg/syslutil" "github.com/sirupsen/logrus/hooks/test" "github.com/stretchr/testify/require" ) var ( update = flag.Bool("update", ...
type testConfig struct { name string testDir string testExtension string
<|file_name|>memstore.go<|end_file_name|><|fim▁begin|>package gobuddyfs import ( "sync" "github.com/golang/glog" ) type MemStore struct { lock *sync.RWMutex store map[string][]byte KVStore } func NewMemStore() *MemStore { return &MemStore{store: make(map[string][]byte), lock: &sync.RWMutex{}} } func (self ...
defer self.lock.Unlock() if value == nil { // Implicit delete operation
<|file_name|>functional_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import print_function import logging import os import signal import socket import time import traceback from datetime import datetime from multiprocessing import Process from os.path import abspath from os.path import...
<|file_name|>disk.rs<|end_file_name|><|fim▁begin|>#![feature(plugin, custom_derive, custom_attribute)] #![plugin(serde_macros)] extern crate drum; extern crate serde; use drum::*; use std::io::*; use std::collections::*; use std::fs::{OpenOptions}; #[derive(PartialEq, Ord, Eq, PartialOrd, Serialize, Deserialize)] enu...
fn run() -> Result<()> {
<|file_name|>tray_settings.cc<|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. #include "ash/system/settings/tray_settings.h" #include "ash/shell.h" #include "ash/system...
<|file_name|>code_interpreter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8; Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*-<|fim▁hole|>@file code_interpreter.py @package pybooster.code_interpreter @version 2019.07.14 @author Devyn Collier Johnson <DevynCJohnson@Gmail.com> @copyright ...
# vim: set fileencoding=utf-8 filetype=python syntax=python.doxygen fileformat=unix tabstop=4 expandtab : # kate: encoding utf-8; bom off; syntax python; indent-mode python; eol unix; replace-tabs off; indent-width 4; tab-width 4; remove-trailing-space on; """@brief Interpret various computer languages using installed ...
<|file_name|>avi_role.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # # This file is part of Ansible # # Ansible is free software: y...
<|file_name|>tables.py<|end_file_name|><|fim▁begin|># Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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....
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy from horizon_lib import tables
<|file_name|>grpc_test.go<|end_file_name|><|fim▁begin|>package grpc import ( "net" "testing" "github.com/asim/go-micro/v3/transport" ) func expectedPort(t *testing.T, expected string, lsn transport.Listener) { _, port, err := net.SplitHostPort(lsn.Addr()) if err != nil { t.Errorf("Expected address to be `%s`,...
<|file_name|>load-ili-kinds.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3 import sqlite3, sys # It takes one argument: the name of the new database if (len(sys.argv) < 1): sys.stderr.write('You need to give the name of the ILI DB\n') sys.exit(1) else: dbfile = sys.argv[1] ##########################...
################################################################
<|file_name|>chickenEggs.js<|end_file_name|><|fim▁begin|>import UnitConverter from '../../../UnitConverter' import { Fraction, mul, div } from '../../../../numbers' import { Mass } from '../../domains' import { UnitedStates } from '../../authorities' import { OunceConverter } from '../../us/customary/mass' import { Ch...
new UnitConverter( Mass, UnitedStates, ChickenEggs,
<|file_name|>kaiseki.js<|end_file_name|><|fim▁begin|>/*! * Kaiseki * Copyright(c) 2012 BJ Basañes / Shiki (shikishiji@gmail.com) * MIT Licensed * * See the README.md file for documentation. */ var request = require('request'); var _ = require('underscore'); var Kaiseki = function(options) { if (!_.isObject(...
for (var i = 0; i < keys.length; i++) ret[keys[i]] = values[i];
<|file_name|>AtomPub10.java<|end_file_name|><|fim▁begin|>/* Copyright 2019 Nationale-Nederlanden 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/LI...
Unless required by applicable law or agreed to in writing, software
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from rest_framework import serializers def serializer_factory(model, serializer_class=serializers.ModelSerializer, attrs=None, meta=None): """ Generate a simple serializer for the given model class. :param model: Model class :param serializer_class: ...
attrs = attrs or {} meta = meta or {} meta.setdefault("model", model) attrs.setdefault("Meta", type(str("Meta"), (object,), meta))
<|file_name|>JaxRsClientProxyFactorySupportTest.java<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2015 the original author or 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 ...
<|file_name|>coinched.rs<|end_file_name|><|fim▁begin|>extern crate coinched; extern crate clap; extern crate env_logger; #[macro_use] extern crate log; use std::str::FromStr; use clap::{Arg, App}; fn main() { env_logger::init().unwrap(); let matches = App::new("coinched") .version(env!(...
let port = if let Some(port) = matches.value_of("PORT") { match u16::from_str(port) {
<|file_name|>DayFlagsTest.java<|end_file_name|><|fim▁begin|>package com.getroadmap.r2rlib.models; import org.junit.Test; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; /** * Created by jan on 28/08/2017. * test dayflag bitwise and operator */ public class DayFlagsTest { @Te...
assertThat(dayFlags.isDay(DayFlags.Companion.getSATURDAY()), is(true)); }
<|file_name|>test_behave.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -tt from behave import * import os import subprocess import glob import re import shutil DNF_FLAGS = ['-y', '--disablerepo=*', '--nogpgcheck'] RPM_INSTALL_FLAGS = ['-Uvh'] RPM_ERASE_FLAGS = ['-e'] def _left_decorator(item): """ Removed p...
context.repo = repo
<|file_name|>GenerateFeaturesXmlMojoTest.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...
import org.apache.maven.artifact.Artifact;
<|file_name|>test_lws_logger.py<|end_file_name|><|fim▁begin|>"""Test cases for JSON lws_logger module, assumes Pytest.""" <|fim▁hole|>from jsonutils.lws import lws_logger class TestDictToTreeHelpers: """Test the helper functions for dict_to_tree.""" def test_flatten_list(self): """Test flattening of ...
<|file_name|>LiteralExpressionTest.java<|end_file_name|><|fim▁begin|>/* * Copyright 2019 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 * * ht...
assertNull(target.getImportedValues()); assertEquals(EXPRESSION_LANGUAGE, target.getExpressionLanguage().getValue()); } }
<|file_name|>events_receiver.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Copyright (C) 2018-2019 Matthias Klumpp <matthias@tenstral.net> # # Licensed under the GNU Lesser General Public License Version 3 # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
log.info('Received invalid JSON message from sender: %s (%s)', data if len(data) > 1 else msg, str(e))
<|file_name|>alert.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core'; import { NavController, AlertController } from 'ionic-angular'; @Component({ templateUrl: 'build/pages/alert/alert.html', }) export class AlertPage { user: string = 'nome'; constructor(public navCtrl: NavControlle...
alert.present();
<|file_name|>AuiTabs.java<|end_file_name|><|fim▁begin|>package com.atlassian.pageobjects.components.aui; import com.atlassian.pageobjects.PageBinder; import com.atlassian.pageobjects.binder.Init; import com.atlassian.pageobjects.binder.InvalidPageStateException; import com.atlassian.pageobjects.components.TabbedCompon...
String tabViewHref = listItem.getAttribute("href");
<|file_name|>ListMainInfo.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react' const invariant = require('invariant'); import {ListMainInfoLeft} from "./ListMainInfoLeft"; import {ListMainInfoDescription} from "./ListMainInfoDescription"; import {ListAdditionalInfo} from "./ListAdditionalInfo"; import {List...
case ListAdditionalInfoStacked: additional.push(child);
<|file_name|>agent.go<|end_file_name|><|fim▁begin|>/* gopm (Go Package Manager) Copyright (c) 2012 cailei (dancercl@gmail.com) The MIT License (MIT) 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 Softwar...
}
<|file_name|>Status.java<|end_file_name|><|fim▁begin|>package org.myrobotlab.framework; import static org.myrobotlab.framework.StatusLevel.DEBUG; import static org.myrobotlab.framework.StatusLevel.ERROR; import static org.myrobotlab.framework.StatusLevel.INFO; import static org.myrobotlab.framework.StatusLevel.SU...
/** * The key is the non changing part and good identifier of what went on... For * Exceptions I would recommend the Exception.class.getSimpleName() for the
<|file_name|>foreign-dupe.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<|fim▁hole|>// http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://w...
<|file_name|>XmlInterrogator.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2013 Red Hat, Inc. and/or its affiliates. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is...
<|file_name|>formButtons.directive.js<|end_file_name|><|fim▁begin|><|fim▁hole|> return { restrict: 'AE', replace: true, scope: { submitClick: '&submitClick', cancelClick: '&cancelClick' }, templateUrl: '/src/utils/views/formButtons.tmpl.html', l...
module.exports = FormButtonsDirective; function FormButtonsDirective () {