prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>wiener.py<|end_file_name|><|fim▁begin|># Copyright 2015 Matthew J. Aburn
#
# 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 option) any... | """transpose the last two axes of a three axis array"""
return a.transpose((0, 2, 1)) |
<|file_name|>stage01_rnasequencing_analysis_postgresql_models.py<|end_file_name|><|fim▁begin|>from SBaaS_base.postgresql_orm_base import *
class data_stage01_rnasequencing_analysis(Base):
__tablename__ = 'data_stage01_rnasequencing_analysis'
id = Column(Integer, Sequence('data_stage01_rnasequencing_analysis_id... | self.analysis_id=row_dict_I['analysis_id'];
self.experiment_id=row_dict_I['experiment_id'];
self.sample_name_abbreviation=row_dict_I['sample_name_abbreviation']; |
<|file_name|>scale_strict.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
### rev: 5.0
### author: <zhq>
### features:
### errors included
### up to 63 bases (2 to 64)
### caps recognition and same output format (deprecated)
### for the function parameters, `cur` represents the current (input) base, `re... | result = chr(digit) + result
if not positive: result = "-" + result
return result |
<|file_name|>status_effect.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Status effect data."""
from components.status_effect import StatusEffect
from status_effect_functions import damage_of_time
# todo: generate new object not copy
STATUS_EFFECT_CATALOG = {
'POISONED':
{
'name': 'poisone... | 'duration': 6,
'function_kwargs': {'init_dmg': 2} # specify as dictionary
}, |
<|file_name|>LessonHeader.js<|end_file_name|><|fim▁begin|>'use strict';
import Flickity from 'flickity-imagesloaded'
export default function LessonHeader() {
console.log("-- LessonHeader initialized")
let photosSelector = '.LessonHeader__photos'
let $photos = $(photosSelector)
if ($photos.length > 0) {
let ... |
} |
<|file_name|>iqiyi.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import unicode_literals
import hashlib
import math
import random
import time
import uuid
from .common import InfoExtractor
from ..compat import compat_urllib_parse
from ..utils import ExtractorError
class IqiyiIE(InfoExtractor):
... |
video_urls_dict = {}
for format_item in data['vp']['tkl'][0]['vs']:
if 0 < int(format_item['bid']) <= 10: |
<|file_name|>ios-star-outline.d.ts<|end_file_name|><|fim▁begin|>import * as React from 'react';
import { IconBaseProps } from 'react-icon-base';<|fim▁hole|><|fim▁end|> | export default class IoIosStarOutline extends React.Component<IconBaseProps> { } |
<|file_name|>pySpan.cpp<|end_file_name|><|fim▁begin|>/* This file is part of HSPlasma.
*
* HSPlasma 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) a... | self->fThis->setBaseMatrix(PyInt_AsLong(value));
return 0;
} |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from setuptools import setup, find_packages
__doc__ = """
Falsify data
"""
version = '0.0.1'
setup(name='perjury',
version=version,
description=__doc__,
author='Aaron Merriam',
author_email='aaronmerriam@gmail.com',
keywords... | long_description=__doc__,
url='https://github.com/aaronmerriam/foundry',
packages=find_packages(),
platforms="any", |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Variable header in MQTT
use std::io;
use std::string::FromUtf8Error;
use crate::topic_name::{TopicNameDecodeError, TopicNameError};
pub use self::connect_ack_flags::ConnackFlags;
pub use self::connect_flags::ConnectFlags;
pub use self::connect_ret_code::ConnectRet... |
impl From<TopicNameDecodeError> for VariableHeaderError {
fn from(err: TopicNameDecodeError) -> VariableHeaderError {
match err { |
<|file_name|>mutating_webhook_manager.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 The Kubernetes 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/LI... | "sort"
"sync/atomic" |
<|file_name|>NamespaceTestCase.js<|end_file_name|><|fim▁begin|>/*
* Copyright 2012 Amadeus s.a.s.
* 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/LIC... | |
<|file_name|>upload.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import argparse
import errno
import hashlib
import os
import shutil
import subprocess
import sys
import tempfile
from io import StringIO
from lib.config import PLATFORM, get_target_arch, get_env_var, s3_config, \
get_zip... | message = ('Error: Please set the $ELECTRON_GITHUB_TOKEN '
'environment variable, which is your personal token') |
<|file_name|>ScheduleEventAddOptionsNextRequestHandler.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2000 - 2013 Silverpeas
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, ... | } |
<|file_name|>tankipas.js<|end_file_name|><|fim▁begin|>/*
* grunt-tankipas
* https://github.com/Leny/grunt-tankipas
*
* Copyright (c) 2014 Leny
* Licensed under the MIT license.
*/
"use strict";
var chalk, error, spinner, tankipas;
tankipas = require("tankipas");
chalk = require("chalk");
error = chalk.bold.red... | |
<|file_name|>3.28.cpp<|end_file_name|><|fim▁begin|>#include <string>
using std::string;<|fim▁hole|>
string sa[10]; // ten elements of empty string
int ia[10]; // ten elements of 0
int main() {
string sa2[10]; // ten elements of empty string
int ia2[10]; // ten elements of undefined value
}<|fim▁end|> | |
<|file_name|>products.ts<|end_file_name|><|fim▁begin|>const product = [
{
name: 'Bananas',
description: 'Yummy yellow fruit',
id: 'sku_GBJ2Ep8246qeeT',
price: 400,
image:
'https://images.unsplash.com/photo-1574226516831-e1dff420e562?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=cr... | price: 100,
image:
'https://images.unsplash.com/photo-1482012792084-a0c3725f289f?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=225&q=80', |
<|file_name|>anim-debug.js<|end_file_name|><|fim▁begin|>YUI.add('anim-base', function(Y) {
/**
* The Animation Utility provides an API for creating advanced transitions.
* @module anim
*/
/**
* Provides the base Anim class, for animating numeric properties.
*
* @module anim
* @submodule anim-base
*/
/**
* A... | */
var NUM = Number; |
<|file_name|>issue-44730.rs<|end_file_name|><|fim▁begin|>// check-pass
//! dox
#![deny(missing_docs)]
macro_rules! doc {
($e:expr) => (
#[doc = $e]
pub struct Foo;
)
}
doc!("a");
<|fim▁hole|>fn main() {}<|fim▁end|> | |
<|file_name|>decompose.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2015 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|>session_plus.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The Xorm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package xorm
import (
"database/sql"
"encoding/json"
"fmt"
"os"
"reflect"
"regexp"
"strings"... |
return sql
} |
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#<|fim▁hole|>from spack import *
class DhpmmF(MakefilePackage):
"""DHPMM_P:High-precision Matrix Multiplication w... | # SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use crate::rendering::*;
use crate::geometry::*;
/// IMPORTANT: Must form a star domain at its center
#[derive(Clone, Debug)]
pub struct Polygon {
pub corners: Vec<Point>, /// defined anti-clockwise
pub center: Point,
pub rot: Rotation, /// anti-clockwise a... |
implement_vertex!(PolygonVertex, corner1, corner2, center, rot, pos, color, fixed_pos); |
<|file_name|>low_high33_backtest.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
import tradeStrategy as tds
import sendEmail as se
import tradeTime as tt
import tushare as ts
import pdSql_common as pds
from pdSql import StockSQL
import numpy as np
import sys,datetime
from pydoc import describe
from ... | (all_temp_hist_df['LINEARREG_ANGLE14MA250']>long_turn_min_angle) &
(all_temp_hist_df['LINEARREG_ANGLE14MA60']>long_turn_min_angle) &
(all_temp_hist_df['LINEARREG_ANGLE14MA30']<1.0) &
|
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render, HttpResponseRedirect, redirect
from django.contrib.auth.decorators import login_required
from django.views.generic.edit import CreateView
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreation... | "formset": formset,
})
else:
raise PermissionDenied |
<|file_name|>imageQueryParser.py<|end_file_name|><|fim▁begin|>import random
class ImageQueryParser:
def __init__(self):
pass
def parse(self, query_string):
tab = query_string.split(" ")
last = tab[-1].lower()
is_random = False
index = 0
if last.startswith("-"):... | if self.is_random():
return random.randrange(0, 100)
else:
i = self.__index |
<|file_name|>sneaky_bastard_sword.js<|end_file_name|><|fim▁begin|>/**
* Created by ionagamed on 8/19/16.
*/
import { Card } from '../../../Card';
import { Item } from '../helpers/Item';
const id = 'sneaky_bastard_sword';
class _ extends Item {
constructor() {
super();<|fim▁hole|> this.hands = 1;... | this.id = id;
this.pack = 'pack1';
this.kind = 'treasure';
this.type = '1-handed'; |
<|file_name|>sum_of_two_integers_371.py<|end_file_name|><|fim▁begin|>"""
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.
Example:
Given a = 1 and b = 2, return 3.
"""
class Solution(object):
def getSum(self, a, b):
"""
:type a: int
:type b: i... | a, b = a^b, (a&b)<<1 |
<|file_name|>ex41.py<|end_file_name|><|fim▁begin|>"""
********************************************************************************
Learn Python the Hard Way Third Edition, by
Zed A. Shaw
ISBN: 978-0321884916
********************************************************************************
"""
import ran... | for i in range(0, snippet.count("@@@")):
param_count = random.randint(1,3)
param_names.append(', '.join(random.sample(WORDS, param_count))) |
<|file_name|>nvme_common.cc<|end_file_name|><|fim▁begin|>/*
eXokernel Development Kit (XDK)
Based on code by Samsung Research America Copyright (C) 2013
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by... | printf(RESET);
} |
<|file_name|>th_dlg.js<|end_file_name|><|fim▁begin|>tinyMCE.addI18n('th.advimage_dlg',{
tab_general:"\u0E17\u0E31\u0E48\u0E27\u0E44\u0E1B",
tab_appearance:"\u0E25\u0E31\u0E01\u0E29\u0E13\u0E30",
tab_advanced:"\u0E02\u0E31\u0E49\u0E19\u0E2A\u0E39\u0E07",
general:"\u0E17\u0E31\u0E48\u0E27\u0E44\u0E1B",
title:"\u0E0A... | misc:"\u0E40\u0E1A\u0E47\u0E14\u0E40\u0E15\u0E25\u0E47\u0E14",
|
<|file_name|>test_polygon.cpp<|end_file_name|><|fim▁begin|>#include <catch2/catch.hpp>
#include "libslic3r/Point.hpp"
#include "libslic3r/Polygon.hpp"
using namespace Slic3r;
SCENARIO("Converted Perl tests", "[Polygon]") {
GIVEN("ccw_square") {
Polygon ccw_square{ { 100, 100 }, { 200, 100 }, { 200, 200 }... | THEN("! is_counter_clockwise") {
REQUIRE(! cw_square.is_counter_clockwise()); |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, t... | # License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
############################################################################## |
<|file_name|>copy_qt_frameworks_mac.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2010-2015, 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:
#
# * Redistrib... | |
<|file_name|>node_item.py<|end_file_name|><|fim▁begin|>__author__ = 'djw'
class FieldNodeItem(object):
"""
An item built on a player's field board, held within a node/cell on that board
"""
def __init__(self):
self.cattle = 0
self.boars = 0
self.sheep = 0
self.grain = ... | pass
def score(self): |
<|file_name|>TwitchSource.py<|end_file_name|><|fim▁begin|>"""News source to send a notification whenever a twitch streamer goes live."""
import datetime
import logging
import discord
from dateutil import parser
from .AbstractSources import DataBasedSource
DOZER_LOGGER = logging.getLogger('dozer')
class TwitchSourc... | headers = {'Authorization': f"Bearer {self.access_token}",
"Client-ID": self.client_id}
else:
headers['Authorization'] = f"Bearer {self.access_token}" |
<|file_name|>bitcoin_hi_IN.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="hi_IN" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About HazeCoin</sour... | |
<|file_name|>react-tap-event-plugin-tests.ts<|end_file_name|><|fim▁begin|>/// <reference path="react-tap-event-plugin.d.ts"/>
import * as injectTapEventPluginAll from 'react-tap-event-plugin';
// since the export is a function, this is the only actual correct way:
import injectTapEventPluginRequire = require("react-t... | shouldRejectClick: function (lastTouchEventTimestamp, clickEventTimestamp) { |
<|file_name|>export.js<|end_file_name|><|fim▁begin|>const getExport = require('../services/get-export')
const getSubNav = require('../services/get-sub-nav')
const organisationUnit = require('../constants/organisation-unit')
const authorisation = require('../authorisation')
const workloadTypes = require('../constants/wo... | try {
authorisation.hasRole(req, [SUPER_USER, APPLICATION_SUPPORT, MANAGER])
} catch (error) { |
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Integration with the Rachio Iro sprinkler system controller."""
from abc import abstractmethod
from contextlib import suppress
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.switch import SwitchEntity
from hom... | |
<|file_name|>YeastType.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2006, 2007 Alessandro Chiari.
*
* This file is part of BrewPlus.
*
* BrewPlus 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;... | |
<|file_name|>filter.js<|end_file_name|><|fim▁begin|>/*!
* Jade - nodes - Filter
* Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Node = require('./node');
/**
* Initialize a `Filter` node with the given
* filter `name` and `block`.
*
* @param {Str... | /** |
<|file_name|>create_fakes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Fake data generator.
To use:
1. Install fake-factory.
pip install fake-factory
2. Create your OSF user account
3. Run the script, passing in your username (email).
::
python3 -m scripts.create_fakes --user fred@cos.io
Th... | import pytz
from faker import Factory |
<|file_name|>niconico.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
/*jshint -W100*/
'use strict';
/**
* ニコニコ動画ログインサンプル
*<|fim▁hole|> * 以下のusernameとpasswordを書き換えてから実行してください
*/
var username = 'hogehoge';
var password = 'fugafuga';
var client = require('../index');
console.info('ニコニコTOPページにアクセスします');
client... | |
<|file_name|>check_mrz_ocr.py<|end_file_name|><|fim▁begin|>import logging
def same_ocr_mrz(mrz_data, zones):
last_name_is_valid = mrz_data["last_name"][:25] == zones["last_name"]["value"][:25]
logging.debug(
"MRZ last name: {}; OCR last name: {}; matching {}".format(
mrz_data["last_name"]... | first_names_mrz = mrz_data["first_name"].split()
first_names_mrz_joined = "".join(first_names_mrz) |
<|file_name|>cmdline_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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/... | task, = ap.parse(['--local-scheduler', '--no-lock', 'FooBaseClass', '--FooBaseClass-x', 'xyz']) |
<|file_name|>generated_content.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/. */
//! The generated content assignment phase.
//!
//!... | } |
<|file_name|>install.py<|end_file_name|><|fim▁begin|># -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals<|fim▁hole|>from ._base import BaseCommand
from .options import dev, no_check, no_clean
class Command(BaseCommand):
name = "install"
description = "Generate Pip... |
from ..actions.install import install |
<|file_name|>node_group.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# This demonstrates a node group configurations.
#
# Node groups can be defined with the syntax "-g N@IP0,IP1-IP2,IP3".
# This says to create a group of N nodes with IPs IP0, IP1, ..., IP2,
# IP3. Run it with deterministic IPs causes lots o... | from optparse import make_option
import string |
<|file_name|>jade.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;
use parser::Parser;
struct Jade {
input_path: String
}
struct ParsedJade {
template: HashMap<String, String>
}
impl Jade {
fn new(input_path: String) -> Jade {
Jade {input_path: input_path}
}
<|fim▁hole|> }
}<... | fn parse() {
let parser = Parser::new(); |
<|file_name|>gitsetup.py<|end_file_name|><|fim▁begin|>from configparser import RawConfigParser
import os
import re
from subprocess import call, check_call, Popen, PIPE, STDOUT
import sys
from errors import Errors
from general import (
exists_and_is_directory, shellquote, print_stderr
)
from githelpers import has_o... | sys.exit(Errors.REPOSITORY_NOT_INITIALIZED)
def check_ref(self,ref): |
<|file_name|>get.js<|end_file_name|><|fim▁begin|>/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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.... | |
<|file_name|>ai.rs<|end_file_name|><|fim▁begin|>use level::*;
pub fn ai_step(level : &mut Level, player_pos: (i32,i32)) {
let mut x = 0;
let mut y = 0;
let mut enemies = Vec::with_capacity(16);
for line in &level.tiles {
for tile in line {
match tile.entity {
Some(E... | }
x+=1;
}
y+=1; |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md>
extern crate build;<|fim▁hole|><|fim▁end|> | fn main() {
build::link("mincore_downlevel", true)
} |
<|file_name|>job_runner.py<|end_file_name|><|fim▁begin|>import sys
from drone.actions.emr_launcher import launch_emr_task
from drone.actions.ssh_launcher import launch_ssh_task
from drone.job_runner.dependency_manager import dependencies_are_met
from drone.job_runner.job_progress_checker import check_running_job_progre... |
def run(job_config, schedule_time, settings):
settings.logger.info('Starting job "%s" "%s"' % (job_config.get('id'), schedule_time)) |
<|file_name|>path_to_enlightenment.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# The path to enlightenment starts with the following:
import unittest
from koans.about_asserts import AboutAsserts
from koans.about_strings import AboutStrings
from koans.about_none import AboutNone
from... | suite.addTests(loader.loadTestsFromTestCase(AboutMethodBindings))
suite.addTests(loader.loadTestsFromTestCase(AboutDecoratingWithFunctions))
suite.addTests(loader.loadTestsFromTestCase(AboutDecoratingWithClasses))
suite.addTests(loader.loadTestsFromTestCase(AboutInheritance)) |
<|file_name|>model_link_token_create_request_update.go<|end_file_name|><|fim▁begin|>/*
* The Plaid API
*
* The Plaid REST API. Please see https://plaid.com/docs/api for more details.
*
* API version: 2020-09-14_1.78.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
packa... | toSerialize["account_selection_enabled"] = o.AccountSelectionEnabled
} |
<|file_name|>CmsComparatorType.java<|end_file_name|><|fim▁begin|>/*
* This library is part of OpenCms -
* the Open Source Content Management System
*
* Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the ter... |
package org.opencms.gwt.shared.sort;
|
<|file_name|>format-money.js<|end_file_name|><|fim▁begin|>export default Ember.Handlebars.makeBoundHelper(function(price) {
var number = parseFloat(price/100).toFixed(2),
dollar = number.split('.')[0],
cents = number.split('.')[1],<|fim▁hole|> .split('').reverse().join('');
return '$' + doll... | dollars = dollar.split('').reverse().join('')
.replace(/(\d{3}(?!$))/g, '$1,') |
<|file_name|>next_power_of_2.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::basic::floats::PrimitiveFloat;
use malachite_base::num::basic::unsigneds::PrimitiveUnsigned;
use malachite_base::num::float::NiceFloat;
use malachite_base_test_util::bench::bucketers::{primitive_float_bucketer, unsigned_bit_bucketer};... | } |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate regex;
use regex::Regex;
const MIN_BOUND: u32 = 0;
const MAX_BOUND: u32 = 10;//((1u64 << 32) - 1) as u32;
#[derive(Debug)]
struct Range {
lo: u32,
hi: u32,
}
impl Range {
fn default() -> Range {
Range {
lo: MIN_BOUND,
... | fn next(&mut self) -> Option<u32> { |
<|file_name|>test_log_abort.py<|end_file_name|><|fim▁begin|>import logging
from unittest.mock import MagicMock, call
from ert_logging._log_util_abort import _log_util_abort
<|fim▁hole|> shutdown_mock = MagicMock()
monkeypatch.setattr(logging, "shutdown", shutdown_mock)
with caplog.at_level(logging.ERROR):
... | def test_log_util_abort(caplog, monkeypatch): |
<|file_name|>advancedFilter.js<|end_file_name|><|fim▁begin|>isc.VStack.create({
membersMargin: 30,
members: [
isc.VStack.create({
membersMargin: 30,
members: [
isc.DynamicForm.create({
ID: "filterForm",
width: 300,
... | }
}) |
<|file_name|>test_gamma.py<|end_file_name|><|fim▁begin|>from pytest import approx, raises
from fastats.maths.gamma import gammaln
def test_gamma_ints():
assert gammaln(10) == approx(12.801827480081469, rel=1e-6)
assert gammaln(5) == approx(3.1780538303479458, rel=1e-6)<|fim▁hole|>def test_gamma_floats():
... | assert gammaln(19) == approx(36.39544520803305, rel=1e-6)
|
<|file_name|>build.py<|end_file_name|><|fim▁begin|>import os
from torch.utils.ffi import create_extension
sources = ["src/lib_cffi.cpp"]
headers = ["src/lib_cffi.h"]
extra_objects = ["src/bn.o"]
with_cuda = True
this_file = os.path.dirname(os.path.realpath(__file__))
extra_objects = [os.path.join(this_file, fname) f... | headers=headers,
sources=sources,
relative_to=__file__,
with_cuda=with_cuda, |
<|file_name|>test_dogma_extra.py<|end_file_name|><|fim▁begin|>from unittest import TestCase
import dogma
from test_dogma_values import *
class TestDogmaExtra(TestCase):
def test(self):
ctx = dogma.Context()
slot = ctx.add_module(TYPE_125mmGatlingAutoCannonII)
loc = dogma.Location.module(... | self.assertEqual(len(capacitors), 1)
self.assertIn(ctx, capacitors) |
<|file_name|>vue-store.js<|end_file_name|><|fim▁begin|>import Vuex from 'vuex'
import store from './file-store'
export default new Vuex.Store({
state: {
characters: []
},<|fim▁hole|> characters: state => {
return state.characters;
},
fileNames: state => {
... | getters: { |
<|file_name|>LinkPortalPlugin.java<|end_file_name|><|fim▁begin|>package com.winthier.linkportal;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public final class LinkPortalPlugin extends JavaPlugin {
private final Lin... | reloadConfig(); |
<|file_name|>delta.rs<|end_file_name|><|fim▁begin|>//! Add a delta to a weave file.
use regex::Regex;
use std::{
collections::BTreeMap,
fs::{remove_file, rename},
io::{self, BufRead, BufReader, BufWriter, Write},
mem::replace,
path::PathBuf,
process::{Command, Stdio},
};
use crate::{header::He... | self.header.write(&mut weave_write.borrow_mut().dest)?;
let mut is_done = false;
let mut is_adding = false; |
<|file_name|>test-particle.py<|end_file_name|><|fim▁begin|>import pyxb.binding.generate
import pyxb.utils.domutils
from xml.dom import Node
import os.path
schema_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
'../schemas/particle.xsd'))
code = pyxb.binding.generate.GeneratePytho... | self.assertRaises(ExtraContentError, h01b.createFromDOM, dom.documentElement) |
<|file_name|>bootloader.py<|end_file_name|><|fim▁begin|>#
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2007 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This p... | retval += " --md5pass=\"%s\"" % self.md5pass
if self.upgrade:
retval += " --upgrade" |
<|file_name|>setting.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import sae.const
DEBUG = False
SITE_TITLE = u"博客标题"
SITE_SUB_TITLE = u"博客副标题"
SITE_KEYWORDS = u"博客关键字"
SITE_DECRIPTION = u"博客描述"
AUTHOR_NAME = u"博客作者" #显示在RSS订阅里面
#CONACT_MAIL = "xxx@gmail.com" #暂未用到
THEMES = ['octopress','admin']
LINK_BR... | {'text': u"爱简单吧", 'url': "http://www.ijd8.com", 'title': u"ijd8官方博客"},
{'text': u"YouBBS", 'url': "http://youbbs.sinaapp.com", 'title': u"ijd8支持论坛"},
] |
<|file_name|>chinj01.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 22 17:01:36 2019
@author: raf
"""
# IMPORT STUFF
from pdb import set_trace as stop
import copy
import numpy as np
from collections import OrderedDict
import string as st
import os
import pandas a... | |
<|file_name|>launch_default_experiments.py<|end_file_name|><|fim▁begin|>import argparse
import os
from config import *
def main():
parser = argparse.ArgumentParser(prog=os.path.basename(__file__))
globals().update(load_config(parser))
parser.add_argument('--dataset', choices=datasets, required=False)
... | for m in methods:
experiment_name = '%s.%s' % (d, m)
command = "qsub -N %s -l q=compute %s/scripts/default_experiment.sh %s %s" % (
experiment_name, os.environ['AUTOWEKA_PATH'], d, m) |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name' : 'Account Tax Cash Basis',
'version' : '1.1',<|fim▁hole|> 'sequence': 4,
'description': """
Add an option on tax to allow them to be ca... | 'author' : 'OpenERP SA',
'summary': 'Allow to have cash basis on tax', |
<|file_name|>ST_decrypt.java<|end_file_name|><|fim▁begin|>import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Ar... | /* Send chunk of data to device */
dumper.append(array2);
return a; |
<|file_name|>syscall_darwin.go<|end_file_name|><|fim▁begin|>// Copyright 2009,2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package syscall
import "unsafe"
func direntIno(buf []byte) (uint64, bool) {
return readInt(b... | } |
<|file_name|>integer-test.js<|end_file_name|><|fim▁begin|>import hbs from 'htmlbars-inline-precompile';
import { moduleForComponent, test } from 'ember-qunit';
moduleForComponent('advanced-form/integer', {
integration: true
});
test('Render component with attributes', function(assert) {
this.render(
hbs`{{adv... | ); |
<|file_name|>fake_service_repository.go<|end_file_name|><|fim▁begin|>// This file was generated by counterfeiter
package fakes
import (
"sync"
"github.com/cloudfoundry/cli/cf/api"
"github.com/cloudfoundry/cli/cf/api/resources"
"github.com/cloudfoundry/cli/cf/models"
)
type FakeServiceRepository struct {
PurgeSe... |
func (fake *FakeServiceRepository) PurgeServiceOfferingCallCount() int {
fake.purgeServiceOfferingMutex.RLock() |
<|file_name|>treeadmin.js<|end_file_name|><|fim▁begin|>/* Suppress initial rendering of result list, but only if we can show it with JS later on */
document.write('<style type="text/css">#result_list { display: none }</style>');
treeadmin.jQuery(function($){
// recolor tree after expand/collapse
$.extend($.fn.recol... | if($("#drag_line").length < 1) {
$("body").append('<div id="drag_line" style="position:absolute">line<div></div></div>'); |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#-*- coding:utf8 -*-
def crawl_folder(folder):
import os
os_objects = []
seen = set([folder])
for os_object_name in os.listdir(folder):
full_path = os.path.normpath(os.path.join(folder, os_object_name))
if not full_path in seen:
... |
class TCustomCounter: |
<|file_name|>test_packet.py<|end_file_name|><|fim▁begin|>import struct
import numpy
import io
import pickle
import pyctrl.packet as packet
def testA():
# test A
assert packet.pack('A','C') == b'AC'
assert packet.pack('A','B') == b'AB'
assert packet.pack('A','C') != b'AB'
assert packet.unpack_str... | assert packet.pack('M',vector) == struct.pack('<cIccIiiiiii', b'M', 2, b'V', b'I', 6, 1, 2, 3, 3, 4, 5)
|
<|file_name|>schemas.py<|end_file_name|><|fim▁begin|>from app.models import EMAIL_TYPES
from app.schema_validation.definitions import uuid, datetime, date
def email_types():
pattern = '|'.join(EMAIL_TYPES)
return {
"type": "string",
"pattern": pattern,
"validationMessage": "is not an ... | "type": "array", |
<|file_name|>juce_Viewport.cpp<|end_file_name|><|fim▁begin|>/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
... |
if (dx < 0)
|
<|file_name|>l476xx--xgen_syscfg.go<|end_file_name|><|fim▁begin|>// +build l476xx
package syscfg
// DO NOT EDIT THIS FILE. GENERATED BY xgen.
import (
"bits"
"mmio"
"unsafe"
"stm32/o/l476xx/mmap"
)
type SYSCFG_Periph struct {
MEMRMP RMEMRMP
CFGR1 RCFGR1
EXTICR [4]REXTICR
SCSR RSCSR
CFGR2 RCFGR2
SWPR ... | type RMEMRMP struct{ mmio.U32 }
|
<|file_name|>day_5.rs<|end_file_name|><|fim▁begin|>pub use tdd_kata::directed_graph_kata::day_5::{DirectedGraph, DirectedCycle};
pub use expectest::prelude::{be_equal_to, be_some, be_ok, be_err, be_true, be_false};
describe! directed_graph {
before_each {
let mut graph = DirectedGraph::default();
}
... | it "should add edges to a graph" {
graph.add_edge(1, 2); |
<|file_name|>api.js<|end_file_name|><|fim▁begin|>import * as React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import {<|fim▁hole|>
export default function Page() {
return <MarkdownDocs demos={demos} docs={docs} requireDemo={requireDemo} />;
}<|fim▁end|> | demos,
docs,
requireDemo,
} from '!@material-ui/markdown/loader!docs/src/pages/guides/api/api.md'; |
<|file_name|>CRecallRequestInfo.hpp<|end_file_name|><|fim▁begin|>// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually
#pragma once
#include <common/common.h>
#include <CRecallRequest.hpp>
START_ATF_NAMESPACE
namespace Info
{
using CReca... | using CRecallRequestRegist26_clbk = char (WINAPIV*)(struct CRecallRequest*, struct CPlayer*, struct CCharacter*, bool, bool, bool, CRecallRequestRegist26_ptr);
|
<|file_name|>write.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|>with open('stuck.pkl','rb') as pklfile:
stuck = pickle.load(pklfile)
TE.makeBasicTable(stuck,TE.workdir+'html/table.html',TE.webdir+'table.html')
TE.makeCSV(stuck,TE.webdir+'data.csv')
for basis in [-6,-5,-4,-3,-1,1,2]:
TE.makeJso... |
import TransferErrors as TE
import cPickle as pickle
|
<|file_name|>claimant_make_claim_command.go<|end_file_name|><|fim▁begin|>package stake
import "strings"
// MakeClaim lets a claimant make a claim about a subject.
func (claimant *Claimant) MakeClaim(subject string, claim string) (string, error) {
if strings.TrimSpace(subject) == "" {
return "Subject cannot be blan... | claimant.trackChange(ClaimMade{ClaimantID: claimant.ID, Subject: subject, Claim: claim})
return "Success", nil |
<|file_name|>actor.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/. */
/// General actor system infrastructure.
use devtools_traits::... | use std::raw::TraitObject;
use std::sync::{Arc, Mutex};
|
<|file_name|>SatisfyTool.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 @author Unai Alegre
*
* This file is part of R-CASE (Requirements for Context-Aware Systems Engineering), a module
* of Modelio that aids the requirements elicitation phase of a Context-Aware System (C-AS).
*
* R-CASE is free soft... | * You should have received a copy of the GNU General Public License
* along with Modelio. If not, see <http://www.gnu.org/licenses/>.
*
*/ |
<|file_name|>requirements.py<|end_file_name|><|fim▁begin|>"""Requirements specific to SQLAlchemy's own unit tests.
"""
from sqlalchemy import util
import sys
from sqlalchemy.testing.requirements import SuiteRequirements
from sqlalchemy.testing import exclusions
from sqlalchemy.testing.exclusions import \
skip, ... | @property
def psycopg2_native_hstore(self): |
<|file_name|>Appearance.py<|end_file_name|><|fim▁begin|># Generated from 'Appearance.h'
def FOUR_CHAR_CODE(x): return x
kAppearanceEventClass = FOUR_CHAR_CODE('appr')
kAEAppearanceChanged = FOUR_CHAR_CODE('thme')
kAESystemFontChanged = FOUR_CHAR_CODE('sysf')
kAESmallSystemFontChanged = FOUR_CHAR_CODE('ssfn')
kAEViewsF... | kThemeSoundUtilWindowActivate = FOUR_CHAR_CODE('uact') |
<|file_name|>helper.py<|end_file_name|><|fim▁begin|>import datetime
import io
import logging
import logging.handlers
import os
import sys
from collections import deque
from time import perf_counter
import colorlog
class LogHelper:
FORMATTER_COLOR = colorlog.ColoredFormatter('{log_color}{asctime} {name}: {levelna... | def __str__(self):
return self.stream.getvalue() |
<|file_name|>PointerData.ts<|end_file_name|><|fim▁begin|>/*
* Point
* Visit http://createjs.com/ for documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* f... | * @type Number
**/ |
<|file_name|>extern.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate fomat_macros;
#[test]
fn macro_use() {
let c: Vec<String> = vec!["a".into()];
let _ = fomat!(
"<ul>"
for x in &c { "<li>" (x) "</li>" }
"</ul>"
);<|fim▁hole|><|fim▁end|> | } |
<|file_name|>SampleLights.py<|end_file_name|><|fim▁begin|>"""This sample demonstrates some very simple lightning effects."""
import math
import d3d11
import d3d11x
from d3d11c import *
def heightCallback(x, z, byteIndex, data):
return data[byteIndex] * 0.03
class SampleLights(d3d11x.Frame):
def onCreate(sel... | for light in lights:
#World matrix. |
<|file_name|>Brocfile.js<|end_file_name|><|fim▁begin|><|fim▁hole|>/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var app = new EmberApp();
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different... | |
<|file_name|>slide.core.js<|end_file_name|><|fim▁begin|>var Drag={
obj: null,
leftTime: null,
rightTime: null,
init: function (o,minX,maxX,btnRight,btnLeft) {
o.onmousedown=Drag.start;
o.hmode=true;
if(o.hmode&&isNaN(parseInt(o.style.left))) { o.style.left="0px"; }
if(!o.hmode&&isNaN(parseInt(o.style.right)... | var c=$i("scrollcontent"); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.