prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>PrimitiveBatch.cpp<|end_file_name|><|fim▁begin|>#include "PrimitiveBatch.h"
#include "onut.h"
namespace onut
{
PrimitiveBatch::PrimitiveBatch()
{
// Create a white texture for rendering "without" texture
unsigned char white[4] = {255, 255, 255, 255};
m_pTexWhite = Texture::... | |
<|file_name|>resource_aws_ebs_snapshot_copy_test.go<|end_file_name|><|fim▁begin|>package aws
import (
"fmt"
"regexp"
"testing"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/helper/sc... | |
<|file_name|>DataDescriptionTest.java<|end_file_name|><|fim▁begin|>package test.janus.data;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.apache.log4j.Logger;
import org.ja... | public class DataDescriptionTest {
|
<|file_name|>xrd.py<|end_file_name|><|fim▁begin|>"""
Commands for X-ray Diffraction
Note that an XRD camera must be installed!
"""
def setup_epics_shutter(prefix='13MARCCD4:'):
"""
Setup Epics shutter for CCD camera
open /close pv = 13IDA:m70.VAL (SSA H WID)
open val = 0.080, close val = -0.020... | Parameters:
name (string): name of datafile
t (float): exposure time in seconds [default= 10]
ext (int or None): number for file extension |
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>module.exports = function (grunt) {<|fim▁hole|> grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-... | 'use strict';
grunt.loadNpmTasks('grunt-contrib-clean'); |
<|file_name|>form.js<|end_file_name|><|fim▁begin|>// $Id$
function CRMLookupCallBack()
{
ZCForm.triggerExternalOnUser(ExternalFieldName);
}
function SDPODLookupCallBack()
{
ZCForm.triggerExternalOnUser(ExternalFieldName);
}
function gDocImportFile(fileName, gDocId)
{
var importEl = $("#gFormName");
if($(imp... | { |
<|file_name|>do-no-args.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/lice... |
// Testing that we can drop the || in do exprs |
<|file_name|>test_forms.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Unit tests for embargo app admin forms.
"""
from __future__ import absolute_import
import six
# Explicitly import the cache from ConfigurationModel so we can reset it after each test
from config_models.models import cache
from django.... | |
<|file_name|>sal.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# cbus/protocol/application/sal.py - SAL interface
# Copyright 2012-2019 Michael Farrell <micolous+git@gmail.com>
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License... | |
<|file_name|>mmpmon.py<|end_file_name|><|fim▁begin|><|fim▁hole|>class mmpmon(object):
def __init__(self):
self.name = 'mmpmon'
self.nodefields = { '_n_': 'nodeip', '_nn_': 'nodename',
'_rc_': 'status', '_t_': 'seconds', '_tu_': 'microsecs',
'_br_': 'bytes_read', '_bw_': 'byt... | |
<|file_name|>fabsettings.py<|end_file_name|><|fim▁begin|>from os import path
try:
from lib.settings_build import Configure
except ImportError:
import sys
from os.path import expanduser, join
sys.path.append(join(expanduser("~"), 'workspace/automation/launchy'))
from lib.settings_build import Conf... | |
<|file_name|>cryptr.js<|end_file_name|><|fim▁begin|>/*
cryptr is a simple aes-256-gcm encrypt and decrypt module for node.js
Copyright (c) 2014 Maurice Butler
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 t... | return Buffer.concat([salt, iv, tag, encrypted]).toString("hex");
};
|
<|file_name|>external_process.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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
# ... | file_name = self.get_pid_file_name() |
<|file_name|>dao.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: UTF-8 -*-
from datetime import datetime
from stacosys.model.comment import Comment
TIME_FORMAT = "%Y-%m-%d %H:%M:%S"
def find_comment_by_id(id):
return Comment.get_by_id(id)
def notify_comment(comment: Comment):
comment.notif... | |
<|file_name|>keystone.py<|end_file_name|><|fim▁begin|>#
# 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
#
# Unless required by... | def is_over_limit(self, ex): |
<|file_name|>kubelet.go<|end_file_name|><|fim▁begin|>/*
Copyright 2015 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/LICENSE-2.0
Unless... | }
}) |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, url
from . import views
<|fim▁hole|>urlpatterns = patterns(
'',
url(r'^$', views.home, name='home'),
url(r'^(?P<pk>\d+)/edit/$', views.edit, name='edit'),
url(r'^new/$', views.new, name='new'),
)<|fim▁end|> | |
<|file_name|>useAuthScope.test.ts<|end_file_name|><|fim▁begin|>import { renderHook } from '@testing-library/react-hooks'
import { mocked } from 'ts-jest/utils'
import AuthScope from '../../utils/api/authScope'
import { getScopes } from '../../utils/auth/auth'
import useAuthScope from './useAuthScope'
jest.mock('../../... | |
<|file_name|>SerializerExceptionTest.java<|end_file_name|><|fim▁begin|>/*
* IIIFProducer
* Copyright (C) 2017 Leipzig University Library <info@ub.uni-leipzig.de>
*
* 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 Fr... | @Test |
<|file_name|>Alias.py<|end_file_name|><|fim▁begin|>"""scons.Node.Alias
Alias nodes.
This creates a hash of global Aliases (dummy targets).
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documen... | """An Alias is not recorded in .sconsign files"""
pass |
<|file_name|>0036_auto_20171117_0422.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.db import migrations, models
import django.contrib.postgres.fields.hstore
class Migration(migrations.Migration):
dependencies = [
('hs_core', '0035_remove_deprecated_fields'),
]
operations ... | model_name='creator',
name='identifiers',
field=django.contrib.postgres.fields.hstore.HStoreField(default={}),
), |
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>// 微信企业号SDK<|fim▁hole|><|fim▁end|> | package corp |
<|file_name|>TreasuryPainter.java<|end_file_name|><|fim▁begin|>/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* 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... |
public static void paint( Level level, Room room ) { |
<|file_name|>controllers.js<|end_file_name|><|fim▁begin|>angular.module('green-streak.controllers', ['LocalStorageModule'])
.controller('MenuController', function ($scope, $location, MenuService) {
// "MenuService" is a service returning mock data (services.js)
$scope.list = MenuService.all();
... | $scope.leftButtons = [ |
<|file_name|>client.rs<|end_file_name|><|fim▁begin|>extern crate env_logger;
extern crate mio;
extern crate tick;
use std::io::{self, Read, Write, stdout};
type Tcp = mio::tcp::TcpStream;
struct Client {
msg: &'static [u8],
pos: usize,
eof: bool,
}
impl Client {
fn new() -> Client {
Client {... | tick::Interest::Remove
} else if self.pos < self.msg.len() {
tick::Interest::ReadWrite
} else { |
<|file_name|>secret.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#coding:utf-8<|fim▁hole|>import sys,os
from toughportal.common import utils
import shutil
import time
import random
import ConfigParser
def gen_secret(clen=32):
rg = random.SystemRandom()
r = list('1234567890abcdefghijklmnopqrstuvwxyzABC... | |
<|file_name|>search-result-controller.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2012-2015 S-Core Co., Ltd.
*
* 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.a... | * @param {boolean} checked - item value
* @param {ViewCallback} callback - set a value in the view.
*/ |
<|file_name|>plumgrid_plugin.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 PLUMgrid, Inc. 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... | director_server_opts = [
cfg.StrOpt('director_server', default='localhost',
help=_("PLUMgrid Director server to connect to")), |
<|file_name|>0029_auto_20170213_1741.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2017-02-13 17:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('product', '0028_product_... | |
<|file_name|>nspawn.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
Manage nspawn containers
.. versionadded:: 2015.8.0
`systemd-nspawn(1)`__ is a tool used to manage lightweight namespace
containers. This execution module provides several functions to help manage
these containers.
.. __: http://www.free... | If the container is not running, don't start it |
<|file_name|>tracker-helper.cc<|end_file_name|><|fim▁begin|>/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
#include "ns3/uinteger.h"
#include "ns3/names.h"
#include "tracker-helper.h"
namespace ns3 {
TrackerHelper::TrackerHelper ()
{
m_factory.SetTypeId (Tracker::GetTypeId ());
SetAttribute ("P... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import sys
PY2 = sys.version_info[0] == 2
if PY2:
long = long
unicode = unicode
basestring = basestring
from urllib import quote_plus, unquote_plus, quote, unquote
from urlparse import parse_qsl
else:
long = int
... | |
<|file_name|>constellation.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 `Constellation`, Servo's Grand Central Station
... | |
<|file_name|>issue-11577.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.<|fim▁hole|>// option. This file may not be copied, modified, or distributed
// except according to t... | //
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>################################
# These variables are overwritten by Zenoss when the ZenPack is exported
# or saved. Do not modify them directly here.
# NB: PACKAGES is deprecated
NAME = 'ZenPacks.community.DistributedCollectors'
VERSION = '1.7'
AUTHOR = 'Egor Puzano... | # STOP_REPLACEMENTS
################################
# Zenoss will not overwrite any changes you make below here.
|
<|file_name|>partition_slice.rs<|end_file_name|><|fim▁begin|>//! Rearrange the elements in a slice according to a predicate.
/// Rearrange the elements of the mutable slice `s` such that elements where `p(t)` is true precede
/// the elements where `p(t)` is false.
///
/// The order of elements is not preserved, unless... | |
<|file_name|>parse_full_xml_report.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Usage: (python) parse_full_xml_report.py <.xml files>
Example:
<|fim▁hole|>import sys
WATSON_INDId = 30346
VENTER_INDId = 30342
THOUSAND_GENOME_popId = [13148, 13149, 13150, 16651, 16652, 16653, 16654, 16655];
de... | $ python parse_full_xml_report.py ncbi_full_report.xml
"""
|
<|file_name|>SttWatsonLogListener.py<|end_file_name|><|fim▁begin|>from stt_watson.SttWatsonAbstractListener import SttWatsonAbstractListener<|fim▁hole|> def __init__(self):
pass
def listenHypothesis(self, hypothesis):
print "Hypothesis: {0}".format(hypothesis)
def listenPayload(self, payloa... |
class SttWatsonLogListener(SttWatsonAbstractListener): |
<|file_name|>deployment_util.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 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/LICENSE-2.0... | return false
}
} |
<|file_name|>index.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity 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 versi... | { |
<|file_name|>fmt.rs<|end_file_name|><|fim▁begin|>use std::fmt::{self, Display};
pub(crate) fn display(fmt: impl Fn(&mut fmt::Formatter) -> fmt::Result) -> impl Display {
DisplayInvoke(fmt)<|fim▁hole|>
impl<T> Display for DisplayInvoke<T>
where
T: Fn(&mut fmt::Formatter) -> fmt::Result,
{
fn fmt(&self, form... | }
struct DisplayInvoke<T>(T); |
<|file_name|>bench1.rs<|end_file_name|><|fim▁begin|>#![feature(test)]
#![allow(unused_imports)]
extern crate test;
#[macro_use(s)]
extern crate ndarray;
use ndarray::{
Array,
Axis,
Ix,
Array1,
Array2,
};
use ndarray::{arr0, arr1, arr2};
use test::black_box;
#[bench]
fn iter_sum_1d_regular(bench:... | bench.iter(|| { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (C) 2011-2015 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
from __future__ import absolute_import
import re
import abc
class AddressbookE... | res.append((name, email))
return res |
<|file_name|>mrps.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
import configparser
import os
import shutil
from PyQt5 import QtWidgets
from PyQt5 import QtWebKitWidgets
from PyQt5 import QtCore
# Read config file
home_dir = os.path.expanduser("~")
conf_path = os.path.join(home_dir, ".config/mrps/... | |
<|file_name|>one_time_data.py<|end_file_name|><|fim▁begin|># Amara, universalsubtitles.org
#
# Copyright (C) 2017 Participatory Culture Foundation
#
# 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 Fo... | # along with this program. If not, see
# http://www.gnu.org/licenses/agpl-3.0.html.
import uuid |
<|file_name|>Libraries.SyntaxHighLighter.js<|end_file_name|><|fim▁begin|>/** @constructor */
Libraries.SyntaxHighlighter = function (){};
/** @type {Function} */
Libraries.SyntaxHighlighter.all;
/** @type {Object} */
Libraries.SyntaxHighlighter.defaults;
/** @type {Function} */
Libraries.SyntaxHighlighter.highlight;
/... | SyntaxHighlighter.regexLib.doubleQuotedString
/** @type {RegExp} */
SyntaxHighlighter.regexLib.multiLineCComments
/** @type {RegExp} */ |
<|file_name|>add_ad_customizer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2016 Google Inc. 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
#
# ... | if 'value' in response: |
<|file_name|>display_list_builder.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/. */
//! Constructs display lists from boxes.
use la... | /// Manages the information needed to construct the display list.
pub struct DisplayListBuilder<'a> {
ctx: &'a LayoutContext,
|
<|file_name|>udp-multicast.rs<|end_file_name|><|fim▁begin|>use std::{env, str};<|fim▁hole|> let mcast_group: Ipv4Addr = "239.0.0.1".parse().unwrap();
let port: u16 = 6000;
let any = "0.0.0.0".parse().unwrap();
let mut buffer = [0u8; 1600];
if env::args().count() > 1 {
let socket = UdpSock... | use std::net::{UdpSocket, Ipv4Addr};
fn main() { |
<|file_name|>panic-parens.rs<|end_file_name|><|fim▁begin|>// Fail macros without arguments need to be disambiguated in
// certain positions
// run-fail
// error-pattern:oops
// ignore-emscripten no processes<|fim▁hole|> match (panic!()) {
() => {}
}
}
}
}
fn main() {... |
fn bigpanic() {
while (panic!("oops")) {
if (panic!()) { |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013, Mirantis Inc
#
# 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|>data_loader.py<|end_file_name|><|fim▁begin|>import torch
import torchvision.transforms as transforms
import torch.utils.data as data
import os
import json
import pickle
import argparse
from PIL import Image
import numpy as np
from utils import Vocabulary
class CocoDataset(data.Dataset):
def __init__(... | self.vocab = pickle.load(open(vocab, 'rb'))
self.transform = transform
|
<|file_name|>category.js<|end_file_name|><|fim▁begin|>import {
categorySave,
categorySortSave,
categoryDel,
categoryGetById,
categoryGetList
} from '../platformApi';
const categoryModule = {<|fim▁hole|> },
mutations: {
setLoading(state, val) {
state.loading = val;
... | namespaced: true,
state: {
loading: false, |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|># Copyright 2013 IBM Corp.
# Copyright 2011 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... | obj_max_ver = api_version.APIVersionRequest(max_ver) |
<|file_name|>unittest.py<|end_file_name|><|fim▁begin|># (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible 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 ver... |
# Make coding more python3-ish |
<|file_name|>buffer.go<|end_file_name|><|fim▁begin|>package buffer
import (
"errors"
"sync"
"github.com/flynn/flynn/pkg/syslog/rfc5424"
)
// Buffer is a linked list that holds rfc5424.Messages. The Buffer's entire
// contents can be read at once. Reading elements out of the buffer does not
// clear them; messages... | if other.prev == nil {
// insert before other at head |
<|file_name|>processing.js<|end_file_name|><|fim▁begin|>/**
* Image Processing
*
* In imaging science, image processing is any form of signal processing for
* which the input is an image, such as a photograph or video frame; the output
* of image processing may be either an image or a set of characteristics or
*... | * - http://en.wikipedia.org/wiki/Image_processing
*/ |
<|file_name|>listing.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright © 2012-2016 Roberto Alsina and others.
# 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
# Software without res... | # if called from "include", set the source
if 'source' in self.options:
node.attributes['source'] = self.options['source'] |
<|file_name|>extern-types-not-sync-send.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
... | // Copyright 2017 The Rust Project Developers. See the COPYRIGHT |
<|file_name|>adminwidget.js<|end_file_name|><|fim▁begin|>/**
* Created by hbzhang on 8/7/15.
*/
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Widget = mongoose.model('Widget'),
Upload = mongoose.model('Upload'),
_ = require('lodash'),
grid = require('gridfs-stream... | |
<|file_name|>day5.rs<|end_file_name|><|fim▁begin|>extern crate crypto;
use crypto::md5::Md5;
use crypto::digest::Digest;
fn main() {
let mut sh = Md5::new();
let seed = "reyedfim";
let mut key = 0;
let mut code_length = 0;
while code_length < seed.len() {
sh.input(seed.as_bytes());
... | fn print_md5_hash(key: &i32, md5: &[u8]) {
print!("key: {}, MD5: ", key);
for i in 0..16 {
print!("{:02X}", md5[i]); |
<|file_name|>InfinispanServerClusterConfigurationProperties.java<|end_file_name|><|fim▁begin|>package org.tuxdevelop.spring.batch.lightmin.server.cluster.configuration;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.Nes... | static class RepositoryConfigurationProperties { |
<|file_name|>test_batch_cast.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
* Martin Renou *
* Copyright (c) QuantSta... | using uint32_batch = xsimd::batch<uint32_t>;
using int64_batch = xsimd::batch<int64_t>; |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import click<|fim▁hole|>from config import GlobalConfig
def mixer(full_story_list, sample_number):
"""Selects a random sample of stories from the full list to display to the user.
Number of stories is set in config.py
Todo: Add argument support for number ... | import newsfeeds
import random
import sys |
<|file_name|>ActionButton.test.js<|end_file_name|><|fim▁begin|>import React from 'react';
import ActionButton from './ActionButton';
import renderer from 'react-test-renderer';
describe('floating action button', () => {
it('renders initial view', () => {
const component = renderer.create(
<ActionButton />... | ); |
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>// Package rpctest provides a hcashd-specific RPC testing harness crafting and<|fim▁hole|>// arbitrary set of outputs.
//
// This package was designed specifically to act as an RPC testing harness for
// `hcashd`. However, the constructs presented are general enough to b... | // executing integration tests by driving a `hcashd` instance via the `RPC`
// interface. Each instance of an active harness comes equipped with a simple
// in-memory HD wallet capable of properly syncing to the generated chain,
// creating new addresses, and crafting fully signed transactions paying to an |
<|file_name|>DefaultScriptParser.java<|end_file_name|><|fim▁begin|>/*
* Copyright DbMaintain.org
*
* 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/... | * @param scriptReader the reader that will provide the script content, not null
* @param initialParsingState the inial state when starting to parse a script, not null |
<|file_name|>transformcoordinates.js<|end_file_name|><|fim▁begin|>var proj4 = require('proj4');
var transformCoordinates = function transformCoordinates(fromProjection, toProjection, coordinates) {<|fim▁hole|> [
'EPSG:3006',
'+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs'
... | proj4.defs([ |
<|file_name|>Escape.java<|end_file_name|><|fim▁begin|>package Escape;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Insets;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionP... | private static final long serialVersionUID = -3689415169655758824L;
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from user.models import State
from django.utils.translation import ugettext as _
## debug
from pprint import pprint
# Create your models here.
class Party(models.Model):
short_name = models.CharField(max_length=10, default='***')
full_... | #logo = models.CharField(max_length=50, default='')
#president = models.CharField(max_length=50, default='')
#founded_by = models.CharField(max_length=50, default='') |
<|file_name|>miniobject.rs<|end_file_name|><|fim▁begin|>use ffi::*;
use std::mem;
use std::ptr;
use reference::Reference;
pub struct MiniObject{
miniobject: *mut GstMiniObject,
}
impl Drop for MiniObject{
fn drop(&mut self){
unsafe{
gst_mini_object_unref(self.miniobject);
}
}
}
<|fim▁hole|>pub enu... | #[repr(u32)]
#[derive(Copy,Clone,Debug)] |
<|file_name|>tableau_test.go<|end_file_name|><|fim▁begin|>package game
import (
"fmt"
"testing"
"github.com/dougfort/gocards"
)
type moveSet map[EvaluatedMoveType]struct{}
var (
testTableaus = []Tableau{
// 0
Tableau{},
// 1
Tableau{
StackType{Cards: gocards.Cards{aceOfClubs}},
},
// 2
Tablea... | }
return result |
<|file_name|>html2html.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
... | extern crate html5ever;
use std::io;
use std::default::Default; |
<|file_name|>webcrawler.py<|end_file_name|><|fim▁begin|>import requests
from bs4 import BeautifulSoup
def trade_spider(max_pages):
page = 1
while page <= max_pages:
url = "https://thenewboston.com/videos.php?cat=98&video=20144" #+ str(page)
source_code = request.get(url)
plain_text = so... | |
<|file_name|>archive.cpp<|end_file_name|><|fim▁begin|>/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can r... | abmpStream->seek(0);
} else {
warning("RIFXArchive::readAfterburnerMap(): Can not open dump file %s", buf); |
<|file_name|>backup_sync_controller.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017, 2020 the Velero contributors.
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/licens... | podVolumeBackup.Labels[velerov1api.BackupUIDLabel] = string(backup.UID) |
<|file_name|>scroll-mask.tsx<|end_file_name|><|fim▁begin|>import React, { FC, useRef, RefObject, useEffect } from 'react'
import classNames from 'classnames'
import { animated, useSpring } from '@react-spring/web'<|fim▁hole|>
export type ScrollMaskProps = {
scrollTrackRef: RefObject<HTMLElement>
}
export const Scrol... | import { useThrottleFn } from 'ahooks'
const classPrefix = `adm-scroll-mask` |
<|file_name|>graphene_functions.hpp<|end_file_name|><|fim▁begin|>//
// graphene_functions.hpp
// graphenePFC
//
// Created by Rachel Zucker on 8/15/16.
// Copyright © 2016 Rachel Zucker. All rights reserved.
//
<|fim▁hole|>
// an inital condition that produces an AC circle inside an AB matrix
void InitialCircle(mat... | #ifndef graphene_functions_hpp
#define graphene_functions_hpp
#include "matrix_types.hpp" |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate octavo;<|fim▁hole|>
mod kdf;<|fim▁end|> | |
<|file_name|>surveyCaches.js<|end_file_name|><|fim▁begin|>import { Mongo } from 'meteor/mongo';
const SurveyCaches = new Mongo.Collection('SurveyCaches');
SimpleSchema.debug = true;
SurveyCaches.schema = new SimpleSchema({
title: {
type: String,
},
version: {
type: Number,<|fim▁hole|> autoValue() {
... | optional: true, |
<|file_name|>test_except.py<|end_file_name|><|fim▁begin|>"""Tests exceptions and DB-API exception wrapping."""
from sqlalchemy import exc as sa_exceptions
from sqlalchemy.test import TestBase
# Py3K
#StandardError = BaseException
# Py2K
from exceptions import StandardError, KeyboardInterrupt, SystemExit
# end Py2K
cl... | pass
class OperationalError(DatabaseError): |
<|file_name|>bmp180.py<|end_file_name|><|fim▁begin|>"""
This program handles the communication over I2C between a Raspberry Pi and a
BMP180 Temperature/Pressure sensor.
Made by: MrTijn/Tijndagamer
Copyright 2015-2017
Released under the MIT license.
"""
import smbus
import math
from time import sleep
class bmp180:
... | B6 = B5 - 4000
X1 = (self.calB2 * (B6 * B6 / math.pow(2, 12))) / math.pow(2, 11) |
<|file_name|>deriving-span-PartialOrd-struct.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http:... | |
<|file_name|>OpenEngSBSecurityException.java<|end_file_name|><|fim▁begin|>/**
* Licensed to the Austrian Association for Software Tool Integration (AASTI)
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. ... | * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<|file_name|>list.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | a = [int(i) for i in input().split()]
print(sum(a)) |
<|file_name|>density.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Formulas for density calculation.
"""
from math import log10
from colormath.density_standards import (
ANSI_STATUS_T_BLUE,
ANSI_STATUS_T_GREEN,
ANSI_STATUS_T_RED,
VISUAL_DENSITY_THRESH,
ISO_VISUAL,
)
def ansi_density... | |
<|file_name|>createVerge1SmallFntConverter.js<|end_file_name|><|fim▁begin|>"use strict"
const createTileGridConverter = require(`./createTileGridConverter`)
const colorDepth = require(`./colorDepth`)<|fim▁hole|> const converter = createTileGridConverter({
tileWidth: 7,
tileHeight: 9,
columns: 19,
tile... |
module.exports = ({palette, images}) => { |
<|file_name|>utility.js<|end_file_name|><|fim▁begin|>exports.createSession = function(req, res, newUser) {
return req.session.regenerate(function() {
req.session.user = newUser;
// res.redirect('/');
});
};
exports.isLoggedIn = function(req, res) {
// return req.session ? !!req.session.user : false... | return req.user ? !!req.user : false; |
<|file_name|>ContestManagerModel_.java<|end_file_name|><|fim▁begin|>package org.iatoki.judgels.uriel.contest.manager;
import org.iatoki.judgels.play.model.AbstractModel_;
import javax.annotation.Generated;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
@Gene... | @StaticMetamodel(ContestManagerModel.class) |
<|file_name|>impl_fake.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
#
# 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 Lice... | while not done.ready():
eventlet.greenthread.sleep(1)
cur_time = time.time() |
<|file_name|>browsingcontext.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 euclid::TypedSize2D;
use msg::constellation_msg::... | let browsing_context_id = match self.stack.pop() {
Some(browsing_context_id) => browsing_context_id,
None => return None,
}; |
<|file_name|>v28_to_v29.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8
import sys
import argparse<|fim▁hole|>import anvio.utils as utils
import anvio.terminal as terminal
from anvio.errors import ConfigError
run = terminal.Run()
progress = terminal.Progress()
current_version, next_version... |
import anvio.db as db |
<|file_name|>remove_element_inplace.py<|end_file_name|><|fim▁begin|>#! /usr/local/bin/python -u
# Given an array and a value, remove all instances of that value in place and return the new length.
# The order of elements can be changed. It doesn't matter what you leave beyond the new length.
class Solution:
# @par... | |
<|file_name|>grid.rs<|end_file_name|><|fim▁begin|>#[derive(Debug)]
pub struct Grid<T: Clone> {
data: Vec<T>,
pub x: usize,
pub y: usize,
}
impl<T: Clone> Grid<T> {
pub fn new(x: usize, y: usize, initial: T) -> Grid<T> {
Grid::<T> {
x: x,
y: y,
data: vec![init... | data: example,
}; |
<|file_name|>test_reports.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Tests for the Shopping Cart Models
"""
import datetime
from textwrap import dedent
import pytest
import pytz
from django.conf import settings
from mock import patch
import six
from six import StringIO
from six import text_type
fro... |
def test_refund_report_rows(self):
report = initialize_report("refund_report", self.now - self.FIVE_MINS, self.now + self.FIVE_MINS) |
<|file_name|>monacoComponent.tsx<|end_file_name|><|fim▁begin|>import * as React from "react";
import { MonacoManager } from "../tools/monacoManager";
import { GlobalState } from "../globalState";
require("../scss/monaco.scss");
interface IMonacoComponentProps {
className: string;
refObject: React.RefO... | |
<|file_name|>index.story.js<|end_file_name|><|fim▁begin|>import React from 'react';
import {
header,
tabs,
tab,
description,
importExample,
title,
divider,
example,
playground,
api,
testkit,
} from 'wix-storybook-utils/Sections';
import { storySettings } from '../test/storySettings';
import Star... | }), |
<|file_name|>yamale.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from .schema import Schema
from .yamale_error import YamaleError
def make_schema(path=None, parser='PyYAML', validators=None, content=None):
# validators = None means use default.
# Import readers here so we can get version information ... | # First document is the base schema |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate proc_macro;
extern crate syn;
#[macro_use]
extern crate quote;
use proc_macro::TokenStream;
#[proc_macro_derive(UnitAdd)]
pub fn unit_add(input: TokenStream) -> TokenStream {
// Construct a string representation of the type definition
let s = input... | #[proc_macro_derive(UnitSum)] |
<|file_name|>AuthorizingAnnotationMethodInterceptor.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 licen... |
import java.lang.annotation.Annotation;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.