prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>lib.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/. */
//! An actor-based remote devtools server implementation. Only te... | __type__: "networkEventUpdate".to_string(),
updateType: "responseStart".to_string(),
response: actor.get_response_start() |
<|file_name|>buildhistory.py<|end_file_name|><|fim▁begin|>import os
import unittest<|fim▁hole|>import tempfile
from git import Repo
from oeqa.utils.commands import get_bb_var
from oe.buildhistory_analysis import blob_to_dict, compare_dict_blobs
class TestBlobParsing(unittest.TestCase):
def setUp(self):
im... | |
<|file_name|>server.py<|end_file_name|><|fim▁begin|>import datetime
from django.db import models
from django.conf import settings
#server variables that needed to be stored in db
class ServerVariable(models.Model):
name = models.CharField(max_length=64, blank=True, null=True)
value = models.TextField(blank=Tru... | @staticmethod
def set(name, value): |
<|file_name|>ConfigFemtoAnalysis.C<|end_file_name|><|fim▁begin|>/*********************************************************************
* *
* Configfemtoanalysis.C - configuration macro for the femtoscopic *
* analysis, meant as a QA process for two-... |
#if !defined(__CINT__) || defined(__MAKECINT_)
#include "AliFemtoManager.h" |
<|file_name|>nii2np.py<|end_file_name|><|fim▁begin|>import sys
from timer import Timer
import os
import pandas as pd
import nipy
import numpy as np
import re
import argparse
def get_images_list(path, regexp, number_images=None):
im_list=[]
dir_list=os.listdir(path)
if regexp=="NO":
im_list=dir_li... | |
<|file_name|>template-build.js<|end_file_name|><|fim▁begin|>! function(factory) {
if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {
var target = module['exports'] || exports;
factory(target);
} else if (typeof define === 'function' && define['amd']... | compiled;
var printPrefix = "$__buf__.="; |
<|file_name|>tabbar.ts<|end_file_name|><|fim▁begin|>import {Component, Inject} from "@angular/core";
import {HighLevelComponent, GENERIC_INPUTS, GENERIC_BINDINGS} from "../common/component";
import {REACT_NATIVE_WRAPPER} from "./../../renderer/renderer";
import {ReactNativeWrapper} from "../../wrapper/wrapper";
/**
*... | * To be documented
*/
set barTintColor(value: string) {this._barTintColor = this.processColor(value);} |
<|file_name|>component.js<|end_file_name|><|fim▁begin|>import React from 'react'
import { Link } from 'react-router'
import videos from './videos.json'
const video = videos[Math.floor(Math.random() * videos.length)]
export default ({ userLoaded, toSteps, toInfo }) => (
<div className='ext-home-cover' style={{
b... | className='ext-site-cover-isologo'
style={{ backgroundImage: `url('/ext/lib/site/home-multiforum/consultas.svg')` }} />
<div>
<h1>Consultas</h1> |
<|file_name|>webglbuffer.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://www.khronos.org/registry/webgl/specs/latest/1... | pub fn is_deleted(&self) -> bool { |
<|file_name|>macro_import.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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.apache.o... |
//! Used by `rustc` when loading a crate with exported macros.
|
<|file_name|>spiderForTECHORANGE.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Copyright (C) 2015, MuChu Hsu
Contributed by Muchu Hsu (muchu1983@gmail.com)
This file is part of BSD license
<https://opensource.org/licenses/BSD-3-Clause>
"""
from selenium import webdriver
import os
import time
import loggi... | """
抓取 科技報橘 html 存放到 source_html |
<|file_name|>completion.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This tool helps you to rebase package to the latest version
# Copyright (C) 2013-2014 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... | parser = CLI.build_parser()
result = []
actions = parser._get_optional_actions() + parser._get_positional_actions() # pylint: disable=protected-access |
<|file_name|>test_requestobject.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import unittest
import securetrading
from securetrading.test import abstract_test_stobjects
import six
class Test_Request(abstract_test_stobjects.Abstract_Test_StObjects):
def setUp(self):
super(Test_Request, self).setU... | requests3 = get_requests(
[get_request({"a": "b"}), |
<|file_name|>test_plane_fftw_wisdom_import_export.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <fftw3.h>
#include <omp.h>
#include <cstdlib>
#include <sweet/SimulationVariables.hpp>
class TestFFTPlans
{
public:
bool importWisdom(int i_reuse_spectral_transformation_plans)
{
static const char *wisd... | {
std::cout << "Enforcing to use Wisdom" << std::endl; |
<|file_name|>log.py<|end_file_name|><|fim▁begin|># Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
FORMAT = """%(asctime)s
:%(name)s:
%(levelname)s<|fim▁hole|>SELENIUM_REMOTE_CONNECTION = "selenium.webdriver.remote.remote_connection"<|fim▁... | :%(module)s
:%(funcName)
:%(lineno)s
:%(message)s""" |
<|file_name|>RemoveNthNodeFromEndOfList.java<|end_file_name|><|fim▁begin|>package org.luapp.practise.leetcode;
/**
* Created by lum on 2015/3/16.
*/
public class RemoveNthNodeFromEndOfList {
public static class ListNode {
int val;
ListNode next;
ListNode(int x) {
val = x;
... | // 如果指定n大于队列长度,报错 |
<|file_name|>logstash_formatter.go<|end_file_name|><|fim▁begin|>package logrustash
import (
"encoding/json"
"fmt"
"strings"
"time"
"github.com/sirupsen/logrus"
)
// Formatter generates json in logstash format.<|fim▁hole|>// Logstash site: http://logstash.net/
type LogstashFormatter struct {
Type string // if n... | |
<|file_name|>cardActionElement.js<|end_file_name|><|fim▁begin|>var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" &&... | "use strict"; |
<|file_name|>devicefarm.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "devicefarm")]
extern crate rusoto;
use rusoto::devicefarm::{DeviceFarmClient, ListDevicesRequest};
use rusoto::{DefaultCredentialsProvider, Region};
#[test]
pub fn should_list_devices() {
let credentials = DefaultCredentialsProvider::new()... |
client.list_devices(&request).unwrap();
} |
<|file_name|>long.py<|end_file_name|><|fim▁begin|># http://rosalind.info/problems/long/
def superstring(arr, accumulator=''):
# We now have all strings
if len(arr) == 0:
return accumulator
# Initial call
elif len(accumulator) == 0:
accumulator = arr.pop(0)
return superstring(a... |
# Recursive call
else:
for i in range(len(arr)): |
<|file_name|>test_calendar.py<|end_file_name|><|fim▁begin|>"""The tests for the google calendar component."""
# pylint: disable=protected-access
import logging
import unittest
from unittest.mock import patch, Mock
import pytest
import homeassistant.components.calendar as calendar_base
from homeassistant.components.go... | 'email': 'uvrttabwegnui4gtia3vyqb@import.calendar.google.com', |
<|file_name|>obj_glyph.js<|end_file_name|><|fim▁begin|>// start of file
/**
Object > Glyph
A single collection of outlines that could
either represent a character, or be used as<|fim▁hole|> part of another character through components.
The following objects are stored as Glyph
Objects:
Glyphs (Characters)
Liga... | |
<|file_name|>test_fn.py<|end_file_name|><|fim▁begin|># coding: utf8
from django.test import RequestFactory
from django.test import TestCase
from django.core.urlresolvers import resolve
from django.views.generic import ListView
import pytest
from selenium import webdriver
import time
from cms.test_utils.testcases impor... |
def test_anonymous(self):
req = RequestFactory().get('/categories/')
categorytree_dict = { |
<|file_name|>websocket.go<|end_file_name|><|fim▁begin|>package input
import (
"github.com/Jeffail/benthos/v3/internal/component/input"
"github.com/Jeffail/benthos/v3/internal/component/metrics"<|fim▁hole|> "github.com/Jeffail/benthos/v3/internal/old/input/reader"
btls "github.com/Jeffail/benthos/v3/internal/tls"
)
... | "github.com/Jeffail/benthos/v3/internal/docs"
"github.com/Jeffail/benthos/v3/internal/http/docs/auth"
"github.com/Jeffail/benthos/v3/internal/interop"
"github.com/Jeffail/benthos/v3/internal/log" |
<|file_name|>importer.py<|end_file_name|><|fim▁begin|># This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 Softwar... | def post_migrate(self):
pass |
<|file_name|>methods.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, absolute_import, division
import numpy as np
import pandas as pd
from toolz import partition
def loc(df, ind):
return df.loc[ind]
def index_count(x):
# Workaround since Index doesn't implement `.count`
return pd... |
def var_aggregate(x2, x, n, ddof):
try: |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import Component from './ImageSlider';<|fim▁hole|>export default StyledComponent(Component);<|fim▁end|> | import StyledComponent from './styles';
|
<|file_name|>0003_auto_20150423_1545.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('connectors', '0002_parameter_description'),
]
operations = [
... | model_name='callback', |
<|file_name|>vault-keyring.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) 2014, Matt Martz <matt@sivel.net>
# (c) 2016, Justin Mayer <https://justinmayer.com/>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms ... | # vault_password_file = /path/to/vault-keyring.py |
<|file_name|>fmt.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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/licens... |
pub fn expand_syntax_ext(ecx: &mut base::ExtCtxt, sp: Span, |
<|file_name|>add.py<|end_file_name|><|fim▁begin|># Copyright (c) 2011, 2012 Free Software Foundation
# 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 Software Foundation, either version 3 of the
... | # it under the terms of the GNU Affero General Public License as |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: iso-8859-2 -*-
#
# Copyright (C) 2007 Adam Folmert <afolmert@gmail.com>
#
# This file 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... | elif index.column() == 2:
return QVariant('%s' % str(card.question_hint).strip())
elif index.column() == 3: |
<|file_name|>JobOrderListResolve.js<|end_file_name|><|fim▁begin|>define(function () {
return {
customerAccount: ['CustomerAccountService', function (CustomerAccountService) {<|fim▁hole|><|fim▁end|> | return CustomerAccountService.getCurrent();
}]
};
}); |
<|file_name|>health-check.ts<|end_file_name|><|fim▁begin|>export interface IHealthCheck {
check_interval_seconds?: number;<|fim▁hole|> protocol: string;
response_timeout_seconds?: number;
unhealthy_threshold?: number;
}<|fim▁end|> | healthy_threshold?: number;
path?: string;
port: number; |
<|file_name|>issue-15381.rs<|end_file_name|><|fim▁begin|>fn main() {
let values: Vec<u8> = vec![1,2,3,4,5,6,7,8];<|fim▁hole|> println!("y={}", y);
}
}<|fim▁end|> |
for &[x,y,z] in values.chunks(3).filter(|&xs| xs.len() == 3) {
//~^ ERROR refutable pattern in `for` loop binding: `&[]`, `&[_]`, `&[_, _]` and 1 more not |
<|file_name|>static-resource.js<|end_file_name|><|fim▁begin|>import { StaticResource } from 'iab-vast-model'
<|fim▁hole|> const res = new StaticResource()
res.creativeType = $staticResource.creativeType
res.uri = $staticResource._value
return res
}<|fim▁end|> | export default ($staticResource) => { |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig
<|fim▁hole|><|fim▁end|> | class OntakAppConfig(AppConfig):
name = "oioioi.ontak" |
<|file_name|>configInterface.ts<|end_file_name|><|fim▁begin|>/**
* Config Interface
*/
"use strict";
/* Node modules */
/* Third-party modules */
<|fim▁hole|>/* Files */
export interface IConfigInterface {
url: string;
mongoOptions?: {
uri_decode_auth?: boolean;
db?: any;
server... | |
<|file_name|>test_get_rest_mags.py<|end_file_name|><|fim▁begin|>import unittest
import ezgal.zf_grid
import numpy as np
import math
# I put the test data for the zf_grid tests in
# tests.zf_grid instead of in tests because
# there is a lot of data but it is all
# specific for this test.
import tests.zf_grid
class te... | |
<|file_name|>faceup.py<|end_file_name|><|fim▁begin|>import time
import maestro
# servo 0 is left/right
# servo 1 is up/down
try:
servo = maestro.Controller()
servo.setRange(1,4000,8000)
# about 5 clicks per full motion
# 1040 for left/right + is left, - is right.
# 800 for up/down + is up, - is down.<|fim... | x = servo.getPosition(1) + 800
servo.setAccel(1,6) |
<|file_name|>RpcImporter.java<|end_file_name|><|fim▁begin|>package com.netwebx.hackerrank.rpc.client;
import java.io.ObjectInputStream;<|fim▁hole|>import java.net.InetSocketAddress;
import java.net.Socket;
/**
* Created by apple on 2017/2/26.
*/
public class RpcImporter<S> {
public S importer(final Class<?> ser... | import java.io.ObjectOutputStream;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy; |
<|file_name|>__manifest__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# (c) 2015 ACSONE SA/NV, Dhinesh D
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': "Inactive Sessions Timeout",
'summary': """
This module disable all inactive sessions since a given delay""... | |
<|file_name|>iword_embedding.py<|end_file_name|><|fim▁begin|>"""
Contains basic interface (abstract base class) for word embeddings.
"""
import os
from abc import ABCMeta, abstractmethod
class IWordEmbedding(object):
"""
Abstract base class for word embeddings
"""
__metaclass__ = ABCMeta
def __ini... |
def get_embedding_model_path(self): |
<|file_name|>test_itemmotion_2.js<|end_file_name|><|fim▁begin|>/**
* Created by whobird on 17/4/10.
*/
var winResizeDuration=null;
$(document).ready(function(){
if(!IsPC()){
window.location="./index.html";
return;
}
//project init
//start
$("img.lazy").lazyload({
event : "... | /*freeModeSticky:true,
freeModeMomentumBounce : true,
freeModeMomentumBounceRatio:10,*/ |
<|file_name|>mod_pow.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::arithmetic::mod_pow::simple_binary_mod_pow;
use malachite_base::num::basic::unsigneds::PrimitiveUnsigned;<|fim▁hole|>use malachite_base_test_util::bench::bucketers::triple_2_3_product_bit_bucketer;
use malachite_base_test_util::bench::{run_be... | |
<|file_name|>amp-instagram.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2015 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http... | super(element);
/** @private {?Element} */ |
<|file_name|>hand.go<|end_file_name|><|fim▁begin|>package mahjong
type Hand []Pai
func remove(list []Pai, p Pai) []Pai {<|fim▁hole|> if e == p && !removed {
removed = true
} else {
result = append(result, e)
}
}
return result
}
func contain(list []Pai, p Pai) bool {
for _, a := range list {
if a == p... | var result []Pai
removed := false
for _, e := range list { |
<|file_name|>length_expr.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(custom_attribute, plugin, slice_bytes, vec_push_all)]
#![plugin(pnet_macro... | // Copyright (c) 2015 Robert Clipsham <robert@octarineparrot.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
<|file_name|>context.rs<|end_file_name|><|fim▁begin|>//! Manage OpenGL context and window.
use std::string::ToString;
use std::rc::Rc;
use std::ops::Deref;
use std::cell::{UnsafeCell, RefCell, RefMut, Ref};
use glium::{Display, DisplayBuild};
use glium::glutin::WindowBuilder;
pub use glium::{Frame, Surface, SwapBuffer... | }
/// Returns the ratio between the backing framebuffer resolution |
<|file_name|>imagedata.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use core::nonzero::NonZero;
use dom::bindings::codegen::Bin... | |
<|file_name|>SiteActivationNotification.py<|end_file_name|><|fim▁begin|>##
##
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 09/10/14 #3623 randerso Manually created, do not r... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#![deny(warnings)]
#![feature(never_type)]
use std::sync::Arc;
use anyhow::Result;
use a... | |
<|file_name|>run.go<|end_file_name|><|fim▁begin|>// Copyright 2017 CoreOS, 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
//<|fim▁hole|>// http://www.apache.org/licenses/LICENSE... | |
<|file_name|>home-unit-spec.js<|end_file_name|><|fim▁begin|>describe('controllers/home', function () {
var di,
Core,
Home,
Type,
contentModel = {
findOne: function() {
}
},
widgetHooks = [],
widgetHook = {
load: function (a... | spyOn(api, 'renderFile').and.callThrough();
di.setAlias('basePath', __dirname + '/../../');
var controller = new Home(api); |
<|file_name|>component-checkbox.component.ts<|end_file_name|><|fim▁begin|>import {Component, OnInit, Input} from '@angular/core';
import { AppService } from '../../app.service';
@Component({
selector: 'lk-component-checkbox',
templateUrl: './component-checkbox.component.html',
styleUrls: [
'./component-check... | |
<|file_name|>FormTests.ts<|end_file_name|><|fim▁begin|>import * as exprTree from 'src/expressionTree';
import * as textstream from 'src/textstream';
import { TestContext, setupTests } from './UnitTests';
import { IForm, DiFunction, BindingCollection, InjectedControllerBuilder } from 'src/controller';
import { IViewData... | |
<|file_name|>updatemarras.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | db.groups.update(
{lname: "marrasputki"},
{$set:{users: ["Jörö"], description: "Marrasputki 2018"}}) |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>import pyaudio
import wave
#CHUNK = 1024
CHUNK = 1
FORMAT = pyaudio.paInt16
#CHANNELS = 2
CHANNELS = 1
#RATE = 44100
RATE = 10025
RECORD_SECONDS = 5
WAVE_OUTPUT_FILENAME = "output.wav"
p = pyaudio.PyAudio()
stream = p.open(format=FORMAT,
channels=CHAN... | |
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>use ::Disruption;
use rustc_serialize::{Encodable};
use rustc_serialize::json::{self};
use std::sync::Arc;
use std::sync::atomic::Ordering;
use time::PreciseTime;
use hyper::Client;
pub fn disruption_to_usize(d: &Option<&(Disruption, usize)>) -> usize {
match *d {<... | None => 0,
Some(&(Disruption::Node(_), _)) => 1,
Some(&(Disruption::Query(_), _)) => 2, |
<|file_name|>android_ip_webcam.py<|end_file_name|><|fim▁begin|>"""
Support for IP Webcam settings.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.android_ip_webcam/
"""
from homeassistant.components.switch import SwitchDevice
from homeassistant.c... | await self._ipcam.focus(activate=False)
elif self._setting == 'video_recording':
await self._ipcam.record(record=False)
else: |
<|file_name|>email-address.js<|end_file_name|><|fim▁begin|>module.exports = function(EmailAddress) {<|fim▁hole|><|fim▁end|> |
}; |
<|file_name|>SqlQueries.go<|end_file_name|><|fim▁begin|>package main
import (
"encoding/json"
"fmt"
"log"
)
func GetAllPlatforms(requestBody []byte) (string, error) {
queryString := "SELECT RowId, Name, Description FROM Platform"
ndrs := GetAllNameDescriptionRows(queryString)
var pmf PlatformsMasterFil... | } |
<|file_name|>splice.controls.pageloader.js<|end_file_name|><|fim▁begin|>$js.module({
prerequisite:[
'/{$jshome}/modules/splice.module.extensions.js'
],
imports:[
{ Inheritance : '/{$jshome}/modules/splice.inheritance.js' },
{'SpliceJS.UI':'../splice.ui.js'},
'splice.controls.pageloader.html'
],
definition:function(... |
var PageLoader = Class(function PageLoaderController(){
this.base(); |
<|file_name|>ClientAuthenticator.java<|end_file_name|><|fim▁begin|>package com.rideon.web.security;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.impl.client.DefaultHttpClient;
import org.springframework.web.client.RestTemplate;
publ... | prov.setCredentials(requestFactory.getAuthScope(), new UsernamePasswordCredentials(username, password));
} |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub use self::arch::{CODESET};
pub use self::arch::{D_T_FMT};<|fim▁hole|>pub use self::arch::{D_FMT};
pub use self::arch::{T_FMT};
pub use self::arch::{T_FMT_AMPM};
pub use self::arch::{AM_STR};
pub use self::arch::{PM_STR};
pub use self::arch::{DAY_1};
pub use self::arc... | |
<|file_name|>_legendgroup.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class LegendgroupValidator(_plotly_utils.basevalidators.StringValidator):<|fim▁hole|> def __init__(self, plotly_name="legendgroup", parent_name="choropleth", **kwargs):
super(LegendgroupValidator, self).__init__(
... | |
<|file_name|>apu.cpp<|end_file_name|><|fim▁begin|>#include "apu.h"
#include "emulator.h"
constexpr byte_t length_table[] = { 11, 254, 20, 2, 40, 4, 80, 6, 160, 8, 60, 10, 14, 12, 26, 14,
12, 16, 24, 18, 48, 20, 96, 22, 192, 24, 72, 26, 16, 28, 32, 30 };
constexpr uint16_t dmc_... | len_enabled_ = enable; |
<|file_name|>FBInventory.java<|end_file_name|><|fim▁begin|>package com.bukkit.gemo.FalseBook.Cart.utils;
import net.minecraft.server.v1_6_R3.Container;
import net.minecraft.server.v1_6_R3.EntityHuman;
import net.minecraft.server.v1_6_R3.InventoryCrafting;
import net.minecraft.server.v1_6_R3.ItemStack;
public class FB... | |
<|file_name|>test_qgslayoutmap.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutItemMap.
.. note:: 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 versio... | |
<|file_name|>files.py<|end_file_name|><|fim▁begin|>from markupsafe import escape
import re
from pymongo.objectid import ObjectId
from pymongo.errors import InvalidId
from app.people.people_model import People
from app.board.board_model import BoardTopic, BoardNode
from beaker.cache import CacheManager
from beaker.u... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
var express = require("express");
var http = require("http");
var app = express();
var httpServer = http.Server(app);
var io = require('socket.io')(httpServer);
// Users array.
var users = [];
// Channels pre-defined array.
var channels = [
'Angula... | // If socket already exists in a channel, leave.
if (typeof socket.channel != 'undefined') { |
<|file_name|>utils.js<|end_file_name|><|fim▁begin|>/**
* utility library
*/
var basicAuth = require('basic-auth');
var fs = require('fs');
/**
* Simple basic auth middleware for use with Express 4.x.
*
* @example
* app.use('/api-requiring-auth', utils.basicAuth('username', 'password'));
*
* @param {string... | |
<|file_name|>AltRange.py<|end_file_name|><|fim▁begin|>from exterminate.Utilities import builtins
<|fim▁hole|>def alt_range(start, stop, step=1):
return _range(start-2, stop+2, max(1, int(step/2)))
builtins.range = alt_range<|fim▁end|> | _range = range
|
<|file_name|>SizeAnimation.java<|end_file_name|><|fim▁begin|>package UserInterface.Animation;
/**
* Makes shit get big, makes shit get small.
*/
public class SizeAnimation extends Animation {
protected int iW, iH, fW, fH, cW, cH;
public SizeAnimation(long period, int paceType, boolean loop, int iW, int iH,... | this.fH = fH;
this.cW = iW;
this.cH = iH; |
<|file_name|>register_all_kernels.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2020 Google 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
*
* htt... | // We explicitly import the modular kernels so they get registered in the
// global registry when we compile the library. A modular build would replace
// the contents of this file and import only the kernels that are needed.
import {KernelConfig, registerKernel} from '../../kernel_registry'; |
<|file_name|>gwiki.py<|end_file_name|><|fim▁begin|>"""
Google Code Wiki translator.
Syntax defined by http://code.google.com/p/support/wiki/WikiSyntax
Here called gwiki to make the dialect clear (g for google).
"""
import re, os, commands, sys
from common import default_movie, plain_exercise, insert_code_and_tex, \
... | basename = os.path.basename(filename)
stem, ext = os.path.splitext(basename)
root, ext = os.path.splitext(filename)
|
<|file_name|>readonly-implicit-fields.spec.ts<|end_file_name|><|fim▁begin|>/*
* Copyright 2022 Imply Data, 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.apach... | }`, |
<|file_name|>jquery.validation.settings.js<|end_file_name|><|fim▁begin|>jQuery(document).ready(function($){
var nameDefault = 'Your name...';
var emailDefault = 'Your email...';
var messageDefault = 'Your message...';
// Setting up existing forms
setupforms();
function setupforms() {
// Applying ... | if(evalDefault('#name') && evalDefault('#email') && evalDefault('#message')) { return true; }
else { return false; }
default :
|
<|file_name|>dice.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import string
import random
# Simple recursive descent parser for dice rolls, e.g. '3d6+1d8+4'.
#
# roll :=... | def __init__(self, s):
self.s = s |
<|file_name|>YoutubeCom.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import operator
import os
import re
import subprocess
import time
import urllib
from xml.dom.minidom import parseString as parse_xml
from module.network.CookieJar import CookieJar
from module.network.HTTPRequest import HTTPRequest
from .... | if expr.startswith('('):
parens_count = 0
for m in re.finditer(r'[()]', expr): |
<|file_name|>JS_divergence.cpp<|end_file_name|><|fim▁begin|>#include <Rcpp.h>
using namespace Rcpp;
// underflow prevention: if the argument to log is so small<|fim▁hole|> return (lg == R_NegInf) ? 0 : x * lg;
}
// [[Rcpp::export]]
double jsdiv_v(NumericVector P, NumericVector Q) {
int n = P.size();
if (Q.... | // we get -Inf, we just give back 0.
inline double xlogy(double x, double y) {
double lg = log(y); |
<|file_name|>ARCComputingElement.py<|end_file_name|><|fim▁begin|>########################################################################
# File : ARCComputingElement.py
# Author : A.T.
########################################################################
""" ARC Computing Element
"""
__RCSID__ = "58c42fc (2013... |
#os.unlink( executableFile )
if batchIDList: |
<|file_name|>MedicationOrderItem.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 Cognitive Medical Systems, Inc (http://www.cognitivemedciine.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy o... | |
<|file_name|>interface.go<|end_file_name|><|fim▁begin|>// Copyright 2020 NetApp, Inc. All Rights Reserved.
// Code generated by informer-gen. DO NOT EDIT.
package v1
import (
internalinterfaces "github.com/netapp/trident/operator/controllers/provisioner/client/informers/externalversions/internalinterfaces"
)
// In... | tweakListOptions internalinterfaces.TweakListOptionsFunc
}
|
<|file_name|>scrape.py<|end_file_name|><|fim▁begin|># Functions to download yesterday's races and associated raceforms from host
import configparser
import requests
import re
import sys
import time
import pymongo
import random
from datetime import datetime, timedelta
from hracing.db import parse_racesheet
from hracin... | #Console feedback |
<|file_name|>test_orm.py<|end_file_name|><|fim▁begin|>"""Testing for ORM"""
from unittest import TestCase
import nose
from nose.tools import eq_
from sets import Set
from mdcorpus.orm import *
class ORMTestCase(TestCase):
def setUp(self):
self.store = Store(create_database("sqlite:"))
self.stor... | class MovieConversationTestCase(ORMTestCase):
@nose.with_setup(ORMTestCase.setUp, ORMTestCase.tearDown)
def test_consistency(self): |
<|file_name|>AdminTownsController.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('adsApp').controller('AdminTownsController', ['$scope', '$rootScope', 'catalog', 'config', 'notify',
function ($scope, $rootScope, catalog, config, notify) {
$rootScope.pageTitle = 'Towns';
var usersCon... | $rootScope.loading = false; |
<|file_name|>plugin.rs<|end_file_name|><|fim▁begin|>//! Plugin specific structures.
use std::{mem, ptr};
use std::os::raw::c_void;
use channels::ChannelInfo;
use host::{self, Host};
use api::{AEffect, HostCallbackProc, Supported};
use api::consts::VST_MAGIC;
use buffer::AudioBuffer;
use editor::Editor;
use event::Ev... | |
<|file_name|>0001_setup_extensions.py<|end_file_name|><|fim▁begin|>from unittest import mock
from django.db import connection, migrations
try:
from django.contrib.postgres.operations import (
BloomExtension, BtreeGinExtension, BtreeGistExtension, CITextExtension,
CreateExtension, CryptoExtension, ... |
class Migration(migrations.Migration): |
<|file_name|>unsized-trait-impl-trait-arg.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> fn foo(&self, z: Z);
}
struct S4<Y: ?Sized>(Box<Y>);
impl<X: ?Sized> T2<X> for S4<X> {
//~^ ERROR the size for values of type
}
fn main() { }<|fim▁end|> | // Test sized-ness checking in substitution in impls.
// impl - unbounded
trait T2<Z> { |
<|file_name|>es6-block-scope.js<|end_file_name|><|fim▁begin|>// -*- coding: utf-8 -*-
// Copyright (C) 2014 Yusuke Suzuki <utatane.tea@gmail.com>
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistri... | expect(scope.type).to.be.equal('global');
expect(scope.variables).to.have.length(1); // No variable in Program scope. |
<|file_name|>ProductList.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
const ProductList = (props) => {
const pl = props.productList;
const products = Object.keys(pl);
return (<ul>
{products.map(key => <li key={key}><a href={`#/product/${key}`} >{pl[key].name}</a></li>)}
</ul>);
};
ProductList.propTypes = {
... | import React, { PropTypes } from 'react'; |
<|file_name|>__init__.py<|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
#
# Unles... | # See the License for the specific language governing permissions and
# limitations under the License. |
<|file_name|>EventListTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2014 Stephan D. Cote' - All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which accompanies this distribution, and is
* available at http://creativecomm... | AppEvent alert6 = list.createEvent( "Six" );
//System.out.println( "Max="+list.getMaxEvents()+" Size=" + list.getSize() );
assertTrue( list._list.size() == 5 );
|
<|file_name|>import_media.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import (
unicode_literals,
absolute_import,
print_function,
division,
)
import aaf2
import traceback
import subprocess
import json
import os
import datetime
import sys
import tempfile
import shutil
impor... | p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout,stderr = p.communicate() |
<|file_name|>oauth2_getAllUsers.py<|end_file_name|><|fim▁begin|>#import some things we need
import httplib2
from oauth2client.client import SignedJwtAssertionCredentials #included with the Google Apps Directory API
from apiclient.discovery import build
import csv
def downloadUsers(domain, account, customerId):
sup... | |
<|file_name|>main.ts<|end_file_name|><|fim▁begin|>import {bootstrap} from '@angular/platform-browser-dynamic';
import {ROUTER_PROVIDERS} from '@angular/router-deprecated';
import {HTTP_PROVIDERS} from '@angular/http';
import {AppComponent} from './app.component';
import {LoggerService} from './blocks/logger.service';
... | ]); |
<|file_name|>windows.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/li... | true
}
} |
<|file_name|>flash_jlink.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=logging-fstring-interpolation
"""Flashes firmware usin... | go
exit |
<|file_name|>test_auth.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from nose.tools import * # noqa; PEP8 asserts
from webtest_plus import TestApp
import mock
import httplib as http
from flask import Flask
from modularodm import Q
from werkzeug.wrappers import BaseResp... | self.user = AuthUserFactory()
self.project = ProjectFactory(is_public=False)
self.link = PrivateLinkFactory() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.