prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>tabs.py<|end_file_name|><|fim▁begin|># Copyright 2012 Nebula, 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... | template_name = ("project/volumes/volumes/_detail_overview.html") |
<|file_name|>cobalt.py<|end_file_name|><|fim▁begin|>import logging
import os
import time
from parsl.providers.error import ScaleOutFailed
from parsl.channels import LocalChannel
from parsl.launchers import AprunLauncher
from parsl.providers.cobalt.template import template_string
from parsl.providers.cluster_provider i... | command = 'qsub -n {0} {1} -t {2} {3} {4}'.format( |
<|file_name|>RemoveLayerTask.ts<|end_file_name|><|fim▁begin|>/**
* Copyright © 2021 Rémi Pace.
* This file is part of Abc-Map.
*
* Abc-Map 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 Software Foundation, either ve... | public async undo(): Promise<void> {
this.map.addLayer(this.layer);
this.map.setActiveLayer(this.layer); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from HardwareInterface import *<|fim▁hole|>from DataInterface import *<|fim▁end|> | from CameraInterface import *
#from ProtocolRunner import * |
<|file_name|>mapa.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# TODO: PORASQUI: BUG: Cerrar la ventana no detiene el GMapCatcher y se queda
# como un proceso de fondo en espera bloqueante... Ni atiende al Ctrl+C
# siquiera.
import sys, os.path
dirfichero = os.path.realpath(os.path.... | m.put_mapa(w) |
<|file_name|>remote-client.py<|end_file_name|><|fim▁begin|>from code import InteractiveConsole
import sys
try:
import websocket
except:
print('Please install websocket_client')
raise
class InteractiveRemoteConsole(InteractiveConsole):
def __init__(self, uri=None):
if uri is None:
u... | pass
console.interact(banner, exitmsg)
|
<|file_name|>translate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import codecs
import csv
import fnmatch
import inspect
import locale
import os
import openerp.sql_db as sql_db
import re
import logging
import tarfile
import tempfil... | # discard the target from the POT targets.
src = dic['src']
if src in pot_targets:
target = pot_targets[src] |
<|file_name|>namegame.py<|end_file_name|><|fim▁begin|>"""Namegame, where you try to remember a team number starting with the last number of the previous played team"""
import asyncio
import gzip
import pickle
import traceback
from collections import OrderedDict
from functools import wraps
import discord
import tbapi
f... | |
<|file_name|>cli.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import argparse
import bz2
import gzip
import os.path
import sys
from csvkit import CSVKitReader
from csvkit.exceptions import ColumnIdentifierError, RequiredHeaderError
def lazy_opener(fn):
def wrapped(self, *args, **kwargs):
self._l... | If you want to constrain which common args are present, you can pass a string for 'omitflags'. Any argument
whose single-letter form is contained in 'omitflags' will be left out of the configured parser. Use 'f' for
file.
""" |
<|file_name|>js.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/. */
//! Smart pointers for the JS-managed DOM objects.
//!
//! The DOM... | } |
<|file_name|>bind_polyfill.js<|end_file_name|><|fim▁begin|>Function.prototype.bind = Function.prototype.bind || function (target) {
var self = this;
return function (args) {
if (!(args instanceof Array)) {
args = [args];
}
self.apply(target, args);
<|fim▁hole|>};<|fim▁end|> | };
|
<|file_name|>fake_features.go<|end_file_name|><|fim▁begin|>// Code generated by client-gen. DO NOT EDIT.
package fake
import (
config_v1 "github.com/openshift/api/config/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8... | func (c *FakeFeatures) Create(features *config_v1.Features) (result *config_v1.Features, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(featuresResource, features), &config_v1.Features{})
if obj == nil { |
<|file_name|>magma_s_init.cpp<|end_file_name|><|fim▁begin|>/*
-- MAGMA (version 1.5.0-beta3) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date July 2014
@generated from magma_z_init.cpp normal z -> s, Fri Jul 18 17:34:30 2014
@a... | */ |
<|file_name|>shard.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2018 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without l... | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
<|file_name|>SearchBar.styles.ts<|end_file_name|><|fim▁begin|>/*
* @author Stéphane LaFlèche <stephane.l@vanillaforums.com>
* @copyright 2009-2021 Vanilla Forums Inc.
* @license GPL-2.0-only
*/
import { globalVariables } from "@library/styles/globalStyleVars";
import { useThemeCache } from "@library/styles/themeCa... | right: 0, |
<|file_name|>key_loader.py<|end_file_name|><|fim▁begin|>def load_keys(filepath):
"""
Loads the Twitter API keys into a dict.<|fim▁hole|> """
try:
keys_file = open(filepath, 'rb')
keys = {}
for line in keys_file:
key, value = line.split('=')
keys[key.strip()... | :param filepath: file path to config file with Twitter API keys.
:return: keys_dict
:raise: IOError |
<|file_name|>sink.spec.js<|end_file_name|><|fim▁begin|>'use strict';
/* jshint ignore:start */
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
/* jshint ignore:end */
var Holodeck = require('../../../holodeck'); /* jshint ignore:line */
var Request ... | 'previous_page_url': null,
'url': 'https://events.twilio.com/v1/Sinks?InUse=True&PageSize=20&Page=0',
'next_page_url': null,
'key': 'sinks' |
<|file_name|>test_chgrp.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (C) 2012 University of Dundee & Open Microscopy Environment.
All Rights Reserved.
Copyright 2013 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms... | |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>var test = require('tst')
var assert = require('assert')
var noise = require('..')
test('white noise', () => {
assert(typeof noise.white() === 'function')
})
test('pink noise', () => {
assert(typeof noise.pink() === 'function')
})
test('brown noise', () => {<|fim... | |
<|file_name|>check_prefixes.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
import os
import sys
import subprocess
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))<|fim▁hole|>
def get_registries():
registries = []
directories = os.listdir(PREFIXES_PATH)
directories.append(... | from lutris.util.wineregistry import WineRegistry
PREFIXES_PATH = os.path.expanduser("~/Games/wine/prefixes") |
<|file_name|>FileDoesNotExistException.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017 Axway Software
*
* 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/... | |
<|file_name|>storage.py<|end_file_name|><|fim▁begin|># Copyright 2015, 2017 IBM Corp.
#
# 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/LICEN... | :param adapter: The adapter for the pypowervm API
:param instance: The nova instance
:param injected_files: A list of file paths that will be injected into |
<|file_name|>car.py<|end_file_name|><|fim▁begin|>"""
Constructs a planner that is good for being kinda like a car-boat thing!
"""
from __future__ import division
import numpy as np
import numpy.linalg as npl
from params import *
import lqrrt
################################################# DYNAMICS
magic_rudder = ... | |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from functools import update_wrapper, wraps
from unittest import TestCase
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import (
login_required, permission_required, user_passes_test,
)
from django.http... | request.method = 'PUT'
self.assertIsInstance(my_safe_view(request), HttpResponseNotAllowed)
request.method = 'DELETE' |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use separator::Separatable;
#[test]
fn negative_nine_hundred_million() {
let i : i128 = -900000000;
assert_eq!("-900,000,000", &i.separated_string());
}
#[test]
fn negative_ninety_million() {
let i : i128 = -90000000;
assert_eq!("-90,000,000", &i.separa... | }
|
<|file_name|>mscorlib_System_Runtime_Serialization_SerializationObjectManager.cpp<|end_file_name|><|fim▁begin|>#include <mscorlib/System/Runtime/Serialization/mscorlib_System_Runtime_Serialization_SerializationObjectManager.h>
#include <mscorlib/System/mscorlib_System_Type.h>
#include <mscorlib/System/mscorlib_System_S... |
}
}
} |
<|file_name|>test_hgnc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import unittest
import logging
from tests.test_source import SourceTestCase<|fim▁hole|>
class HGNCTestCase(SourceTestCase):
def setUp(self):
self.source = HGNC('rdf_graph', True)
self.source.test_ids = self.all_test_ids... | from dipper.sources.HGNC import HGNC
logging.basicConfig(level=logging.WARNING)
logger = logging.getLogger(__name__) |
<|file_name|>AccountTag.tsx<|end_file_name|><|fim▁begin|>import { IPromise } from 'angular';
import React from 'react';
import { AccountService } from './AccountService';
export interface IAccountTagProps {
account: string;
className?: string;
}
export interface IAccountTagState {
isProdAccount: boolean;
}
exp... | |
<|file_name|>mkdir.hpp<|end_file_name|><|fim▁begin|>// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law ... | // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<|file_name|>defined.js<|end_file_name|><|fim▁begin|>function defined (constant_name) {
// http://kevin.vanzonneveld.net
// + original by: Waldo Malqui Silva
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + revised by: Brett Zamir (http://brett-zamir.me)
// % ... | // % note 1: in a threaded environment, e.g., DOM worker threads)
// * example 1: defined('IMAGINARY_CONSTANT1');
// * returns 1: false
var tmp = this.window[constant_name]; |
<|file_name|>mdarray_test.cpp<|end_file_name|><|fim▁begin|>//
// (c) Copyright 2013 DESY, Eugen Wintersberger <eugen.wintersberger@desy.de>
//
// This file is part of pninexus.
//
// pninexus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
... | // GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with pninexus. If not, see <http://www.gnu.org/licenses/>. |
<|file_name|>types.py<|end_file_name|><|fim▁begin|># This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from sqlalchem... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import include, url
from django.contrib import admin
from Poller import views<|fim▁hole|> url(r'^(?P<pk>\d+)/$', views.DetailView.as_view(), name='detail'),
url(r'^(?P<pk>\d+)/results/$', views.ResultsView.as_view(), name='results'),
url... |
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'), |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
//
// Benchmark testing
//
// Test serialization and deserialzation of a MicrovmState for a default VMM:
// - 1 VCPU
// - 128 MB memory size
// - no devi... | black_box(snapshot_len),
black_box(version_map.clone()), |
<|file_name|>kex.rs<|end_file_name|><|fim▁begin|>use ::NailResult;
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use rand::{self, Rng};
use ssh::CompressionAlgorithm::{Xz, Zlib, NoComp};
use ssh::EncryptionAlgorithm::{TripleDesCbc, BlowfishCbc, Twofish256Cbc, Twofish192Cbc,
Two... | Ok(kex_packet)
} |
<|file_name|>HeartbeatManager.java<|end_file_name|><|fim▁begin|>package ch.spacebase.openclassic.api;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Un... | * @param id ID of the custom heartbeat. |
<|file_name|>RespawnGui.java<|end_file_name|><|fim▁begin|>package io.github.phantamanta44.pwarfare.gui;
import io.github.phantamanta44.pwarfare.Game;
import io.github.phantamanta44.pwarfare.data.GameMap;
import io.github.phantamanta44.pwarfare.data.GameMap.GameMode;
import io.github.phantamanta44.pwarfare.data.GamePla... | |
<|file_name|>loadbalancer_test.go<|end_file_name|><|fim▁begin|>// Copyright 2018 Authors of Cilium
//
// 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... | Port: 1,
},
ID: 1,
}, |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 TiKV Project Authors. Licensed under Apache-2.0.
use concurrency_manager::ConcurrencyManager;
use criterion::{black_box, BatchSize, Bencher, Criterion};
use kvproto::kvrpcpb::Context;
use test_util::KvGenerator;
use tikv::storage::kv::{Engine, WriteDat... | |
<|file_name|>0005_auto_20160621_1438.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10a1 on 2016-06-21 09:08
from __future__ import unicode_literals
from django.conf import settings<|fim▁hole|>from django.db import migrations, models
import django.db.models.deletion
class Migration(m... | |
<|file_name|>XceiverClientSpi.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to yo... | /**
* Sends a given command to server gets a waitable future back.
*
* @param request Request |
<|file_name|>memory.js<|end_file_name|><|fim▁begin|>// ----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------
var promises = require('../utilities/promises')... | function items(table) {
var name = table.name.toLowerCase(); |
<|file_name|>Calibrate.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# ======================================================================
import pangloss
import sys,getopt,cPickle,numpy
import scipy.stats as stats
# ======================================================================
def Calibrate(ar... | |
<|file_name|>AppRouter.js<|end_file_name|><|fim▁begin|>/**
*
* app.js
*
* This is the entry file for the application
*
*/
import FilmLocationSearchComponent from '../MovieSearchApp/Containers/FilmSearchContainer/FilmSearchComponent';
import AppComponent from '../CommonComponent/app.js';
import React from 'react';
... |
const getAppRouter = () => {
return (
<Route component={AppComponent}> |
<|file_name|>api.go<|end_file_name|><|fim▁begin|>// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package translate
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
)
const opText = "TranslateText"
// TextRequest generate... |
// Text API operation for Amazon Translate.
// |
<|file_name|>web3.js<|end_file_name|><|fim▁begin|>require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.ex... | } |
<|file_name|>testmagicmethods.py<|end_file_name|><|fim▁begin|># Copyright (C) 2007-2011 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
from tests.support import unittest2, inPy3k
try:
unicode
except NameError:
# Python 3
unicode = st... | self.assertEqual(float(mock), 1.0) |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for urlscript project.
Generated by 'django-admin startproject' using Django 1.9.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.... | }, |
<|file_name|>Resources.py<|end_file_name|><|fim▁begin|>__author__ = 'mpetyx'
from tastypie.authorization import DjangoAuthorization
from .models import OpeniQuestion
from OPENiapp.APIS.OpeniGenericResource import GenericResource
from OPENiapp.APIS.OPENiAuthorization import Authorization
from OPENiapp.APIS.OPENiAuthe... | |
<|file_name|>time_linux.go<|end_file_name|><|fim▁begin|>package archive // import "github.com/ory/dockertest/v3/docker/pkg/archive"
import (<|fim▁hole|>func timeToTimespec(time time.Time) (ts syscall.Timespec) {
if time.IsZero() {
// Return UTIME_OMIT special value
ts.Sec = 0
ts.Nsec = ((1 << 30) - 2)
return
... | "syscall"
"time"
)
|
<|file_name|>mongo.rs<|end_file_name|><|fim▁begin|>extern crate bson;
extern crate mongo_driver;
use bson::Bson;
use mongo_driver::CommandAndFindOptions;
use mongo_driver::client::{ClientPool, Uri};
use mongo_driver::collection::UpdateOptions;
use mongo_driver::flags::UpdateFlag;<|fim▁hole|>use storage::error::{StoreE... |
use config::DBConfig;
use objects::{utils, Object}; |
<|file_name|>stat.js<|end_file_name|><|fim▁begin|>'use strict'
const utils = require('../../utils')<|fim▁hole|>
module.exports = {
command: 'stat <key>',
describe: 'Get stats for the DAG node named by <key>',
builder: {},
handler (argv) {
utils.getIPFS((err, ipfs) => {
if (err) {
throw err... | const debug = require('debug')
const log = debug('cli:object')
log.error = debug('cli:object:error') |
<|file_name|>factories.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import factory
from data.tests.factories import DepartmentFactory
from ..models import Tourist, TouristCard
class TouristFactory(factory.DjangoModelFactory):<|fim▁hole|>
class Meta:
model = Tourist
first_name = 'Dave'
... | |
<|file_name|>database.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 3 of ... |
#[cfg(test)]
mod client_tests { |
<|file_name|>alarm_control_panel.py<|end_file_name|><|fim▁begin|>"""Support for SimpliSafe alarm control panels."""
import logging
import re
from simplipy.entity import EntityTypes
from simplipy.system import SystemStates
from homeassistant.components.alarm_control_panel import (
FORMAT_NUMBER,
FORMAT_TEXT,
... | |
<|file_name|>server.py<|end_file_name|><|fim▁begin|>import threading
import time
from . import _impl
from .common import *
from .connection import *
from .networktablenode import NetworkTableNode
from .type import NetworkTableEntryTypeManager
import logging
logger = logging.getLogger('nt')
__all__ = ["NetworkTableSe... |
def updateEntry(self, entry, sequenceNumber, value):
with self.entry_lock:
if entry.putValue(sequenceNumber, value): |
<|file_name|>flush.rs<|end_file_name|><|fim▁begin|>// This file is part of rust-web/twig<|fim▁hole|>use extension::api::TokenParser;
use engine::Node;
use engine::parser::{Job, ParserError};
use engine::parser::token::stream::Item;
use api::error::Traced;
#[derive(Debug, Default)]
pub struct Flush;
impl TokenParser f... | //
// For the copyright and license information, please view the LICENSE
// file that was distributed with this source code.
|
<|file_name|>libnpmsearch-tests.ts<|end_file_name|><|fim▁begin|>import search = require('libnpmsearch');
const opts: search.Options = {
limit: 20,
from: 0,
detailed: false,
sortBy: 'optimal',
registry: 'https://registry.npmjs.org',
token: 'token',
};
<|fim▁hole|>search.stream('libnpm'); // $Ex... | search('libnpm'); // $ExpectType Promise<Result[]>
search('libnpm', opts); // $ExpectType Promise<Result[]>
search('libnpm', { detailed: true }); // $ExpectType Promise<DetailedResult[]> |
<|file_name|>haversine.py<|end_file_name|><|fim▁begin|>from math import radians, cos, sin, asin, sqrt
def haversine(lon1, lat1, lon2, lat2):
"""
Calculate the great circle distance between two points
on the earth (specified in decimal degrees)
"""
# convert decimal degrees to radians
lon1, lat1... | |
<|file_name|>bosun.js<|end_file_name|><|fim▁begin|>/// <reference path="angular.d.ts" />
/// <reference path="angular-route.d.ts" />
/// <reference path="angular-sanitize.d.ts" />
/// <reference path="bootstrap.d.ts" />
/// <reference path="moment.d.ts" />
/// <reference path="moment-duration-format.d.ts" />
/// <refer... | dp.k = moment.utc(last.k, tsdbDateFormat).add(15, 'seconds').format();
$scope.dps.push(dp);
}
}; |
<|file_name|>fulfillments.update_fulfillment.js<|end_file_name|><|fim▁begin|>// Copyright 2022 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/... |
function main(fulfillment, updateMask) {
// [START dialogflow_v2_generated_Fulfillments_UpdateFulfillment_async] |
<|file_name|>OutputBindingCard.tsx<|end_file_name|><|fim▁begin|>import i18next from 'i18next';
import { Link } from 'office-ui-fabric-react';
import React, { useContext } from 'react';
import { useTranslation } from 'react-i18next';
import { ReactComponent as OutputSvg } from '../../../../../../images/Common/output.svg... | |
<|file_name|>error_codes_check.rs<|end_file_name|><|fim▁begin|>//! Checks that all error codes have at least one test to prevent having error
//! codes that are silently not thrown by the compiler anymore.
use std::collections::HashMap;
use std::ffi::OsStr;
use std::fs::read_to_string;
use std::path::Path;
use regex:... | f: &str,
error_codes: &mut HashMap<String, ErrorCodeStatus>,
path: &Path,
errors: &mut Vec<String>, |
<|file_name|>StatelessAuthenticationFilter.java<|end_file_name|><|fim▁begin|>package conqueror.security;
import io.jsonwebtoken.JwtException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.context.Secur... | import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
|
<|file_name|>test_ubl.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from odoo.addons.account_edi.tests.common import AccountEdiTestCommon
from odoo.tests import tagged
from odoo import Command
@tagged('post_install_l10n', 'post_install', '-at_install')
class TestL10nBeEdi(AccountEdiTestCommon):
@classm... | self.assertEqual(len(self.env['account.move'].search([])), invoice_count)
self.assertEqual(invoice.amount_total, 666.50)
self.assertEqual(invoice.amount_tax, 115.67) |
<|file_name|>common-defines.cpp<|end_file_name|><|fim▁begin|>////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2016 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Vers... | |
<|file_name|>midi_output.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of Linux Show Player
#
# Copyright 2012-2016 Francesco Ceruti <ceppofrancy@gmail.com>
#
# Linux Show Player is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Licens... | # GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License |
<|file_name|>textarea.js<|end_file_name|><|fim▁begin|>"use strict";
var m = require("mithril"),
assign = require("lodash.assign"),
id = require("./lib/id"),
hide = require("./lib/hide"),<|fim▁hole|>module.exports = {
controller : function(options) {
var ctrl = this;
ctrl.id ... | label = require("./lib/label"),
css = require("./textarea.css");
|
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import htmlPy
import socket
import json
import os
sock = socket.socket()
sock.connect(('localhost', 5002))
sock.send(b'')
sock.recv(1024)
sock.recv(1024)
sock.recv(1024)
app = htmlPy.AppGUI(title=u"Python Best Ever", maximized=True)
app.template_path = os.path.abspa... | def link(self, url): |
<|file_name|>FindUsedTypes.cpp<|end_file_name|><|fim▁begin|>//===- FindUsedTypes.cpp - Find all Types used by a module ----------------===//
//
// The LLVM Compiler Infrastructure
//
<|fim▁hole|>//
//===----------------------------------------------------------------------===//
//
// This pass... | // This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
|
<|file_name|>many_single_char_names.rs<|end_file_name|><|fim▁begin|>#![allow(clippy::too_many_arguments, clippy::diverging_sub_expression)]
#![warn(clippy::many_single_char_names)]
fn bla() {
let a: i32;
let (b, c, d): (i32, i64, i16);
{
{
let cdefg: i32;
let blar: i32;
... | {
let e: i32; |
<|file_name|>util.py<|end_file_name|><|fim▁begin|>import collections
import functools
import dpath
import six
import pprint
import stringcase
from pyutrack.logger import get_logger
def print_friendly(value, sep=', '):
if isinstance(value, six.string_types):
return value
if isinstance(value, collect... | for attribute, lookup in dct.get('__attributes__', {}).items():
getter = functools.partial(Type.Base._get_attribute, lookup=lookup)
getter.__doc__ = attribute |
<|file_name|>form_group_name.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google LLC 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 {Directive, forwardRef, Host, Inject, Input, OnDe... | export const formGroupNameProvider: any = {
provide: ControlContainer, |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.contrib import messages
from models import UserVote
from forms import UserV... | |
<|file_name|>sttClient.py<|end_file_name|><|fim▁begin|>#
# Copyright IBM Corp. 2014
#
# 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 r... | |
<|file_name|>conv.cpp<|end_file_name|><|fim▁begin|>/* Copyright (c) 2005, 2006 by CodeSourcery. All rights reserved.
This file is available for license from CodeSourcery, Inc. under the terms
of a commercial license and under the GPL. It is not part of the VSIPL++
reference implementation and is not availab... | |
<|file_name|>cmp.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
use core::cmp::Ordering::{self, Less, Equal, Greater};
// pub trait FixedSizeArray<T> {
// /// Converts the array to immutable slice
// fn as_slice(&self) -> &[T];
// /// Conv... | // __impl_slice_eq2! { [A; $N], [B] }
// __impl_slice_eq2! { [A; $N], &'b [B] }
// __impl_slice_eq2! { [A; $N], &'b mut [B] }
// // __impl_slice_eq2! { [A; $N], &'b [B; $N] } |
<|file_name|>api.quiz.test.js<|end_file_name|><|fim▁begin|>describe("Quiz API Tests", function() {
var api;
var mock;
beforeAll(function(done) {
api = Playbasis.quizApi;
mock = window.mock;
window.acquireBuiltPlaybasis();
done();
});
describe("List Active Quizzes test", function() {
beforeAll(function... | |
<|file_name|>test_deeplab.py<|end_file_name|><|fim▁begin|># --------------------------------------------------------
# Deformable Convolutional Networks
# Copyright (c) 2016 by Contributors
# Copyright (c) 2017 Microsoft
# Licensed under The Apache-2.0 License [see LICENSE for details]
# Modified by Zheng Zhang
# -----... |
# infer shape
data_shape_dict = dict(test_data.provide_data_single) |
<|file_name|>oneClickInstallerTest.ts<|end_file_name|><|fim▁begin|>import { Arch, Platform } from "electron-builder"
import { copyFile, writeFile } from "fs-extra"
import * as path from "path"
import { assertThat } from "../helpers/fileAssert"
import { app, assertPack, copyTestAsset, modifyPackageJson } from "../helper... | app( |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright (c) 2010 OpenStack, 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
#
# http://www.apache.org/licenses... | from glance.openstack.common import setup
from glance.version import version_info as version
requires = setup.parse_requirements() |
<|file_name|>ptr_offset_0_plus_0.rs<|end_file_name|><|fim▁begin|>// error-pattern: invalid use of NULL pointer
fn main() {<|fim▁hole|><|fim▁end|> | let x = 0 as *mut i32;
let _x = x.wrapping_offset(8); // ok, this has no inbounds tag
let _x = unsafe { x.offset(0) }; // UB despite offset 0, NULL is never inbounds
} |
<|file_name|>test_media_player.py<|end_file_name|><|fim▁begin|>"""Tests for Vizio config flow."""
from __future__ import annotations
from contextlib import asynccontextmanager
from datetime import timedelta
from typing import Any
from unittest.mock import call, patch
import pytest
from pytest import raises
from pyviz... | |
<|file_name|>ProjectIntegrationTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2012-present Facebook, 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.apac... | |
<|file_name|>hdfs_disk_usage_per_datanode.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Joseph Herlant <herlantj@gmail.com>
# File name: hdfs_disk_usage_per_datanode.py
# Creation date: 2014-10-08
#
# Distributed under terms of the GNU GPLv3 license.
"""
This nagios active ... | print ('WARNING:%s |%s' % (w_msg, perfdata)).strip(',')[:1024] |
<|file_name|>PersonService.java<|end_file_name|><|fim▁begin|>package com.walmart.labs.pcs.normalize.MongoDB.SpringBoot.service;
import com.walmart.labs.pcs.normalize.MongoDB.SpringBoot.entity.Person;
import com.walmart.labs.pcs.normalize.MongoDB.SpringBoot.repository.PersonRepository;
import com.walmart.labs.pcs.norma... | @Autowired
private PersonRepository personRepository;
|
<|file_name|>seq_with_cursor.py<|end_file_name|><|fim▁begin|>#
# Copyright 2003,2004 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
# misc utilities
from __future__ import absolute_import
from __future__ import division
from __future__ import unicod... |
def prev (self):
new_index = self.index - 1 |
<|file_name|>promise.js<|end_file_name|><|fim▁begin|>~function (global) {
// status
var PENDING = 0,
FULFILLED = 1,
REJECTED = 2;
var Promise = function (fun) {
var me = this,
resolve = function (val) {
me.resolve(val);
},
... | if (this._status === PENDING) {
this._status = REJECTED;
this._onRejected && this._onRejected(val);
} |
<|file_name|>lisp.rs<|end_file_name|><|fim▁begin|>#![macro_use]
//! This module contains Rust definitions whose C equivalents live in
//! lisp.h.
use libc::{c_char, c_void, intptr_t, ptrdiff_t, uintptr_t};
#[cfg(test)]
use std::cmp::max;
use std::convert::From;
use std::fmt::{Debug, Error, Formatter};
use std::mem;
... |
impl CarIter { |
<|file_name|>test_wikidata.py<|end_file_name|><|fim▁begin|>def test_signal_wikidata_url(ranker):
rank = lambda url: ranker.client.get_signal_value_from_url("wikidata_url", url)<|fim▁hole|> assert rank("http://www.douglasadams.com") > 0.5
assert rank("http://www.douglasadams.com/?a=b") > 0.5
assert rank("... | |
<|file_name|>AgendaChart.js<|end_file_name|><|fim▁begin|>import React, {PropTypes, Component} from 'react';
import moment from 'moment';
import StyleSheet from 'styles/agenda.styl';
export default class AgendaChart extends Component {
static propTypes = {
items: PropTypes.array,
currentDate: PropTypes.number... | |
<|file_name|>ToastText.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
import { Icon } from './Icon';
interface IProps {
id?: string;
title?: string | React.ReactNode;
icon?: string;
onClose: () => void;
}
const ToastText = ({ id, title, icon, onClose}: IProps) => {
const ref = React.useRef... | |
<|file_name|>preprocessors.py<|end_file_name|><|fim▁begin|>"""
Prototype demo:
python holoviews/ipython/convert.py Conversion_Example.ipynb | python
"""
import ast
from nbconvert.preprocessors import Preprocessor
def comment_out_magics(source):
"""
Utility used to make sure AST parser does not choke on unrec... | |
<|file_name|>canonical_alias.rs<|end_file_name|><|fim▁begin|>//! Types for the [`m.room.canonical_alias`] event.<|fim▁hole|>use ruma_macros::EventContent;
use serde::{Deserialize, Serialize};
use crate::RoomAliasId;
/// The content of an `m.room.canonical_alias` event.
///
/// Informs the room as to which alias is th... | //!
//! [`m.room.canonical_alias`]: https://spec.matrix.org/v1.2/client-server-api/#mroomcanonical_alias
|
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pywim documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possibl... |
import pywim |
<|file_name|>mth-to-last-element.py<|end_file_name|><|fim▁begin|>import sys
def main():
with open(sys.argv[1]) as input_file:
for line in input_file.readlines():
input_list = list(reversed(line.strip().split(' ')))
index = int(input_list[0])
del input_list[0]
... | |
<|file_name|>token.go<|end_file_name|><|fim▁begin|>package token
import (
"encoding/base32"
"net/http"
"time"
"github.com/dgrijalva/jwt-go"
"github.com/dgrijalva/jwt-go/request"
)
const (
// UserToken is the kind of token to represent a user token.
UserToken = "user"
// SessToken is the kind of token to rep... |
// SignUnlimited signs a token the never expires. |
<|file_name|>FrozenSerializationBench.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* 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... | size_t s = 0;
|
<|file_name|>ip2_convolve3x3.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* ... | |
<|file_name|>waterfall_sink_c_impl.cc<|end_file_name|><|fim▁begin|>/* -*- c++ -*- */
/*
* Copyright 2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*... | return retarg;
}
void |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.