prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>pkcs11factory.go<|end_file_name|><|fim▁begin|>// +build pkcs11
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package factory
import (
"encoding/hex"
"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/bccsp/pkcs11"
"github.com/hyperledger/fabri... | |
<|file_name|>init.rs<|end_file_name|><|fim▁begin|>#![feature(core, collections)]
extern crate core;
#[cfg(test)]
mod tests {
use core::slice::SliceExt;
// fn size_from_ptr<T>(_: *const T) -> usize {
// mem::size_of::<T>()
// }
// macro_rules! slice_offset {
// ($ptr:expr, $by:expr) =>... | // }
// |
<|file_name|>babylon.animation.ts<|end_file_name|><|fim▁begin|>module BABYLON {
export class Animation {
private _keys: Array<any>;
private _offsetsCache = {};
private _highLimitsCache = {};
private _stopped = false;
public _target;
private _easingFunction: IEasingFu... | |
<|file_name|>Solution.java<|end_file_name|><|fim▁begin|>package com.mgireesh;
public class Solution extends VersionControl {
public int firstBadVersion(int n) {
int badVersion = 0;<|fim▁hole|> int end = n;
while (start < end) {
int mid = start + (end - start) / 2;
if (isBadVersion(mid)) {
end = mid;
... |
int start = 1; |
<|file_name|>tagger.js<|end_file_name|><|fim▁begin|>let BASE_DIR = '/masn01-archive/';
const TAG_OPTIONS = ['meteor', 'cloud', 'bug', 'misc'];
let CURR_DIR = null;
let CURR_FILES = null;
let INIT_CMAP = null;
let CURR_IDX = 0;
let PREV_IDX = null;
$(async function() {
let cameras = JSON.parse(await $.get('camera... | }, {
action: 'list',
path: currentFile |
<|file_name|>TimezoneModel.js<|end_file_name|><|fim▁begin|>Ext.define('Onlineshopping.onlineshopping.shared.shop.model.location.TimezoneModel', {
"extend": "Ext.data.Model",
"fields": [{
"name": "primaryKey",
"type": "string",
"defaultValue": ""
}, {
"name": "timeZ... | "name": "cities",
"type": "string",
"defaultValue": ""
}, { |
<|file_name|>test_abstract.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
from rpaths import unicode, PY3, AbstractPath, PosixPath, WindowsPath
class TestAbstract(unittest.TestCase):
def test_construct(self):
... | class TestWindows(unittest.TestCase):
"""Tests for WindowsPath.
"""
def test_construct(self): |
<|file_name|>advogato.py<|end_file_name|><|fim▁begin|># Copyright (c) 2001-2004 Twisted Matrix Laboratories.<|fim▁hole|># See LICENSE for details.
#
'''
Usage:
advogato.py <name> <diary entry file>
'''
from twisted.web.xmlrpc import Proxy
from twisted.internet import reactor
from getpass import getpass
import sys
... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::net::{TcpStream, TcpListener};
use std::thread;
fn handle_client(stream: TcpStream) {
println!("Someone connected!");
}
fn main() {
println!("Starting Iron IRCd");<|fim▁hole|> match stream {
Ok(stream) => {
thread::spawn(move || {
handle_cli... |
let listener = TcpListener::bind("127.0.0.1:6667").unwrap();
for stream in listener.incoming() { |
<|file_name|>c_cm1x.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------------
# Copyright (C) 2013-2014 Huynh Vi Lam <domovilam@gmail.com>
#
# This file is part of pimucha.
#
# This program is free software: you can redistribute it and/or modify
# it und... | # GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
<|file_name|>Script.ts<|end_file_name|><|fim▁begin|>import { ILogger, getLogger } from './loggers';
import { CancellationToken, ICancellationToken } from '../util/CancellationToken';
import { Step } from './Step';
import { ModuleLoader } from './ModuleLoader';
import * as _ from 'underscore';
import { Guid } from '../u... | this.name = scriptDefinition.name; |
<|file_name|>test_parse_rank_score.py<|end_file_name|><|fim▁begin|>from scout.parse.variant.rank_score import parse_rank_score
from scout.parse.variant.variant import parse_variant
def test_parse_rank_score():
## GIVEN a rank score string on genmod format
rank_scores_info = "123:10"
variant_score = 10.0
... | ## THEN assert that None is returned
assert parsed_rank_score == None
|
<|file_name|>single_thread_calculator.rs<|end_file_name|><|fim▁begin|>use crate::{MonteCarloPiCalculator, gen_random};
use std::sync::Arc;
pub struct SingleThreadCalculator {}
impl SingleThreadCalculator {
#[inline]
fn gen_randoms_static(n: usize) -> (Vec<f64>, Vec<f64>) {
let mut xs = vec![0.0; n];
... | |
<|file_name|>cog_selector.py<|end_file_name|><|fim▁begin|># #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://etetoolkit.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the t... | node_id, clade_id = generate_node_ids(target_sp, out_sp)
# Initialize task |
<|file_name|>MultiSurfaceType.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2013 Gunnar Kappei.
*
* 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.or... | |
<|file_name|>from_bits.rs<|end_file_name|><|fim▁begin|>use itertools::Itertools;
use malachite_base::num::basic::traits::Zero;
use malachite_base::num::conversion::traits::ExactFrom;
use malachite_base::num::logic::traits::BitAccess;
use malachite_nz::natural::Natural;
pub fn from_bits_asc_naive<I: Iterator<Item = boo... | }) { |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>(function() {
function config($stateProvider, $locationProvider) {
$locationProvider
.html5Mode({
enabled: true,
requireBase: false
});
$stateProvider
.state('landing', {
url: '/',<|fim▁hole|> url: '/album',... | controller: 'LandingCtrl as landing',
templateUrl: '/templates/landing.html'
})
.state('album', { |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod clauses;
pub mod elements;
pub mod expressions;
pub mod func;
pub mod keywords;
pub mod math;
pub mod select_statement;
pub mod values;
use nom::branch::alt;
use nom::combinator::map;
use nom::number::complete::double;
use nom::IResult;
use ordered_float::Ordere... | pub use expressions::parse_expr; |
<|file_name|>get_outgoing.rs<|end_file_name|><|fim▁begin|>use chrono::{UTC, Date, Datelike};
use std::str::FromStr; // Use of #from_str.
use api::client::{TellerClient, ApiServiceResult, Transaction};
use api::client::parse_utc_date_from_transaction;
use api::inform::Money;
pub trait GetOutgoing {
fn get_outgoin... | .fold(0i64, |sum, v| sum + v); |
<|file_name|>current.py<|end_file_name|><|fim▁begin|>"""This *was* the parser for the current HTML format on parl.gc.ca.
But now we have XML. See parl_document.py.
This module is organized like so:
__init__.py - utility functions, simple parse interface
common.py - infrastructure used in the parsers, i.e. regexes<|fi... | current.py - parser for the Hansard format used from 2006 to the present
old.py - (fairly crufty) parser for the format used from 1994 to 2006 |
<|file_name|>problem-0013.rs<|end_file_name|><|fim▁begin|>/// Problem 13
/// Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.
///
/// 37107287533902102798797998220837590246510135740250
/// ...
fn main() {
let raw: String = "\
37107287533902102798797998220837590246510... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""GRR restful API rendering plugins."""
# pylint: disable=unused-import<|fim▁hole|>from grr.gui.api_plugins import docs
from grr.gui.api_plugins import hunt
from grr.gui.api_plugins import reflection
from grr.gui.api_plugins import stats<|fim... | from grr.gui.api_plugins import aff4
from grr.gui.api_plugins import artifact
from grr.gui.api_plugins import config |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Collision detection algorithms<|fim▁hole|><|fim▁end|> |
pub mod minkowski;
pub mod broad_phase; |
<|file_name|>moment.ts<|end_file_name|><|fim▁begin|>import 'moment';<|fim▁hole|> if (!date) return undefined;
return moment(date).format(format);
}
}<|fim▁end|> |
export class MomentValueConverter {
toView(date: Date, format: string) {
if (!format) format = 'LLL'; |
<|file_name|>twitter.py<|end_file_name|><|fim▁begin|>import urllib
from askbot.deps.django_authopenid.util import OAuthConnection
class Twitter(OAuthConnection):<|fim▁hole|> super(Twitter, self).__init__('twitter')
self.tweet_url = 'https://api.twitter.com/1.1/statuses/update.json'
def tweet(self, ... | def __init__(self): |
<|file_name|>sigecoin_vi.ts<|end_file_name|><|fim▁begin|><TS language="vi" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Create a new address</source>
<translation>Tạo một địa chỉ mới</translation>
</message>
<message>
<source>&New</source>
<... | <context>
<name>ReceiveCoinsDialog</name>
</context> |
<|file_name|>testmarkint.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2019 Ondrej Starek
*
* This file is part of OTest2.
*
* OTest2 is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either ... | |
<|file_name|>SendMessageUtil.java<|end_file_name|><|fim▁begin|>package com.wjyup.coolq.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;<|fim▁hole|>import com.google.common.hash.HashCode;
import com.google.common.hash.HashFunction;
import com.google.common.hash.Hashing;
import com.google.... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .polarpoint import PolarPoint
__all__ = [
'PolarPoint',<|fim▁hole|>]<|fim▁end|> | |
<|file_name|>testcase_lmd_loader.js<|end_file_name|><|fim▁begin|>(function (require) {
var test = require('test'),
asyncTest = require('asyncTest'),
start = require('start'),
module = require('module'),
ok = require('ok'),
expect = require('expect'),
$ = requir... | if (typeof result === "undefined") {
result = scriptTag;
|
<|file_name|>entry.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) 2013-2014 Avencall
#
# 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, ... | u'7931G',
u'7941G',
u'7942G', |
<|file_name|>lithos_switch.rs<|end_file_name|><|fim▁begin|>extern crate libc;
extern crate nix;
extern crate env_logger;
extern crate regex;
extern crate argparse;
extern crate quire;
#[macro_use] extern crate log;
extern crate lithos;
use std::env;
use std::io::{stderr, Read, Write};
use std::process::exit;
use std:... | (default /etc/lithos/master.yaml)") |
<|file_name|>test_list_image_filters.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
#
# ... | self.assertFalse(any([i for i in images
if i['id'] == self.snapshot1_id]))
self.assertFalse(any([i for i in images
if i['id'] == self.snapshot2_id])) |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* main.rs */
#[crate_id = "main#0.1"];
#[comment = "ironkernel"];
#[license = "MIT"];
#[crate_type = "lib"];
// Forked from pczarn/rustboot
#[no_std];
#[feature(asm, globs, macro_rules)];
extern mod core;
#[cfg(target_arch = "arm")]
pub use support::{memcpy, memmove}... | use platform::{cpu, io};
pub mod kernel; |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import include, url
from sapl.sessao.views import (AdicionarVariasMateriasExpediente,
AdicionarVariasMateriasOrdemDia, BancadaCrud,
CargoBancadaCrud, ExpedienteMateriaCrud,
... | url(r'^sistema/sessao-plenaria/tipo/',
include(TipoSessaoCrud.get_urls())),
url(r'^sistema/sessao-plenaria/tipo-resultado-votacao/',
include(TipoResultadoVotacaoCrud.get_urls())), |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ----------... | |
<|file_name|>chatsService.js<|end_file_name|><|fim▁begin|>appService.factory('Chats', function() {
// Might use a resource here that returns a JSON array
// Some fake testing data
var chats = [{
id: 0,
<|fim▁hole|> name: 'Ben Sparrow',
lastText: 'You on your way?',
face: 'app/view/common/im... | |
<|file_name|>instr_vfmadd132ss.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
use ::test::run_test;
#[test]
fn vfmadd132ss_1() {
run_test... | fn vfmadd132ss_3() {
run_test(&Instruction { mnemonic: Mnemonic::VFMADD132SS, operand1: Some(Direct(XMM0)), operand2: Some(Direct(XMM7)), operand3: Some(Direct(XMM4)), operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[196, 226, 65, 153, 196], OperandSiz... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 12