prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>Group.js<|end_file_name|><|fim▁begin|>import { setPropertiesFromJSON } from '../../json-helper';
import Entity from './Entity';
/**
* Generated class for shr.entity.Group.
* @extends Entity
*/
class Group extends Entity {
/**<|fim▁hole|> return this._entryInfo;
}
/**
* Set the entry info... | * Get the entry information.
* @returns {Entry} The shr.base.Entry
*/
get entryInfo() { |
<|file_name|>all_7.js<|end_file_name|><|fim▁begin|>var searchData=
[<|fim▁hole|> ['iostructures_2eh',['IOStructures.h',['../de/d79/IOStructures_8h.html',1,'']]],
['irwlspar',['IRWLSpar',['../d4/d49/budgeted-train_8h.html#ad51d9a46645ad0b0bedb1113a3807d24',1,'budgeted-train.h']]]
];<|fim▁end|> | ['index',['index',['../d8/d33/structsvm__sample.html#a008f6b24c7c76af103e84245fb271506',1,'svm_sample']]],
['initlibirwls',['initLIBIRWLS',['../d4/d54/pythonmodule_8c.html#abe9b02ef8b3dff171684f855d6819d13',1,'initLIBIRWLS(void): pythonmodule.c'],['../d0/da7/pythonmodule_8h.html#abe9b02ef8b3dff171684f855d6819d... |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Legato - Statsd Server in Rust
//
// Copyright 2016 TSH Labs
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// op... | InvalidSection, |
<|file_name|>denominations.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Parity Technologies (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, eit... | |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Get ride details and liveboard details for NMBS (Belgian railway)."""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_LATITUDE,
ATTR_LONGITUDE... |
if delay > 0:
attrs["delay"] = f"{delay} minutes" |
<|file_name|>vue-clipboard.d.ts<|end_file_name|><|fim▁begin|>declare module 'vue-clipboard' {
import Vue, { PluginFunction } from 'vue'
module "vue/types/vue" {
interface Vue {
$copy(text: string): boolean;
}
}<|fim▁hole|>
class VueClipboard {
static install: PluginFunction<never>
}
}<|fim▁... | |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>/*
Command lmdb_copy is a clone of mdb_copy that copies an LMDB environment. A
consistent copy is made even if the source database is in use.
Command line flags mirror the flags for the original program. For information
about, run lmdb_copy with the -h flag.
lmdb_c... | } |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|>For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ShroomsAPI.settings")
application = g... | WSGI config for ShroomsAPI project.
It exposes the WSGI callable as a module-level variable named ``application``.
|
<|file_name|>_familysrc.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
<|fim▁hole|>
class FamilysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="familysrc", parent_name="barpolar.hoverlabel.font", **kwargs
):
super(FamilysrcValidator,... | |
<|file_name|>__MIDL___MIDL_itf_shobjidl_0212_0001.hpp<|end_file_name|><|fim▁begin|>// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually
#pragma once
#include <common/common.h>
<|fim▁hole|>
START_ATF_NAMESPACE
typedef SLR_FLAGS __MIDL___MIDL_itf_shobjidl_0212_... | |
<|file_name|>_implicit_psolver1.py<|end_file_name|><|fim▁begin|>from pycp2k.inputsection import InputSection
from ._dielectric_cube1 import _dielectric_cube1
from ._dirichlet_bc_cube1 import _dirichlet_bc_cube1
from ._dirichlet_cstr_charge_cube1 import _dirichlet_cstr_charge_cube1
<|fim▁hole|>class _implicit_psolver1(... | |
<|file_name|>files.rs<|end_file_name|><|fim▁begin|>use std::ffi;
use std::fs;
use std::io::Read;
use std::io::Write;
use std::path;
use crate::error::Result;
use failure::ResultExt;
use ignore::gitignore::{Gitignore, GitignoreBuilder};
use ignore::Match;
use log::debug;
use log::trace;
use normalize_line_endings::norm... | }
pub fn includes_file(&self, file: &path::Path) -> bool {
if !self.ext_contains(file) { |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! Generic types that share their serialization implementations
... | /// for font-feature-settings
///
/// Do not use this type anywhere except within FontSettings |
<|file_name|>cliente.py<|end_file_name|><|fim▁begin|>'''
Created on 20/02/2009
@author: Chuidiang
Ejemplo de cliente de socket.
Establece conexion con el servidor, envia "hola", recibe y escribe la
respuesta, espera 2 segundos, envia "adios", recibe y escribe la respuesta
y cierrra la conexion
'''
import socket
#import... | |
<|file_name|>ConditionMonitors.cpp<|end_file_name|><|fim▁begin|>/*
Copyright_License {
Top Hat Soaring Glide Computer - http://www.tophatsoaring.org/
Copyright (C) 2000-2016 The Top Hat Soaring Project
A detailed list of copyright holders can be found in the file "AUTHORS".
This program is free software; you ... | cm_aattime.Update(basic, calculated, settings);
cm_glideterrain.Update(basic, calculated, settings);
cm_landablereachable.Update(basic, calculated, settings);
} |
<|file_name|>AccelerometerProxy.js<|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... | var cordova = require('cordova'),
Acceleration = require('cordova-plugin-device-motion.Acceleration'),
accelerometerCallback = null;
|
<|file_name|>rootfindpack.py<|end_file_name|><|fim▁begin|>"""
Root finding methods
====================
Routines in this module:
bisection(f, a, b, eps=1e-5)
newton1(f, df, eps=1e-5)
newtonn(f, J, x0, eps=1e-5)
secant(f, x0, x1, eps=1e-5)
inv_cuadratic_interp(f, a, b, c, eps=1e-5)
lin_fracc_interp(f, a, b, c, eps=1e-... |
while True: |
<|file_name|>test_mincost.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import networkx as nx
from nose.tools import assert_equal, assert_raises
class TestNetworkSimplex:
def test_simple_digraph(self):
G = nx.DiGraph()
G.add_node('a', demand = -5)
G.add_node('d', demand = 5)
... | 'f': {'d': 0, 'g': 3, 'h': 2}, |
<|file_name|>SupervisedLearning.py<|end_file_name|><|fim▁begin|>import numpy as np
from sklearn.grid_search import GridSearchCV
import sklearn.metrics as metrics
from sklearn import preprocessing as prep
from tr_utils import merge_two_dicts, isEmpty
class SKSupervisedLearning (object):
"""
Thin wrapper arou... | @scoring.setter
def scoring(self, val): |
<|file_name|>test_learner_profile.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
End-to-end tests for Student's Profile Page.
"""
from contextlib import contextmanager
from datetime import datetime
from bok_choy.web_app_test import WebAppTest
from nose.plugins.attrib import attr
from ...pages.common.logo... | Given that I am on my profile page with public access
And I can see default image |
<|file_name|>cxx_vector.rs<|end_file_name|><|fim▁begin|>//! Less used details of `CxxVector` are exposed in this module. `CxxVector`
//! itself is exposed at the crate root.
use crate::extern_type::ExternType;
use crate::kind::Trivial;
use crate::string::CxxString;
use core::ffi::c_void;
use core::fmt::{self, Debug};
... | v: Pin<&'a mut CxxVector<T>>,
index: usize,
}
|
<|file_name|>scenarios.js<|end_file_name|><|fim▁begin|>'use strict';
/* https://github.com/angular/protractor/blob/master/docs/toc.md */
describe('my app', function() {
browser.get('index.html');
it('should automatically redirect to /home when location hash/fragment is empty', function() {
expect(browser.ge... |
});
|
<|file_name|>LockingGridView.js<|end_file_name|><|fim▁begin|>/*!
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
/*!
* Ext JS Library 3.3.0
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.ns... | |
<|file_name|>grpc_error_test.go<|end_file_name|><|fim▁begin|>// Copyright 2017, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package tabletconn
import (
"testing"
vtrpcpb "github.com/youtube/vitess/go/vt/proto/vtrpc"
"gith... | }, |
<|file_name|>is-finite-number.js<|end_file_name|><|fim▁begin|>/**
* The MIT License (MIT)
*
* Copyright (c) 2014-2022 Mickael Jeanroy
*
* 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 ... | |
<|file_name|>bootstrap.js<|end_file_name|><|fim▁begin|>/* Bootstrap v3.3.1 (http://getbootstrap.com)
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Modifications from Andoni M. Garcia.
*/
if (typeof jQuery === 'undefined') {
throw new Error('Boot... | relatedTarget: $previous[0] |
<|file_name|>adaptor.go<|end_file_name|><|fim▁begin|>// Package fasthttpadaptor provides helper functions for converting net/http
// request handlers to fasthttp request handlers.
package fasthttpadaptor
import (
"io"
"net/http"
"net/url"
"github.com/valyala/fasthttp"
)
// NewFastHTTPHandlerFunc wraps net/http h... | // it has the following drawbacks comparing to using manually written fasthttp
// request handler:
//
// * A lot of useful functionality provided by fasthttp is missing |
<|file_name|>ROGUE.js<|end_file_name|><|fim▁begin|>import ITEM_QUALITIES from '../ITEM_QUALITIES';
export default {
// Shared legendaries
SOUL_OF_THE_SHADOWBLADE: {
id: 150936,
name: 'Soul of the Shadowblade',
icon: 'inv_jewelry_ring_56',
quality: ITEM_QUALITIES.LEGENDARY,
},
MANTLE_OF_THE_MAST... | id: 137098, |
<|file_name|>atom.cpp<|end_file_name|><|fim▁begin|>/******************************************************************************
This source file is part of the MolCore project.
Copyright 2011 Kitware, Inc.
This source code is released under the New BSD License, (the "License").
Unless required by applica... | |
<|file_name|>waveform_with_overlay.rs<|end_file_name|><|fim▁begin|>use gtk::{cairo, pango, prelude::*};
use log::debug;
use std::{
cell::RefCell,
collections::Bound::Included,
rc::Rc,
sync::{Arc, Mutex},
};
use metadata::Duration;
use renderers::{ImagePositions, SampleIndexRange, Timestamp, WaveformR... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# coding=utf-8
# region License
# Findeco is dually licensed under GPLv3 or later and MPLv2.
#
################################################################################
# Copyright (c) 2012 Klaus Greff <klaus.greff@gmx.net>
# This file is pa... | # |
<|file_name|>first.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
current = u'b'<|fim▁hole|>print ord('a')
print ord('1')
print ord('\n')
ip 1 2 3
./first.py<|fim▁end|> | print ord(current) |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from cms.admin.pageadmin import PageAdmin
from cms.models import Page<|fim▁hole|>
admin.site.register(page)
admin.site.register(Sub_Pages)<|fim▁end|> |
from .models import page, Sub_Pages |
<|file_name|>jquery.sentinel.js<|end_file_name|><|fim▁begin|>/*
* sentinel
* https://github.com/jaredhoyt/jquery-sentinel
*
* Copyright (c) 2015 Jared Hoyt
* Licensed under the MIT license.
*/
(function($) {
// Collection method.
$.fn.sentinel = function() {
return this.each(function(i) {
// Do so... | // Override default options with passed-in options. |
<|file_name|>e09asynctwostage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
"""
./e09asynctwostage.py http://camlistore.org 1 6
Found 10 urls
http://camlistore.org/ frequencies: [('camlistore', 13), ...]
...
First integer arg is depth, second is minimum word count.
"""
import re
from sys import argv
impor... | top_word = yield from wordcount_async(data, word_length)
return url, top_word, found_urls
|
<|file_name|>pipelines.py<|end_file_name|><|fim▁begin|># Define your item pipelines here
#<|fim▁hole|> def process_item(self, item, spider):
return item<|fim▁end|> | # Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class MyuniversityscraperPipeline(object): |
<|file_name|>guessnameclass.py<|end_file_name|><|fim▁begin|># A program that has a list of six colors and chooses one by random. The user can then has three chances to quess the right color. After the third attepmt the program outputs "Nope. The color I was thinking of was..."
import random
# this is the function that ... | else:
print ('Nope. The color I was thinking of was {0}'.format(c2.color))
|
<|file_name|>ProductServiceImpl.java<|end_file_name|><|fim▁begin|>/**
* This file is part of mycollab-services.
*
* mycollab-services 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 th... | public ICrudGenericDAO<Integer, Product> getCrudMapper() {
return productMapper;
} |
<|file_name|>types.ts<|end_file_name|><|fim▁begin|>import { Command, App } from './';
export interface NorthbrookConfig extends Object<any> {
plugins?: Array<string | App | Command>;
packages?: Array<string>;<|fim▁hole|>}
export interface Object<T> {
[key: string]: T;
}
export interface STDIO {
stdout?: Node... | }
export interface Plugin {
plugin: App | Command; |
<|file_name|>_GroupLock.qunit.js<|end_file_name|><|fim▁begin|>/*!
* ${copyright}
*/
sap.ui.define([
"sap/base/Log",
"sap/ui/model/odata/v4/lib/_GroupLock"
], function (Log, _GroupLock) {
"use strict";
//*********************************************************************************************
QUnit.module("s... | // code under test
oPromise1 = oGroupLock.waitFor("foo");
oPromise2 = oGroupLock.waitFor("foo"); |
<|file_name|>watchpid_test.go<|end_file_name|><|fim▁begin|>package immortal
import (
"os/exec"
"syscall"
"testing"
"time"
)
func TestWatchPidGetpid(t *testing.T) {
ch := make(chan error, 1)
d := &Daemon{}
cmd := exec.Command("go", "version")
cmd.Start()
pid := cmd.Process.Pid
go func() {
d.WatchPid(pid, c... | pid := cmd.Process.Pid
go func() {
d.WatchPid(pid, ch) |
<|file_name|>messages.py<|end_file_name|><|fim▁begin|>NOT_GIT_REPO_MSG = "#{red}Not a git repository (or any of the parent directories)"
HOOK_ALREADY_INSTALLED_MSG = "The pre-commit hook has already been installed."
EXISTING_HOOK_MSG = (
"#{yellow}There is an existing pre-commit hook.\n"
"#{reset_all}Therapis... | |
<|file_name|>properties.py<|end_file_name|><|fim▁begin|>from bokeh.util.deprecate import deprecated_module
deprecated_module('bokeh.properties', '0.11', 'use bokeh.core.properties instead')<|fim▁hole|>
from .core.properties import * # NOQA<|fim▁end|> | del deprecated_module |
<|file_name|>transform.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/. */
//! Generic types for CSS values that are related to transf... | |
<|file_name|>run_bot.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from mattermost_bot.bot import Bot, PluginsManager
from mattermost_bot.mattermost import MattermostClient
from mattermost_bot.dispatcher import MessageDispatcher
import bot_settings
class LocalBot(Bot):
def __init__(self):
self._cl... |
if __name__ == '__main__': |
<|file_name|>xiaoi.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import unicode_literals
# created by: Han Feng (https://github.com/hanx11)
import collections
import hashlib
import logging
import requests
from wxpy.api.messages import Message
from wxpy.ext.talk_bot_utils import get_context_user_id,... | "X-Auth": "app_key=\"{0}\",nonce=\"{1}\",signature=\"{2}\"".format(
self.key, sign.nonce, sign.signature) |
<|file_name|>test_kinesis.py<|end_file_name|><|fim▁begin|>#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the ... | |
<|file_name|>gandi_live.py<|end_file_name|><|fim▁begin|># Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache ... | # {
# "code": 400, |
<|file_name|>keyboard.rs<|end_file_name|><|fim▁begin|>use crate::platform::*;
use crate::types::InputList;
use registry::{Data, Hive, RegKey, Security};
use std::convert::{TryFrom, TryInto};
use std::fmt;
use std::io;
use std::path::Path;
#[cfg(feature = "legacy")]
pub use crate::keyboard_legacy::*;
#[cfg(not(feature ... | self.layout_name().unwrap_or("".to_string())
)?;
writeln!(
f, |
<|file_name|>backends.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from moto.acm import acm_backends
from moto.apigateway import apigateway_backends
from moto.autoscaling import autoscaling_backends
from moto.awslambda import lambda_backends
from moto.cloudformation import cloudformation_bac... | if name in models:
return list(getattr(backend, models[name])()) |
<|file_name|>htmlformelement.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::attr::AttrValue;
use dom::bindings::codegen:... | }
}
}
let filter = box ElementsFilter { form: Root::from_ref(self) }; |
<|file_name|>Type.java<|end_file_name|><|fim▁begin|>package com.fordprog.matrix.interpreter.type;
public enum Type {
RATIONAL,
MATRIX,
FUNCTION,<|fim▁hole|><|fim▁end|> |
VOID
} |
<|file_name|>parameter_tests_edges.py<|end_file_name|><|fim▁begin|># coding: utf-8
# In[1]:
import os
from shutil import copyfile
import subprocess
from save_embedded_graph27 import main_binary as embed_main
from spearmint_ghsom import main as ghsom_main
import numpy as np
import pickle
from time import ti... |
#setting fo e_sg
p = parameter_settings[j]
|
<|file_name|>aria_combobox_dojo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""Test of Dojo combo box presentation."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(PauseAction(5000))
sequence.append(KeyComboAction("Tab"))
sequence.append(KeyComboAction("Tab"))
seque... | |
<|file_name|>auto-complete-list.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'ul',
classNames: 'ember-autocomplete-list',<|fim▁hole|><|fim▁end|> | }); |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2016 Nikita Pekin and the smexybot contributors
// See the README.md file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT... | |
<|file_name|>Test_MonitoringSystem.py<|end_file_name|><|fim▁begin|>"""
It is used to test client->db-> service.
It requires the Monitoring service to be running and installed (so discoverable in the .cfg),
and this monitoring service should be connecting to an ElasticSeach instance
"""
# pylint: disable=invalid-n... | u'User': u'phicharp', u'JobGroup': u'00050280', u'UserGroup': u'lhcb_mc', u'metric': u'WMSHistory'},
{u'Status': u'Running', 'Jobs': 24, u'timestamp': 1458219012, u'JobSplitType': u'MCSimulation', |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for myproject project.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths insi... | WSGI_DIR = os.path.dirname(BASE_DIR)
REPO_DIR = os.path.dirname(WSGI_DIR)
DATA_DIR = os.environ.get('OPENSHIFT_DATA_DIR', BASE_DIR) |
<|file_name|>filter-projects.pipe.ts<|end_file_name|><|fim▁begin|>import { Pipe, PipeTransform } from '@angular/core';
import { Project } from '../models/Project';
/**
* Filter an array
*/
@Pipe({
name: 'filterProjects',<|fim▁hole|> pure: true
})
export class FilterProjectsPipe implements PipeTransform {
... | |
<|file_name|>DateUtils.ts<|end_file_name|><|fim▁begin|>/*
* @license
* Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
*
* Use of this source code is governed by an Apache-2.0 license that can be
* found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
... | /**
* Date conversion for DPI standards |
<|file_name|>myconfig.py<|end_file_name|><|fim▁begin|>#Es necesario cambiar estos datos por los parametros de nuestro servidor, usuarios, password
userDb = "userDb"
passDb = "passDb"
mail = "*********@gmail.com"
passMail = "passMail"
nameDb = "domotics_db"
urlDb = "urlDb"
serverPort = 8080
#Security Code Device
upda... | |
<|file_name|>pgbouncer.py<|end_file_name|><|fim▁begin|>"""Pgbouncer check
Collects metrics from the pgbouncer database.
"""
# 3p
import psycopg2 as pg
# project
from checks import AgentCheck, CheckException
class ShouldRestartException(Exception):
pass
class PgBouncer(AgentCheck):
"""Collects metrics from... | for row in results: |
<|file_name|>resnet_3d.py<|end_file_name|><|fim▁begin|># Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apach... | |
<|file_name|>sciblox.py<|end_file_name|><|fim▁begin|>#------------- Daniel Han-Chen 2017
#------------- https://github.com/danielhanchen/sciblox
#------------- SciBlox v0.02
#-------------
maxcats = 15
import warnings
warnings.filterwarnings("ignore")
true = True; TRUE = True
false = False; FALSE = False
import pip
de... | huelabel = columns(hue)[0];
if huelabel is None: huelabel = "Hue" |
<|file_name|>set_volume_option.py<|end_file_name|><|fim▁begin|>import json<|fim▁hole|>
class SetVolumeOption(object):
def __init__(self, api_job):
super(SetVolumeOption, self).__init__()
self.api_job = api_job
self.atom = SetVolumeOption
def start(self):
attributes = json.loads(... |
import etcd
from tendrl.gluster_bridge.atoms.volume.set import Set
|
<|file_name|>derives-span-Clone-enum-struct-variant.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 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
/... |
struct Error; |
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/**
* <|fim▁hole|> * @author root
*
*/
package com.amanaje.activities;<|fim▁end|> | */
/** |
<|file_name|>top_block.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Top Block
# Generated: Tue Dec 27 19:28:14 2016
##################################################
if __name__ == '__main__':
... | from gnuradio import wxgui |
<|file_name|>built-in-glamorous-components.d.ts<|end_file_name|><|fim▁begin|>import { ExtraGlamorousProps } from './glamorous-component'
import {
ViewProperties,
TextStyle,
ViewStyle,
ImageStyle,
TextInputProperties,
ImageProperties,
ScrollViewProps,
TextProperties,
TouchableHighlightProperties,
To... | TextInput: React.StatelessComponent<
TextInputProperties & ExtraGlamorousProps & TextStyle
> |
<|file_name|>filter_actions.js<|end_file_name|><|fim▁begin|>"use strict";
var FilterDispatcher = require("../dispatcher/filter_dispatcher");
module.exports = {
changeDate: function changeDate(key, date) {
var pos = arguments.length <= 2 || arguments[2] === undefined ? "start" : arguments[2];
FilterDispatch... |
selectFilter: function selectFilter(filterBy, id) {
FilterDispatcher.handleSelectFilter({
type: "SELECT_FILTER", |
<|file_name|>basic_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unl... | t.Errorf("expected %v, got %v", e, a)
}
|
<|file_name|>synchronicity_tests.py<|end_file_name|><|fim▁begin|>from nose.tools import eq_, with_setup
from threading import Thread
from Queue import Queue
from time import sleep
def setup():
global Person, neo4django, gdb, neo4jrestclient, neo_constants, settings, models
from neo4django.tests import Person... | raise AssertionError('There was an error saving one of the '
'RaceModels (#%d) - "%s"' % (i, val))
#check the number of typenodes |
<|file_name|>iterateArcMapDocsByFolder.py<|end_file_name|><|fim▁begin|># Copyright 2012 majgis Contributors
#
# Individuals comprising majgis Contributors are identified in
# the NOTICE file found in the root directory of this project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# ... | |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>//! A stand-in for `std::error`
use core::any::TypeId;
use core::fmt::{Debug, Display};
/// A stand-in for `std::error::Error`, which requires no allocation.
#[cfg(feature = "unstable")]
pub trait Error: Debug + Display + ::core::marker::Reflect {
/// A short des... | /// The description should not contain newlines or sentence-ending |
<|file_name|>ajax.js<|end_file_name|><|fim▁begin|>// $Id: ajax.js,v 1.26.2.2 2009/11/30 22:47:05 merlinofchaos Exp $
/**
* @file ajax_admin.js
*
* Handles AJAX submission and response in Views UI.
*/
Drupal.Views.Ajax = Drupal.Views.Ajax || {};
/**
* Handles the simple process of setting the ajax form area with ... | |
<|file_name|>autojoinSteamQueue.js<|end_file_name|><|fim▁begin|>// Most of it was made by xPaw: https://gist.github.com/xPaw/73f8ae2031b4e528abf7
// Add following lines into manifest.json under content_scripts section (and tweak or remove date below):
// {
// "js": [ "js/autojoinSteamQueue.js" ],
// "matches": [... | var requests = [], |
<|file_name|>media_operations.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# a... | return (False, content) |
<|file_name|>incubate_eggs.py<|end_file_name|><|fim▁begin|>from pokemongo_bot.human_behaviour import sleep
from pokemongo_bot.base_task import BaseTask
class IncubateEggs(BaseTask):
SUPPORTED_TASK_API_VERSION = 1
last_km_walked = 0
def initialize(self):
self.ready_incubators = []
self.us... | elif 'is_egg' not in pokemon and pokemon['id'] in lookup_ids:
pokemon.update({
"iv": [
pokemon.get('individual_attack', 0), |
<|file_name|>run_plink_reformat.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# encoding: utf-8
import glob
import os
import subprocess
'''
Convert 23andMe files to
PLINK format
'''
def twenty3_and_me_files():
"""Return the opensnp files that are 23 and me format"""
all_twenty3_and_me_files= glob.glob('..... | subprocess.call(call,shell=True)
usable_files = twenty3_and_me_files()
run_plink_format(usable_files) |
<|file_name|>isLeapYearSpec.js<|end_file_name|><|fim▁begin|>import { isLeapYear } from "../../Source/Cesium.js";
describe("Core/isLeapYear", function () {
it("Check for valid leap years", function () {
expect(isLeapYear(2000)).toEqual(true);
expect(isLeapYear(2004)).toEqual(true);
expect(isLeapYear(2003)... |
it("Fail with non-numerical value", function () {
expect(function () {
isLeapYear("asd"); |
<|file_name|>RateLimit.js<|end_file_name|><|fim▁begin|>/*!
* Redback
* Copyright(c) 2011 Chris O'Hara <cohara87@gmail.com>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var Structure = require('../Structure');
/**
* See https://gist.github.com/chriso/54dd46b03155fcf555adccea822193da
*
* Count the number o... | var bucket = this.getBucket(), multi = this.client.multi();
subject = this.key + ':' + subject; |
<|file_name|>tree-openable.js<|end_file_name|><|fim▁begin|>/*
YUI 3.11.0 (build d549e5c)
Copyright 2013 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('tree-openable', function (Y, NAME) {
/*jshint expr:true, onevar:false */
/**
Extension for `Tree` that ad... | |
<|file_name|>gsmlogger.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
"""
Tools for logging in GSM package.
"""
import logging
import os
import platform
LOGGERS = {}
if platform.node() == 'ldb001':
BASE_LOG_DIR = os.path.join(os.getenv('HOME'), 'GSM')
else:
BASE_LOG_DIR = os.path.join(os.getenv('HOME'... | if use_console and len(logger.handlers) == 1:
console_handler = logging.StreamHandler()
console_handler.setFormatter(logging.Formatter( |
<|file_name|>PySrt.py<|end_file_name|><|fim▁begin|>import re
import sys
class SrtSection:
"""
This class is used to stock a section from a srt file (subtitle frames).
- self.beginning is the time (in seconds) where the subframe begins
- self.duration is the duration (in seconds) of the subf... |
return ' --> '.join(times)
|
<|file_name|>bitcoin_pl.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="pl" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="14"/>
<source>About Kickasscoin</source>
... | <translation type="unfinished"/>
</message>
<message> |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use std::io::Error;
// Grpc related files used by tonic are generated here. Those files re-generate for each build
// so it's up to date.
//
// Grpc related files used by grpcio are maintained at src/proto/grpcio. tests/grpc_build.rs makes
// sure they are... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from kivy.core.window import Window
from kivy.uix.textinput import TextInput
__author__ = 'woolly_sammoth'
from kivy.config import Config
Config.set('graphics', 'borderless', '1')
Config.set('graphics', 'resizable', '0')
Config.set('graphics', 'fullscreen', '1')
fro... | |
<|file_name|>test_ff.py<|end_file_name|><|fim▁begin|># (C) British Crown Copyright 2010 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either ... | |
<|file_name|>console_test.go<|end_file_name|><|fim▁begin|>package main
import (
"bytes"
"sync"
"testing"
"github.com/mauricioklein/text-search-engine/ranking"
"github.com/mauricioklein/text-search-engine/reader"
"github.com/mauricioklein/text-search-engine/report"
"github.com/stretchr/testify/assert"
)
func T... | |
<|file_name|>backend.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2005-2021 Intel Corporation
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/lice... | MALLOC_ASSERT(rSz == sz, ASSERT_TEXT);
return sz;
}
void markCoalescing(size_t blockSz) { |
<|file_name|>session.rs<|end_file_name|><|fim▁begin|>//! Endpoints for user session management.
pub mod get_login_types;
pub mod login;<|fim▁hole|>pub mod logout_all;
pub mod sso_login;
pub mod sso_login_with_provider;<|fim▁end|> | pub mod login_fallback;
pub mod logout; |
<|file_name|>user_agent.rs<|end_file_name|><|fim▁begin|>header! {
#[doc="`User-Agent` header, defined in"]
#[doc="[RFC7231](http://tools.ietf.org/html/rfc7231#section-5.5.3)"]
#[doc=""]<|fim▁hole|> #[doc="agent originating the request, which is often used by servers to help"]
#[doc="identify the scop... | #[doc="The `User-Agent` header field contains information about the user"] |
<|file_name|>SeedRule.ts<|end_file_name|><|fim▁begin|>import { TOptionsNormalizerRule } from '../../types/options/TOptionsNormalizerRule';
import { IOptions } from '../../interfaces/options/IOptions';
/**
* @param {IOptions} options
* @returns {IOptions}
*/
export const SeedRule: TOptionsNormalizerRule = (options:... | };
}
|
<|file_name|>SmsCommunicatorFragment.java<|end_file_name|><|fim▁begin|>package info.nightscout.androidaps.plugins.SmsCommunicator;
import android.app.Activity;<|fim▁hole|>import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.Html;
import android.view.LayoutInflater;
import android.view... | |
<|file_name|>test_checks.py<|end_file_name|><|fim▁begin|>from flake8_quotes import QuoteChecker
import os
import subprocess
from unittest import TestCase
class TestChecks(TestCase):
def test_get_noqa_lines(self):
checker = QuoteChecker(None, filename=get_absolute_path('data/no_qa.py'))
self.assert... |
def test_multiline_string_using_lines(self):
with open(get_absolute_path('data/doubles_multiline_string.py')) as f: |
<|file_name|>test_parsers.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
import mock
import os
from shutil import rmtree
from tempfile import mkdtemp
from django.test import TestCase
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import Com... | |
<|file_name|>retry.py<|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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | exc_type: Type[Exception] = errors.CommunicationTimeoutError
) -> _FuncReturnType:
"""Retries func() until it succeeds or timeout is reached.
|
<|file_name|>InputDataClient.py<|end_file_name|><|fim▁begin|>from shutil import copy
from os import remove
import sys
from I_Data_Degradation_Block.Code.Degradation import main as blockI
from II_Cryptography_Block.Code.encrypt import main as blockII
from III_Shamirs_Block.Code.SecretSharing import main as blockIII... | try:
return int(var)
except: |
<|file_name|>authapi.go<|end_file_name|><|fim▁begin|>package authapi
import(
"github.com/duosecurity/duo_api_golang"
"encoding/json"
"net/url"
"strconv"
)
type AuthApi struct {
api duoapi.DuoApi
}
// Build a new Duo Auth API object.
// api is a duoapi.DuoApi object used to make the Duo Rest API c... | func AuthPushinfo(pushinfo string) func (*url.Values) {
return func(opts *url.Values) {
opts.Set("pushinfo", pushinfo)
} |
<|file_name|>conn_manager_impl.cc<|end_file_name|><|fim▁begin|>#include "common/http/conn_manager_impl.h"
#include <cstdint>
#include <functional>
#include <list>
#include <memory>
#include <string>
#include <vector>
#include "envoy/buffer/buffer.h"
#include "envoy/common/time.h"
#include "envoy/event/dispatcher.h"
#... |
// Make sure that we handle the zero byte data frame case. We make no effort to optimize this |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.