prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>IntWithMaxTest.java<|end_file_name|><|fim▁begin|>package xigua.battle.of.elements.model;
import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class IntWithMaxTest {
private IntWithMax intWithMax;
@Before
public void setUp() {
... | assertThat(intWithMax.getMaxValue()).isEqualTo(42);
}
} |
<|file_name|>download_data_test.py<|end_file_name|><|fim▁begin|># Copyright 2019 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://ww... | { name: 'optional_string_hparam' }
]
metric_infos: [ |
<|file_name|>api2db.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
#!/usr/bin/env python
# ############################################################################
# ########## Libraries #############
# ##################################
# Standard library
import logging
from os import path<|fim▁hole|>
# ... | |
<|file_name|>uploadhandler.py<|end_file_name|><|fim▁begin|>"""
Upload handlers to test the upload API.
"""
from django.core.files.uploadhandler import (
FileUploadHandler, StopUpload, TemporaryFileUploadHandler,
)
class QuotaUploadHandler(FileUploadHandler):
"""
This test upload handler terminates the co... | def receive_data_chunk(self, raw_data, start): |
<|file_name|>Utils.ts<|end_file_name|><|fim▁begin|>module Utils {
export class Generator {
public static newGuid() {
var guid = "";
for (var i = 1; i <= 32; i++) {
var n = Math.floor(Math.random() * 16.0).toString(16);
guid += n;
if ((... |
export class Common {
public static isInt(val: string): boolean {
var regInt = /^-?[0-9]+(\.0*)?$/; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Contains everything related to the interface between glium and the OpenGL implementation.
use gl;
use libc;
use std::env;
use std::mem;
use std::ptr;
use std::borrow::Cow;
use std::collections::HashMap;
use std::cell::{Cell, RefCell, RefMut};
use std::marker::Phant... | if ctxt.extensions.gl_nvx_gpu_memory_info {
ctxt.gl.GetIntegerv(gl::GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX,
&mut value[0]); |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
######################
# MEZZANINE SETTINGS #
######################
# The following settings are already defined with default values in
# the ``defaults.py`` module within each of Mezzanine's apps, but are
... |
# List of processors used by RequestContext to populate the context.
# Each one should be a callable that takes the request object as its
# only parameter and returns a dictionary to add to the context. |
<|file_name|>test_discoveredhost.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
"""Test class for Foreman Discovery
@Requirement: Discoveredhost
@CaseAutomation: Automated
@CaseLevel: Acceptance
@CaseComponent: UI
@TestType: Functional
@CaseImportance: High
@Upstream: No
"""
import subprocess
import t... | session, |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>// Demo component
// this is only example component
// you can find tests in __test__ folder
import React from 'react';
import Button from './components/Button'
class TeamCatfish extends React.Component {
render() {
return (
<div className="t... | </div>
)
}
}; |
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>use cargo::core::Workspace;
use cargo::ops::{self, MessageFormat, Packages};
use cargo::util::{CliResult, CliError, Config, CargoErrorKind};
use cargo::util::important_paths::find_root_manifest_for_wd;
#[derive(Deserialize)]
pub struct Options {
arg_args: Vec<Strin... | Compilation can be configured via the `test` profile in the manifest.
By default the rust test harness hides output from test execution to |
<|file_name|>test_true_condition.py<|end_file_name|><|fim▁begin|>import pytest
from clustaar.authorize.conditions import TrueCondition
@pytest.fixture
def condition():
return TrueCondition()
<|fim▁hole|><|fim▁end|> |
class TestCall(object):
def test_returns_true(self, condition):
assert condition({}) |
<|file_name|>test_dist.py<|end_file_name|><|fim▁begin|>from jabbapylib.distance.dist import lev_dist, ham_dist, similarity
def test_lev_dist():
assert lev_dist('ag-tcc', 'cgctca') == 3
assert lev_dist('GUMBO', 'GAMBOL') == 2
assert lev_dist('Google', 'Yahoo!') == 6<|fim▁hole|>def test_ham_dist():
asser... | |
<|file_name|>pdf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#-*- coding: utf-8 -*-
### 2008-2015 Charlie Barnes.
### 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... | |
<|file_name|>DispersionSpectrumLike.py<|end_file_name|><|fim▁begin|>import copy
import pandas as pd
from threeML.plugins.SpectrumLike import SpectrumLike
from threeML.utils.OGIP.response import InstrumentResponse
from threeML.utils.spectrum.binned_spectrum import (
BinnedSpectrumWithDispersion,
ChannelSet,
)
... | ), "the observed spectrum does not have a response"
# assign the response to the plugins |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf8 -*-
"""setup
(C) Franck Barbenoire <fbarbenoire@yahoo.fr>
License : GPL v3"""
<|fim▁hole|>from setuptools import find_packages
setup(name = "django-openzoom",
version = "0.1.1",
description = "Django application for di... | from distutils.core import setup |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>#resource, resources, Resources
from flask import Blueprint, render_template, request,flash, redirect, url_for
from app.{resources}.models import {Resources}, {Resources}Schema
{resources} = Blueprint('{resources}', __name__, template_folder='templates')
#http://... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![no_std]
extern crate labrador_ldpc;
use labrador_ldpc::LDPCCode;<|fim▁hole|>
#[panic_handler]
#[no_mangle]
pub fn panic(_info: &core::panic::PanicInfo) -> ! {
loop {}
}
#[no_mangle]
pub extern fn labrador_ldpc_code_n(code: LDPCCode) -> usize {
code.n()
}
#... | use labrador_ldpc::decoder::DecodeFrom;
use core::slice; |
<|file_name|>DatabaseObject.ts<|end_file_name|><|fim▁begin|>export class DatabaseObject {<|fim▁hole|><|fim▁end|> | documentType?: string;
} |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Cloud'
db.create_table(u'cloudslav... | 'image_name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'primary_key': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'region': ('djang... |
<|file_name|>qmp_basic.py<|end_file_name|><|fim▁begin|>from autotest.client.shared import error
from virttest import qemu_monitor
def run(test, params, env):
"""
QMP Specification test-suite: this checks if the *basic* protocol conforms
to its specification, which is file QMP/qmp-spec.txt in QEMU's source... | check_success_resp(resp)
check_str_key(resp, "id", id_key)
|
<|file_name|>AccountResourceIntTest.java<|end_file_name|><|fim▁begin|>package com.baeldung.jhipster5.web.rest;
import com.baeldung.jhipster5.BookstoreApp;
import com.baeldung.jhipster5.config.Constants;
import com.baeldung.jhipster5.domain.Authority;
import com.baeldung.jhipster5.domain.User;
import com.baeldung.jhips... | userWithUpperCaseEmail.setImageUrl(firstUser.getImageUrl());
userWithUpperCaseEmail.setLangKey(firstUser.getLangKey());
userWithUpperCaseEmail.setAuthorities(new HashSet<>(firstUser.getAuthorities())); |
<|file_name|>TileElement.cpp<|end_file_name|><|fim▁begin|>/*****************************************************************************
* Copyright (c) 2014-2019 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRC... | Guard::Assert(false);
}
} |
<|file_name|>unique-decl.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/lic... | |
<|file_name|>parityBackground.js<|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 versi... |
return _props;
};
} |
<|file_name|>rpc.py<|end_file_name|><|fim▁begin|># Copyright 2011 Jeff Garzik
#
# RawProxy has the following improvements over python-jsonrpc's ServiceProxy
# class:
#
# - HTTP connections persist for the life of the RawProxy object (if server
# supports HTTP/1.1)
# - sends protocol 'version', per JSON-RPC 1.1
# - se... | (self.__class__.__name__, block_hash.__class__))
try:
r = self._call('getblock', block_hash, False) |
<|file_name|>DiffCompare.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ***********************IMPORTANT NMAP LICENSE TERMS************************
# * *
# * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com ... | |
<|file_name|>elastic.rs<|end_file_name|><|fim▁begin|>use super::ease::Easing;
use functions::util::*;
use num_traits::float::FloatConst;
/// This struct captures Elastic easing functions
#[derive(Debug)]
pub struct Elastic;
impl<F: Float + FloatConst> Easing<F> for Elastic {
fn ease_in(t: F, b: F, c: F, d: F) -> ... | |
<|file_name|>test_calibration.py<|end_file_name|><|fim▁begin|># Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# License: BSD 3 clause
import pytest
import numpy as np
from numpy.testing import assert_allclose
from scipy import sparse
from sklearn.base import BaseEstimator
from sklearn.dummy im... | clf, method=method, cv=5, ensemble=ensemble |
<|file_name|>test_storage.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from unittest import TestCase
from scrapy.settings import Settings
from scrapy_tracker.storage.memory import MemoryStorage
from scrapy_tracker.storage.redis import RedisStorage
from scrapy_tracker.storage.sqlalchemy import SqlAlchemySto... | with mock.patch("scrapy_tracker.storage.redis.StrictRedis") as mock_redis: |
<|file_name|>Roundrect_test.go<|end_file_name|><|fim▁begin|>// Copyright 2017 Baliance. All rights reserved.
//
// DO NOT EDIT: generated by gooxml ECMA-376 generator
//
// Use of this source code is governed by the terms of the Affero GNU General
// Public License version 3.0 as published by the Free Software Foundati... | "baliance.com/gooxml/schema/urn/schemas_microsoft_com/vml"
)
func TestRoundrectConstructor(t *testing.T) { |
<|file_name|>people_class.py<|end_file_name|><|fim▁begin|>#! /home/nsanthony/miniconda3/bin/python
import inventory.inventory_class as inv
import weapons.weapon_class as wp<|fim▁hole|>
class people:
"""This is the people class with attributes:"""
def name():
n = ''
return n
def health():
... | |
<|file_name|>test_wsse.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
<|fim▁hole|>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, o... | |
<|file_name|>directshow.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 Takeshi HASEGAWA
#
# 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... | import threading
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![warn(missing_docs, trivial_numeric_casts, unused_extern_crates, unused_import_braces, unused_qualifications,
unused_results)]
//! # Pascal strings in Rust.
//!
//! A `PascalString`, or `ShortString` is a String which stores its data on the stack. Because of t... | extern crate ascii as ascii_crate;
extern crate odds; |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import * as S from './addTodo.css';
import { ITodo } from '../../../../interfaces/ITodo';
export const AddTodoComponent: angular.IComponentOptions = {
template: `
<form ng-submit="$ctrl.addTodo()">
<input class="${S['new-todo']}" placeholder="... | |
<|file_name|>test_actionchain.py<|end_file_name|><|fim▁begin|># Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apa... | CHAIN_SECOND_TASK_RENDER_FAIL_PATH = FixturesLoader().get_fixture_file_path_abs(
FIXTURES_PACK, 'actionchains', 'chain_second_task_parameter_render_fail.yaml') |
<|file_name|>bsp.cpp<|end_file_name|><|fim▁begin|>// bsp.cpp -- by Thatcher Ulrich <tu@tulrich.com> 2001
// This code is in the public domain.
// Code to make a collision-bsp tree out of triangle soup.
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <engine/utility.h>
#include <engine/bsp.h>
co... | float diff = db - da; |
<|file_name|>process.py<|end_file_name|><|fim▁begin|>from tornado.process import cpu_count, _reseed_random
from tornado import ioloop
import logging
import os
import signal
import sys
from tornado.util import errno_from_exception
import errno
logger = logging.getLogger(__name__)
_task_id = None
exiting = ... | children = {}
|
<|file_name|>deserializeform.js<|end_file_name|><|fim▁begin|>// Generated by CoffeeScript 1.6.3
/*!
@author Branko Vukelic <branko@brankovukelic.com>
@license MIT
*/
var _this = this;
if (typeof define !== 'function' || !define.amd) {
this.require = function(dep) {
return (function() {
switch (dep) {
... | if (!name) {
return;
}
switch (type) { |
<|file_name|>ip_lib.py<|end_file_name|><|fim▁begin|><|fim▁hole|># 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/LICE... | # Copyright 2012 OpenStack Foundation |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>"""
Configuration for the ``student`` Django application.
"""
from __future__ import absolute_import
from django.apps import AppConfig
from django.contrib.auth.signals import user_logged_in
class StudentConfig(AppConfig):
"""
Default configuration for the ``s... | from django.contrib.auth.models import update_last_login as django_update_last_login
user_logged_in.disconnect(django_update_last_login)
from .signals.receivers import update_last_login
user_logged_in.connect(update_last_login) |
<|file_name|>CachedProperty.py<|end_file_name|><|fim▁begin|># NOTE: this should inherit from (object) to function correctly with python 2.7
class CachedProperty(object):
""" A property that is only computed once per instance and
then stores the result in _cached_properties of the object.
Source: https:... | return True
else:
return False |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
Copyright (c) 2012-2016 Ben Croston
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 without restriction, including without limitation the ... | |
<|file_name|>angles.py<|end_file_name|><|fim▁begin|>"""Angles and anomalies.
"""
from astropy import units as u
from poliastro.core.angles import (
D_to_M as D_to_M_fast,
D_to_nu as D_to_nu_fast,
E_to_M as E_to_M_fast,
E_to_nu as E_to_nu_fast,
F_to_M as F_to_M_fast,
F_to_nu as F_to_nu_fast,
... | Hyperbolic eccentric anomaly.
ecc : ~astropy.units.Quantity
Eccentricity (>1).
|
<|file_name|>palette-sort.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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 3 of the License, or
# (a... | |
<|file_name|>migrate.js<|end_file_name|><|fim▁begin|>var assert = require("chai").assert;
var Init = require("truffle-init");
var Migrate = require("truffle-migrate");
var Contracts = require("../lib/contracts");
var Networks = require("../lib/networks");
var path = require("path");
var fs = require("fs");
var TestRPC ... | });
});
}; |
<|file_name|>requestlog.py<|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/.
import mozhttpd
import urllib2
import os
import unittest
import... |
def check_logging(self, log_requests=False):
httpd = mozhttpd.MozHttpd(port=0, docroot=here, log_requests=log_requests) |
<|file_name|>block_depth.py<|end_file_name|><|fim▁begin|>"""
Block Depth Transformer
"""
from __future__ import absolute_import
from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer<|fim▁hole|> """
Keep track of the depth of each block within the block structure. In ... |
class BlockDepthTransformer(BlockStructureTransformer): |
<|file_name|>hints_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for checks."""
from grr.lib import flags
from grr.lib import test_lib
from grr.lib.checks import hints
from grr.lib.rdfvalues import client as rdf_client
from grr.lib.rdfvalues import config_file as rdf_config... | """Test hint operations."""
def testCheckOverlay(self): |
<|file_name|>ArrayFilterIterator.java<|end_file_name|><|fim▁begin|>/*
* The MIT License
*
* Copyright 2016 njacinto.
*
* 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 without restricti... | package org.nfpj.utils.arrays; |
<|file_name|>test_action_defaults.py<|end_file_name|><|fim▁begin|># Copyright 2015 - StackStorm, 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... | ---
version: "2.0" |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/// Debug
#[macro_use]
pub mod debug;
/// ELF File Support
pub mod elf;
/// Event input
pub mod event;
/// Get slice implementation
pub mod get_slice;
/// Kernel memory allocation
pub mod memory;
/// Paging (x86)
#[cfg(target_arch = "x86")]
#[path="paging-i386.rs"]
pub m... | pub mod parse_ip;
/// A module for queues
pub mod queue;
/// A module for pseudorandom generator |
<|file_name|>util.js<|end_file_name|><|fim▁begin|>/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* Copyright 2012 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not... | lineTo: 14,
curveTo: 15,
curveTo2: 16,
curveTo3: 17, |
<|file_name|>FormatIndentDecreaseSharp.js<|end_file_name|><|fim▁begin|>import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><path d="M11 17h10v-2H11v2zm-8-5l4 4V8l-4 4zm0 9h18v-2H3v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z" /></React.Fragme... | |
<|file_name|>catalog.test.ts<|end_file_name|><|fim▁begin|>import fs from "fs-extra"
import path from "path"
import mockFs from "mock-fs"
import { mockConsole, mockConfig } from "@lingui/jest-mocks"
import {
getCatalogs,
getCatalogForFile,
getCatalogForMerge,
Catalog,
cleanObsolete,
order,
normalizeRelati... | |
<|file_name|>background.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2013 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.
/**
* Extension ID of Files.app.
* @type {string}
* @const
*/
var FILE_MANAGER_EXTENSIONS_... | chrome.runtime.sendMessage(
FILE_MANAGER_EXTENSIONS_ID, { |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Caliopen mail message privacy features extraction methods."""
from __future__ import absolute_import, print_function, unicode_literals
import logging
import pgpy
from caliopen_main.pi.parameters import PIParameter
from .helpers.spam import ... | |
<|file_name|>middleware.py<|end_file_name|><|fim▁begin|># -*- coding:Utf-8 -*-
from django.conf import settings
from django.core.urlresolvers import is_valid_path
from django.http import HttpResponseRedirect
from django.utils.cache import patch_vary_headers
from django.utils import translation
from django.middleware.l... | |
<|file_name|>cache.py<|end_file_name|><|fim▁begin|>from django.test import TestCase
from restclients.mock_http import MockHTTP
from myuw.util.cache_implementation import MyUWCache
from restclients.models import CacheEntryTimed
from datetime import timedelta
CACHE = 'myuw.util.cache_implementation.MyUWCache'
class T... | response = cache.getCache('sws', '/student/myuwcachetest1', {}) |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
mod errors;
use common::Named;
use errors::*;
use fnv::{FnvHashMap, FnvHashSet}... | TypeWithFields, UnionID,
}; |
<|file_name|>projectview.js<|end_file_name|><|fim▁begin|>define([], function() {
return Backbone.View.extend({
tagName: "a",
className: "projectlink",
attributes: {
href: "#"
},
template: _.template("<%- name %>"),
events: {<|fim▁hole|> },
initialize: function() {
this.listenTo(this.model, "change... | "click": "toggleSelection" |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod finite_state_automaton;<|fim▁hole|><|fim▁end|> | pub mod push_down_automaton;
pub mod tree_stack_automaton; |
<|file_name|>pull-request-review-comment-deleted.event.ts<|end_file_name|><|fim▁begin|>export const pullRequestReviewCommentRemoved = {
'event': 'pull_request_review_comment',
'payload': {
'action': 'deleted',
'comment': {
'url': 'https://api.github.com/repos/Thatkookooguy/test-new-achievibit-events/p... | 'blobs_url': 'https://api.github.com/repos/Thatkookooguy/test-new-achievibit-events/git/blobs{/sha}',
'git_tags_url': 'https://api.github.com/repos/Thatkookooguy/test-new-achievibit-events/git/tags{/sha}',
'git_refs_url': 'https://api.github.com/repos/Thatkookooguy/test-new-achievibit-even... |
<|file_name|>score.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> score: number;
createdAt: Date;
}<|fim▁end|> | export interface Score {
name: string; |
<|file_name|>construct-string-from-binary-tree.js<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> * this.val = val;
* this.left = this.right = null;
* }
*/
/**
* @param {TreeNode} t
* @return {string}
*/
const tree2str = (t) => {
let ret = '';
if (t) {
ret += t.val;
if (t.left || t.ri... | * Definition for a binary tree node.
* function TreeNode(val) { |
<|file_name|>baserunner_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2008 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://w... |
class BaseRunnerTest(unittest.TestCase):
"""Unit test cases for BaseRunner class.""" |
<|file_name|>acfun.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
<|fim▁hole|>from .letv import letvcloud_download_by_vu
from .qq import qq_download_by_vid
from .sina import sina_download_by_vid
from .tudou import tudou_download_by_iid
from .youku import youku_download_by_vid
import json, re
def get_srt_json(i... | __all__ = ['acfun_download']
from ..common import *
|
<|file_name|>migrate_analytics.py<|end_file_name|><|fim▁begin|># A script to migrate old keen analytics to a new collection, generate in-between points for choppy
# data, or a little of both
import os
import csv
import copy
import pytz
import logging
import argparse
import datetime
from dateutil.parser import parse
fr... | return client.extraction(event_collection, timeframe=timeframe) |
<|file_name|>s3.go<|end_file_name|><|fim▁begin|>package s3
import (
"bytes"
"context"
"errors"
"io"
"os"
"path/filepath"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/... |
_, err = s3c.Client.DeleteObject(&input) |
<|file_name|>NormalMapDemo.java<|end_file_name|><|fim▁begin|>// External imports
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.FileInputStream;
import java.io.Buf... | getContentPane().add(p1);
}
//--------------------------------------------------------------- |
<|file_name|>etheraddress64.hh<|end_file_name|><|fim▁begin|>// -*- related-file-name: "../../lib/etheraddress64.cc" -*-
#ifndef CLICK_ETHERADDRESS64_HH
#define CLICK_ETHERADDRESS64_HH
#include <click/string.hh>
#include <click/glue.hh>
#include <click/type_traits.hh>
#if !CLICK_TOOL
# include <click/nameinfo.hh>
# incl... | return _data[0] + _data[1] + _data[2] + _data[3] == 0x03FC; |
<|file_name|>ffi.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2014 Maciej Piechotka
*
* 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 without restriction, including without limitat... | compression: c_int,
standalone: c_int,
intSubset: *xmlDtd,
extSubset: *xmlDtd, |
<|file_name|>0022_pinpoint_gateway_fee_amount_null.py<|end_file_name|><|fim▁begin|>from django.db import migrations
from corehq.apps.smsbillables.management.commands.bootstrap_gateway_fees import (
bootstrap_pinpoint_gateway,
)
def add_pinpoint_gateway_fee_for_migration(apps, schema_editor):
bootstrap_pinpoi... | ] |
<|file_name|>iter.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/L... |
#[test]
fn test_unfoldr() { |
<|file_name|>util.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/. */
extern crate libc;
use std::io;
macro_rules! try_or {
($va... | };
} |
<|file_name|>App.js<|end_file_name|><|fim▁begin|>import { App } from "./nwGui";
import Process from "./process";
App.removeAllListeners( "open" );
export default App;
export const argv = App.argv;
export const filteredArgv = App.filteredArgv;<|fim▁hole|>export function quit() {
try {
// manually emit the proces... | export const manifest = App.manifest;
|
<|file_name|>OscTools.hpp<|end_file_name|><|fim▁begin|>#ifndef OSCTOOLS_HPP_INCLUDED
#define OSCTOOLS_HPP_INCLUDED
class OscOptionalUnpacker
{
ofxOscMessage & msg;
int n;
public:
OscOptionalUnpacker(ofxOscMessage & m):msg(m),n(0){}
OscOptionalUnpacker & operator >> (int & i)
{
if(n < ms... | {
if(n < msg.getNumArgs()) |
<|file_name|>facebook.js<|end_file_name|><|fim▁begin|>var
util = require('util'),
querystring = require('querystring'),
request = require('request');
function FacebookProvider(client_id, client_secret, redirect_uri) {
this.client_id = client_id;
this.client_secret = client_secret;
this.redirect... | |
<|file_name|>constant.py<|end_file_name|><|fim▁begin|>class constant():
folder_name = 'results'
MAX_HELP_POSITION = 27
CURRENT_VERSION = '0.9.1'
output = None
file_logger = None
# jitsi options
jitsi_masterpass = None
# mozilla options
manually = None
path = None
bruteforce = None
specific... | |
<|file_name|>shorten_path.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
import os
import re
<|fim▁hole|> print >>sys.stderr, "Usage: $0 <path> <length>"
sys.exit(1)
path = re.sub(os.getenv('HOME'), '~', path)
while len(path) > length:
dirs = path.split("/");
# Find the longest direct... | try:
path = sys.argv[1]
length = int(sys.argv[2])
except: |
<|file_name|>Combination.py<|end_file_name|><|fim▁begin|>import bpy
from functions import *
class Combination():
'''A class containing all properties and methods
relative to combination settings for
Curve To Frame addon'''
def update_curves( self, context ):
'''method that must be over ride: update curve wh... | )
|
<|file_name|>DownloadLink.java<|end_file_name|><|fim▁begin|><|fim▁hole|>import com.sdl.selenium.extjs3.ExtJsComponent;
import com.sdl.selenium.web.SearchType;
import com.sdl.selenium.web.WebLocator;
public class DownloadLink extends ExtJsComponent implements Download {
public DownloadLink() {
setCl... | package com.sdl.selenium.extjs3.button;
import com.sdl.selenium.bootstrap.button.Download;
|
<|file_name|>ExecutionGraphException.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
... | *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Intecture Developers.
//
// Licensed under the Mozilla Public License 2.0 <LICENSE or
// https://www.tldrlegal.com/l/mpl-2.0>. This file may not be copied,
// modified, or distributed except according to those terms.
extern crate clap;
extern cra... | impl Service for Api {
type Request = InMessage;
type Response = InMessage; |
<|file_name|>stock_landed_costs.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can ... | 'move_id': move_id, |
<|file_name|>default_keyvalue_differ.js<|end_file_name|><|fim▁begin|>'use strict';var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (ar... | |
<|file_name|>linkbubble_test.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
//
// ... | |
<|file_name|>filter-dropdown-number-range.js<|end_file_name|><|fim▁begin|>import m from 'mithril';
import prop from 'mithril/stream';
import h from '../h';
import _ from 'underscore';
const EnterKey = 13;
const innerFieldInput = {
oninit: function(vnode) {
const inputState = {<|fim▁hole|> setVa... | value: vnode.attrs.inputValue, |
<|file_name|>LangevinThermostat.py<|end_file_name|><|fim▁begin|># Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: ... | class LangevinThermostat(Extension):
__metaclass__ = pmi.Proxy
pmiproxydefs = dict(
cls = 'espressopp.integrator.LangevinThermostatLocal', |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | #lib/ontologies/com/usefulinc/ns |
<|file_name|>CharSource.java<|end_file_name|><|fim▁begin|>// This Source Code is in the Public Domain per: http://unlicense.org
package org.litesoft.commonfoundation.charstreams;
/**
* A CharSource is like a powerful version of a "char" based Iterator.
*/
public interface CharSource {
/**
* Report if there ... | public String getUpToNonVisible7BitAscii();
|
<|file_name|>AceEditorPreview.java<|end_file_name|><|fim▁begin|>/*
* AceEditorPreview.java
*
* Copyright (C) 2009-11 by RStudio, Inc.
*
* This program is licensed to you under the terms of version 3 of the
* GNU Affero General Public License. This program is distributed WITHOUT
* ANY EXPRESS OR IMPLIED WARRANTY,... |
if (currentStyleLink_ != null)
currentStyleLink_.removeFromParent(); |
<|file_name|>sync_normal.hpp<|end_file_name|><|fim▁begin|>#ifndef BOOST_NETWORK_PROTOCOL_HTTP_IMPL_HTTP_SYNC_CONNECTION_20100601
#define BOOST_NETWORK_PROTOCOL_HTTP_IMPL_HTTP_SYNC_CONNECTION_20100601
// Copyright 2013 Google, Inc.
// Copyright 2010 (C) Dean Michael Berris
// Copyright 2010 (C) Sinefunc, Inc.
// Distri... | http_sync_connection<Tag, version_major, version_minor> > {
typedef typename resolver_policy<Tag>::type resolver_base;
typedef typename resolver_base::resolver_type resolver_type; |
<|file_name|>admin.js<|end_file_name|><|fim▁begin|>////functionen hämtar alla artiklar med hjälp av getJSON
//och får tillbaka en array med alla artiklar
//efter den är klar kallar den på functionen ShoArtTab.
//som skriver ut alla artiklar i en tabell.
function getAllAdminProducts()
{
$.getJSON("index2.php/getAllP... | if (r==true)
{
x="JA";
} else { |
<|file_name|>feeds.js<|end_file_name|><|fim▁begin|>define([], () => {
'use strict';
class FeedsError extends Error {
constructor(...args) {
console.error('FeedsError', args);
super(args);
}
}
class ServerError extends Error {
constructor(...args) {
... | mode: 'cors',
method: 'GET'
})
.then((response) => { |
<|file_name|>physical_z_tag_test.py<|end_file_name|><|fim▁begin|># Copyright 2020 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/L... | cirq.testing.assert_equivalent_repr( |
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|>import ddt
from django.contrib.auth import login, authenticate
from importlib import import_module
from django_lti_tool_provider import AbstractApplicationHookManager
from mock import patch, Mock
from oauth2 import Request, Consumer, SignatureMethod_HMAC_SHA1
fr... | expected_user_data = {
'username': self._data['lis_person_sourcedid'],
'email': self._data['lis_person_contact_email_primary'], |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import sys
import traceback
import logging
import time
import inspect
def run_resilient(function, function_args=[], function_kwargs={}, tolerated_errors=(Exception,), log_prefix='Something failed, tolerating error and retrying: ', retries=5, delay=True, critical=Fa... | log that, and if it's critical, properly throw the exception """
|
<|file_name|>premultiplyfx.cpp<|end_file_name|><|fim▁begin|>#include "stdfx.h"
//#include "tfxparam.h"
#include "trop.h"
//===================================================================
class PremultiplyFx : public TStandardRasterFx {
FX_PLUGIN_DECLARATION(PremultiplyFx)
TRasterFxPort m_input;
public:
Prem... | }
} |
<|file_name|>Coordinates.py<|end_file_name|><|fim▁begin|>class Coordinates:
""" WhiteSource model for artifact's coordinates. """
def __init__(self, group_id, artifact_id, version_id):
self.groupId = group_id
self.artifactId = artifact_id
self.versionId = version_id
def create_projec... |
dist_name = distribution.get_name() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.