prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""<|fim▁hole|> ... | |
<|file_name|>UPnP.UPnPService.1.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
// System.Runtime.Remoting.ObjRef CreateObjRef(type requestedType)
CreateObjRef() {
}
// bool Equals(System.Object obj)
Equals() {
}
// int GetHashCode()
GetHashCode() {
}
// System.Object GetLifet... | class upnp_upnpservice_1 {
constructor() {
} |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright (c) 2014-2015 Cedric Bellegarde <cedric.bellegarde@adishatz.org>
# 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 Foundatio... | builder.add_from_resource('/org/gnome/Lollypop/SettingsDialog.ui')
self._settings_dialog = builder.get_object('settings_dialog') |
<|file_name|>navbar.component.ts<|end_file_name|><|fim▁begin|>import {Component, Input} from '@angular/core';
import {CORE_DIRECTIVES} from '@angular/common';
import {ROUTER_DIRECTIVES, Router} from '@angular/router-deprecated';
import {AuthService} from '../common/auth.service';
@Component({
selector: 'todo-navbar... | console.log('getName');
return this.name;
}
|
<|file_name|>AbstractCalendarValidator.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 ... | }
|
<|file_name|>needs-feature.rs<|end_file_name|><|fim▁begin|>//[full] run-pass
// Verifies that having generic parameters after constants is not permitted without the
// `const_generics_defaults` feature.
// revisions: min full<|fim▁hole|>
struct A<const N: usize, T=u32>(T);
//[min]~^ ERROR type parameters must be declar... | #![cfg_attr(full, feature(const_generics_defaults))] |
<|file_name|>BenchmarkTest01168.java<|end_file_name|><|fim▁begin|>/**
* OWASP Benchmark Project v1.2beta<|fim▁hole|>* This file is part of the Open Web Application Security Project (OWASP)
* Benchmark Project. For details, please see
* <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/... | * |
<|file_name|>calendar.js<|end_file_name|><|fim▁begin|>// @flow
import type {Action} from '../actions/types';
const initialState = {
firstMonth: -1,
dates: []<|fim▁hole|>export type State = {
firstMonth: number;
dates: Array<Array<number>>;
};
export default function calendar(state: State = initialState, actio... | };
|
<|file_name|>server.model.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
/**
* <%= model.pascalCaseSingular %> Schema
*/
var <%= model.pascalCaseSingular %>Schema = new Schema({<% model.elements.forEach(function(element) {... | <% } else { %>
<%= nestedelement.elementname %>: <%= nestedelement.elementtype %>,
<% } %>
<% }); %> |
<|file_name|>errors1.rs<|end_file_name|><|fim▁begin|>// errors1.rs
// This function refuses to generate text to be printed on a nametag if
// you pass it an empty string. It'd be nicer if it explained what the problem
// was, instead of just sometimes returning `None`. The 2nd test currently
// does not compile or pass... | if name.len() > 0 {
Some(format!("Hi! My name is {}", name)) |
<|file_name|>polyfills.ts<|end_file_name|><|fim▁begin|>/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are
* sorte... | *
* (window as any).__Zone_enable_cross_context_check = true;
* |
<|file_name|>addRole.js<|end_file_name|><|fim▁begin|>var ParseIndex = require("../../index");
module.exports = function addRole(params) {
Parse.Cloud.define("addRole", (req, res) => {
if (req.params.masterKey === ParseIndex.config.masterKey) {
var roleName = req.params.roleName;
if (roleName.length >... | |
<|file_name|>tower_credential.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__met... | default: null
project: |
<|file_name|>build_board_docs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of t... | if not_five_volt:
pinHTML2 += '<SPAN class="pinfunction NOT_5V" title="Not 5v Tolerant">3.3v</SPAN>'; |
<|file_name|>material.rs<|end_file_name|><|fim▁begin|>use std::io::{Cursor, Read};
use anyhow::Error;
use image::{self, GenericImage, GenericImageView};
use zip::ZipArchive;
use cache::{AssetLoadContext, GeneratedAsset, WebAsset};
use srgb::{LINEAR_TO_SRGB, SRGB_TO_LINEAR};
#[derive(Clone, Copy)]
pub enum MaterialTy... | gfx_core::texture::NewImageInfo { |
<|file_name|>cbx-2to3.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Data filter converting CSTBox v2 event logs to v3 format.
Usage: ./cbx-2to3.py < /path/to/input/file > /path/to/output/file
"""
__author__ = 'Eric Pascual - CSTB (eric.pascual@cstb.fr)'
import fileinput<|fim▁hole... | import json
for line in fileinput.input():
ts, var_type, var_name, value, data = line.split('\t') |
<|file_name|>ChartTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2021 James Pether Sörling
*
* 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/licen... | import org.dussan.vaadin.dcharts.helpers.ObjectHelper;
import org.dussan.vaadin.dcharts.metadata.XYaxes;
import org.junit.Assert;
import org.junit.Test; |
<|file_name|>orthog.py<|end_file_name|><|fim▁begin|>"""
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY 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 you... | """
self.z.value = np.zeros(self.shape)
def _project(self, matrix): |
<|file_name|>CellSpaceTest.java<|end_file_name|><|fim▁begin|>package net.tofweb.starlite;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import ... | assertTrue(rhsD == info.getRhs());
assertTrue(costA == info.getCost()); |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>#
# Author: Endre Karlson <endre.karlson@gmail.com>
#
# 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/L... | action = 'list'
|
<|file_name|>set_part_quantity_mutation.rs<|end_file_name|><|fim▁begin|>use async_graphql::{
ID,
Context,
FieldResult,
};
use async_graphql::validators::{IntGreaterThan};
// use eyre::{
// eyre,
// // Result,<|fim▁hole|>// // Context as _,
// };
use printspool_json_store::{
Record,
};
use c... | |
<|file_name|>confirmation.ts<|end_file_name|><|fim▁begin|>/**
* @author Damien Dell'Amico <damien.dellamico@gmail.com>
* @copyright Copyright (c) 2016
* @license GPL-3.0
*/
import { Component } from '@angular/core';
import { AlertController, NavController } from 'ionic-angular';
import { FormGroup, FormBuilde... | this.geocoderService.addressForlatLng(this.position.lat(), this.position.lng())
.subscribe((address: string) => { |
<|file_name|>validation.js<|end_file_name|><|fim▁begin|>/**
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
*/
/*jshint jquery:true*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
define([
"jquery",
"mage/validation",
... | });
return result && total > 0;
},
'Please specify the quantity of product(s).' |
<|file_name|>layers.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2022 The Google Research 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/... | """
super(PositionEmbed, self).__init__(**kwargs)
if not isinstance(axes, (list, tuple)): |
<|file_name|>CdrhClassification.java<|end_file_name|><|fim▁begin|>//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// 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 recompi... | * <simpleContent>
* <extension base="<>String200Type">
* </extension>
* </simpleContent> |
<|file_name|>style.rs<|end_file_name|><|fim▁begin|>//! Code for applying CSS styles to the DOM.
//!
//! This is not very interesting at the moment. It will get much more
//! complicated if I add support for compound selectors.
use dom::{Node, NodeType, ElementData};
use css::{Stylesheet, Rule, Selector, SimpleSelecto... | let mut rules = matching_rules(elem, stylesheet); |
<|file_name|>string_slice_runtime.rs<|end_file_name|><|fim▁begin|>#[derive( Debug, PartialEq )]
pub struct Struct1< 'a >
{
pub string_slice_1 : &'a str,
}
impl< 'a > Struct1< 'a >
{
#[inline]
pub fn former() -> Struct1Former< 'a >
{
Struct1Former
{
string_slice_1 : ::core::option::Option::None,... | Src : ::core::convert::Into< &'a str >, |
<|file_name|>connection.js<|end_file_name|><|fim▁begin|>var knex = require('knex'),
config = require('../../config'),
dbConfig = config.database,
knexInstance;<|fim▁hole|>
if (client === 'pg' || client === 'postgres' || client === 'postgresql') {
try {
pg = require('pg');
... |
function configureDriver(client) {
var pg; |
<|file_name|>01.ExchangeIfGreater.js<|end_file_name|><|fim▁begin|>/**
* Created by Kaloyan on 24.5.2015 ã..
*/
console.log('============');
console.log('Exercise 1: Exchange if first is greater');
var a = 5;
var b = 2;
<|fim▁hole|> a = b;
b = temp;
}
console.log(a + ' ' + b);<|fim▁end|> | if (a > b) {
var temp = a; |
<|file_name|>AutoCollapseDlg.hpp<|end_file_name|><|fim▁begin|>//=======================================================================
// Author: Donovan Parks
//
// Copyright 2009 Donovan Parks
//
// This file is part of Chameleon.
//
// Chameleon is free software: you can redistribute it and/or modify
// it under th... | void Execute();
void TopLevelChanged(bool bFloating);
private: |
<|file_name|>UhbdInterface.py<|end_file_name|><|fim▁begin|>"""
uhbd_interface.py:
Functions/data necessary to perform a UHBD calculation on a single pdb file.
Core of the batch run suite.
Required files:
pkaS-doinp.inp (in ./inputs/)
pkaS.dat (in ./inputs/)
Version Notes:
0.... | 0.4.3: 060310
Changed default grid sizes. Used to have program define first two grids, |
<|file_name|>delete.go<|end_file_name|><|fim▁begin|>package main
import (
"flag"
"fmt"
"os"
pb "github.com/azmodb/exp/azmo/azmopb"
"golang.org/x/net/context"
)
var delCmd = command{
Help: `
Delete removes a key/value pair.
`,
Short: "removes a key/value pair",
Args: "key",
Run: put,
}
func del(ctx conte... | |
<|file_name|>fix_pour.cpp<|end_file_name|><|fim▁begin|>/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sand... | int n = 5*ncount; |
<|file_name|>opt.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import logging
_logger = logging.getLogger('theano.sandbox.cuda.opt')
import copy
import sys
import time
import warnings
import pdb
import numpy
import theano
from theano import scalar as scal
from theano import config, tensor, go... | |
<|file_name|>addon.py<|end_file_name|><|fim▁begin|>import xbmcaddon
import xbmcgui
import subprocess,os
def EstoEsUnaFun( str ):
xbmcgui.Dialog().ok("ESO ES","AHHHH",str)
return
addon = xbmcaddon.Addon()
addonname = addon.getAddonInfo('name')
line1 = "Hello World!"
line2 = "We can write anything we ... | |
<|file_name|>matrix_market.rs<|end_file_name|><|fim▁begin|>use std::fs;
use std::path::Path;
use crate::sparse::CsMatrix;
use crate::RealField;
use pest::Parser;
#[derive(Parser)]
#[grammar = "io/matrix_market.pest"]
struct MatrixMarketParser;
// FIXME: return an Error instead of an Option.
/// Parses a Matrix Marke... | let file = fs::read_to_string(path).ok()?; |
<|file_name|>hiphopabotamus.rs<|end_file_name|><|fim▁begin|>#![feature(box_syntax)]
#![feature(plugin)]
#![plugin(postgres_macros,regex_macros)]
use irc::event_stream::{Action, HandlerAction, Response};
use irc::protocol;
use postgres::{Connection, SslMode};
use regex::Regex;
use rand::{thread_rng, Rng};
use std::asci... | };
let join_nick = nick.clone(); |
<|file_name|>test_fishbans.py<|end_file_name|><|fim▁begin|>import json
import pytest
from plugins.fishbans import fishbans, bancount
from cloudbot import http
test_user = "notch"
test_api = """
{"success":true,"stats":{"username":"notch","uuid":"069a79f444e94726a5befca90e38aaf5","totalbans":11,"service":{"mcbans":0,... | |
<|file_name|>replays.rs<|end_file_name|><|fim▁begin|>use std::fs;
use std::path::PathBuf;
use std::cmp::Ordering;
use chrono::{Local, DateTime};
use pf_sandbox_lib::files;
use pf_sandbox_lib::input::ControllerInput;
use pf_sandbox_lib::package::Package;<|fim▁hole|>use crate::game::{Game, PlayerSetup};
use crate::inpu... | use pf_sandbox_lib::stage::Stage; |
<|file_name|>struct_variant_xc.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.apa... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate rand;
extern crate regex;
extern crate time;
mod cli;<|fim▁hole|>mod storage;
use cli::Cli;
fn main() {
let mut cli = Cli::new();
cli.run();
}<|fim▁end|> | mod editor;
mod models; |
<|file_name|>SearchForTextResult.cpp<|end_file_name|><|fim▁begin|>/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/location/model/SearchForTextResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespa... | return payload;
} |
<|file_name|>plots_installation.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) 2016 Adam Collin, Mathew Topper
# Copyright (C) 2017-2018 Mathew Topper
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... | log_phase_descript = l_phase
|
<|file_name|>commonjs2.js<|end_file_name|><|fim▁begin|><|fim▁hole|>const React = require('react')
module.exports = () => <div>test2</div><|fim▁end|> | |
<|file_name|>userRepository.ts<|end_file_name|><|fim▁begin|>import * as decorator from "../decorators/repository";
import {UserModel} from '../models/usermodel';
import {DynamicRepository} from '../dynamic/dynamic-repository';
@decorator.repository({ path: 'users', model: UserModel })
export default class UserReposit... | } |
<|file_name|>PlotLandmarks.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <boost/program_options.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include "rt/filesystem.hpp"
#include "rt/io/ImageIO.hpp"
#include "rt/io/LandmarkIO.hpp"
using namespace r... | ("help,h", "Show this message")
("moving,m", po::value<std::string>()->required(), "Moving image") |
<|file_name|>ptime.py<|end_file_name|><|fim▁begin|>import sys
import time
sleep = time.sleep
<|fim▁hole|>else:
time = time.time<|fim▁end|> | if sys.platform == 'win32':
time = time.clock |
<|file_name|>url_tree.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 {PRIMARY_OUTLET, ParamMap, convertToParamMap} from './s... | |
<|file_name|>DomManagerImpl.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* 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... | public final <T extends DomElement> T createStableValue(final Factory<T> provider) {
return createStableValue(provider, t -> t.isValid());
} |
<|file_name|>main_check_remaining.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 27 12:16:26 2017
@author: Anand A Joshi, Divya Varadarajan
"""
import glob
from os.path import isfile, split
import configparser
config_file = u'/big_disk/ajoshi/ABIDE2/study.cfg'
... | NPROC = int(Config.get('CSESVREG', 'NPROC')) |
<|file_name|>test_molecule.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2015 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the t... | |
<|file_name|>mode.rs<|end_file_name|><|fim▁begin|>extern crate num_complex;
use kiss_fft;
pub struct CeltMode {<|fim▁hole|> pub fft0: kiss_fft::KissFft,
pub fft3: kiss_fft::KissFft,
pub twiddles: Vec<num_complex::Complex<f32>>,
pub v: Vec<Vec<Option<u32>>>,
}<|fim▁end|> | pub window: Vec<f32>, |
<|file_name|>apigen.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
import re
import pdb
import pycparser
import subprocess
KNOWN_TYPES = ['int', 'double', 'float', 'char', 'short', 'long',
'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t']
# input is name of interface file.
# ... | code +="""
/* |
<|file_name|>borrowck-preserve-box-in-discr.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:/... |
struct F { f: ~int }
pub fn main() { |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>(function() {
chai.should();
describe("Dropzone", function() {
var getMockFile, xhr;
getMockFile = function() {
return {
status: Dropzone.ADDED,
accepted: true,
name: "test file name",
size: 123456,
type: "text/... | total: 2000,
bytesSent: 200
} |
<|file_name|>CraftEquipmentState.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2020 OpenXcom Developers.
*
* This file is part of OpenXcom.
*
* OpenXcom 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 Founda... | #include "../Savegame/ItemContainer.h"
#include "../Savegame/SavedBattleGame.h"
#include "../Savegame/SavedGame.h"
#include "../Savegame/Vehicle.h" |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|># (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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, ei... | |
<|file_name|>Layout.tsx<|end_file_name|><|fim▁begin|>// tslint:disable-next-line:no-unused-variable
import * as React from 'react';
import { Link } from 'react-router';
<|fim▁hole|> <nav className="nav-main">
<div className="wrap">
<Link className="nav-home" to="/">Typed Patterns</Li... | export default ({children}) =>
<div className="container"> |
<|file_name|>inline-svg.js<|end_file_name|><|fim▁begin|>import Helper, { helper as buildHelper } from '@ember/component/helper';
import { inlineSvg } from 'ember-inline-svg/helpers/inline-svg';
import SVGs from '../svgs';
import Ember from 'ember';
let helper;
if (Helper && buildHelper) {
helper = buildHelper(functi... | |
<|file_name|>coherence-no-direct-lifetime-dispatch.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
//... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
<|file_name|>notification.service.ts<|end_file_name|><|fim▁begin|>import {Injectable} from "@angular/core";
import {Router} from "@angular/router";
import {Subject} from "rxjs";
import {NotificationEvent} from "../interfaces/notification-event.type";
<|fim▁hole|> private emitter: Subject<NotificationEvent> = new Subje... | @Injectable()
export class NotificationService { |
<|file_name|>calculate_distances.py<|end_file_name|><|fim▁begin|>import math
from numba import njit
from tardis.montecarlo.montecarlo_numba import (
njit_dict_no_parallel,
)
import tardis.montecarlo.montecarlo_numba.numba_config as nc
from tardis.montecarlo.montecarlo_numba.numba_config import (
C_SPEED_OF_L... | delta_shell = 1 |
<|file_name|>ShoppingCart.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 AppDynamics, Inc.
*<|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 WAR... | * 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|>fail_over_configuration_broker.py<|end_file_name|><|fim▁begin|>from ..broker import Broker
class FailOverConfigurationBroker(Broker):
controller = "fail_over_configurations"
def get_config(self, **kwargs):
"""Get the failover configuration for the specified unit.
**Inputs**
... | | ``api version max:`` None |
<|file_name|>PipelineTemplateGenerator.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
import os
import Pipeline.settings.BiotoolsSettings as BiotoolsSettings
import DPyGetOpt
from Pipeline.core.PipelineTemplate import PipelineTemplate
import Pipeline.core.PipelineUtil as PipelineUtil
from Pipeline.cor... | |
<|file_name|>expr.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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/licen... | //!
//! Public entry points: |
<|file_name|>13 - xml.js<|end_file_name|><|fim▁begin|>var http = require('http');
var querystring = require('querystring');
var multipart = require('multipart');
function writeResponse(res, data) {
var total = 0;
for (fruit in data) {
total += Number(data[fruit]);
}
res.writeHead(200, "OK", {
"Content-Type": "... | console.log("[200] " + req.method + " to " + req.url);
if (req.method == 'OPTIONS') {
res.writeHead(200, "OK", { |
<|file_name|>wbemcli.rs<|end_file_name|><|fim▁begin|>// 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.
// All files in the project carrying such notice may not be ... | |
<|file_name|>getblocktemplate_proposals.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2<|fim▁hole|>
from test_framework.test_framework import AureusTestFramework
from test_framework.util import *
from binascii import a2b_hex, b2a_hex
from hashlib import sha256
from struct import pack
def check_array_result(ob... | # Copyright (c) 2014-2015 The Aureus Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php. |
<|file_name|>get.controller.js<|end_file_name|><|fim▁begin|>'use strict';
var Bluebird = require('bluebird');
var _ = require('lodash');
var debug = require('debug')('oradbpm:ctrl:get');
var Queue = require('queue-fifo');
var promiseWhile = require('promise-while')(Bluebird);
var error = require('./../../common/erro... | |
<|file_name|>challenge.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import {BaseCrudService} from "./base-crud.service";
import {Observable} from "rxjs/Observable";
import {Ladder, LadderUser} from "./ladder.service";
import {User} from "./users.service";
@Injectable()
export cla... | return this.http.post<Challenge>(this.url + "/" + ladder.id, challenge);
}
public putChallenge(challenge : Challenge) { |
<|file_name|>_models_py3.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated... | self.authentication_type = authentication_type
self.identity = identity |
<|file_name|>lump.rs<|end_file_name|><|fim▁begin|>/*
Copyright 2013 Jesse 'Jeaye' Wilkerson
See licensing in LICENSE file, or at:
http://www.opensource.org/licenses/BSD-3-Clause
File: shared/obj/bsp/lump.rs
Author: Jesse 'Jeaye' Wilkerson
Description:
Lump definitions for Q3 BSP maps.... | |
<|file_name|>UtilsFileManager.js<|end_file_name|><|fim▁begin|>$('#modalUploader').on('show.bs.modal', function (event) {
var uploader = new qq.FileUploaderBasic({
element: document.getElementById('file-uploader-demo1'),
button: document.getElementById('areaSubir'),
action: '/Files/Upload',
... | |
<|file_name|>du.rs<|end_file_name|><|fim▁begin|>#![crate_name = "uu_du"]
/*
* This file is part of the uutils coreutils package.
*
* (c) Derek Chiang <derekchiang93@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
exter... |
let mut grand_total = 0;
for path_str in strs.into_iter() { |
<|file_name|>test_dep_graph.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from rbpkg.package_manager.dep_graph import DependencyGraph
from rbpkg.testing.testcases import TestCase
class DependencyGraphTests(TestCase):
"""Unit tests for rbpkg.package_manager.dep_graph.DependencyGraph."""
... | graph = DependencyGraph() |
<|file_name|>move-2.rs<|end_file_name|><|fim▁begin|><|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. This file may not be copied, modified, or d... | // 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. |
<|file_name|>apt_manager.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 the Apache Li... | available_packages_cmd = [repo_cache_bin, "dump"]
installed_packages_cmd = ['COLUMNS=999', pkg_manager_bin, "-l"]
|
<|file_name|>ngModelSpec.js<|end_file_name|><|fim▁begin|>'use strict';
/* globals generateInputCompilerHelper: false */
describe('ngModel', function() {
describe('NgModelController', function() {
/* global NgModelController: false */
var ctrl, scope, element, parentFormCtrl;
beforeEach(inject(function... | $rootScope.inputPresent = true;
$rootScope.$apply();
expect($rootScope.myForm.$valid).toBe(false); |
<|file_name|>bluetoothadvertisingdata.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::Blueto... | // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothadvertisingdata-txpower
fn GetTxPower(&self) -> Option<i8> {
Some(self.txPower)
} |
<|file_name|>nest.py<|end_file_name|><|fim▁begin|># Copyright 2016 The TensorFlow Authors. 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://www.apache.org/l... | "structure has length %s, while shallow structure has length %s."
% (len(input_tree), len(shallow_tree)))
|
<|file_name|>test_close_old_issue.py<|end_file_name|><|fim▁begin|># python -m unittest discover
import unittest
from datetime import datetime
from tasks import old_issues as c
class TestCloseOldIssue(unittest.TestCase):
<|fim▁hole|> def test_is_closed_issue(self):
self.assertEquals(c.is_closed({'closed_at... | |
<|file_name|>rhs-type.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<|fim▁hole|>// except according ... | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed |
<|file_name|>mario.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function
import numpy as np
import warnings
from numpy.polynomial.hermite import hermvander
from six.moves import xrange
from .common import Baseline
try:
from cvxopt import matrix as cvx_matrix, solvers
except ImportErr... | class Mario(Baseline):
def __init__(self, poly_order=10, max_iters=None, verbose=False, tol=1e-2): |
<|file_name|>ethertype.rs<|end_file_name|><|fim▁begin|>use core::convert::TryFrom;
use num_enum::TryFromPrimitive;
use serde::{Deserialize, Serialize};
/// https://en.wikipedia.org/wiki/EtherType#Examples
#[derive(
Debug,
Clone,
Copy,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash,
TryFromPri... | }
impl EtherType { |
<|file_name|>unboxed-closure-sugar-default.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://... | //~^ ERROR not implemented |
<|file_name|>rhs-type.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/licens... | |
<|file_name|>plotter.py<|end_file_name|><|fim▁begin|>from numbers import Integral, Real
from itertools import chain
import string
import numpy as np
import openmc.checkvalue as cv
import openmc.data
# Supported keywords for continuous-energy cross section plotting
PLOT_TYPES = ['total', 'scatter', 'elastic', 'inelas... | |
<|file_name|>vec-late-init.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// 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.... | |
<|file_name|>Rgaa32016Rule101503Test.java<|end_file_name|><|fim▁begin|>/*
* Tanaguru - Automated webpage assessment
* Copyright (C) 2008-2016 Tanaguru.org
*
* 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 F... | } |
<|file_name|>peers_filter_test.go<|end_file_name|><|fim▁begin|>package abci
import (
"fmt"
"testing"
"github.com/hyperledger/burrow/logging"
"github.com/hyperledger/burrow/consensus/tendermint/codes"
"github.com/stretchr/testify/assert"
"github.com/tendermint/tendermint/abci/types"
abciTypes "github.com/tende... | func makeTestFilterQuery(filterType string, peer string) *abciTypes.RequestQuery {
return makeTestQuery(fmt.Sprintf("%v%v/%v", peersFilterQueryPath, filterType, peer)) |
<|file_name|>simple.interceptor.spec.ts<|end_file_name|><|fim▁begin|>import { Injector } from '@angular/core';
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { HTTP_INTERCEPTORS, HttpClient } from '@angular/common/http';
import { HttpClientTestingM... | req.flush('ok!');
});
}); |
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|>""" Tests for commerce views. """
from common.djangoapps.student.tests.factories import UserFactory
<|fim▁hole|>class UserMixin:
""" Mixin for tests involving users. """
def setUp(self):
super().setUp()
self.user = UserFactory()
def ... | |
<|file_name|>compiler.py<|end_file_name|><|fim▁begin|># Copyright 2014 Cloudera 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/LICENSE-2.0
#
# Unless ... |
class SQLiteExprTranslator(alch.AlchemyExprTranslator): |
<|file_name|>kmeans.py<|end_file_name|><|fim▁begin|>import json
import math
import random
import os
class KMeans(object):
# TO-DO: Richard
def __init__(self, dataset=None):
file_path = os.path.dirname(os.path.realpath(__file__))
if dataset is None:
self.mega_dataset = js... | def _ED(self, point1, point2):
result = 0
|
<|file_name|>plot_quantiles.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
=================================================
Draw a Quantile-Quantile Plot and Confidence Band
=================================================
This is an example of drawing a quantile-quantile plot with a confidence level
(CL)... | from rootpy.plotting.contrib.quantiles import qqgraph
set_style('ATLAS') |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from .responses import CloudWatchResponse
url_bases = [
"https?://monitoring.(.+).amazonaws.com",
]
<|fim▁hole|>url_paths = {
'{0}/$': CloudWatchResponse.dispatch,
}<|fim▁end|> | |
<|file_name|>cereconf_local.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2003-2018 University of Oslo, Norway<|fim▁hole|># This file is part of Cerebrum.
#
# Cerebrum is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public Lic... | # |
<|file_name|>server.js<|end_file_name|><|fim▁begin|>const express = require('express');
const app = express();
const path = require('path');
const userCtrl = require('./userCtrl.js');
//extra middleware
const bodyParser = require('body-parser');
<|fim▁hole|>
app.post('/requestDB', userCtrl.sendTableList);
app.post('/r... | app.use(bodyParser.urlencoded({extended: true}), bodyParser.json());
app.use(express.static(path.join(__dirname, '../../node_modules/')));
app.use(express.static(path.join(__dirname, '../client/'))); |
<|file_name|>helper.js<|end_file_name|><|fim▁begin|>"use strict";
module.exports = function (context) {<|fim▁hole|><|fim▁end|> | return context.data.root.query.name + context.data.root.query.suffix;
}; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.