prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>py_nve.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import lammps
import ctypes
import traceback
import numpy as np
class LAMMPSFix(object):
def __init__(self, ptr, group_name="all"):
self.lmp = lammps.lammps(ptr=ptr)
self.group_name = group_name
class LAMMPSF... | pass
def initial_integrate_respa(self, vflag, ilevel, iloop): |
<|file_name|>filemetadatamodule.cc<|end_file_name|><|fim▁begin|>#include "filemetadatamodule.hh"
#include "../config/config.hh"
#include "../common/debug.hh"
extern ConfigLayer *configLayer;
using namespace mongo;
/**
* @brief Default Constructor
*/
FileMetaDataModule::FileMetaDataModule(ConfigMetaDataModule* co... | } |
<|file_name|>labels.py<|end_file_name|><|fim▁begin|>import socket
import requests
import threading
import hashlib
import json
try:
import PyQt4
except Exception:
sys.exit("Error: Could not import PyQt4 on Linux systems, you may try 'sudo apt-get install python-qt4'")
from PyQt4.QtGui import *
from PyQt4.QtCor... | @hook |
<|file_name|>call_once.rs<|end_file_name|><|fim▁begin|>#![feature(core, unboxed_closures)]
extern crate core;
#[cfg(test)]
mod tests {
use core::ops::FnMut;
use core::ops::FnOnce;
type T = i32;
struct F;
type Args = (T,);
impl FnOnce<Args> for F {
type Output = T;
extern "rust-call" fn c... | assert_eq!(result, 70); |
<|file_name|>s0081.go<|end_file_name|><|fim▁begin|>// In the 5 by 5 matrix below, the minimal path sum from the top left to the
// bottom right, by only moving to the right and down, is indicated in bold red
// and is equal to 2427.
//
// [131] 673 234 103 18<|fim▁hole|>// 630 803 [746] [422] 111
// 537 ... | // [201] [ 96] [342] 965 150 |
<|file_name|>InstrumentClone.js<|end_file_name|><|fim▁begin|>// InstrumentClone.js
//
// Copyright 2018 High Fidelity, Inc.
// Created by Robin Wilson 7/5/2018
// Expands on guitarMexico.js created by Rebecca Stankus 01/31/18
//
// Entity script that plays the sound while holding the entity.
// Chooses the sound bite ... | }
},
// clickReleaseOnEntity: function (entityID, mouseEvent) { |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var app = new Vue({
el: '#app',<|fim▁hole|>});<|fim▁end|> | data: {
message: 'Kevin W. Palmer, South Florida, firstnameMiddleInitialLastname@gmail.com'
} |
<|file_name|>test_iptables_fwaas.py<|end_file_name|><|fim▁begin|># Copyright 2013 Dell 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
#
# http://... | |
<|file_name|>survey-template.js<|end_file_name|><|fim▁begin|>import { Factory, faker } from 'ember-cli-mirage';
<|fim▁hole|>export default Factory.extend({
survey_type: 'Biological Resources',
duplicator_label: 'Observation(s)',
fully_editable: true,
name() {
return faker.name.jobType();
},
status() {
... | |
<|file_name|>load_distr_uniform.rs<|end_file_name|><|fim▁begin|>extern crate rand;
use self::rand::distributions::{IndependentSample, Range};
#[derive(Clone, Debug)]
pub struct LoadDistrUniform < T > {
_buf: Vec< T >,
}
impl < T > Default for LoadDistrUniform < T > {
fn default() -> Self {
Self {
... | }
}
impl < T > LoadDistrUniform < T > { |
<|file_name|>make_ndvi.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ndvi_test.py
#
# Copyright 2015 rob <rob@Novu>
# <|fim▁hole|># (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without ev... | # 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 2 of the License, or |
<|file_name|>categorySelectDialog.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Licence: GPL v.3 http://www.gnu.org/licenses/gpl.html
# This is an XBMC addon for demonstrating the capabilities
# and usage of PyXBMCt framework.
import os
import xbmc
import xbmcaddon
import pyxbmct
from lib import utils
impo... | |
<|file_name|>db.py<|end_file_name|><|fim▁begin|># copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms ... | # logilab-common is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
<|file_name|>api.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc.
#
# This file is part of Mycroft Core.
#
# Mycroft Core 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 th... | # GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mycroft Core. If not, see <http://www.gnu.org/licenses/>. |
<|file_name|>build.js.e2e.ts<|end_file_name|><|fim▁begin|>import * as gulp from 'gulp';
import * as gulpLoadPlugins from 'gulp-load-plugins';
import { join } from 'path';
import { APP_SRC, APP_DEST, TOOLS_DIR } from '../../config';
import { templateLocals, makeTsProject } from '../../utils';
const plugins = <any>gulpLo... | .pipe(plugins.sourcemaps.write()) |
<|file_name|>conf.js<|end_file_name|><|fim▁begin|>var colors = require('colors');
colors.enabled = true;<|fim▁hole|>exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['../nodejs/jasmine-custom-message.spec.js', './test-jasmine-custom-message.js']
};<|fim▁end|> | |
<|file_name|>validation.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 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
Unl... | // ValidateServiceUpdate tests if required fields in the service are set during an update
func ValidateServiceUpdate(service, oldService *core.Service) field.ErrorList {
allErrs := ValidateObjectMetaUpdate(&service.ObjectMeta, &oldService.ObjectMeta, field.NewPath("metadata")) |
<|file_name|>application.go<|end_file_name|><|fim▁begin|>package requirements
import (
"github.com/cloudfoundry/cli/cf/api/applications"
"github.com/cloudfoundry/cli/cf/models"
)
//go:generate counterfeiter -o fakes/fake_application_requirement.go . ApplicationRequirement
type ApplicationRequirement interface {
Re... | return apiErr
}
|
<|file_name|>auth.js<|end_file_name|><|fim▁begin|>import { hashHistory } from 'react-router'
import { auth } from 'lib/firebase'
export const redirect = path => hashHistory.push(path)
export const signInWithGoogle = () => {
const provider = new auth.GoogleAuthProvider()
provider.addScope('https://www.googleapis.... | }
|
<|file_name|>localizations.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*----... | return false;
} |
<|file_name|>usernotification.js<|end_file_name|><|fim▁begin|>'use strict';
const async = require('async');
const mongoose = require('mongoose');
const UserNotification = mongoose.model('Usernotification');
const DEFAULT_LIMIT = 50;
const DEFAULT_OFFSET = 0;
module.exports = {
countForUser,
create,
get,
getA... | setRead |
<|file_name|>main.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import sys, time
from PySide import QtGui, QtCore
from presentacion.form_abm_paciente import FormPacienteABM
if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
# Create and display the splash screen
splash_pix = QtGui.... | time.sleep(1)
form = FormPacienteABM() |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""The Tile component."""
import asyncio
from datetime import timedelta
from pytile import async_login
from pytile.errors import SessionExpiredError, TileError
from homeassistant.const import ATTR_ATTRIBUTION, CONF_PASSWORD, CONF_USERNAME
from homeassistant.core i... | ) |
<|file_name|>SerialComm.cpp<|end_file_name|><|fim▁begin|>/**
* Pennyworth - A new smarthome protocol.
* Copyright (C) 2012 Dream-Crusher Labs LLC
*
* 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 Fou... | name = "Serial ";
name.append(dev);
|
<|file_name|>GradleDslLiteral.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://... | public String toString() {
Object value = getValue();
return value != null ? value.toString() : super.toString();
} |
<|file_name|>20161221201621-associate-classicsaladcatagory-and-classicsalad.js<|end_file_name|><|fim▁begin|><|fim▁hole|>const sql = require('../api/helpers/sql');
module.exports = {
up: function (queryInterface, Sequelize) {
return Task.spawn(function* () {
yield queryInterface.addColumn('ClassicSalads', '... | 'use strict';
const Task = require('co-task'); |
<|file_name|>document_loader.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/. */
//! Tracking of pending loads in a document.
//!
//!... | load: LoadType, |
<|file_name|>kendo.culture.nn.js<|end_file_name|><|fim▁begin|>/*
* Kendo UI Web v2014.1.318 (http://kendoui.com)
* Copyright 2014 Telerik AD. All rights reserved.
*
* Kendo UI Web commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-web
* If you do not own a commercial lic... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/**
* Module dependencies
*/
const express = require('express');
const cluster = require('cluster');
const numCPUs = require('os').cpus().length;
const compression = require('compression');
const helmet = require('helmet');
const hpp = require('hpp');
const config = ... | if (cluster.isMaster) {
for (let i = 0; i < numCPUs; i += 1) {
cluster.fork();
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).<|fim▁hole|><|fim▁end|> |
from . import res_partner |
<|file_name|>sym_encrypted_session_key.js<|end_file_name|><|fim▁begin|>// GPG4Browsers - An OpenPGP implementation in javascript
// Copyright (C) 2011 Recurity Labs GmbH
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as publi... | // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. |
<|file_name|>overlay.py<|end_file_name|><|fim▁begin|>import math
import urwid
from mitmproxy.tools.console import common
from mitmproxy.tools.console import signals
from mitmproxy.tools.console import grideditor
class SimpleOverlay(urwid.Overlay):
def __init__(self, master, widget, parent, width, valign="middle... | signals.pop_view_state.send(self)
if key == "?":
self.master.view_help(self.widget.make_help())
else: |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 MicroEra s.r.l.
# (<http://www.microera.it>).
#
# This program is free software: you can redistribute it and/or modify
# it... | # by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export * from './site.component';<|fim▁end|> | |
<|file_name|>files.js<|end_file_name|><|fim▁begin|>import { Map, Set, OrderedSet, List } from 'immutable'
import * as constants from '../constants/files.js'
import { ls, searchFiles, rangeSelect } from '../sagas/helpers.js'
const initialState = Map({
files: List(),
workingDirectoryFiles: null,
searchResults: List()... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># This file is part of django-popularity.
#
# django-popularity: A generic view- and popularity tracking pluggable for Django.
# Copyright (C) 2008-2010 Mathijs de Bruin
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | |
<|file_name|>tabs.js<|end_file_name|><|fim▁begin|>/*
* jQuery UI 1.7.2
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI
*/
(function($) {
var _remove = $.fn.remove,
isFF2 = $.brows... |
return !this._mouseStarted;
}, |
<|file_name|>MapImplementationsTest.java<|end_file_name|><|fim▁begin|>package org.swcraft.javase.collections.map;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import org.junit.Test;
public class MapImplementationsTest {
@Test
... |
// Iterate over entries
for (Entry<String, Integer> entry : map.entrySet()) { |
<|file_name|>new-unicode-escapes.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://www.apache... | let s = "\u{2603}";
assert_eq!(s, "☃");
let s = "\u{2a10}\u{2A01}\u{2Aa0}"; |
<|file_name|>test_client_full.rs<|end_file_name|><|fim▁begin|>use std::mem;
use bip_util::bt::{self};<|fim▁hole|>use futures::{Future};
use {handshaker};
#[test]
#[allow(unused)]
fn positive_client_request_dropped() {
let (sink, mut stream) = handshaker();
let server_addr = "127.0.0.1:3504".parse().unwr... | use bip_utracker::{TrackerClient, ClientRequest};
use bip_utracker::announce::{ClientState, AnnounceEvent};
use futures::stream::Stream; |
<|file_name|>ActivityInfo.js<|end_file_name|><|fim▁begin|>import PinSvg from './svg/PinSvg';
export default function ActivityInfo({title, price, stars, reviews, location}) {
return (
<>
<div className='h2 line-height-2 mb1'>
<span className='travel-results-result-text'>{title}</span>
<span ... | |
<|file_name|>catchupMail.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
"""
Copyright 2020 Paul Willworth <ioscode@gmail.com>
This file is part of Galaxy Harvester.
Galaxy Harvester is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as publ... |
# update alert status |
<|file_name|>LogMessage.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2013 Oak Ridge National Laboratory
* Author: James Horey <horeyjl@ornl.gov>
*
* 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 t... | *
* http://www.apache.org/licenses/LICENSE-2.0
* |
<|file_name|>gear.controller.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
<|fim▁hole|>
GearController.$inject =['GearService', 'InventoryService', '$scope'];
function GearController(GearService, InventoryService, $scope) {
var vm = this;
var currentItem = '';
vm.inventory = ... | angular.module('character-tracker.charactersheet')
.controller('GearController', GearController); |
<|file_name|>taste_entries_index_view.js<|end_file_name|><|fim▁begin|>var TasteEntriesIndexView = Backbone.View.extend({
initialize: function () {
this.initial_data = $('#data').data('response');
this.collection = new TasteEntriesCollection(this.initial_data);
this.render();
this.taste_entries_index_list_vi... | },
render: function () {
this.$el.html(''); |
<|file_name|>statusbarItem.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*----... | readonly labelContainer: HTMLElement;
get name(): string { |
<|file_name|>orderer.go<|end_file_name|><|fim▁begin|>/*
Copyright IBM Corp. 2016 All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package config
import (
"time"
"github.com/hyperledger/fabric/common/channelconfig"
ab "github.com/hyperledger/fabric/protos/orderer"
)
// Orderer is a mock implementation... | // Organizations returns OrganizationsVal
func (scm *Orderer) Organizations() map[string]channelconfig.Org { |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os.path
import tornado.escape<|fim▁hole|>import tornado.ioloop
import tornado.options
import tornado.web
from tornado.options import define, options
define("port", default=8000, help="run on the given port", type=int)
class Application(to... | import tornado.httpserver |
<|file_name|>defaults.go<|end_file_name|><|fim▁begin|>package v1
import (
"k8s.io/apimachinery/pkg/runtime"
kapi "k8s.io/kubernetes/pkg/api"
)
func SetDefaults_ImagePolicyConfig(obj *ImagePolicyConfig) {
if obj == nil {
return
}
if len(obj.ResolveImages) == 0 {
obj.ResolveImages = Attempt
}
for i := rang... | }
func addDefaultingFuncs(scheme *runtime.Scheme) error { |
<|file_name|>transaction_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum 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
//... | txt.skipLoad("^ttNonce/TransactionWithHighNonce256.json")
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (C) 2008-2014 Bastian Kleineidam<|fim▁hole|># the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without ... | #
# 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 |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import re
from django.contrib.auth.models import User
from django.db import models
from common.models import ExtraBase
CHALLENGES_TYPE = (
('p', 'playable player'),
('np', 'not playable player'),
)
class Challenge(models.Model, ExtraBase):
name = mod... |
def depends_on(self):
return ", ".join(i.name for i in self.depends.all())
|
<|file_name|>boxmodel.py<|end_file_name|><|fim▁begin|>#*****************************************************************************
# Copyright (C) 2017 Lee Worden <worden dot lee at gmail dot com>
#
# Distributed under the terms of the GNU General Public License (GPL) v.2
# http://www.gnu.org/licen... | raise RuntimeError, (
"Missing parameter dependencies in expression " +
str( reduce( self._mul, args ) )
) |
<|file_name|>StartActivity.java<|end_file_name|><|fim▁begin|>package com.brejza.matt.habmodem;
import group.pals.android.lib.ui.filechooser.FileChooserActivity;
import group.pals.android.lib.ui.filechooser.io.localfile.LocalFile;
import java.io.File;
import java.util.List;
import android.os.Bundle;
import android.os... | String mapst = PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext()).getString("pref_map_path", "");
|
<|file_name|>test_array.py<|end_file_name|><|fim▁begin|>import decimal
import json
import unittest
import uuid
from django import forms
from django.apps.registry import Apps
from django.core import exceptions, serializers, validators
from django.core.management import call_command
from django.db import IntegrityError,... | def test_exact_times(self):
self.assertSequenceEqual(
DateTimeArrayModel.objects.filter(times=self.times),
self.objs |
<|file_name|>aurelia-router.d.ts<|end_file_name|><|fim▁begin|>declare module 'aurelia-router' {
import * as core from 'core-js';
import * as LogManager from 'aurelia-logging';
import { Container } from 'aurelia-dependency-injection';
import { RouteRecognizer } from 'aurelia-route-recognizer';
import { join ... | export function loadNewRoute(routeLoader: any, navigationContext: any): any; |
<|file_name|>ObjectFactory.java<|end_file_name|><|fim▁begin|>//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon r... | * type definitions, element declarations and model |
<|file_name|>location.py<|end_file_name|><|fim▁begin|>class Location(object):
def __init__(self, x, y):
self.x = x
self.y = y<|fim▁hole|> return Location(self.x + direction.x, self.y + direction.y)
def __sub__(self, direction):
return Location(self.x - direction.x, self.y - dire... |
def __add__(self, direction): |
<|file_name|>combine_logs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
"""Combine logs from multiple bitcore nodes as well as the test_framework log.
This streams the combined log output to stdout. Use combine_logs.py > outputfile
to write to an outputfile."""
import argparse
from collections import default... | def print_logs(log_events, color=False, html=False):
"""Renders the iterator of log events into text or html."""
if not html: |
<|file_name|>addition.py<|end_file_name|><|fim▁begin|>import nengo
model = nengo.Network()
with model:
a = nengo.Ensemble(n_neurons=100, dimensions=1)
stim_a = nengo.Node([0])
nengo.Connection(stim_a, a)
b = nengo.Ensemble(n_neurons=100, dimensions=1)
stim_b = nengo.Node([0])<|fim▁ho... | nengo.Connection(stim_b, b)
|
<|file_name|>F_TIME_TO_USINT.cpp<|end_file_name|><|fim▁begin|>/*************************************************************************
*** FORTE Library Element
<|fim▁hole|> ***
*** Name: F_TIME_TO_USINT
*** Description: convert TIME to USINT
*** Version:
*** 0.0: 2013-08-29/4DIAC-IDE - 4DIAC-Consortiu... | ***
*** This file was generated using the 4DIAC FORTE Export Filter V1.0.x!
|
<|file_name|>pointcloud_publisher_node.cpp<|end_file_name|><|fim▁begin|>/*
* pointcloud_publisher_node.cpp
*
* Created on: Aug 19, 2021
* Author: Edo Jelavic
* Institute: ETH Zurich, Robotic Systems Lab
*/
#include <pcl_conversions/pcl_conversions.h><|fim▁hole|>namespace gm = ::grid_map::grid_map_pcl;... | #include <ros/ros.h>
#include <sensor_msgs/PointCloud2.h>
#include "grid_map_pcl/helpers.hpp"
|
<|file_name|>physical_plan_test.go<|end_file_name|><|fim▁begin|>// Copyright 2017 PingCAP, 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
//
// http://www.apache.org/licenses/LI... | c.Assert(err, IsNil)
se.Execute(context.Background(), "use test") |
<|file_name|>block.js<|end_file_name|><|fim▁begin|>/**
* BLOCK: blocks
*
* Registering a basic block with Gutenberg.
* Simple block, renders and saves the same content without any interactivity.
*/
import "./editor.scss";
import "./style.scss";
import React from "react";
import Select from "react-select";
const {... | var el = wp.element.createElement;
const { InspectorControls } = wp.editor; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>use std::ops::Range;
use std::cmp::min;
use std::error::Error;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Direction {Forward, Reverse}
use self::Direction::*;
impl Direction {
fn reverse(self) -> Direction {
match self {
Forward => Reverse,
Reverse ... | |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from flask_script import Manager, Shell, Server
from flask_script.commands import Clean, ShowUrls
from flask_migrate import MigrateCommand
from inspectors.app import create_app
from inspectors.settings import De... | |
<|file_name|>parameter_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python -t
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Jonathan Delvaux <pyshell@djoproject.net>
# 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
# t... | list_enabled=False,
local_param=True,)
|
<|file_name|>SingleValueIndexedIntsWriter.java<|end_file_name|><|fim▁begin|>/*
* Licensed to Metamarkets Group Inc. (Metamarkets) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Metamarkets licenses this... | *
* Unless required by applicable law or agreed to in writing, |
<|file_name|>selector_scope_spec.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import * as ts from 'typescript';
import {TypeScri... | selector: 'program-cmp',
isComponent: true,
exportAs: null,
inputs: {}, |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distri... | TestUtil.clientServerTest()
print("tests with collocated server.")
TestUtil.collocatedTest() |
<|file_name|>AudioOutputSample.cpp<|end_file_name|><|fim▁begin|>// Copyright 2005-2019 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
#in... | QString AudioOutputSample::browseForSndfile(QString defaultpath) {
QString file = QFileDialog::getOpenFileName(NULL, tr("Choose sound file"), defaultpath, QLatin1String("*.wav *.ogg *.ogv *.oga *.flac"));
if (! file.isEmpty()) {
SoundFile *sf = AudioOutputSample::loadSndfile(file); |
<|file_name|>question.rs<|end_file_name|><|fim▁begin|>use std::str;
pub struct Question {
pub name: Vec<String>,
pub rrtype: u16,
pub class: u16,
}
impl Question {
pub fn unpack(buffer: &[u8], offset: usize) -> (Question, usize) {
let mut name = Vec::new();
let mut offset = offset;
... |
for part in self.name.iter() { |
<|file_name|>EvaluationStats.py<|end_file_name|><|fim▁begin|>"""
This file is part of contribution to the OAD Data Science Toolkit.
This 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 Lic... | Area under the roc curve of the classifier.
Parameters: None.
|
<|file_name|>regions-steal-closure.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.apac... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
|
<|file_name|>err.rs<|end_file_name|><|fim▁begin|>use ::dynamic::CompositerError;
use ::graphic::GraphicError;
use ::pty_proc::shell::ShellError;
use std::error::Error;
use std::fmt;
pub type Result<T> = ::std::result::Result<T, NekoError>;
/// The enum `NekoError` defines the possible errors
/// from constructor Neko... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># coding=utf-8
import zipfile
import re<|fim▁hole|>import hashlib
import json
import logging
from django.shortcuts import render
from django.db.models import Q, Count
from django.core.paginator import Paginator
from rest_framework.views import APIView
from django.co... | import os |
<|file_name|>createStaticRouter.js<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> * Returns an Express Router with bindings for the Admin UI static resources,
* i.e files, less and browserified scripts.
*
* Should be included before other middleware (e.g. session management,
* logging, etc) for reduced overhead.
*/
... | |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>#include <unistd.h>
#include <iostream><|fim▁hole|>#include <iomanip>
#include <string>
#include <sndfile.hh>
#include "TemVoc.hpp"
const string VERSION = "1.0";
using namespace std;
int main(int argc, char *argv[]) try
{
string help_message {"temvoc [-hwv] [-f ff... | |
<|file_name|>gidget_add.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4<|fim▁hole|> gidget add reference <filename>
"""
from docopt import docopt
if __name__ == '__main__':
print(docopt(__doc__))<|fim▁end|> | # -*- mode: python; indent-tabs-mode nil; tab-width 4; python-indent 4; -*-
"""
usage: gidget add data <filename> |
<|file_name|>0005_profile_terms_accepted.py<|end_file_name|><|fim▁begin|># Generated by Django 2.1.3 on 2019-02-22 22:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0004_auto_20170418_0219'),
]
operations = [
migrations.... | field=models.DateTimeField(blank=True, null=True),
),
] |
<|file_name|>testModelController.js<|end_file_name|><|fim▁begin|>/**
* @author lnaef
*/
dojo.provide("cs.util.tests.controller.testModelController");
dojo.require("cs.controller.ModelController");
dojo.require("cs.util.tests.controller.testLibraryController");
doh.register("cs.util.tests.controller.testModelCo... | |
<|file_name|>socket.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import gtk, sys, string
class Socket:
def __init__(self):
window = gtk.Window()<|fim▁hole|>
socket = gtk.Socket()
window.add(socket)
print "Socket ID:", socket.get_id()
if len(sys.argv) == 2:
... | window.set_default_size(200, 200) |
<|file_name|>htmlfontelement.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 dom::attr::{Attr, AttrHelpers};
use dom::bindings... |
match attr.local_name() {
&atom!("color") => {
self.color.set(str::parse_legacy_color(&attr.value()).ok()) |
<|file_name|>htmlulistelement.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 dom::bindings::codegen::Bindings::HTMLUListEleme... | #[allow(unrooted_must_root)]
pub fn new(localName: DOMString,
prefix: Option<DOMString>, |
<|file_name|>sqli_test.go<|end_file_name|><|fim▁begin|>package runner
import (
"strings"
"testing"
"gopkg.in/stretchr/testify.v1/assert"
)
// https://wfuzz.googlecode.com/svn/trunk/wordlist/Injections/SQL.txt
var fuzzList = `
'
"
#
-
--
'%20--
--';
'%20;
=%20'
=%20;
=%20--
\x23
\x27
\x3D%20\x3B'
\x3D%20\x27
\x27\... | ' or userid like '%
' or uid like '% |
<|file_name|>mock.go<|end_file_name|><|fim▁begin|>package mockclient
import (
"io"
"github.com/samalba/dockerclient"
"github.com/stretchr/testify/mock"
)
type MockClient struct {
mock.Mock
}
func NewMockClient() *MockClient {
return &MockClient{}
}
func (client *MockClient) Info() (*dockerclient.Info, error) ... |
func (client *MockClient) ImportImage(source string, repository string, tag string, tar io.Reader) (io.ReadCloser, error) {
args := client.Mock.Called(source, repository, tag, tar)
return args.Get(0).(io.ReadCloser), args.Error(1) |
<|file_name|>run-tests.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
import sys, os, getopt, struct, unittest
from distutils.spawn import spawn
build = True
verbosity = 2
here = os.path.dirname(os.path.abspath(__file__))
os.chdir(here)
def bits():
"""determine if running on a 32 bit or 64 bit platform
... | else: |
<|file_name|>LogicalSchema.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 licenses this file
* to you u... | }
/**
* Get all fields |
<|file_name|>result.py<|end_file_name|><|fim▁begin|>import numpy as np
from . import finiteelements as fe
from . import matrices
from math import cos
class Result:
def __init__(self):
pass
def __init__(self, freq, u1, u2, u3, mesh, geometry):
self.freq = freq
self.u1 = u1
... | return cos(self.freq * time) |
<|file_name|>AnimationUtils.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2018 Mauricio Colli <mauriciocolli@outlook.com>
* AnimationUtils.java is part of NewPipe
*
* License: GPL-3.0+
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License ... | animateScaleAndAlpha(view, enterOrExit, duration, delay, execOnEnd);
break; |
<|file_name|>Piece.test.js<|end_file_name|><|fim▁begin|>"use strict";
var Piece = require('../lib/Piece'),
map = require('../lib/map');
describe('Piece.js', function() {
var piece;
beforeEach(function() {
piece = new Piece(1, 'black', 0, 0);
});
describe('Piece Constructor', function() {
// めんど... | |
<|file_name|>cmd_connect.py<|end_file_name|><|fim▁begin|>from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from zope.interface import implements
class ConnectCommand(ModuleData, Command):
implements(IPlugin, IModul... | user.sendMessage("NOTICE", "*** Server {} is already on the network".format(serverName))
elif self.ircd.connectServer(serverName): |
<|file_name|>0003_auto_20201113_1437.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
<|fim▁hole|>
dependencies = [
('donation', '0002_auto_20190416_2318'),
]
operations = [
migrations.AlterField(
model_name='razorpayplans',
... | from django.db import migrations, models
class Migration(migrations.Migration): |
<|file_name|>shmem.rs<|end_file_name|><|fim▁begin|>use models::*;
use futures::prelude::*;
use libc;
use libc::c_char;
use std;
use std::cmp::min;
use std::ffi::CStr;
use std::io;
use std::io::Write;
use std::os::linux::fs::MetadataExt;
use std::os::unix::fs::OpenOptionsExt;
use std::os::unix::io::AsRawFd;
use std::sy... |
impl Default for MSG_CHANNEL { |
<|file_name|>RemoveFormatCommand.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2007 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following... | |
<|file_name|>http.rs<|end_file_name|><|fim▁begin|>use hyper::{Client, Url};
use hyper::status::StatusCode;
use hyper::header::{ContentType, Headers, Authorization, Basic};
use std::io::Read;
use errors::Error;
fn get_headers(url: Url) -> Headers {
let mut headers = Headers::new();
headers.set(ContentType::jso... |
#[doc(hidden)]
pub fn post(url: &Url, body: &str) -> Result<String, Error> {
let headers = get_headers(url.clone()); |
<|file_name|>CardConnectorException.java<|end_file_name|><|fim▁begin|>/*
* java API for the SatoChip Bitcoin Hardware Wallet
* (c) 2015 by Toporin - 16DMCk4WUaHofchAhpMaQS4UPm4urcy2dN
* Sources available on https://github.com/Toporin
*
* Copyright 2015 by Toporin (https://github.com/Toporin)
*
* License... | * See the License for the specific language governing permissions and
* limitations under the License.
*/
|
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Progdupeupl documentation build configuration file, created by
# sphinx-quickstart on Sat Dec 07 17:25:18 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration va... | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will |
<|file_name|>VirtualTarget.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2013-2016 Parallel and Reconfigurable Computing Group, University of Auckland.
*
* Authors: <http://homepages.engineering.auckland.ac.nz/~parallel/ParallelIT/People.html>
*
* This file is part of Pyjama, a Java implementation of OpenM... | * |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![cfg_attr(any(feature = "unstable", feature = "custom-unstable"), feature(test))]
#[cfg(any(feature = "unstable", feature = "custom-unstable"))]
extern crate test;
pub fn function() {
println!("hi");
}
pub fn function2() {
println!("hi");
}
#[test]<|fim▁hol... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.