prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>Setup-lang-ru-debug.js<|end_file_name|><|fim▁begin|>/********************** tine translations of Setup**********************/
Locale.Gettext.prototype._msgs['./LC_MESSAGES/Setup'] = new Locale.Gettext.PO(({
""
: "Project-Id-Version: Tine 2.0\nPOT-Creation-Date: 2008-05-17 22:12+0100\nPO-Revision-Date: 201... | |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from django.test import TestCase
from finance.models import Banking_Account
class IBANTestCase(TestCase):<|fim▁hole|> def test_iban_converter(self):
"""BBAN to IBAN conversion"""
self.assertEqual(Banking_Account.convertBBANToIBAN("091-0002777-90"), ... | def setUp(self):
pass
|
<|file_name|>jsonSchema.js<|end_file_name|><|fim▁begin|>define(['../Property', '../Model', 'dojo/_base/declare', 'json-schema/lib/validate'],
function (Property, Model, declare, jsonSchemaValidator) {
// module:
// dstore/extensions/JsonSchema
// summary:
// This module generates a dstore schema from a JSON Sch... | return declare(Model, { |
<|file_name|>drop-trait-generic.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.
//<|fim▁hole|>// option. This file may not be copied, modified, or distributed
// except acco... | // 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 |
<|file_name|>Heartbreaker.js<|end_file_name|><|fim▁begin|>import SPELLS from 'common/SPELLS';
import RESOURCE_TYPES from 'game/RESOURCE_TYPES';
import Analyzer, { SELECTED_PLAYER } from 'parser/core/Analyzer';
import Events from 'parser/core/Events';
import STATISTIC_ORDER from 'parser/ui/STATISTIC_ORDER';
import Talen... | |
<|file_name|>radio_box.py<|end_file_name|><|fim▁begin|># Created On: 2010-06-02
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# ht... | for button, label in zip(self._buttons, self._labels):
button.setText(label) |
<|file_name|>memory.go<|end_file_name|><|fim▁begin|>package collector
import (
"github.com/lowstz/mongodb_exporter/shared"
)
//Mem
type MemStats struct {
Bits float64 `bson:"bits"`
Resident float64 `bson:"resident"`<|fim▁hole|> Virtual float64 `bson:"virtual"`
Mapped flo... | |
<|file_name|>0023_userdetail_contributor_uid.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 = [
('changeset', '0022_auto_20160222_2358'),
]
operations = ... | field=models.IntegerField(db_index=True, null=True, blank=True),
), |
<|file_name|>audio-whitenoise.rs<|end_file_name|><|fim▁begin|>extern crate sdl2;
extern crate rand;
use sdl2::audio::{AudioCallback, AudioSpecDesired};
use std::time::Duration;
struct MyCallback {
volume: f32
}
impl AudioCallback for MyCallback {
type Channel = f32;
fn callback(&mut self, out: &mut [f32]... | // Lock guard is dropped here |
<|file_name|>mock-raf-tests.ts<|end_file_name|><|fim▁begin|>import * as createMockRaf from 'mock-raf';
const mockRaf = createMockRaf();
const id = mockRaf.raf(() => {<|fim▁hole|>});
mockRaf.step({ count: 10 });
mockRaf.cancel(id);
console.log(mockRaf.now());<|fim▁end|> | console.log('RAF!!!'); |
<|file_name|>test_short_code.py<|end_file_name|><|fim▁begin|># coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request<|fim▁hole|>from twilio.http.response import Response
class Shor... | from twilio.base.exceptions import TwilioException |
<|file_name|>recursion.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/licen... | |
<|file_name|>protoc_java.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Generate java source files from protobuf files.
This is a helper file ... | help="Path to output directory for java files.") |
<|file_name|>amiibro.py<|end_file_name|><|fim▁begin|>class Amiibro:
def __init__(self):
self._amiibos={#'hex': {'name': 'Noname', 'method': methodObject, 'params': params}<|fim▁hole|> }
def handleTag(self, hex=None):
if hex in self._amiibos:
print(self._amiibos[h... | |
<|file_name|>signals.py<|end_file_name|><|fim▁begin|>"""
This module contains signals related to enterprise.
"""
import logging
import six
from django.conf import settings
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.db.models.signals import post_save, p... | client.enterprise.coupons.create_refunded_voucher.post({"order": order_number}) |
<|file_name|>ProbeScience.mock.js<|end_file_name|><|fim▁begin|>import {
PROBES_SCIENCE_QUERY,
PROBES_SCIENCE_SUB,
PROBES_SCIENCE_CONTACT_SUB,
} from "components/views/ProbeScience";
import systems from "../data/systems";
import sensors from "../data/sensors";
import sensorContacts from "../data/sensorContacts";
i... | variables: {simulatorId: "test"},
},
result: {
data: { |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod xdg;
<|fim▁hole|><|fim▁end|> | pub use self::xdg::Xdg; |
<|file_name|>firefox_run.py<|end_file_name|><|fim▁begin|>import os
from outlawg import Outlawg
from fftool import (
DIR_CONFIGS,
local
)
from ini_handler import IniHandler
Log = Outlawg()
env = IniHandler()
env.load_os_config(DIR_CONFIGS)
def launch_firefox(profile_path, channel, logging, nspr_log_modules=''... | local(cmd, logging) |
<|file_name|>ItemTest.js<|end_file_name|><|fim▁begin|>module('Item');
test('.setOptions()', function() {
var item = new Item({
name: 'Name',
category: 'Category',
icon: 'Icon',
value: 'Value',
flavor: 'Flavor',
rarity: 'Rare',
});
item.code = 'Code';
equal(item.getName(),'Name');<|fim... | equal(item.getCategory(),'Category');
equal(item.getIcon(),'Icon');
equal(item.getValue(),'Value');
equal(item.getFlavor(),'Flavor'); |
<|file_name|>ihex_writer.rs<|end_file_name|><|fim▁begin|>//
// Copyright 2016 The c8s Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the MIT license <LICENSE-MIT or http://opensource.org/licenses/MIT>.
// All files in the project carrying such notice may not ... | }
|
<|file_name|>polarization.py<|end_file_name|><|fim▁begin|># Licensed under GPL version 3 - see LICENSE.rst
import numpy as np
import astropy.units as u
from .utils import norm_vector, e2h
__all__ = ['polarization_vectors', 'Q_reflection', 'paralleltransport_matrix',
'parallel_transport']
def polarizatio... | # right hand coordinate system is v_1, v_2, r (photon direction)
v_2 = np.cross(r, v_1) |
<|file_name|>highlight.js<|end_file_name|><|fim▁begin|>/**
* Wraps the
*
* @param text
* {string} haystack to search through
* @param search
* {string} needle to search for
* @param [caseSensitive]
* {boolean} optional boolean to use case-sensitive searching
*/
angular.module('ui.hi... | |
<|file_name|>ag_data_access.py<|end_file_name|><|fim▁begin|>from __future__ import division
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The American Gut Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in ... | KIT_PASSWD = '1234567890'
KIT_VERCODE = KIT_PASSWD
KIT_PASSWD_NOZEROS = KIT_PASSWD[0:-1] |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#[allow(dead_code)]
use std::rc::Rc;
use std::cell::RefCell;
use std::fmt;
use std::ops::{Drop, Deref, DerefMut};
use std::convert::{AsRef, AsMut};
use std::cmp::{Ord, PartialOrd, PartialEq, Eq, Ordering};
use std::hash::{Hash, Hasher};
use std::borrow::Borrow;
use std::... | fn clone(&self) -> Self {
let pool_ref = self.pool.clone();
let mut cloned_value = pool_ref.borrow_mut().remove_or_create(); |
<|file_name|>OrganizationNavigationMeta.tsx<|end_file_name|><|fim▁begin|>/*
* SonarQube
* Copyright (C) 2009-2019 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as publish... | |
<|file_name|>router_spec.ts<|end_file_name|><|fim▁begin|>import {
AsyncTestCompleter,
describe,
proxy,
it,
iit,
ddescribe,
expect,
inject,
beforeEach,
beforeEachBindings
} from 'angular2/test_lib';
import {SpyRouterOutlet} from './spies';
import {Type} from 'angular2/src/core/facade/lang';
import {P... | expect(location.urlChanges).toEqual([]); |
<|file_name|>application.js<|end_file_name|><|fim▁begin|>// This is a manifest file that'll be compiled into application.js, which will include all the files<|fim▁hole|>//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, ... | // listed below. |
<|file_name|>AbsorbersPlugin.d.ts<|end_file_name|><|fim▁begin|>import type { IPlugin } from "../../Core/Interfaces/IPlugin";
import type { Container } from "../../Core/Container";
import { Absorbers } from "./Absorbers";
import { RecursivePartial } from "../../Types/RecursivePartial";
import type { IAbsorberOptions } f... | readonly id: string; |
<|file_name|>tf_train_exponential_decay.py<|end_file_name|><|fim▁begin|>"""自适应学习率衰减
tf.train.exponential_decay(learning_rate, global_step, decay_steps, decay_rate, staircase=False, name=None)
退化学习率,衰减学习率,将指数衰减应用于学习速率。
计算公式:decayed_learning_rate = learning_rate *
decay_rate ^ (global_step / deca... | import tensorflow as tf |
<|file_name|>matrix_inverse_op_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 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:... | size=np.prod(shape)).reshape(shape).astype(dtype)
self._verifyInverseReal(matrix)
@test_util.deprecated_graph_mode_only |
<|file_name|>fd_unix.go<|end_file_name|><|fim▁begin|>// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris
package net
import (
"io"
"os"
"r... | if err != nil { |
<|file_name|>chunking.rs<|end_file_name|><|fim▁begin|>use serde::Deserialize;
use std::{
fmt,
fs::File,
io::{
BufReader,
BufWriter,
Read,
Write,
},
ops::Range,
path::{
Path,
PathBuf,
},
};
use anyhow::{
Context,
Result,
};
use serde:... | serde_json::to_writer(&mut writer, &item)?;
writeln!(&mut writer)?;
} |
<|file_name|>containerRegistry.test.ts<|end_file_name|><|fim▁begin|>// ------------------------------------------------------------------------------
// Copyright (c) 2017-present, RobotlegsJS. All Rights Reserved.
//
// NOTICE: You are permitted to use, modify, and distribute this file
// in accordance with the ter... | |
<|file_name|>config.orchestrator.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export {
ListToolbarConfigOrchestrator
} from '@skyux/list-builder/modules/list-toolbar/state/config/config.orchestrator'; |
<|file_name|>scalarfloat.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import print_function, absolute_import, division, unicode_literals
import sys
from .compat import no_limit_int # NOQA
if False: # MYPY
from typing import Text, Any, Dict, List # NOQA
__all__ = ["ScalarFloat", "Exponentia... | # type: (Any, Any, Any) -> Any
width = kw.pop('width', None) # type: ignore
prec = kw.pop('prec', None) # type: ignore
m_sign = kw.pop('m_sign', None) # type: ignore |
<|file_name|>UtilTest.java<|end_file_name|><|fim▁begin|>package de.riedquat.java.io;
import de.riedquat.java.util.Arrays;
import org.junit.Test;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import static de.riedquat.java.io.Util.copy;
import static de.riedqua... | }
|
<|file_name|>MasterFaultDetection.java<|end_file_name|><|fim▁begin|>/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apa... | |
<|file_name|>GnssLogTime.cpp<|end_file_name|><|fim▁begin|>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: GnssLogTime.cpp
* Author: markov
*/
#include <boos... | GnssLogTime::GnssLogTime(unsigned short week, unsigned int milliseconds) {
|
<|file_name|>googleAnalyticsAdapter_spec.js<|end_file_name|><|fim▁begin|>import ga from 'modules/googleAnalyticsAdapter.js';
var assert = require('assert');
describe('Ga', function () {<|fim▁hole|> return cpm <= 1 ? '<= 1$' : '> 1$';
}
var config = { options: { trackerName: 'foo', enableDistribution: tru... | describe('enableAnalytics', function () {
var cpmDistribution = function(cpm) { |
<|file_name|>window.rs<|end_file_name|><|fim▁begin|>use error::Result;
use glium_sdl2::{DisplayBuild, SDL2Facade};
use glium::{Frame, Surface};
use platform;
use sdl2;
use sdl2::Sdl;
use sdl2::video::GLProfile;
const WINDOW_TITLE: &'static str = "Rusty Doom v0.0.7";
const OPENGL_DEPTH_SIZE: u8 = 24;
pub struct Wind... | |
<|file_name|>blog.py<|end_file_name|><|fim▁begin|>import os
import datetime
import logging
ORDER = 999
POSTS_PATH = 'posts/'
POSTS = []
from django.template import Context
from django.template.loader import get_template
from django.template.loader_tags import BlockNode, ExtendsNode
def getNode(template, context=Cont... | |
<|file_name|>html.min.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1
oid sha256:54bbb07ae1a9f895764c118915dd17af16bf383083de7e4f867c71d1da32c925<|fim▁hole|><|fim▁end|> | size 972 |
<|file_name|>redir_assignment_parser.py<|end_file_name|><|fim▁begin|>from vint.ast.traversing import traverse, register_traverser_extension
from vint.ast.parsing import Parser
from vint.ast.node_type import NodeType
REDIR_CONTENT = 'VINT:redir_content'
class RedirAssignmentParser(object):
""" A class to make r... | def enter_handler(node):
node_type = NodeType(node['type'])
if node_type is not NodeType.EXCMD:
return |
<|file_name|>public_api.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# SPDX-FileCopyrightText: 2013-2021 Agora Voting SL <contact@nvotes.com>
#
# SPDX-License-Identifier: AGPL-3.0-only
#
import pickle
import base64
import json
import re
from datetime import datetime
from flask import Blueprint, request, ... | |
<|file_name|>TileIdsWithMatches.java<|end_file_name|><|fim▁begin|>package org.janelia.alignment.match;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* List of {@link CanvasMatches} with associated tileIds mapped for fast lookup.
*
* @author Eric Trautman
*/... | final Set<String> stackTileIds) { |
<|file_name|>plot_morph_surface_stc.py<|end_file_name|><|fim▁begin|>"""
.. _ex-morph-surface:
=============================
Morph surface source estimate
=============================
This example demonstrates how to morph an individual subject's
:class:`mne.SourceEstimate` to a common reference space. We achieve thi... | # The morph will be applied to the source estimate data, by giving it as the
# first argument to the morph we computed above. |
<|file_name|>gitRepository.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# This file should be compatible with both Python 2 and 3.
# If it is not, please file a bug report.
"""
This is a Class which allows one to manipulate a git repository.
"""
#external imports
import os
import tempfile
#internal imports
i... | message = message.encode('ascii', 'ignore').decode('ascii') |
<|file_name|>AbstractField.java<|end_file_name|><|fim▁begin|>package net.thevpc.upa.impl;
import net.thevpc.upa.*;
import net.thevpc.upa.impl.transform.IdentityDataTypeTransform;
import net.thevpc.upa.impl.util.NamingStrategy;
import net.thevpc.upa.impl.util.NamingStrategyHelper;
import net.thevpc.upa.impl.util.Platfo... | public void close() throws UPAException { |
<|file_name|>bebee.py<|end_file_name|><|fim▁begin|># !/usr/bin/python
# -*- coding: cp1252 -*-
#
##################################################################################
#
# Copyright 2016-2017 Félix Brezo and Yaiza Rubio (i3visio, contacto@i3visio.com)
#
# This program is part of OSRFramework. You can ... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from fms import constants as FC
from django.utils import timezone
from django.core.files import File
from django.core.exceptions import ObjectDoesNotExist
class DocumentCategory(models.Model):
name = models.CharField(max_length=30, null... | return self.address +" : "+ self.name
def save(self, *args, **kwargs): |
<|file_name|>make_tuple.hpp<|end_file_name|><|fim▁begin|>/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.o... | return tuple<BOOST_PP_ENUM(N, BOOST_FUSION_AS_FUSION_ELEMENT, _)>(
BOOST_PP_ENUM_PARAMS(N, arg));
|
<|file_name|>4.9.py<|end_file_name|><|fim▁begin|># usr/bin/sh
# -*- coding:utf8 -*-
# @function listDeal
# @parma {list} list
def listDeal(list):<|fim▁hole|> listString = ''
for i in range(0,len(list)):
print(i)
if i!=(len(list)-1):
listString += list[i]+',';
else:
... | |
<|file_name|>convert_to_tfrecords.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2018 The Google AI Language Team 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
#
# ... | |
<|file_name|>tabTitle.d.ts<|end_file_name|><|fim▁begin|>/// <reference types="react" />
import * as React from "react";
import { ITab2Props, TabId } from "./tab2";
export interface ITabTitleProps extends ITab2Props {
/** Handler invoked when this tab is clicked. */
onClick: (id: TabId, event: React.MouseEvent<H... | parentId: TabId;
/** Whether the tab is currently selected. */
selected: boolean; |
<|file_name|>abbreviationAction.test.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license informati... | |
<|file_name|>types.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
twython.streaming.types
~~~~~~~~~~~~~~~~~~~~~~~
This module contains classes and methods for :class:`TwythonStreamer` to use.
"""
class TwythonStreamerTypes(object):
"""Class for different stream endpoints
Not all streaming endp... | def site(self, **params):
"""Stream site
Accepted params found at: |
<|file_name|>config.example.js<|end_file_name|><|fim▁begin|>'use strict';
exports.port = process.env.PORT || 3000;
exports.mongodb = {
uri: process.env.MONGOLAB_URI || process.env.MONGOHQ_URL || 'localhost/lulucrawler'
};
exports.getThisUrl = '';
exports.companyName = '';
exports.projectName = 'luluCrawler';
exports... | address: process.env.SMTP_FROM_ADDRESS || 'your@email.addy'
}, |
<|file_name|>test_transforms.py<|end_file_name|><|fim▁begin|>import os
import os.path as op
import pytest
import numpy as np
from numpy.testing import (assert_array_equal, assert_equal, assert_allclose,
assert_array_less, assert_almost_equal)
import itertools
import mne
from mne.datasets im... | # np.pi is an approx since pi is irrational |
<|file_name|>setext_header.rs<|end_file_name|><|fim▁begin|>use regex::Regex;
use parser::Block;
use parser::Block::Header;<|fim▁hole|> let HORIZONTAL_RULE_1 = Regex::new(r"^===+$").unwrap();
let HORIZONTAL_RULE_2 = Regex::new(r"^---+$").unwrap();
if lines.len() > 1 {
if HORIZONTAL_RULE_1.is_match(li... | use parser::span::parse_spans;
pub fn parse_setext_header(lines: &[&str]) -> Option<(Block, usize)> { |
<|file_name|>MainActivity.java<|end_file_name|><|fim▁begin|>package com.nidzo.filetransfer;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.Menu;
import android.view.MenuItem;
im... | |
<|file_name|>Console.java<|end_file_name|><|fim▁begin|>package com.evanbyrne.vending_machine_kata.ui;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.SortedMap;
import org.jooq.lambda.tuple.Tuple2;
import com.evanbyrne.vending_machine_kata.... | return paid; |
<|file_name|>unsafe_removed_from_name.rs<|end_file_name|><|fim▁begin|>use clippy_utils::diagnostics::span_lint;
use rustc_ast::ast::{Item, ItemKind, UseTree, UseTreeKind};
use rustc_lint::{EarlyContext, EarlyLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use rust... | /// ### What it does
/// Checks for imports that remove "unsafe" from an item's
/// name.
/// |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from .current_flow_closeness import *
from .current_flow_betweenness import *
from .current_flow_betweenness_subset import *
from .degree_alg import *
from .dispersion import *
from .eigenvector import *
from .harmonic import *
from .katz import *
from .... | from .betweenness import *
from .betweenness_subset import *
from .closeness import *
from .subgraph_alg import * |
<|file_name|>ignores.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import unittest
import os
import tempfile
# internal modules:
from yotta.lib.fsutils import mkDirP... | # can't run tests that hit github without an authn token
return os.name == 'nt'
|
<|file_name|>bitcoin_eu_ES.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="eu_ES" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About POPCoin</sourc... | <location line="+3"/>
<source>Add &Recipient</source>
<translation type="unfinished"/>
</message> |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::io;
fn main() {
let mut input = String::new();
io::stdin().read_line(&mut input).expect("Failed to read line");
let result = input.trim().parse::<u32>();
if result.is_ok()
{<|fim▁hole|> let mut candidate = num - 1;
let mut pr... | let num = result.unwrap(); |
<|file_name|>viewport_rule.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 https://mozilla.org/MPL/2.0/. */
//! The [`@viewport`][at] at-rule and [`meta`][meta] e... | let max = match $max {
Some(max) => cmp::min(max, $initial),
None => $initial,
}; |
<|file_name|>datasources.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 24 12:49:36 2017
@author: drsmith
"""
import os
from .globals import FdpError<|fim▁hole|> 'diiid': ['diiid', 'diii-d', 'd3d'],
'cmod': ['cmod', 'c-mod']}
for ... |
def canonicalMachineName(machine=''):
aliases = {'nstxu': ['nstx', 'nstxu', 'nstx-u'], |
<|file_name|>test_notification_sched.py<|end_file_name|><|fim▁begin|>from twisted.internet.defer import inlineCallbacks, fail, succeed
from globaleaks import models
from globaleaks.orm import transact
from globaleaks.tests import helpers
from globaleaks.jobs.delivery_sched import DeliverySchedule
from globaleaks.job... | |
<|file_name|>cache.py<|end_file_name|><|fim▁begin|># Copyright (C) 2014 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import os
import json
import platform
from collections import defaultdict<|fim▁hole|>cachepath = {
'linux': os.path.join('~', '.local', '... |
from anaconda_go.lib import go
from anaconda_go.lib.plugin import typing
|
<|file_name|>keyword-for-as-identifier.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// 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. This file may not be copied... | // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
// |
<|file_name|>ScanAnimaitonStrategy.java<|end_file_name|><|fim▁begin|>package com.bruce.android.knowledge.custom_view.scanAnimation;
/**
* @author zhenghao.qi
* @version 1.0
* @time 2015年11月09日14:45:32
*/
public class ScanAnimaitonStrategy implements IAnimationStrategy {
/**
* 起始X坐标
*/
private int... | |
<|file_name|>breakctr2.rs<|end_file_name|><|fim▁begin|>use std::env;
use std::slice;
use std::io::prelude::*;
use common::{err, challenge};
use common::cipher::one_byte_xor as obx;
use set3::breakctr;
pub static info: challenge::Info = challenge::Info {
no: 20,
title: "Break fixed-nonce CTR stat... | match it.next() { |
<|file_name|>KEY.js<|end_file_name|><|fim▁begin|>// Generated by CoffeeScript 1.7.1
(function() {
var M, TRM, TYPES, alert, badge, debug, echo, help, info, log, njs_fs, options, rainbow, rpr, urge, warn, whisper,
__slice = [].slice;
njs_fs = require('fs');
TYPES = require('coffeenode-types');
TRM = requi... |
this.new_secondary_facet = function(realm, type, idn, name, value, distance) { |
<|file_name|>MapData.java<|end_file_name|><|fim▁begin|>//: net/mindview/util/MapData.java
// A Map filled with data using a generator object.
package com.example.doun.chapter21concurrency.ReaderWriterMapPack;
//package net.mindview.util;
import java.util.*;
public class MapData<K, V> extends LinkedHashMap<K, V> {
... | |
<|file_name|>List.tests.ts<|end_file_name|><|fim▁begin|>import 'mocha';
import * as assert from 'assert';
import List from '../src/List';
suite("List", function () {
suite("Should add items and access them using index", function () {
test("First entry", function () {
// Arrange
cons... | |
<|file_name|>PybindDataCollector.cc<|end_file_name|><|fim▁begin|>#include "pybind11/pybind11.h"
#include "eudaq/DataCollector.hh"
namespace py = pybind11;
class PyDataCollector;
namespace{
auto dummy = eudaq::Factory<eudaq::DataCollector>::
Register<PyDataCollector, const std::string&, const std::string&>
... | |
<|file_name|>SetDontInlineMethodTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU Ge... | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
<|file_name|>0014_auto_20160904_2350.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-04 23:50
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('courses', '0013_auto_20160903_02... | |
<|file_name|>Config_acapon_Efficiency.C<|end_file_name|><|fim▁begin|>Bool_t SetGeneratedSmearingHistos = kFALSE;
Bool_t GetCentralityFromAlien = kFALSE;
std::string centralityFilename = "";
std::string centralityFilenameFromAlien = "/alice/cern.ch/user/a/acapon/.root";
const Int_t triggerNames = AliVEvent::kINT7;
c... | |
<|file_name|>UIxTaskEditor.js<|end_file_name|><|fim▁begin|>/* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
var contactSelectorAction = 'calendars-contacts';
function uixEarlierDate(date1, date2) {
// can this be done in a sane way?
if (date1 && date2) {
if (date1.getYear() < date2.... | };
this._getShadowDate = function(which) { |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! # Getting started
//!
//! ```rust,no_run
//! extern crate sdl2;
//!
//! use sdl2::pixels::Color;
//! use sdl2::event::Event;
//! use sdl2::keyboard::Keycode;
//! use std::time::Duration;
//!
//! pub fn main() {
//! let sdl_context = sdl2::init().unwrap();
//! ... | #[cfg(feature = "mixer")]
pub mod mixer; |
<|file_name|>badwebserver_jsonly.py<|end_file_name|><|fim▁begin|>import socket, sys, time, argparse
parser = argparse.ArgumentParser(description="This bad server accepts an HTTP connection and replies with a valid HTML document which links to assets. However, attemps to load the assets should result in a net::ERR_EMPT... | if js_requests > args.tries:
js_requests = 0
print "^ FINAL JS REQUEST - WILL REPLY ^"
clientsocket.send(js_response_text) |
<|file_name|>positionList.py<|end_file_name|><|fim▁begin|>###############################################################################
# This file is part of openWNS (open Wireless Network Simulator)
# _____________________________________________________________________________
#
# Copyright (C) 2004-2007
# Chair o... | |
<|file_name|>RowSelector.ts<|end_file_name|><|fim▁begin|>import {Component, Input, Output, EventEmitter, OnInit, DoCheck} from "@angular/core";
@Component({
selector: "mfRowSelector",
template: `
<input type="checkbox" id="{{checkboxId}}" [checked]="isChecked" (change)="onChange($event)" />
<la... | public ngOnInit() {
this.getIsChecked(); |
<|file_name|>oapMemoryApiTests.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2016 - 2021 Marcin Matula
*
* This file is part of Oap.
*
* Oap 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 vers... | |
<|file_name|>ImageDialog.java<|end_file_name|><|fim▁begin|>package net.sf.memoranda.ui.htmleditor;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Image;... | public JTextField urlField = new JTextField();
JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 10));
JButton okB = new JButton(); |
<|file_name|>run_test.py<|end_file_name|><|fim▁begin|>import numdifftools<|fim▁hole|><|fim▁end|> |
numdifftools.test() |
<|file_name|>issue-13703.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/lic... |
pub struct Foo<'a, 'b: 'a> { foo: &'a &'b isize }
pub fn foo<'a, 'b>(x: Foo<'a, 'b>, _o: Option<& & ()>) { let _y = x.foo; }
fn main() {} |
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
// Visual Recognition
import { VisualRecognitionService } from './visual-recognition.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
expor... | |
<|file_name|>otp_test.go<|end_file_name|><|fim▁begin|>package otp
import (
"crypto/sha512"
"encoding/base64"
"net/http"
"net/http/httptest"
"testing"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
)
type testUser struct {
PID string
OTPs string
}
func (t *testUser) GetPI... | if !beforeCalled {
t.Error("before should have been called") |
<|file_name|>lookupCodingSystem.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|>/**
* @summary Retrieve a Coding System object.
* @param {String} source Abbreviation of the source coding system under test.
* @param {Function} callback Function called on process completion, with standard (err, result) ... | const _ = require('lodash');
const serviceUtils = require('../serviceUtils');
|
<|file_name|>util.py<|end_file_name|><|fim▁begin|>import os, platform
sysstr = platform.system()
if sysstr == "Windows":
LF = '\r\n'
elif sysstr == "Linux":
LF = '\n'
def StripStr(str):
# @Function: Remove space(' ') and indent('\t') at the begin and end of the string
oldStr = ''
newStr = str
... | os.remove(logfile) |
<|file_name|>AccessibilityControllerAtk.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2008, 2009, 2010 Apple Inc. All Rights Reserved.
* Copyright (C) 2009 Jan Michael Alonzo
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following condi... | {
if (!ATK_IS_OBJECT(parent)) |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod field_names_decoder;
use self::field_names_decoder::FieldNamesDecoder;
use csv::{self, ByteString, Decoded, Error, NextField, RecordTerminator, Result};
use rustc_serialize::Decodable;
use std::fs::File;
use std::io::{Cursor, Read};
use std::marker::PhantomData;
us... | p: self.csv,
reorder_columns: self.reorder_columns,
ignore_unused_columns: self.ignore_unused_columns, |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
#
# tBB 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 option) any later version.
#
# tB... | # You should have received a copy of the GNU General Public License |
<|file_name|>block_metadata_config_tests.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
config::{
block_metadata::{build_block_metadata, is_new_block, Entry},
global::Config as GlobalConfig,
},
errors::*,
t... | let global = parse_and_build_global_config(r"
//! account: alice |
<|file_name|>qsr_rcc8.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import print_function, division
from qsrlib_qsrs.qsr_rcc_abstractclass import QSR_RCC_Abstractclass
class QSR_RCC8(QSR_RCC_Abstractclass):
"""Symmetrical RCC5 relations.
Values of the abstract properties
* *... | :rtype: str
"""
return qsr |
<|file_name|>_default.js<|end_file_name|><|fim▁begin|>function fixPosition() {
console.log($(window).scrollTop());
// if its anywhee but at the very top of the screen, fix it
if ($(window).scrollTop() >= headerHeight) { // magic number offset that just feels right to prevent the 'bounce'
// if (headPosition.... | |
<|file_name|>canvas-test.js<|end_file_name|><|fim▁begin|>import {
moduleFor,
test
} from 'ember-qunit';
<|fim▁hole|> // needs: ['service:foo']
});
// Replace this with your real tests.
test('it exists', function(assert) {
var service = this.subject();
assert.ok(service);
});<|fim▁end|> | moduleFor('service:canvas', {
// Specify the other units that are required for this test. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.