prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>test_certificates.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
"""
Group Configuration Tests.
"""
import json
import mock
import ddt
from django.conf import settings
from django.test.utils import override_settings
from opaque_keys.edx.keys import AssetKey
from opaque_keys.edx.locations import ... | data=CERTIFICATE_JSON_WITH_SIGNATORIES |
<|file_name|>runningjobswidget.js<|end_file_name|><|fim▁begin|>function fetchData{{ id }}() {
function onDataReceived(series) {<|fim▁hole|> series: {
shadowSize: 0,
},
bars: {
show: true,
barWidth: series.barWidth,
align: "center"
},
xax... | data = [series];
$.plot("#{{ id }}", data, { |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// ignore-tidy-linelength
#![feature(doc_cfg)]
pub mod module {
pub mod sub_module {
pub mod sub_sub_module {
pub fn foo() {}
}
pub fn bar() {}
}
pub fn whatever() {}
}
pub fn foobar() {}
pub type Alias = u32;
#[doc(cf... | /// aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
/// ```
///
/// ``` |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>window.React = require('react');
var App = require('./components/App.react');
var css = require('./../css/app.css');
require('../img/social_media.png');
React.initializeTouchEvents(true);
// Render the app component (js/components/App.react.js)<|fim▁hole|>);<|fim▁end|> | React.render(
<App />,
document.getElementById('app') |
<|file_name|>ECPrivKey.java<|end_file_name|><|fim▁begin|>/**
* jBorZoi - An Elliptic Curve Cryptography Library
*
* Copyright (C) 2003 Dragongate Technologies Ltd.
*
* 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
* th... | /**
* The EC Domain Parameters
*/
public ECDomainParameters dp; |
<|file_name|>index.d.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 information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior a... | * Creates a new Azure Search index.
*
* @param {object} index The definition of the index to create. |
<|file_name|>windows_env_start.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2020 The Pigweed 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
#
# https://ww... | import sys |
<|file_name|>Environment.py<|end_file_name|><|fim▁begin|>"""SCons.Environment
Base class for construction Environments. These are
the primary objects used to communicate dependency and
construction information to the build engine.
Keyword arguments supplied when the construction Environment
is created are constructi... | |
<|file_name|>image.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
//! CSS handling for the specified value of
//! [`image`][image]s
//!
//! [image]: https://drafts.csswg.org/css-images/#image-values
use Atom;
use cssparser::{Parser, Token};
use custom_properties::SpecifiedValue;
use parser::{Parse, ParserContext};
use s... | /* 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/. */ |
<|file_name|>_type.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------------
# Copyright (c) 2016-2021, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.... |
SampleData = SemanticType('SampleData', field_names='type') |
<|file_name|>JMathPlotter3D.java<|end_file_name|><|fim▁begin|>/*
* RapidMiner
*
* Copyright (C) 2001-2014 by RapidMiner and the contributors
*
* Complete list of developers available at our web site:
*
* http://rapidminer.com
*
* This program is free software: you can redistribute it and/or modify
*... | * the Free Software Foundation, either version 3 of the License, or |
<|file_name|>sokoban.rs<|end_file_name|><|fim▁begin|>#![crate_type = "bin"]
#![allow(unused_must_use)]
//extern crate native;
extern crate libc;
use std::from_str::{FromStr};
use std::io::{File};
use std::io::stdio::{stdin};
use std::path::{Path};
use std::os;
use sokoboard::{SokoBoard};
use sokoannotatedboard::{So... | println!("Reading from file.");
} else { |
<|file_name|>layout.js<|end_file_name|><|fim▁begin|>window.Lunchiatto.module('Transfer', function(Transfer, App, Backbone, Marionette, $, _) {
return Transfer.Layout = Marionette.LayoutView.extend({
template: 'transfers/layout',
ui: {
receivedTransfers: '.received-transfers',
submittedTransfers: ... | this._showTransfers('received');
this._showTransfers('submitted'); |
<|file_name|>nonblock_server.cpp<|end_file_name|><|fim▁begin|>#include "gen-cpp/LogSender.h"
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/server/TNonblockingServer.h>
#include <thrift/transport/TServerSocket.h>
#include <thrift/transport/TBufferTransports.h>
#include <thrift/concurrency/PosixThreadFact... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from future.builtins import str
from datetime import datetime
import re
try:
from urllib.parse import quote
except ImportError:
# Python 2
from urllib import quote
from django.db import models
from django.utils.en... | QUERY_TYPE_LIST: ("https://api.twitter.com/1.1/lists/statuses.json" |
<|file_name|>118A - String Task.py<|end_file_name|><|fim▁begin|><|fim▁hole|>v = 'aeiouy'
n = ''
for c in word:
if not c in v:
n += '.' + c
print n<|fim▁end|> | word = raw_input().lower() |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.views import generic
from django.core.urlresolvers import reverse
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import tabs
f... | template_name = 'project/cust_invoice/invoice.html' |
<|file_name|>common.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Django settings for puput_demo project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
... |
# GENERAL CONFIGURATION |
<|file_name|>gruntfile.js<|end_file_name|><|fim▁begin|>module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
// watch for changes and trigger compass, jshint, uglify and livereload
watch: {
... |
// we use the Sass |
<|file_name|>DetectionEvents.d.ts<|end_file_name|><|fim▁begin|>export declare enum DetectionEvents {
/**
* Event triggered by a audio detector indicating that its active state has changed from active to inactive or vice
* versa.
* @event
* @type {boolean} - true when service has changed to activ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#
# Extensible User Folder
#
# (C) Copyright 2000-2004 The Internet (Aust) Pty Ltd
# ACN: 082 081 472 ABN: 83 082 081 472
# All Rights Reserved
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDIN... |
import nullGroupSource |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2016 SUSE Linux GmbH
#<|fim▁hole|>#
# dbxincluder 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
# (... | # This file is part of dbxincluder. |
<|file_name|>hello_triangle.rs<|end_file_name|><|fim▁begin|>extern crate bootstrap_rs as bootstrap;
extern crate polygon;
use bootstrap::window::*;
use polygon::*;
use polygon::anchor::*;
use polygon::camera::*;
use polygon::math::*;
use polygon::mesh_instance::*;
use polygon::geometry::mesh::*;
static VERTEX_POSITIO... | .set_position_data(Point::slice_from_f32_slice(&VERTEX_POSITIONS))
.set_indices(&INDICES)
.build()
.unwrap(); |
<|file_name|>test_admin.py<|end_file_name|><|fim▁begin|>"""
Tests course_creators.admin.py.
"""
import mock
import django
from django.contrib.admin.sites import AdminSite
from django.contrib.auth.models import User
from django.core import mail
from django.http import HttpRequest
from django.test import TestCase
from ... |
def setUp(self):
""" Test case setup """
super(CourseCreatorAdminTest, self).setUp() |
<|file_name|>popup.js<|end_file_name|><|fim▁begin|>//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
//>>description: Popup windows
//>>label: Popups
//>>group: Widgets
//>>css.theme: ../css/themes/default/jquery.mobile.theme.css
//>>css.structure: ../css/structure/jquery.mobile.popup.css,../css/structure/j... | });
prerequisites.container.then( function() { |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import sys
import EulerPy
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def readme():
with open('README.rst') as f:
return f.read()
def requirements():
install_requires = []
with open('requirements... | "Programming Language :: Python :: 3", |
<|file_name|>urlwrappers.py<|end_file_name|><|fim▁begin|>import os
import functools
import logging
import six
from pelican.utils import (slugify, python_2_unicode_compatible)
logger = logging.getLogger(__name__)
@python_2_unicode_compatible
@functools.total_ordering
class URLWrapper(object):
def __init__(self,... |
page_name = property(functools.partial(_from_settings, key='URL',
get_page_name=True)) |
<|file_name|>cssgroupingrule.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 dom::bindings::codegen::Bindings::CSSGroupingRule... | fn InsertRule(&self, rule: DOMString, index: u32) -> Fallible<u32> {
self.rulelist().insert_rule(&rule, index, /* nested */ true) |
<|file_name|>auth.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from flask_login import LoginManager
from tamactiluya.models import User
login_manager = LoginManager()
login_manager.session_protection = 'strong'
login_manager.login_view = 'user.login'
@login_manager.user_loader
def user_loader(uname) -> ... | :return:
"""
try: |
<|file_name|>sitemaps.py<|end_file_name|><|fim▁begin|>from django.contrib.sitemaps import Sitemap
<|fim▁hole|> changefreq = "yearly"
priority = 0.6
protocol = 'https'
def items(self):
return BlogEntry.on_site.filter(is_visible=True)
def lastmod(self, item):
return item.modification<... | from .models import BlogEntry
class BlogEntrySitemap(Sitemap): |
<|file_name|>trace.py<|end_file_name|><|fim▁begin|>import gevent
import gevent.pool
import uuid
import logging
def get_trace(greenlet=None):
greenlet = greenlet or gevent.getcurrent()
if not hasattr(greenlet, '_iris_trace'):
greenlet._iris_trace = {}
return greenlet._iris_trace
def spawn(*args, ... | return g
|
<|file_name|>pybugger.py<|end_file_name|><|fim▁begin|>import random
from pybugger import myaixterm<|fim▁hole|>color.aix_init()
def string_constructor(args, foreground="normal", background="normal"):
if foreground != "rainbow":
foreground = "" if foreground == "normal" else color.aix_fg(foreground)
... |
color = myaixterm
|
<|file_name|>wct.conf.js<|end_file_name|><|fim▁begin|>module.exports = {
'plugins': {<|fim▁hole|> }
}
}<|fim▁end|> | 'local': {
'browsers': [ 'chrome', 'firefox' ] |
<|file_name|>LevelOrderJsonParser.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
* t... | * is used for the size of the entire object (including sub-objects).
*
* @see FullJsonParser |
<|file_name|>model.py<|end_file_name|><|fim▁begin|># !/usr/bin/python
# @package model
# @author Attila Borcs
#
# Class for the deep neural net. Each class function wrapped with
# a decorator function using python @property for unifying
# the DNN functionalities when tensorflow graph initializer
# called (tf.glob... | return decorator
|
<|file_name|>my.js<|end_file_name|><|fim▁begin|>/* this is all example code which should be changed; see query.js for how it works */
authUrl = "http://importio-signedserver.herokuapp.com/";
reEx.push(/\/_source$/);
/*<|fim▁hole|> doQuery();//query on ready
}
*/
//change doReady() to add autocomplete-related events... | //change doReady() to auto-query on document ready
var doReadyOrg = doReady;
doReady = function() {
doReadyOrg(); |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 The Exonum Team
//
// 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
//
//... | }
|
<|file_name|>ircensus_channel_bot.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
"""
A simple bot to gather some census data in IRC channels.
It is intended to sit in a channel and collect the data for statistics.
:author: tpltnt
:license: AGPLv3
"""
import irc.bot
import irc.strings
from irc.client import ip... | |
<|file_name|>a.py<|end_file_name|><|fim▁begin|>def suma(a, b):
return a+b
def resta(a, b):<|fim▁hole|><|fim▁end|> | return a+b |
<|file_name|>TestOzoneShell.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... | execute(shell, args);
|
<|file_name|>Fence.cpp<|end_file_name|><|fim▁begin|>#include <gbVk/Fence.hpp>
#include <gbVk/Exceptions.hpp>
#include <gbBase/Assert.hpp>
namespace GHULBUS_VULKAN_NAMESPACE
{
Fence::Fence(VkDevice logical_device, VkFence fence)
:m_fence(fence), m_device(logical_device)
{
}
Fence::~Fence()
{
if(m_fence) { vk... | |
<|file_name|>tfi_model.py<|end_file_name|><|fim▁begin|>"""A few convenience functions to setup the Ising model in a TF.
TFIM stands for Ising model in a transverse field, i.e.:
.. math::
H=\sum_{i}\left[S^{z}_{i}S^{z}_{i+1} + h S^{x}_{i}\right)\right]
"""
class TranverseFieldIsingModel(object):
"""Implements ... | |
<|file_name|>analysis.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | # proxy module
from __future__ import absolute_import
from codetools.blocks.analysis import * |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod brainfuck;
mod optimizer;
use std::fmt::{Display, Formatter, Result};<|fim▁hole|>pub enum BasicCmd {
Skip,
Rewind,
Add,
Sub,
}
impl Display for BasicCmd {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "{:?}", self)
}
}
// workaround b... |
#[derive(Clone, PartialEq, Debug)] |
<|file_name|>sql.py<|end_file_name|><|fim▁begin|>"""
Collection of query wrappers / abstractions to both facilitate data
retrieval and to reduce dependency on DB-specific API.
"""
from contextlib import contextmanager
from datetime import date, datetime, time
from functools import partial
import re
from typing import ... | if self.keys is not None: |
<|file_name|>make_ready_future.hpp<|end_file_name|><|fim▁begin|>#pragma once
#include <agency/detail/config.hpp>
#include <agency/detail/requires.hpp>
#include <agency/future.hpp>
#include <agency/execution/executor/executor_traits/executor_future.hpp>
#include <agency/execution/executor/executor_traits/is_executor.hp... | #include <type_traits> |
<|file_name|>__manifest__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>{
"name": "Account Invoice Payment Retention",
"version": "14.0.1.0.1",
"category": "Accounting & Finance",
"author": "Ecosoft, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/account... | # Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyOnnx(PythonPackage):
"""Open Neura... | built-in operators and standard data types. Currently we focus
on the capabilities needed for inferencing (scoring)."""
homepage = "https://github.com/onnx/onnx" |
<|file_name|>.doxie.render.toc.js<|end_file_name|><|fim▁begin|>// from https://gist.github.com/mathewbyrne/1280286
slugify = function(text){
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/... |
var render = function(data) {
var data = data.data; |
<|file_name|>problem_2.py<|end_file_name|><|fim▁begin|>'''
Problem 2
@author: Kevin Ji
'''
def sum_even_fibonacci( max_value ):
# Initial two elements
prev_term = 1
cur_term = 2
temp_sum = 2<|fim▁hole|> prev_term = cur_term
cur_term = next_term
if cur_term % 2 == 0:
... |
while cur_term < max_value:
next_term = prev_term + cur_term |
<|file_name|>ex3.py<|end_file_name|><|fim▁begin|>"""
example with 'calls_expected' in addtoBatch used
"""
import batchOpenMPI
def f_mult(x) : <|fim▁hole|>f.addtoBatch(4,calls_expected=4)
batchOpenMPI.processBatch() #get the workers to calculate all the inputs
res = [f(4),f(4),f(4)]
print(res)
#another test
f.addtoB... | return x*2.0
f = batchOpenMPI.batchFunction(f_mult) #creating function wrapper
batchOpenMPI.begin_MPI_loop() # both the workers and the master process run the same code up until here |
<|file_name|>system.rs<|end_file_name|><|fim▁begin|>extern crate racer;
extern crate rand;
use racer::{complete_from_file, find_definition, Match, MatchType, Coordinate};
use std::io::Write;
use std::fs::{self, File};
use std::path::{Path, PathBuf};
use std::thread;
/// A temporary file that is removed on drop
///
/... | fn mymethod(&self) -> Bar {}
}
impl<T> Bar<T> { |
<|file_name|>TestWinapp.py<|end_file_name|><|fim▁begin|># vim: ts=4:sw=4:expandtab
# BleachBit
# Copyright (C) 2008-2015 Andrew Ziem
# http://bleachbit.sourceforge.net
#
# 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 F... | dirname = tempfile.mkdtemp(prefix='bleachbit-test-winapp')
f1 = os.path.join(dirname, f1_filename or 'deleteme.log')
file(f1, 'w').write('')
|
<|file_name|>ProductSize.java<|end_file_name|><|fim▁begin|>package uk.co.nevarneyok.entities.product;
import com.google.gson.annotations.SerializedName;
public class ProductSize {
private long id;
@SerializedName("remote_id")
private long remoteId;
private String value;
public ProductSize() {
... | public void setRemoteId(long remoteId) { |
<|file_name|>test_meta.py<|end_file_name|><|fim▁begin|>"""
Tests for the integration test suite itself.
"""
import logging
import os
import subprocess
from collections import defaultdict
from pathlib import Path
from typing import Set
import yaml
from get_test_group import patterns_from_group
__maintainer__ = 'adam... | if (
line and
# Some tests show warnings on collection. |
<|file_name|>upload.js<|end_file_name|><|fim▁begin|>//Settings
actype = ['image/png','image/jpeg','image/jpg','image/gif']; /* Accepted mime type */
maxweight = 819200; /* Max file size in octets */
maxwidth = 150; /* Max width of the image */
maxheight = 150; /* Max height*/
//Caching variable selector
ish = $('.ish'... | |
<|file_name|>late.rs<|end_file_name|><|fim▁begin|>//! Implementation of lint checking.
//!
//! The lint checking is mostly consolidated into one pass which runs
//! after all other analyses. Throughout compilation, lint warnings
//! can be added via the `add_lint` method on the Session structure. This
//! requires a sp... | |
<|file_name|>Tags.js<|end_file_name|><|fim▁begin|>/**
* Interaction for the tags module<|fim▁hole|> */
jsBackend.tags =
{
// init, something like a constructor
init: function()
{
$dataGridTag = $('.jsDataGrid td.tag');
if($dataGridTag.length > 0) $dataGridTag.inlineTextEdit({ params: { fork: { action: 'edit' }... | *
* @author Tijs Verkoyen <tijs@sumocoders.be> |
<|file_name|>sales_schema.py<|end_file_name|><|fim▁begin|>import datetime<|fim▁hole|>class Store:
def parse(self,line):
fields=line.split('\t')
self.id = fields[0]
self.name = fields[1]
return self
def __repr__(self):
return "Store: id=%s \t name=%s"%(self.id,self.name)
class Product:
def parse(self,lin... | |
<|file_name|>ScriptMgr.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>VERSION = (0, 6, 0)<|fim▁hole|><|fim▁end|> | __version__ = '.'.join((str(x) for x in VERSION)) |
<|file_name|>stock_server.rs<|end_file_name|><|fim▁begin|>mod async_helpers;
<|fim▁hole|>use std::time::Duration;
use zeromq::*;
#[async_helpers::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut rng = rand::thread_rng();
let stocks: Vec<&str> = vec!["AAA", "ABB", "BBB"];
println!("... | use rand::Rng; |
<|file_name|>0011_auto_20201109_1100.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2.11 on 2020-11-09 17:00
import daphne_context.utils
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
... |
operations = [ |
<|file_name|>Types.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# This file is part of nexdatas - Tango Server for NeXus data writer
#
# Copyright (C) 2012-2017 DESY, Jan Kotanski <jkotan@mail.desy.de>
#
# nexdatas is free software: you can redistribute it and/or modify
# it under the terms of the G... | |
<|file_name|>Treatment.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2019 The Hyve B.V.
*
* This library 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. The software and documentation p... | |
<|file_name|>handlers.py<|end_file_name|><|fim▁begin|>import peewee
import tornado.web
import tornado.gen
from windseed.settings import env, db
from windseed.base import handler
from windseed.apps.admin import urls
from windseed.apps.admin.models import User
from windseed.apps.web.models import Record
class Handler... | name=name,
description=description) |
<|file_name|>Sensor.hpp<|end_file_name|><|fim▁begin|>/// This is the sensor class
///
/// Sensor is a box2d fixture that is attached to a parent body
/// Sensors are used to detect entities in an area.
#pragma once
#include <AFP/Scene/SceneNode.hpp>
#include <AFP/Entity/Entity.hpp>
#include <AFP/Entity/Character.hpp>
... | /// Creates a vision sensor for the entity. |
<|file_name|>loginoption.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Calendar-Indicator
#
# Copyright (C) 2011-2019 Lorenzo Carbonell Cerezo
# lorenzo.carbonell.cerezo@gmail.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | else: |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>from django.core.cache import cache<|fim▁hole|> cache.clear()<|fim▁end|> |
def pytest_runtest_setup(item):
# Clear the cache before every test |
<|file_name|>NaccacheSternTest.java<|end_file_name|><|fim▁begin|>package org.bouncycastle.crypto.test;
import java.math.BigInteger;
import java.security.SecureRandom;
import java.util.Vector;
import org.bouncycastle.crypto.AsymmetricCipherKeyPair;
import org.bouncycastle.crypto.InvalidCipherTextException;
import org.... | static final BigInteger g = BigInteger.valueOf(131);
|
<|file_name|>node.go<|end_file_name|><|fim▁begin|>package wikimediaparser
import (
"fmt"
"github.com/golang/glog"
"strings"
)
// Node as it is emitted by the parser
// - contains a NodeType for clear identification
// - a string val Val
// - a list of named parameters which are actually Node Lists
// ... | return ""
}
func EmptyNode() Node { |
<|file_name|>size_of.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/. */
use script::test::size_of;
// Macro so that we can stringif... | sizeof_checker!(size_node, Node, 184);
sizeof_checker!(size_element, Element, 360);
sizeof_checker!(size_htmlelement, HTMLElement, 376); |
<|file_name|>index.stories.tsx<|end_file_name|><|fim▁begin|>/*
import * as React from 'react'
import SelectOtherDevice from '.'
import {action, storiesOf} from '../../stories/storybook'
import * as Constants from '../../constants/provision'
import * as Types from '../../constants/types/provision'
const rd = {
cTime:... | }),
],
onBack: action('onBack'),
onResetAccount: action('onResetAccount'), |
<|file_name|>server.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"log"
"net/http"
"gopkg.in/jcelliott/turnpike.v1"
)
func main() {
s := turnpike.NewServer()
http.Handle("/ws", s.Handler)
http.Handle("/", http.FileServer(http.Dir("web")))<|fim▁hole|> if err := http.ListenAndServe(":8080", nil); ... |
fmt.Println("Listening on port 8080") |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms
<|fim▁hole|># future use<|fim▁end|> | |
<|file_name|>weak_crypto.py<|end_file_name|><|fim▁begin|>from cryptography.hazmat import backends
from cryptography.hazmat.primitives.asymmetric import ec, dsa, rsa
# Crypto and Cryptodome have same API
if random():
from Crypto.PublicKey import DSA
from Crypto.PublicKey import RSA
else:
from Cryptodome.Pub... | |
<|file_name|>_operations.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated... | |
<|file_name|>common.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This is the common settings file, intended to set sane defaults. If you have a
piece of configuration that's dependent on a set of feature flags being set,
then create a function that returns the calculated value based on the value of
FEATU... | 'TOS': 'tos',
'HONOR': 'honor',
'PRIVACY': 'privacy_edx',
'JOBS': 'jobs', |
<|file_name|>file.js<|end_file_name|><|fim▁begin|>/**
* @file
* Provides JavaScript additions to the managed file field type.
*
* This file provides progress bar support (if available), popup windows for
* file previews, and disabling of other file fields during Ajax uploads (which
* prevents separate file fields... | attach: function (context) { |
<|file_name|>issue-28105.rs<|end_file_name|><|fim▁begin|>// Make sure that a continue span actually contains the keyword.<|fim▁hole|> continue //~ ERROR `continue` outside of a loop
;
break //~ ERROR `break` outside of a loop
;
}<|fim▁end|> |
fn main() { |
<|file_name|>qgscurveeditorwidget.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
qgscurveeditorwidget.cpp
------------------------
begin : February 2017<|fim▁hole|> *****************************************************************... | copyright : (C) 2017 by Nyall Dawson
email : nyall dot dawson at gmail dot com |
<|file_name|>mode-ruby.js<|end_file_name|><|fim▁begin|>/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the follow... | }
if (prevIndent == -1) { |
<|file_name|>TestTimeField.py<|end_file_name|><|fim▁begin|># vim: set ff=unix expandtab ts=4 sw=4:
from unittest import TestCase, main
import numpy as np
from CompartmentalSystems.bins.TimeField import TimeField
class TestTimeField(TestCase):
def setUp(self):
self.ar = np.zeros(3)<|fim▁hole|> self.... | self.ar[2] = 2
self.arr = np.zeros((3, 2)) |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for ncbi project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_a... | application = get_wsgi_application() |
<|file_name|>client_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import
<|fim▁hole|>
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON,
)
from salttesting.helpers import... | # Import Salt Libs
from salt import acl |
<|file_name|>modistile.js<|end_file_name|><|fim▁begin|>define([
'aeris/util',
'aeris/errors/invalidargumenterror',
'aeris/maps/layers/aeristile'
], function(_, InvalidArgumentError, AerisTile) {
/**
* Representation of an Aeris Modis layer.
*
* @constructor
* @class aeris.maps.layers.ModisTile
* ... | |
<|file_name|>maybeArrayLike.js<|end_file_name|><|fim▁begin|>var _Array$isArray = require("../core-js/array/is-array");
var arrayLikeToArray = require("./arrayLikeToArray");
function _maybeArrayLike(next, arr, i) {
if (arr && !_Array$isArray(arr) && typeof arr.length === "number") {
var len = arr.length;
ret... | |
<|file_name|>test_iddgaps.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 Santosh Philip
# =======================================================================
# Distributed under the MIT License.
# (See accompanying file LICENSE or copy at
# http://opensource.org/licenses/MIT)
# ============================... | assert result == newfield |
<|file_name|>db_snapshot.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2012, Suryandaru Triandana <syndtr@gmail.com>
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package leveldb
import (
"container/list"
"fmt"
"runtime"
"sync... | |
<|file_name|>testcli.py<|end_file_name|><|fim▁begin|>import sphivedbcli
import time
import sys
def printResultSet( rs ):
print "row.count %d" % ( rs.getRowCount() )
columnCount = rs.getColumnCount()
hdrs = ""
for i in range( columnCount ):
hdrs = hdrs + ( "\t%s(%s)" % ( rs.getName( i ), rs.getType( i ) ) )
... | sys.exit( -1 )
|
<|file_name|>_ext_type.py<|end_file_name|><|fim▁begin|># $File: _ext_type.py
# $Date: Wed Feb 22 15:04:06 2012 +0800
#<|fim▁hole|># Contributors to this file:
# Kai Jia <jia.kai66@gmail.com>
#
# This file is part of pynojo
#
# pynojo is free software: you can redistribute it and/or modify
# it under the terms of th... | # Copyright (C) 2012 the pynojo development team <see AUTHORS file>
# |
<|file_name|>cabi_x86.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 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/licens... | RetValue(t) => { |
<|file_name|>lace.js<|end_file_name|><|fim▁begin|>import { $, util } from './util-node'
import Taglet from './taglet'
var
lace,
version = '1.0.0',
defaults = {
opts: {}
},
warehouse = {
singleton: null,
compiled_dom: null,
laces: {
global: null
... | |
<|file_name|>tydecode.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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/l... | |
<|file_name|>IBaseState.ts<|end_file_name|><|fim▁begin|>/**
* https://docs.aws.amazon.com/step-functions/latest/dg/awl-ref-states.html
*/
interface IBaseState {
/**<|fim▁hole|> Type: string
/**
* The name of the next state that will be run when the current state finishes.
* Some state types, such as Cho... | * The state's type. Can be any of the values listed in State Types. [Required]
*/ |
<|file_name|>regions-trait-object-1.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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://ww... | fn extension<'e>(x: &'e E<'e>) -> Box<M+'e> { |
<|file_name|>EmailSetupGUI.java<|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.
*/
package com.github.sunnybat.paxchecker.setup.email;
import com.github.sun... | if (smtpAddress != null) {
authSmtp.setEmailAddress(smtpAddress); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
if VERSION[... | VERSION = (1, 3, 0, 'alpha', 1)
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
from albaproject.settings import MEDIA_ROOT
import pdb
def _upload_to_generic(prefix_path=None, instance=None, field=None, filename=None):
#pdb.set_trace()
if not instance.pk: ... | def output_dest(self, filename):
return _upload_to_generic(None, self, 'output', filename)
def output_path(self): |
<|file_name|>server.go<|end_file_name|><|fim▁begin|>package grpc
import (
"context"
pb "go-common/app/service/main/account/api"
"go-common/app/service/main/account/conf"
"go-common/app/service/main/account/service"
"go-common/library/net/rpc/warden"
)
// New warden rpc server
func New(c *conf.Config, s *service... | LevelInfo: level, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.