prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>remapping.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
def callback_function(data):
#FILL IN HERE
global publisher_name, msg
msg.linear.x = -data.linear.x
msg.angular.z = -data.angular.z
publisher_name.publish(msg)
def subscri... | rospy.Subscriber('turtle1/cmd_vel', Twist, callback_function) |
<|file_name|>searchView.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Deepin, Inc.
# 2011 Wang Yong
#
# Author: Wang Yong <lazycat.manatee@gmail.com>
# Maintainer: Wang Yong <lazycat.manatee@gmail.com>
#
# This program is free software: you can ... | # GNU General Public License for more details.
# |
<|file_name|>BlockJukeBox.java<|end_file_name|><|fim▁begin|>package net.minecraft.src;
public class BlockJukeBox extends BlockContainer
{
protected BlockJukeBox(int par1)
{
super(par1, Material.wood);
this.setCreativeTab(CreativeTabs.tabDecorations);
}
/**
* Called upon block acti... | return false;
}
else |
<|file_name|>Datasource.java<|end_file_name|><|fim▁begin|>package Cheiron.Datasource;
import java.util.Map;
public abstract class Datasource {
<|fim▁hole|> public abstract Map<String, Map<String, String>> getData() throws Exception;
public Object get(String field) throws Exception {
return this.getClass().getDecl... | |
<|file_name|>test_cfgparser.py<|end_file_name|><|fim▁begin|>import ConfigParser
import StringIO
from test_support import TestFailed, verify
def basic(src):
print "Testing basic accessors..."
cf = ConfigParser.ConfigParser()
sio = StringIO.StringIO(src)
cf.readfp(sio)
L = cf.sections()
L.sort(... | else:
raise TestFailed("Failed to catch expected " + exctype.__name__)
|
<|file_name|>WizardPanelNotFoundException.java<|end_file_name|><|fim▁begin|>package fr.inserm.ihm;
public class WizardPanelNotFoundException extends RuntimeException {
/**
*
*/
private static final long serialVersionUID = -1947507532224487459L;
public WizardPanelNotFoundException() {
super();
}<|fim▁hole|... | |
<|file_name|>scenes.rs<|end_file_name|><|fim▁begin|>// +--------------------------------------------------------------------------+
// | Copyright 2016 Matthew D. Steele <mdsteele@alum.mit.edu> |
// | |
// | This file is part of Sy... | Ast::Slide(UGRENT, (220, 304), false, true, 1.25), |
<|file_name|>aldryn_config.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from aldryn_client import forms
<|fim▁hole|> plugin_name = forms.CharField('Plugin name', initial='Facebook Comments')
plugin_template = forms.CharField('Plugin Template', initial='djangoc... | class Form(forms.BaseForm):
plugin_module = forms.CharField('Plugin module name', initial='Generic') |
<|file_name|>bitcoin_mn.ts<|end_file_name|><|fim▁begin|><TS language="mn" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Create a new address</source>
<translation>Шинэ хаяг нээх</translation>
</message>
<message>
<source>&New</source>
<transl... | </message>
<message>
<source>Error</source> |
<|file_name|>__init__.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 applicable law or agr... |
def nullable(property_schema): |
<|file_name|>jquery-ui.js<|end_file_name|><|fim▁begin|>/*! jQuery UI - v1.10.3 - 2013-05-03
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.effe... | return this.element.find( "ol,ul" ).eq( 0 );
}, |
<|file_name|>test_run_info.py<|end_file_name|><|fim▁begin|>from unittest import TestCase
from micall.drivers.run_info import RunInfo
from micall.drivers.sample import Sample
from micall.drivers.sample_group import SampleGroup
class RunInfoTest(TestCase):
def test_get_all_samples(self):<|fim▁hole|> run_inf... | expected_fastq_paths = ['1a_R1_001.fastq',
'1b_R1_001.fastq',
'2_R1_001.fastq']
|
<|file_name|>app.e2e-spec.ts<|end_file_name|><|fim▁begin|>import { AppPage } from './app.po';
import { browser, logging } from 'protractor';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display welcome message', () => {
page.navi... | |
<|file_name|>DependencyInjectionAspectSupport.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2002-2004 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
... | |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python2
# vim: set fileencoding=utf-8
from dateutil.parser import parse
from subprocess import check_output
from shutil import copy
import datetime
import sys
import os.path
import isoweek
DATE_FORMAT = '%Y%m%d'
START = """\documentclass[a4paper,oneside,dr... | \\newcommand{\workingDate}{\\today}
\input{preambule} |
<|file_name|>local.rs<|end_file_name|><|fim▁begin|>extern crate log;
extern crate tempfile;
use boxfuture::{BoxFuture, Boxable};
use fs::{self, GlobMatching, PathGlobs, PathStatGetter, Snapshot, StrictGlobMatching};
use futures::{future, Future, Stream};
use std::collections::BTreeSet;
use std::os::unix::process::Exit... | FallibleExecuteProcessResult {
stdout: as_bytes(""),
stderr: as_bytes(""), |
<|file_name|>generate_null_dataset.py<|end_file_name|><|fim▁begin|># This file is part of jacqq.py
# Copyright (C) 2015 Saman Jirjies - sjirjies(at)asu(dot)edu.
#
# 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 Soft... | csv_file.close() |
<|file_name|>bls_bft_replica_plenum.py<|end_file_name|><|fim▁begin|>from typing import Optional
from common.serializers.serialization import state_roots_serializer
from crypto.bls.bls_bft import BlsBft
from crypto.bls.bls_bft_replica import BlsBftReplica
from crypto.bls.bls_multi_signature import MultiSignature, Multi... | self.state_root_serializer = state_roots_serializer
self.metrics = metrics
def _can_process_ledger(self, ledger_id): |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod container;
pub mod content;<|fim▁hole|><|fim▁end|> | pub mod repository; |
<|file_name|>test_financial_move.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2017 KMEE
# Hendrix Costa <hendrix.costa@kmee.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp.addons.financial.tests.financial_test_classes import \
FinancialTestCase
class ... | action = financial_move_id.action_view_financial('2pay')
self.assertEqual( |
<|file_name|>webpack.config.prod.js<|end_file_name|><|fim▁begin|>'use strict'
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const ManifestPlugin = require('webpack-manifest-plugin... | |
<|file_name|>searchUserIDs.ts<|end_file_name|><|fim▁begin|>import { MethodEnum } from '@algolia/requester-common';
import { RequestOptions } from '@algolia/transporter';
import { SearchClient, SearchUserIDsOptions, SearchUserIDsResponse } from '../..';
export const searchUserIDs = (base: SearchClient) => {
return (... | requestOptions?: SearchUserIDsOptions & RequestOptions
): Readonly<Promise<SearchUserIDsResponse>> => {
return base.transporter.read( |
<|file_name|>gyp_node.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import glob
import os
import shlex
import sys
script_dir = os.path.dirname(__file__)
node_root = os.path.normpath(os.path.join(script_dir, os.pardir))
sys.path.insert(0, os.path.join(node_root, 'tools', 'gyp', 'pylib'))
import gyp
# Directo... |
# GYP bug. |
<|file_name|>msgblock_test.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2013-2015 The btcsuite developers
// Copyright (c) 2015 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package wire_test
import (
"bytes"
"io"
"reflect"
"testing"
... | 0xcd, 0xb6, 0x06, 0xe8, 0x57, 0x23, 0x3e, 0x0e, // MerkleRoot [36]
0x98, 0x20, 0x51, 0xfd, 0x1e, 0x4b, 0xa7, 0x44, |
<|file_name|>target_list.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2014 Travis DeWolf
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 ... | self.target_index += 1
self.set_target() |
<|file_name|>utils.js<|end_file_name|><|fim▁begin|>'use strict';
var crypto = require('crypto');
exports.typeOf = function(obj) {
var classToType;
if (obj === void 0 || obj === null) {
return String(obj);
}
classToType = {
'[object Boolean]': 'boolean',
'[object Number]': 'number',
'[object Str... | sessionToken: (currentUser && currentUser.getSessionToken()) || (req && req.sessionToken) |
<|file_name|>browser_scanbox.py<|end_file_name|><|fim▁begin|># Copyright (C) 2015 Will Metcalf william.metcalf@gmail.com
#
# 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 t... | |
<|file_name|>dtools.js<|end_file_name|><|fim▁begin|>function handleDialogRequest(dialogName, xhr, status, args) {
if (!args.success) {
PF(dialogName).jq.effect("shake", {times : 5}, 100);
} else {
PF(dialogName).hide();<|fim▁hole|>}<|fim▁end|> | } |
<|file_name|>vec-slices.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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|>extensions.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from notifications_utils.clients.redis.redis_client import RedisClient
from notifications_utils.clients.zendesk.zendesk_client import ZendeskClient
antivirus_client = AntivirusClient()
zendesk_client = ZendeskClient()
redis_client = RedisClient()<|fim... | from notifications_utils.clients.antivirus.antivirus_client import (
AntivirusClient,
) |
<|file_name|>test_basic_user_interaction_pending.py<|end_file_name|><|fim▁begin|>import time
from unittest import TestCase
from formalign.settings import CHROME_DRIVER, SERVER_URL
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import pyperclip
from helper_funcs.helpers_test import file_t... | consensus_meta = self.browser.find_elements_by_xpath('//h3[@class="query_seq_meta bg-color-body"]')[-1]
self.assertEqual(consensus_meta.text, 'consensus 70%:')
# She is happy with the result, sees a "Render" button and clicks it. |
<|file_name|>PlainCalendarDayNamesHeader.js<|end_file_name|><|fim▁begin|>import CalendarDayNamesHeader from "../base/CalendarDayNamesHeader.js";
import { template } from "../base/internal.js";
import { fragmentFrom } from "../core/htmlLiterals.js";
/**
* CalendarDayNamesHeader component in the Plain reference design ... | white-space: nowrap;
}
|
<|file_name|>DeregisterEcsClusterResult.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2014-2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is... | * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR |
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate nix;
#[macro_use]
extern crate lazy_static;
extern crate libc;
extern crate rand;
extern crate tempdir;
extern crate tempfile;
extern crate nix_test as nixtest;
mod sys;
mod test_fcntl;
#[cfg(target_os = "linux")]
mod test_mq;
mod test_net;
m... |
use nixtest::assert_size_of;
use std::os::unix::io::RawFd; |
<|file_name|>ember-cli-build-options.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* Configuration options for Ember CLI App used to manage broccoli build tree for DataHub web.
* Returns a method to import build dependencies and an options
* object with configuration attributes
*
* @param {string} env curren... | |
<|file_name|>align.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
"""
Copyright 2017 Ryan Wick (rrwick@gmail.com)
https://github.com/rrwick/Porechop
Porechop makes use of C++ functions which are compiled in cpp_functions.so. This module uses ctypes
to wrap them in similarly named Python functions.
This file ... |
C_LIB.adapterAlignment.argtypes = [c_char_p, # Read sequence
c_char_p, # Adapter sequence
c_int, # Match score |
<|file_name|>basicTimeSeries.js<|end_file_name|><|fim▁begin|>if (Highcharts != null) {
if (Highcharts.charts == null) {
Highcharts.charts = {};
}
if (Highcharts.getChart == null) {
Highcharts.getChart = function(chartId, containerId) {
var opts = Highcharts.charts[chartId];
opts.chart.renderTo = containe... | xAxis: { |
<|file_name|>spiflash.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)]
use core::cmp;
use csr;
const CMD_PP: u8 = 0x02;
const CMD_WRDI: u8 = 0x04;
const CMD_RDSR: u8 = 0x05;
const CMD_WREN: u8 = 0x06;
const CMD_SE: u8 = 0xd8;
const PIN_CLK: u8 = 1 << 1;
const PIN_CS_N: u8 = 1 << 2;
const PIN_DQ_I: u8 = 1 <<... | let mut sr = 0; |
<|file_name|>drag-and-drop.js<|end_file_name|><|fim▁begin|>/**
* @license Copyright 2017 Google Inc. All Rights Reserved.<|fim▁hole|> */
'use strict';
/**
* Manages drag and drop file input for the page.
*/
class DragAndDrop {
/**
* @param {function(!File)} fileHandlerCallback Invoked when the user chooses a n... | * 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 applicable law or agreed to in writing, software distributed under the License is d... |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for auth0-lock 10.9
// Project: http://auth0.com
// Definitions by: Brian Caruso <https://github.com/carusology>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="auth0-js/v7" />
interface Auth0LockAddition... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The rust-gobject authors.
//<|fim▁hole|>// 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
// option. Thi... | |
<|file_name|>20.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export { LocationCompanyFilled20 as default } from "../../"; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 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/licenses/LI... | }
}
|
<|file_name|>header.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.apache.org/lic... | fn parse_name_value_directive(line: &str,
directive: ~str) -> Option<~str> { |
<|file_name|>node_provider.py<|end_file_name|><|fim▁begin|>import random
import threading
from collections import defaultdict
import logging
import time
from typing import Any, Dict, List, Optional
from ray.autoscaler.node_provider import NodeProvider
from ray.autoscaler.tags import TAG_RAY_CLUSTER_NAME, TAG_RAY_NODE_... | |
<|file_name|>vDialing.py<|end_file_name|><|fim▁begin|># vDial-up client
# Copyright (C) 2015 - 2017 Nathaniel Olsen
# 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 Licens... | |
<|file_name|>lifetime-update.rs<|end_file_name|><|fim▁begin|>#![feature(type_changing_struct_update)]
#![allow(incomplete_features)]
#[derive(Clone)]
struct Machine<'a, S> {
state: S,
lt_str: &'a str,
common_field: i32,
}
#[derive(Clone)]
struct State1;
#[derive(Clone)]
struct State2;
fn update_to_state2... | let s = String::from("hello");
let m1: Machine<State1> = Machine {
state: State1,
lt_str: &s, |
<|file_name|>qualitycontrol_analysesrepeated.py<|end_file_name|><|fim▁begin|>from dependencies.dependency import getToolByName
from lims.browser import BrowserView
from dependencies.dependency import ViewPageTemplateFile
from lims import bikaMessageFactory as _
from lims.utils import t
from lims.utils import formatDate... |
datalines.append(dataline)
|
<|file_name|>cropTouch.js<|end_file_name|><|fim▁begin|>"use strict";<|fim▁hole|> this.id = id || 0;
this.x = x || 0;
this.y = y || 0;
this.dragHandle = null;
}
return CropTouch;
}());
exports.CropTouch = CropTouch;
//# sourceMappingURL=cropTouch.js.map<|fim▁end|> | var CropTouch = (function () {
function CropTouch(x, y, id) { |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>import re
from django.db import models, transaction
from django.utils import timezone
from django.utils.six import iteritems, with_metaclass
from django.utils.translation import ugettext_lazy as _
from django.core.cache import cache
from django.core.exceptions import S... | HVM = frozenset([Hypervisor_KVM, Hypervisor_BHYVE])
class Meta:
app_label = 'vms' |
<|file_name|>Volume.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* ... | */ |
<|file_name|>parser.rs<|end_file_name|><|fim▁begin|>/**
# AST DEFINITION
## Symbols
⁞literal⁞ means the token must be a literal, but it also has additional
mandatory hygiene metadata that must be carried along (i.e. the token
cannot be synthesized in the macro).
«bool» one of the literal true or false
... | buffer: { $body:block $($rest:tt)* }, |
<|file_name|>FileIterator.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2009 University of Southern California and
* Andrew D. Smith
*
* Authors: Andrew D. Smith
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Genera... | using std::istream;
using std::vector;
using std::string; |
<|file_name|>DfaFromNfa.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 Matthew Timmermans
*
* 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/license... | |
<|file_name|>driver.rs<|end_file_name|><|fim▁begin|>use libc::c_int;
use std::ffi::CString;
use std::ptr::null_mut;
use std::sync::{Once, ONCE_INIT};
use utils::{_string, _last_null_pointer_err};
use raster::Dataset;
use raster::types::GdalType;
use gdal_major_object::MajorObject;
use metadata::Metadata;
use gdal_sys::... | size_x: isize,
size_y: isize,
bands: isize, |
<|file_name|>autoComplete.spec.js<|end_file_name|><|fim▁begin|>describe('autocomplete', function () {
beforeEach(function () {
browser.get('/bonita/preview/page/no-app-selected/autocomplete/');
});
describe('simple list', function() {
var input, p;
beforeEach(function() {
input = $('.test-sim... |
values.get(0).click(); |
<|file_name|>c-style-enum.rs<|end_file_name|><|fim▁begin|>// ignore-aarch64
// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
// min-lldb-version: 310
// compile-flags:-g
// === GDB TESTS ===================================================================================
/... | // Borrow to avoid an eager load of the constant value in the static. |
<|file_name|>thread.rs<|end_file_name|><|fim▁begin|>use alloc::boxed::Box;
use core::mem;
use system::syscall::{sys_clone, sys_exit, sys_yield, sys_nanosleep, sys_waitpid, CLONE_VM, CLONE_FS, CLONE_FILES,
TimeSpec};
use time::Duration;
/// An owned permission to join on a thread (block on its terminat... | } |
<|file_name|>getAll.js<|end_file_name|><|fim▁begin|>module.exports = (req, res, next) => {
const _registration = req.requestParams.registration
const match = {
_registration: _registration
}
return global.models.getAll(
global.db.registrations.RegistrationDebaters,<|fim▁hole|> res
)
}<|fim▁end|> | match,
global.utils.populate.registrationDebaters, |
<|file_name|>aes_ctr_hmac_test.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 The Tink-Rust 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/lic... | chunk_size: 128, |
<|file_name|>screenshot.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Converts A bunch of mac Screenshots to 24hour format
def to_24(string):
hour, minute, trail = string.split('.')
sec, period = trail.split(' ')
hour = int(hour)
minute = int(minute)
sec = int(s... | |
<|file_name|>Bow.java<|end_file_name|><|fim▁begin|>/**
* The MIT License
* Copyright (c) 2014-2016 Ilkka Seppälä
*
* 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 restriction, i... | |
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from unittest import TestCase
from shutil import rmtree
from tempfile import mkdtemp
from os import makedirs
from os.path import join, exists, dirname
from awsfabrictasks.s3.api import dirlist_absfilenames
from awsfabrictask... | from awsfabrictasks.s3.api import s3path_to_localpath
|
<|file_name|>imagedata.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 https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::ImageDataBind... | Uint8ClampedArray::create(cx, CreateWith::Length(len), array.handle_mut()).unwrap();
(*imagedata).data.set(array.get());
}
|
<|file_name|>Histogram.py<|end_file_name|><|fim▁begin|>import copy
class Histogram( object ):
'''Histogram + a few things.
This class does not inherit from a ROOT class as we could want to use it
with a TH1D, TH1F, and even a 2D at some point.
Histogram contains the original ROOT histogram, obj, and... | else:
for ibin in range(1, hist.GetNbinsX()+1):
if hist.GetBinContent(ibin)<0:
hist.SetBinContent(ibin, 0) |
<|file_name|>bats_test.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"testing"
)
func TestBats(t *testing.T) {<|fim▁hole|> t.Errorf("failed: bats 22 2 2 9 11 is 3, got %d",
r)
}
if r := bats(835, 125, 1, []string{"113"}); r != 5 {
t.Errorf("failed: bats 835 125 1 113 is 5, got %d",
r)
}
i... | if r := bats(22, 2, 2, []string{"9", "11"}); r != 3 { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*-
<|fim▁hole|><|fim▁end|> | from decode import decode |
<|file_name|>util.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import with_statement
import glob
import os
import hmac
import hashlib
import shutil
import socket
import subprocess
import struct
from twisted.intern... | |
<|file_name|>Controller.js<|end_file_name|><|fim▁begin|>(function() {
function Base(props) {
this.id = Ambient.getID();
<|fim▁hole|>
Base.extend = function(methods) {
if (typeof methods === "function") {
methods = methods();
}
methods = (methods... |
$.extend(this, props || {});
}
|
<|file_name|>spectrometer_task.py<|end_file_name|><|fim▁begin|># ===============================================================================
# Copyright 2013 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | |
<|file_name|>SnapshotManagerTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is avai... | long retIndex = snapshotManager.trimLog(10);
assertEquals("return index", -1L, retIndex); |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import 'babel-polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import promise from 'redux-promise';
import createLogger... | |
<|file_name|>model.py<|end_file_name|><|fim▁begin|>import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'MODEL1006230003.xml')
<|fim▁hole|> try:
__import__(module_name)
except ImportError:
return False
else:
return True
if module_exists('lib... | with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
def module_exists(module_name): |
<|file_name|>test_useractive.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from datetime import timedelta
from django.utils import timezone
from django.test import RequestFactory
from exam import fixture
from sentry.middleware.user import UserActiveMiddleware
from sentry.testutils import Test... | middleware = fixture(UserActiveMiddleware)
factory = fixture(RequestFactory)
def test_simple(self): |
<|file_name|>function2.js<|end_file_name|><|fim▁begin|>function Test() {
a = 1;
console.log(a);
try {
console.log(b);
} catch (e) {
console.log("null");
}
}
console.log("Test1");
Test();
a = 2;
b = 3;
console.log("Test2");
Test();
Test.a = 4;
Test.b = 4;
console.log("Test3");
Test();<|fim▁hole... |
console.log("Test4");
|
<|file_name|>bouqueteditor_chanselect.cpp<|end_file_name|><|fim▁begin|>/*
neutrino bouquet editor - channel selection
Copyright (C) 2001 Steffen Hehn 'McClean'
Copyright (C) 2017 Sven Hoefer
License: GPL
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General ... | |
<|file_name|>TarThread.py<|end_file_name|><|fim▁begin|>import os
import logging
from mongodb_consistent_backup.Common import LocalCommand
from mongodb_consistent_backup.Pipeline import PoolThread
class TarThread(PoolThread):
def __init__(self, backup_dir, output_file, compression='none', verbose=False, binary="t... | "error": error,
"directory": self.backup_dir,
"exit_code": self.exit_code
} |
<|file_name|>mail_utils.py<|end_file_name|><|fim▁begin|>import smtplib
from email.mime.text import MIMEText
from django.core.mail import EmailMultiAlternatives
from django.conf import settings
def send_message(message):
"""
* desc 快捷发送邮件
* input 要发送的邮件信息
* output None
"""
mail_handler = ... | msg['Subject'] = subject
msg['From'] = sender
msg['To'] = ";".join(receiver_list)
self.smtp.sendmail(sender, receiver_list, msg.as_string()) |
<|file_name|>bitcoin_es_CL.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="es_CL" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Keplercoin</so... | <translation><b>Transacciones recientes</b></translation>
</message> |
<|file_name|>ex2-18.cc<|end_file_name|><|fim▁begin|>#include <iostream>
int main(int argc, char const *argv[])
{
int i = 5, i2 = 20;
int *ptr1 = &i, *ptr2 = &i;<|fim▁hole|> std::cout << i << " " << i2 << std::endl;
std::cout << *ptr1 << " " << *ptr2 << std::endl;
return 0;
}<|fim▁end|> | ptr1 = &i2;
*ptr2 = 10; |
<|file_name|>ImageSlider.js<|end_file_name|><|fim▁begin|>// @flow
import React, { type Node, Component } from 'react';
import {
Image,
View,
ScrollView,
StyleSheet,
TouchableHighlight,
TouchableOpacity,
Dimensions,
} from 'react-native';
const reactNativePackage = require('react-native/package.json');
c... | ref={ref => this._onRef(ref)}
onMomentumScrollEnd={this._handleScroll}
scrollEventThrottle={16} |
<|file_name|>config.js<|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 strict";
var convict = require('convict');
var format = ... | }
}, |
<|file_name|>worker.js<|end_file_name|><|fim▁begin|>'use strict';
const async = require('async');
const getApp = require('../utils/utils.js').getApp;
module.exports = function(Worker) {
//Worker.validatesPresenceOf('title');
Worker.upsertItem = (data, cb) => {
let res = {};
getApp(Worker)
.then((ap... | })
|
<|file_name|>sessions.py<|end_file_name|><|fim▁begin|>"""Mongodb implementations of repository sessions."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods,too-few-public-methods
# Number of methods are defined in specification
# pylint: disable=pr... |
"""
# Implemented from template for osid.resource.ResourceLookupSession.get_bin
return self._catalog |
<|file_name|>formating.py<|end_file_name|><|fim▁begin|># Copyright (c) OpenMMLab. All rights reserved.
# flake8: noqa
import warnings
from .formatting import *
warnings.warn('DeprecationWarning: mmdet.datasets.pipelines.formating will be '<|fim▁hole|><|fim▁end|> | 'deprecated, please replace it with '
'mmdet.datasets.pipelines.formatting.') |
<|file_name|>cert.go<|end_file_name|><|fim▁begin|>package autosignr
import (
"crypto/x509"
"encoding/pem"
"fmt"
"io/ioutil"
"os/exec"
"path/filepath"
"regexp"
"strings"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
)
// The OID for Puppet's pp_preshared_key in the Certificate Extensions
// https... |
// PuppetPSKFromCSRFile return the CSR file data |
<|file_name|>xgb.py<|end_file_name|><|fim▁begin|># This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
im... | params['eval_metric'] = 'mae'
params['max_depth'] = 10
params['silent'] = 0 |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>angular.module('NetPlanningApp').controller('AppCtrl', function($mdSidenav, $mdDialog, $mdToast, $scope, $location, $localStorage, $translate, amMoment, settings, DataService) {
'use strict';
var vm = this;
vm.$storage = $localStorage;
vm.DataService = DataService;... | DataService.login(vm.username, vm.password).then(function() {
DataService.loadItems(false); |
<|file_name|>AndroidFoodBankOwnerServlet.java<|end_file_name|><|fim▁begin|>package cs499.examples.semesterproject;
import javax.servlet.*;
import javax.servlet.http.*;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.*;
import java.sql.Connection;
import... | //c = DriverManager.getConnection("jdbc:oracle:thin:@10.159.226.169:1521/XE", "system", "admin");
s = c.createStatement();
|
<|file_name|>taste.rs<|end_file_name|><|fim▁begin|>use config::{parse_config, Benchmark, Config};
use git2;
use repo::Workspace;
use Commit;
use Push;
use std::collections::HashMap;
use std::io;
use std::path::Path;
use std::process::{Command, ExitStatus, Output};
use std::str;
/// `(val, percentage_change)`
#[derive... | |
<|file_name|>validation_info.ts<|end_file_name|><|fim▁begin|>// Copyright 2021 Google LLC
//<|fim▁hole|>//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTI... | // 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|>ocvOpticalFlowApp.cpp<|end_file_name|><|fim▁begin|>#include "cinder/app/AppNative.h"
#include "cinder/gl/Texture.h"
#include "cinder/Capture.h"
#include "cinder/params/Params.h"
#include "CinderOpenCV.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class ocvOpticalFlowApp : public A... | cv::Mat currentFrame( toOcv( Channel( surface ) ) );
if( mPrevFrame.data ) {
if( mFeatures.empty() || getElapsedFrames() % 30 == 0 ) // pick new features once every 30 frames, or the first frame
chooseFeatures( mPrevFrame ); |
<|file_name|>_translation_utils.py<|end_file_name|><|fim▁begin|># Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under ... | """
for attr in extra_attr_map: |
<|file_name|>mathUtils.ts<|end_file_name|><|fim▁begin|>///<reference path="../reference.ts" />
module Plottable {
export module Utils {
export module Math {
let nativeMath: Math = (<any>window).Math;
/**
* Checks if x is between a and b.
*
* @param {number} x The value to test if in range
... | |
<|file_name|>test_table_view.py<|end_file_name|><|fim▁begin|>'''Tests for helpers_views'''
from mysite import settings
from mysite.helpers.db_access import DBAccess
from mysite.helpers import testhelpers as th
from heatmap.helpers.table_view import (TableForm, QueryForm)
from heatmap.helpers import test_helpers_views ... | import os
import sqlite3
|
<|file_name|>junos.py<|end_file_name|><|fim▁begin|>#
# (c) 2016 Red Hat Inc.
#
# 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 version 3 of the License, or
# (... | try:
return strategy(*args, **kwargs)
except AnsibleFallbackNotFound: |
<|file_name|>KT2_J1_vahenda_tester.py<|end_file_name|><|fim▁begin|>"""
Task description (in Estonian):
3. Maatriksi vähendamine (6p)
Kirjuta funktsioon vähenda, mis võtab argumendiks arvumaatriksi, milles ridu ja
veerge on paarisarv, ning tagastab uue maatriksi, milles on kaks korda vähem
ridu ja kaks korda vähem veer... |
[[9, 4, 6, 5, 4, 6],
[3, 8, 7, 1, 2, 5], |
<|file_name|>dns_resolver.rs<|end_file_name|><|fim▁begin|>//! Asynchronous DNS resolver
use std::{
io::{self, ErrorKind},
net::SocketAddr,
};
use futures::Future;
use tokio;
use trust_dns_resolver::{config::ResolverConfig, AsyncResolver};
use crate::context::SharedContext;
pub fn create_resolver(dns: Option... | #[cfg(any(unix, windows))]
{ |
<|file_name|>values.rs<|end_file_name|><|fim▁begin|>#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum MethodType {
Get,
Post,<|fim▁hole|>}<|fim▁end|> | Put,
Delete,
Patch, |
<|file_name|>iceberg.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>
import json
from django import template
from django.conf import settings
register = template.Library()
from django_iceberg.auth_utils import init_iceberg
@register.inclusion_tag('django_iceberg/javascript_sdk.html', takes_cont... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.