prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>arte.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import re
import json
import xml.etree.ElementTree
from .common import InfoExtractor
from ..utils import (
ExtractorError,
find_xpath_attr,
unified_strdate,
determine_ext,
get_element_by_id,
compat_str,
)
# There are different... | return info
info_dict['formats'] = [_format(f) for f in formats]
|
<|file_name|>parser.py<|end_file_name|><|fim▁begin|>from parso.python import tree
from parso.python.token import PythonTokenTypes
from parso.parser import BaseParser
NAME = PythonTokenTypes.NAME
INDENT = PythonTokenTypes.INDENT
DEDENT = PythonTokenTypes.DEDENT
class Parser(BaseParser):
"""
This class is use... | # do error recovery here. In all other cases, we want to do
# error recovery.
if len(stack_node.nodes) != 1:
break |
<|file_name|>register.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('eventappApp')
.config(function ($stateProvider) {
$stateProvider
.state('register', {
parent: 'account',
url: '/register',
data: {
roles: [],<|... | pageTitle: 'register.title'
}, |
<|file_name|>entropy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Calculate entropies of each leaf on each branch node of a tree for each column
Usage:
entropy.py -a ali.s9t100.fa -n gpcrdb_gapped_tm_numbering.csv -t ali.s9t100.ph > ali.s9t100.entropies
"""
import argparse
import collections
import lo... | args = parser.parse_args()
calculate_entropies(args.tree, args.alignment, args.numbering, |
<|file_name|>Ledger.java<|end_file_name|><|fim▁begin|>/**
*
*/
package org.commcare.cases.ledger;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import org.javarosa.core.services.storage... | |
<|file_name|>getComponents_test.go<|end_file_name|><|fim▁begin|>package liquidhandling
import (
"github.com/antha-lang/antha/antha/anthalib/wtype"
"github.com/antha-lang/antha/antha/anthalib/wunit"
"testing"
)
type testCase struct {
Name string
Cmps wtype.ComponentVector
Match wtype.Match
Expected w... | Match: wtype.Match{M: []int{0}, Vols: []wunit.Volume{wunit.NewVolume(0.00999, "El")}},
Expected: wtype.ComponentVector{&wtype.Liquid{Vol: 0.00001, Vunit: "El"}},
}, |
<|file_name|>types.go<|end_file_name|><|fim▁begin|>package cmdji
type Compound struct {
KanjiCompound string
KanaCompound string
CompoundMeanings []string
}
type kanjiStruct struct {
Kanji string `json:"kanji"`
Meanings []string `json:"meanings"`
Onyomis ... | Kanji kanjiStruct `json:"kanji"` |
<|file_name|>htmliframeelement.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 document_loader::{LoadType, LoadBlocker};
use d... | |
<|file_name|>version.py<|end_file_name|><|fim▁begin|>from pkg_resources import DistributionNotFound, get_distribution
def get_version():
try:
return get_distribution("naima").version<|fim▁hole|> # package is not installed
return "UNINSTALLED"<|fim▁end|> | except DistributionNotFound: |
<|file_name|>TryNodes.py<|end_file_name|><|fim▁begin|># Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License"... | statements=pre_statements + [self] + post_statements,
source_ref=self.source_ref,
) |
<|file_name|>en_dlg.js<|end_file_name|><|fim▁begin|>tinyMCE.addI18n('en.tinycimmimage_dlg',{
title : 'Image Manager',
upload:'Upload'<|fim▁hole|><|fim▁end|> | }); |
<|file_name|>dynamic_tests.rs<|end_file_name|><|fim▁begin|>use crate::cell::RefCell;
use crate::collections::HashMap;
use crate::thread_local;
#[test]
fn smoke() {
fn square(i: i32) -> i32 {
i * i
}
thread_local!(static FOO: i32 = square(3));
FOO.with(|f| {
assert_eq!(*f, 9);
});
}... | #[test] |
<|file_name|>source.ts<|end_file_name|><|fim▁begin|>export class TwingSource {
private readonly code: string;
private readonly name: string;
private readonly fqn: string;<|fim▁hole|> this.fqn = fqn || name;
}
getCode() {
return this.code;
}
getName() {
return this.na... |
constructor(code: string, name: string, fqn?: string) {
this.code = code;
this.name = name; |
<|file_name|>DiskStatusColumn.java<|end_file_name|><|fim▁begin|>package org.ovirt.engine.ui.common.widget.table.column;
import org.ovirt.engine.core.common.businessentities.Disk;
import com.google.gwt.user.cellview.client.Column;
public class DiskStatusColumn extends Column<Disk, Disk> {<|fim▁hole|> super(new... |
public DiskStatusColumn() { |
<|file_name|>resizecontroller.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding va... | ~ResizeControllerData();
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use crate::resource::IResource;
use com_wrapper::ComWrapper;
use winapi::um::d2d1::{ID2D1Image, ID2D1Resource};
use wio::com::ComPtr;
pub use self::bitmap::{Bitmap, IBitmap};
pub use self::bitmap1::{Bitmap1, IBitmap1};
pub mod bitmap;
pub mod bitmap1;
#[repr(transpar... | } |
<|file_name|>query.js<|end_file_name|><|fim▁begin|>exports.find = function(options) {
options || (options = {});
options.param || (options.param = 'query');
options.parse || (options.parse = JSON.parse);
return function(req, res, next) {
var query = req.query[options.param];
var conditi... | options || (options = {});
options.param || (options.param = 'select');
options.delimiter || (options.delimiter = ','); |
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
... | }; |
<|file_name|>DungeonWallsTilemap.java<|end_file_name|><|fim▁begin|>/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2021 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public L... | |
<|file_name|>const.py<|end_file_name|><|fim▁begin|>"""Constants for AccuWeather integration."""
from __future__ import annotations
from typing import Final
from homeassistant.components.weather import (
ATTR_CONDITION_CLEAR_NIGHT,
ATTR_CONDITION_CLOUDY,
ATTR_CONDITION_EXCEPTIONAL,
ATTR_CONDITION_FOG,
... | |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>from ..parsers.errors import ErrorResponse
from warnings import warn
def raise_for_error(f):
"""
Wrapper method to parse any error response and raise the ErrorResponse instance if an error is encountered.
:param f:
:return:
"""
def inner(*args... | |
<|file_name|>NullPaymentGatewayConfigurationImpl.java<|end_file_name|><|fim▁begin|>/*
* #%L
* SparkCommerce Framework Web
* %%
* Copyright (C) 2009 - 2013 Spark Commerce
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... |
import org.sparkcommerce.common.payment.PaymentGatewayType;
import org.springframework.stereotype.Service;
|
<|file_name|>yt.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2013 Sean Poyser
#
#
# This code is a derivative of the YouTube plugin for XBMC
# released under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 3
# Copyright (C) 2010-2012 Tobias Ussing And Henrik... | #
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
<|file_name|>azure_rm_virtualmachine.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... |
for key in self.module_arg_spec.keys() + ['tags']: |
<|file_name|>yield-while-local-borrowed.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 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... | let a = 3; |
<|file_name|>S15.8.2.17_A6.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.<|fim▁hole|>
/*---
info: >
Math.sqrt, recommended that implementations use the approximation
algorithms for IEEE 754 arithmetic contained in fdlibm
es5id: 15.8.2.17_A6
description: >
Checki... | // This code is governed by the BSD license found in the LICENSE file. |
<|file_name|>docstring.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
sphinx.ext.napoleon.docstring
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Classes for docstring parsing and formatting.
:copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
""... | >>> config = Config(napoleon_use_param=True, napoleon_use_rtype=True) |
<|file_name|>ckeditor_link_tags.py<|end_file_name|><|fim▁begin|>import importlib
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from ckeditor_link import conf
from django import template
from django.template.defaultfilters import stringfilter
try:
mo... | |
<|file_name|>testdelete.py<|end_file_name|><|fim▁begin|>from vt_manager_kvm.models import *
from vt_manager_kvm.communication.utils.XmlUtils import *
import xmlrpclib
am = xmlrpclib.Server('https://expedient:expedient@192.168.254.193:8445/xmlrpc/agent')
xml = xmlFileToString('communication/utils/queryDelete.xml')<|fim... |
am.send(xml) |
<|file_name|>profileapi.rs<|end_file_name|><|fim▁begin|>// Copyright © 2017 winapi-rs developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// All files in ... | |
<|file_name|>0018_auto_20171214_1524.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('portal', '0017_auto_20171214_1138'),
]
operations = [
m... | name='assembly_id', |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | """
self.model = dioptas_model
self.phase_model = self.model.phase_model |
<|file_name|>select_query_builder.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2017 The Lovefield Project 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 th... | return res.map(o => {
let val = {};
for (let key in o) {
if (this.conversion.has(key)) { |
<|file_name|>replications_metrics.go<|end_file_name|><|fim▁begin|>package metrics
import (
"strconv"
"github.com/influxdata/influxdb/v2/kit/platform"
"github.com/prometheus/client_golang/prometheus"
)
type ReplicationsMetrics struct {
TotalPointsQueued *prometheus.CounterVec
TotalBytesQueued *prome... | rm.RemoteWriteBytesSent,
rm.RemoteWriteBytesDropped,
rm.PointsFailedToQueue, |
<|file_name|>missing_record_ids.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from flask import current_app
from flask.cli import with_appcontext
from invenio_db import db
from hepdata.cli import fix
from hepdata.ext.elasticsearch.api import index_record_ids, push_data_keywords
from hepdata.modules.su... | submission,
submission.version) |
<|file_name|>delete.js<|end_file_name|><|fim▁begin|>var accessToken="i7LM4k7JcSKs4ucCpxpgNPcs3i1kRbNKyUE8aPGKZzZWASagz9uZiuLgmgDgBJzY";
$(window).load(function() {
$('#pseudo_submit').click(function() {
NProgress.start();
$.ajax({
type: "POST",
url: "../db-app/signdown.ph... | });
} |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.urls import path, re_path
from . import views
urlpatterns = [
path('noslash', views.empty_view),
path('slash/', views.empty_view),<|fim▁hole|>]<|fim▁end|> | path('needsquoting#/', views.empty_view),
# Accepts paths with two leading slashes.
re_path(r'^(.+)/security/$', views.empty_view), |
<|file_name|>simulations.py<|end_file_name|><|fim▁begin|>"""Run Monte Carlo simulations."""
from joblib import Parallel, delayed
from frbpoppy import Survey, CosmicPopulation, SurveyPopulation, pprint
from datetime import datetime
from copy import deepcopy
from glob import glob
import frbpoppy.paths
import os
import n... | |
<|file_name|>RadiusConstant.java<|end_file_name|><|fim▁begin|>package org.toughradius.handler;<|fim▁hole|> public final static String VENDOR_MIKROTIK = "14988";
public final static String VENDOR_IKUAI = "10055";
public final static String VENDOR_HUAWEI = "2011";
public final static String VENDOR_ZTE = "3... |
public interface RadiusConstant {
public final static String VENDOR_TOUGHSOCKS = "18168"; |
<|file_name|>ProxySubject.java<|end_file_name|><|fim▁begin|>package gof.structure.proxy;
public class ProxySubject extends Subject {
private RealSubject realSubject;
public ProxySubject(){
}
/* (non-Javadoc)
* @see gof.structure.proxy.Subject#request()
*
<|fim▁hole|> * Subject subject = n... | |
<|file_name|>Welcome.js<|end_file_name|><|fim▁begin|>/** @jsx m */
import m from 'mithril';
import { linkTo, hrefTo } from '@storybook/addon-links';
const Main = {
view: vnode => (
<article
style={{
padding: 15,
lineHeight: 1.4,
fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI",... | const NavButton = {
view: vnode => (
<button
type="button" |
<|file_name|>1646815966637-RemoveStarredCharts.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE charts DROP COLUMN starred;`)
}
public async down(queryRunner: QueryRunner): Promise<void> {
await quer... | import { MigrationInterface, QueryRunner } from "typeorm"
export class RemoveStarredCharts1646815966637 implements MigrationInterface {
name = "RemoveStarredCharts1646815966637" |
<|file_name|>test_identity.py<|end_file_name|><|fim▁begin|># Copyright 2017 IBM Corp.
# All Rights Reserved.<|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... | # |
<|file_name|>formatter.rs<|end_file_name|><|fim▁begin|>/**********************************************************\
| |
| hprose |
| |
| Official WebSite: h... | #[inline] |
<|file_name|>Cache.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 the... | *
* http://www.apache.org/licenses/LICENSE-2.0 |
<|file_name|>issue-5521.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/lice... | // except according to those terms.
#[feature(managed_boxes)]; |
<|file_name|>index_tests.rs<|end_file_name|><|fim▁begin|>// This is a part of rust-encoding.
// Copyright (c) 2013-2015, Kang Seonghoon.
// See README.md and LICENSE.txt for details.
//! Macros and utilities for testing indices.
/// Makes a common test suite for single-byte indices.
#[macro_export]
macro_rules! singl... | |
<|file_name|>fs.rs<|end_file_name|><|fim▁begin|>// Copyright 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
// http://www.apache.org/license... | }
|
<|file_name|>configs-normalize_comments-true.rs<|end_file_name|><|fim▁begin|>// rustfmt-normalize_comments: true
// Normalize comments
// Lorem ipsum:
fn dolor() -> usize {}
// sit amet:
fn adipiscing() -> usize {}
<|fim▁hole|>////////////////////////////////////////////////////////////////////////////////
// Basic s... | // #652 |
<|file_name|>安居客.py<|end_file_name|><|fim▁begin|># coding=utf-8
#下面的代码是接口函数,无关
def get(ar,index):
l=len(ar);
if index<0:
return ar[l+index];
else:
return ar[index];
def find(ar,filter):
for r in ar:
if filter(r):
return r;
return None;
def execute(ar,filter,action):
for r in ar:
if filter(r):
a... | |
<|file_name|>bitcoin_ky.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="ky" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About SweetStake</source>
<translation type="unfinish... | <message>
<location line="+19"/> |
<|file_name|>setup.js<|end_file_name|><|fim▁begin|>/*
* This file is subject to the terms and conditions defined in
* file 'LICENSE.txt', which is part of this source code package.
*
* author: emicklei
*/
V8D.receiveCallback = function(msg) {
var obj = JSON.parse(msg);
var context = this;
if (obj.rece... | |
<|file_name|>do-classes-match.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> let classesMatch = true;
let currentClass: string = null;
for (let i = 0; i < expectedClasses.length; i++) {
currentClass = expectedClasses[i];
classesMatch = resultClasses.contains(currentClass);
if (!classesMatch) {
br... | import { ComponentRef, DebugElement } from '@angular/core';
import { ComponentFixture } from '@angular/core/testing';
export function doClassesMatch(resultClasses: DOMTokenList, expectedClasses: string[]): boolean { |
<|file_name|>FrameAui.cpp<|end_file_name|><|fim▁begin|>// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#include <cstddef>
#include <string>
#include <vector>
#include <wx/chartype.h>
#include <wx/defs.h>
#include <wx/dynarray.h>
#include <wx/event.h>
#inclu... | { |
<|file_name|>UnbanChatSenderChat.java<|end_file_name|><|fim▁begin|>package com.pengrad.telegrambot.request;
import com.pengrad.telegrambot.response.BaseResponse;
/**
* Mirco Ianese
* 07 December 2021
*/
public class UnbanChatSenderChat extends BaseRequest<UnbanChatSenderChat, BaseResponse> {
public UnbanChatS... | |
<|file_name|>reminder.rs<|end_file_name|><|fim▁begin|>use typemap_rev::TypeMapKey;
use crate::database::reminders::{Reminder, RemindersRepository};
use crate::util::now;
use serenity::model::id::{ChannelId, GuildId};
use serenity::model::user::User;
use std::time::Duration;
use tracing::error;
<|fim▁hole|>impl TypeMap... | |
<|file_name|>wikitech_family.py<|end_file_name|><|fim▁begin|>"""Family module for Wikitech."""
#
# (C) Pywikibot team, 2005-2020
#
# Distributed under the terms of the MIT license.
#
from pywikibot import family
# The Wikitech family
class Family(family.WikimediaOrgFamily):
"""Family class for Wikitech."""
... | return 'https' |
<|file_name|>package_test.go<|end_file_name|><|fim▁begin|>// Copyright 2016 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package migrationmaster_test<|fim▁hole|> gc "gopkg.in/check.v1"
)
func Test(t *testing.T) {
gc.TestingT(t)
}<|fim▁end|> |
import (
"testing"
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
//
// Portions Copyright 2017 The Chromium OS Authors. All rights reserved.<|fim▁hole|>// Use of this source code is governed by a BSD-style license that can... | |
<|file_name|>mod.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/. */
//! Servo heavily uses display lists, which are retained-mode lis... | ClippingRegion {
main: MAX_RECT,
complex: Vec::new(), |
<|file_name|>dropbox_account.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding: utf8
"""
Dropbox Authentication for web2py
Developed by Massimo Di Pierro (2011)
Same License as Web2py License
"""
# mind here session is dropbox session, not current.session
import os
import re
import urllib
from ... | last_name = display_name[-1],
registration_id = data.get('uid',None)) |
<|file_name|>tax-meta-clss.js<|end_file_name|><|fim▁begin|>/**
* All Tax meta class
*
* JS used for the custom fields and other form items.
*
* Copyright 2012 Ohad Raz (admin@bainternet.info)
* @since 1.0
*/
var $ =jQuery.noConflict();
function update_repeater_fields(){
/**
* Datepicker Field.
*
... | }); |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod macaddr;
pub use self::macaddr::*;
packet!(EthernetPacket, MutEthernetPacket, 14);
getters!(EthernetPacket
pub fn destination(&self) -> MacAddr {
MacAddr::from_slice(&self.0[0..6])
}
pub fn source(&self) -> MacAddr {
MacAddr::from_slice... | |
<|file_name|>journal.go<|end_file_name|><|fim▁begin|>// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free... | // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. |
<|file_name|>DataCryptMock.ts<|end_file_name|><|fim▁begin|>import { User } from "./Api";
import { IDataCrypt } from "./DataCrypt";
import assert from "assert";
const prefix = "encrypted:";
// Mocking DataCrypt with simple encryption since jest testing does not support crypt functions yet
export class DataCryptMock im... |
public async unwrapDataEncryptionKey( |
<|file_name|>ErrorFunction.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2010-2016 Structr GmbH
*
* This file is part of Structr <http://structr.org>.
*
* Structr 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 Soft... |
return null;
}
|
<|file_name|>ParallelForDemo.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2011 Matt Crinklaw-Vogt
*
* 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 wit... | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
<|file_name|>MinMaxCapabilityRefinement.js<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2020 The FOAM Authors. All Rights Reserved.
* http://www.apache.org/licenses/LICENSE-2.0
*/
foam.CLASS({
package: 'foam.nanos.crunch.lite',
name: 'MinMaxCapabilityRefinement',
refines: 'foam.nanos.crunch.MinMax... | |
<|file_name|>raspi_camera.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# python code for interfacing to VC0706 cameras and grabbing a photo
# pretty basic stuff
# written by ladyada. MIT license
# revisions for Raspberrry Pi by Gordon Rush
import serial
BAUD = 38400
# this is the port on the Raspberry Pi; it wi... | FBUF_CURRENTFRAME = 0x00
FBUF_NEXTFRAME = 0x01
FBUF_STOPCURRENTFRAME = 0x00 |
<|file_name|>bitcoin_de.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="de" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Wekoin</source>
... | <translation>Zeitraum:</translation>
</message>
<message>
<location line="+8"/> |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import os
import mimetypes
from django.conf import settings as django_settings
from django.db import models
from django.template.defaultfilters import slugify
from django.core.files.images import get_image_dimensions
from django.utils.translation import ugettext_lazy... | mime_type.short_description = _('mime type')
def type_slug(self): |
<|file_name|>link.js<|end_file_name|><|fim▁begin|>'use strict';
exports = module.exports = function(service) {
return {
message: function(user) {
return '<p>' + 'Welcome to ' + service + ' ' + user.fullname + '!' + '</p>' +
'<p>' + 'You have now linked your Google+ account to this service' + '</p>';
},
t... | }; |
<|file_name|>writer.go<|end_file_name|><|fim▁begin|>package main
import (
"bytes"
"fmt"
"strings"
"time"
)
type Writer interface {
Meta(string, time.Time)
Block(string)
Break(string)
List(string)
Section(string)
Text(string)
TextBold(string)
TextUnderline(string)
Flag(string, string, string)
Done() str... | tr.writeln(`.B "%s"`, text)
}
}
|
<|file_name|>root.go<|end_file_name|><|fim▁begin|>package cmd
import (
"os"
"github.com/Azure/acs-engine/pkg/armhelpers"
"github.com/Azure/go-autorest/autorest/azure"
log "github.com/Sirupsen/logrus"
"github.com/satori/go.uuid"
"github.com/spf13/cobra"
flag "github.com/spf13/pflag"
)
const (
rootName ... | language string |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::fs::File;
extern crate rustc_serialize;
extern crate docopt;
use docopt::Docopt;
mod vm;
static USAGE: &'static str = "
Usage: norn_rust <file>
norn_rust (--help | --version)
Options:
-h, --help Show this message.
-v, --version Show... | vm::ir::programs::Program::parse_textual_bytecode(file)
.map_err(|err| err.to_string())
})
.and_then(|program| Ok(vm::execute(&program))) |
<|file_name|>benchmarks.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 The Tink-Rust Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/L... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
import hashlib
import json
import os
import re
import magic
from perpetualfailure.db import session
from pyramid.authentication import (
Authenticated,
Everyone,
)
from pyramid.httpexceptions import (
HTTPException,
HTTPBadReq... | |
<|file_name|>navbar.js<|end_file_name|><|fim▁begin|>$(function () {
var setupNavbar = function () {
$('a').each(function(){
if ($(this).prop('href') == window.location.href) {
$(this).parents('li').addClass('active');
}
});
var login = $('ul.nav a[href="login"]').... | } |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}<|fim▁hole|><|fim▁end|> | __export(require('./lib/create-render'));
__export(require('./lib/universal-cache'));
//# sourceMappingURL=index.js.map |
<|file_name|>qwt_spline.cpp<|end_file_name|><|fim▁begin|>/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under ... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import webapp2
from google.appengine.ext import db
import logging
import charbuilder
import traits
import traceback
import random
import string
instance_key = "".join(
(random.choice(string.ascii_uppercase + string.digits) for i in xrange(25)))
def getFile(_file)... | complete_html += "<td> %s </td>" % (y) # puts the entire line as column with the td tag
column += 1 # go to the next column
complete_html += "</table>" # close the table |
<|file_name|>dvr_local_router.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 Openstack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.... | device.route.delete_gateway(str(fip_2_rtr.ip),
table=dvr_fip_ns.FIP_RT_TBL)
self.fip_ns.local_subnets.release(self.router_id)
self.rtr_fip_subnet = None |
<|file_name|>fake_fischer.go<|end_file_name|><|fim▁begin|>/*
Copyright 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... |
_, err := c.Fake.Invokes(action, &v1alpha1.FischerList{}) |
<|file_name|>nevergrad_example.py<|end_file_name|><|fim▁begin|>"""This test checks that Nevergrad is functional.
It also checks that it is usable with a separate scheduler.
"""
import ray
from ray.tune import run<|fim▁hole|>
def easy_objective(config, reporter):
import time
time.sleep(0.2)
for i in range(... | from ray.tune.schedulers import AsyncHyperBandScheduler
from ray.tune.suggest.nevergrad import NevergradSearch |
<|file_name|>utils.go<|end_file_name|><|fim▁begin|>package node
import (
"bytes"
"golang.org/x/net/html"
)
// Attr returns attribute of node by given key if any.
func Attr(n *html.Node, key string) (string, bool) {
for _, a := range n.Attr {
if a.Key == key {
return a.Val, true
}
}
return "", false
}
//... | func Children(n *html.Node, filter func(*html.Node) bool) []*html.Node {
nodes := make([]*html.Node, 0)
|
<|file_name|>keygenerator.js<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2015 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://ww... |
/** |
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.te... | undef: true,
unused: true,
boss: true, |
<|file_name|>unwind-unique.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/l... | task::spawn(f);
} |
<|file_name|>iostream.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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/... | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
<|file_name|>Alphas.py<|end_file_name|><|fim▁begin|># ==========================================
# Author: Richard Wang
# Contact: rwthree@princeton.edu
#
# Performs simple parsing of an "Alpha" file
# Contents are simply (Server #, Alpha)
# Ex:
# 1, 3
# 2, 0
# 3, 1
# ==========================================
import... | # return newAlphas |
<|file_name|>UsersSubview.tsx<|end_file_name|><|fim▁begin|>// UsersSubview --------------------------------------------------------------
// Render a list of Users for the current Facility, with a callback to
// handleSelect(user) when a particular User is selected, or
// handleSelect(null) if a previously selected Us... | if ((currentFacility.id >= 0) && loginContext.loggedIn) {
try {
const newUsers: User[] = |
<|file_name|>cross_validation_test.py<|end_file_name|><|fim▁begin|>'''
Created on 10 August 2014
@author: vincent
'''
# Loading necessary packages
import numpy as np
import sys
from seizures.data.DataLoader_v2 import DataLoader
from seizures.evaluation.XValidation import XValidation
from seizures.evaluation.performa... | |
<|file_name|>utils.ts<|end_file_name|><|fim▁begin|>import { HookContext, Application, createContext, getServiceOptions } from '@feathersjs/feathers';
import { NotFound, MethodNotAllowed, BadRequest } from '@feathersjs/errors';
import { createDebug } from '@feathersjs/commons';
import isEqual from 'lodash/isEqual';
impo... | const handleError = (error: any) => { |
<|file_name|>hash.js<|end_file_name|><|fim▁begin|>import stringify from 'json-stable-stringify'<|fim▁hole|> return createHash('sha256').update(data).digest('hex')
}<|fim▁end|> | import { createHash } from 'crypto'
export default function hash (val) {
const data = Buffer.isBuffer(val) ? val : stringify(val) |
<|file_name|>miembros.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* @ngdoc function
* @name yeoprojectApp.controller:MiembrosCtrl
* @description
* # MiembrosCtrl
* Controller of the yeoprojectApp
*/
angular.module('yeoprojectApp')
.controller('MiembrosCtrl', function ($scope,$http,$modal) {
$http.get(... | templateUrl: 'views/add-miembros.html',
controller:'AddNuevoMiembroCtrl',
resolve:{ |
<|file_name|>ogr2ogrclipextent.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
ogr2ogrclipextent.py
---------------------
Date : November 2012
Copyright : (C) 2012 by Victor Olaya
Emai... |
output = self.getOutputFromName(self.OUTPUT_LAYER) |
<|file_name|>google_api.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Read the Google Weather API and emit data in the usual format.
Write a sample every 5 minutes on stdout, log on stderr.
"""
import sys
import time
from urllib import quote_plus
from urllib2 import urlopen
from datetime import datetime, t... | location = sys.argv[1] |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># django-salesforce
#
# by Phil Christensen
# (c) 2012-2013 Freelancers Union (http://www.freelancersunion.org)
# See LICENSE.md for details<|fim▁hole|>This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Repla... | #
""" |
<|file_name|>GfxLGradient.hh<|end_file_name|><|fim▁begin|>#pragma once
/* This file is part of Imagine.
Imagine 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
(at your o... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/*
* Copyright 2017 Sreejith Krishnan R
*
* 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
... | * limitations under the License.
*/
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.