prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>roll-the-dice.py<|end_file_name|><|fim▁begin|>##<|fim▁hole|># the double totals.
# import the random library
import random
# Set the start and end values the same as a dice
start = 1
end = 6
# Set the running total for doubles found
totalDoubles = 0
# Get the number of times we need to roll the dice
ro... | # @author Brandon Michael
# Roll the dice based on the user's input. Track double rolls and display |
<|file_name|>describe.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2016 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with... | if 'dxapi' in desc:
print_field("API version", desc["dxapi"]) |
<|file_name|>addtrack.py<|end_file_name|><|fim▁begin|>"""
//=========================================================
// OOMidi<|fim▁hole|>
import Pyro.core
import time
oom=Pyro.core.getProxyForURI('PYRONAME://:Default.oom')
for j in range(0,5):
for i in range(0,30):
oom.addMidiTrack("amiditrack" +... | // OpenOctave Midi and Audio Editor
// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
//=========================================================
""" |
<|file_name|>LALFileTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 Jerom van der Sar.
*
* 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/license... |
import java.io.File;
import org.junit.Assert; |
<|file_name|>ChatOutput.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# This file is part of emesene.
#
# emesene 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 ... | # You should have received a copy of the GNU General Public License
# along with emesene; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
<|file_name|>all_12.js<|end_file_name|><|fim▁begin|><|fim▁hole|> ['vguac_5fclient_5fabort',['vguac_client_abort',['../client_8h.html#a4c0eccd7d0ed3dbf3e7941ce297e0224',1,'client.h']]],
['vguac_5fclient_5flog',['vguac_client_log',['../client_8h.html#a37a0fa9cfc4c02236085e3852972f494',1,'client.h']]],
['vguac_5fprot... | var searchData=
[
['value',['value',['../structguac__pool__int.html#af76ff5f21c6e0f69d95cdd1385ea24a4',1,'guac_pool_int']]], |
<|file_name|>AnalyticsLoginTestCase.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
... | log.error("Error while changing configurations in identity.xml");
} catch (MalformedURLException e) { |
<|file_name|>test_urlresolvers.py<|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/.
from unittest.mock import Mock, patch
from django.test ... | Should return exact match if it is in settings.LANGUAGE_URL_MAP
"""
request = self.factory.get("/")
prefixer = Prefixer(request) |
<|file_name|>paragraph.ts<|end_file_name|><|fim▁begin|>import { BlockNode } from './block';
import { TextNode } from './text';
import { Token } from '../tokenize';
export class ParagraphNode extends BlockNode {
openTag() {
return '<p>';<|fim▁hole|> closeTag() {
return '</p>';
}
absorb(child) {
retur... | } |
<|file_name|>build.ts<|end_file_name|><|fim▁begin|>import { task } from 'gulp';
import { join } from 'path';
import { DIST_BUILD_ROOT, DIST_BUILD_ES2015_ROOT, DIST_BUILD_UMD_ROOT, ES5, ES_2015, PROJECT_ROOT, UMD_MODULE } from '../constants';
import { copySourceToDest, createTempTsConfig, deleteFiles, runNgc, runTsc } f... | createTempTsConfig([join('.', '**', '*.ts')], ES5, UMD_MODULE, join(PROJECT_ROOT, 'tsconfig.json'), join(DIST_BUILD_UMD_ROOT, 'tsconfig.json'));
runNgc(join(DIST_BUILD_UMD_ROOT, 'tsconfig.json'), (err) => {
if (err) { |
<|file_name|>prerequisites.ts<|end_file_name|><|fim▁begin|>// From https://hapijs.com/api/16.1.1#route-prerequisites
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
const pre1: Hapi.RoutePrerequisiteRequestHandler = function (request, reply) {
return reply('Hello'... | const pre3: Hapi.RoutePrerequisiteRequestHandler = function (request, reply) {
const pre = request.pre as Pre1;
return reply(pre.m1 + ' ' + pre.m2);
}; |
<|file_name|>reflect-object-param.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 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.apach... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for vacuum cleaner robots (botvacs)."""
from dataclasses import dataclass
from datetime import timedelta
from functools import partial
import logging
from typing import final
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
... | """Start, pause or resume the cleaning task."""
raise NotImplementedError()
|
<|file_name|>test_clean.py<|end_file_name|><|fim▁begin|># -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2017 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free ... | for i in range(n):
part_name = 'clean{}'.format(i) |
<|file_name|>mysql.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
@author: Fabio Erculiani <lxnay@sabayon.org>
@contact: lxnay@sabayon.org
@copyright: Fabio Erculiani
@license: GPL-2
I{EntropyRepository} is the MySQL implementation of the repository
interface.
"""
import os
impor... | class MySQLCursorWrapper(SQLCursorWrapper):
"""
This class wraps a MySQL cursor and |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import json
# django imports
from django.contrib.auth.decorators import permission_required
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from ... | "navigation": navigation(request, voucher_group),
})) |
<|file_name|>description.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code,... | |
<|file_name|>final_prompt.py<|end_file_name|><|fim▁begin|>#
# This file is part of Checkbox.
#
# Copyright 2008 Canonical Ltd.
#
# Checkbox 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 t... | class FinalPrompt(Plugin):
def register(self, manager): |
<|file_name|>ReplaceWithAction.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2009 Andrey Loskutov.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License... | * @author Andrey
*/
public abstract class ReplaceWithAction extends AbstractHandler implements IObjectActionDelegate {
|
<|file_name|>array_map.js<|end_file_name|><|fim▁begin|>//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
/... |
Array.prototype[6] = 20;
|
<|file_name|>express.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* Module dependencies.
*/
var express = require('express'),
mean = require('meanio'),
consolidate = require('consolidate'),
mongoStore = require('connect-mongo')(express),
flash = require('connect-flash'),
helpers = require('v... | css: assets.css,
debug: (process.env.NODE_ENV !== 'production'),
webroot: 'public/public'
}); |
<|file_name|>start-local.task.js<|end_file_name|><|fim▁begin|>import fs from 'fs';
import url from 'url';
import path from 'path';
import mime from 'mime-types';
import gulp from 'gulp';
import createServerTask from './tasks/server';
import consoleArguments from './console-arguments';
import { adminBundle } from './adm... | import { translatorBundle } from './translator-bundle.tasks';
const BUNDLES = [adminBundle, dashboardBundle, mediaBundle, translatorBundle]; |
<|file_name|>StringToDateConverter.ts<|end_file_name|><|fim▁begin|>import { JsonConverter, JsonCustomConvert } from 'json2typescript';
@JsonConverter
export class StringToDateConverter implements JsonCustomConvert<Date> {<|fim▁hole|> return new Date(Number(date));
}
}<|fim▁end|> | public serialize(date: Date): any {
return date.getTime().toString();
}
public deserialize(date: any): Date { |
<|file_name|>stack.py<|end_file_name|><|fim▁begin|># Copyright 2017-2019 Tom Eulenfeld, MIT license
"""Stack correlations"""
import numpy as np
import obspy
from obspy import UTCDateTime as UTC
from yam.util import _corr_id, _time2sec, IterTime
def stack(stream, length=None, move=None):
"""
Stack traces in s... | |
<|file_name|>derive_from_xml_stream.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate mws_derive;
#[macro_use]
extern crate mws;
extern crate chrono;
use chrono::{DateTime, Utc};
pub use mws::{result, xmlhelper};
#[test]
fn derive_struct() {
#[derive(Debug, PartialEq, Default, FromXmlStream)]
struct S {
... | Products {
ItemDimensions: ItemDimensions {
Height: Value { |
<|file_name|>Npc.js<|end_file_name|><|fim▁begin|>import Objects from './'
import Character from './Character'
import Actions from '../actions'
import Attacks from '../actions/Attacks'
import Dash from '../actions/Dash'
const addMoveAnimations = function () {
Object.keys(this.directions).map(
(direction) => this.... | action: Actions.move,
direction,
speed: 8 |
<|file_name|>first_attempt.py<|end_file_name|><|fim▁begin|># need to pass it a file, where data starts, path to write
# things to import
import sys
import pandas
import scipy
import numpy
from scipy import stats
from scipy.stats import t
# arguments being passed
path_of_file=sys.argv[1]
last_metadata_column=int(sys.... | |
<|file_name|>rrule.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The rrule module offers a small, complete, and very fast, implementation of
the recurrence rules documented in the
`iCalendar RFC <https://tools.ietf.org/html/rfc5545>`_,
including support for caching of results.
"""
import itertools
import ... | |
<|file_name|>ExpressionParser.java<|end_file_name|><|fim▁begin|>/*****************************************************************************
* Copyright (C) jparsec.org *
* ------------------------------------------------------------------------- *
* Licensed under th... | TerminalParser.QUALIFIED_NAME, paren(param.sepBy(TerminalParser.term(","))),
FunctionExpression::new);
}
|
<|file_name|>test_url_middleware.py<|end_file_name|><|fim▁begin|># Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/... | def setUp(self):
self.middleware = middleware.NormalizingFilter(FakeApp())
self.response_status = None
self.response_headers = None |
<|file_name|>statuses.js<|end_file_name|><|fim▁begin|>define(['config', 'folders'], function (config, folders) {
var wrikeStates = { 'active': 0, 'completed': 1, 'deferred': 2, 'cancelled': 3 };
var statusFolders = folders.getSubfolders(config.statusFolder)
, statuses = {}
, statusesById = {};
$.each(st... | val.powerWrike.wrikeState = wrikeState;
statuses[val.powerWrike.uniquePath] = statusesById[val.id] = val; |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from urllib.parse import urlparse
from django.conf import settings
from django.core.files.storage import default_storage
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from api.applications.models import ShowApplicationSetti... | |
<|file_name|>rule_solver.go<|end_file_name|><|fim▁begin|>// Copyright 2016 The Cockroach Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/... | |
<|file_name|>startup.py<|end_file_name|><|fim▁begin|># encoding: utf-8
#
#
# 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/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.... | except IOError: |
<|file_name|>SerialPortChoice.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#
# EventGhost is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License... | |
<|file_name|>adapter_literotica.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2013 Fanficdownloader team, 2015 FanFicFare 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 Lice... | @classmethod |
<|file_name|>test_ioctl.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)]
// Simple tests to ensure macro generated fns compile
ioctl!(do_bad with 0x1234);
ioctl!(none do_none with 0, 0);
ioctl!(read read_test with 0, 0; u32);
ioctl!(write write_test with 0, 0; u64);
ioctl!(readwrite readwrite_test with 0, 0; u64);... | #[test]
fn test_op_read() {
assert_eq!(ior!(b'z', 10, 1), 0x40017A0A); |
<|file_name|>labelallow_test.go<|end_file_name|><|fim▁begin|>package stages
import (
"testing"
"time"
"github.com/prometheus/common/model"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
ww "github.com/weaveworks/common/server"
util_log "github.com/grafana/loki/pkg/util/log"
)
func... | config: &LabelAllowConfig{"testLabel1", "testLabel2"},
inputLabels: model.LabelSet{
"testLabel1": "testValue", |
<|file_name|>test_task_manager.py<|end_file_name|><|fim▁begin|># Copyright (c) 2017, John Skinner
import unittest
import unittest.mock as mock
import bson
import pymongo.collection
import database.client
import batch_analysis.task_manager as manager
import batch_analysis.tasks.import_dataset_task as import_dataset_tas... | self.assertEqual(s_task, mock_db_client.deserialize_entity.call_args[0][0])
self.assertEqual(mock_entity, result) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
Turn entities to and fro various representations.
This is the base Class and interface Class used to
transform strings of various forms to model objects
and model objects to strings of various forms.
"""
from tiddlyweb.serializer import NoSerializationError
fr... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Tifflin OS - Userland loader
// - By John Hodge (thePowersGang)
//
// elf/mod.rs
// - ELF Parser
use syscalls::vfs::{File,FileOpenMode};
use syscalls::vfs::Error as VfsError;
use std::io::{Read,Seek,SeekFrom};
use load::{Segment,SegmentProt};
#[derive(Debug)]
pub ... | }
pub fn load_segments(&mut self) -> LoadSegments<R> {
LoadSegments( self.phents() ) |
<|file_name|>purchase_order.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
#
# Author: Yannick Vaucher
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Fre... | """ """
requisition = self.order_id.requisition_id
date = requisition.date_exchange_rate or fields.Date.today() |
<|file_name|>qdvgrabressources_rc.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.15.0)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x23\x1c\
\x89\
\x50\x4e\x47\x... | \xff\xa9\x8f\x04\x4c\xcd\xe3\x7e\x58\xf2\x4d\x1c\xa1\xad\x26\x01\
\xad\x5e\x46\x79\x47\x90\x08\x2b\x05\x92\xe0\xe4\x4b\x60\xcd\x6e\
\xf1\x8c\x10\xbe\x06\xe4\x27\x04\x80\x8f\x44\xea\xbc\x6d\x42\xcb\
\x4a\x6a\x31\x18\x14\xe9\x02\x68\xc0\x21\x4a\xfd\x9b\xeb\x27\xd6\ |
<|file_name|>random.rs<|end_file_name|><|fim▁begin|>use crate::common::{rational_to_bigrational, rational_to_rug_rational};
use malachite_base::num::basic::integers::PrimitiveInt;
use malachite_base::num::basic::signeds::PrimitiveSigned;
use malachite_base::num::basic::unsigneds::PrimitiveUnsigned;
use malachite_base::... | config.get_or("mean_bits_d", 1), |
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>"""
core/api/serializers.py is the module for core model api data serializers
"""
#import core django module
from django.contrib.auth.models import User, Permission
#import external modules
from rest_framework import serializers
#import project modules
fro... | class Meta:
model = ProductCategory
|
<|file_name|>sdk.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
import hashlib
import base64
import datetime
import urllib2
import json
class TemplateSMS:
account_sid = ''
account_token = ''
app_id = ''
server_ip = ''
server_port = ''
soft_version = ''
timestamp = ''
def set_... | except:
return {"statusCode": '172001'} |
<|file_name|>Region.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.core.region;
import java.util.Set;
import org.joda.beans.impl.flexi.FlexiBean;
import org.threeten.bp.Zo... | * This bundle stores the set of these external identifiers. |
<|file_name|>ToneAudioBuffers.ts<|end_file_name|><|fim▁begin|>import { Tone } from "../Tone";
import { optionsFromArguments } from "../util/Defaults";
import { noOp } from "../util/Interface";
import { isString } from "../util/TypeCheck";
import { ToneAudioBuffer } from "./ToneAudioBuffer";
import { assert } from "../u... | |
<|file_name|>makeDummyReport.js<|end_file_name|><|fim▁begin|>/*
* Copyright 2016(c) The Ontario Institute for Cancer Research. All rights reserved.
*
* This program and the accompanying materials are made available under the terms of the GNU Public
* License v3.0. You should have received a copy of the GNU General ... | |
<|file_name|>ContainerWarehouseStorage.java<|end_file_name|><|fim▁begin|>package net.shadowmage.ancientwarfare.automation.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minec... | * need to loop through this.itemMap and compare quantities to warehouse.itemMap
* add any changes to change-list
|
<|file_name|>counter.test.js<|end_file_name|><|fim▁begin|>'use strict';<|fim▁hole|>
const Bluebird = require('bluebird');
const Book = require('./helpers/book');
const Counter = require('../lib/counter');
const Genre = require('./helpers/genre');
const Redis = require('./helpers/redis');
describe('counter', ()... | |
<|file_name|>PermissionBasedAuthorizationImpl.java<|end_file_name|><|fim▁begin|>/********************************************************************************
* Copyright (c) 2019 Stephane Bastian
*
* This program and the accompanying materials are made available under the 2
* terms of the Eclipse Public License... | PermissionBasedAuthorizationImpl other = (PermissionBasedAuthorizationImpl) obj; |
<|file_name|>details.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2006-2008, 2013 Red Hat, Inc.
# Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.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 So... | if self.ignoreDetails:
return
|
<|file_name|>zipfile.py<|end_file_name|><|fim▁begin|>"""Utility functions for handling and fetching repo archives in zip format."""
from __future__ import absolute_import
import os
import tempfile
from zipfile import ZipFile
import requests
try:
# BadZipfile was renamed to BadZipFile in Python 3.2.
from zip... | zip_path = os.path.abspath(zip_uri) |
<|file_name|>xml_handler.js<|end_file_name|><|fim▁begin|>/**
* @file common/js/xml_handler.js
* @brief XE에서 ajax기능을 이용함에 있어 module, act를 잘 사용하기 위한 자바스크립트
**/
// xml handler을 이용하는 user function
var show_waiting_message = true;
/* This work is licensed under Creative Commons GNU LGPL License.
Lice... | }
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|># django imports
from django.db import models
from django.utils.translation import ugettext_lazy as _
# lfs imports
from lfs.catalog.models import Product
from lfs.order.models import Order
class Topseller(models.Model):
"""Selected products are in any case amo... | class Meta:
ordering = ["position"] |
<|file_name|>raw_analysis.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
def test_signal(T=100, fs=1):
dt = 1/fs
x = np.arange(0, T, dt)
y = np.ones(x.shape)
return np.vstack((x,y))
def test_signal1(T=16.0, fs=10.0):
dt = 1/fs
... | #f.savefig(str(file_name)+'.png')
def calculate_distance(position_1, position_2): |
<|file_name|>navDirective.js<|end_file_name|><|fim▁begin|>(function () {
'use strict';
angular
.module('nama.common')
.directive('namaNav', namaNav);
namaNav.$inject = [];
function namaNav() {
return {
restrict: 'E',<|fim▁hole|> controllerAs: 'vm',
bindToController: true,
scope: {
brand: '... | templateUrl: '/nama-framework/common/nav/nav.html',
controller: 'NavController', |
<|file_name|>f045592adab0_add_follow_table.py<|end_file_name|><|fim▁begin|><|fim▁hole|>"""add follow table
Revision ID: f045592adab0
Revises: 56a3d184ac27
Create Date: 2017-10-06 00:38:24.001488
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f045592adab0'
dow... | |
<|file_name|>window.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/. */
//! Off-screen windows.
//!
//! This is used for off-screen re... | Cursor::CopyCursor => "dragCopyCursor",
Cursor::AliasCursor => "dragLinkCursor", |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from enum import Enum, EnumFactory
<|fim▁hole|><|fim▁end|> | __all__ = ["Enum", "EnumFactory"] |
<|file_name|>expectation.cpp<|end_file_name|><|fim▁begin|>/**
* @file expectation.cpp
* @author Chris Vig (chris@invictus.so)
* @date 2016/12/30
*/
/* -- Includes -- */
#include <sstream>
#include <string>
#include <spookshow/spookshow.hpp>
/* -- Namespaces -- */
using namespace spookshow;
/* -- Procedures --... | } |
<|file_name|>permissions.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# ex:set fileencoding=utf-8:
from __future__ import unicode_literals
from django.db.models import Q
# from djangobmf.permissions import ModulePermission
from djangobmf.utils import FilterQueryset
class GoalFilter(FilterQueryset):
def f... | |
<|file_name|>Projects.js<|end_file_name|><|fim▁begin|>import React, { PropTypes } from 'react';
import Page from './Page';
import ProjectListItem from './ProjectListItem';
import AspectContainer from './AspectContainer';
import BannerImage from './BannerImage';
import styles from './Projects.css';
const Projects = ({ ... | <AspectContainer>
<BannerImage url="https://placebear.com/900/1200" />
</AspectContainer> |
<|file_name|>scatt_bg_c.py<|end_file_name|><|fim▁begin|>import ctypes
import numpy as np
import os
libpath = os.path.dirname(os.path.realpath(__file__))
lib = ctypes.cdll.LoadLibrary(libpath+'\libscatt_bg.so')
scatt_bg_c = lib.scatt_bg
scatt_bg_c.restype = ctypes.c_void_p # reset return types. default is c_int
scatt_... | subtend_c.argtypes = [ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double]
|
<|file_name|>render.py<|end_file_name|><|fim▁begin|>from jinja2 import Template
import codecs
def render(file, props=None):
if props == None:
return '404'
with codecs.open('./views/' + file + '.html', 'r', encoding='utf8') as f:
content = f.read()<|fim▁hole|><|fim▁end|> |
templated = Template(content).render(props)
return templated |
<|file_name|>RestAPI.d.ts<|end_file_name|><|fim▁begin|>import ApiManager = require('./ApiManager');
import express = require('express');
import BaseConnector = require('./BaseConnector');
export declare class RestAPI extends BaseConnector.BaseConnector {<|fim▁hole|> resourceUrl: any;
layersUrl: any;
keysUrl:... | server: express.Express;
baseUrl: string;
manager: ApiManager.ApiManager; |
<|file_name|>factory.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless... | |
<|file_name|>chacha20.rs<|end_file_name|><|fim▁begin|>// 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, modified, or distributed
//... | 16 => b"expand 16-byte k",
32 => b"expand 32-byte k",
_ => unreachable!(),
}; |
<|file_name|>packet.go<|end_file_name|><|fim▁begin|><|fim▁hole|> "fmt"
)
// This represents a basic packet.
type Packet struct {
// This represents the node tht the packet should go to. Note that the NodeAddress is in fact a
// public key hash.
Dest NodeAddress
// The Amt is the amount of money in satoshis that wi... | package types
import (
"crypto/sha512" |
<|file_name|>mask_manager.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2021 Google Health Research.
#
# 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... | |
<|file_name|>advanced_settings.py<|end_file_name|><|fim▁begin|># pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import step, world
from cms.djangoapps.contentstore.features.common import press_the_notification_button, type_in_codemirror
KEY_CSS = '.key h3.title'
ADVANCED_MODULES... | |
<|file_name|>StockSpanProblem.java<|end_file_name|><|fim▁begin|>/**
*
*/
package com.kant.datastructure.stacks;
import com.kant.sortingnsearching.MyUtil;
/**
* http://www.geeksforgeeks.org/the-stock-span-problem/ <br/>
*
*
* The stock span problem is a financial problem where we have a series of n... | *
|
<|file_name|>angle.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/. */
//! Computed angles.
use num_traits::Zero;
use std::{f32, f64}... | #[derive(PartialOrd, ToAnimatedZero)]
pub enum Angle { |
<|file_name|>storage.py<|end_file_name|><|fim▁begin|>"""URI API
This file contains the part of the blaze API dealing with URIs. The
"URI API". In Blaze persistence is provided by the means of this URI
API, that allows specifying a "location" for an array as an URI.
The URI API allows:
- saving existing arrays to an ... | where the array is stored. |
<|file_name|>ObservablesMixedHAWP.py<|end_file_name|><|fim▁begin|>"""The WaveBlocks Project
Compute some observables like norm, kinetic and potential energy
of Hagedorn wavepackets. This class implements the mixed case
where the bra does not equal the ket.
@author: R. Bourquin
@copyright: Copyright (C) 2014, 2016 R. ... |
from WaveBlocksND.Observables import Observables |
<|file_name|>client.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
import pickle
import random
import time
import urllib
try:
import xbmc, xbmcgui
except:
pass
from platformcode import config, logger
LIBTORRENT_PATH = config.get_setting("libtorrent_path", server="torrent", de... | self._monitor.add_listener(self.announce_torrent)
|
<|file_name|>nullable-pointer-size.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.apac... | // option. This file may not be copied, modified, or distributed
// except according to those terms. |
<|file_name|>babyparse.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for babyparse
// Project: https://github.com/Rich-Harris/BabyParse
// Definitions by: Charles Parker <https://github.com/cdiddy77>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module BabyParse {
interface Sta... | |
<|file_name|>TestComplexDateTimes.py<|end_file_name|><|fim▁begin|>"""
Test parsing of complex date and times
"""
import unittest, time, datetime
import parsedatetime as pdt
class test(unittest.TestCase):
@pdt.tests.assertEqualWithComparator
def assertExpectedResult(self, result, check, **kwargs):
ret... | |
<|file_name|>NewXmlFileCreationPage.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Eclipse Public License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
... | setMessage(null);
}
} |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>import ConfigParser
import sys, traceback
from slackclient import SlackClient
from chatterbot import ChatBot
import os
from os import listdir
from os.path import isfile, join
from chatterbot.trainers import ChatterBotCorpusTrainer
config = ConfigParser.SafeConfigPa... | print "Starting Chatterbot"
chatbot = ChatBot(bot_name, storage_adapter="chatterbot.adapters.storage.JsonDatabaseAdapter",
logic_adapters=[ |
<|file_name|>elder-http-client.service.ts<|end_file_name|><|fim▁begin|>import {Injectable} from '@angular/core';
import {Page, Pageable} from '../../common/data/page';
import {Filter} from '../../common/data/filter';
import {HttpClient, HttpParams} from '@angular/common/http';
import {LoggerFactory} from '@elderbyte/ts... | * @param pageable The page request
* @param filters The filtersSnapshot request
* @param params Additional parameters |
<|file_name|>sec_auth.cc<|end_file_name|><|fim▁begin|>/* sec_auth.cc: NT authentication functions
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
This file is part of Cygwin.
This software is a copyrighted work licensed under the terms of the
Cyg... | pop_self_privilege (); |
<|file_name|>notosansdevanagari_regular.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
class Charset(object):
common_name = 'NotoSansDevanagari-Regular'
native_name = ''
def glyphs(self):
glyphs = []
glyphs.append(0x0065) #uni0961
glyphs.append(0x0178) #glyph00376
... | glyphs.append(0x02B6) #glyph00694
glyphs.append(0x02B9) #glyph00697
glyphs.append(0x02B8) #glyph00696
glyphs.append(0x02F1) #six |
<|file_name|>ExceptionTranslator.java<|end_file_name|><|fim▁begin|>package com.meetup.agileim.web.rest.errors;
import java.util.List;
import org.springframework.dao.ConcurrencyFailureException;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.AccessDeniedException;
import org.spr... | ErrorDTO dto = new ErrorDTO(ErrorConstants.ERR_VALIDATION);
for (FieldError fieldError : fieldErrors) {
dto.add(fieldError.getObjectName(), fieldError.getField(), fieldError.getCode()); |
<|file_name|>preprocess.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#==============================================================================
# main file for creating apsimRegion experiments
#==============================================================================
import o... |
# create config files |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-isegory',
version='0.1',
packages=['iseg... | 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
], |
<|file_name|>hatoku_hton.cc<|end_file_name|><|fim▁begin|>/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
#ident "$Id$"
/*
COPYING CONDITIONS NOTICE:
This program is free software; you can redistribute it and/or modify
it under the terms of version... | return +1;
else
return 0;
}; |
<|file_name|>lint-plugin-cmdline-load.rs<|end_file_name|><|fim▁begin|>// check-pass
// aux-build:lint-plugin-test.rs
// ignore-stage1
// compile-flags: -Z crate-attr=plugin(lint_plugin_test)
#![feature(plugin)]
fn lintme() { } //~ WARNING item is named 'lintme'
#[allow(test_lint)]
pub fn main() {<|fim▁hole|>}<|fim▁e... | fn lintme() { } |
<|file_name|>oa.py<|end_file_name|><|fim▁begin|>from rdflib import Literal
from classes import ldp
from namespaces import dcterms, oa, rdf
# alias the RDFlib Namespace
ns = oa
# Annotation resources
class Annotation(ldp.Resource):
def __init__(self):
super(Annotation, self).__init__()
self.motiva... | self.content_type = content_type
if len(self.value) <= 25:
self.title = self.value
else: |
<|file_name|>max_pool2d.rs<|end_file_name|><|fim▁begin|>use super::*;
pub struct MaxPool2D {
pub pad: usize,
pub stride: usize,
pub size: usize,
}
pub struct MaxPool2DGrad {
pad: usize,
stride: usize,
size: usize,
}
pub struct MaxPool2DGradGrad {
pad: usize,
stride: usize,
size: u... | indices.set_len(all_len_y); |
<|file_name|>buy-item4.py<|end_file_name|><|fim▁begin|>from clickerft.cft import Cft
from time import sleep
class Suite(Cft):
def test_buy_item_4(self):
while int(self.clicksPerGeneration.text) < 2:
if int(self.clicksOwned.text) < 1:
sleep(.5)
continue
... | assert int(self.oi4.text) == 1
sleep(1) |
<|file_name|>__manifest__.py<|end_file_name|><|fim▁begin|>##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the ... | |
<|file_name|>test_dataset.py<|end_file_name|><|fim▁begin|>from main.dataset import DataSet
import numpy as np
def test_dataset(load_image_data, image_size):
images, labels, ids, cls, _ = load_image_data
dataset = DataSet(images, labels, ids, cls)
assert sorted(list(dataset.cls)) == sorted(['cat', 'dog'... | assert label_batch.shape == (2, 2)
assert label_batch.dtype == np.float64
assert label_batch.min() == float(0) |
<|file_name|>0069_auto_20190915_1605.py<|end_file_name|><|fim▁begin|># pylint: skip-file
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-09-15 20:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('passive_data_kit', '0068_remove_deviceiss... | |
<|file_name|>swizzle.rs<|end_file_name|><|fim▁begin|>use crate::base::allocator::Allocator;
use crate::base::{DefaultAllocator, DimName, Scalar};
use crate::geometry::{Point, Point2, Point3};
use typenum::{self, Cmp, Greater};
macro_rules! impl_swizzle {
($( where $BaseDim: ident: $( $name: ident() -> $Result: ide... | xzz() -> Point3[0, 2, 2],
yxz() -> Point3[1, 0, 2],
yyz() -> Point3[1, 1, 2], |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#![crate_type = "lib"]
#![crate_name = "tests"]
#![feature(custom_de... | mod parse;
mod io;
mod fmt; |
<|file_name|>8_2_average.py<|end_file_name|><|fim▁begin|>total = 0
n = 0
stop = 0
nextMark = input('Type in a mark: ')
while stop == 0:
nextMark = eval(nextMark)
<|fim▁hole|> stop = 1
print("You entered", n, 'marks. The average is:',total/n)<|fim▁end|> | total = total+nextMark
n = n + 1
nextMark = input('Hit enter to stop, or type in a mark: ')
if nextMark == "":
|
<|file_name|>jquery.slider.js<|end_file_name|><|fim▁begin|>/**
* slider - jQuery EasyUI
*
* Copyright (c) 2009-2013 www.jeasyui.com. All rights reserved.
*
* Licensed under the GPL or commercial licenses
* To use it on other terms please contact us: info@jeasyui.com
* http://www.gnu.org/licenses/gpl.txt
... | * Dependencies:
* draggable
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.