prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
Tools for sending email.
"""
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
# Imported for backwards compatibility, and for the sake
# of a cleaner namespace. These symb... | for subject, message, sender, recipient in datatuple]
return connection.send_messages(messages) |
<|file_name|>packed-struct-generic-layout.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://w... | c: S
} |
<|file_name|>bracket_ui.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'reactiongameui.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(obje... | self.label_28.setFont(font) |
<|file_name|>suppress_ga.py<|end_file_name|><|fim▁begin|>"""
SUPPRESS-GO-AHEAD
This supports suppressing or activating Evennia
the GO-AHEAD telnet operation after every server reply.
If the client sends no explicit DONT SUPRESS GO-AHEAD,
Evennia will default to supressing it since many clients
will fail to use it and... | |
<|file_name|>watson.rs<|end_file_name|><|fim▁begin|>use std::fs::File;
use std::io::BufReader;
use std::path::PathBuf;
use std::thread;
use std::time::{Duration, Instant};
use crate::blocks::{Block, ConfigBlock, Update};
use crate::config::SharedConfig;
use crate::de::deserialize_duration;
use crate::de::deserialize_l... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from download_music import run_midi_load<|fim▁end|> | # What should be exported from module |
<|file_name|>_upload.py<|end_file_name|><|fim▁begin|># Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... |
Args: |
<|file_name|>header.component.ts<|end_file_name|><|fim▁begin|>import {Component, OnInit, OnDestroy} from '@angular/core';
import * as firebase from 'firebase';
import {UserService} from "../shared/user.service";
import {MyFireService} from "../shared/myfire.service";
import {Subscription} from "rxjs";
import {LogInComp... | }
ngOnInit() {
this.userService.statusChange.subscribe( userData =>{ |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>const path = require('path');
module.exports = {
lazyLoad: true,
pick: {
posts(markdownData) {<|fim▁hole|> description: markdownData.description,
};
},
},
plugins: [path.join(__dirname, '..', 'node_modules', 'bisheng-plugin-description')],... | return {
meta: markdownData.meta, |
<|file_name|>update-congress.js<|end_file_name|><|fim▁begin|>var request = require("request");
var yaml = require("js-yaml");
var jsonfile = require("jsonfile");
request("https://raw.githubusercontent.com/unitedstates/congress-legislators/master/legislators-current.yaml", function(error, response, body) {
if (!error... |
return {
firstName: legislator.name.first,
lastName: legislator.name.last, |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
from setuptools import find_packages
from setuptools import setup
version = '1.0'
project = 'kotti_mb'
install_requires=[
'Kotti',
],
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHAN... | keywords='kotti addon', |
<|file_name|>gevent.py<|end_file_name|><|fim▁begin|>"""A wait callback to allow psycopg2 cooperation with gevent.
Use `patch_psycopg()` to enable gevent support in Psycopg.
"""
# Copyright (C) 2010-2012 Daniele Varrazzo <daniele.varrazzo@gmail.com>
# All rights reserved. See COPYING file for details.
from __future... | "Bad result from poll: %r" % state)
|
<|file_name|>bug_389.py<|end_file_name|><|fim▁begin|>''' Test bug 389: http://bugs.openbossa.org/show_bug.cgi?id=389'''
import sys
import unittest
from helper import UsesQApplication
from PySide import QtCore,QtGui
class BugTest(UsesQApplication):
def testCase(self):<|fim▁hole|>if __name__ == '__main__':
unit... | s = QtGui.QWidget().style()
i = s.standardIcon(QtGui.QStyle.SP_TitleBarMinButton)
self.assertEqual(type(i), QtGui.QIcon)
|
<|file_name|>package_test.go<|end_file_name|><|fim▁begin|>// Copyright 2017 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package apiserver_test
import (
"testing"
gc "gopkg.in/check.v1"
)
func TestPackage(t *testing.T) {<|fim▁hole|> gc.TestingT(t)
}<|fim▁end|> | |
<|file_name|>placeholder.js<|end_file_name|><|fim▁begin|>/**
* Placeholder test - checks that an attribute or the content of an
* element itself is not a placeholder (i.e. 'click here' for links).
*/
'use strict';
quail.components.placeholder = function (quail, test, Case, options) {
var resolve = function resol... | text += $(this).text();
$(this).find('img[alt]').each(function () {
text += $(this).attr('alt');
}); |
<|file_name|>exception.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
class MorfessorException(Exception):
"""Base class for exceptions in this module."""
pass
class ArgumentException(Exception):
"""Exception in command line argument parsing."""
pass
class InvalidCategoryE... | |
<|file_name|>callback_executors.rs<|end_file_name|><|fim▁begin|>//! Executor abstraction for executing callbacks to user code (request filters, provider state change callbacks)
use std::collections::HashMap;
use std::sync::Arc;
use ansi_term::Colour::Yellow;
use async_trait::async_trait;
use maplit::*;
use serde_json... | use pact_matching::models::content_types::JSON;
use pact_matching::models::provider_states::ProviderState;
|
<|file_name|>0002_auto_20180510_2256.py<|end_file_name|><|fim▁begin|># Generated by Django 2.0.5 on 2018-05-10 22:56
from django.db import migrations
class Migration(migrations.Migration):<|fim▁hole|> dependencies = [("studies", "0001_initial")]
operations = [migrations.AlterModelOptions(name="extension", op... | |
<|file_name|>JobProperty.java<|end_file_name|><|fim▁begin|>/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
... | |
<|file_name|>cjs.js<|end_file_name|><|fim▁begin|>'use strict';
var a = 0;
var b = 1;
var x = a;<|fim▁hole|>
console.log( x + y );<|fim▁end|> | var y = b; |
<|file_name|>modadd.rs<|end_file_name|><|fim▁begin|>use num::{Zero, BigUint, BigInt, Integer, PrimInt};
/// The `ModAdd` trait defines an interface for calculating the sum of two integers
/// modulo a modulus.
pub trait ModAdd {
/// The function `mod_add` computes the sum
/// ```text
/// x + y (mod m)
... | modulus: BigInt,
sum: BigInt, |
<|file_name|>test_mle.py<|end_file_name|><|fim▁begin|>import pytest
import numpy as np
from numpy.testing import assert_allclose
from .....extern.six.moves import range
from ..mle import design_matrix, periodic_fit
@pytest.fixture
def t():
rand = np.random.RandomState(42)
return 10 * rand.rand(10)
@pytest.m... | assert_allclose(y, y_fit) |
<|file_name|>two-sum-naive-spec.js<|end_file_name|><|fim▁begin|>'use strict';
var twoSum = require('../src/two-sum/naive');
describe('twoSum naive', function () {
it('should return undefined when called on an empty array', function () {
expect(twoSum([], 1)).toBe(undefined);
});<|fim▁hole|> it('should return... | |
<|file_name|>auth.go<|end_file_name|><|fim▁begin|>package easyauth
import (
"context"
"crypto/rand"
"encoding/base64"
"fmt"
"html/template"
"log"
"net/http"
"strings"
"time"
"github.com/gorilla/mux"
)
//Role is a number representing a permission level.
//Specific roles will be defined by the host applicati... | }()
r = m.buildContext(w, r)
p.HandlePost(w, r)
} |
<|file_name|>ScrollBar.py<|end_file_name|><|fim▁begin|>#
# This file is part of GNU Enterprise.
#
# GNU Enterprise 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 2, or (at your option) ... | self._val = newVal
self.Paint(None,None,None)
|
<|file_name|>rule_008.py<|end_file_name|><|fim▁begin|>from vsg.rules import token_prefix
from vsg import token
<|fim▁hole|>lTokens.append(token.signal_declaration.identifier)
class rule_008(token_prefix):
'''
This rule checks for valid prefixes on signal identifiers.
Default signal prefix is *s\_*.
... | lTokens = [] |
<|file_name|>__main__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import print_function
import sys
from ipa_auto import ipa_auto
if __name__ == "__main__":
label = ""
pub = False
con = False
# url = "http://192.168.0.33/publish/ipapub/"
# url = "http://127.0.0.1:8000/ipa... | if '-publish' in sys.argv:
pub = True
if '-url' in sys.argv: |
<|file_name|>Application.java<|end_file_name|><|fim▁begin|>package com.test.ipetrov.start;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;<|fim▁hole|>import org.springframework.web.servlet.con... | import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; |
<|file_name|>index.test.tsx<|end_file_name|><|fim▁begin|>import { StandardArticle } from "@artsy/reaction/dist/Components/Publishing/Fixtures/Articles"
import { ImageCollection } from "@artsy/reaction/dist/Components/Publishing/Fixtures/Components"
import {
ArticleImage,
EditImage,
} from "client/apps/edit/componen... |
it("Renders children if !isDraggable", () => {
props.isDraggable = false |
<|file_name|>ex03.rs<|end_file_name|><|fim▁begin|>// Ler um conjunto de quatro valores i,a,b,c onde i é um inteiro
// e positivo e a,b,c são quaisquer valores reais distintos e os
// escreva. A seguir
/*
Se i = 1 escrever os valores a,b,c em ordem crescente
Se i = 2 escrever os valores a,b,c em ordem decrescente
Se i =... | println!("Para I = {:?}, temos {:?}, {:?}, {:?}", i, c, b, a); |
<|file_name|>en.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
tinyMCE.addI18n('en.asciimathcharmap',{
desc : 'Math Symbols'
});<|fim▁end|> | tinyMCE.addI18n('en.asciimath',{
desc : 'Add New Math'
});
|
<|file_name|>hardware_events.cpp<|end_file_name|><|fim▁begin|>// Copyright 2004-present Facebook. All Rights Reserved.
#include <vector>
#include <string>
#include <osquery/core.h>
#include <osquery/logger.h>
#include <osquery/tables.h>
#include "osquery/events/linux/udev.h"
namespace osquery {
namespace tables {
... | subscription->action = UDEV_EVENT_ACTION_ALL;
|
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest<|fim▁hole|>
@pytest.fixture(scope="function")
def dummy_context():
ns = Namespace()
env.before_scenario(ns, None)
yield ns
env.after_scenario(ns, None)<|fim▁end|> | from argparse import Namespace
from behave_cmdline import environment as env
|
<|file_name|>near_to_target.py<|end_file_name|><|fim▁begin|>import math as m
<|fim▁hole|> return True
return False<|fim▁end|> | def near_to_target(lbot, targetX, targetY, nearDist = 50):
x, y, alpha = lbot.getPose()
distToTarget = m.sqrt(m.pow(x-targetX, 2) + m.pow(y-targetY, 2))
if distToTarget <= nearDist: |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>pub fn hello(name: Option<&str>) -> String {
format!("Hello, {}!", match name {
Some(n) => n,
None => "World"
})<|fim▁hole|><|fim▁end|> | } |
<|file_name|>partnership.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Akvo RSR is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/lice... | )
partner_type_extra = ValidXMLCharField( |
<|file_name|>hubvirtualnetworkconnections.go<|end_file_name|><|fim▁begin|>package network
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Change... | type HubVirtualNetworkConnectionsClient struct {
BaseClient |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | """The results of a Task, including logs and execution time."""
exit_code = db.IntegerProperty(required=True)
execution_time = db.FloatProperty(required=False) |
<|file_name|>PlatformProcessorImpl.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to Y... | throw new IgniteException("Platform cache extension cannot be null.");
|
<|file_name|>altcoin_nl.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="nl" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="14"/>
<source>About Altcoin</source>
... | |
<|file_name|>linear-for-loop.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.apache.org... | if i == 0 { assert!((c == 'h' as u8)); }
if i == 1 { assert!((c == 'e' as u8)); } |
<|file_name|>testloader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding: utf-8
import unittest
import sys
import os
<|fim▁hole|>ROOT_PATH = os.path.dirname(__file__)
if __name__ == '__main__':
if 'GAE_SDK' in os.environ:
SDK_PATH = os.environ['GAE_SDK']
sys.path.insert(0, SDK_PATH... | PROJECT_PATH = os.path.sep.join(os.path.abspath(__file__).split(os.path.sep)[:-2]) |
<|file_name|>environment.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2016 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:/... | |
<|file_name|>softmax_vs_convolutional_nn.py<|end_file_name|><|fim▁begin|>import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
def softmax():
# Model variables
x = tf.placeholder(tf.float32, shape=[None, 784])
y_ ... | y_ = tf.placeholder(tf.float32, shape=[None, 10])
# Layer 1 |
<|file_name|>productionOrStagingEndpointInfo.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may ca... | region: {
required: false,
serializedName: 'region',
type: { |
<|file_name|>parser.js<|end_file_name|><|fim▁begin|>var less, tree;
if (typeof environment === "object" && ({}).toString.call(environment) === "[object Environment]") {
// Rhino
// Details on how to detect Rhino: https://github.com/ringo/ringojs/issues/88
if (typeof(window) === 'undefined') { less = {} }
... | if ((importError = parser.imports.error)) { // Check if there was an error during importing
if (importError instanceof LessError) throw importError;
else throw new(LessError)(importError, env); |
<|file_name|>GtkMain.py<|end_file_name|><|fim▁begin|>#
# GtkMain.py -- pygtk threading help routines.
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
GUI threading ... | |
<|file_name|>util.go<|end_file_name|><|fim▁begin|>/*
Copyright 2019 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
Unless re... |
v1 "k8s.io/api/core/v1" |
<|file_name|>issue-89088.rs<|end_file_name|><|fim▁begin|>// Regression test for the ICE described in #89088.
// check-pass
#![allow(indirect_structural_match)]
use std::borrow::Cow;
const FOO: &A = &A::Field(Cow::Borrowed("foo"));
#[derive(PartialEq, Eq)]
enum A {
Field(Cow<'static, str>)
}
fn main() {
let... | _ => todo!() |
<|file_name|>option_box_transmute_ptr.rs<|end_file_name|><|fim▁begin|>// This tests that the size of Option<Box<i32>> is the same as *const i32.
fn option_box_deref() -> i32 {
let val = Some(Box::new(42));
unsafe {<|fim▁hole|> let ptr: *const i32 = std::mem::transmute::<Option<Box<i32>>, *const i32>(val)... | |
<|file_name|>test_multiarray.py<|end_file_name|><|fim▁begin|>import collections.abc
import tempfile
import sys
import warnings
import operator
import io
import itertools
import functools
import ctypes
import os
import gc
import weakref
import pytest
from contextlib import contextmanager
from numpy.compat import pickle... | def test_var_dimensions(self): |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from similarity.webpage import WebPage |
<|file_name|>AppWithHooks.js<|end_file_name|><|fim▁begin|>/*
* function Component with Hooks: Modify ./index.js to apply this file
*/
import React, { useState, useLayoutEffect } from 'react';
import './App.css';
import logo from './logo.svg';
import tplsrc from './views/showing-click-times.liquid';
import Parser from... | fetchTpl
.then(tpl => engine.render(tpl, state))
.then(html => setState({...state, html})) |
<|file_name|>fixed.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2015, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
//! A container which allows you to positi... | impl_TraitWidget!(Fixed);
|
<|file_name|>CoreContainer.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under... | */
public CoreContainer(ConfigSolr config) {
this(config, config.getCoresLocator());
} |
<|file_name|>query.py<|end_file_name|><|fim▁begin|><|fim▁hole|>class BookQuerySet(QuerySet, GroupByMixin):
pass<|fim▁end|> | from django_group_by import GroupByMixin
from django.db.models.query import QuerySet
|
<|file_name|>DropdownMenuItem.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { prefix, getUnhandledProps, defaultProps } from '../utils';
export interface DropdownMenuItemProps {
classPrefix: string;
componentClass?: ... | export default defaultProps<DropdownMenuItemProps>({
classPrefix: 'dropdown-menu-item' |
<|file_name|>BufferedTokenStream.py<|end_file_name|><|fim▁begin|>#
# [The "BSD license"]
# Copyright (c) 2012 Terence Parr
# Copyright (c) 2012 Sam Harwell
# Copyright (c) 2014 Eric Vergnaud
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted... | |
<|file_name|>CullingSet.cpp<|end_file_name|><|fim▁begin|>/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. ... | |
<|file_name|>iGlobalConfig.ts<|end_file_name|><|fim▁begin|>export interface iGlobalConfig {
database?: any;
universe?: any;
network?: any;<|fim▁hole|><|fim▁end|> | } |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Contains test for the ffi layer
extern crate odbc_sys;
use odbc_sys::*;
use std::ptr::null_mut;<|fim▁hole|>
#[test]
fn allocate_environment() {
let mut env: Handle = null_mut();
unsafe {
assert_eq!(
SqlReturn::SUCCESS,
SQLAlloc... | |
<|file_name|>classify_half5.py<|end_file_name|><|fim▁begin|>import numpy as np
import pandas
import scipy, scipy.spatial
import sklearn
import sklearn.svm
import sys
import argparse
import pickle
sys.path.append('codes/')
from utilities_v2 import *
ymin = 157
ysplit = 160
ymax = 161
feat_threshold = 0.01
# C=10... | Xsub = Xsub[:,features_idx] |
<|file_name|>smoke_test.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2014 ThoughtWorks Deutschland GmbH
#
# Pixelated is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License... | fake_mailpile = os.path.join(os.path.dirname(__file__), 'fake_mailpile.py')
ssl_config = SSLConfig(certfile(), keyfile())
provider_ca = None |
<|file_name|>h.js<|end_file_name|><|fim▁begin|>if (typeof global === 'undefined') {
global = window;
} else {
global.XRegExp = require('../../xregexp-all');
}
// Ensure that all opt-in features are disabled when each spec starts
global.disableOptInFeatures = function() {
XRegExp.uninstall('namespacing astr... | } |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|>from datetime import datetime
class PanoplyException(Exception):
def __init__(self, args=None, retryable=True):
super(PanoplyException, self).__init__(args)
self.retryable = retryable
class IncorrectParamError(Exception):
def __init__(s... | self.source_id = source_id
self.database_id = database_id
self.exception_cls = exception_cls
self.created_at = datetime.utcnow() |
<|file_name|>PostFlatFeed.tsx<|end_file_name|><|fim▁begin|>import { Box, Col } from '@tlon/indigo-react';
import { arrToString, Association, FlatGraph, FlatGraphNode, Group } from '@urbit/api';
import bigInt from 'big-integer';
import React from 'react';
import { RouteComponentProps, useHistory } from 'react-router';
i... | offset={0}
data={flatGraph} |
<|file_name|>base_spec.py<|end_file_name|><|fim▁begin|>import os
import signal
import subprocess
import beanstalkc
import time
import pexpect
try:
import unittest2 as unittest
except ImportError:
import unittest
from beanstalkctl.util import BeanstalkdMixin
class BaseSpec(unittest.TestCase, BeanstalkdMixin... | |
<|file_name|>MvcConfiguration.java<|end_file_name|><|fim▁begin|>package com.bugsnag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;... | |
<|file_name|>sl-ls.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# sl-ls.py: get information utility
# Created by NAKAJIMA Takaaki
# Last modified: Apr 16, 2014.
#
# Require: Python v3
#
# See also https://softlayer-api-python-client.readthe... | class VirtualGuests(IterableItems):
u"""List of SoftLayer_Virtual_Guest"""
def define_fetch_method(self): |
<|file_name|>profile.js<|end_file_name|><|fim▁begin|>import { Meteor } from "meteor/meteor";
import { Template } from "meteor/templating";
import { Roles } from "meteor/alanning:roles";
import { ReactiveVar } from "meteor/reactive-var";
import { Reaction } from "/client/api";
import { i18next } from "/client/api";
imp... | Template.accountProfile.helpers({
|
<|file_name|>F.simulateTree.js<|end_file_name|><|fim▁begin|>
(function() {
function getParentIndex(levels, level, index) {
if (level > 0) {
for (var i = index - 1; i >= 0; i--) {
if (levels[i] == level - 1) {
return i;
}
... | else {
return '<div class="x-elbow-end"></div>';
|
<|file_name|>nations.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# This file is part of OpenSoccerManager-Editor.
#
# OpenSoccerManager 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 ve... | self.actionbuttons = uigtk.interface.ActionButtons()
self.actionbuttons.buttonUpdate.connect("clicked", self.on_update_clicked)
self.attach(self.actionbuttons, 0, 1, 1, 1)
|
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# FIXME -- eventually, we want more (all?) of these to work
imagedir = parent + "/libtiffpic/depth"
files = [
"flower-minisblack-02.tif", # 73x43 2-bit minisblack gray image
"flower-minisblack-04.tif", # 73x43 4-bit minisblack gray i... | #FIXME "flower-rgb-planar-32.tif", # 73x43 32-bit seperated RGB image |
<|file_name|>omni-output-pane-view.ts<|end_file_name|><|fim▁begin|>import {Disposable} from "rx";
var Convert = require('ansi-to-html');
import _ = require('lodash')
import Omni = require('../../omni-sharp-server/omni')
import React = require('react');
import {ReactClientComponent} from "./react-client-component";
impo... | _.defer(_.bind(this.scrollToBottom, this)); |
<|file_name|>polyfills.ts<|end_file_name|><|fim▁begin|>// This file includes polyfills needed by Angular and is loaded before
// the app. You can add your own extra polyfills to this file.
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'co... | import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array'; |
<|file_name|>_singleordefault.js<|end_file_name|><|fim▁begin|>function singleOrDefaultAsync(source, hasDefault, defaultValue) {
return new AnonymousObservable(function (o) {
var value = defaultValue, seenValue = false;
return source.subscribe(function (x) {
if (seenValue) {
o.onError(n... | |
<|file_name|>ProcessFailureCancelingITCase.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this ... | }
};
Thread programThread = new Thread(programRunner); |
<|file_name|>kexipartinfo.cpp<|end_file_name|><|fim▁begin|>/* This file is part of the KDE project
Copyright (C) 2003 Lucijan Busch <lucijan@kde.org>
Copyright (C) 2003-2011 Jarosław Staniek <staniek@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU... | }
void Info::setProjectPartID(int id) |
<|file_name|>Mesh.hpp<|end_file_name|><|fim▁begin|>/*
* Mesh.hpp
*
* RTfact - Real-Time Ray Tracing Library
*
* Copyright (C) 2010 Saarland University
*
* 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 Fr... | |
<|file_name|>find.cc<|end_file_name|><|fim▁begin|>// Copyright (C) 2004, 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library 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 So... |
s = "dhruv is a very very good boy ;-)"; |
<|file_name|>typewriter-scrolling.js<|end_file_name|><|fim▁begin|>/**
* LICENSE : MIT
*/
"use strict";
(function (mod) {
if (typeof exports == "object" && typeof module == "object") {
mod(require("codemirror"));
}
else if (typeof define == "function" && define.amd) {
define(["codemirror"],... | if (cm.getSelection().length !== 0) {
return;
}
for (var i = 0, len = changes.length; i < len; i++) { |
<|file_name|>MPPS.java<|end_file_name|><|fim▁begin|>/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy ... | *
* Alternatively, the contents of this file may be used under the terms of |
<|file_name|>webkit.py<|end_file_name|><|fim▁begin|>from .base import Browser, ExecutorBrowser, require_arg
from .base import get_timeout_multiplier # noqa: F401
from ..executors import executor_kwargs as base_executor_kwargs
from ..executors.executorwebdriver import (WebDriverTestharnessExecutor, # noqa: F401
... | |
<|file_name|>income_tract.py<|end_file_name|><|fim▁begin|>"""income_tract.py
Extract the household income per tract for each cbsa, using the
crosswalk between CBSA and Tracts.
"""
import csv
import os
# Income file comprises estimates and margin of error
income_rows = [5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35]
... | reader = csv.reader(source, delimiter=',') |
<|file_name|>appengine_config.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from google.appengine.ext import vendor
#Para que entienda que las librerías de terceros debe buscarlas en la carpeta lib<|fim▁hole|><|fim▁end|> | vendor.add('lib') |
<|file_name|>shader.rs<|end_file_name|><|fim▁begin|>use gfx;
use gfx::traits::FactoryExt;
use vecmath::{self, Matrix4};
static VERTEX: &[u8] = b"
#version 150 core
uniform mat4 u_projection, u_view;
in vec2 at_tex_coord;
in vec3 at_color, at_position;
out vec2 v_tex_coord;
out vec3 v_color;
... | }
|
<|file_name|>init.rs<|end_file_name|><|fim▁begin|>use std::sync::{Arc, Mutex};
use std::io;
use std::ptr;
use std::mem;
use std::thread;
use super::callback;
use super::Window;
use super::MonitorId;
use super::WindowWrapper;
use super::Context;
use Api;
use CreationError;
use CreationError::OsError;
use CursorState;
... |
// `GetMessage` must be called in the same thread as CreateWindow, so we create a new thread |
<|file_name|>DiscordMailHooks.ts<|end_file_name|><|fim▁begin|>import { Buffer } from 'buffer';
const discordmailhooksLegacyBrailleRegex = /([\u2800-\u28FF]+)(?:.)([\u2800-\u28FF]+)/;
class DiscordMailHooks {
email: string
constructor(email: string) {
this.email = email;
}
matches() {
return discordma... |
export default DiscordMailHooks |
<|file_name|>mergeSort.py<|end_file_name|><|fim▁begin|>'''
Python program for implementation of Merge Sort
l is left index, m is middle index and r is right index
L[l...m] and R[m+1.....r] are respective left and right sub-arrays
'''
def merge(arr, l, m, r):
n1 = m - l + 1
n2 = r-m
#create temporary arrays
L ... | if L[i] <= R[j] :
arr[k] = L[i] |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup
import py2exe
import os
import sys
sys.argv.append('py2exe')
# The filename of the script you use to start your program.
target_file = 'main.py'
# The root directory containing your assets, libraries, etc.
assets_dir = '.\\'
# Filet... | """
for file in os.listdir(base_dir + target_dir):
full_path = base_dir + target_dir + file |
<|file_name|>cs_ban.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|> * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.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 the
* Free Software Foundation; ei... | /*
|
<|file_name|>index.js<|end_file_name|><|fim▁begin|>// Alias to import the folder<|fim▁hole|><|fim▁end|> | import Logo from './Logo';
export default Logo; |
<|file_name|>AbstractMobileBeanCursor.java<|end_file_name|><|fim▁begin|>package br.com.zalem.ymir.client.android.entity.data.openmobster.cursor;
import android.database.Cursor;
import br.com.zalem.ymir.client.android.entity.data.cursor.IEntityRecordCursor;
/**
* Base para cursores de dados baseados no OpenMobster.<b... | public void close() { |
<|file_name|>ar-JO.js<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*<|fim▁hole|> * found in the LICENSE file at https://angular.io/license
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/gulp-tasks/cldr/extract.js
function plural(n) {
if (n === 0)
... | * Use of this source code is governed by an MIT-style license that can be |
<|file_name|>upload.user.logo.service.js<|end_file_name|><|fim▁begin|>(function () {
'use strict';
angular
.module('app')
.service('UploadUserLogoService', UploadUserLogoService);
function UploadUserLogoService($http, $log, TokenService, UserService, $rootScope) {
this.uploadImag... | |
<|file_name|>QuadraticResidue1Prng.java<|end_file_name|><|fim▁begin|>/*
* Created on 02/04/2005
*
* JRandTest package
*
* Copyright (c) 2005, Zur Aougav, aougav@hotmail.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted pro... | |
<|file_name|>StandardView.tsx<|end_file_name|><|fim▁begin|>import React, { useEffect, useMemo, useRef } from 'react'
import styled from 'styled-components'
import {
Box,
Button,
Dialog,
extend,
Paragraph,
Progress,
RefreshIcon,
themeGet,
} from '../../components'
import { useFullSizeMode } from '../Full... | width: '100%',
height: '100%', |
<|file_name|>AddImageAction.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2004 - 2012 Nils Asmussen
*
* 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 version 2
* of the Lice... | super(con,start,end);
_image = image;
}
|
<|file_name|>azure_rm_acs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright (c) 2017 Julien Stroheker, <juliens@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = ty... | suboptions:
count: |
<|file_name|>package.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# ===========================================================================
# eXe
# Copyright 2004-2006, University of Auckland
# Copyright 2006-2008 eXe Project, http://eXeLearning.org/
#
# This program is free software; you can redistribu... | "exam": "exam",
"self assessment": "self assessment", |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.