prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>DBIndex.java<|end_file_name|><|fim▁begin|>package com.github.esadmin.meta.model; import java.util.Date; import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax....
<|file_name|>upstart_test.go<|end_file_name|><|fim▁begin|>// Copyright 2012, 2013 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package upstart_test import ( "fmt" "io/ioutil" "os" "path/filepath" "testing" gc "launchpad.net/gocheck" jc "launchpad.net/juju-core/testing/checkers" ...
func (s *UpstartSuite) assertInstall(c *gc.C, conf *upstart.Conf, expectEnd string) { expectContent := expectStart + expectEnd expectPath := filepath.Join(conf.InitDir, "some-service.conf")
<|file_name|>component.js<|end_file_name|><|fim▁begin|>import React from 'react'; import { combineReducers } from 'redux'; import { connect } from 'react-redux';<|fim▁hole|>// Count reducer const count = (state = 10, action) => { switch (action.type) { case 'increment': return state + 1; case 'decrement...
<|file_name|>test_openmp.py<|end_file_name|><|fim▁begin|>import unittest from distutils.errors import CompileError from pythran.tests import TestFromDir import os import pythran from pythran.syntax import PythranSyntaxError from pythran.spec import Spec class TestOpenMP(TestFromDir): path = os.path.join(os.path.di...
<|file_name|>test_truncnorm.py<|end_file_name|><|fim▁begin|>import matplotlib.pyplot as plt <|fim▁hole|>def test_truncnorm(): alpha0 = [0, 2] # alpha1 = [2] p = TruncNorm(alpha0=alpha0, alpha1=None, number_of_alpha_levels=7) print(p) print(p.df) print(p.df.values.tolist()) ref = [[0.0, 0.0,...
import numpy as np from phuzzy.mpl import TruncNorm
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2013-2015 ARM Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- # # Copyright (C) 2017 NDP Systèmes (<http://www.ndp-systemes.fr>). # # 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 Soft...
# This program 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. See the
<|file_name|>Abilities.js<|end_file_name|><|fim▁begin|>import React from 'react'; import Wrapper from 'common/Wrapper'; import SPELLS from 'common/SPELLS'; import SpellLink from 'common/SpellLink'; import CoreAbilities from 'Parser/Core/Modules/Abilities'; import ISSUE_IMPORTANCE from 'Parser/Core/ISSUE_IMPORTANCE'; c...
<|file_name|>base.py<|end_file_name|><|fim▁begin|>__author__ = 'Robbert Harms' __date__ = "2015-04-23" __maintainer__ = "Robbert Harms" __email__ = "robbert.harms@maastrichtuniversity.nl" class DVS(object): def __init__(self, comments, dvs_tables): """Create a new DVS object Args: co...
<|file_name|>pin.py<|end_file_name|><|fim▁begin|>""" This test need a set of pins which can be set as inputs and have no external pull up or pull down connected. """ from machine import Pin import os mch = os.uname().machine if 'LaunchPad' in mch: pin_map = ['GP24', 'GP12', 'GP14', 'GP15', 'GP16', 'GP17', 'GP...
except Exception:
<|file_name|>base.py<|end_file_name|><|fim▁begin|>""" Django settings for lwc project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the pro...
<|file_name|>PlaylistsDialog.js<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2005-2010 Erik Nilsson, software on versionstudio point com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Founda...
// private
<|file_name|>skype_bot2.py<|end_file_name|><|fim▁begin|>from skypebot import * class Skype_Bot: """ This class handles communication with Skype via SkypeBot """ def __init__(self, plugins): self.skype = Skypebot.Skype(Events=self) self.skype.FriendlyName = "Skype Bot Levitan" se...
<|file_name|>pisa_same_entity.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ check same interface phos_binding patterns """ import os import sys import urllib import urllib2 import cPickle as pickle from multiprocessing import Pool def get_entityid(p): pdbid,interface_id,chain1...
if len(v) > 1:
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase, RequestFactory from django.core.urlresolvers import reverse from django.template import Template, Context from django.core.cache import cache from djconfig import confi...
cache.clear() self.user = utils.create_user() self.category = utils.create_category()
<|file_name|>ofctl_v1_2.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache....
ofp.OFPQ_ALL)
<|file_name|>gproc.e.py<|end_file_name|><|fim▁begin|>''' This script demonstrates how to create a periodic Gaussian process using the *gpiso* function. ''' import numpy as np import matplotlib.pyplot as plt from sympy import sin, exp, pi from rbf.basis import get_r, get_eps, RBF from rbf.gproc import gpiso np.random...
# define a periodic RBF using the symbolic expression basis = RBF(expr) # define a Gaussian process using the periodic RBF
<|file_name|>console.rs<|end_file_name|><|fim▁begin|>// Copyright © 2018 Cormac O'Brien // // Permission is hereby granted, free of charge, to any person obtaining a copy of this software // and associated documentation files (the "Software"), to deal in the Software without // restriction, including without limitation...
<|file_name|>lifetime_tok.rs<|end_file_name|><|fim▁begin|>use lifetime_tok_lib::LtTok; extern crate lalrpop_util as __lalrpop_util; mod __parse__Expr { #![allow(non_snake_case, non_camel_case_types, unused_mut, unused_variables, unused_imports)] use lifetime_tok_lib::LtTok; extern crate lalrpop_util as __...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import event_event from . import event_registration<|fim▁hole|>from . import event_type from . import website from . import website_event_menu from . import we...
<|file_name|>test_web.py<|end_file_name|><|fim▁begin|>import csv import json import sys import traceback from six.moves import StringIO import requests import mock import gevent from gevent import wsgi from locust import web, runners, stats from locust.runners import LocustRunner from locust.main import parse_options...
stats.global_stats.clear_all() parser = parse_options()[0] options = parser.parse_args([])[0]
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand import sys class MyTest(TestCommand): def run_tests(self): tests = unittest.TestLoader().dis...
'orm by peewee, form by wtform and query by rest_query.' 'The framework implements custom query api(like this: /?select=id,name&id=gte.20), ' 'save form data, model object serializer, APIMethodView(get, post, put,delete) and errorhandler.'
<|file_name|>controller.js<|end_file_name|><|fim▁begin|>import Ember from 'ember'; import Sortable from 'ui/mixins/sortable'; export default Ember.Controller.extend(Sortable, {<|fim▁hole|> ip: ['displayIp','name','id'], image: ['imageUuid','id'], }, });<|fim▁end|>
sortBy: 'name', sorts: { state: ['stateSort','name','id'], name: ['name','id'],
<|file_name|>listing_8_21.py<|end_file_name|><|fim▁begin|>import sys import os import Image def simpleQuant(): im = Image.open('bubbles.jpg') w,h = im.size for row in range(h): for col in range(w): r,g,b = im.getpixel((col,row))<|fim▁hole|> im.putpixel((col,row),(r,g,b)) i...
r = r // 36 * 36 g = g // 42 * 42 b = b // 42 * 42
<|file_name|>scheduler.cpp<|end_file_name|><|fim▁begin|>/* This file is part of the KDE libraries Copyright (C) 2000 Stephan Kulow <coolo@kde.org> Waldo Bastian <bastian@kde.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library Ge...
<|file_name|>Group.js<|end_file_name|><|fim▁begin|>import React, { PropTypes } from 'react'; import { connect } from 'react-redux'; import GroupPage from './GroupPage.js'; import GroupNotFoundPage from './GroupNotFoundPage.js'; const Group = ({ isValid, groupId }) => (isValid ? <GroupPage groupId={groupId} /> : <Grou...
<|file_name|>server_manager.js<|end_file_name|><|fim▁begin|>var debug = require('util').debug, inspect = require('util').inspect, path = require('path'), fs = require('fs'), exec = require('child_process').exec, spawn = require('child_process').spawn, Connection = require('../../lib/mongodb').Connection, ...
var mongodb = exec(startCmd,
<|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 https://mozilla.org/MPL/2.0/. */ #[macro_use] extern crate lazy_static; #[macro_use] extern crate...
use keyboard_types::KeyboardEvent; use msg::constellation_msg::{InputMethodType, PipelineId, TopLevelBrowsingContextId}; use servo_url::ServoUrl;
<|file_name|>display.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import cv2 import cv2.cv as cv class Display: def setup(self, fullscreen): cv2.namedWindow('proj_0', cv2.WINDOW_OPENGL) if fullscreen: cv2.setWindowProperty('proj_0', cv2.WND_PROP_FULLSCREEN, cv.CV_WINDO...
<|file_name|>test_abiobjects.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Distributed under the terms of the MIT License. import os import warnings from pymatgen.core.structure import Structure from pymatgen.core.units import Ha_to_eV, bohr_to_ang from pymatgen.io.abinit.abiobjects import * from pymatgen.util.testin...
# Copyright (c) Pymatgen Development Team.
<|file_name|>readium_sdk.js<|end_file_name|><|fim▁begin|>// LauncherOSX // // Created by Boris Schneiderman. // Copyright (c) 2012-2013 The Readium Foundation. // // The Readium SDK is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // t...
@static @return {string} version */ version: function() {
<|file_name|>expand.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/lic...
fld.cx.bt_push(ExpnInfo { call_site: attr.span,
<|file_name|>hubitat.go<|end_file_name|><|fim▁begin|>package insteon // HubitatConfiguration contains the Hubitat configuration. type HubitatConfiguration struct { HubURL string `yaml:"hub_url"` } // HubitatEvent represents a Hubitat event. type HubitatEvent struct { Alias string `json:"id"` State LightState `...
}
<|file_name|>normalizeUrl.js<|end_file_name|><|fim▁begin|>function normalizeUrl(url){ // parseUri 1.2.2 // (c) Steven Levithan <stevenlevithan.com> // MIT License function parseUri (str) { var o = parseUri.options, m = o.parser[o.strictMode ? "strict" : "loose"].exec(str), uri = {}, i = 14; whi...
<|file_name|>MeshListener.hpp<|end_file_name|><|fim▁begin|>/* Sirikata Object Host * MeshListener.hpp * * Copyright (c) 2009, Daniel Reiter Horn * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions...
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<|file_name|>description.py<|end_file_name|><|fim▁begin|>""" Helper classes for creating frontend metadata """ class ContactPersonDesc(object): """ Description class for a contact person """ def __init__(self): self.contact_type = None self._email_address = [] self.given_name ...
""" Binds a display name to the given language
<|file_name|>compat.py<|end_file_name|><|fim▁begin|># coding: utf-8 """ Compatibility functions for unified behavior between Python 2.x and 3.x. :author: Alex Grönholm """ from __future__ import unicode_literals, absolute_import import inspect import sys from threading import Thread if sys.version_info[0] < 3: d...
def items(d): return list(d.items())
<|file_name|>point.rs<|end_file_name|><|fim▁begin|>use std::f64::consts::PI; use data::FloatPoint; fn point_f64_f64_(a: &f64, b: &f64) -> FloatPoint { FloatPoint::new(*a, *b) } wrap_2_arg!(point_f64_f64, point_f64_f64_); fn add_fpt_fpt_(a: &FloatPoint, b: &FloatPoint) -> FloatPoint { FloatPoint::new(a.x + b....
let x = *radius * radians.cos();
<|file_name|>instance.d.ts<|end_file_name|><|fim▁begin|>/// <reference types="node" /> import * as fs from 'fs'; import * as ts from 'typescript'; import { Checker } from './checker'; import { CompilerInfo, LoaderConfig, TsConfig } from './interfaces'; export interface Instance { id: number; babelImpl?: any; ...
[key: string]: Instance; }; options: { watch: boolean;
<|file_name|>packet5.py<|end_file_name|><|fim▁begin|>from . import packet class Packet5(packet.Packet): def __init__(self, player, slot): super(Packet5, self).__init__(0x5) self.add_data(player.playerID) self.add_data(slot)<|fim▁hole|> self.add_data(0) # Prefix self.add_st...
self.add_structured_data("<h", 0) # Stack
<|file_name|>dstr-dflt-obj-ptrn-id-get-value-err.js<|end_file_name|><|fim▁begin|><|fim▁hole|>// - src/dstr-binding/obj-ptrn-id-get-value-err.case // - src/dstr-binding/error/gen-func-decl-dflt.template /*--- description: Error thrown when accessing the corresponding property of the value object (generator function decl...
// This file was procedurally generated from the following sources:
<|file_name|>test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 '''Test on server shutdown when a zone transaction is open.''' import psutil from dnstest.libknot import libknot from dnstest.test import Test from dnstest.utils import * t = Test() knot = t.server("knot") zone = t.zone("example.com.") t.link(...
<|file_name|>basic_octdiff_cons.hpp<|end_file_name|><|fim▁begin|>// $flavio.lisboa @ 2017-09-04. // /* * @file basic_octdiff_cons.hpp */ #ifndef adl__oct__cons__basic_octdiff_cons__hpp__ #define adl__oct__cons__basic_octdiff_cons__hpp__ #include <type_traits> #include <string> #include <iosfwd> #include <stdexcept> ...
template <typename ConstantType, typename VarType> class basic_octdiff_cons : public cons_base_<ConstantType, VarType> { private: using superclass_ = cons_base_<ConstantType, VarType>;
<|file_name|>number_arabic.py<|end_file_name|><|fim▁begin|># # This file is part of Dragonfly. # (c) Copyright 2007, 2008 by Christo Butcher # Licensed under the LGPL. # # Dragonfly is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as publi...
set = [int_1_9, int_10_19, int_20_99], ) int_100s = MagnitudeIntBuilder(
<|file_name|>M5.py<|end_file_name|><|fim▁begin|>props.bf_Shank_Dia = 5.0 #props.bf_Pitch = 0.8 # Coarse props.bf_Pitch = 0.5 # Fine props.bf_Crest_Percent = 10<|fim▁hole|>props.bf_Major_Dia = 5.0 props.bf_Minor_Dia = props.bf_Major_Dia - (1.082532 * props.bf_Pitch) props.bf_Hex_Head_Flat_Distance = 8.0 props.bf_Hex_He...
props.bf_Root_Percent = 10
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![allow(unused_imports)] #![allow(dead_code)] #![allow(non_snake_case)] extern crate crypto as rust_crypto; extern crate openssl as ssl; extern crate rand; extern crate rustc_serialize as serialize; extern crate hyper; extern crate num; pub mod crypto; pub mod freq; p...
pub mod util; pub mod vector;
<|file_name|>with-self-in-projection-output-good.rs<|end_file_name|><|fim▁begin|>// build-pass (FIXME(62277): could be check-pass?) // Regression test related to #56288. Check that a supertrait projection (of // `Output`) that references `Self` can be ok if it is referencing a projection (of // `Self::Target`, in this...
// specify both `Target` and `Output` for now.
<|file_name|>065-setselection.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # example setselection.py import pygtk pygtk.require('2.0') import gtk<|fim▁hole|>import time class SetSelectionExample: # Callback when the user toggles the selection def selection_toggled(self, widget, window): if w...
<|file_name|>urlopen.py<|end_file_name|><|fim▁begin|>''' Example dangerous usage of urllib[2] opener functions The urllib and urllib2 opener functions and object can open http, ftp, and file urls. Often, the ability to open file urls is overlooked leading to code that can unexpectedly open files on the local server. T...
six.moves.urllib.request.urlretrieve('file:///bin/ls', '/bin/ls2')
<|file_name|>test.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/licenses/L...
} extern { // name probably doesn't need to be mut, but the C function doesn't specify const fn sysctl(name: *mut libc::c_int, namelen: libc::c_uint,
<|file_name|>truncate_fasta_qual_files.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # File created Sept 29, 2010 from __future__ import division __author__ = "William Walters" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["William Walters", "Greg Caporaso"] __license__ = "GPL" __version__...
# Get output filepaths fasta_out_fp, qual_out_fp = get_output_filepaths(output_dir, fasta_fp, qual_fp)
<|file_name|>test_integration.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import from sentry.identity.vsts import VSTSIdentityProvider from sentry.integrations.exceptions import IntegrationError from sentry.integrations.vsts import VstsIntegration, VstsIntegrationProvider from sentry.models import...
'AccountId': external_id, }, 'instance': '{}.visualstudio.com'.format(self.vsts_account_name), 'identity': {
<|file_name|>script.js<|end_file_name|><|fim▁begin|>var leaderboard2 = function(data) { return data.data.sort(function(a,b){return b.points-a.points;}); }; function liCreate(name,points) { var li = $('<li>'+name+'</li>'); li.append('<span>'+points+'</span>'); } $(document).ready(function() { // var sorted = l...
//i.e., if/when SUCCESS, execute some code block; if ERROR, execute another. console.log(data); var sorted = leaderboard2(data); for (var i=0; i<sorted.length; i++) {
<|file_name|>rezkonvimporter.cpp<|end_file_name|><|fim▁begin|>/*************************************************************************** * Copyright © 2003 Jason Kivlighn <jkivlighn@gmail.com> * * * * This program is free soft...
#include <kapplication.h> #include <klocale.h>
<|file_name|>TestRe.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import re test = '用户输入的字符串' if re.match(r'用户', test): print('ok') else: print('failed') print('a b c'.split(' ')) print(re.split(r'\s*', 'a b c')) print(re.split(r'[\s\,\;]+', 'a,b;; c d')) m = re.match(r'^(\d{3})-(\d{3,8})$', '01...
print(m.group(2)) print(m.groups())
<|file_name|>regions-close-over-type-parameter-2.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // h...
// Error results because the type of is inferred to be
<|file_name|>t2-random-walks.py<|end_file_name|><|fim▁begin|>""" Trabalho T2 da disciplina Teoria dos Grafos, ministrada em 2014/02 'All Hail Gabe Newell' Alunos: Daniel Nobusada 344443 Thales Eduardo Adair Menato 407976 Jorge Augusto Bernardo ...
) trace_random100b = Bar( x = graphG.nodes(), y = np.squeeze(np.asarray(w_random100b)),
<|file_name|>mock_peernet.go<|end_file_name|><|fim▁begin|>package mocknet import ( "fmt" "math/rand" "sync" ic "github.com/jbenet/go-ipfs/p2p/crypto" inet "github.com/jbenet/go-ipfs/p2p/net" peer "github.com/jbenet/go-ipfs/p2p/peer" context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go...
}
<|file_name|>ModuleAudioTest.java<|end_file_name|><|fim▁begin|>package tranquvis.simplesmsremote.CommandManagement.Modules; /**<|fim▁hole|>}<|fim▁end|>
* Created by Andreas Kaltenleitner on 31.10.2016. */ public class ModuleAudioTest extends ModuleTest {
<|file_name|>azure_rm_servicebusqueue.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (c) 2018 Yuwei Zhou, <yuwzho@microsoft.com> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__...
try: client = self._get_client()
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import from hamcrest.library import *<|fim▁hole|><|fim▁end|>
from hamcrest.core import *
<|file_name|>environment_scoop_test.py<|end_file_name|><|fim▁begin|>__author__ = 'Robert Meyer' try: import scoop except ImportError: scoop = None def scoop_not_functional_check(): if scoop is not None and scoop.IS_RUNNING: print('SCOOP mode functional!') return False else: p...
self.use_pool = False
<|file_name|>register-device.js<|end_file_name|><|fim▁begin|>/** * Copyright 2019, Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICE...
case 'thermostat': configValue = require('./default-thermostat.json'); break;
<|file_name|>service_1.go<|end_file_name|><|fim▁begin|>package main import ( "os" "os/exec" "syscall" )<|fim▁hole|> binary, lookErr := exec.LookPath("service_1.bash") if lookErr != nil { panic(lookErr) } args := []string{""} env := os.Environ() execErr := syscall.Exec(binary, args, env) if execErr != nil ...
func main() {
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django.contrib.auth.decorators import user_passes_test from Aluno.models import Aluno def check_aluno_exist(user): if not user.is_authenticated(): return False try: aluno = user.aluno_set.get()<|fim▁hole|> ...
return True except Aluno.DoesNotExist: return False
<|file_name|>MainActivity.java<|end_file_name|><|fim▁begin|>package com.lee.game; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView...
import java.util.HashMap;
<|file_name|>workflow-controller.spec.js<|end_file_name|><|fim▁begin|>'use strict'; /** * Created by Alex Levshin on 26/11/16. */ var RootFolder = process.env.ROOT_FOLDER; if (!global.rootRequire) { global.rootRequire = function (name) { return require(RootFolder + '/' + name); }; } var restify = re...
describe('.getAll()', function () { it('should get a 200 response', function (done) { adminClient.get(ApiPrefix + '/workflows', function (err, req, res, data) {
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render from django.middleware.csrf import get_token from ajaxuploader.views import AjaxFileUploader from pandora.backends import SignalBasedLocalUploadBackend from pandora.models import Item def home(request): return render(request, ...
import_uploader = AjaxFileUploader(SignalBasedLocalUploadBackend)
<|file_name|>apps.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from __future__ import unicode_literals from django.apps import AppConfig class SequencerConfig(AppConfig): name = 'sequencer'<|fim▁end|>
<|file_name|>dokku-installer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.7 import cgi import json import os import re import SimpleHTTPServer import SocketServer import subprocess import sys import threading VERSION = 'v0.14.6' hostname = '' try: command = "bash -c '[[ $(dig +short $HOSTNAME) ]] && ec...
<|file_name|>010-libphotofloat.js<|end_file_name|><|fim▁begin|>(function() { /* constructor */ function PhotoFloat() { this.albumCache = []; } /* public member functions */ PhotoFloat.prototype.album = function(subalbum, callback, error) { var cacheKey, ajaxOptions, self; if (typeof subalbum.photos !== "un...
break;
<|file_name|>TestModuleLoadedNotifys.py<|end_file_name|><|fim▁begin|>""" Test how many times newly loaded binaries are notified; they should be delivered in batches instead of one-by-one. """ from __future__ import print_function import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import...
total_solibs_removed = 0 total_modules_added_events = 0 total_modules_removed_events = 0 while listener.GetNextEvent(event):
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># Generated by Django 3.0.13 on 2021-05-19 21:21 <|fim▁hole|> class Migration(migrations.Migration): initial = True dependencies = [ ('products', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ope...
from django.conf import settings from django.db import migrations, models import django.db.models.deletion
<|file_name|>localfileview.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009-2010 Zuza Software Foundation # # This file is part of Virtaal. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as p...
<|file_name|>sqLiteProviderTests.js<|end_file_name|><|fim▁begin|>$(document).ready(function () { if (!$data.StorageProviderLoader.isSupported('sqLite')) return; module("sqLiteProviderTest"); test("memberDefinition converter", function(){ $data.EntityContext.extend('$conv.ConverterTest', { ...
}); module("sqLiteProviderTest_in_subselect");
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- """ leap/email/imap/tests/__init__.py ---------------------------------- Module intialization file for leap.mx.tests, a module containing unittesting code, using twisted.trial, for testing leap_mx. @authors: Kali Kaneko, <kali@leap.se> @li...
huKqHYmlCGSliwbrJppTG7jc1/ls3itrK+CWTg4txREkSpEVmfcASvw/ZqLbjgfs
<|file_name|>webData.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <headingcell level=1> # Intercity Python API Development # <codecell> from bs4 import BeautifulSoup import requests import pickle loadSite = requests.get('http://www.intercity.co.nz/') siteData = loadSite.con...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- __title__ = 'pywebtask' __version__ = '0.1.8' __build__ = 0x000108 __author__ = 'Sebastián José Seba' __license__ = 'MIT' __copyright__ = 'Copyright 2016 Sebastián José Seba' from .webtasks import run, run_file # Set default logging handl...
pass logging.getLogger(__name__).addHandler(NullHandler())
<|file_name|>preview.ts<|end_file_name|><|fim▁begin|>import { document, HTMLElement, __STORYBOOK_STORY_STORE__ as storyStore, __STORYBOOK_CLIENT_API__ as clientApi, } from 'global'; import qs from 'qs'; import addons from '@storybook/addons'; import { STORY_CHANGED, SELECT_STORY } from '@storybook/core-events';...
const current = storyStore.fromId(storyId); resolve(generateUrl(toId(kind || current.kind, name)));
<|file_name|>ctaBacktesting.py<|end_file_name|><|fim▁begin|># encoding: UTF-8 ''' 本文件中包含的是CTA模块的回测引擎,回测引擎的API和CTA引擎一致, 可以使用和实盘相同的代码进行回测。 ''' from datetime import datetime, timedelta from collections import OrderedDict from itertools import product import pymongo # import MySQLdb import json import os import cPickle ...
self.tradeCount = 0 # 成交编号 self.tradeDict = OrderedDict() # 成交字典
<|file_name|>test_rotation.rs<|end_file_name|><|fim▁begin|>extern crate mp4parse_capi; use std::io::Read; use mp4parse_capi::*; extern fn buf_read(buf: *mut u8, size: usize, userdata: *mut std::os::raw::c_void) -> isize { let input: &mut std::fs::File = unsafe { &mut *(userdata as *mut _) }; let mut buf = unsa...
let mut rv = mp4parse_read(parser);
<|file_name|>condition.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2016 Timo Savola. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package condition type C int const ( Eq = C(iota) Ne GeS GtS GeU GtU LeS LtS LeU LtU<|fim▁ho...
OrderedAndEq OrderedAndNe
<|file_name|>NetworkTest.py<|end_file_name|><|fim▁begin|>##################################################################### # -*- coding: iso-8859-1 -*- # # # # Frets on Fire ...
<|file_name|>RegressionTree.py<|end_file_name|><|fim▁begin|># regression tree # input is a dataframe of features # the corresponding y value(called labels here) is the scores for each document import pandas as pd import numpy as np from multiprocessing import Pool from itertools import repeat import scipy import sci...
leaf = {'splittng_feature': None, 'left': None,
<|file_name|>cleanup.py<|end_file_name|><|fim▁begin|>"""Cleanup script.""" from grr.lib import export_utils # After you do this the UI complains a little, but creating a new hunt fixes it. hunts = aff4.FACTORY.Open("aff4:/hunts/") for hunt in hunts.ListChildren():<|fim▁hole|> cutoff = rdfvalue.RDFDatetime().Now() - r...
aff4.FACTORY.Delete(hunt) # Delete clients that haven't polled in for 2hours for fd in aff4.FACTORY.MultiOpen(export_utils.GetAllClients()):
<|file_name|>enrollmentTermsApi.js<|end_file_name|><|fim▁begin|>// // Copyright (C) 2016 - present Instructure, Inc. // // This file is part of Canvas. // // Canvas 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...
// You should have received a copy of the GNU Affero General Public License along // with this program. If not, see <http://www.gnu.org/licenses/>.
<|file_name|>WMSOverlayServer.py<|end_file_name|><|fim▁begin|>from kvmap.code.projections import * from urllib2 import urlopen from httplib import HTTPConnection from threading import Thread from kivy.logger import Logger from kivy.loader import Loader from os.path import join, dirname import time, os import hashlib t...
x, y = latlon_to_google (lat, lon) else:
<|file_name|>test_generic.py<|end_file_name|><|fim▁begin|># Copyright 2016 Red Hat, Inc. # # 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 # ...
class ManualManagementHardwareTestCase(db_base.DbTestCase): def setUp(self):
<|file_name|>file-type.js<|end_file_name|><|fim▁begin|>'use strict'; const toBytes = s => [...s].map(c => c.charCodeAt(0)); const xpiZipFilename = toBytes('META-INF/mozilla.rsa'); const oxmlContentTypes = toBytes('[Content_Types].xml'); const oxmlRels = toBytes('_rels/.rels'); const fileType = input => { const buf = ...
<|file_name|>control.rs<|end_file_name|><|fim▁begin|>use cgmath; use claymore_scene::Transform; pub type MousePos = (i32, i32); pub struct Control { rotate_speed: f32, move_speed: f32, zoom_speed: f32, rotate_base: Option<(MousePos, Transform<f32>)>, move_base: Option<(MousePos, cgmath::Vector3<f...
}
<|file_name|>side-panel.e2e.ts<|end_file_name|><|fim▁begin|>import { browser, by, element } from 'protractor'; describe('App', () => { beforeEach(() => { // change hash depending on router LocationStrategy browser.get('/#/home'); }); it('should have a title', () => { let subject = browser.getTitle(...
});
<|file_name|>BuildAndRun.py<|end_file_name|><|fim▁begin|>macimport os import subprocess name = "gobuildmaster" current_hash = "" for line in os.popen("md5sum " + name).readlines(): current_hash = line.split(' ')[0] # Move the old version over for line in os.popen('cp ' + name + ' old' + name).readlines(): ...
print line.strip()
<|file_name|>dashboard.js<|end_file_name|><|fim▁begin|>var Index = function () { return { //main function to initiate the module init: function () { App.addResponsiveHandler(function () { Index.initCalendar(); jQuery('.vmaps').each(function () { ...
}); var unique_id = $.gritter.add({ // (string | mandatory) the heading of the notification
<|file_name|>taskConfiguration.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. *...
export function fillDefaults(value: Globals, context: ParseContext): void { if (!value) { return; }
<|file_name|>interact.js<|end_file_name|><|fim▁begin|>/** * interact.js v1.1.2 * * Copyright (c) 2012, 2013, 2014 Taye Adeyemi <dev@taye.me> * Open source under the MIT License. * https://raw.github.com/taye/interact.js/master/LICENSE */ (function () { 'use strict'; var document = window.docume...
<|file_name|>test_signals.py<|end_file_name|><|fim▁begin|>import asyncio from unittest import mock import pytest from multidict import CIMultiDict from aiohttp.signals import Signal from aiohttp.test_utils import make_mocked_request from aiohttp.web import Application, Response @pytest.fixture def app(): return...
callback = mock.Mock()
<|file_name|>Util.TypeChecker.test.js<|end_file_name|><|fim▁begin|>module.exports = (function () { var TypeChecker = Cactus.Util.TypeChecker; var JSON = Cactus.Util.JSON; var stringify = JSON.stringify; var object = Cactus.Addon.Object; var collection = Cactus.Data.Collection; var gettype = TypeChecker.get...
<|file_name|>test_cloud_trace_exporter.py<|end_file_name|><|fim▁begin|># Copyright 2021 The OpenTelemetry 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...
def test_extract_status_code_unset(self): self.assertIsNone( _extract_status(SpanStatus(status_code=StatusCode.UNSET))
<|file_name|>btree.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/licenses/...
} #[test]
<|file_name|>scatter_with_labels.py<|end_file_name|><|fim▁begin|>""" Simple Scatter Plot with Labels =============================== This example shows a basic scatter plot with labels created with Altair. """ # category: scatter plots import altair as alt import pandas as pd data = pd.DataFrame({ 'x': [1, 3, 5, 7...
).encode(