prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>PRESUBMIT.py<|end_file_name|><|fim▁begin|># Copyright 2017 the V8 project authors. All rights reserved.<|fim▁hole|># found in the LICENSE file.
def CheckChangeOnCommit(input_api, output_api):
tests = input_api.canned_checks.GetUnitTestsInDirectory(
input_api, output_api, '.', files_to_check=['test... | # Use of this source code is governed by a BSD-style license that can be |
<|file_name|>fn-coerce-field.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... | }
|
<|file_name|>RangeFilter.js<|end_file_name|><|fim▁begin|>define(function()
{
"use strict";
function RangeFilter(columnKey, isMinEnabled, minValue, isMaxEnabled, maxValue)
{
InputValidator.validateNotNull("columnKey", columnKey);
InputValidator.validateNotNull("isMinEnabled", isMinEnabled);
... | minValue: minValue, |
<|file_name|>stack.py<|end_file_name|><|fim▁begin|>import copy
import mufsim.utils as util
import mufsim.gamedb as db
import mufsim.stackitems as si
from mufsim.errors import MufRuntimeError
from mufsim.insts.base import Instruction, instr
class InstPushItem(Instruction):
value = 0
def __init__(self, line, v... | @instr("lreverse")
class InstLReverse(Instruction):
def execute(self, fr): |
<|file_name|>fix_tb_basedon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Finds revisions from the Thunderbird migration that don't have based_on
set correctly, and are still relavent, and fixes that.
Run this script like `./manage.py runscript fix_tb_basedon`.
"""
import sys
from... | from django.db.models import Q
|
<|file_name|>wrap-actions.js<|end_file_name|><|fim▁begin|>import getCompletions from "./get-completions"
<|fim▁hole|>export const addAutosuggestionCompleters = (ori, system) => (context) => {
return ori(context).concat([{
getCompletions(...args) {
// Add `context`, then `system` as the last args
retur... | // Add an autosuggest completer |
<|file_name|>main.loading.js<|end_file_name|><|fim▁begin|>function paddAppendClear() {
jQuery('.append-clear').append('<div class="clear"></div>');
}
function paddWrapInner1() {
jQuery('.wrap-inner-1').wrapInner('<div class="inner"></div>');
}
function paddWrapInner3() {
jQuery('.wrap-inner-3').wrapInner('<div cla... | });
}
|
<|file_name|>dev.go<|end_file_name|><|fim▁begin|>package build
import (
"bytes"
"context"
"errors"
"io"
"strings"
"time"
"github.com/bblfsh/sdk/v3/driver"
"github.com/bblfsh/sdk/v3/internal/docker"
"github.com/bblfsh/sdk/v3/protocol"
"google.golang.org/grpc"
protocol1 "gopkg.in/bblfsh/sdk.v1/protocol"
)
c... | func (d *ServerInstance) installFromDocker(ctx context.Context, lang, id string) error {
if !strings.Contains(id, ":") { |
<|file_name|>Reducer.js<|end_file_name|><|fim▁begin|>import InputValidator from "../../common/js/InputValidator.js";
import ObjectUtilities from "../../common/js/ObjectUtilities.js";
import Action from "./Action.js";
import DefaultFilters from "./DefaultFilters.js";
import InitialState from "./InitialState.js";
var Re... | |
<|file_name|>minimizebutton.cpp<|end_file_name|><|fim▁begin|>//
// This source file is part of appleseed.
// Visit http://appleseedhq.net/ for additional information and resources.
//
// This software is released under the MIT license.
//
// Copyright (c) 2014-2015 Marius Avram, The appleseedhq Organization
//
// Permi... | m_dock_widget->toggleViewAction()->activate(QAction::Trigger);
} |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! A Rust library for allocation-limited computation of the Discrete Cosine Transform.
//!
//! 1D DCTs are allocation-free but 2D requires allocation.
//!
//! Features:
//!
//! * `simd`: use SIMD types to speed computation (2D DCT only)
//! * `cos-approx`: use a Taylor ... | test_cos_approx(x);
test_cos_approx(-x);
} |
<|file_name|>MemoryOffsetBackingStore.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... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
scraping
the utility functions for the actual web scraping
"""
import ssl
import datetime
import requests
import re
# this is the endpoint that my new version of this program will
# abuse with possible store ids. this is a much more reliable "darts at the wall... |
def camel_to_underscore(in_string):
""" |
<|file_name|>exactlyone.go<|end_file_name|><|fim▁begin|><|fim▁hole|>// 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... | // Copyright 2019 Istio Authors
// |
<|file_name|>lib.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/. */
#![feature(globs, macro_rules, phase, thread_local, link_args)]
... | #[cfg(target_os="macos")]
extern crate cgl;
#[cfg(target_os="macos")]
extern crate cocoa; |
<|file_name|>text.py<|end_file_name|><|fim▁begin|>#
# Copyright 2010 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-paint
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
Utilities for extracting text from generated classes.... | except NameError:
pass |
<|file_name|>configuration.go<|end_file_name|><|fim▁begin|>package astilog<|fim▁hole|>
import "flag"
// Flags
var (
AppName = flag.String("logger-app-name", "", "the logger's app name")
Filename = flag.String("logger-filename", "", "the logger's filename")
Verbose = flag.Bool("logger-verbose", false, "if true, th... | |
<|file_name|>module.js<|end_file_name|><|fim▁begin|>"use strict";
var Extension = require("../runtime/extension");
/**
* @constructor Trait
* @memberof module:impulse
*
* @summary Traits allow classes to be extended without modification, and support isTypeOf() when used as parameters.
**/
function Trait(parent,... | import { symbol } from "core-js/es6/symbol";
import * from core-js.fn.object.assign; |
<|file_name|>test_dfs.py<|end_file_name|><|fim▁begin|>"""Tests for the DFS module"""
import unittest
from dfs import dfsTraverse
class test_dfsTraverse(unittest.TestCase):
"""Test the correct order in traversing a graph"""
def setUp(self):
"""Create a graph and a tuple with the correct traverse"""
... | |
<|file_name|>dictionaries.go<|end_file_name|><|fim▁begin|>package hashcat3<|fim▁hole|> Name string
Path string
}
type Dictionaries []Dictionary
func (d Dictionaries) Len() int {
return len(d)
}
func (d Dictionaries) Swap(i, j int) {
d[i], d[j] = d[j], d[i]
}
func (d Dictionaries) Less(i, j int) bool {
return d[... |
type Dictionary struct { |
<|file_name|>Direct.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1<|fim▁hole|><|fim▁end|> | oid sha256:be847f24aac166b803f1ff5ccc7e4d7bc3fb5d960543e35f779068a754294c94
size 1312 |
<|file_name|>D1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Problem: Endless Knight
# Language: Python
# Author: KirarinSnow
# Usage: python thisfile.py <input.in >output.out
# Comments: OK for large, but may time out on small.
from itertools import *
MOD = 10007
# Precompute factorial table mod MOD
fact ... | break
if inc:
points = [[0,0]] + [rocks[j] for j in perm] + [[h,w]] |
<|file_name|>SystemConfiguration.js<|end_file_name|><|fim▁begin|>/*global Ext, i18n*/
//<debug>
console.log(new Date().toLocaleTimeString() + ": Log: Load: WPAKD.view.desktop.icons.SystemConfiguration");
//</debug>
Ext.define("WPAKD.view.desktop.icons.SystemConfiguration", {
extend: "Ext.Container",
alias: "wid... | , width: 40
}, {
xtype: "container",
style: {"text-align": "center", color: "#FFFFFF"}, |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export * from './item-repository';
export * from './user-repository';<|fim▁end|> | |
<|file_name|>testlistfmt_ka_GE.js<|end_file_name|><|fim▁begin|>/*
* testlistfmt_ka_GE.js - test the list formatter object
*
* Copyright © 2020, JEDLSoft
*
* 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 o... | |
<|file_name|>mainPlugin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
/***************************************************************************
GeepsSpStats
A QGIS plugin
Spatial Statistics by PySAL
-------------------
begin ... | self.__unload() |
<|file_name|>default.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
#########################################################################
## This is a sample controller
## - index is the default action of any application
## - ... |
@auth.requires_login()
def event_data():
""" |
<|file_name|>wrong_transmute.rs<|end_file_name|><|fim▁begin|>use super::WRONG_TRANSMUTE;
use clippy_utils::diagnostics::span_lint;
use rustc_hir::Expr;
use rustc_lint::LateContext;
use rustc_middle::ty::{self, Ty};
/// Checks for `wrong_transmute` lint.
/// Returns `true` if it's triggered, otherwise returns `false`.<... | pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>, from_ty: Ty<'tcx>, to_ty: Ty<'tcx>) -> bool {
match (&from_ty.kind(), &to_ty.kind()) { |
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import functools
class memoize(object):
def __init__ (self, func):
self.func = func
def __call__ (self, *args, **kwargs):
if (args, str(kwargs)) in self.__dict__:
value = self.__dict__[args, str(kwargs)]
else:
... | return value
def __set__(self, obj, value):
if obj is None: |
<|file_name|>chart_b.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from common.db_sum import _metric_meta_db
'''get the data from table by name'''
def get_data_by_name(name, status=[1], other=0):
result = []
where = ''
if status:
status = ",".join([str(x) for x in status])
where... | tmp['_symbolIndex'] = key - 1
tmp_series.append(tmp) |
<|file_name|>app.module.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import { HomePage } from '../pages/home/home';
import { ResultPage } from '../pages/result/result';
import { ChuckNorrisJokesService } from '../services/chuck-noris-jokes-service';
const cloudSettings: CloudSettings = {
'core': {
'app_id': '1282... | import { NgModule } from '@angular/core';
import { IonicApp, IonicModule } from 'ionic-angular';
import { CloudSettings, CloudModule } from '@ionic/cloud-angular';
import { MyApp } from './app.component'; |
<|file_name|>18_summon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python-i
# draws SUMMON logo
#
import math
import summon
from summon.core import *<|fim▁hole|>from summon import shapes, colors
def interleave(a, b):
c = []
for i in xrange(0, len(a), 2):
c.extend(a[i:i+2] + b[i:i+2])
return c
... | |
<|file_name|>booted.go<|end_file_name|><|fim▁begin|>// -*- Mode: Go; indent-tabs-mode: t -*-
/*
* Copyright (C) 2014-2015 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foun... | // UpdateBootRevisions synchronizes the active kernel and OS snap versions
// with the versions that actually booted. This is needed because a
// system may install "os=v2" but that fails to boot. The bootloader
// fallback logic will revert to "os=v1" but on the filesystem snappy |
<|file_name|>bitcoin_hu.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="hu" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About CandyCoin</source>
... | <location line="-1"/>
<source>Specify data directory</source>
<translation>Adatkönyvtár |
<|file_name|>codegen_common.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
##########################################################################
#
# MTraceCheck
# Copyright 2017 The Regents of the University of Michigan
# Doowon Lee and Valeria Bertacco
#
# Licensed under the Apache License, Version 2.0 (the "... | cppString += "#include <pthread.h>\n"
cppString += "#include <map>\n"
cppString += "#include <vector>\n" |
<|file_name|>sell.py<|end_file_name|><|fim▁begin|>"""
일반매도
"""
import base64
import simplejson as json
import hashlib
import hmac
import httplib2
import time
ACCESS_KEY = ''
SECRET_KEY = ''
currency = 'btc-krw'
def get_encoded_payload(payload):
dumped_json = json.dumps(payload)
encoded_json = base64.b64encode(dum... | |
<|file_name|>StoreAppleReceiptParser.hpp<|end_file_name|><|fim▁begin|>//
// StoreAppleReceiptParser.hpp
// Pods
//
// Created by eps on 7/3/20.
//<|fim▁hole|>
#include <string>
#include "ee/store/StoreFwd.hpp"
namespace ee {
namespace store {
class AppleReceiptParser {
public:
AppleReceiptParser();
std::s... |
#ifndef EE_X_STORE_APPLE_RECEIPT_PARSER_HPP
#define EE_X_STORE_APPLE_RECEIPT_PARSER_HPP |
<|file_name|>misc7.C<|end_file_name|><|fim▁begin|><|fim▁hole|>
int main()
{
int i = 0;
// Make sure build_unary_op correctly computes this.
int *pi = &(++i);
*pi = 4;
if (i != 4)
{ printf ("FAIL\n"); return 1; }
else
printf ("PASS\n");
}<|fim▁end|> | // { dg-do run }
// GROUPS passed miscellaneous
extern "C" int printf (const char *, ...); |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! API for tracing applications and libraries.
//!
//! The `trace` module includes types for tracking the progression of a single
//! request while it is handled by services that make up an application. A trace
//! is a tree of [`Span`]s which are objects that represent... | //! } |
<|file_name|>train.py<|end_file_name|><|fim▁begin|>import argparse
import copy
import numpy as np
import chainer
from chainer.datasets import ConcatenatedDataset
from chainer.datasets import TransformDataset
from chainer.optimizer_hooks import WeightDecay
from chainer import serializers
from chainer import training
fr... | self.coder = copy.copy(coder)
self.coder.to_cpu()
|
<|file_name|>test_inlinequeryresultgame.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or ... | reply_markup=TestInlineQueryResultGame.reply_markup)
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// ams - Advanced Memory Scanner
// Copyright (C) 2018 th0rex
//
// 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|>analyze_test_sources.go<|end_file_name|><|fim▁begin|>/* Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
* Licensed under the Apache License, Version 2.0 (see LICENSE).
*
* Parts adapted from Go SDK and Bazel rules_go, both under BSD-compatible licenses.
*/
package main
import (
"enc... | "go/doc" |
<|file_name|>trace.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/. */
//! Utilities for tracing JS-managed values.
//!
//! The lifeti... | use euclid::rect::Rect;
use euclid::size::Size2D;
use html5ever::tree_builder::QuirksMode; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>extern crate sodiumoxide;
extern crate serialize;
extern crate sync;
extern crate extra;
use std::io::{Listener, Acceptor};
use std::io::{MemReader, BufReader};
use std::io::net::ip::{SocketAddr};
use std::io::net::tcp::{TcpListener, TcpStream};
use std::from_str::{from... | println!("New connection from '{:s}'", client.peer_name().unwrap().to_str()); |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># coding: utf-8
import sys
from setuptools import setup, find_packages
NAME = "pollster"
VERSION = "2.0.2"
# To install the library, run the following
#
# python setup.py install
#<|fim▁hole|>REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"... | # prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
|
<|file_name|>DashboardController.js<|end_file_name|><|fim▁begin|>app.controller('DashboardController',function($scope,$http,Article){
//Pagination configuration
$scope.maxSize = 5;
$scope.numPerPage = 5;
$scope.currentPage = '1';
$scope.isEdit = false;
$scope.isError= false;
$scope.newar... | $scope.isError=false;
|
<|file_name|>sys.rs<|end_file_name|><|fim▁begin|>/// This module is copied from `libstd/sys/common/stack.rs`.
#[allow(dead_code)]
pub mod stack {
pub const RED_ZONE: usize = 20 * 1024;
#[inline(always)]
pub unsafe fn record_rust_managed_stack_bounds(stack_lo: usize, stack_hi: usize) {
// When the... | #[cfg(any(target_arch = "aarch64",
target_arch = "powerpc",
all(target_arch = "arm", target_os = "ios"),
target_os = "bitrig", |
<|file_name|>20141102214329_settings_invoice_number.js<|end_file_name|><|fim▁begin|>'use strict';
exports.up = function(knex, Promise) {
return knex.schema.table('settings', function(table) {
table.integer('next_invoice_number');<|fim▁hole|> return knex.schema.table('settings', function(t) {
t.dropColumn('n... | });
};
exports.down = function(knex, Promise) { |
<|file_name|>syntax-extension-source-utils.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013-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
... | // ignore-pretty - the pretty tests lose path information, breaking include! |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate pcap;
use pcap::{Active, Activated, Offline, Capture};
use std::path::Path;
#[test]
fn read_packet_with_full_data() {
let mut capture = capture_from_test_file("packet_snaplen_65535.pcap");
assert_eq!(capture.next().unwrap().len(), 98);
}
#[test]
f... | loop{}
}
|
<|file_name|>histogram.py<|end_file_name|><|fim▁begin|>import datetime
from pystogram.tree import PrefixTree
SECOND = 1
MINUTE = SECOND * 60
HOUR = MINUTE * 60
DAY = HOUR * 24
MONTH = DAY * 30
YEAR = DAY * 365
# The multiplier applied when testing timestamp interval to guess a resolution.
# A value of 2.0 m... | return MONTH |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^books/$', views.BookListView.as_view(), name='books'),
url(r'^books/(?P<pk>\d+)$', views.BookDetailView.as_view(), name='book-detail'),
u... | ] |
<|file_name|>test_survey_integration.py<|end_file_name|><|fim▁begin|># coding=utf-8
from datetime import datetime
from euphorie.client import model
from euphorie.client.tests.utils import addAccount
from euphorie.client.tests.utils import addSurvey
from euphorie.content.tests.utils import BASIC_SURVEY
from euphorie.tes... | class TestSurveyViews(EuphorieIntegrationTestCase): |
<|file_name|>sysmon.py<|end_file_name|><|fim▁begin|># Gnome15 - Suite of tools for the Logitech G series keyboards and headsets
# Copyright (C) 2010 Brett Smith <tanktarta@blueyonder.co.uk>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Licens... | now = time.time()
|
<|file_name|>testChemotaxis.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import JeevesLib
class TestAuction(unittest.TestCase):
def setUp(self):
JeevesLib.init()
def test_something(self):
r = RSphaeroides()
pass<|fim▁end|> | import JeevesLib
from smt.Z3 import *
import unittest
from RSphaeroides import RSphaeroides |
<|file_name|>ItemGourmetChicken.java<|end_file_name|><|fim▁begin|>package gerhard2202.culinaromancy.item;
<|fim▁hole|>import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import java.util.Random;
public class ItemGourmetChicken extends ItemCulinaromancyFood
{
public ItemGourmetChicken() {
... | import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.item.ItemStack; |
<|file_name|>movie.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# inbuild - Exception - python exception - parent clas
# InvalidAgeException - Child class
class InvalidAgeException(Exception):
def __init__(self,age):
self.age = age
def validate_age(age):
if age > 18:<|fim▁hole|> return "welcome to the movie... | |
<|file_name|>read_write_lock.py<|end_file_name|><|fim▁begin|>from kazoo.exceptions import NoNodeError
from sys import maxsize
from .mutex import Mutex
from .internals import LockDriver
from .utils import lazyproperty
READ_LOCK_NAME = "__READ__"
WRITE_LOCK_NAME = "__WRIT__"
class _LockDriver(LockDriver):
def sort... | |
<|file_name|>path.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2010 Mikhail Gusarov
#
# 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 th... | return |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Support for Subaru sensors."""
import subarulink.const as sc
from homeassistant.components.sensor import DEVICE_CLASSES
from homeassistant.const import (
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_VOLTAGE,
LENGTH_KILOMETERS,
L... | ): |
<|file_name|>LicenceValidationResult.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2016 the original author or authors.
*
* This file is part of jGrades Application Project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may obtain a copy of the License at
* http://www.... | import lombok.AllArgsConstructor;
import lombok.Getter; |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from functools import wraps
import logging
import time
try:
from collections import OrderedDict
except ImportError:
try:
# ordereddict available on pypi for Python < 2.7
from ordereddict import OrderedDict
except ImportError:
# Othe... | |
<|file_name|>qos_specs.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 ... |
def destroy(self, force=False):
"""Deletes the QoS spec.
|
<|file_name|>util.py<|end_file_name|><|fim▁begin|>import re
import hashlib
FNAME_MATCH = re.compile(r'/([^/]+)$') # From the last slash to the end of the string
PREFIX = re.compile(r'([^:]+://)(/)?(.+)') # Check for a prefix like data://
def getParentAndBase(path):
match = PREFIX.match(path)<|fim▁hole|> ... | if match is None:
if path.endswith('/'):
stripped_path = path[:-1]
else: |
<|file_name|>DataFilter.java<|end_file_name|><|fim▁begin|>package com.instaclick.filter;
/**
* Defines a behavior that should be implement by all filter
*
* @author Fabio B. Silva <fabio.bat.silva@gmail.com>
*/
public interface DataFilter
{
/**
* Adds the given {@link Data} if it does not exists
*
... | |
<|file_name|>search-control-properties.js<|end_file_name|><|fim▁begin|>'use strict';
module.exports = {
skip: {
type: 'integer',
format: 'int32',
minimum: 0,
maximum: 500,
default: 0,
description: 'The number of results to skip before returning matches. Use this to support paging. Maximum of ... | maximum: 200, |
<|file_name|>CellError.hpp<|end_file_name|><|fim▁begin|>// CellError.hpp
//
// Copyright (C) 2006-2007 Peter Graves <peter@armedbear.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|>transport_test.go<|end_file_name|><|fim▁begin|>// Copyright Project Harbor 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/LIC... | // limitations under the License.
package notary
|
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig
<|fim▁hole|><|fim▁end|> | class LibraryConfig(AppConfig):
name = 'library' |
<|file_name|>calibration.py<|end_file_name|><|fim▁begin|>import numpy as np
from scipy import sparse
from scipy.interpolate import interp1d
class calibration(object):
'''
some useful tools for manual calibration
'''
def normalize_zdata(self,z_data,cal_z_data):
return z_data/cal_z_data
def normalize_amplitude... | '''
for this to work, you need to analyze a large part of the baseline
tune lam and p until you get the desired result |
<|file_name|>containers.component.ts<|end_file_name|><|fim▁begin|>import {ChangeDetectorRef, Component, OnInit} from '@angular/core';
import {DockerService} from "../../services/docker.service";
import 'rxjs/Rx';
import {toast} from "angular2-materialize";
import {Transform, Writable} from "stream";
declare let $: any... | return false; |
<|file_name|>unittest_pool.py<|end_file_name|><|fim▁begin|>#-------------------------------------------------------------------------
# The Azure Batch Apps Python Client
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any per... | |
<|file_name|>CustomFieldServiceInterfaceupdateCustomFieldOptions.java<|end_file_name|><|fim▁begin|>// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http:... | */ |
<|file_name|>compiler.py<|end_file_name|><|fim▁begin|>from .execute import GraphNode
from . import preprocess
def compile(layout_dict):
preprocess.proprocess(layout_dict)<|fim▁hole|> out = [GraphNode.from_layout(root_node, layout_dict, graph_dict) for root_node in root_nodes]
return out<|fim▁end|> | # get nodes without any outputs
root_nodes = layout_dict["nodes"].keys() - {l[0] for l in layout_dict["links"]}
graph_dict = {} |
<|file_name|>map.ts<|end_file_name|><|fim▁begin|>module core {<|fim▁hole|>
export interface IMap<T> {
[pKey: string]: T;
}
export class Map<T> implements IMap<T> {
[pKey: string]: T;
}
}<|fim▁end|> | |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>//@flow
var x = 42;<|fim▁hole|> y = "hello world";
}
(42: string); // should still have some errors!<|fim▁end|> | x = "true";
var y = 42;
if (x) { |
<|file_name|>date-formatter.min.js<|end_file_name|><|fim▁begin|>/**
* angular-strap
* @version v2.1.6 - 2015-01-11
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)<|fim▁hole|> * @license MIT License, http://www.opensource.org/licenses/MIT
*/
"use strict";angular.modul... | |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for react-particles-js v3.0.0
// Project: https://github.com/wufe/react-particles-js
// Definitions by: Simone Bembi <https://github.com/wufe>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
<|fim▁hole|>
export type IParticlesPa... | /// <reference types="react" />
import { ComponentClass } from "react";
import { Container } from "tsparticles/Core/Container";
import { ISourceOptions } from "tsparticles"; |
<|file_name|>legend.py<|end_file_name|><|fim▁begin|>"""
Defines a legend for displaying components.
:copyright: 2015 Agile Geoscience
:license: Apache 2.0
"""
# from builtins import object
from io import StringIO
import csv
import warnings
import random
import re
import itertools
try:
from functools import partia... | """
Jupyter Notebook magic repr function as a row – used by
``Legend._repr_html_()``. |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># Generated by Django 3.1 on 2020-08-25 12:15
import django.db.models.deletion
from django.db import migrations, models
import s3upload.fields
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migra... | "id",
models.AutoField( |
<|file_name|>folder.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
(c) 2014 - Copyright Red Hat Inc
Authors:
Pierre-Yves Chibon <pingou@pingoured.fr>
"""
from anitya.lib.backends import (
BaseBackend, get_versions_by_regex_for_text, REGEX)
from anitya.lib.exceptions import AnityaPluginExceptio... | @classmethod
def get_versions(cls, project):
''' Method called to retrieve all the versions (that can be found)
of the projects provided, project that relies on the backend of |
<|file_name|>test_rich_string03.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
T... | ###############################################################################
# |
<|file_name|>listener.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... | update_allowed=True, |
<|file_name|>cookie_http_state.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use hyper::header::{Header, SetCookie};
use net::co... |
#[test]
fn test_path0006() {
let r = run("http://home.example.org:8888/cookie-parser?path0006", |
<|file_name|>HttpTypes.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>
export const enum HttpMethod {
Get = 'get',
Post = 'post',
Delete = 'delete',
Patch = 'patch',
Put = 'put'
}
export type ProgressFunction = (loaded: number, total: number) => void;
export type LoadedProgressFunction = (loaded: number) => voi... | import { FutureResult } from '@ephox/katamari';
import { ResponseBodyDataTypes, RequestBody, ResponseBody } from './HttpData';
import { HttpError } from './HttpError'; |
<|file_name|>import_panel_example.py<|end_file_name|><|fim▁begin|># This file is part of the pyqualtrics package.
# For copyright and licensing information about this package, see the
# NOTICE.txt and LICENSE.txt files in its top-level directory; they are
# available at https://github.com/Baguage/pyqualtrics
#
# Licens... | |
<|file_name|>sass.js<|end_file_name|><|fim▁begin|>define("ace/snippets/sass",["require","exports","module"], function(require, exports, module) {
"use strict";
<|fim▁hole|>
});
(function() {
window.require(["ace/snippets/sass"], function(m) {
if (typeof module... | exports.snippetText = "";
exports.scope = "sass"; |
<|file_name|>struct_create_packets_1_1__2.js<|end_file_name|><|fim▁begin|>var struct_create_packets_1_1__2 =
[<|fim▁hole|> [ "angle", "struct_create_packets_1_1__2.html#a425d33bd27790066ff7edb4a608a8149", null ],
[ "buttons", "struct_create_packets_1_1__2.html#a6b7d2d6c0a3a063f873420c010063b33", null ],
[ "d... | |
<|file_name|>test_dellscapi.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 Dell 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/licens... | # Test case where ScVolume has no mappings
res = self.scapi._find_mappings(self.VOLUME)
mock_get.assert_called() |
<|file_name|>theme.js<|end_file_name|><|fim▁begin|>$(function () {
$(window).scroll(function() {
if ($(".navbar").offset().top>30) {
$(".navbar-fixed-top").addClass("sticky");
}
else {
$(".navbar-fixed-top").removeClass("sticky");
}
});
// Flex
if... | $bigPics.hide().eq(0).show();
|
<|file_name|>AllTests.py<|end_file_name|><|fim▁begin|># **********************************************************************
#
# Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.<|fim▁hole... | #
# **********************************************************************
import sys, Ice, Test |
<|file_name|>preferences.entry.ts<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2021 the Octant contributors. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import { BehaviorSubject, Subscription } from 'rxjs';
import { PreferencesService } from './preferences.service';
import { Preferences } from ... | |
<|file_name|>Result.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2016 Vaadin Ltd.
*
* 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.... | /**
* Applies the {@code consumer} if result is not an error.
*
* @param consumer |
<|file_name|>paginated-scroll-box.js<|end_file_name|><|fim▁begin|><|fim▁hole|>import Ember from 'ember';
import PaginatedScrollViewMixin from 'kowa/mixins/paginated-scroll-view';
var PaginatedScrollBox = Ember.View.extend(PaginatedScrollViewMixin);
export default PaginatedScrollBox;<|fim▁end|> | |
<|file_name|>AutoDark.tsx<|end_file_name|><|fim▁begin|>import { Box } from '@fower/react';
import { useState } from 'react';
import { Button } from './Button';
export default () => {
const [mode, setMode] = useState('Light');
function toggleMode() {
if (mode === 'Dark') {
setMode('Light');
document... | |
<|file_name|>publish_to_beta.py<|end_file_name|><|fim▁begin|>"""Uploads apk to rollout track with user fraction."""
import sys
import socket
from apiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials
import subprocess
import xml.etree.ElementTree as ET
import os
from pathl... | credentials = ServiceAccountCredentials.from_json_keyfile_name(
CREDENTIALS_JSON, scopes=['https://www.googleapis.com/auth/androidpublisher']
) |
<|file_name|>TablePage.java<|end_file_name|><|fim▁begin|>package org.openjava.upay.web.domain;
import java.util.List;
public class TablePage<T>
{
private long start;
private int length;
private long recordsTotal;
private long recordsFiltered;
private List<T> data;
public TablePage()
{
... | |
<|file_name|>strings.js<|end_file_name|><|fim▁begin|>define(
({
_widgetLabel: "속성 테이블",
ok: "확인",
cancel: "취소",
unsupportQueryWarning: "속성 테이블 위젯에 표시하려면 레이어가 쿼리 작업을 지원해야 합니다. 서비스에 쿼리 기능이 켜져 있는지 확인하세요.",
exportMessage: "데이터를 CSV 파일로 내보내시겠습니까?",<|fim▁hole|> exportFiles: "CSV로 내보내기",
exportS... | |
<|file_name|>lockfile-compat.rs<|end_file_name|><|fim▁begin|>extern crate cargotest;
extern crate hamcrest;
use cargotest::support::git;
use cargotest::support::registry::Package;
use cargotest::support::{execs, project, lines_match};
use hamcrest::assert_that;
#[test]
fn oldest_lockfile_still_works() {
let cargo... | .file("src/lib.rs", "")
.file("Cargo.lock", r#" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.