prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>views.py<|end_file_name|><|fim▁begin|><|fim▁hole|>def home(request):
return render(request, 'home.html', {})<|fim▁end|> | from django.shortcuts import render
|
<|file_name|>0004_auto__del_logentry.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
pass<|fim▁hole|>
models = {
}
complete_apps = ['admin']<|fim▁end|> |
def backwards(self, orm):
pass |
<|file_name|>testcases.py<|end_file_name|><|fim▁begin|>import re
import unittest
from urlparse import urlsplit, urlunsplit
from xml.dom.minidom import parseString, Node
from django.conf import settings
from django.core import mail
from django.core.management import call_command
from django.core.urlresolvers import cle... | |
<|file_name|>target.rs<|end_file_name|><|fim▁begin|>#[derive(Debug, PartialEq)]<|fim▁hole|> Row(usize),
Column(usize),
}<|fim▁end|> | pub enum Target { |
<|file_name|>randomInt.ts<|end_file_name|><|fim▁begin|>const random = (num: number): number => Math.round(Math.random() * num);
const range = (num: number, num2: number): number => {
if (num2 < num) {
[num, num2] = [num2, num];
}
return random(num2 - num) + num;
};
/**
* Returns a random in... | |
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>from ipfs_connector import IPFSConnector, IPFSConfig
from nn_loader import NNListener, NNLoader
class ProcessorCallback:
pass
class Processor(NNListener):
def __init__(self, callback: ProcessorCallback, ipfs_config: IPFSConfig):
print("Connecting... | class DataInconsistencyError (Exception): |
<|file_name|>Cluster.cpp<|end_file_name|><|fim▁begin|>//
// Cluster.cpp
// ginseng
//
// Created by Daniel Shiposha on 16/03/2018.
//
#include <ginseng/tefri/abstract/Cluster.h>
#include <ginseng/tefri/abstract/Interactor.h>
#include <ginseng/tefri/abstract/Source.h>
#include <ginseng/tefri/Flow.h>
#include <ginse... | bool is_finished = false;
};
|
<|file_name|>subnet_broker.py<|end_file_name|><|fim▁begin|>from ..broker import Broker
class SubnetBroker(Broker):
controller = "subnets"
def show(self, **kwargs):
"""Shows the details for the specified subnet.
**Inputs**
| ``api version min:`` None
| ``api ver... |
:param RouteTimestamp: The date and time that this subnet was last seen on any router. |
<|file_name|>auth.go<|end_file_name|><|fim▁begin|>package main
import (
"errors"
"fmt"
"os"
"github.com/reinbach/go-stash/oauth1"
"github.com/reinbach/go-stash/stash"
)
var (
testURL string
consumerKey string
privateKey string
)
func init() {
testURL = os.Getenv("STASH_URL")
consumerKey = os.Getenv("... | |
<|file_name|>example1.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The cli Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"flag"
"fmt"
"log"
"github.com/zlowram/gocli"
)
func testCmd1Run(tc gocli.Co... | Description: "short description of the subcmd2",
UsageLine: `TestCli subcmd2 [options] {args}
`, |
<|file_name|>lib.py<|end_file_name|><|fim▁begin|>"""Suit + values are ints"""
from random import shuffle
class Card:
suits = ("spades", "hearts", "diamonds", "clubs")
values = (None, None, '2', '3',
'4', '5', '6', '7',
'8', '9', '10',
'Jack','Queen',
'Kin... | def __init__(self, v, s):
self.suite = s |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from . import list<|fim▁end|> | |
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py
try:
from pypy.rpython.test.test_llinterp import interpret
except ImportError:
py.test.skip('Needs PyPy to be on the PYTHONPATH')
from rply import ParserGenerator, Token
from rply.errors import ParserGeneratorWarning
from .base import B... | return BoxInt(int(p[0].getstr()))
parser = pg.build()
|
<|file_name|>multiproc.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Monkey-patching to add multiprocessing support for coverage.py"""
import multiprocessing
import multiproc... | d['stowaway'] = Stowaway(rcfile)
return d
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! The purpose of this library is to provide an OpenGL context on as many
//! platforms as possible.
//!
//! # Building a window
//!
//! There are two ways to create a window:
//!
//! - Calling `Window::new()`.
//! - Calling `let builder = WindowBuilder::new()` then ... | /// Provides a way to retreive events from the windows that are registered to it. |
<|file_name|>signupController.js<|end_file_name|><|fim▁begin|>function SignupController()
{<|fim▁hole|>// redirect to homepage when cancel button is clicked //
$('#account-form-btn1').click(function(){ window.location.href = '/#section-3';});
// redirect to homepage on new account creation, add short delay so user ca... | |
<|file_name|>ace.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for Ace Ajax.org Cloud9 Editor
// Project: http://ace.ajax.org/
// Definitions by: Diullei Gomes <https://github.com/Diullei>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module AceAjax {
export interface Delta {
... | |
<|file_name|>APPAAnnounce.java<|end_file_name|><|fim▁begin|>package appalounge;
import org.json.JSONArray;
import org.json.JSONObject;
import resources.Constructors;
import resources.exceptions.ApiException;
import resources.exceptions.AuthRequiredException;
import resources.exceptions.BadRequestException;
import reso... | */ |
<|file_name|>status.py<|end_file_name|><|fim▁begin|>from kubeflow.kubeflow.crud_backend import api, status
def pvc_status(pvc):
"""
Set the status of the pvc
"""
if pvc.metadata.deletion_timestamp is not None:
return status.create_status(status.STATUS_PHASE.TERMINATING,
... | namespace=pvc.metadata.namespace,
field_selector=api.events_field_selector( |
<|file_name|>config.hpp<|end_file_name|><|fim▁begin|>/* Proposed SG14 status_code
(C) 2018-2019 Niall Douglas <http://www.nedproductions.biz/> (5 commits)
File Created: Feb 2018
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtain... |
// 0.28 (0.15 of which is exception_ptr)
#include <exception> // for std::exception
// <new> includes <exception>, <exception> includes <new> |
<|file_name|>FilterPipe.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import {IModel} from "../../../../data/model/IModel";
import {IIterable} from "../../../../data/collection/IIterable";
import {IPredicate} from "../../../../data/predicate/IPredicate";
@Pipe({
name: 'FilterPipe',
pure: false // Force i... | import {Pipe, PipeTransform} from 'angular2/core';
import {ICollection} from "../../../../data/collection/ICollection"; |
<|file_name|>PdcAxisValue.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2000 - 2021 Silverpeas
*
* 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 Free Software Foundation, either version 3 of the
* Lic... | |
<|file_name|>ident.go<|end_file_name|><|fim▁begin|>package astutil
import (
"go/ast"
"github.com/juju/errors"
)
// SameIdent returns true if a and b are the same.
func SameIdent(a, b *ast.Ident) bool {
// TODO(waigani) Don't rely on name, it could change and still be the same
// ident.
if a.String() != b.String... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod listener;
pub use self::listener::TcpListener;
mod socket;
pub use self::socket::{TcpKeepalive, TcpSocket};
<|fim▁hole|><|fim▁end|> | mod stream;
pub use self::stream::TcpStream; |
<|file_name|>login.component.ts<|end_file_name|><|fim▁begin|>import { Component, AfterViewInit, OnInit, ElementRef } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { AuthenticationService } from '../shared/authentication/index';
declare const fabric: any;
/**
* This class repr... | }
} |
<|file_name|>empty.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This is an empty file with a .cc extension, to convince the toolchain
// (I'm looking at YOU, Xc... | // belongs to as C++. |
<|file_name|>commands.py<|end_file_name|><|fim▁begin|>############################################################################
# Joshua Boverhof<JRBoverhof@lbl.gov>, LBNL
# Monte Goode <MMGoode@lbl.gov>, LBNL
# See Copyright for copyright notice!
#####################################################################... | |
<|file_name|>table-column.type.d.ts<|end_file_name|><|fim▁begin|>import { PipeTransform } from '@angular/core';
import { ValueGetter } from '../utils/column-prop-getters';
/**
* Column property that indicates how to retrieve this column's
* value from a row.
* 'a.deep.value', 'normalprop', 0 (numeric)
*/
export dec... | * @memberOf TableColumn |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
<|fim▁hole|>
class FileuploadConfig(AppConfig):
name = 'fileupload'<|fim▁end|> | |
<|file_name|>llallocator_test.cpp<|end_file_name|><|fim▁begin|>/**
* @file llallocator_test.cpp
* @author Brad Kittenbrink
* @date 2008-02-
* @brief Test for llallocator.cpp.
*
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*... | #endif // LL_USE_TCMALLOC |
<|file_name|>routes.js<|end_file_name|><|fim▁begin|>/**
# @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
##############################################################################
# Copyright (c) 2016 The Linux Foundation and others.
#
# All rights reserved. This program and the accompanying materials
# are ma... | |
<|file_name|>PASER_Neighbor_Entry.cc<|end_file_name|><|fim▁begin|>/*
*\class PASER_Neighbor_Table
*@brief Class represents an entry in the neighbor table
*
*\authors Eugen.Paul | Mohamad.Sbeiti \@paser.info
*
*\copyright (C) 2012 Communication Networks Institute (CNI - Prof. Dr.-Ing. Christian W... | * This program is free software; you can redistribute it |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>// index.js
import {
LocalStateForm,
SimpleValidation
} from 'immutable-react-form';
import Form from './form';
import validation from './validation';
import {GetData,UpdateData} from './data';
export default LocalStateForm(<|fim▁hole|> props => (GetData()),
v... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>macro_rules! mk_test {
($name: ident,
[$($input: ident = $t: ty),*],
{$($expr: stmt);*},
$sort: expr,
$check: expr
) => {<|fim▁hole|> $check
}
}
}
use super::*;
mod sorted;
mod stability;<|fim▁end|> | #[quickcheck]
fn $name($($input: $t),*) -> bool{
$($expr);*;
$sort; |
<|file_name|>numbers.go<|end_file_name|><|fim▁begin|>/* Package declaration, golite 2.2 */
package main
/* Append, golite 2.9.7 */
/* Switch statements, golite 2.8.10 */
func funky(n int) {
var s0 []int
s0 = append(s0, 1)
s0 = append(s0, 1%5)
s1 := append(s0, 2)
s2 := append(s1, 3+5)
switch n {
default:
pr... | println(z) |
<|file_name|>frets.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
from colorama import Fore, Back
class frets:
tuning = list()
max_string_name_len = 0;
frets_count = 0;
strings = dict()
NOTES = ('E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B', 'C', 'C#', 'D', 'D#')
def __init__(self,
... | ' Found octave-higher note {} on: {}'.format(upper_seek_note,
upper_found_position))
print(Back.RED + ' ' + Back.BLACK + \
' Found note {} on: {}'.format(seek_note, |
<|file_name|>ValidStringResult.java<|end_file_name|><|fim▁begin|>package org.allmyinfo.result;
import org.eclipse.jdt.annotation.NonNull;
public final class ValidStringResult implements StringResult<|fim▁hole|>{
private final String value;
public ValidStringResult(final @NonNull String value)
{
this.value = val... | |
<|file_name|>number.js<|end_file_name|><|fim▁begin|>/*
* Should
* Copyright(c) 2010-2014 TJ Holowaychuk <tj@vision-media.ca>
* MIT Licensed
*/
module.exports = function(should, Assertion) {
/**
* Assert given object is NaN
* @name NaN
* @memberOf Assertion
* @category assertion numbers
* @example... | this.params = { operator: 'to be above ' + n, message: description };
this.assert(this.obj > n); |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>#-*- encoding: utf-8 -*-
from django.contrib.auth import authenticate, login, logout
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response, RequestContext, render
from membro_profile.forms import MembroForm, MembroP... | return HttpResponseRedirect('%s'%(reverse('profile')))
|
<|file_name|>otp_to_ott.py<|end_file_name|><|fim▁begin|>""" Convert an OpenTripPlanner json itinerary response into something that's more suitable for rendering via a webpage
"""
import re
import sys
import math
from decimal import *
import datetime
from datetime import timedelta
import simplejson as json
from ott.uti... |
def get_selected_itinerary(self, params, max=3): |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "alert.h"
#include "ch... | return pindex;
}
unsigned int GetNextTargetRequired(const CBlockIndex* pindexLast, bool fProofOfStake) |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (https://cubicerp.com).
{
"name": "Bolivia - Accounting",
"version": "2.0",
"description": """
Bolivi... | "account_tax.xml",
"account_chart_template.yml",
], |
<|file_name|>personal-messaging.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MaterialModule, MdButtonModule, MdCheckboxModule } from '@angular/material';
<|fim... | import { NewPersonalMessageComponent } from './new-personal-message/new-personal-message.component';
import { ReadPersonalMessageComponent } from './read-personal-message/read-personal-message.component';
|
<|file_name|>DataObjectHttpUtils.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright 2007-2013 See AUTHORS file.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the ... | * See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
|
<|file_name|>utils.js<|end_file_name|><|fim▁begin|>/*jshint strict: false */
/*global chrome */
var merge = require('./merge');
exports.extend = require('pouchdb-extend');
exports.ajax = require('./deps/ajax');
exports.createBlob = require('./deps/blob');
exports.uuid = require('./deps/uuid');
exports.getArguments = re... | return atob(str); |
<|file_name|>ProxyManagerHandler.py<|end_file_name|><|fim▁begin|>""" ProxyManager is the implementation of the ProxyManagement service in the DISET framework
.. literalinclude:: ../ConfigTemplate.cfg
:start-after: ##BEGIN ProxyManager:
:end-before: ##END
:dedent: 2
:caption: ProxyManager op... | |
<|file_name|>randomuserid.py<|end_file_name|><|fim▁begin|>import string
from random import choice
from django.contrib.auth.models import User
def get_random_id():
valid_id = False
test_name = 'EMPTY'
while valid_id is False:
s1 = ''.join([choice(string.ascii_uppercase) for i in range(2)])
s... | valid_id = True
return test_name |
<|file_name|>_optable.py<|end_file_name|><|fim▁begin|>OperandLookupTable = b''.join([
b'\x81\xbd\x81\xbd\x41\x7d\x00\x00\x81\xbd\x81\xbd\x41\x7d\x00\x00'
b'\x81\xbd\x81\xbd\x41\x7d\x00\x00\x81\xbd\x81\xbd\x41\x7d\x00\x00'
b'\x81\xbd\x81\xbd\x41\x7d\x00\x00\x81\xbd\x81\xbd\x41\x7d\x00\x00'
b'\x81\xbd\x81... | b'\x84\x84\x84\x84\x84\x84\x84\x84\x84\x84\x84\x90\x84\x84\x84\x84' |
<|file_name|>CircularQueue.java<|end_file_name|><|fim▁begin|>package eiko.collections;
<|fim▁hole|>
@SuppressWarnings("unchecked")
public CircularQueue() {
elements = (E[]) new Comparable[START_SIZE];
size = 0;
start = 0;
stop = 0;
}
public void enqueue(E element) {
check_size(size+1);
e... | public class CircularQueue<E extends Comparable<? super E>>
extends AbstractCircularArray<E> {
|
<|file_name|>task3.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from bdchecker.api import NewDatabaseTaskChecker
from bdcheckerapp.autograding.zaj5.unit5.utils import Zaj5TaskChecker, UserList
class TaskChecker(NewDatabaseTaskChecker):
display_stdout = True
class TestSuite(Zaj5TaskChecker):
... | |
<|file_name|>ECMQVBasicAgreement.java<|end_file_name|><|fim▁begin|>package repack.org.bouncycastle.crypto.agreement;
import repack.org.bouncycastle.crypto.BasicAgreement;
import repack.org.bouncycastle.crypto.CipherParameters;
import repack.org.bouncycastle.crypto.params.ECDomainParameters;
import repack.org.bouncycas... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate libc;
extern crate llvm_sys;
extern crate argparse;
extern crate typed_arena;
macro_rules! cstr {
($s:expr) => (
concat!($s, "\0").as_ptr() as *const ::libc::c_char
)
}
macro_rules! fl {
() => ((file!(), line!()));
(line:$expr) => ... |
let mut name = "".to_owned(); |
<|file_name|>Commandworkbench.java<|end_file_name|><|fim▁begin|>package net.ess3.commands;
import net.ess3.api.IUser;
public class Commandworkbench extends EssentialsCommand
{<|fim▁hole|> @Override
public void run(final IUser user, final String commandLabel, final String[] args) throws Exception
{
user.getPlayer... | |
<|file_name|>ModalAddhubCtrl.js<|end_file_name|><|fim▁begin|>'use strict'
angular
.module('softvApp')
.controller('ModalAddhubCtrl', function (clusterFactory, tapFactory, $rootScope, areaTecnicaFactory, $uibModalInstance, opcion, ngNotify, $state) {
function init() {
if (opcion.opcion === 1) {
vm... | |
<|file_name|>monkey_playback.py<|end_file_name|><|fim▁begin|><!DOCTYPE html>
<html lang="en" class="">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# object: http://ogp.me/ns/object# article: http://ogp.me/ns/article# profile: http://ogp.me/ns/profile#">
<meta charset='utf-8'>
<link crosso... | <div class="container">
<nav class="reponav js-repo-nav js-sidenav-container-pjax"
itemscope |
<|file_name|>connection.go<|end_file_name|><|fim▁begin|>package automation
// Copyright (c) Microsoft and contributors. 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... | autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
} |
<|file_name|>manager.py<|end_file_name|><|fim▁begin|># Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except i... |
LOG.info(_("Starting volume driver %(driver_name)s (%(version)s)") % |
<|file_name|>expected_echo_generated_code.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import sys
MOD = 123 # type: int
YES = "yes" # type: str
NO = "NO" # type: str
def solve(N: int, M: int, H: "List[List[str]]", A: "List[int]", B: "List[float]", Q: int, X: "List[int]"):
print(N, M)
assert len(... | assert len(A) == N - 1
assert len(B) == N - 1
for i in range(N - 1): |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/*
use std::fmt;
use std::io::{self, Write};
use std::marker::PhantomData;
use std::sync::mpsc;
use url::Url;
use tick;
use time::now_utc;
use header::{self, Headers};
use http::{self, conn};
use method::Method;
use net::{Fresh, Streaming};
use status::StatusCode;
use ... | });
trace!("Http11Message.reader = {:?}", self.reader);
|
<|file_name|>union-transmute.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org... | // except according to those terms.
// run-pass
|
<|file_name|>AlloyRimsCarItem.java<|end_file_name|><|fim▁begin|>package spiridon.carorder.caritems;
public class AlloyRimsCarItem extends CarItem {
@Override
public double getPrice() {
return 100;
}
@Override<|fim▁hole|> return "Jante Aliaj";
}
}<|fim▁end|> | public String getName() {
// TODO Auto-generated method stub |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|># ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICE... | # Import all fixtures from PyInstaller into the tests.
from PyInstaller.utils.conftest import * |
<|file_name|>asm.rs<|end_file_name|><|fim▁begin|>/// Breakpoint
pub fn bkpt() {
unsafe {
asm!("bkpt" :::: "volatile");
}
}
/// NOP
pub fn nop() {
unsafe {
asm!("nop" :::: "volatile");
}
}
<|fim▁hole|> asm!("wfi" :::: "volatile");
}
}<|fim▁end|> | /// Wait for interrput
pub fn wfi() {
unsafe { |
<|file_name|>router.rs<|end_file_name|><|fim▁begin|>//! Routing entity for handling endpoints
//!
//! This module is intended for matching and converting a passed URLs by a client
//! in request into certain queue/topic names.
//!
use std::clone::Clone;
use std::collections::HashMap;
use crate::engine::router::endpoi... | let endpoints = extract_endpoints(config);
Box::new(Router::new(endpoints))
}
|
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2012-2016 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as pu... | |
<|file_name|>trailer.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
zen Add-on
Copyright (C) 2016 zen
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, either version ... | |
<|file_name|>director.js<|end_file_name|><|fim▁begin|>var Bookshelf = require('../config/bookshelf');
var Director = Bookshelf.Model.extend({
tableName: 'directors',
movies: function() {<|fim▁hole|> },
virtuals: {
fullName: function () {
'use strict';
return this.get('firstName') + ' '... | 'use strict';
return this.hasMany('Movie', 'directorID'); |
<|file_name|>signals.cc<|end_file_name|><|fim▁begin|>// Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apac... | const std::set<int>* unhandled_signals) {
return InstallHandlers( |
<|file_name|>test_stack_resources.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<|fim▁hole|># http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # a copy of the License at
# |
<|file_name|>FileDataView.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from PyQt4 import QtCore, QtGui
from acq4.util.DataManager import *
#import acq4.Manager as Manager
import acq4.pyqtgraph as pg
#from acq4.pyqtgraph.MultiPlotWidget import MultiPlotWidget<|fim▁hole|>import acq4.util.metaarray as metaarra... | #from acq4.pyqtgraph.ImageView import ImageView
from acq4.util.DictView import * |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from f6a_tw_crawler.constants import *
import unittest
import logging
<|fim▁hole|>
def teardown():
pass<|fim▁end|> |
def setup():
pass
|
<|file_name|>circuitpython.py<|end_file_name|><|fim▁begin|>"""
A mode for working with Circuit Python boards.
Copyright (c) 2015-2017 Nicholas H.Tollervey and others (see the AUTHORS file).
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as pub... | else:
# Not plugged in? Just return Mu's regular workspace directory
# after warning the user. |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for tests project.
"""
from __future__ import unicode_literals
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuit... |
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth", |
<|file_name|>AboutActivity.java<|end_file_name|><|fim▁begin|>package info.bati11.wearprofile;
import android.app.ActionBar;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
public class AboutActivity extends Activity {
... | if (id == android.R.id.home) {
finish(); |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate lazy_static;
extern crate regex;
use std::io;
use std::io::prelude::*;
use std::str::FromStr;
use std::fmt;
use regex::Regex;
#[derive(Debug)]
struct ParseErr;
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
enum Instruction {
Rect(usiz... | assert_eq!(format!("{}", screen),
"#.#....\n\
###....\n\ |
<|file_name|>config.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Redistribution and use of this source code is licensed under
# the BSD license. See COPYING file for license description.
import os
import sys
sys.path.insert(0, os.path.join(os.path.split(__file__)[0], '..'))<|fim▁end|> | #!/usr/bin/env python
#
# Copyright 2011, Toru Maesaka
# |
<|file_name|>FixedWindowWidget.hpp<|end_file_name|><|fim▁begin|>/*
Copyright_License {
XCSoar Glide Computer - http://www.xcsoar.org/
Copyright (C) 2000-2016 The XCSoar Project
A detailed list of copyright holders can be found in the file "AUTHORS".
This program is free software; you can redistribute it and/o... |
#endif |
<|file_name|>test_ensurepip.py<|end_file_name|><|fim▁begin|>import unittest
import os
import os.path
import contextlib
import sys
import test._mock_backport as mock
import test.test_support
import ensurepip
import ensurepip._uninstall
class TestEnsurePipVersion(unittest.TestCase):
def test_returns_version(self)... | self.assertFalse(self.run_pip.called)
def test_basic_bootstrapping(self): |
<|file_name|>formatters.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import logging
# CUSTOM LOG LEVELS
LOG_LEVEL_TOOL = 25
# Terminal colors
TERMINAL_COLOR_BLUE = '\033[94m'
TERMINAL_COLOR_GREEN = '\033[92m'
TERMINAL_COLOR_YELLOW = '\033[93m'
TERMINAL_COLOR_RED = '\033[91m'
TERMINAL_COLOR_END = '\033[0m'
... | self._fmt = self.error_fmt
elif record.levelno == logging.WARN:
self._fmt = self.warn_fmt |
<|file_name|>idatabase.py<|end_file_name|><|fim▁begin|>#import coin
class IDatabase:<|fim▁hole|><|fim▁end|> | def enter_coin(coin):
raise Exception('NotImplementedError') |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls.defaults import *
urlpatterns = patterns('contrib.karma.views',<|fim▁hole|><|fim▁end|> | (r'^$', 'index'),
(r'index', 'index'),
) |
<|file_name|>Encryptor.cpp<|end_file_name|><|fim▁begin|>#include "Encryptor.hpp"
#include "Global.hpp"
#include <string>
#ifdef ANDROID_PLATFORM
#include <jni.h>
#include <android_native_app_glue.h>
#endif
using namespace std;
namespace MPACK
{
namespace Encryptor
{
#ifdef ANDROID_PLATFORM
static ANativeActivit... | std::vector<unsigned char> Decrypt(std::vector<unsigned char> param)
{
Init();
return callVectoryByteJavaFunctionVectorByte("decrypt", param); |
<|file_name|>autorizada.js<|end_file_name|><|fim▁begin|>var mongoose = require('mongoose');
var u = require('../utils');
var autorizadaSchema = new mongoose.Schema({
nome: String,
cpf: { type: String, unique: true },
celular: String,
dtInicial: Date,
dtFinal: Date,
autorizador: String,
apto... | [{
nome: 'Mickey', |
<|file_name|>20140715214934_26d9c9c91542_add_cycletaskgroupobject_object.py<|end_file_name|><|fim▁begin|># Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Add CycleTaskGroupObject.object
Revision ID: 26d9c9c91542
Revises: 19a67dc67c3
Create Date: 2014-... | cycle_task_group_objects.object_type = task_group_objects.object_type;
''')
|
<|file_name|>bubble.py<|end_file_name|><|fim▁begin|>'''
Bubble
======
.. versionadded:: 1.1.0
.. image:: images/bubble.jpg
:align: right
The Bubble widget is a form of menu or a small popup where the menu options
are stacked either vertically or horizontally.
The :class:`Bubble` contains an arrow pointing in th... |
.. versionadded:: 1.6.0 |
<|file_name|>unparse.py<|end_file_name|><|fim▁begin|>"Usage: unparse.py <path to source file>"
import sys
import ast
import cStringIO
import os
# Large float and imaginary literals get turned into infinities in the AST.
# We unparse those infinities to INFSTR.
INFSTR = "1e" + repr(sys.float_info.max_10_exp + 1)
def i... | return True
else: |
<|file_name|>Session.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
*
* 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; either version... | } |
<|file_name|>server.rs<|end_file_name|><|fim▁begin|>//
// Copyright 2022 The Project Oak Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/L... | );
while !handshaker.is_completed() {
let incoming_message = request_stream.next()
.await |
<|file_name|>perfect-numbers.spec.js<|end_file_name|><|fim▁begin|>import PerfectNumbers from './perfect-numbers';
describe('Exercise - Perfect Numbers', () => {
const perfectNumbers = new PerfectNumbers();
describe('Perfect Numbers', () => {
it('Smallest perfect number is classified correctly', () => {
... | it('Medium abundant number is classified correctly', () => { |
<|file_name|>AwsS3BucketLoggingConfiguration.cpp<|end_file_name|><|fim▁begin|>/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/securityhub/model/AwsS3BucketLoggingConfiguration.h>
#include <aws/core/utils/json/JsonSerializer.h>
#inclu... | |
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import hashlib
import random
from rest_framework import serializers
from sita.users.models import User
from sita.subscriptions.models import Subscription
from sita.utils.refresh_token import create_token
from hashlib import md5
from datet... |
def validate(self, data):
"""
Validation email and active status |
<|file_name|>OOMPpart_HESH_03_L_STAN_01.py<|end_file_name|><|fim▁begin|>import OOMP
newPart = OOMP.oompItem(9019)
newPart.addTag("oompType", "HESH")
newPart.addTag("oompSize", "03")
newPart.addTag("oompColor", "L")
newPart.addTag("oompDesc", "STAN")
newPart.addTag("oompIndex", "01")<|fim▁hole|>
OOMP.parts.append(newPa... | |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>webpackJsonp([0],{
/***/ 109:
/***/ (function(module, exports) {
function webpackEmptyAsyncContext(req) {
// Here Promise.resolve().then() is used instead of new Promise() to prevent
// uncatched exception popping up in devtools
return Promise.resolve().then(functi... | __WEBPACK_IMPORTED_MODULE_2__app_component__["a" /* MyApp */],
__WEBPACK_IMPORTED_MODULE_3__pages_about_about__["a" /* AboutPage */],
__WEBPACK_IMPORTED_MODULE_4__pages_contact_contact__["a" /* ContactPage */], |
<|file_name|>client.py<|end_file_name|><|fim▁begin|># server.py -- Implementation of the server side git protocols
# Copryight (C) 2008 Jelmer Vernooij <jelmer@samba.org>
#
# 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... | :param pack_data: Callback called for each bit of data in the pack
:param progress: Callback for progress reports (strings) |
<|file_name|>config.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|>
module.exports = _.extend(
require('./env/all'),
require('./env/' + process.env.NODE_ENV) || {}
);<|fim▁end|> | var _ = require('underscore'); |
<|file_name|>room_participant_subscribed_track.py<|end_file_name|><|fim▁begin|># coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceCont... | :rtype: unicode
""" |
<|file_name|>SharePlatform.java<|end_file_name|><|fim▁begin|>package com.beanu.l2_shareutil.share;
import androidx.annotation.IntDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;<|fim▁hole|>
public class SharePlatform {
@IntDef({ DEFAULT, QQ, QZONE, WEIBO, WX, WX_TIMELINE })... |
/**
* Created by shaohui on 2016/11/18.
*/ |
<|file_name|>test_core_additions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""QGIS Unit tests for core additions
.. note:: 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; either version... | metaEnumFromValue(QgsMapLayer.LayerType)
|
<|file_name|>BaseDataSubscriber.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be... | |
<|file_name|>Three.js<|end_file_name|><|fim▁begin|>import './polyfills.js';
export { WebGLRenderTargetCube } from './renderers/WebGLRenderTargetCube.js';
export { WebGLRenderTarget } from './renderers/WebGLRenderTarget.js';
export { WebGLRenderer } from './renderers/WebGLRenderer.js';
// export { WebGL2Renderer } from... | export { BufferGeometryLoader } from './loaders/BufferGeometryLoader.js';
export { DefaultLoadingManager, LoadingManager } from './loaders/LoadingManager.js';
export { JSONLoader } from './loaders/JSONLoader.js'; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.