prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>ErrorMessages.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
import { FormErrorMap } from './FormErrorMap';
import { ErrorMessagesContext } from './ErrorMessagesContext';
export interface ErrorMessagesProps {
<|fim▁hole|>}
export default function ErrorMessages({errors, children}: ... | errors?: FormErrorMap
children: React.ReactNode
|
<|file_name|>color.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2022 The MMGen Project <mmgen@tuta.io>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gener... | run([],shell=True) |
<|file_name|>lnbin.py<|end_file_name|><|fim▁begin|>import numpy as np
#x must be a np array
def lnbin(x, BinNum):
"""
Logarithmically bins a numpy array, returns (midpoints, Freq)
This function take the input of a data vector x, which is to be binned;
it also takes in the amount bins one would like t... | while x[i] <= 0:
i += 1 |
<|file_name|>builder.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Appcelerator Titanium Mobile
# Copyright (c) 2011 by Appcelerator, Inc. All Rights Reserved.
# Licensed under the terms of the Apache Public License
# Please see the LICENSE included with this distribution for details... | def are_resources_installed(self): |
<|file_name|>nconns.py<|end_file_name|><|fim▁begin|>import sys
import time
import ldap
url, binddn, bindpw, basedn, nconns, niters = sys.argv[1:]
conns = []
for ii in xrange(0, int(nconns)):<|fim▁hole|> conn.simple_bind(binddn, bindpw)
for ii in xrange(0, int(niters)):
for conn in conns:
ents = conn.s... | conn = ldap.initialize(url)
conns.append(conn)
for conn in conns: |
<|file_name|>HdmiCec.py<|end_file_name|><|fim▁begin|>import struct
import os
from sys import maxint
from enigma import eTimer, eHdmiCEC, eActionMap
from config import config, ConfigSelection, ConfigYesNo, ConfigSubsection, ConfigText
from Tools.StbHardware import getFPWasTimerWakeup
from Tools.Directories import fileEx... | if keyCode == 114:
cmd = 0x44
data = str(struct.pack('B', 0x42)) |
<|file_name|>at2_e2.cc<|end_file_name|><|fim▁begin|>//
// Copyright (c) 2014 Limit Point Systems, 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/licen... | |
<|file_name|>test-verifiers.cc<|end_file_name|><|fim▁begin|>// Copyright 2020 the V8 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.
// These tests check that Torque-generated verifier functions crash the process
// when enco... | #include "src/api/api-inl.h"
#include "src/objects/descriptor-array.h" |
<|file_name|>evlogger.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of hopr: https://github.com/hopr/hopr.
#
# Hopr 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 Founda... | |
<|file_name|>Message.js<|end_file_name|><|fim▁begin|>var _ = require('underscore'),
Backbone = require('backbone'),
DAL = require('../DAL');
var Message = Backbone.Model.extend(
/** @lends Message.prototype */
{
defaults: {
userId: null,
waveId: null,
parent... | this.set('created_at', Date.now());
} |
<|file_name|>coval.py<|end_file_name|><|fim▁begin|># Atomic covalent radius data
# http://www.periodictable.com/Properties/A/CovalentRadius.an.html
# Updated Jun. 9th, 2016
class Covalent(object):<|fim▁hole|> "Al": 1.18, "Si": 1.11, "P": 1.06, "S": 1.02, "Cl": 0.99, "Ar": 0.97,
"K": 1.96, "Ca": 1.74, "Sc": ... | x = {
"H": 0.37, "He": 0.32, "Li": 1.34, "Be": 0.90, "B": 0.82, "C": 0.77,
"N": 0.75, "O": 0.73, "F": 0.71, "Ne": 0.69, "Na": 1.54, "Mg": 1.30, |
<|file_name|>Portal.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
from __future__ import print_function
import datetime
import calendar
import logging
import time
import re
import os
import os.path
from abc import ABCMeta
from abc import abstractmethod
from selenium import webdriver
from selenium.webdriver.com... | self.accountNameRegex = re.compile(r":(?P<accountName>.+):") |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Abstracts out the APIs necessary to `Runtime` for integrating the blocking
//! pool. When the `blocking` feature flag is **not** enabled, these APIs are
//! shells. This isolates the complexity of dealing with conditional
//! compilation.
mod pool;
pub(crate) use po... |
impl BlockingPool {
pub(crate) fn spawner(&self) -> &BlockingPool {
self |
<|file_name|>address.rs<|end_file_name|><|fim▁begin|>extern crate e2d2;
use e2d2::utils::*;
use std::net::Ipv4Addr;
use std::str::FromStr;
<|fim▁hole|> let pfx = Ipv4Prefix::new(u32::from(Ipv4Addr::from_str("192.168.0.0").unwrap()), 16);
assert!(pfx.in_range(u32::from(Ipv4Addr::from_str("192.168.0.1").unwrap()),... | #[test]
fn address_inline() { |
<|file_name|>vtysh_utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
# All Rights Reserved.
#<|fim▁hole|># not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org... | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
<|file_name|>pixied.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import argparse
import ipaddress
import gevent
import gevent.wsgi
import hashlib
import json
import traceback
from gevent import monkey
from werkzeug.exceptions import (BadRequest, HTTPException,
InternalServer... | |
<|file_name|>resolver.js<|end_file_name|><|fim▁begin|>"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ramda_1 = require("ramda");
var render_instance_1 = require("./render-instance");
var types_1 = require("./types");
function deepResolver(mapper, renderer) {
return function (comp) ... | };
}
exports.deepResolver = deepResolver; |
<|file_name|>ghostedit-core-1.0.0-pre.js<|end_file_name|><|fim▁begin|>/* Lasso range library
Name: Lasso
Description: Lightweight, crossbrowser javascript library for creating and modifying ranges. Used by the GhostEdit editor.
Licence: Dual licensed under MIT and LGPL licenses.
Browser Support: Internet Explo... | r.selectNode = function (elem) {
if(typeof elem === "string") elem = document.getElementById(elem);
if (r.domrange) { |
<|file_name|>login.go<|end_file_name|><|fim▁begin|>package openshift
import (
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/golang/glog"
"github.com/spf13/cobra"
kclientcmd "k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
kclientcmdapi "k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api... | func Login(username, password, server, configDir string, f *clientcmd.Factory, c *cobra.Command, out io.Writer) error {
existingConfig, err := f.OpenShiftClientConfig().RawConfig()
if err != nil { |
<|file_name|>logger.hpp<|end_file_name|><|fim▁begin|>#pragma once
#ifndef UTIL_LOGGER_HPP
#define UTIL_LOGGER_HPP
#include <gsl/span>
#include <string>
#include <iterator>
#include <vector>
#include <cstdlib>
/**
* @brief A utility which logs a limited amount of entries
* @details Logs strings inside a ringbuffer.
... | public:
using base = Log::iterator; |
<|file_name|>energyScalingFunction.H<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 20... | |
<|file_name|>macro_inner.rs<|end_file_name|><|fim▁begin|>#![crate_name = "macro_inner"]<|fim▁hole|>pub struct Foo;
/// See also [`Foo`]
#[macro_export]
macro_rules! my_macro {
() => {}
}<|fim▁end|> | #![deny(broken_intra_doc_links)]
|
<|file_name|>Icon.tsx<|end_file_name|><|fim▁begin|>import React, { ComponentType } from "react";
import * as styles from "./Icon.module.scss";
type Props = {
name: string;
icon: ComponentType<any>;
};
const Icon = ({ name, icon }: Props) => {<|fim▁hole|>};
export default Icon;<|fim▁end|> | const Icon = icon;
return <Icon className={styles.icon} />; |
<|file_name|>exception.cpp<|end_file_name|><|fim▁begin|>#include <stdio.h>
#include <stdlib.h>
static void foo()
{
throw 123;
}
<|fim▁hole|>int main(int argc, char *argv[])
{
int count = argc == 1 ? 10000 : atoi(argv[ 1 ]);
int n = 0;
for(int i = 0; i < count; ++i) {
try {
foo();
}
catch(...... | |
<|file_name|>admin-user-manage.ts<|end_file_name|><|fim▁begin|>import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './admin-user-manage.module';<|fim▁hole|><|fim▁end|> |
platformBrowserDynamic().bootstrapModule(AppModule); |
<|file_name|>sample_help.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import division,print_function,absolute_import,unicode_literals
import sys
import os
os.chdir(sys.path[0])
sys.path.append('/mnt/sda2/github/TSF1KEV/TSFpy')
from TSF_io import *
#from TSF_Forth impor... | |
<|file_name|>verify.go<|end_file_name|><|fim▁begin|>package command
import (
"fmt"
"os"
"path/filepath"
"time"
"github.com/kemokemo/gckdir/lib"
"github.com/skratchdot/open-golang/open"
"github.com/urfave/cli"
)
var (
// UsageVerify is Usage of verify subcommand for cli
UsageVerify = "Verifies the structure ... | sourceList, err := lib.GetHashList(source)
if err != nil {
return cli.NewExitError(
fmt.Sprintf("Failed to get the hash list. %v\n%s", err, help), |
<|file_name|>comment.js<|end_file_name|><|fim▁begin|>function commentPage() {
// Open popup
$("#comment-popup").dialog({
width : 800,
height : 400,
modal : true,
appendTo: "#mainForm",
open : function(event, ui) {
$('input[id$="comment-comment"]').focus();
},
close : function(event, ui) {
... | * Clean comment form
|
<|file_name|>24.d.ts<|end_file_name|><|fim▁begin|>import { MacOption24 } from "../../";<|fim▁hole|>
export = MacOption24;<|fim▁end|> | |
<|file_name|>forecastweather_units.js<|end_file_name|><|fim▁begin|>/* Magic Mirror Test config default weather
*
* By rejas
* MIT Licensed.<|fim▁hole|>
modules: [
{
module: "weather",
position: "bottom_bar",
config: {
type: "forecast",
location: "Munich",
mockData: '"#####WEATHERDATA#####"',
... | */
let config = {
units: "imperial", |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-<|fim▁hole|>
The ``scoretools`` package should not import ``instrumenttools``
at top level.
'''
from abjad.tools import systemtools
systemtools.ImportManager.import_structured_package(
__path__[0],
globals(),
)
_documentation_section = ... | '''Dependencies: |
<|file_name|>hw5_tests.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*-
u"""
Тесты на ДЗ#5.
"""
__author__ = "wowkalucky"<|fim▁hole|>
import datetime
from hw5_solution1 import Person
def tests_for_hw5_solution1():
u"""Тесты задачи 1"""
petroff = Person("Petrov", "Petro", "1952-01-02")
ivanoff = ... | __email__ = "wowkalucky@gmail.com"
__date__ = "2014-11-17" |
<|file_name|>file_stack.cpp<|end_file_name|><|fim▁begin|>#include <cstdio>
#include <string>
#include <cerrno>
#include <cstring>
#include "toi.h"
using namespace std;
FileStack::FileStack() {
tlines = 0;
}
FileStack::~FileStack() {
while(!file_stack.empty())
file_close();
}
// returns true if ... | tlines++; |
<|file_name|>TradeConditionOperator.java<|end_file_name|><|fim▁begin|>package ny2.ats.model.tool;<|fim▁hole|>/**
* 取引条件計算の演算子のクラスです
*/
public enum TradeConditionOperator {
EQUAL((d1, d2) -> Double.compare(d1, d2) == 0, null, "="),
LESS((d1, d2) -> d1 < d2, null, "<"),
LESS_EQUAL((d1, d2) -> d1 <= d2, n... |
import java.util.function.BiPredicate;
|
<|file_name|>dataid.py<|end_file_name|><|fim▁begin|>"""
Module defining DataID as enumeration, e.g. concentration, velocity.
class Enum allows accessing members by .name and .value
FunctionID is deprecated and will be removed
"""
from enum import IntEnum, auto
# Schema for metadata
DataSchema = {
"type": "object",... | PID_Major = auto()
PID_Minor = auto()
PID_Patch = auto()
PID_Full = auto() |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>use std::io::{ Result, Read };<|fim▁hole|> /// See `read_to_end` for other semantics.
fn read_into_vec(&mut self) -> Result<Vec<u8>> {
let mut buf = Vec::new();
let res = self.read_to_end(&mut buf);
res.map(|_| buf)
}
/// Read all ... |
pub trait ReadExt: Read {
/// Read all bytes until EOF in this source, returning them as a new `Vec`.
/// |
<|file_name|>metadata.py<|end_file_name|><|fim▁begin|>__description__ = "Zookeeper"<|fim▁hole|><|fim▁end|> | __config__ = {} |
<|file_name|>pages_test.go<|end_file_name|><|fim▁begin|>package octokit
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestPagesService_PageInfo(t *testing.T) {
setup()<|fim▁hole|> defer tearDown()
stubGet(t, "/repos/github/developer.github.com/pages", "pageinfo", nil)
page, result := client.Pa... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// 错误使用
// fn main() {
// let mut s = String::from("hello");
// let r1 = &s; // 没问题
// let r2 = &s; // 没问题
// let r3 = &mut s; // 大问题
// println!("{}, {}, and {}", r1, r2, r3);
//}
// 正确使用
fn main() {<|fim▁hole|> let r2 = &s; // 没问题
printl... | let mut s = String::from("hello");
let r1 = &s; // 没问题 |
<|file_name|>construct.py<|end_file_name|><|fim▁begin|>"""Functions to construct sparse matrices
"""
__docformat__ = "restructuredtext en"
__all__ = [ 'spdiags', 'eye', 'identity', 'kron', 'kronsum',
'hstack', 'vstack', 'bmat', 'rand']
from warnings import warn
import numpy as np
from sputils import u... | |
<|file_name|>fortios_firewall_vip6.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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... | range: "<your_own_value>" |
<|file_name|>Observable.test.ts<|end_file_name|><|fim▁begin|>import {TeardownLogic, Subscription, SubscriptionHandler, Observable, PartialObserver, Subscriber} from 'tabris';
let observable: Observable<string>;
let observer: Subscriber<string>;
let partialObserver: PartialObserver<string> = {};
let subHandler: Subscri... | }); |
<|file_name|>listener.js<|end_file_name|><|fim▁begin|>'use strict'
const { EventEmitter } = require('events')
const { Multiaddr } = require('multiaddr')
/**
* @typedef {import('libp2p-interfaces/src/transport/types').Listener} Listener
*/
/**
* @param {import('../')} libp2p
* @returns {Listener} a transport list... | }) |
<|file_name|>rmsprop_op.cc<|end_file_name|><|fim▁begin|>/* Copyright (c) 2016 PaddlePaddle 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/li... | ctx->HasInput("MeanSquare"), true, |
<|file_name|>Mean.java<|end_file_name|><|fim▁begin|>/*
*
* * Copyright 2015 Skymind,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://... | |
<|file_name|>debug.py<|end_file_name|><|fim▁begin|># pylint: disable=C0111,R0903
"""Shows that debug is enabled"""
import platform
import core.module
import core.widget
import core.decorators
class Module(core.module.Module):
@core.decorators.every(minutes=60)
def __init__(self, config, theme):
sup... |
def state(self, widget):
return "warning" |
<|file_name|>ZUtils.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2001-2006 Jacek Sieka, arnetheduck on gmail point com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either versio... | compressing = false;
dcdebug("Dynamically disabled compression"); |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free softwar... | res_id = context.get('mail.compose.target.id') or context.get('active_id') or False
if context.get('mail.compose.message.mode') == 'mass_mail':
# use the original template values - to be rendered when actually sent
# by super.send_mail() |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (c) 2013, Carnegie Mellon University
# All rights reserved.
# Authors: Michael Koval <mkoval@cs.cmu.edu>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the followi... | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
<|file_name|>connector.js<|end_file_name|><|fim▁begin|>import 'whatwg-fetch';
import { getBaseURL } from 'new-dashboard/utils/base-url';
/*
DEV CREDENTIALS:
https://connreg.carto-staging.com/api/v4
c96add2d9d67ec784ebec742e2ea4cecdedfdf53
*/
async function __createNewConnection (context, payload) {
const base... |
return new Promise((resolve, reject) => {
context.rootState.client.post([CONFIG_PATH], opts, err => { |
<|file_name|>solution_4.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <seqan/file.h>
#include <seqan/sequence.h><|fim▁hole|>template <typename TText, typename TPattern>
int computeLocalScore(TText const & subText, TPattern const & pattern)
{
int localScore = 0;
for (unsigned i = 0; i < length(pa... | #include <seqan/score.h>
using namespace seqan;
|
<|file_name|>vgg.py<|end_file_name|><|fim▁begin|>import tensorflow as tf
import numpy as np
import scipy.io
vgg_layers = [
'conv1_1', 'relu1_1', 'conv1_2', 'relu1_2', 'pool1',
'conv2_1', 'relu2_1', 'conv2_2', 'relu2_2', 'pool2',
'conv3_1', 'relu3_1', 'conv3_2', 'relu3_2', 'conv3_3', 'relu3_3', 'conv3_4', '... | current = tf.nn.avg_pool(current, ksize = (1, 2, 2, 1), strides = (1, 2, 2, 1), padding = 'SAME')
convnet[name] = current
return convnet, mean |
<|file_name|>tokenTester.js<|end_file_name|><|fim▁begin|>//currently commented out as TokenTester is causing a OOG error due to the Factory being too big
//Not fully needed as factory & separate tests cover token creation.
/*contract("TokenTester", function(accounts) {
it("creates 10000 initial tokens", function(d... | });*/ |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)]
use std::rc::Rc;
use std::ops::{
Add,
Sub,
};
use chunk::{ChunkOption};
pub struct Vec3f64 {
x: f64,
y: f64,
z: f64,
}
pub struct Entity {
mass: Rc<ChunkOption>,
velocity: Vec3f64,
location: Vec3f64,
rotation: Ve... | }
|
<|file_name|>run-release.js<|end_file_name|><|fim▁begin|>module.exports = function(gulp, plugins, paths){<|fim▁hole|> return plugins.shell.task("node "+paths.build+"/index.js --production");
};<|fim▁end|> | |
<|file_name|>ringo.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include "ringo.hpp"<|fim▁hole|>void ringo () {
std::cout << "and Ringo" << std::endl;
}<|fim▁end|> | |
<|file_name|>root.rs<|end_file_name|><|fim▁begin|>/*
The library provides a simple datastructure to access geolocated labels with an additional
elimination time t and a label size factor. The library provides method to query a set of
such labels with a bounding box and a minimum elimination time.
Copyr... | ///
/// The struct defines a tree node.
///
/// The tree nodes members are the labels t value, the label itself, the split type (X, Y or UNDEF |
<|file_name|>events.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
from six import add_metaclass, text_type
from .event_encoder import Parameter, EventEncoder
@add_metaclass(EventEncoder)
class Event(object):
hit = Parameter('t', text_type, required=True)
category ... | def __init__(self, **kwargs):
self.hit = 'event'
for name, value in kwargs.items():
setattr(self, name, value) |
<|file_name|>deep_pytorch.py<|end_file_name|><|fim▁begin|>import numpy as np
import warnings
from .._explainer import Explainer
from packaging import version
torch = None
class PyTorchDeep(Explainer):
def __init__(self, model, data):
# try and import pytorch
global torch
if torch is None:... | |
<|file_name|>coordinator.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import sys
sys.path.append(".")
from linear.common.coordinator import Coordinator
import linear.twopc.config as config
if len(sys.argv) != 3:
raise RuntimeError("Invalid arguments. Call like this <name> <num_partitions>")
coordinator = Coordinat... | #! /usr/bin/python3
|
<|file_name|>example.module.ts<|end_file_name|><|fim▁begin|>/**
* @file UI Example 页面
* @desc app/page/example/module
* @author Surmon <https://github.com/surmon-china>
*/
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '... | import { BorderedTableComponent } from './components/table/components/borderedTable';
import { HoverTableComponent } from './components/table/components/hoverTable'; |
<|file_name|>SampleApplication.java<|end_file_name|><|fim▁begin|>package com.sampleapp.base;
import android.app.Application;
<|fim▁hole|>import io.fabric.sdk.android.Fabric;
import timber.log.Timber;
/**
* Created by saveen_dhiman on 05-November-16.
* Initialization of required libraries
*/
public class SampleApp... | import com.crashlytics.android.Crashlytics;
import com.sampleapp.BuildConfig;
import com.sampleapp.utils.UtilsModule;
|
<|file_name|>types.rs<|end_file_name|><|fim▁begin|>use read::Sexp;
use std::rc::Rc;
use std::cell::{RefCell, Ref};
use std::collections::HashMap;
use itertools::*;
#[derive(PartialEq, Clone, Debug)]
pub struct TRef(Rc<RefCell<Option<Type>>>);
impl TRef {
fn new() -> Self {
TRef(Rc::new(RefCell::new(None... | Quote(ref ast) => Type::Sexp,
Add(ref es) => {
for e in es {
unify(&Type::Int, &g(env, e)).unwrap(); |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>from database import init_db
from flask import Flask
from flask_graphql import GraphQLView
from schema import schema
app = Flask(__name__)
app.debug = True
default_query = '''
{
allEmployees {
edges {
node {
id,
name,
department {
... | |
<|file_name|>extends-has-child.js<|end_file_name|><|fim▁begin|>'use strict';
var q = require('q');
var announcer = require('pd-api-announcer');
var methodNomen = require('./nomenclt');
var nm = require('./parenthood-nomenclt');
module.exports = function (Parent, Child) {
var hasChildName = methodNomen.ifOwns(Child)... | }); |
<|file_name|>improv_rnn_create_dataset.py<|end_file_name|><|fim▁begin|># Copyright 2022 The Magenta 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/lice... | 'log', 'INFO',
'The threshold for what messages will be logged DEBUG, INFO, WARN, ERROR, '
'or FATAL.') |
<|file_name|>test_convert.py<|end_file_name|><|fim▁begin|>#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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
# th... | "idPkg:Story[0]/{}Story[0]/{}XMLElement[0]/{}ParagraphStyleRange[0]"
"Stories/Story_mainmainmainmainmainmainmainmainmainmainmainu188.xml" |
<|file_name|>FileProcessing.py<|end_file_name|><|fim▁begin|># encoding=utf-8
import codecs
import sys
from src.view.FileProcessingOutput import FileProcessingOutput
class FileProcessing():
def __init__(self):
self.fileProcessingOutput = FileProcessingOutput()
def read_input_file(self, file_path, fil... | |
<|file_name|>api-call-wikipedia.js<|end_file_name|><|fim▁begin|>define([
"knockout",
// mappoint needs to be here first for addEventListener
"../modules/mappoint",
], function (ko) {
// create result object
var result = {
cityname : ko.observable(''),
citydata : ko.observableArray([])
};
// subscribe to cu... | var city ='',
// oldValue
oldValue = ''; |
<|file_name|>button.view.js<|end_file_name|><|fim▁begin|>import React, { Component, PropTypes } from 'react'
import cx from 'classnames'<|fim▁hole|>import './button.view.styl'
export class Button extends Component {
static propTypes = {
className: PropTypes.string,
children: PropTypes.oneOfType([
Prop... | import { Icon } from '../icon'
import { capitalize } from 'utils/string'
|
<|file_name|>skills.js<|end_file_name|><|fim▁begin|>import React from 'react';
import './skills.scss';
export default () => {
return (
<section className="skills-section">
<svg className="bigTriangleColor separator-skills" width="100%" height="100" viewBox="0 0 100 102" preserveAspectRatio="none">
... | Javascript/ES6 React Redux Node Express MongoDB GraphQL REST Next.js Mocha Jest JSS PostCSS SCSS LESS AWS nginx jQuery Webpack Rollup UI/Design
</p>
<button className="button button--wayra button--inverted skills-btn"> |
<|file_name|>media_object.py<|end_file_name|><|fim▁begin|>""" TODO: Add docstring """
import re
import pexpect
class MediaObject(object):
"""Represents an encodable object"""
def __init__(self, input_filename, output_filename):
self.input_filename = input_filename
self.output_filename = outp... | # PERF: Perform some tests to find the min number of lines
# certain not to contain the duration, then operate on a slice
# not containing those lines |
<|file_name|>Portal.js<|end_file_name|><|fim▁begin|>import React from 'react';
import ReactDOM from 'react-dom';
import componentOrElement from 'react-prop-types/lib/componentOrElement';
import ownerDocument from './utils/ownerDocument';
import getContainer from './utils/getContainer';<|fim▁hole|> * The children of `<P... |
/**
* The `<Portal/>` component renders its children into a new "subtree" outside of current component hierarchy.
* You can think of it as a declarative `appendChild()`, or jQuery's `$.fn.appendTo()`. |
<|file_name|>system.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2020 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <util/system.h>
#i... | bool ArgsManager::SoftSetBoolArg(const std::string& strArg, bool fValue)
{
if (fValue)
return SoftSetArg(strArg, std::string("1")); |
<|file_name|>bitcoin_pl.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="pl" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About iadixcoin</source>
<translation>O iadixcoin</tr... | <translation type="unfinished"/> |
<|file_name|>ogr2ogrtabletopostgislist.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
ogr2ogrtabletopostgislist.py
---------------------
Date : November 2012
Copyright : (C) 2012 by Victo... | arguments.append('-overwrite') |
<|file_name|>mediawiki.py<|end_file_name|><|fim▁begin|>"""
Custom Authenticator to use MediaWiki OAuth with JupyterHub
Requires `mwoauth` package.
"""
import json
import os
from asyncio import wrap_future
from concurrent.futures import ThreadPoolExecutor
from jupyterhub.handlers import BaseHandler
from jupyterhub.uti... | class MWOAuthenticator(OAuthenticator):
login_service = 'MediaWiki'
login_handler = MWLoginHandler
callback_handler = MWCallbackHandler |
<|file_name|>fitsdiff.py<|end_file_name|><|fim▁begin|>"""fitsdiff is now a part of Astropy.
Now this module just provides a wrapper around astropy.io.fits.diff for backwards
compatibility with the old interface in case anyone uses it.
"""
import os
import sys
from astropy.io.fits.diff import FITSDiff
from astropy.io.... | |
<|file_name|>test_artificial_32_None_PolyTrend_12_12_20.py<|end_file_name|><|fim▁begin|>import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
<|fim▁hole|>
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 12, transform = "None", sigma ... | |
<|file_name|>timestamp.ts<|end_file_name|><|fim▁begin|>import { OperatorFunction, Timestamp as TimestampInterface, TimestampProvider, Timestamp } from '../types';
import { map } from './map';
/**
* Attaches a timestamp to each item emitted by an observable indicating when it was emitted
*
* The `timestamp` operator... | return map((value: T) => ({ value, timestamp: timestampProvider.now()})); |
<|file_name|>signup.js<|end_file_name|><|fim▁begin|>import { useState } from 'react'
import { useRouter } from 'next/router'
import Link from 'next/link'
import { gql, useMutation } from '@apollo/client'
import { getErrorMessage } from '../lib/form'
import Field from '../components/field'
const SignUpMutation = gql`
... | <form onSubmit={handleSubmit}>
{errorMsg && <p>{errorMsg}</p>} |
<|file_name|>syslog_broker.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2012:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is p... | # the Free Software Foundation, either version 3 of the License, or |
<|file_name|>metrics_utils.py<|end_file_name|><|fim▁begin|># Copyright 2021 The Kubeflow 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/LICENS... | # distributed under the License is distributed on an "AS IS" BASIS, |
<|file_name|>operand.rs<|end_file_name|><|fim▁begin|>//!
//! MOS 6502 operands (adressing modes)
//!
use std::fmt;
use addr::{Address, Masked};
use cpu::Mos6502;
use mem::Addressable;
/// Instruction operand with different addressing modes
#[derive(Debug, PartialEq, Eq)]
pub enum Operand {
Implied, ... | let mut cpu = Mos6502::new(TestMemory);
cpu.pc = 0x1337; cpu.ac = 0x88; cpu.x = 0x11; cpu.y = 0x22;
// Implied |
<|file_name|>trait.rs<|end_file_name|><|fim▁begin|>// 不可复制的类型。
struct Empty;<|fim▁hole|>trait DoubleDrop<T> {
// 定义一个关于调用者的方法,接受一个额外的单一参量 `T`,
// 且没有任何操作。
fn double_drop(self, _: T);
}
// 针对泛型参量 `T` 和调用者 `U` 实现了 `DoubleDrop<T>` 。
impl<T, U> DoubleDrop<T> for U {
// 此方法获得了两个传入参数的所有权,并释放这两个参数。
fn dou... | struct Null;
// 用到 `T` 的trait 泛型。 |
<|file_name|>hooks.py<|end_file_name|><|fim▁begin|>import hexchat
import re
import sys
import twitch.hook, twitch.jtvmsghandler, twitch.user, twitch.channel
import twitch.normalize, twitch.commands, twitch.exceptions, twitch.topic
import twitch.logger, twitch.settings
from twitch import irc
log = twitch.logger.get()
#... | |
<|file_name|>DefaultDialogActionButton.d.ts<|end_file_name|><|fim▁begin|>/// <reference types="react" />
import {DialogAction} from './types'
export declare function DefaultDialogActionButton(props: {<|fim▁hole|> index: number
onAction?: (action: DialogAction) => void
}): JSX.Element<|fim▁end|> | action: DialogAction |
<|file_name|>interval_timer.rs<|end_file_name|><|fim▁begin|>//! Timer to keep track of repeating intervals.
/// This struct keeps track of passage of repeated intervals (like bars of music).
pub struct IntervalTimer {
every: u64,
next: u64,
}
impl IntervalTimer {
#[allow(missing_docs)]
pub fn new(every: u64, ... | |
<|file_name|>quest.101.js<|end_file_name|><|fim▁begin|>//
// Speak To The Farmers ( 101 )
//
var log = require('../class.log'),
realmConfig = require('../../config.realm').config,
quest = require('../class.quest'),
questCondition = require('../class.questCondition').condition;
exports.questObject... | var self = this;
this.conditions = {};
|
<|file_name|>ops.py<|end_file_name|><|fim▁begin|>from .. import util
from ..util import sqla_compat
from . import schemaobj
from sqlalchemy.types import NULLTYPE
from .base import Operations, BatchOperations
import re
class MigrateOperation(object):
"""base class for migration command and organization objects.
... | |
<|file_name|>aslam_buoys.py<|end_file_name|><|fim▁begin|>from mission.constants.config import PIPE_SEARCH_DEPTH
from mission.framework.combinators import *
from mission.framework.primitive import *
from mission.framework.position import *
from mission.framework.movement import *
from mission.framework.task import *
fro... | RestoreHeading()
] |
<|file_name|>ufcs-explicit-self-bad.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 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.apa... | let foo = box Foo {
f: 1,
};
println!("{}", foo.foo(2)); |
<|file_name|>reverse_lists.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on Jul 1, 2014
@author: anroco
I have a list in python and I want to invest the elements, ie the latter is the
first, how I can do?
<|fim▁hole|>Tengo una lista en python y quiero invertir los elementos... | |
<|file_name|>bind_rel_test.cpp<|end_file_name|><|fim▁begin|>#include <boost/config.hpp>
#if defined(BOOST_MSVC)
#pragma warning(disable: 4786) // identifier truncated in debug info
#pragma warning(disable: 4710) // function not inlined
#pragma warning(disable: 4711) // function selected for automatic inline ex... | BOOST_TEST( ( boost::bind( f, _1 ) == y )( x ) );
BOOST_TEST( !( ( boost::bind( f, _1 ) != y )( x ) ) );
BOOST_TEST( !( ( boost::bind( f, _1 ) < y )( x ) ) );
|
<|file_name|>test-paths.py<|end_file_name|><|fim▁begin|>from . import common
import os
import hglib
class test_paths(common.basetest):
def test_basic(self):
f = open('.hg/hgrc', 'a')
f.write('[paths]\nfoo = bar\n')
f.close()
# hgrc isn't watched for changes yet, have to reopen
... | |
<|file_name|>struct-seq-value-type.ts<|end_file_name|><|fim▁begin|>import { StructProperty } from './struct-property';
/**
* REDHAWK StructSeq Property values is a list of Structs<|fim▁hole|><|fim▁end|> | */
export type StructSeqValueType = Array<StructProperty>; |
<|file_name|>antiFloodBot.py<|end_file_name|><|fim▁begin|>import os
import time
import json
import pprint
from util import hook
def readConfig():
### Read config json and parse it
confJson = None
with open(os.getcwd() + '/antiFloodBotConfig.json', 'r') as confFile:
confJson = confFile.read()
... | saveToFile(file, "inp", inp)
saveToFile(file, "nick", nick)
saveToFile(file, "msg", msg) |
<|file_name|>kernel.go<|end_file_name|><|fim▁begin|>// Copyright 2017 Yanni Coroneos. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"../../embedded"
"fmt"
"runtime"
"syscall"
)
/*
* This is the entry point of GER... | for { |
<|file_name|>BLASTing.py<|end_file_name|><|fim▁begin|>####### LICENSE #######
# This code is part of the Recombineering module, written by Gregory
# Moyerbrailean at Michigan State University, Department of Microbiology
# and Molecular Genetics.
# Copyright (C) 2010 Gregory Moyerbrailean
#
# This program is free soft... | buff = 0.05 * l |
<|file_name|>Test8570.java<|end_file_name|><|fim▁begin|>package org.gradle.test.performance.mediummonolithicjavaproject.p428;
import org.junit.Test;
import static org.junit.Assert.*;
public class Test8570 {
Production8570 objectUnderTest = new Production8570();
@Test
public void testProperty0() {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.