prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>RepetableReadRepo.java<|end_file_name|><|fim▁begin|>package com.success.txn.jpa.repos;
import java.util.Date;
import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import org.slf4j.Logger;
import org.slf4j.LoggerFactor... |
public String insertOne() {
Student s = new Student();
String address = "" + new Date(); |
<|file_name|>migrate_test.go<|end_file_name|><|fim▁begin|>package migrate
import (
"reflect"
"testing"
"github.com/influxdata/influxdb/v2/pkg/slices"
)
func Test_sortShardDirs(t *testing.T) {
input := []shardMapping{
{path: "/influxdb/data/db0/autogen/0"},
{path: "/influxdb/data/db0/rp0/10"},
{path: "/infl... | { |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate nickel;
extern crate postgres;
extern crate time;
extern crate rustc_serialize;
use nickel::{Nickel, JsonBody, FormBody};
use nickel::status::StatusCode;
use postgres::{Connection, SslMode};
use std::collections::HashMap;
use rustc_serialize::... | |
<|file_name|>TableDialog.js.uncompressed.js<|end_file_name|><|fim▁begin|>define("dojox/editor/plugins/nls/mk/TableDialog", {
//begin v1.x content
insertTableTitle: "Вметни табела",
modifyTableTitle: "Модифицирај табела",
rows: "Редови",
columns: "Колони",
align: "Порамни:",
cellPadding: "Дополнување на ќели... | left: "лево", |
<|file_name|>VendorType.java<|end_file_name|><|fim▁begin|>//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0-b52-fcs
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilati... | private final String value;
VendorType(String v) {
value = v; |
<|file_name|>publishtestsWithoutBuildConfig.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 util = require('../DotnetMockHelper');
const taskPath = path.join(__dirname, '../..', 'dotnetcore.js');
co... | |
<|file_name|>224621d9edde_timezone_at_metavj_level.py<|end_file_name|><|fim▁begin|>"""timezone at metavj level
Revision ID: 224621d9edde
Revises: 14346346596e
Create Date: 2015-12-21 16:52:30.275508
"""
<|fim▁hole|>down_revision = '5a590ae95255'
from alembic import op
import sqlalchemy as sa
import geoalchemy2 as ga... | # revision identifiers, used by Alembic.
revision = '224621d9edde' |
<|file_name|>Quest_LochModan.cpp<|end_file_name|><|fim▁begin|>/*
* ArcScripts for ArcEmu MMORPG Server
* Copyright (C) 2009 ArcEmu Team <http://www.arcemu.org/>
* Copyright (C) 2008-2009 Sun++ Team <http://www.sunscripting.com/>
* Copyright (C) 2008 WEmu Team
*
* This program is free software: you can redistribut... |
class ProtectingtheShipment : public QuestScript |
<|file_name|>__terp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) Camptocamp SA
# Author: Arnaud WÃŒst
#
#
# This file is part of the c2c_report_tools module.
#
#
# WARNING: This program as such is intended t... | #
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License |
<|file_name|>simple_bot.js<|end_file_name|><|fim▁begin|>"use strict";
var SimpleBot = function () {
this.name = 'SimpleBot';
};
SimpleBot.prototype.getMove = function (game) {
var nMaxConsequentFails = 1000,
nMaxCleverTryFails = 900;
for (var consequentFails = 0; consequentFails < nMaxConsequentFails; ++con... | |
<|file_name|>explorerTreeData.js<|end_file_name|><|fim▁begin|>import _ from 'lodash';
import { createSelector } from 'reselect';
const srcFilesSelector = state => state.srcFiles;
const featuresSelector = state => state.features;
const featureByIdSelector = state => state.featureById;
const keywordSelector = (state, ke... | |
<|file_name|>OptionsIpFilterPage.cpp<|end_file_name|><|fim▁begin|>// FileZilla Server - a Windows ftp server
// Copyright (C) 2002-2016 - Tim Kosse <tim.kosse@filezilla-project.org>
// This program is free software; you can redistribute it and/or<|fim▁hole|>// of the License, or (at your option) any later version.
/... | // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2 |
<|file_name|>ListRemoveWithIndexCodec.ts<|end_file_name|><|fim▁begin|>/* tslint:disable */
import ClientMessage = require('../ClientMessage');
import {BitsUtil} from '../BitsUtil';
import {Data} from '../serialization/Data';
import {ListMessageType} from './ListMessageType';
import Address = require('../Address');
impo... | static encodeRequest(name: string, index: number) {
// Encode request into clientMessage
var clientMessage = ClientMessage.newClientMessage(this.calculateSize(name, index)); |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Anaconda documentation build configuration file, created by
# sphinx-quickstart on Wed Sep 18 14:37:01 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration value... | #html_domain_indices = True
# If false, no index is generated.
#html_use_index = True |
<|file_name|>test.py<|end_file_name|><|fim▁begin|><|fim▁hole|>def main():
print(1)
if __name__ == '__main__':
main()<|fim▁end|> | import sys
|
<|file_name|>virt-launcher.go<|end_file_name|><|fim▁begin|>/*
* This file is part of the KubeVirt 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.apache.org/... | if istioProxyPresent(httpClient) {
isRetriable := func(err error) bool { |
<|file_name|>hello.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust-Windows Project Developers. See the
// COPYRIGHT file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
/... | const MENU_MAIN: isize = 0x201;
const MENU_NEW: WORD = 0x202;
const MENU_EXIT: WORD = 0x203; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from rk.ssh.tunnel import * |
<|file_name|>de.js<|end_file_name|><|fim▁begin|>window.locales = window.locales || {};
window.locales["de"] = {
_error_check: "muss sein",
_error_unknown_locale: "unbekannte Sprache -> setze zurück auf standardmäßig vorgegebene Sprache:",
_help_at_start_1: "Willkommen zu getstarted.js - entwickelt von @ThomasGrei... | have_name: "name",
have_id: "id",
entire_page: "ganze_seite",
help: "hilfe", |
<|file_name|>iterator.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2015, Emir Pasic. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package treemap
import (
"github.com/emirpasic/gods/containers"
rbt "github.com/emirpasic/gods/trees/r... | return Iterator{iterator: m.tree.Iterator()}
}
// Next moves the iterator to the next element and returns true if there was a next element in the container. |
<|file_name|>ag-grid-cell-validator.module.ts<|end_file_name|><|fim▁begin|>import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { SkyStatusIndicatorModule } from '@skyux/indicators';
import { SkyPopoverModule } from '@skyux/popovers';
import { SkyAgGridCellValidatorTooltipCo... | |
<|file_name|>ImageUtils.java<|end_file_name|><|fim▁begin|>package xzd.mobile.android.common;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import j... | if (b.length < 8) {
return false; |
<|file_name|>threadingFunctions.py<|end_file_name|><|fim▁begin|>import SpaceScript
import multiprocessing
from multiprocessing import Process, Queue, Pipe, Lock
from SpaceScript import frontEnd
from SpaceScript import utility
from SpaceScript.frontEnd import terminal
from SpaceScript.utility import terminalUtility
from... | |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>""" Django admin pages for student app """
from django import forms
from django.contrib.auth.models import User
from ratelimitbackend import admin
from xmodule.modulestore.django import modulestore
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys impor... |
class LinkedInAddToProfileConfigurationAdmin(admin.ModelAdmin):
"""Admin interface for the LinkedIn Add to Profile configuration. """
|
<|file_name|>shortcuts.py<|end_file_name|><|fim▁begin|>import os
import re
from subprocess import Popen, PIPE
from kivy.uix.popup import Popup
def run_syscall(cmd):
"""
run_syscall; handle sys calls this function used as shortcut.
::cmd: String, shell command is expected.
"""
p = Popen(cmd, shell... | result_text += text
location = -1
return result_text
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># DO NOT EDIT THIS FILE!
#
# Python module CosCollection__POA generated by omniidl
import omniORB
omniORB.updateModule("CosCollection__POA")
<|fim▁hole|>
# ** 3. End<|fim▁end|> | # ** 1. Stub files contributing to this module
import CosCollection_idl
# ** 2. Sub-modules |
<|file_name|>cell_renderer_text.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use CellRenderer;
use TreePath;
use ffi;
use gdk;
use glib;
use glib::StaticType;
use glib::Value;
use glib::object::D... | }
}
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//<|fim▁hole|>// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless req... | // Licensed under the Apache License, Version 2.0 (the "License"); |
<|file_name|>func_command.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
## func command line interface & client lib
##
## Copyright 2007,2008 Red Hat, Inc
## +AUTHORS
##
## This software may be freely redistributed under the terms of the GNU
## general public license.
##
## You should have received a copy of the G... | args.pop(0)
# if it doesn't look like server, assume it
# is a sub command? that seems wrong, what about |
<|file_name|>alerts.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""alerts.py Classes for sendings alerts
"""
__author__ = "Jean-Martin Archer"
__copyright__ = "Copyright 2013, MIT License."
import smtplib
from twilio.rest import TwilioRestClient
from vendors.pushbullet.pushbullet import PushBullet
import... | for alert in self.alerts: |
<|file_name|>LiteralBooleanEvaluationImpl.cpp<|end_file_name|><|fim▁begin|>#include "fUML/Semantics/Values/impl/LiteralBooleanEvaluationImpl.hpp"
#ifdef NDEBUG
#define DEBUG_MESSAGE(a) /**/
#else
#define DEBUG_MESSAGE(a) a
#endif
#ifdef ACTIVITY_DEBUG_ON
#define ACT_DEBUG(a) a
#else
#define ACT_DEBUG(a) /**/... | |
<|file_name|>unify_key.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.org/... | |
<|file_name|>LSTM.py<|end_file_name|><|fim▁begin|>from keras.models import Sequential
from keras.layers import LSTM
import numpy as np
model = Sequential()
ly = LSTM(2, activation='tanh', recurrent_activation='relu',implementation = 1, stateful=False, batch_input_shape=(5, 3, 3))
model.add(ly)
model.compile(optimizer=... | data[b, h, c] = (l % 5 + 1)/10 |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for eyrie project.
It exposes the WSGI callable as a module-level variable named ``application``.<|fim▁hole|>
import os
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
os.environ.setdefault("DJANGO_SETT... |
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
""" |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate cube;
// use cube::cube;
#[test]
fn cube_of_4_is_64() {
assert_eq!(cube::cube(4), 64);
}
// other test functions:<|fim▁hole|><|fim▁end|> | // ... |
<|file_name|>list.js<|end_file_name|><|fim▁begin|>'use strict';
const schema = require('screwdriver-data-schema');
const listSchema = schema.models.banner.list;
module.exports = () => ({
method: 'GET',
path: '/banners',
config: {
description: 'Get banners',
notes: 'Returns all banner recor... | tags: ['api', 'banners'], |
<|file_name|>recipe-496858.py<|end_file_name|><|fim▁begin|>'''Support module for translating strings.
This module provides several functions
for definitions, keys, and transforms.'''
__version__ = 1.3
################################################################################
import random
def definition(name... |
################################################################################
if __name__ == '__main__': |
<|file_name|>resourceEditorInput.test.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 informat... | import * as assert from 'assert';
import { URI } from 'vs/base/common/uri'; |
<|file_name|>Jornada.java<|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.
*/
package Code.Domain;
/**
*
* @author Andres Orduz Grimaldo
*/
public class J... | public void setNombre(String nombre) {
this.nombre = nombre;
}
|
<|file_name|>CCipher.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
Single Round Match 147 Round 1 - Division II, Level One
"""
class CCipher:
def decode(self, cipherText, shift):
a = ord('A')
decoder = [a + (c - shift if c >= shift else c - shift + 26) for c in range(26)]
plain = [chr(decod... | """
http://community.topcoder.com/stat?c=problem_statement&pm=1667 |
<|file_name|>borrowck-lend-flow.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.apache.... |
fn inc(v: &mut Box<isize>) {
*v = box (**v + 1); |
<|file_name|>touch.py<|end_file_name|><|fim▁begin|># asyncio version
# The MIT License (MIT)
#
# Copyright (c) 2016, 2017 Robert Hammelrath (basic driver)
# 2016 Peter Hinch (asyncio extension)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associat... | |
<|file_name|>CurrencyTest.java<|end_file_name|><|fim▁begin|>/*
* Created on 24/02/2014
*
*/
package net.rlviana.pricegrabber.model.entity.common;
import net.rlviana.pricegrabber.context.JPAPersistenceContext;
import net.rlviana.pricegrabber.model.entity.AbstractReadOnlyEntityTest;
import org.junit.Test;
import org.... | |
<|file_name|>test_qos.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 Mellanox Technologies, Ltd
# 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
#
# ... | self.assertTrue(self.qos_ext._policy_rules_modified(self.policy,
self.new_policy))
|
<|file_name|>proxy.py<|end_file_name|><|fim▁begin|>import logging
from sys import exc_info
from socket import socket, AF_INET, SOCK_STREAM, SOCK_DGRAM, SHUT_RD, SOL_SOCKET, SO_REUSEADDR, error as socketError
from traceback import format_exception
from struct import Struct
from .common import *
from .models import *
f... |
def disconnect(self):
socks = [s for s in self.sockets.keys() if SOCK_STREAM == s.type] |
<|file_name|>upasswd.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { UpasswdComponent } from './upasswd.component';
describe('UpasswdComponent', () => {<|fim▁hole|> TestBed.configureTestingModule({
declarations: [ UpasswdCompon... | let component: UpasswdComponent;
let fixture: ComponentFixture<UpasswdComponent>;
beforeEach(async(() => { |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate itertools;
use std::ops::Add;
use itertools::Itertools;
struct Character {
hitpoints: u16,
damage: u16,
armor: u16
}
impl Character {
fn rounds(&self, opponent: &Character) -> u16 {
let round_damage: f64 =
if op... | |
<|file_name|>foo.js<|end_file_name|><|fim▁begin|>/**
*
*/
var obj = {<|fim▁hole|>obj.<|fim▁end|> | num: 123,
str: 'hello',
};
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Lettre is a mailer written in Rust. It provides a simple email builder and several transports.
//!
//! ## Architecture
//!
//! This mailer is divided into:
//!
//! * An `email` part: builds the email message
//! * A `transport` part: contains the available transports... | #[macro_use] |
<|file_name|>TooltipView.js<|end_file_name|><|fim▁begin|>import './styles.scss';
import {View} from 'backbone';
import {className} from '../../decorators';
import bem from 'b_';
import $ from 'jquery';
import {defaults} from 'underscore';
export const POSITION = {
'top': function({top, left, width}, {offset}, tipS... | this.$el.remove();
}
}
|
<|file_name|>common.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The html5ever Project Developers. See the
// COPYRIGHT file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// ... |
/// A `DOCTYPE` with name, public id, and system id.
Doctype(String, String, String), |
<|file_name|>__init__.py<|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/.<|fim▁hole|><|fim▁end|> | #
# Copyright (c) 2015 Etherios, Inc. All rights reserved.
# Etherios, Inc. is a Division of Digi International. |
<|file_name|>process_raster.py<|end_file_name|><|fim▁begin|>def standard_process_to_geoserver():
# check no data value
print "standard_process_to_geoserver"
<|fim▁hole|>def _process():
# process to 3857 or 4326
print "process to 3857 or 4326"<|fim▁end|> | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from librehatti.catalog.models import PurchaseOrder
from librehatti.catalog.models import Category
from librehatti.catalog.models import PurchasedItem
from librehatti.catal... | return HttpResponse('')
|
<|file_name|>lxd.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# (c) 2016, Hiroaki Nakamura <hnakamur@gmail.com>
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is emb... | |
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>import datetime
import json
import time
import urllib
import urlparse
from django.contrib.humanize.templatetags import humanize
from django.contrib.staticfiles.storage import staticfiles_storage
from django.template import defaultfilters
from django.utils.encoding i... |
# Yanking filters from Django.
register.filter(strip_tags) |
<|file_name|>crateresolve8.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.apache.org/l... | // option. This file may not be copied, modified, or distributed
// except according to those terms. |
<|file_name|>pure_expression_spec.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Injector, PipeTransform, RenderComponentTy... | |
<|file_name|>twit.js<|end_file_name|><|fim▁begin|>var c = require("./config").twitter;
var Twit = require('twit');
//console.log(c);
console.log(c.apiKey);
console.log(c.apiSecret);
console.log(c.accessToken);
console.log(c.accessTokenSecret);
var T = new Twit({
consumer_key: c.apiKey,
consumer_secret: c.ap... |
//
// tweet 'hello world!'
// |
<|file_name|>uatparse.go<|end_file_name|><|fim▁begin|>package uatparse
import (
"encoding/hex"
"errors"
"fmt"
"io/ioutil"
"strconv"
"strings"
)
const (
UPLINK_BLOCK_DATA_BITS = 576
UPLINK_BLOCK_BITS = (UPLINK_BLOCK_DATA_BITS + 160)
UPLINK_BLOCK_DATA_BYTES = (UPLINK_BLOCK_DATA_BITS / 8)
UPLINK_BLOCK_B... | fmt.Fprintf(ioutil.Discard, "overlay_record_identifier=%d\n", overlay_record_identifier)
object_label_flag := uint8(record_data[4] & 0x01)
fmt.Fprintf(ioutil.Discard, "object_label_flag=%d\n", object_label_flag)
|
<|file_name|>_showexponent.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class ShowexponentValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(<|fim▁hole|> self,
plotly_name="showexponent",
parent_name="scatterpolar.marker.colorbar",
**kwa... | |
<|file_name|>BlockConfigurator.java<|end_file_name|><|fim▁begin|><|fim▁hole|>package org.consumersunion.stories.dashboard.client.application.ui.block.configurator;
import org.consumersunion.stories.common.client.util.Callback;
import org.consumersunion.stories.dashboard.client.application.ui.block.HasValidation;
impo... | |
<|file_name|>fixer_util.py<|end_file_name|><|fim▁begin|>"""Utility functions, node construction macros, etc."""
# Author: Collin Winter
# Local imports
from .pgen2 import token
from .pytree import Leaf, Node
from .pygram import python_symbols as syms
from . import patcomp
############################################... | or an itterator).
See test_map_nochange in test_fixers.py for some examples and tests.
"""
global p0, p1, p2, pats_built |
<|file_name|>xz.rs<|end_file_name|><|fim▁begin|>use crate::decode;
use crate::encode::lzma2;
use crate::encode::util;
use crate::xz::{footer, header, CheckMethod, StreamFlags};
use byteorder::{LittleEndian, WriteBytesExt};
use crc::{crc32, Hasher32};
use std::io;
use std::io::Write;
pub fn encode_stream<R, W>(input: &... | stream_flags.serialize(&mut digested)?;
}
let crc32 = digest.sum32();
output.write_u32::<LittleEndian>(crc32)?; |
<|file_name|>MainApplication.java<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, softwa... | * Copyright 2013-2014 UOL - Universo Online Team
*
* Licensed under the Apache License, Version 2.0 (the "License"); |
<|file_name|>test_volumes_get.py<|end_file_name|><|fim▁begin|># Copyright 2012 OpenStack Foundation
# 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
#
# ... | new_v_name = data_utils.rand_name('new-Volume')
new_desc = 'This is the new description of volume' |
<|file_name|>ser.rs<|end_file_name|><|fim▁begin|>//! JSON Serialization
//!
//! This module provides for JSON serialization with the type `Serializer`.
use std::io;
use std::num::FpCategory;
use serde::ser;
use super::error::{Error, ErrorCode, Result};
/// A structure for serializing Rust values into JSON.
pub struc... | Err(Error::SyntaxError(ErrorCode::KeyMustBeAString, 0, 0)) |
<|file_name|>kvdatatest.cc<|end_file_name|><|fim▁begin|>/*
Kvalobs - Free Quality Control Software for Meteorological Observations
$Id: kvdatatest.cc,v 1.1.6.2 2007/09/27 09:02:31 paule Exp $
Copyright (C) 2007 met.no
Contact information:
Norwegian Meteoro... |
using namespace kvalobs;
using namespace std;
using namespace miutil; |
<|file_name|>ServerActions.js<|end_file_name|><|fim▁begin|>'use strict';
var AppDispatcher = require('../dispatchers/AppDispatcher');
var AppStore = require('../stores/AppStore');
var AppConstants = require('../constants/AppConstants');
var ServerActions = {
receiveData: function(data) {
AppDispatcher.handleVie... | |
<|file_name|>named_anon_conflict.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 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.a... | error_var
).span_suggestion_with_applicability( |
<|file_name|>MainClass.java<|end_file_name|><|fim▁begin|>// $Id: MainClass.java,v 1.6 2003/10/07 21:46:08 idgay Exp $
/* tab:4
* "Copyright (c) 2000-2003 The Regents of the University of California.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* docum... | |
<|file_name|>json.py<|end_file_name|><|fim▁begin|>import json
<|fim▁hole|>
class JsonFormatter(DocumentBrowserFormatter):
DATATYPE = JsonDocumentType()
def format_document(self, doc):
return json.dumps(doc.data, indent=4)<|fim▁end|> | from pimlico.datatypes.corpora.json import JsonDocumentType
from pimlico.cli.browser.tools.formatter import DocumentBrowserFormatter
|
<|file_name|>test_vmutils.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cloudbase Solutions Srl
# 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 obta... |
import mock |
<|file_name|>currencies.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# vim:fenc=utf-8
'''
Insights Forex live source
--------------------------
:copyright (c) 2014 Xavier Bruhiere
:license: Apache 2.0, see LICENSE for more details.
'''
import time
import pandas as pd
import dna.logging
import int... | |
<|file_name|>management.component.ts<|end_file_name|><|fim▁begin|>import { Component, Input, OnChanges, SimpleChanges } from "@angular/core";
const LOW = 3;
const REDIRECT: string =
"http://" + window.location.hostname + ":10000/dashboard";
@Component({
selector: "management",
templateUrl: "./management.compone... | }
break;
case LOW - 2: // 1
if (this.defcon === LOW - 2) { |
<|file_name|>CalculatorTest.java<|end_file_name|><|fim▁begin|>// Copyright(c) 2013 GROWTH XPARTNERS, Incorporated.
//
//
package junit.tutorial.calculator;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUni... | int expected = 35; |
<|file_name|>reference.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. module:: ellipse_fitting
:platform: Unix, Windows
:synopsis: Ellipse fitting algorithms and handling of ellipse information.
.. moduleauthor:: hbldh <henrik.blidh@nedomkull.com>
Created on 2013-05-05, 23:... | |
<|file_name|>signer_client.rs<|end_file_name|><|fim▁begin|>use client::{Rpc, RpcError};
use rpc::v1::types::{ConfirmationRequest, TransactionModification, U256, BlockNumber};
use serde_json::{Value as JsonValue, to_value};<|fim▁hole|>
pub struct SignerRpc {
rpc: Rpc,
}
impl SignerRpc {
pub fn new(url: &str, authfile... | use std::path::PathBuf;
use futures::{BoxFuture, Canceled}; |
<|file_name|>16.d.ts<|end_file_name|><|fim▁begin|>import { CalendarSettings16 } from "../../";<|fim▁hole|>
export = CalendarSettings16;<|fim▁end|> | |
<|file_name|>SettlementContract.java<|end_file_name|><|fim▁begin|>package com.tachys.moneyshare.dataaccess.db.contracts;
import android.provider.BaseColumns;
public class SettlementContract {<|fim▁hole|> }
public static class SettlementEntry implements BaseColumns {
public static final String TABLE_NA... | public SettlementContract() { |
<|file_name|>qos_specs.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 eBay Inc.
# Copyright (c) OpenStack 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
#
# http://www.apache.o... | """Associate a volume type with specific qos specs. |
<|file_name|>ReactFabric.js<|end_file_name|><|fim▁begin|><|fim▁hole|> * Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/
'use strict';
import {BatchedBridge} from... | /** |
<|file_name|>RoboticLineSolverILP.cpp<|end_file_name|><|fim▁begin|>/*
This file is part of the EnergyOptimizatorOfRoboticCells program.
EnergyOptimizatorOfRoboticCells 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 Foun... |
mModel.c.resize(mMapper.numberOfVariables(), 0.0);
for (const auto& p : mMapper.W) |
<|file_name|>dump_vppcalls.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2019 Cisco 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:
//
// http://www.ap... | if !exists {
h.log.Warnf("XConnect dump: rx interface name for index %d not found", pairs.RxSwIfIndex)
continue
} |
<|file_name|>transactioncontrol.cpp<|end_file_name|><|fim▁begin|>#include "forms/transactioncontrol.h"
#include "forms/graphicbutton.h"
#include "forms/label.h"
#include "forms/listbox.h"
#include "forms/scrollbar.h"
#include "forms/ui.h"
#include "framework/data.h"
#include "framework/framework.h"
#include "framework/... | |
<|file_name|>hash.rs<|end_file_name|><|fim▁begin|>use ahash::AHashMap;
use std::hash::Hash;
use std::marker::PhantomData;
use crate::entity::storage::{
AsStorage, AsStorageMut, DependentStorage, Dispatch, Dynamic, Enumerate, Get, IncrementalKeyer,
IndependentStorage, InnerKey, Insert, InsertWithKey, Key, Keyer... | }
}
|
<|file_name|>test_generate_pdf.py<|end_file_name|><|fim▁begin|># 3rd party imports
from bidi.algorithm import get_display as apply_bidi
# Django imports
from django.conf import settings
# Project imports
from .base import TestGeneratePdfBase
from .factories import create_voters
from .utils_for_tests import extract_pd... | textlines = extract_textlines(xml) |
<|file_name|>option.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 base::prelude::*;
use {Write, LowerHex, UpperHex, Debug, Disp... | }
}
} |
<|file_name|>test_runtime.py<|end_file_name|><|fim▁begin|>"""Test Workbench Runtime"""
from unittest import TestCase
import mock
from django.conf import settings
from xblock.fields import Scope
from xblock.runtime import KeyValueStore
from xblock.runtime import KvsFieldData
from xblock.reference.user_service import... | self.assertEqual(self.id_mgr.last_created_usage_id(), "my_scenario.my_block.d0.u1") |
<|file_name|>TestAlignAsBaseClass.py<|end_file_name|><|fim▁begin|>import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@no_debug_info_test
def test(self):
se... | self.expect_expr("(intptr_t)&d3g.f2 - (intptr_t)&d3g", result_value="8") |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># Copyright (C) 2010-2014 GRNET S.A.<|fim▁hole|>#
# 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
# (at your... | |
<|file_name|>ge.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
// pub trait FixedSizeArray<T> {
// /// Converts the array to immutable slice
// fn as_slice(&self) -> &[T];
// /// Converts the array to mutable slice
// fn as_mut_slice(&m... | ];
assert_eq!(array_a.ge(&array_b), false); |
<|file_name|>service_inspect_test.go<|end_file_name|><|fim▁begin|>package docker // import "docker.io/go-docker"
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
"testing"
"docker.io/go-docker/api/types"
"docker.io/go-docker/api/types/swarm"
"golang.org/x/net/context"
)
func TestServ... | if !strings.HasPrefix(req.URL.Path, expectedURL) {
return nil, fmt.Errorf("Expected URL '%s', got '%s'", expectedURL, req.URL)
}
content, err := json.Marshal(swarm.Service{ |
<|file_name|>transform.py<|end_file_name|><|fim▁begin|>"""Helper functions for transforming results."""
import hashlib
import logging
import os
import re
import urllib.parse
from typing import Optional
from docutils.core import publish_parts
from dump2polarion.exporters.verdicts import Verdicts
# pylint: disable=in... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var debugpp = require('..');
<|fim▁hole|>var debugSystem = debugpp.debug('system', true);
var debugSystemTest = debugpp.debug('system.test', true);
debugSystem.log("Hello system!");
debugSystemTest.log("Hello system test!");
debugSystemTest.log("World");
debugSystemT... | |
<|file_name|>lilylib.py<|end_file_name|><|fim▁begin|># This file is part of LilyPond, the GNU music typesetter.
#
# Copyright (C) 1998--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
# Jan Nieuwenhuizen <janneke@gnu.org>
#
# LilyPond is free software: you can redistribute it and/or modify
# it under the terms ... | if os.path.exists (full): |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>//! # Synacor Challenge
//!
//! A Rust based runtime for the Synacor challenge architecture.
#![warn(missing_docs)]
extern crate byteorder;
extern crate termion;
#[macro_use] extern crate chan;
extern crate chan_signal;
extern crate libc;
extern crate synacor;
mod com... | } |
<|file_name|>vieweditor.container.js<|end_file_name|><|fim▁begin|>/* @flow */
import { bindActionCreators } from 'redux';
import React from 'react';
import Select from 'react-select';
import { connect } from 'react-redux';
import {map} from 'lodash';
import { getAllBoards } from '../../data/boards';
import {addView} fr... | state: {
name: string,
selectedBoards: string[],
}; |
<|file_name|>webpack.base.conf.js<|end_file_name|><|fim▁begin|>var path = require('path')
var utils = require('./utils')
var config = require('../config')
var vueLoaderConfig = require('./vue-loader.conf')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
entry: {
app: './sr... | loader: 'eslint-loader', |
<|file_name|>jquery.js<|end_file_name|><|fim▁begin|>/*!
* jQuery JavaScript Library v3.2.1
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2017-03-20T18:59Z
*/
( fu... | tmp = getAll( fragment.appendChild( elem ), "script" );
// Preserve script evaluation history |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.