prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>test.js<|end_file_name|><|fim▁begin|>/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | out = [ 0.0, 0.0 ];
v = minmaxabs( out, 4.2, 3.14, -1.0, -6.14 );
t.strictEqual( v, out, 'returns output array' );
t.strictEqual( v[ 0 ], 1.0, 'returns min value' ); |
<|file_name|>issue-54239-private-type-triggers-lint.rs<|end_file_name|><|fim▁begin|>// Regression test for #54239, shouldn't trigger lint.<|fim▁hole|>
#![deny(missing_debug_implementations)]
struct DontLookAtMe(i32);
async fn secret() -> DontLookAtMe {
DontLookAtMe(41)
}
pub async fn looking() -> i32 { // Should... | // check-pass
// edition:2018 |
<|file_name|>AreaMemoryManager.cpp<|end_file_name|><|fim▁begin|>/**
@file AreaMemoryManager.cpp
@maintainer Morgan McGuire, http://graphics.cs.williams.edu
@created 2009-01-20
@edited 2009-01-20
Copyright 2000-2009, Morgan McGuire.
All rights reserved.
*/
#include "G3D/AreaMemoryManager.h"
#i... | return old;
}
}
|
<|file_name|>miner.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2013 The NovaCoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mi... | CheckStake(pblock.get(), *pwallet); |
<|file_name|>EnumButton.py<|end_file_name|><|fim▁begin|>from src.tools.enum import enum
import pyxbmct.addonwindow as pyxbmct
from src.tools.dialog import dialog
EnumMode = enum(SELECT=0, ROTATE=1)
class EnumButton(object):
def __init__(self, label, values, current, default, changeCallback=None, saveCallback=No... | |
<|file_name|>test_filter2d.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# ______________________________________________________________________
'''test_filter2d
Test the filter2d() example from the PyCon'12 slide deck.
'''
# ______________________________________________________________________
import nump... | def test_vectorized_filter2d(self): |
<|file_name|>basic-types.rs<|end_file_name|><|fim▁begin|>// Copyright 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... | // check:$5 = -16
// debugger:print i32
// check:$6 = -32 |
<|file_name|>utilities_test.ts<|end_file_name|><|fim▁begin|>/*
Copyright 2021 The CloudEvents Authors
SPDX-License-Identifier: Apache-2.0
*/
import "mocha";
import { expect } from "chai";
import { isStringOrThrow, equalsOrThrow, isBase64, asData } from "../../src/event/validation";
describe("Utilities", () => {
d... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2011-2014 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LIC... | def call_app(self, req, app=None, expect_exception=False): |
<|file_name|>125.valid_palindrome.java<|end_file_name|><|fim▁begin|>/* 125.valid_palindrome
*/
public class Solution {
public int[] twoSum(int[] nums, int target) {
for (int i = 0; i < nums.length; i++) {
int ni = nums[i];
for (int j = i + 1; j < nums.length; j++) {
int nj = nums[j];... | throw new IllegalArgumentException("No two sum solution");
|
<|file_name|>sendemail.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright (C) 2014 Stefano Guglielmetti
# 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... | smtp.login(username,password)
smtp.sendmail(send_from, send_to, msg.as_string()) |
<|file_name|>GridCacheBinaryTransactionalEntryProcessorDeploymentSelfTest.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 own... | } |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>#include <QtGui/QApplication><|fim▁hole|>#include "dialog.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Dialog w;
w.show();
return a.exec();
}<|fim▁end|> | |
<|file_name|>securitygrouprule_fitask.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LI... | return nil
}
var _ fi.HasName = &SecurityGroupRule{} |
<|file_name|>cube-portfolio-2-ns.js<|end_file_name|><|fim▁begin|>(function($, window, document, undefined) {
<|fim▁hole|> wrap, filtersCallback;
/*********************************
init cubeportfolio
*********************************/
gridContainer.cubeportfolio({
layoutMode:... | 'use strict';
var gridContainer = $('#grid-container'),
filtersContainer = $('#filters-container'),
|
<|file_name|>defines.js<|end_file_name|><|fim▁begin|>// -------------------------------------------------------------------------------
// OEA Original colors
// --------------------------------------------------------------------------------
export default {
blue: "#3299BB",
lightBlue: "#88D4E1",
... | black: "#000",
backgroundGray: "#E9E9E9", |
<|file_name|>_version.py<|end_file_name|><|fim▁begin|># Copyright 2019 DeepMind Technologies Limited. 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.ap... | #
# Unless required by applicable law or agreed to in writing, software |
<|file_name|>jquery.booleanEditor.js<|end_file_name|><|fim▁begin|>// This file is part of Moodle - http://moodle.org/
//
// Moodle 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 Lice... | /**
* Build the HTML code for editing a rule condition.
* A rule is composed of one or more rule conditions linked by boolean operators
*/ |
<|file_name|>books.js<|end_file_name|><|fim▁begin|>"use strict";
module.exports = function (app) {
app.route('/book')
.get(function (req, res) {
res.send('Get a random book');<|fim▁hole|> res.send('Add a book');
})
.put(function (req, res) {
res.send('Updat... | })
.post(function (req, res) { |
<|file_name|>tensor.rs<|end_file_name|><|fim▁begin|>use std::ffi::CString;
use std::fmt;
use std::ptr::{self, NonNull};
use dynet_sys;
use super::{ApiResult, Dim, Result, Wrap};
/// A struct to represent a tensor.
///
/// # Examples
///
/// ```
/// # use dynet::{DynetParams, ParameterCollection, ParameterInitGlorot}... | |
<|file_name|>add-contributor.js<|end_file_name|><|fim▁begin|>import path from 'path'
import inquirer from 'inquirer'
import downloadTwitterPhoto from './utils/download-twitter-photo'
inquirer.prompt([<|fim▁hole|> type: 'input',
message: 'Twitter handle?',
},
]).then(({twitter}) => {
const destinationPath = ... | {
name: 'twitter', |
<|file_name|>confirmations.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version ... | #[derive(Debug, Clone, PartialEq)]
pub enum ConfirmationResponse { |
<|file_name|>sparse_nndescent.py<|end_file_name|><|fim▁begin|># Author: Leland McInnes <leland.mcinnes@gmail.com>
# Enough simple sparse operations in numba to enable sparse UMAP
#
# License: BSD 3 clause
from __future__ import print_function
import locale
import numpy as np
import numba
from pynndescent.utils import ... | |
<|file_name|>isolatedconnectedimagefilter.cpp<|end_file_name|><|fim▁begin|>/***********************************************************************************
* *
* Voreen - The Volume Rendering Engine ... | * * |
<|file_name|>client.js<|end_file_name|><|fim▁begin|>var PROPS = injectProps;
var hookOnReload = injectOnReload;
const io = require('socket.io-client');
const socket = io(`http://127.0.0.1:${PROPS.port}`);
const { id: ext_id } = chrome.runtime;
const onReload = (query = {}, cb) => {
query = Object.assign({
... | chrome.tabs.create(new_tab);
});
cb(tabs); |
<|file_name|>logged-in-user.ts<|end_file_name|><|fim▁begin|>import { autoinject } from 'aurelia-framework';
import { EventAggregator } from 'aurelia-event-aggregator';
import { AuthService } from 'aurelia-authentication';
import { UserEntity } from './user-entity';
@autoinject()
export class LoggedInUser {
isLogged... | |
<|file_name|>WrapTextTwoTone.js<|end_file_name|><|fim▁begin|>import React from 'react';
import createSvgIcon from './utils/createSvgIcon';<|fim▁hole|> <path d="M4 17h6v2H4zm13-6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3 3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4zM4 5h16v2H4z" />
, 'WrapTextTwoTone');<|fim▁end|> |
export default createSvgIcon( |
<|file_name|>EncodingUtil.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2015 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/licenses... | |
<|file_name|>logical_geometry.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/. */
//! Geometry in flow-relative space.
use euclid::{P... | }
/// Assuming .is_vertical(), does the block direction go left to right?
#[inline] |
<|file_name|>narcissistic.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# encoding: utf-8
# Here's a simple script (feels like a program, though) that prints out
# the first n narcissistic numbers, where n is provided on the command line. import sys
import sys
def numDigits(num):
"""Returns the number of digi... | originalNum = num |
<|file_name|>Consumer.java<|end_file_name|><|fim▁begin|><|fim▁hole|>
import cn.aezo.demo.rabbitmq.util.RabbitmqU;
import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.DefaultConsumer;
import com.rabbitmq.client.Envelope;
import java.io.I... | package cn.aezo.demo.rabbitmq.c05_model_topic; |
<|file_name|>Guard.cpp<|end_file_name|><|fim▁begin|>/* -*-coding: mule-utf-8-unix; fill-column: 58; -*-
Copyright (C) 2009, 2013 Sergei Lodyagin
This file is part of the Cohors Concurro library.
This library is free software: you can redistribute it
and/or modify it under the terms of the GNU Lesser
Gene... | {
"free", |
<|file_name|>zilla-shortcodes-lib.js<|end_file_name|><|fim▁begin|>jQuery(document).ready(function($) {
$(".zilla-tabs").tabs();<|fim▁hole|> var $this = $(this);
if( $this.attr('data-id') == 'closed' ) {
$this.accordion({ header: '.zilla-toggle-title', collapsible: true, active: false });
} else {
$this.ac... |
$(".zilla-toggle").each( function () { |
<|file_name|>iteratorSpreadInCall6.ts<|end_file_name|><|fim▁begin|>//@target: ES6
function foo(...s: (symbol | number)[]) { }
class SymbolIterator {
next() {
return {
value: Symbol(),
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
<|... |
class _StringIterator {
next() {
|
<|file_name|>elasticache_subnet_group.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# 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 Licens... | |
<|file_name|>shell_pre.js<|end_file_name|><|fim▁begin|>// eSpeak and other code here are under the GNU GPL.
function generateSpeech(text, args) {<|fim▁hole|> var self = { text: text, args: args, ret: null };
(function() {<|fim▁end|> | |
<|file_name|>protocol_final.py<|end_file_name|><|fim▁begin|>from tasty.types.driver import TestDriver
__params__ = {'la': 32, 'lb': 32}
driver = TestDriver()
<|fim▁hole|> client.b = Unsigned(bitlen=lb).input(src=driver, desc='b')
client.ga = Garbled(val=client.a)
client.gb = Garbled(val=client.b)
client.... | def protocol(client, server, params):
la = params['la']
lb = params['lb']
client.a = Unsigned(bitlen=la).input(src=driver, desc='a') |
<|file_name|>tools.py<|end_file_name|><|fim▁begin|>"""Module containing tools that are useful when benchmarking algorithms
"""
from math import hypot, sqrt
from functools import wraps
from itertools import repeat
try:
import numpy
except ImportError:
numpy = False
class translate(object):
"""Decorator for ... | |
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for HomematicIP Cloud switches."""
import logging
<|fim▁hole|>from homematicip.aio.group import AsyncSwitchingGroup
from homeassistant.components.switch import SwitchDevice
from . import DOMAIN as HMIPC_DOMAIN, HMIPC_HAPID, HomematicipGenericDevice
from .... | from homematicip.aio.device import (
AsyncBrandSwitchMeasuring, AsyncFullFlushSwitchMeasuring, AsyncMultiIOBox,
AsyncOpenCollector8Module, AsyncPlugableSwitch,
AsyncPlugableSwitchMeasuring) |
<|file_name|>checked_sub_mul.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::basic::signeds::PrimitiveSigned;
use malachite_base::num::basic::unsigneds::PrimitiveUnsigned;
use malachite_base_test_util::bench::bucketers::triple_max_bit_bucketer;
use malachite_base_test_util::bench::{run_benchmark, BenchmarkType... | .get(gm, &config)
.take(limit)
{
println!( |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|># coding: utf-8
'''Common test fixtures
@author: Jesse Schwartzentruber (:truber)
@license:
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 htt... | else: |
<|file_name|>omitBy.js<|end_file_name|><|fim▁begin|>import baseIteratee from './_baseIteratee';
import basePickBy from './_basePickBy';
/**
* The opposite of `_.pickBy`; this method creates an object composed of
* the own and inherited enumerable properties of `object` that `predicate`
* doesn't return truthy for. ... | * @returns {Object} Returns the new object.
* @example
* |
<|file_name|>lib.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/licens... | Some(Json::String(version)) => { |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/*
* Routes handlers
*/
var exec = require('child_process').exec,
child_process = require('child_process'),
fs = require('fs'),
child_processes = [];
// Basic routing
module.exports = function(app) {
app.get("/", getHomePage);
app.post("/add", postAddScra... | |
<|file_name|>nttcis.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 Lice... | kwargs[k] = v
params = kwargs
result = func(args[0], params)
else: |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup
import os.path
setup(
name='State Fragility',<|fim▁hole|> py_modules=['state_fragility'],
data_files=[('', [
"./state_fragility.db"
])]
)<|fim▁end|> | version='1', |
<|file_name|>secrets.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 l... | ] |
<|file_name|>filters.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
import { AppliedFilter, DataTypes, GridFilters, numberWithCommas, ReactPowerTable, withInternalPaging, withInternalSorting } from '../../src/';
import { defaultColumns, partyList, sampledata } from './shared';
// //if coming in from... | const Table = withInternalSorting(withInternalPaging(ReactPowerTable));
export class FiltersExample extends React.Component<never, FiltersExampleState> {
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># flake8: noqa
from __future__ import absolute_import
from .filterset import FilterSet
from .filters import *
__version__ = '0.9.2'<|fim▁hole|>
def parse_version(version):
'''
'0.1.2-dev' -> (0, 1, 2, 'dev')
'0.1.2' -> (0, 1, 2)
'''
v = version.... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'
const isPlainObject = require('lodash.isplainobject')
const getPath = require('lodash.get')
const StaticComponent = require('./StaticComponent')
const DynamicComponent = require('./DynamicComponent')
const LinkedComponent = require('./LinkedComponent')
c... | return component && component.instantiate && component.unwrap && true
} |
<|file_name|>queue_get_config_request.py<|end_file_name|><|fim▁begin|>"""Query the switch for configured queues on a port."""
# System imports
# Third-party imports<|fim▁hole|>
# Local source tree imports
from pyof.foundation.base import GenericMessage
from pyof.foundation.basic_types import Pad, UBInt32
from pyof.v0... | |
<|file_name|>TranslateComponent.spec.ts<|end_file_name|><|fim▁begin|>import {
provideTranslator,
TranslateComponent,
TranslateLogHandler,
Translator,
TranslatorConfig,
TranslatorContainer,
TranslatorModule,
} from "../index";
import {Component, ReflectiveInjector} from "@angular/core";
impo... | |
<|file_name|>navbar.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { ROUTER_DIRECTIVES } from '@angular/router';
@Component({
selector: 'fc-navbar',
directives: [...ROUTER_DIRECTIVES],
styleUrls: ['./na... | { |
<|file_name|>loss.py<|end_file_name|><|fim▁begin|>import numpy as np
import cudarray as ca
from .base import PickleMixin
_FLT_MIN = np.finfo(ca.float_).tiny
<|fim▁hole|> # elegant if Loss only provided loss() and grad(). However, where should
# we place the logic from fprop()?
@classmethod
def from_a... | class Loss(PickleMixin):
# abll: I suspect that this interface is not ideal. It would be more |
<|file_name|>generator_utils_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Unit tests for generator_utils.py
"""
import os
import unittest
... | "description": "description_B",
"trigger": "trigger_B",
"data": "data_B", |
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless req... | |
<|file_name|>o_auth_credential_create_request.go<|end_file_name|><|fim▁begin|>package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.co... | |
<|file_name|>TimeSlot.java<|end_file_name|><|fim▁begin|>package doodle;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Comparator;
import java.util.Date;
/**
* A poll is made up of two or more time slots, which are voted on by poll
* invitees. A time slot... | |
<|file_name|>progress_test.py<|end_file_name|><|fim▁begin|># coding=utf8
import time
import random
import unittest
from qiniuManager.progress import *
class Pro(object):
def __init__(self):
self.progressed = 0
self.total = 100
self.title = 'test'
self.chunked = False
self.... | self.chunk_recved += random.randrange(3, 1000000)
if time.time() - self.start > 5: |
<|file_name|>page-not-found.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
@Component({
<|fim▁hole|> `
})
export class PageNotFoundComponent {}<|fim▁end|> | template: `
<h2>Page not found</h2>
|
<|file_name|>taskbar_ui.js<|end_file_name|><|fim▁begin|>(function ($) {
/**
* Move a block in the blocks table from one region to another via select list.
*
* This behavior is dependent on the tableDrag behavior, since it uses the
* objects initialized in that behavior to update the row.
*/
Drupal.behaviors.taskba... | $(row).addClass('drag-previous');
}
}); |
<|file_name|>RedirectToServiceActionTests.java<|end_file_name|><|fim▁begin|>package org.apereo.cas.web.flow.actions;
import org.apereo.cas.authentication.CoreAuthenticationTestUtils;
import org.apereo.cas.authentication.principal.ResponseBuilderLocator;
import org.apereo.cas.authentication.principal.WebApplicationServ... | import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockServletContext;
import org.springframework.test.context.junit4.rules.SpringClassRule;
import org.springframework.test.context.junit4.rules.SpringMethodRule; |
<|file_name|>_showtickprefix.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
<|fim▁hole|> def __init__(
self, plotly_name="showtickprefix", parent_name="layout.yaxis", **kwargs
):
super(ShowtickprefixValidator, self).__init__(
plotly_name=plotly_name,
... | class ShowtickprefixValidator(_plotly_utils.basevalidators.EnumeratedValidator): |
<|file_name|>CredentialBodyParser.java<|end_file_name|><|fim▁begin|>//
// ========================================================================
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program... | byte currByte = buffer.get();
--cursor;
proofLength += (currByte & 0xFF) << 8 * cursor; |
<|file_name|>to_bits.rs<|end_file_name|><|fim▁begin|>use itertools::Itertools;
use malachite_base::num::logic::traits::{BitConvertible, BitIterable};
use malachite_base_test_util::bench::bucketers::vec_len_bucketer;
use malachite_base_test_util::bench::{run_benchmark, BenchmarkType};
use malachite_base_test_util::gener... | |
<|file_name|>LosslessJPEGCodec.java<|end_file_name|><|fim▁begin|>/*
* #%L
* BSD implementations of Bio-Formats readers and writers
* %%
* Copyright (C) 2005 - 2016 Open Microscopy Environment:
* - Board of Regents of the University of Wisconsin-Madison
* - Glencoe Software, Inc.
* - University of Dundee
*... | throws FormatException, IOException |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Yummly data models.
"""
from inspect import getargspec
class Storage(dict):
"""An object that is like a dict except `obj.foo` can be used in addition
to `obj['foo']`.
Raises Attribute/Key errors for missing references.
>>> o = Storage(a=1, b=2)... | class Attribution(Storage):
"""Attribution model.""" |
<|file_name|>document.ts<|end_file_name|><|fim▁begin|>import 'css.escape'
import { createFootnote, FootnoteElements } from './footnote'
import { bindScrollHandler } from './scroll'
import { Adapter } from '../core'
import { addClass, removeClass, unmount } from './element'
export const CLASS_CONTENT = 'littlefoot__con... | |
<|file_name|>pages.py<|end_file_name|><|fim▁begin|>import copy
import types
from django.core.urlresolvers import reverse
from django.db.models.query import QuerySet
registry = []
def register(*args):
"""
Register urls, views, model instances and QuerySets to be potential
pages for menu items.
Ex... | """
registry.extend(args)
|
<|file_name|>pep_bookmarks.py<|end_file_name|><|fim▁begin|><|fim▁hole|># This file is part of nbxmpp.
#
# 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 ... | # Copyright (C) 2018 Philipp Hörist <philipp AT hoerist.com>
# |
<|file_name|>GeneticAlgorithm.hpp<|end_file_name|><|fim▁begin|>/**
* @file GeneticAlgorithm.hpp
* @author Renato Oliveira (renatorro@comp.ufla.br)
* @version 1.0
* @since GeneticNet 1.0
* @date 10/07/2012
*/
#ifndef GRUBI_GENETICNET_GENETICALGORITHM_HPP_INCLUDED
#define GRUBI_GENETICNET_GENETICALGORITHM_HPP_INCL... | #include "AbstractMetaheuristic.hpp"
#include "ResultManager.hpp"
#include "Solution.hpp" |
<|file_name|>PasteEntryRepositoryAction.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2001-2017 by RapidMiner and the contributors
*
<|fim▁hole|> * This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU Affero General Public License as published by the Free S... | * Complete list of developers available at our web site:
*
* http://rapidminer.com
*
|
<|file_name|>inventory-filter.spec.ts<|end_file_name|><|fim▁begin|>import { TestData } from '../../test-data';
import { ViewController } from 'ionic-angular';
import {
NavParamsMock,
BrandsActionsMock,
CategoriesActionsMock,
ModelsActionsMock,
ItemsActionsMock,
BrandsServiceMock,
CategoriesServiceMock,
... |
it('resets filters on resetFilters()', () => {
spyOn(instance, 'onApplyFilters');
instance.onResetFilters(); |
<|file_name|>df103_NanoAODHiggsAnalysis.py<|end_file_name|><|fim▁begin|>## \file
## \ingroup tutorial_dataframe
## \notebook -draw
## \brief An example of complex analysis with RDataFrame: reconstructing the Higgs boson.
##
## This tutorial is a simplified but yet complex example of an analysis reconstructing the Higgs... | # Canvas and general style options
ROOT.gStyle.SetOptStat(0) |
<|file_name|>new.js<|end_file_name|><|fim▁begin|><|fim▁hole|>export { default } from 'ember-flexberry-designer/controllers/fd-interface-edit-form/new';<|fim▁end|> | |
<|file_name|>MysqlDialect.java<|end_file_name|><|fim▁begin|>package com.xinfan.msgbox.service.dao.dialect;
public class MysqlDialect extends Dialect {
@Override
public boolean supportsLimit() {
return true;
}
@Override
public boolean supportsLimitOffset() {
return true;
}
@Override
pub... | return pagingSelect.toString();
}
|
<|file_name|>issue-2995.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lice... | // option. This file may not be copied, modified, or distributed
// except according to those terms.
|
<|file_name|>generation.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | |
<|file_name|>webpack.config.dev.js<|end_file_name|><|fim▁begin|>var webpack = require('webpack');
var dotenv = require('dotenv').load();
module.exports = exports = require('./webpack.config');
exports.plugins = [
new webpack.DefinePlugin({
__API_URL__: JSON.stringify(process.env.LANDLINE_API_URL),
__PROD__:... | exports.devtool = 'source-map'; |
<|file_name|>messaging-input-field.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MessagingInputFieldComponent } from './messaging-input-field.component';
describe('MessagingInputFieldComponent', () => {
let component: MessagingInput... | fixture = TestBed.createComponent(MessagingInputFieldComponent);
component = fixture.componentInstance;
fixture.detectChanges();
}); |
<|file_name|>userAction.js<|end_file_name|><|fim▁begin|>'use strict';
var auth = require('../middleware/auth');
var express = require('express');
var router = express.Router();
var achievements = require('../common/achievements');
var User = require('../models').users;
var Action = require('../models').actions;
var Lo... | /**
* @api {post} /user/action/:actionId Change state for user action |
<|file_name|>browser_CaptivePortalWatcher_1.js<|end_file_name|><|fim▁begin|>"use strict";
add_task(setupPrefsAndRecentWindowBehavior);
let testcases = [
/**
* A portal is detected when there's no browser window,
* then a browser window is opened, and the portal is logged into
* and redirects to a different... | |
<|file_name|>dashboard.js<|end_file_name|><|fim▁begin|>/**
Template Controllers
@module Templates
*/
/**
The dashboard template
@class [template] views_dashboard
@constructor
*/
Template['views_dashboard'].helpers({
/**
Get all current wallets
@method (wallets)
*/
'wallets': function(disabled)... | e.preventDefault();
|
<|file_name|>sk.js<|end_file_name|><|fim▁begin|>tinyMCE.addI18n('sk.simple',{
<|fim▁hole|>bullist_desc:"Zoznam s odr\u00E1\u017Ekami",
numlist_desc:"\u010C\u00EDslovan\u00FD zoznam",
undo_desc:"Sp\u00E4\u0165 (Ctrl+Z)",
redo_desc:"Znovu (Ctrl+Y)",
cleanup_desc:"Vy\u010Disti\u0165 neupraven\u00FD k\u00F3d"
});<|fim... | bold_desc:"Tu\u010Dn\u00FD text (Ctrl+B)",
italic_desc:"\u0160ikm\u00FD text (kurz\u00EDva) (Ctrl+I)",
underline_desc:"Pod\u010Diarknut\u00FD text (Ctrl+U)",
striketrough_desc:"Pre\u0161krtnut\u00FD text",
|
<|file_name|>partner_sequence_unify.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2013 jmesteve All Rights Reserved
# https://github.com/jmest... | |
<|file_name|>fs.rs<|end_file_name|><|fim▁begin|>/*
Rust - Std Misc Filesystem Operation
Licence : GNU GPL v3 or later
Author : Aurélien DESBRIÈRES
Mail : aurelien(at)hackers(dot)camp
Created on : June 2017
Write with Emacs-nox ───────────────┐
Rust ───────────────────────────────┘
*/
// fs.rs
use std::f... | |
<|file_name|>RootClosedMapDataNode.java<|end_file_name|><|fim▁begin|>/*
* Swift Parallel Scripting Language (http://swift-lang.org)
* Code from Java CoG Kit Project (see notice below) with modifications.
*
* Copyright 2005-2014 University of Chicago
*
* Licensed under the Apache License, Version 2.0 (the "License... | }
@Override |
<|file_name|>terminated-multibyte.js<|end_file_name|><|fim▁begin|>const sizeOf = {
object: function () {
return function (object) {
let $start = 0
$start += 1 * object.array.length + 2
return $start
}
} ()
}
const serializer = {
all: {
object: f... | |
<|file_name|>namespace_a_e_mmailer.js<|end_file_name|><|fim▁begin|>var namespace_a_e_mmailer =
[
[ "AEMMailer", "d5/d12/class_a_e_mmailer_1_1_a_e_m_mailer.html", "d5/d12/class_a_e_mmailer_1_1_a_e_m_mailer" ],
[ "Error", "dc/d02/class_a_e_mmailer_1_1_error.html", null ],<|fim▁hole|><|fim▁end|> | [ "MissingEmailAccountsException", "d9/d2a/class_a_e_mmailer_1_1_missing_email_accounts_exception.html", null ],
[ "NoPasswordException", "d1/d47/class_a_e_mmailer_1_1_no_password_exception.html", null ]
]; |
<|file_name|>ExportXmlParser.cpp<|end_file_name|><|fim▁begin|>//-------------------------------------------------------------------------------------
// ExportXmlParser.cpp
//
// Simple callback non-validating XML parser implementation.
//
// Microsoft XNA Developer Connection.
// Copyright © Microsoft Corporatio... | // we no longer own strFilename, so un-set it
m_pISAXCallback->m_strFilename = NULL; |
<|file_name|>insert_grp_desg.py<|end_file_name|><|fim▁begin|># script.py
import argparse
import pyexcel as pe
import configparser
import os
import sys
import sqlite3
import my_connection_grp_desg as connection
from insert import sanction_grp as insert_sanc
DB_URL = None
global conn
conn = None
sheet = None
desg_ls=... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
from keras.datasets import mnist, cifar10, cifar100
from sklearn.preprocessing import LabelBinarizer
from nets import LeNet, LeNetVarDropout, VGG, VGGVarDr... | X_train /= 255 |
<|file_name|>espeak-demo.js<|end_file_name|><|fim▁begin|>var espeak = require('node-espeak');
espeak.initialize();
<|fim▁hole|>});
espeak.speak("hello world!");<|fim▁end|> | espeak.onVoice(function(wav, samples, samplerate) { |
<|file_name|>MonotoneChainBuilder.java<|end_file_name|><|fim▁begin|>/*
* The JTS Topology Suite is a collection of Java classes that
* implement the fundamental operations required to validate a given
* geo-spatial data set to a known topological specification.
*
* Copyright (C) 2001 Vivid Solutions
*
* T... | {
int safeStart = start;
// skip any zero-length segments at the start of the sequence
|
<|file_name|>fetch.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This is a virtual module that is entirely implemented as an action plugin and runs on the c... | validate_checksum:
version_added: '1.4'
description: |
<|file_name|>find-kam-node.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# find-kam-node.py: python2 example of loading kam, resolving kam node, and
# printing out BEL terms
#
# usage: find-kam-node.py <kam name> <source_bel_term>
from random import choice
from suds import *
from ws import ... | print "loaded kam '%s', handle '%s'" % (kam_name, handle.handle) |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from django.utils.translation import ugettext, ugettext_lazy as _
from ella.positions.models import Position
from ella.utils import timezone
class PositionOptions(admin.ModelAdmin):
def show_title(self, obj):
if not obj.t... |
# suggest_fields = {'category': ('tree_path', 'title', 'slug',),} |
<|file_name|>Context.js<|end_file_name|><|fim▁begin|><|fim▁hole|>class Context {
user: Object;
req: express$Request;
res: express$Response;
depth: number;
constructor(req: express$Request, res: express$Response, depth: number = 0) {
this.req = req;
this.res = res;
this.depth = depth;
// $Flo... | // @flow
|
<|file_name|>mod.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/. */
#![allow(unsafe_code)]
//! The rule tree.
#[cfg(feature = "serv... | }
|
<|file_name|>syslogparser.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
This is a collection of classes that contain data for files from a
sosreport in the directory:
var/log/*
@author : Shane Bradley
@contact : sbradley@redhat.com
@version : 2.16
@copyright : GPLv2
"""
class VarLogMessagesMsg:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.