prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>zapi_test.go<|end_file_name|><|fim▁begin|>// Copyright (C) 2014, 2015 Nippon Telegraph and Telephone Corporation.
//
// 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
//
// htt... | assert.Equal(nil, err)
switch v {
case 2, 3:
assert.Equal([]byte{0x2, 0x10, byte(message[v])}, buf[0:3]) |
<|file_name|>checkstyle.js<|end_file_name|><|fim▁begin|>var vows = require('vows'),
assert = require('assert'),
fs = require('fs'),
jscheckstyle = require('../lib/jscheckstyle');
function given(inputFile, expectedOutput) {
var context = {};
context['(' + inputFile + ') '] = {
topic: functio... | |
<|file_name|>makerlinks.py<|end_file_name|><|fim▁begin|>import os
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
# create makerlinks application
app = Flask(__name__)
app.config.from_object(__name__)
app.config.update(dict(
DATABASE = os.path.join(app... | with app.open_resource('schema.sql', mode='r') as f:
db.cursor().executescript(f.read())
db.commit()
|
<|file_name|>parsemarkdownService.js<|end_file_name|><|fim▁begin|>/**
* Created by li_xiaoliang on 2015/3/29.
*/
define(['marked','highlight'],function(marked,highlight){
return{
parsemarkdown:function(md){
var pattern=/~.*?~/g;
var matches=pattern.exec(md);<|fim▁hole|> ... | while(matches!=null){ |
<|file_name|>Dialog.js<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain ... | WebInspector.Dialog._modalHostView = view;
};
/** |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Authors: Tim Hessels
UNESCO-IHE 2017<|fim▁hole|>Module: Collect/JRC
Description:
This module downloads JRC water occurrence data from http://storage.googleapis.com/global-surface-water/downloads/.
Use the JRC.Occurrence functio... | Contact: t.hessels@unesco-ihe.org
Repository: https://github.com/wateraccounting/wa |
<|file_name|>alphabeta.py<|end_file_name|><|fim▁begin|>from logika import IGRALEC_R, IGRALEC_Y, PRAZNO, NEODLOCENO, NI_KONEC, MAKSIMALNO_STEVILO_POTEZ, nasprotnik
from five_logika import Five_logika
from powerup_logika import Powerup_logika, POWER_STOLPEC, POWER_ZETON, POWER_2X_NW, POWER_2X_W
from pop10_logika import P... | stirke_R = self.igra.stirke_R
stirke_Y = self.igra.stirke_Y |
<|file_name|>HelloWorld.cpp<|end_file_name|><|fim▁begin|>/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2007 Erwin Coumans http://continuousphysics.com/Bullet/
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable ... | btTransform startTransform;
|
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import Orange
import logging
import random
from discretization import *
from FeatureSelector import *
from utils import *
from sklearn import svm
from sklearn import cross_validation
from sklearn.metrics import f1_score, precision_recall_fscore_support
from sklearn.feat... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django import forms
from django.contrib import messages
from django.core.exceptions import ValidationError
from django.db.models import ObjectDoesNotExist
from django.shortcuts import get_object_or_404, redirect, render_to_response
from django.template import Requ... | form = OrderItemForm()
return render_to_response('product/product_detail.html', {
'object': product, |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Stetl documentation build configuration file, created by
# sphinx-quickstart on Sun Jun 2 11:01:36 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values a... | # List of patterns, relative to source directory, that match files and |
<|file_name|>commands.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
from copy import copy
import json
from peewee import Model, CharField, ForeignKeyField, IntegerField
from utils.modules import BaseModule, modules
from utils.modules.api import api as pmb_api
from utils imp... | |
<|file_name|>AccumuloConfiguration.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
* ... | */ |
<|file_name|>page_index.js<|end_file_name|><|fim▁begin|>/*-- Addition for remembering expanded state of pages --*/
function writeSessionCookie(cookieName, cookieValue) {
document.cookie = escape(cookieName) + "=" + escape(cookieValue) + ";";
<|fim▁hole|>}
function toggle_viewers() {
if (document.add.visib... | |
<|file_name|>ls.go<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2017 VMware, 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://www.apache.org/licenses/LICENSE-2.... | |
<|file_name|>solution.py<|end_file_name|><|fim▁begin|># Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findTilt(self, root):<|fim▁hole|> def dfs(root):
... | """
:type root: TreeNode
:rtype: int
""" |
<|file_name|>btree.cc<|end_file_name|><|fim▁begin|>// Based on "Design Patterns: Elements of Reusable Object-Oriented Software"
// book by Erich Gamma, John Vlissides, Ralph Johnson, and Richard Helm
//
// Created by Bartosz Rachwal. The National Institute of Advanced Industrial Science and Technology, Japan.
#includ... | }
}
} |
<|file_name|>globalize.min.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1<|fim▁hole|><|fim▁end|> | oid sha256:32728342485677be1fe240941c1404f53f367f741f7980cf29ae5c77e3f66a16
size 558 |
<|file_name|>GitHubUserApiTest.java<|end_file_name|><|fim▁begin|>package tw.showang.apiabstractionframework.example.api;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import tw.showang.apiabstractionframework.example.api.base.ApiTestBase;
import tw.showang.apiab... | |
<|file_name|>RefactoringElementListenerProvider.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2009 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://w... | import com.intellij.openapi.extensions.ExtensionPointName; |
<|file_name|>exercicio-05-17.py<|end_file_name|><|fim▁begin|>##############################################################################
# Parte do livro Introdução à Programação com Python
# Autor: Nilo Ney Coutinho Menezes
# Editora Novatec (c) 2010-2014
# Primeira edição - Novembro/2010 - ISBN 978-85-7522-250-8
#... | # Terceira reimpressão - Agosto/2013
# Segunda edição - Junho/2014 - ISBN 978-85-7522-408-3 |
<|file_name|>FileDriver.ts<|end_file_name|><|fim▁begin|>import * as fs from 'fs';
import * as glob from 'glob';
import * as path from 'path';
import { IDatabase } from '../interfaces/IDatabase';
import { IExtractor } from '../interfaces/IExtractor';
type fs = typeof fs;
type glob = typeof glob;
type path = typeof pat... | * @param fs |
<|file_name|>Font.cpp<|end_file_name|><|fim▁begin|>/*
* Font.cpp
*
* Copyright (C) 2012 Simon Lehmann
*
* This file is part of Actracktive.
*
* Actracktive 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 Foundati... | : face(face), size(size) |
<|file_name|>align.rs<|end_file_name|><|fim▁begin|>s_no_extra_traits! {
#[allow(missing_debug_implementations)]<|fim▁hole|> #[repr(align(16))]
pub struct max_align_t {
priv_: [f32; 8]
}
}
s! {
pub struct ucontext_t {
pub uc_flags: ::c_ulong,
pub uc_link: *mut ucontext_t,
... | |
<|file_name|>ImmutableVirtualizedList.test.js<|end_file_name|><|fim▁begin|>import React from 'react';
import renderer from 'react-test-renderer';
import { data, renderers, expectors } from '../../test-utils';
import ImmutableVirtualizedList from '../ImmutableVirtualizedList';
describe('ImmutableVirtualizedList', () ... | it('renders basic List', () => { |
<|file_name|>NodeDescriptor.java<|end_file_name|><|fim▁begin|>/*****************************************************************
JADE - Java Agent DEvelopment Framework is a framework to develop
multi-agent systems in compliance with the FIPA specifications.
Copyright (C) 2000 CSELT S.p.A.
GNU Lesser General Public ... | |
<|file_name|>building.py<|end_file_name|><|fim▁begin|># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2013 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complian... | a = Building(name = str(row[0]), |
<|file_name|>planetposition.test.js<|end_file_name|><|fim▁begin|>import assert from 'assert'
import { planetposition, julian, sexagesimal as sexa } from '../src/index.js'
import data from '../data/index.js'
describe('#planetposition', function () {
describe('position2000', function () {
it('Mars at 2415020.0', f... | assert.strictEqual(new sexa.Angle(fk5.lat).toDegString(5), '-2°.6206')
})
})
}) |
<|file_name|>test_gbq.py<|end_file_name|><|fim▁begin|>import pytest
from datetime import datetime
import pytz
import platform
import os
import numpy as np
import pandas as pd
from pandas import compat, DataFrame
from pandas.compat import range
pandas_gbq = pytest.importorskip('pandas_gbq')
PROJECT_ID = None
PRIVATE... | |
<|file_name|>speed_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Benchmark how long it takes to set 10,000 keys in the database.
"""
from __future__ import print_function
import trollius as asyncio
from trollius import From
import logging
import trollius_redis
import time
from six.moves import range
i... | yield From(connection.set(u'key', u'value'))
|
<|file_name|>Keycodes.java<|end_file_name|><|fim▁begin|>/*
Simple DirectMedia Layer
Java source code (C) 2009-2011 Sergii Pylypenko
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permissi... | public static final int SDLK_KP_TAB = 186;
public static final int SDLK_KP_BACKSPACE = 187;
public static final int SDLK_KP_A = 188;
public static final int SDLK_KP_B = 189; |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># Copyright 2020 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | if not os.path.exists(self.build_temp):
os.makedirs(self.build_temp)
|
<|file_name|>version-numbers.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate version_sync;
#[test]<|fim▁hole|> assert_markdown_deps_updated!("README.md");
}
#[test]
fn test_html_root_url() {
assert_html_root_url_updated!("src/lib.rs");
}<|fim▁end|> | fn test_readme_deps() { |
<|file_name|>bikes.ts<|end_file_name|><|fim▁begin|>import * as objectAssign from 'object-assign';
import * as Redux from 'redux'
import {
BikesState,
BIKES_ADD,
BIKES_FETCHING,
BIKES_RECEIVED,
BIKES_FAILURE
} from '../types';
const initialState: BikesState = {
isFetching: false,
items: []
... | case BIKES_FETCHING:
return objectAssign({}, state, { isFetching: true });
|
<|file_name|>pijavskij.py<|end_file_name|><|fim▁begin|>from operator import itemgetter
__author__ = 'davide'
def pairwise(l):
for t in zip(l, l[1:]):
yield t
def pijavskij(f, L, a, b, eps=1E-5):
l = [(a, f(a)), (b, f(b))]
while True:
imin, Rmin, xmin = -1, float("inf"), -... | imin = i
Rmin = R
xmin = (xi + xj) / 2 - (fj - fi) / (2 * L)
|
<|file_name|>0015_auto_20160421_0000.py<|end_file_name|><|fim▁begin|>from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cms', '0014_auto_20160404_1908'),
]
operations = [
migrations.AlterField(
model_name='cmsplugin',
... | |
<|file_name|>0002_create_site.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def create_site(apps, schema_editor):
# We get the model from the versioned app registry;
# if we directly import it, it'll be the wrong versi... |
class Migration(migrations.Migration):
dependencies = [ |
<|file_name|>test_c_node_tree.py<|end_file_name|><|fim▁begin|>import sys
import unittest
from string import ascii_letters
from random import randint, choice
import logging
from influxgraph.templates import parse_influxdb_graphite_templates
from influxgraph.utils import parse_series as parse_py_series
try:
from inf... | def test_string_insert(self):
del self.index
self.index = Node() |
<|file_name|>cclib2pyquante.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (c) 2016, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Bridge for using cclib data in PyQuante (http://pyqu... | # Fail silently for now.
pass
|
<|file_name|>coupons.py<|end_file_name|><|fim▁begin|>"""
E-commerce Tab Instructor Dashboard Coupons Operations views
"""
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.views.decorators.http import require_POST
f... | return HttpResponseNotFound(_("coupon with the coupon id ({coupon_id}) already exists").format(coupon_id=coupon_id))
# check if the coupon code is in the CourseRegistrationCode Table |
<|file_name|>user_defined.py<|end_file_name|><|fim▁begin|># Author: Prabhu Ramachandran <prabhu [at] aero . iitb . ac . in>
# Copyright (c) 2008, Enthought, Inc.
# License: BSD Style.
# Enthought library imports.
from tvtk.tools.tvtk_doc import TVTKFilterChooser, TVTK_FILTERS
# Local imports.
from mayavi.filters.fil... | error('Invalid filter chosen! Try again!')
return obj |
<|file_name|>icons.js<|end_file_name|><|fim▁begin|>var blueMarker = L.AwesomeMarkers.icon({
icon: 'record',
prefix: 'glyphicon',
markerColor: 'blue'
});
var airportMarker = L.AwesomeMarkers.icon({
icon: 'plane',
prefix: 'fa',
markerColor: 'cadetblue'
});
var cityMarker = L.AwesomeMarkers.icon(... | }); |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md>
fn main() {<|fim▁hole|><|fim▁end|> | println!("cargo:rustc-flags=-l samlib");
} |
<|file_name|>parse_cheetah_logfile.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# JN 2015-07-29
"""
Log file parser for Cheetah by Johannes Niediek
This script reads out the reference settings
by sequentially following all crs, rbs, and gbd commands.
Please keep in mind that the following scenario is possi... | |
<|file_name|>patch.py<|end_file_name|><|fim▁begin|>from bson import ObjectId
import simplejson as json
from eve.tests import TestBase
from eve.tests.test_settings import MONGO_DBNAME
from eve.tests.utils import DummyEvent
from eve import STATUS_OK, LAST_UPDATED, ID_FIELD, ISSUES, STATUS, ETAG
from eve.methods.patch i... | # document we are trying to update.
del(self.domain['contacts']['schema']['dependency_field1']['default'])
del(self.domain['contacts']['defaults']['dependency_field1'])
changes = {'dependency_field2': 'value'} |
<|file_name|>client.go<|end_file_name|><|fim▁begin|>// Package storagedatalake implements the Azure ARM Storagedatalake service API version 2019-10-31.
//
// Azure Data Lake Storage provides storage for Hadoop and other big data workloads.
package storagedatalake
// Copyright (c) Microsoft Corporation. All rights rese... | }
// NewWithoutDefaults creates an instance of the BaseClient client. |
<|file_name|>BlockTest.java<|end_file_name|><|fim▁begin|>package test.ethereum.core;
import test.ethereum.TestContext;
import org.ethereum.config.SystemProperties;
import org.ethereum.core.Block;
import org.ethereum.core.BlockchainImpl;
import org.ethereum.core.Genesis;
import org.ethereum.facade.Blockchain;
import o... |
URL scenario1 = ClassLoader
.getSystemResource("blockload/scenario1.dmp");
|
<|file_name|>views.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from .apps.page import views as page
assert page |
<|file_name|>save-map-form.component.ts<|end_file_name|><|fim▁begin|>import {Component, OnDestroy} from '@angular/core';
import {Subject} from 'rxjs';
import {takeUntil} from 'rxjs/operators';
import {HsCoreService} from '../core/core.service';
import {HsLayerUtilsService} from '../utils/layer-utils.service';
import ... | this.HsSaveMapManagerService.missingName = false;
}
|
<|file_name|>test_rst_csv_writer.py<|end_file_name|><|fim▁begin|>"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from textwrap import dedent
import pytest
import pytablewriter
from ...._common import print_test_result
from ....data import (
Data,
headers,
mix_header_list,
mix... | writer.value_matrix = value
writer.iteration_length = len(value)
writer.write_table_iter()
|
<|file_name|>error_page_embed.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from django import forms
from django.db import IntegrityError, transaction
from django.http import HttpResponse
from django.views.generic import View
from django.template.loader import render_to_string
from django.util... | if not origin:
return self._json_response(request, status=403) |
<|file_name|>issue-37945.rs<|end_file_name|><|fim▁begin|>// compile-flags: -O -Zmerge-functions=disabled
// ignore-x86
// ignore-arm
// ignore-emscripten
// ignore-gnux32
// ignore 32-bit platforms (LLVM has a bug with them)
// Check that LLVM understands that `Iter` pointer is not null. Issue #37945.
#![crate_type =... | // CHECK-NEXT: [[A:%.*]] = icmp ne i32* %xs.1, null |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/// <reference path="../typings/tsd.d.ts"/>
import React = require('react');
import TR = require('typed-react');
import $ = require('jquery');
import _ = require('lodash');
import MapLookUp = require('maps/mapLookUp');
import Map = require('maps/map');
import Places ... | new google.maps.LatLng(47.561175, -122.284089), // Rainier community center
new google.maps.LatLng(47.579174, -122.299633), // QFC Rainier Ave |
<|file_name|>libtodaystocktickerplugin.ts<|end_file_name|><|fim▁begin|><!DOCTYPE TS><TS>
<defaultcodec>iso8859-1</defaultcodec>
<context>
<name>QObject</name>
<message>
<source>StockTicker plugin</source>
<translation>Module "StockTicker"</translation>
</message>
</context>
<contex... | by a space.</source>
<translation>Entrer les symboles de stock séparés
par des espaces.</translation> |
<|file_name|>sync.js<|end_file_name|><|fim▁begin|>/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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... | module.exports = lint; |
<|file_name|>MockDriver.java<|end_file_name|><|fim▁begin|>/*! ******************************************************************************
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
*
**********************************************************************... | |
<|file_name|>image.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/. */
//! Generic types for the handling of [images].
//!
//! [image... | |
<|file_name|>logging.js<|end_file_name|><|fim▁begin|>sap.ui.define([
"jquery.sap.global",
"unitTests/utils/loggerInterceptor"
], function ($, loggerInterceptor) {
"use strict";
// Opa5 needs to be unloaded because we want to intercept the logger
jQuery.sap.unloadResources("sap/ui/test/Opa5.js", false, true, true)... | this.oView.placeAt("qunit-fixture");
sap.ui.getCore().applyChanges(); |
<|file_name|>config.ts<|end_file_name|><|fim▁begin|>export let Config = {
import: [
'app/shared/config/cache.json',
'app/shared/i18n/lang_en.json',<|fim▁hole|> appLang: 'en',
availableLangs: [
{ label: 'EN', value: 'en' },
{ label: 'ES', value: 'es' }
],
security: {
... | 'app/shared/i18n/lang_es.json'
],
|
<|file_name|>test.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import sys
print (sys.argv[1:])<|fim▁end|> | #!../venv/bin/python
|
<|file_name|>SchedulingComponent.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this not... | heapq.heappush(self.eventQueue, event)
return event
|
<|file_name|>memory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************... | # allocation curve
self.allocation = Map({"times": [], "allocation": [], "cumulative": []})
|
<|file_name|>outcomes_test.go<|end_file_name|><|fim▁begin|>package comm
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestQueryType_String(t *testing.T) {
assert.Equal(t, "REQUEST", Request.String())
assert.Equal(t, "RESPONSE", Response.String())
}
func TestOutcome_String(t *testing.T) {
asser... |
func TestMetrics_Record(t *testing.T) {
m := newScalarMetrics() |
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2014 OSBI 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.0<... | *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<|file_name|>t_BarPlot_std.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
from openturns import *
from math import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
# Instanciate one distribution object
dim = 1
meanPoint = NumericalPoint(dim, 1.0)
meanPoint[0] = 0.5
sigma = NumericalPoint(... | distribution1 = Normal(meanPoint, sigma, R)
# Instanciate another distribution object |
<|file_name|>test_res_partner_industry.py<|end_file_name|><|fim▁begin|># Copyright 2015 Antiun Ingenieria S.L. - Javier Iniesta
# Copyright 2016 Tecnativa S.L. - Vicent Cubells
# Copyright 2016 Tecnativa S.L. - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo.exceptions im... | self.assertEqual(industry_copy.name, "Test child 2")
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""<|fim▁hole|>VERSION = "0.3.2" # pragma: no cover<|fim▁end|> | PyLTI is module that implements IMS LTI in python
The API uses decorators to wrap function with LTI functionality.
""" |
<|file_name|>GradAdapter.java<|end_file_name|><|fim▁begin|>package com.hangon.saying.viewPager;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.LayoutInflater;
impor... | }
@Override |
<|file_name|>templating.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
import argparse
import traceback
import sys
import netaddr
import requests
from flask import Flask, request
from jinja2 import Environment, FileSystemLoader, TemplateNotFound
endpoints = "read/networks read/oplog read/snmp read/switches-mana... | parser = argparse.ArgumentParser(description="Process templates for gondul.", add_help=False)
parser.add_argument("-t", "--templates", type=str, nargs="+", help="location of templates")
parser.add_argument("-h", "--host", type=str, default="127.0.0.1", help="host address") |
<|file_name|>TpNameText.js<|end_file_name|><|fim▁begin|>/**
* @author caspar - chengzhihang
* @contact 279397942@qq.com
* @date 2016/12/29
* @file admin/view-partial/main/order/widget/form/value-widget/TpNameText
*/
define([<|fim▁hole|> return declare('admin/view-partial/main/order/widget/form/value-widget/TpNa... | 'zh/widget/text/ValidationTextBox',
'admin/services/enums/OrderPropertyEnum',
"dojo/_base/declare"
], function (TextBox, OrderPropertyEnum, declare) { |
<|file_name|>zsysnum_linux_amd64.go<|end_file_name|><|fim▁begin|>// mksysnum_linux.pl /usr/include/asm/unistd_64.h
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
// +build amd64,linux
package unix
const (
SYS_READ = 0
SYS_WRITE = 1
SYS_OPEN = 2
SYS_CLO... | SYS_NFSSERVCTL = 180
SYS_GETPMSG = 181
SYS_PUTPMSG = 182
SYS_AFS_SYSCALL = 183 |
<|file_name|>dra.py<|end_file_name|><|fim▁begin|>#http://informatics.mccme.ru/mod/statements/view3.php?id=22783&chapterid=113362#1
n = int(input())<|fim▁hole|>def sum_kv_cifr(x):
su = 0
for i in str(x):
su += int(i)*int(i)
return su
maxi_power = 0
for i in range(1, n//2+1):
print('______',i)
... | |
<|file_name|>mapper_pca.go<|end_file_name|><|fim▁begin|>package pdp
import (
"fmt"
"sort"
"strings"
"github.com/infobloxopen/go-trees/strtree"
)
type mapperPCA struct {
argument Expression
policies *strtree.Tree
def Evaluable
err Evaluable
order int
algorithm PolicyCombiningAlg
}
// Mapp... |
return mapperPCA{ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2011,2013 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|>#
# Unless required by applicable law or agre... | # 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 |
<|file_name|>transcribe.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/lice... | Some(matched) => match *matched {
MatchedNonterminal(_) => LisUnconstrained, |
<|file_name|>attachments.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 b... | volume_ref = objects.Volume.get_by_id(
context,
attachment_ref.volume_id)
attachment_ref.update({'attach_status': 'attached'}) |
<|file_name|>gadagne.py<|end_file_name|><|fim▁begin|>from core.engine import hplayer
# PLAYER
player = hplayer.addplayer('mpv', 'gadagne')
# Interfaces
player.addInterface('osc', 4000, 4001)
player.addInterface('http', 8080)
# player.addInterface('gpio', [16,19,20,21,26])
# GADAGNE logic
defaultFile = 'media0.mp4'
p... | # HTTP + GPIO events |
<|file_name|>test_sort_by.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase
class TestSortBy(FlexGetBase):
__yaml__ = """
tasks:
test1:
sort_by: title
mock:
- {title: 'B C D', ur... | - {title: 'A B C', url: 'http://localhost/2'}
- {title: 'A P E', url: 'http://localhost/3'}
test3: |
<|file_name|>BaseForecastResponse.java<|end_file_name|><|fim▁begin|><|fim▁hole|>
}<|fim▁end|> | package com.dpanayotov.simpleweather.api.base;
public class BaseForecastResponse { |
<|file_name|>qnotify.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3<|fim▁hole|># Copyright (C) 2018 Ingo Ruhnke <grumbel@gmail.com>
#
# 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, eith... |
# dirtool.py - diff tool for directories |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>/*
The main entry point for the client side of the app
*/<|fim▁hole|>this.App = {};
// Create the needed collections on the client side
this.Surprises = new Meteor.Collection("surprises");
// Subscribe to the publishes in server/collections
Meteor.subscribe('sur... |
// Create the main app object |
<|file_name|>fun_with_regex_done.py<|end_file_name|><|fim▁begin|># Regular expressions are a powerful tool for pattern matching when you
# know the general format of what you're trying to find but want to keep
# it loose in terms of actual content: think finding email addresses or
# phone numbers based on what they hav... | # 6. {1,2} matches at least one, but no more than 2
# 7. , matches the comma in the date
# 8. \s{1}: again, one space or tab |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Ansible integration test infrastructure."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import contextlib
import json
import os
import shutil
import tempfile
from .. import types as t
from ..target import (
analy... | display.notice('Sourcing inventory file "%s" from "%s".' % (inventory_path, inventory_path_src)) |
<|file_name|>07f975f81f03_remove_team_domain.py<|end_file_name|><|fim▁begin|><|fim▁hole|># -*- coding: utf-8 -*-
"""Remove team domain
Revision ID: 07f975f81f03
Revises: 4e206c5ddabd
Create Date: 2017-08-04 15:12:11.992856
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
re... | |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from iitem_database.models import Item, ItemClass, Area, Creature, Drops, Found, UserItems, ItemReview
admin.site.register(Item)<|fim▁hole|>admin.site.register(Drops)
admin.site.register(Found)
admin.site.register(UserItems)
admin.site... | admin.site.register(ItemClass)
admin.site.register(Area)
admin.site.register(Creature) |
<|file_name|>mpi_rank.hpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015-2016, Technische Universität Dresden, Germany
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted
* provided that the following conditions are met:
*
* 1. Redistrib... | return mpi_size_;
} |
<|file_name|>unknown-renamed-lints.rs<|end_file_name|><|fim▁begin|>#![deny(unknown_lints)]
//~^ NOTE lint level is defined
#![deny(renamed_and_removed_lints)]
//~^ NOTE lint level is defined
#![deny(x)]
//~^ ERROR unknown lint
#![deny(rustdoc::x)]
//~^ ERROR unknown lint: `rustdoc::x`
#![deny(intra_doc_link_resolution_... | #![deny(rustdoc::intra_doc_link_resolution_failure)]
//~^ ERROR unknown lint |
<|file_name|>printf.rs<|end_file_name|><|fim▁begin|>// c-style formatted printing
fn main(){
println!("{} days", 31);
// arguments in formatted print can be reffered to by position.
// very handy
println!("{0}, this is {1}. {1}, this is {0}","Alice","Bob");
// arguments can be named
println!(... |
// radix
println!("{} decimal, {:b} binary, {:x} hex",1000,1000,1000); |
<|file_name|>TestEvaluator.java<|end_file_name|><|fim▁begin|>package operationExtensibility.tests;
import static org.junit.Assert.assertEquals;
import org.junit.BeforeClass;
import org.junit.Test;
import operationExtensibility.*;
public class TestEvaluator {
private static Visitor<Integer> v;
@BeforeC... | public void testLit() {
Lit x = new Lit();
x.setInfo(42);
|
<|file_name|>swarm_notif_test.go<|end_file_name|><|fim▁begin|>package swarm
import (
"testing"
"time"
ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
inet "github.com/ipfs/go-ipfs/p2p/net"
)
func ... | for _, s2 := range swarms {
if s == s2 { |
<|file_name|>greatfet.rs<|end_file_name|><|fim▁begin|>#![allow(missing_docs)]
use core::intrinsics::abort;
use hal::lpc17xx::pin;
use hal::pin::Gpio;
use hal::pin::GpioDirection;
pub struct Led {
pin: pin::Pin,
}
impl Led {
pub fn new(idx: u8) -> Led {
Led {
pin: match idx {
... | }
}
} |
<|file_name|>life.py<|end_file_name|><|fim▁begin|>import random
import glob
from os import path
import biohex
import math
import traceback
# storage class for constants
class locals():
class distanceLookup():
RING_CACHE = 0
BIT_LISTER = 1
try:
# load up bit graphic asset names
bitList = ... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
<|fim▁hole|>admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'DjangoApplication1.views.home', name='home'),
# url(r'^DjangoApplication1/', include('DjangoApplication1.fob.urls'... |
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
|
<|file_name|>lambda.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# This file is part of Ansible
#
# Ansible 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|>test_permmod.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from djangocms_text_ckeditor.models import Text
from django.contrib.admin.sites import site
from django.contrib.admin.utils import unquote
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser... | # Refresh internal user cache
USERS[0] = self.reload(USERS[0]) |
<|file_name|>air_quality.py<|end_file_name|><|fim▁begin|>"""Support for Xiaomi Mi Air Quality Monitor (PM2.5)."""
import logging
from miio import AirQualityMonitor, Device, DeviceException
import voluptuous as vol
from homeassistant.components.air_quality import PLATFORM_SCHEMA, AirQualityEntity
from homeassistant.co... | |
<|file_name|>sku__create.js<|end_file_name|><|fim▁begin|>$(document).ready(function () {
// add classes to check boxes
$('#id_notify_at_threshold').addClass('form-control');
$('#id_in_live_deal').addClass('form-control');<|fim▁hole|>
});<|fim▁end|> | $('#id_is_subscription').addClass('form-control'); |
<|file_name|>synth.py<|end_file_name|><|fim▁begin|># Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | cls, |
<|file_name|>UnboundedSourceWrapper.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
*... | |
<|file_name|>0001_announcement.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-07 22:51
from __future__ import unicode_literals
import c3nav.mapdata.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.