prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>Select.d.ts<|end_file_name|><|fim▁begin|>import * as React from 'react';
import { DropdownProps } from '../../modules/Dropdown';
import { default as DropdownDivider } from '../../modules/Dropdown/DropdownDivider';
import { default as DropdownHeader } from '../../modules/Dropdown/DropdownHeader';
import { ... | |
<|file_name|>cmapview.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
cmapview.cpp
-------------------
begin : Mon Mar 19 2001
copyright : (C) 2001 by Kmud Develope... | action->setIcon (SmallIcon("edit-delete"));
connect (action, SIGNAL (triggered()), this, SLOT(slotPathDelete())); |
<|file_name|>Context.java<|end_file_name|><|fim▁begin|>// Copyright 2017 Google 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
//... | public UserContext create(String name) {
final User user = controller.newUser(name); |
<|file_name|>ApplicationModule.java<|end_file_name|><|fim▁begin|>package com.example.dagger2_hello_world;
import android.content.Context;
import android.support.annotation.NonNull;
import javax.inject.Named;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
@Module
public abstract class Application... | abstract Context context(Application application); |
<|file_name|>LocationScale.js<|end_file_name|><|fim▁begin|>define([
'dojo/_base/declare',
'dojo/dom-construct',
'JBrowse/View/Track/BlockBased',
'JBrowse/Util'],
function(
declare,
dom,
BlockBased,
Util
) {
return decl... | }); |
<|file_name|>rev.go<|end_file_name|><|fim▁begin|>// The command line tool for running Revel apps.
package main
import (
"flag"
"fmt"
"io"
"os"
"strings"
"text/template"
)
// Cribbed from the genius organization of the "go" command.
type Command struct {
Run func(args []string)<|fim▁hole|>
fu... | UsageLine, Short, Long string
} |
<|file_name|>redis_wrapper.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import redis, frappe, re
import cPickle as pickle
from frappe.utils import cstr
class RedisWrapper(redis.Redis):
"""Re... | |
<|file_name|>whisper.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2008 Orbitz WorldWide
#
# 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... | |
<|file_name|>availability_sets_operations.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 informatio... | |
<|file_name|>201511251405_33a1d6f25951_add_timetable_related_tables.py<|end_file_name|><|fim▁begin|>"""Add timetable related tables
Revision ID: 33a1d6f25951
Revises: 225d0750c216
Create Date: 2015-11-25 14:05:51.856236
"""
import sqlalchemy as sa
from alembic import op
from indico.core.db.sqlalchemy import PyIntEnu... | |
<|file_name|>collectd.py<|end_file_name|><|fim▁begin|># Copyright 2015-2016 Palo Alto Networks, 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... | |
<|file_name|>qhyper.ts<|end_file_name|><|fim▁begin|>/* This is a conversion from LIB-R-MATH to Typescript/Javascript
Copyright (C) 2018 Jacob K.F. Bogers info@mail.jacob-bogers.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published b... | _d[iterm] =
lfastchoose(_d[iNR], _d[ixr])
+
lfastchoose(_d[iNB], _d[ixb]) |
<|file_name|>matrix_test.py<|end_file_name|><|fim▁begin|># Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington and Kai Nagel
# See opus_core/LICENSE
import os
import opus_matsim.sustain_city.tests as test_dir
from opus_core.tests import opus_unittest
from opus_core.store.csv_sto... | '''
|
<|file_name|>successive_narrowing.py<|end_file_name|><|fim▁begin|>import deep_architect.searchers.common as se
import numpy as np
# NOTE: this searcher does not do any budget adjustment and needs to be
# combined with an evaluator that does.
class SuccessiveNarrowing(se.Searcher):
def __init__(self, search_space... | budget = initial_budget * (budget_increase_factor**round_idx) |
<|file_name|>elementwise.py<|end_file_name|><|fim▁begin|>import string
import numpy
import six
import cupy
from cupy import carray
from cupy import cuda
from cupy import util
six_range = six.moves.range
six_zip = six.moves.zip
def _get_simple_elementwise_kernel(
params, operation, name, preamble,
... | return "<ufunc '%s'>" % self.name
|
<|file_name|>spu_isa.py<|end_file_name|><|fim▁begin|># Copyright (c) 2006-2009 The Trustees of Indiana University.
# All rights reserved.
#
# Redistribution and use... | class bgx(Instruction):
machine_inst = OPCD_B_A_T |
<|file_name|>UnsafeSSLConnection.java<|end_file_name|><|fim▁begin|>/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.mariotaku.twidere.util.http;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.Inp... | }
return new UnsafeSSLConnection(host, port);
} |
<|file_name|>player_controller.hpp<|end_file_name|><|fim▁begin|>//
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2004-2005 Steve Baker <sjbaker1@airmail.net>
// Copyright (C) 2006 Joerg Henrichs, Steve Baker
//
// This program is free software; you can redistribute it and/or
// modify it under ... | virtual bool disableSlipstreamBonus() const { return false; } |
<|file_name|>pseudo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import random as rand
class PrimeTester(object):
def solovay_strassen(self, primo, acuracidade=5):
nro_tentativas = 0
if primo == 2 or primo == 3:
return (nro_tentativas, True)
if primo < 2:
... | primo_candidato = self.potencia(primo_candidato, resto, primo)
|
<|file_name|>avx.rs<|end_file_name|><|fim▁begin|>//! Mask reductions implementation for `x86` and `x86_64` targets with `AVX`
/// `x86`/`x86_64` 256-bit `AVX` implementation
/// FIXME: it might be faster here to do two `_mm_movmask_epi8`
#[cfg(target_feature = "avx")]
macro_rules! x86_m8x32_avx_impl {
($id:ident) ... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from .v2016_09_01.mode... | # coding=utf-8
# -------------------------------------------------------------------------- |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url, include
from snippets import views
from rest_framework.routers import DefaultRouter
# Create a router and register our viewsets with it.
router = DefaultRouter()
router.register(r'snippets', views.SnippetViewSet)
router.register(r'user... | ] |
<|file_name|>authv.js<|end_file_name|><|fim▁begin|>Vue.component('snackbar', require('./components/material/snackbar.vue'));<|fim▁hole|><|fim▁end|> | Vue.component('show-snackbar', require('./components/material/show-snackbar.vue')); |
<|file_name|>UIRichEdit.cpp<|end_file_name|><|fim▁begin|>#include "stdafx.h"
#include <textserv.h>
#pragma comment(lib, "riched20.lib")
// These constants are for backward compatibility. They are the
// sizes used for initialization and reset in RichEdit 1.0
namespace DirectUICore {
const LONG cInitTextMax = (32 ... | { |
<|file_name|>namespaces.js<|end_file_name|><|fim▁begin|>var namespaces =<|fim▁hole|><|fim▁end|> | [
[ "shyft", "namespaceshyft.html", "namespaceshyft" ]
]; |
<|file_name|>iot_lcd.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import print_function
import time
import pyupm_grove as grove
import pyupm_i2clcd as lcd
import pyupm_th02 as th02
import pyupm_guvas12d as upmUV
import pyupm_grovemoisture as upmMoisture
from phant import Phant
import requests
f... | |
<|file_name|>linear_search.py<|end_file_name|><|fim▁begin|>def linear_search(lst,size,value):
i = 0
while i < size:
if lst[i] == value:
return i
i = i + 1
return -1
def main():
lst = [-31, 0, 1, 2, 2, 4, 65, 83, 99, 782]
size = len(lst)
original_list = ""
value... | original_list += str(i) + " "
print(original_list)
print("\nLinear Search Big O Notation:\n--> Best Case: O(1)\n--> Average Case: O(n)\n--> Worst Case: O(n)\n") |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>use std::env;
use std::process::Command;
fn main() {
if std::env::var("DOCS_RS").is_ok() {
// Skip everything when building docs on docs.rs
return;
}
// On Windows Rust always links against release version of MSVC runtime, thus requires Re... | ) |
<|file_name|>CanvasSetup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
New Drawing class to create new mark and style on axes.
"""
# from copy import deepcopy, copy
from decimal import Decimal
import numpy as np
import toyplot
# from .Admixture import AdmixEdges
# for setting values from iterables
ITERA... | |
<|file_name|>test_awsssm.py<|end_file_name|><|fim▁begin|>import pretend
import pytest
from botocore.exceptions import ClientError
from configstore.backends.awsssm import AwsSsmBackend
def test_awsssm_init_bad_install(monkeypatch):
monkeypatch.setattr('configstore.backends.awsssm.boto3', None)
with pytest.r... | |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>//! Error types and conversion functions.
use std::error::Error;
use std::fmt;
use std::sync::Arc;
use rodio::decoder::DecoderError;
use rodio::PlayError;
/// An enum containing all kinds of game framework errors.
#[derive(Debug, Clone)]
pub enum GameError {
/// ... | |
<|file_name|>bug-44.js<|end_file_name|><|fim▁begin|>describe('async methods', () => {
it('commits multiple valid inserts to the database', done => {
const methodUnderTest = async (unitOfWork) => {
const insert = { method: 'insert' };
await new unitOfWork.Users(getUserWithEmail('1')).s... | };
new SomeService(methodUnderTest)
.runMethodUnderTest() |
<|file_name|>argument.py<|end_file_name|><|fim▁begin|>__author__ = 'tahsmith'
from operator import add
import os
from cmake.context import Context
from functools import reduce
class VariableReference(object):
def __init__(self, tokens):
self.name = tokens[0]
def evaluate(self, ctx):
"""
... | return os.environ[name] |
<|file_name|>angular-ui-dashboard.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2014 DataTorrent, 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
*
* h... | |
<|file_name|>test_oopsreferences.py<|end_file_name|><|fim▁begin|># Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Tests of the oopsreferences core."""
__metaclass__ = type
from datetime import (
datetime,
timede... | self.failUnlessEqual(
set([]),
referenced_oops(now + day, now + day, "product=1", {})) |
<|file_name|>gpio.py<|end_file_name|><|fim▁begin|>GPIO_HUB_RST_N = 30
GPIO_UBLOX_RST_N = 32
GPIO_UBLOX_SAFEBOOT_N = 33
GPIO_UBLOX_PWR_EN = 34
GPIO_STM_RST_N = 124
GPIO_STM_BOOT0 = 134
def gpio_init(pin, output):
try:
with open(f"/sys/class/gpio/gpio{pin}/direction", 'wb') as f:
f.write(b"out" if output el... | print(f"Failed to set gpio {pin} direction: {e}")
def gpio_set(pin, high): |
<|file_name|>badge.ts<|end_file_name|><|fim▁begin|>import * as Router from 'koa-router'
import * as moment from 'moment'
import { get } from 'lodash'
import { QueryOptions } from '../route'
import { BlockchainService } from '../../domainService'<|fim▁hole|>
interface Badge {
readonly workId: string,
readonly dateP... | import { WorkRoute } from './work' |
<|file_name|>test_filter.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
... | # Filter two.
self.assert_console_output(
'overlaps:three',
targets=self.targets('::'), |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Scrapy settings for miner project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
#
BOT_NAME = ... | BOT_NAME+'.pipelines.BXJDailyPostDigestPipeline': 300,
BOT_NAME+'.pipelines.BXJPostDigestDuplicatesPipeline': 301,
BOT_NAME+'.pipelines.BXJPostDigestJsonWirterPipeline': 302, |
<|file_name|>exercise2_60.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-16.html#%_thm_2.60
"""
from Chapter2.themes.lisp_list_structured_data import car, cdr, cons, lisp_list, nil, print_lisp_list
from Chapter2.themes.sequences_as_conventional_interfac... | """Computes intersection of set1 and set2"""
if set1 is nil or set2 is nil:
return nil
if element_of_set(car(set1), set2): |
<|file_name|>test-until.ts<|end_file_name|><|fim▁begin|>// Source file from duniter: Crypto-currency software to manage libre currency such as Ğ1
// Copyright (C) 2018 Cedric Moreau <cem.moreau@gmail.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero... | }
} |
<|file_name|>test_nmf.py<|end_file_name|><|fim▁begin|>import numpy as np
from scipy import linalg
from sklearn.decomposition import nmf
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import raises
from sklearn.utils.testing import assert_array_al... | |
<|file_name|>WSModificationRepository.java<|end_file_name|><|fim▁begin|>package com.compomics.pride_asa_pipeline.core.repository.impl.webservice;
import com.compomics.pride_asa_pipeline.core.model.modification.source.PRIDEModificationFactory;
import com.compomics.pride_asa_pipeline.core.model.modification.impl.Asap... | }
|
<|file_name|>parser.rs<|end_file_name|><|fim▁begin|>pub fn parse_line(line: &str) -> Vec<String> {
let mut vec = Vec::with_capacity(32);
let mut tmp_str = String::with_capacity(line.len());
let mut in_quotes = false;
for c in line.chars() {
match c {
' ' => {
if in_q... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate serde;
#[macro_use]
extern crate serde_derive;
mod gen;
pub use gen::*;
<|fim▁hole|> use super::*;
#[test]
fn get_perms() {
Role::all_roles();
}
}<|fim▁end|> | #[cfg(test)]
mod tests { |
<|file_name|>shortener.cpp<|end_file_name|><|fim▁begin|>/****************************************************************
* This file is distributed under the following license:
*
* Copyright (C) 2010, Bernd Stramm
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of ... | emit DoneShortening (message);
messageParts.erase (tag);
}
} |
<|file_name|>Transformer.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2010 JBoss 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... | package org.drools.runtime.pipeline;
|
<|file_name|>apple_ios_base.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.org/... | } |
<|file_name|>dropdown.js<|end_file_name|><|fim▁begin|>;(function () {
var defaults = {
"wrap": "this",//下拉列表用什么包裹,"this"为按钮自身,主流的插件放在"body"中
"data": null,
"formName": "",
"zIndex": 999
};
function Dropdown(opt) {
var $this = $(this),
id = $this.attr("id")... | |
<|file_name|>VisualizerCanvasPoincare.cpp<|end_file_name|><|fim▁begin|>#include "VisualizerCanvasPoincare.h"
#include <QMouseEvent>
#include <assert.h>
#include "VisualizerContext3D.h"
#include <cmath>
#include <limits>
#include <boost/foreach.hpp>
#include <algorithm>
#define pi 3.14159256
double log(double,int){
... | const double delta_phi = pi / 12.0; // Kugel wird in 15-Grad-Schritten unterteilt.
GLuint sphere = glGenLists(1); |
<|file_name|>a.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | #![allow(unused)]
#![crate_type = "proc-macro"] |
<|file_name|>mutation.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Facebook, Inc. and its affiliates.<|fim▁hole|> *
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
//! Tracking of commit mutations (amends, rebases, etc.)
use std::io::{Read... | |
<|file_name|>test_identifier_detail.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from nose.tools import * # flake8: noqa
import urlparse
from api.base.settings.defaults import API_BASE
from website.identifiers.model import Identifier
from tests.base import ApiTestCase
from osf_tests.factories import (
... | |
<|file_name|>PropertiesFactory.java<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> * @author Eric D. Dill eddill@ncsu.edu
* @author James D. Martin jdmartin@ncsu.edu
* Copyright © 2010-2013 North Carolina State University. All rights reserved
*/
package email;
import java.util.Properties;
public class PropertiesFact... | |
<|file_name|>PerLengthPhaseImpedance.java<|end_file_name|><|fim▁begin|>/**
*/
package CIM15.IEC61970.Wires;
import CIM15.IEC61970.Core.IdentifiedObject;
import java.util.Collection;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClas... | * <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated |
<|file_name|>EfuseCommand.cpp<|end_file_name|><|fim▁begin|>#include "../Resource/ResourceManager.h"
#include "../Resource/Handle/DLHandle.h"
#include "../Resource/Handle/DAHandle.h"
#include "../Err/FlashToolErrorCodeDef.h"
#include "../Conn/Connection.h"
#include "../Err/Exception.h"
#include "../Logger/Log.h"
#includ... | if(secure->_sbc_key1_E.buf_len > 0)
{
LOGI("sbc_public_key1_e = %s",
secure->_sbc_key1_E.buf); |
<|file_name|>util.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Several methods to simplify expressions involving unit objects.
"""
from __future__ import division
from sympy.utilities.exceptions import SymPyDeprecationWarning
from sympy import Add, Function, Mul, Pow, Rational, Tuple, sympify
from sy... | |
<|file_name|>multichecksum.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python
__author__ = "Andrew Hankinson (andrew.hankinson@mail.mcgill.ca)"
__version__ = "1.5"
__date__ = "2011"
__copyright__ = "Creative Commons Attribution"
__license__ = """The MIT License
Permission is hereby granted, free o... | m = reduce(__upd, contents, hashalg)
finally:
fd.close() |
<|file_name|>SelectionSort.java<|end_file_name|><|fim▁begin|>/**
* Created by avinashvundyala on 09/07/16.
*/
public class SelectionSort {
public int[] iterativeSelectionSort(int[] arr) {
int temp, smallIdx;
for(int i = 0; i < arr.length; i++) {
smallIdx = i;
for(int j = i; j < arr.length; j++)... | if(arr[smallIdx] > arr[j]) {
smallIdx = j; |
<|file_name|>authors.js<|end_file_name|><|fim▁begin|>const debug = require('ghost-ignition').debug('api:canary:utils:serializers:input:authors');
const slugFilterOrder = require('./utils/slug-filter-order');
const utils = require('../../index');
function setDefaultOrder(frame) {
if (!frame.options.order && frame.o... | |
<|file_name|>array.js<|end_file_name|><|fim▁begin|>//Version-IE: < 9
if ( 'function' !== typeof Array.prototype.reduce ) {
Array.prototype.reduce = function( callback /*, initialValue*/ ) {
'use strict';
if ( null === this || 'undefined' === typeof this ) {
throw new TypeError(
'Array.prototype... |
// 7. Repeat, while k < len
while (k < len) { |
<|file_name|>flat_map.rs<|end_file_name|><|fim▁begin|>use consumer::*;
use std::cell::RefCell;
use std::rc::Rc;
use stream::*;
struct FlatmapState<C, F> {
child: Rc<RefCell<Option<C>>>,
func: F,
}
impl<C, F, I, S> Consumer<I> for FlatmapState<C, F>
where F: FnMut(I) -> S,
C: Consumer<S::Item>,
... | }
impl<S, F, SO> Stream for Flatmap<S, F> |
<|file_name|>Charset5Main.java<|end_file_name|><|fim▁begin|>package com.cloudhopper.commons.charset.demo;
/*
* #%L
* ch-commons-charset
* %%
* Copyright (C) 2012 Cloudhopper by Twitter
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with th... | |
<|file_name|>treeview.js<|end_file_name|><|fim▁begin|>/**
* guy
* 异步树
* @class BI.TreeView
* @extends BI.Pane
*/
BI.TreeView = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.TreeView.superclass._defaultConfig.apply(this, arguments), {
_baseCls: "bi-tree",
... |
o.itemsCreator(op, function (res) {
if (self._stop === true) { |
<|file_name|>plate.py<|end_file_name|><|fim▁begin|># -----------------------------------------------------------------------------
# Copyright (c) 2016--, The Plate Mapper Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this so... | |
<|file_name|>account_payment_order.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# © 2015 Compassion CH (Nicolas Tran)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, models
class AccountPaymentOrder(models.Model):
_inherit = 'account.payment.order'
<|fim▁hole... | @api.multi
def open2generated(self):
""" |
<|file_name|>test_cred_client.py<|end_file_name|><|fim▁begin|># Copyright 2016 Hewlett Packard Enterprise Development LP
# 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.apac... |
class TestCredClientV3(base.TestCase):
def setUp(self):
super(TestCredClientV3, self).setUp() |
<|file_name|>test_paralleltools.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
__author__ = """Co-Pierre Georg (co-pierre.georg@uct.ac.za)"""
import sys
from src.paralleltools import Parallel
#-------------------------------------------------------------------------
#<|fim▁hole|>
... | # conftools.py is a simple module to manage .xml configuration files
#
#-------------------------------------------------------------------------
if __name__ == '__main__': |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># encoding: utf-8<|fim▁hole|># ## Imports
from threading import local as __local
# Expose these as importable from the top-level `web.core` namespace.
from .application import Application
from .util import lazy
# ## Module Globals
__all__ = ['local', 'Applicat... | |
<|file_name|>EntityTypeValidator.java<|end_file_name|><|fim▁begin|>/**
*
* $Id$
*/
package Variation_Diff.validation;
/**
* A sample validator interface for {@link Variation_Diff.EntityType}.
* This doesn't really do anything, and it's not a real EMF artifact.
* It was generated by the org.eclipse.emf.examples.... | * This can be disabled with -vmargs -Dorg.eclipse.emf.examples.generator.validator=false. |
<|file_name|>gendata.py<|end_file_name|><|fim▁begin|>class Project(object):
def __init__(self, name, start, end):
self.name = name
self.start = start
self.end = end
def __repr__(self):
return "Project '%s from %s to %s" % (
self.name, self.start.isoformat(), self.end.isofo... | ) |
<|file_name|>volume.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 Nexenta Systems, 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
# ... | :return: iscsiadm-formatted provider location string
""" |
<|file_name|>htckbdhandler.cpp<|end_file_name|><|fim▁begin|>/*
* Jeremy Compostella <jeremy.compostella@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of ... | |
<|file_name|>query_external_sheets_permanent_table.py<|end_file_name|><|fim▁begin|># Copyright 2019 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/l... | # application first with the following command:
# |
<|file_name|>project-cache-issue-31849.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
// http://www.... | U: ToStatic
{
type Static = (T::Static, U::Static); |
<|file_name|>util.py<|end_file_name|><|fim▁begin|>import sys
import os
import pkg_resources
VERSION = 0.5
<|fim▁hole|>
def resource_path(relative_path):
base_path = getattr(sys, '_MEIPASS', script_path)
full_path = os.path.join(base_path, relative_path)
if os.path.isfile(full_path):
return full_pat... | script_path = os.path.dirname(sys.argv[0]) |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2020 DDN. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
pub mod daemon;<|fim▁hole|>pub mod state;<|fim▁end|> | pub mod error;
pub mod reducers; |
<|file_name|>initdatabase.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-<|fim▁hole|>
conn = mysql.connector.connect(host="localhost",user="spike",password="valentine", database="drupal")
cann = mysql.connector.connect(host="localhost",user="spike",password="valentine", database="content_d... |
import mysql.connector
import time
import datetime |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
.. module:: radical.pilot.controller.pilot_launcher_worker
.. moduleauthor:: Ole Weidner <ole.weidner@rutgers.edu>
"""
__copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu"
__license__ = "MIT"
from unit_manager_controller import UnitManagerContr... | from pilot_manager_controller import PilotManagerController
from input_file_transfer_worker import InputFileTransferWorker
from output_file_transfer_worker import OutputFileTransferWorker |
<|file_name|>clip-docs-2.ts<|end_file_name|><|fim▁begin|>import * as clipboardy from 'clipboardy'
const rows = clipboardy.readSync();
const transformed = rows.split('\n')
.map(row => {
const cells = row.split('\t').map(cell => (cell || '').replace(/\n/g, ' ').trim());
return ` /** ${cel... | })
.join('\n');
|
<|file_name|>Editor.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit.Editor"]){ //_hasResource checks added by ... | this.endEditing(true); |
<|file_name|>replication_controller.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/LICE... | }
}
glog.V(4).Infof("Pod %s/%s deleted through %v, timestamp %+v, labels %+v.", pod.Namespace, pod.Name, utilruntime.GetCaller(), pod.DeletionTimestamp, pod.Labels)
if rc := rm.getPodController(pod); rc != nil { |
<|file_name|>CVar.cpp<|end_file_name|><|fim▁begin|>#include <stdio.h>
#include <sstream>
#include <bitset>
#include "CVar.h"
#include "../dbnet/db_net.hpp"
CVar::CVar(int iWid, int iType, std::string sRem) : m_iWid(iWid), m_iType(iType), m_sRem(sRem)
{
m_bSync = false;
}
void CVar::AddAlias(int iBit, std::string s... | case TYPE_FLOAT:
{ |
<|file_name|>dynamic.to.top.min.js<|end_file_name|><|fim▁begin|>/*
* Dynamic To Top Plugin
* http://www.mattvarone.com
*
* By Matt Varone
* @sksmatt
*
*/
var mv_dynamic_to_top;(function($,mv_dynamic_to_top){jQuery.fn.DynamicToTop=function(options){var defaults={text:mv_dynamic_to_top.text,min:parseInt(mv_dynamic... | if(!$.isFunction(settings.easing)){settings.easing='linear';} |
<|file_name|>agent.rs<|end_file_name|><|fim▁begin|>#![allow(non_snake_case)]
use std::collections::HashMap;
use request::Handler;
use serde_json;
use error::ConsulResult;
use std::error::Error;
use super::{Service, RegisterService, TtlHealthCheck};
/// Agent can be used to query the Agent endpoints
pub struct Agent... | let json_str = serde_json::to_string(&service)
.map_err(|e| e.description().to_owned())?;
|
<|file_name|>dataerrorview.directive.js<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2021 Inera AB (http://www.inera.se)
*
* This file is part of sklintyg (https://github.com/sklintyg).
*<|fim▁hole|> *
* sklintyg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the im... | * sklintyg is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache Li... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>export { piMatch } from './pimatch'
export { titleCapitalize } from './titlecapitalization'<|fim▁hole|><|fim▁end|> | export { wordScore } from './wordscore' |
<|file_name|>gblackboard.cpp<|end_file_name|><|fim▁begin|>#include "gblackboard_p.h"
#include "gblackboard_p_p.h"
#include "gghosttree_p.h"
#include "gghostnode_p.h"
typedef QHash<QQmlEngine *, QPointer<GBlackboard> > GlobalBlackboards;
Q_GLOBAL_STATIC(GlobalBlackboards, theGlobalBlackboards)
// class GBlackboard
G... | Q_D(GBlackboard);
if (value.isUndefined()) { |
<|file_name|>PaginationControlsView_spec.js<|end_file_name|><|fim▁begin|>var createFakeModel = function () { return sinon.createStubInstance(Backbone.Model); };
var createFakeCollection = function () { return sinon.createStubInstance(Backbone.Collection); };
requireMock.requireWithStubs(
{
'models/SearchParamsMo... | |
<|file_name|>test_stl.cpp<|end_file_name|><|fim▁begin|>#include "test_stl.h"
#include <QSet>
#include <QtTest/QtTest>
#include <vector>
#include <cstring>
#include <cwchar>
#include "../src/utils/stl.h"
void STLTest::testBufferArry() {
using utils::BufferArray;
// constructor
std::string test1("123456789abcdefg... | // move
std::string test3("gqjdiw913abc_123d");
BufferArray other_buffer(test3); |
<|file_name|>Renderer.cpp<|end_file_name|><|fim▁begin|>#include "Renderer.h"
#include "Core/Windows/Window.h"
#include <Resources/ResourceCache.h>
namespace uut
{
UUT_MODULE_IMPLEMENT(Renderer)
{}
Renderer::Renderer()
: _screenSize(0)
{
}
Renderer::~Renderer()
{
}
////////////////////////////////////////... | return true;
} |
<|file_name|>1.cpp<|end_file_name|><|fim▁begin|>//
// Created by icebeetle on 18-6-23.
//
#include<bits/stdc++.h>
using namespace std;
struct _t {
int x, y, z, t;
explicit _t(int xx = 0, int yy = 0, int zz = 0, int tt = 0) : x(xx), y(yy), z(zz), t(tt) {};
friend bool operator<(const _t &a, const _t &b)... | if (mcnt <= cnt) { |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.core.validators import MinValueValidator, MaxValueValidator
from django.conf import settings
from datetime import datetime
import uuid
User = settings.AUTH_USER_MODEL
def generate_new_uuid():
return str(uuid.uuid4())
clas... | class chemotaxisTimeEventType_model(models.Model):
uuid = models.CharField(('Unique Identifier'), max_length=36, primary_key=True, default=generate_new_uuid) |
<|file_name|>helloWorldController.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
app.get('/hello/world', function(request, response){
var responseObject = { "hello": "world"}
response.send(responseObject);
});
};
module.exports = helloWorldController;<|fim▁end|> | var helloWorldController = function(app){ |
<|file_name|>good-edit.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnDestroy, OnInit, Self } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Subscription, BehaviorSubject, combineLatest } from 'rxjs';
import { switchMap, map } from 'rxjs/operators';
import { MatSnackBa... | }
public ngOnDestroy(): void { |
<|file_name|>defs.rs<|end_file_name|><|fim▁begin|>//-
// Copyright (c) 2016, 2017, Jason Lingle
//
// This file is part of Ensync.
//
// Ensync 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 vers... | FileData::Directory(_) => true, |
<|file_name|>usa2Low.min.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1
oid sha256:bdecbb5008fcaa6e28cdb99aada4e0c3dc8dfa6bd53bb4d6e63005c7538ee886<|fim▁hole|>size 30020<|fim▁end|> | |
<|file_name|>search_results.js<|end_file_name|><|fim▁begin|>var Entry = require("entry");
var reds = require("reds");
var transliterate = require("transliteration");
module.exports = function (req, callback) {
var blogID = req.blog.id;
// We couldn't find a search query
if (!req.query.q) {
return callback(n... | search.query(q).end(function (err, ids) {
if (err) return callback(err); |
<|file_name|>problems.rs<|end_file_name|><|fim▁begin|>#[derive(PartialEq, Debug)]
pub enum ProblemType {
MAX,<|fim▁hole|><|fim▁end|> | MIN,
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.