prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>PolarGlue.cpp<|end_file_name|><|fim▁begin|>/*
Copyright_License {
XCSoar Glide Computer - http://www.xcsoar.org/
Copyright (C) 2000-2016 The XCSoar Project
A detailed list of copyright holders can be found in the file "AUTHORS".
This program is free software; you can redistribute it and/or
modi... | #include "IO/ConfiguredFile.hpp"
#include "IO/LineReader.hpp"
#include "Dialogs/Message.hpp" |
<|file_name|>ismaster.py<|end_file_name|><|fim▁begin|># Copyright 2014-2015 MongoDB, 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
#
# Un... | def max_bson_size(self):
return self._doc.get('maxBsonObjectSize', common.MAX_BSON_SIZE)
|
<|file_name|>executor.py<|end_file_name|><|fim▁begin|>import asyncio
from functools import partial
class AsyncWrapper:
def __init__(self, target_instance, executor=None):
self._target_inst = target_instance
self._loop = asyncio.get_event_loop()
self._executor = executor
def __getattri... |
async def _async_wrapper(self, method_name, *args, **kwargs):
coroutine_wrapped = partial(method_name, *args, **kwargs) |
<|file_name|>CWLWorkflow.java<|end_file_name|><|fim▁begin|>package org.rabix.bindings.cwl.bean;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.rabix.bindings.cwl.json.CWLStepsDeserializer;
import org.rabix.bindings.model.ValidationReport;
import org.rabix... | this.dataLinks.add(dataLink);
} |
<|file_name|>quagga.py<|end_file_name|><|fim▁begin|># Copyright (C) 2016 Nippon Telegraph and Telephone 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.o... | f.write(''.join('ip prefix-list {0} deny {1}\n'.format(n, p) for p in match['value']))
f.write('ip prefix-list {0} permit any\n'.format(n))
elif match['type'] == 'as-path':
f.write(''.join('ip as-path access-list... |
<|file_name|>ela-sep.py<|end_file_name|><|fim▁begin|>import sys
from pymongo import MongoClient
from werkzeug.utils import secure_filename
import os
import sys
client = MongoClient('mongodb://localhost:27017/')
db = client.ir
#li=[]
#color=open("AllColors.txt","r")
doc1=[]
doc2=[]
edgeConWT=[]
edgeElaWT=[]
edgeStart=[]... | print(str1)
results = db.rPaper.update({'filename': file[:-10]+'pdf'}, {'$set': {'elaboration': t2}})
print (results) |
<|file_name|>options.js<|end_file_name|><|fim▁begin|>/**
* options.js
*
* A test helper to detect which html-snapshots options to use
*
* phantomjs
* If a global phantomjs is defined, decorates html-snapshots options to specify that global
* In some test environments (travis), local phantomjs will not install i... |
const spawn = require("child_process").spawn;
module.exports = { |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|># Copyright 2016 Twitter. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LIC... | '''constants.py: constants for integration test for pyheron'''
INTEGRATION_TEST_MOCK_MESSAGE_ID = "__integration_test_mock_message_id" |
<|file_name|>pl-pl.py<|end_file_name|><|fim▁begin|># coding: utf8
{
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyra\xc5\xbceniem postaci "pole1=\'nowawarto\xc5\x9b\xc4\x87\'". Nie mo\xc5\xbcesz uaktualni\xc4\x87 lub u... | 'Delete:': 'Usu\xc5\x84:', |
<|file_name|>config.js<|end_file_name|><|fim▁begin|>var path = require('path'),
fs = require('fs'),
Source = require(hexo.lib_dir + '/core/source'),
config_dir = path.dirname(hexo.configfile),
config = hexo.config;
function testver(){
var ver = hexo.env.version.split('.');
var test = true;
if ... | var store = hexo.extend.renderer.store;
var error = '';
if (!store['ejs']) error += '\tnpm install hexo-renderer-ejs\n';
|
<|file_name|>test-workers.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
self.addEventListener('message', function (msg) {
if (msg.data === 'Hello') {
self.postMessage(1);
}
else if (msg.data instanceof self.ArrayBuffer) {
var view = new Int32Array(msg.data);
if (view[0] === 2) {
... | self.postMessage(0); |
<|file_name|>DataSourceServiceTest.java<|end_file_name|><|fim▁begin|>/**
*
*/
package br.com.geocab.tests.service;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import br.com.geocab.domain.entity.datasource.DataSource;
import br.com.geocab.domain.ser... | "/dataset/AccountDataSet.xml" |
<|file_name|>receipt.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 t... | s.append(&self.state_root); |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate rustfbp;
agent! {
input(input: any),
output(output: any),
option(any),<|fim▁hole|> msg_input.vec = opt.vec.clone();
msg_input.action = opt.action.clone();
try!(self.output.output.send(msg_input));
Ok(... | fn run(&mut self) -> Result<Signal> {
debug!("{:?}", env!("CARGO_PKG_NAME"));
let opt = self.recv_option();
let mut msg_input = try!(self.input.input.recv()); |
<|file_name|>test_triggersqls.py<|end_file_name|><|fim▁begin|>"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the under the Apache License, Version 2.0 (the "License");
you may not use this file except in complian... | @classmethod
def setUpClass(cls):
"""
Since some operation in this scenario is blocked, we want to run |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from django.db import models
# Create your models here.
<|fim▁hole|> An abstract base class model that provides self-updating "created" and "modified" fields.
"""
created = models.DateTimeField(auto_now_add=True)
modified =... | class TimeStampedModel(models.Model):
""" |
<|file_name|>gen_overlay_widgets.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
# Copyright 2019 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# gen_overlay_widgets.py:
# Code generation for overlay widgets. ... | |
<|file_name|>get_sql_server_info.py<|end_file_name|><|fim▁begin|>from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Get-SQLServerInfo',
'Author': ['@_nullbind', '@0xbadjuju'],
'Description': ('Returns basic serv... | |
<|file_name|>test_menu.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import curses
import npyscreen
from vent.helpers.paths import PathDirs
from vent.menu import VentApp
from vent.menus.main import MainForm
npyscreen.TEST_SETTINGS['CONTINUE_AFTER_TEST_INPUT'] = False
def run_menu(test_input):
""" Act... | run_menu([ENTER, CTRL_X, 't', 'v', 't', RIGHT, ENTER])
run_menu([ENTER, CTRL_X, 't', 'v', 's', RIGHT, ENTER]) |
<|file_name|>Operar_unit.java<|end_file_name|><|fim▁begin|>package testtravis;
import static org.junit.Assert.*;
import org.junit.Test;
public class Operar_unit {
@Test
public void testSumar() {
System.out.println("Sumar dos numeros");
int numero1 = 6;
int numero2 = 6;
Operacion... | |
<|file_name|>storage_v1_messages.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 ... | |
<|file_name|>port1.rs<|end_file_name|><|fim▁begin|>#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Port 1 Output Register"]
pub out: crate::Reg<out::OUT_SPEC>,
#[doc = "0x04 - Port 1 Output Modification Register"]<|fim▁hole|> #[doc = "0x10 - Port 1 Input/Output Control Re... | pub omr: crate::Reg<omr::OMR_SPEC>,
_reserved2: [u8; 0x08], |
<|file_name|>scanner.py<|end_file_name|><|fim▁begin|>"""
Copyright 2014 Quentin Kaiser
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... | @property |
<|file_name|>ex_402.py<|end_file_name|><|fim▁begin|>class Solution(object):
def removeKdigits(self, num, k):
"""
:type num: str
:type k: int
:rtype: str<|fim▁hole|> while k and stack and stack[-1] > c:
stack.pop()
k -= 1
stack.ap... | """
stack = []
length = len(num) - k
for c in num: |
<|file_name|>viewport.rs<|end_file_name|><|fim▁begin|>//! Provides a utility method for calculating native viewport size when the window is resized.
use ppu::{SCREEN_WIDTH, SCREEN_HEIGHT};
/// A simple rectangle
pub struct Viewport {
pub x: u32,
pub y: u32,
pub w: u32,
pub h: u32,
}
impl Viewport {
... | |
<|file_name|>eagleplatform.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
)
class EaglePlatformIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:
... | video_id, 'Downloading m3u8 JSON')
|
<|file_name|>karma.hpp<|end_file_name|><|fim▁begin|>/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2001-2009 Hartmut Kaiser
http://spirit.sourceforge.net/
Distributed under the Boost Software License, Version 1.0. (Se... | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef BOOST_SPIRIT_INCLUDE_KARMA_REPOSITORY |
<|file_name|>proc_cci_mta_acceptor.cpp<|end_file_name|><|fim▁begin|>//proc_ace_acceptor.cpp
#include <proc_mta_ace_acceptor.h>
using namespace proc_mta_ace;
using std::ostringstream;
//----------------------------------------------------------------------------------------------------------------------------
proc_... | |
<|file_name|>answer.tsx<|end_file_name|><|fim▁begin|>import React from "react";
import { getAnswersByQuestion } from "../../selectors/report-tree";
import { connect } from "react-redux";
import { AnswerProps } from "../../util/answer-utils";
import { getQuestionIcon } from "../../util/question-utils";
import MultipleCh... | ? this.renderAnswer(atype)
: this.renderNoAnswer(QuestionIcon) |
<|file_name|>calc.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/. */
//! [Calc expressions][calc].
//!
//! [calc]: https://drafts.css... | |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
func main() {<|fim▁hole|><|fim▁end|> | // Goes nowhere, does nothing
} |
<|file_name|>common.py<|end_file_name|><|fim▁begin|># This file is distributed under the terms of the GNU General Public license.
# Copyright (C) 1999 Aloril (See the file COPYING for details).
import time
from mind.Goal import Goal
# goals for minds
def false(_): return False
def true(_): return True
class De... | Goal.__init__(self, desc=desc, fulfilled=self.assess_condition)
self.condition_fn = condition_fn
self.goals_true = goals_true |
<|file_name|>bitcoin_sah.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="sah" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About altcommunitycoin</source>
<translation type="... | |
<|file_name|>hsv_rgb.hpp<|end_file_name|><|fim▁begin|>/*******************************************************
* Copyright (c) 2014, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause... | { |
<|file_name|>test_attachment.py<|end_file_name|><|fim▁begin|>from O365 import attachment
import unittest
import json
import base64
from random import randint
att_rep = open('attachment.json','r').read()
att_j = json.loads(att_rep)
class TestAttachment (unittest.TestCase):
def setUp(self):
self.att = attachment.A... | |
<|file_name|>bool.hpp<|end_file_name|><|fim▁begin|>#ifndef SC_BOOST_MPL_BOOL_HPP_INCLUDED
#define SC_BOOST_MPL_BOOL_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENS... | |
<|file_name|>authenticated_group_adder.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/L... | |
<|file_name|>tesstrain.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# (C) Copyright 2014, Google Inc.
# (C) Copyright 2018, James R Barlow
# 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 Licens... | log.addHandler(logfile)
def main(): |
<|file_name|>TestListenerMethodBinding.java<|end_file_name|><|fim▁begin|>// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// h... | import org.apache.tapestry.BindingException;
import org.apache.tapestry.IActionListener; |
<|file_name|>query_result.rs<|end_file_name|><|fim▁begin|>use std::marker::PhantomData;
use serde::{de, Deserialize, Deserializer};
use uuid::Uuid;
/// A report about the outcome of a write.
#[derive(Debug)]
pub struct WriteStatus<T> {
/// The number of new documents inserted. This counter is zero in case of an up... | "inserted" => Inserted,
"replaced" => Replaced,
"unchanged" => Unchanged, |
<|file_name|>AlertPolicyManager.java<|end_file_name|><|fim▁begin|>package com.ctrip.xpipe.redis.checker.alert.manager;
import com.ctrip.xpipe.redis.checker.alert.ALERT_TYPE;
import com.ctrip.xpipe.redis.checker.alert.AlertChannel;
import com.ctrip.xpipe.redis.checker.alert.AlertConfig;
import com.ctrip.xpipe.redis.che... |
import javax.annotation.PostConstruct;
import java.util.List;
import java.util.Map; |
<|file_name|>shop-list.client.routes.js<|end_file_name|><|fim▁begin|>'use strict';
//Setting up route
angular.module('shop-list').config(['$stateProvider',
function($stateProvider) {<|fim▁hole|> $stateProvider.
state('detail-product', {
url: '/detail-product/:productId',
templateUrl: 'modules/shop-list/views... | // Shop list state routing |
<|file_name|>tool_catalog.py<|end_file_name|><|fim▁begin|>import inspect
from biicode.client.shell.biistream import Color
class ToolCatalog(dict):
def __init__(self, main_class, tools):
dict.__init__(self)
self.main_class = main_class
# dict from tool group name to set of classes
f... | return doc.split('\n', 1)[0]
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from contextlib import contextmanager
from datetime import datetime
from django import forms
from django.conf import settings
from django.contrib.auth.models import AbstractBaseUser
from django.core import validators
from django.db import models
from django.utils imp... |
def anonymize(self):
log.info(u"User (%s: <%s>) is being anonymized." % (self, self.email))
self.email = None |
<|file_name|>Conversor.java<|end_file_name|><|fim▁begin|>/**
Copyright 2008, 2009 UFPE - Universidade Federal de Pernambuco
Este arquivo é parte do programa Amadeus Sistema de Gestão de Aprendizagem, ou simplesmente Amadeus LMS
O Amadeus LMS é um software livre; você pode redistribui-lo e/ou modifica-lo dentro... | * Method that converts AMADeUs Material object into Mobile Material object
* @param mat - AMADeUs Material object to be converted
* @return - Mobile Material object converted
|
<|file_name|>gateway_tcp.py<|end_file_name|><|fim▁begin|>"""Start a tcp gateway."""
import click
from mysensors.cli.helper import (
common_gateway_options,
handle_msg,
run_async_gateway,
run_gateway,
)
from mysensors.gateway_tcp import AsyncTCPGateway, TCPGateway
def common_tcp_options(func):
"""... | func = click.option(
"-p", |
<|file_name|>circle_urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#!/usr/bin/env python
'''
circle_urls.py will rename all url files to not have extension .html
'''
import sys
import os
from glob import glob
site_dir = os.path.abspath(sys.argv[1])
print("Using site directory %s" %(site_dir))
files = glob("%s/*.h... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>def get_all_styles():
"""
Returns previously registered by richtemplates at
``richtemplates.settings.REGISTERED_PYGMENTS_STYLES``.
"""
from richtemplates.settings import REGISTERED_PYGMENTS_STYLES
return REGISTERED_PYGMENTS_STYLES
def get_st... | |
<|file_name|>status.py<|end_file_name|><|fim▁begin|>from gettext import gettext as _
import traceback
from pulp.client.commands.repo.sync_publish import StatusRenderer
from pulp.client.extensions.core import COLOR_FAILURE
from pulp_puppet.common import constants
from pulp_puppet.common.publish_progress import Publis... |
self.prompt.render_spacer() |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages
XMODULES = [
"abtest = xmodule.abtest_module:ABTestDescriptor",
"book = xmodule.backcompat_module:TranslateCustomTagDescriptor",
"chapter = xmodule.seq_module:SequenceDescriptor",
"combinedopenended = xmodule... | |
<|file_name|>rijndael_test.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
""" cryptopy.cipher.rijndael_test
Tests for the rijndael encryption algorithm
Copyright (c) 2002 by Paul A. Lambert
Read LICENSE.txt for license information.
"""
from cryptopy.cipher.rijndael import Rijndael
from cryptopy.ci... |
RijndaelTestVec( i = 'dev_vec.txt 20 byte block, 16 byte key', |
<|file_name|>basemodule.js<|end_file_name|><|fim▁begin|>// Copyright 2008 The Closure Library 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
//
// ... | /**
* @fileoverview Defines the base class for a module. This is used to allow the
|
<|file_name|>ShadowVolume.cpp<|end_file_name|><|fim▁begin|>#include <osgShadow/ShadowVolume>
#include <iostream>
#include <string>
#include <osg/Vec3>
#include <osg/Vec4>
#include <osg/io_utils>
#include <osgDB/Registry>
#include <osgDB/Input>
#include <osgDB/Output>
#include <osgDB/ParameterOutput>
bool ShadowVolu... | osgShadow::ShadowVolume& ss = static_cast<osgShadow::ShadowVolume&>(obj);
bool itAdvanced = false;
|
<|file_name|>TodoListClient.java<|end_file_name|><|fim▁begin|>package com.myconnector.client.domain;
import java.util.List;
import com.google.gwt.user.client.rpc.IsSerializable;
import com.myconnector.client.domain.interfaces.ITodoContext;
import com.myconnector.client.domain.interfaces.ITodoItem;
import com.myconnec... |
public void setId(Long id) {
this.id = id;
} |
<|file_name|>editor.py<|end_file_name|><|fim▁begin|>import wx
import os.path
class MainWindow( wx.Frame ):
def __init__( self, filename = '*.txt' ):
super( MainWindow, self ).__init__( None, size = ( 800,640 ) )
self.filename = filename
self.dirname = '.'
self.panel = wx.Panel( sel... | self.SetTitle()
else:
userProvidedFilename = False |
<|file_name|>rpcmanager.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Manager of RPC calls from plugins.
"""
from golismero.api.config import Config
__license__ = """
GoLismero 2.0 - The web knife - Copyright (C) 2011-2014
Golismero project site: https://github.com/golismero
Golis... | :rtype: tuple(class, object, str)
"""
exc_type, exc_value, exc_traceback = sys.exc_info() |
<|file_name|>body4.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from body3 import *
function_decl(link='extern',srcp='eval.c:216',
body=bind_expr(
body=statement_list(
E0=decl_expr(
ftype=void_type(algn='8',name='126')),
E1=decl_expr(
ftype=void_type(algn='8',name='126')),
E... | OP0=pointer_type(algn='64'), |
<|file_name|>query.cc<|end_file_name|><|fim▁begin|>/**
* @file query.cc
*
* @section LICENSE
*
* The MIT License
*
* @copyright Copyright (c) 2017-2021 TileDB, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "So... | if (stride != nullptr)
return logger_->status(Status_QueryError(
"Cannot add range; Setting range stride is currently unsupported"));
|
<|file_name|>ConfigureDryRunError.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 wi... | # permit persons to whom the Software is furnished to do so, subject to
# the following conditions: |
<|file_name|>listener.go<|end_file_name|><|fim▁begin|>package elastic_load_balancing
import (
"github.com/jagregory/cfval/constraints"
. "github.com/jagregory/cfval/schema"
)
// see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-listener.html
var listener = NestedResource{
De... | // * If there is another listener with the same InstancePort whose
// InstanceProtocol is secure, i.e., HTTPS or SSL, the listener's |
<|file_name|>ckan_search.py<|end_file_name|><|fim▁begin|>import os
import time
import mechanize
CKAN = os.environ.get('CKAN', 'http://data.england.nhs.uk/')<|fim▁hole|>
class Transaction(object):
def __init__(self):
self.custom_timers = {}
def run(self):
# create a Browser instance
... | |
<|file_name|>types.js<|end_file_name|><|fim▁begin|><|fim▁hole|>export const LOGGED_OUT = 'LOGGED_OUT';<|fim▁end|> | export const LOGGED_IN = 'LOGGED_IN'; |
<|file_name|>distributions.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
##
# distributions.py: module for probability distributions.
##
# © 2017, Chris Ferrie (csferrie@gmail.com) and
# Christopher Granade (cgranade@cgranade.com).
#
# Redistribution and use in source and binary form... | :param numpy.ndarray locations: Locations of each particle in array
of shape ``(n_particles, n_modelparams)``
:rtype: :class:`numpy.ndarray`, shape ``(n_modelparams,)``. |
<|file_name|>issue-38091-2.rs<|end_file_name|><|fim▁begin|>// build-fail
//~^ ERROR overflow evaluating the requirement `i32: Check`
#![feature(specialization)]
//~^ WARN the feature `specialization` is incomplete
trait Iterate<'a> {
type Ty: Valid;
fn iterate(self);
}
impl<'a, T> Iterate<'a> for T
where<|fim... | T: Check,
{ |
<|file_name|>StringUtils.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2016 Code Above Lab 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... | cp >= 'a' && cp <= 'f' ||
cp >= 'A' && cp <= 'F'; |
<|file_name|>node-console.js<|end_file_name|><|fim▁begin|>require('./node')<|fim▁hole|><|fim▁end|> | require('./console') |
<|file_name|>user.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
import ApplicationSerializer from 'ghost-admin/serializers/application';
import EmbeddedRecordsMixin from 'ember-data/serializers/embedded-records-mixin';
const {String: {pluralize}} = Ember;
export default ApplicationSerializer.extend(Embed... | lastLoginUTC: {key: 'last_login'},
createdAtUTC: {key: 'created_at'},
updatedAtUTC: {key: 'updated_at'}
}, |
<|file_name|>svg.js<|end_file_name|><|fim▁begin|>/* app/ui/map/svg */
define(
[
'jquery',
'raphael',
'app/ui/map/data',
'app/ui/map/util',
'util/detector',
'pubsub'
],
function ($, Raphael, MapData, MapUtil, Detector) {
'use strict';
var SVG;
return {
nzte: {},
markers: [],
exports: ... | continentSet.animate({ opacity: 0 }, 250, 'easeInOutSine').hide().toBack();
}
},
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from __future__ import absolute_import |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014 Anler Hernández <hello@anler.me>
# This program is free software: you can redistribu... | |
<|file_name|>packaging.py<|end_file_name|><|fim▁begin|>import os.path
import subprocess
import pkg_resources
import setuptools # pylint: disable=unused-import
def get_package_revision(package_name):
# type: (str) -> str
"""Determine the Git commit hash for the Shopify package.
If the package is install... | return egg_info.get_metadata('git_sha.txt')
return ''
|
<|file_name|>ResultSet.java<|end_file_name|><|fim▁begin|>package com.planet_ink.fakedb;
import java.io.InputStream;
import java.io.Reader;
import java.sql.NClob;
import java.sql.RowId;
import java.sql.SQLException;
import java.sql.SQLXML;
import java.util.Map;
/*
Copyright 2001 Thomas Neumann
Licen... | if((!isNumber(s1))||(!isNumber(s2))) return 0;
if(isDouble(s1)||(isDouble(s2)))
{
double d1=isDouble(s1)?s_double(s1):Long.valueOf(s_long(s1)).doubleValue();
|
<|file_name|>directives.py<|end_file_name|><|fim▁begin|># Define a new directive `code-block` (aliased as `sourcecode`) that uses the
# `pygments` source highlighter to render code in color.
#
# Incorporates code from the `Pygments`_ documentation for `Using Pygments in
# ReST documents`_ and `Octopress`_.
#
# .. _P... | title = self.options['title'] if 'title' in self.options else 'link'
link = ('<a href="%s">%s</a>' % (self.options['url'], title)) if 'url' in self.options else ''
if caption or link: |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.apps import AppConfig
class SalesforceDb(AppConfig):
name = 'salesforce'
label = 'salesforce_db'<|fim▁end|> | """This file is useful only if 'salesforce' is a duplicit name in Django registry
then put a string 'salesforce.apps.SalesforceDb' instead of simple 'salesforce'
""" |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import datetime
import os
from sqlalchemy import create_engine
from sqlalchemy import MetaData, Table, Column, DateTime, Float, Integer, ForeignKey
from sqlalchemy import between, func
from sqlalchemy.sql import select
from sqlalchemy.ext.hybrid import hybrid_property... | for meter in meters:
user_name = User.query.filter_by(user_id=meter.user_id).first().username |
<|file_name|>SecurityConfig.java<|end_file_name|><|fim▁begin|>package br.eti.qisolucoes.contactcloud.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.Authenti... | |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Bitcoin information service that uses blockchain.info."""
from datetime import timedelta
import logging
from blockchain import exchangerates, statistics
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const ... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Compiler utilities.
//!
//! This module contains a number of utilities used throughput the compiler, such as unique symbol
//! and ID generators and a module for measuring compile-time performance of various aspects of the
//! compiler.
use fnv;
use crate::ast::Exp... |
use std::cmp::max; |
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>from tempfile import TemporaryFile
import pytest
from imgpy import Img
@pytest.mark.parametrize('image', ({
'sub': 'anima/bordered.gif',
'convert': 'L',
'mode': 'P'
}, {
'sub': 'anima/clear.gif',
'convert': 'L',
'mode': 'P'
}, {
'... | }, {
'sub': 'fixed/clear.jpg',
'convert': 'L', |
<|file_name|>tbb.rs<|end_file_name|><|fim▁begin|>use crate::core::bits::Bits;
use crate::core::instruction::{Instruction, Reg2RnRmParams};
use crate::core::register::Reg;<|fim▁hole|>pub fn decode_TBB_t1(opcode: u32) -> Instruction {
let rn = opcode.get_bits(16..20);
let rm = opcode.get_bits(0..4);
Instruct... |
#[allow(non_snake_case)] |
<|file_name|>test_core.py<|end_file_name|><|fim▁begin|>"""
Tests for core and utility classes
"""
import unittest
from pandas_accounting import Company, Subsidiary<|fim▁hole|>class TestCompany(unittest.TestCase):
def setUp(self):
self.C = Company(shares=100)
def test_company_shares(self):
sel... | |
<|file_name|>chromeManifestModify.js<|end_file_name|><|fim▁begin|>import fs from 'fs'
import path from 'path'
const Jimp = require('jimp')
const hjson = require('hjson')
const electronImageResize = require('./electronImageResize')
const {getPath1,getPath2} = require('./chromeExtensionUtil')
const contentScriptName = '... | flagBackground = true |
<|file_name|>DataSourceSmartOS.py<|end_file_name|><|fim▁begin|># vi: ts=4 expandtab
#
# Copyright (C) 2013 Canonical Ltd.
#
# Author: Ben Howard <ben.howard@canonical.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version ... | if md['user-data']: |
<|file_name|>DocetDocFormat.java<|end_file_name|><|fim▁begin|><|fim▁hole|> * Licensed to Diennea S.r.l. under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Diennea S.r.l. licenses this file
* to you under th... | /* |
<|file_name|>DtoConverter.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1... | |
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>extern crate mio;
extern crate bytes;
#[macro_use]
extern crate log;
extern crate env_logger;
extern crate tempdir;
pub use ports::localhost;
mod test_battery;
mod test_close_on_drop;
mod test_echo_server;
mod test_multicast;
mod test_notify;
mod test_register_deregi... | |
<|file_name|>cleanClinTSV.py<|end_file_name|><|fim▁begin|># -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
import miscClin
import tsvIO
import sys
# -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
remapDict = {}
DAYS_PER_YEAR = 365.2425
# ------------... | ## deltaDays is either (days_to_sample_procurement) - (days_to_initial_pathologic_diagnosis)
## or just (days_to_sample_procurement)
if (haveT): |
<|file_name|>0109_v370_job_template_organization_field.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2.4 on 2019-08-07 19:56
import awx.main.utils.polymorphic
import awx.main.fields
from django.db import migrations, models
import django.db.models.deletion
from awx.main.migrations._rbac import (
rebuild_... | migrations.RemoveField(
model_name='project', |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!python
# coding=utf-8
# Package level logger
import logging
logger = logging.getLogger("pocean")
logger.addHandler(logging.NullHandler())<|fim▁hole|>__version__ = "1.0.0"<|fim▁end|> | |
<|file_name|>keyword_provider_unittest.cc<|end_file_name|><|fim▁begin|>// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/omnibox/browser/keyword_provider.h"
#include <stddef.h>
#inc... | |
<|file_name|>encoder_test.go<|end_file_name|><|fim▁begin|>package toolbox_test
import (
"bytes"<|fim▁hole|>)
func TestEncoderFactory(t *testing.T) {
buffer := new(bytes.Buffer)
assert.NotNil(t, toolbox.NewJSONEncoderFactory().Create(buffer))
}
func TestMarshalEncoderFactory(t *testing.T) {
buffer := new(bytes.Bu... | "testing"
"github.com/stretchr/testify/assert"
"github.com/viant/toolbox" |
<|file_name|>eo_view.rs<|end_file_name|><|fim▁begin|>// std imports
use std::mem;
// external imports
use num::traits::Num;
// local imports
use algebra::structure::MagmaBase;
use super::eo_traits::{ERO, ECO};
use matrix::view::MatrixView;
use matrix::traits::{Shape, MatrixBuffer, Strided};
/// Implementation of ... | |
<|file_name|>cli_config.py<|end_file_name|><|fim▁begin|>#
# Copyright 2018 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | class ActionModule(ActionNetworkModule):
def run(self, tmp=None, task_vars=None):
del tmp # tmp no longer has any effect |
<|file_name|>GameObjectAI.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: http://github.com/azerothcore/azerothcore-wotlk/LICENSE-GPL2
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNG... | if (go->GetAIName() == "GameObjectAI")
return PERMIT_BASE_SPECIAL; |
<|file_name|>racetrackview.py<|end_file_name|><|fim▁begin|>import kivy
kivy.require('1.9.1')
from kivy.uix.label import Label
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.widget import Widget
from kivy.uix.scatter import Scatter
from kivy.app import Builder
from kivy.metrics import dp
from kivy.graphics impor... | def remove_heat_values(self, key):
self.ids.trackmap.remove_heat_values(key) |
<|file_name|>PersistentCollection.java<|end_file_name|><|fim▁begin|>/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-par... | /**
* Disassemble the collection to get it ready for the cache |
<|file_name|>exercise3.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
""" Assignment 1, Exercise 3, INF1340, Fall, 2015. Troubleshooting Car Issues.
This module contains one function diagnose_car(). It is an expert system to
interactive diagnose car issues.
"""
__author__ = 'Susan Sim'
__email__ = "ses@drsus... | if clicking == 'Y':
print "Replace the battery." |
<|file_name|>nn_ops.cc<|end_file_name|><|fim▁begin|>/* Copyright 2015 The TensorFlow 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://www.apache.org/licenses... | strides: The stride of the sliding window for each dimension of the |
<|file_name|>random.py<|end_file_name|><|fim▁begin|>"""
Statistics for astronomy
"""
import numpy as np
from scipy.stats.distributions import rv_continuous
<|fim▁hole|>def bivariate_normal(mu=[0, 0], sigma_1=1, sigma_2=1, alpha=0,
size=None, return_cov=False):
"""Sample points from a 2D normal... | |
<|file_name|>countryMentionNYT.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Estimate the international "visibility" of countries by retrieving the
average number of articles the New York Times returns in its search query.
For each year and each country, a query is send to the NYT api and the
number of r... | the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.