src stringlengths 721 1.04M |
|---|
# Copyright (C) 2019 Collin Capano
# 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 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in t... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Major'
db.create_table('classes_major', (
('id', self.gf('django.d... |
# Sublime Suricate, Copyright (C) 2013 N. Subiron
#
# This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you
# are welcome to redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either
# version 3 of the License, or (... |
# -*- coding: utf-8 -*-
from django.utils.importlib import import_module
_cache = {}
_settings_forms = []
_markdown_extensions = []
_article_tabs = []
_sidebar = []
def register(PluginClass):
"""
Register a plugin class. This function will call back your plugin's
constructor.
"""
if PluginClass in... |
import os, sys
import numpy as np
import pickle
import matplotlib
import matplotlib.cm as cm
from matplotlib.ticker import MaxNLocator
import matplotlib.pyplot as plt
# Build dependencies
import setup
axlbls = setup.lbl_dict
units = setup.units_dict
matplotlib.rcParams.update(setup.params)
# Data and target locations... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2013
# Author: Guewen Baconnier - Camptocamp SA
# Augustin Cisterne-Kaasv - Elico-corp
# David Béal - Akretion
# Chafique Delli - Akretion
# This program is free... |
#-*- coding: utf- -*-
import os
import sys
import random
import time
import json
import wikiquote
import tuitear
from threading import Thread
CONGIG_JSON = 'bots.json'
# Variable local, para modificar el intervalo real cambiar la configuración
INTERVALO = 1
stop = False
def start_bot(bot):
""" Hilo que inicia ... |
# Copyright (c) 2012-2013 SHIFT.com
#
# 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 the rights to
# use, copy, modify, merge, publish, dist... |
# -*- coding: utf-8 -*-
#
# python-ptraceplus - Ptrace bindings + extra stuff
#
# Copyright (c) 2013 Eric Le Bihan <eric.le.bihan.dev@free.fr>
#
# 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, e... |
build_version = "1.3.1"
python_path = "C:\\Python26\\"
import os, glob
import shutil
shutil.copy(python_path + "Scripts\deluge-script.pyw", python_path + "Scripts\deluge.py")
shutil.copy(python_path + "Scripts\deluge-script.pyw", python_path + "Scripts\deluge-debug.py")
shutil.copy(python_path + "Scripts\deluged-scrip... |
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... |
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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 2
... |
# Copyright (c) 2011-2017 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
"""parser.py - Parses a PDF document to extract driving
regulation articles and store them in memory.
"""
import logging
import hashlib
import re
import slate # pylint: disable=import-error
import connector
import retriever
logging.basicConfig(level=logging.INFO)
class Document:
"""Class for Regulations Docum... |
from pyapi import Request,RequestPrivate
#this is going to be it
#from pyapi import AccountStructure
from CryptsyInfo import Info
import time
# <codecell>
#pur account into pyapi and inherit the specific platform account
#from the general class.
class Account():
#class Account(AccountStructure):
#it does not make... |
import ipaddress
import itertools
import logging
from collections import deque
from ipaddress import IPv4Address, IPv6Address
from typing import Dict, List, Optional, Union
from h2.config import H2Configuration
from h2.connection import H2Connection
from h2.errors import ErrorCodes
from h2.events import (
Event, C... |
from dotmailer import Base
from dotmailer.connection import connection
class Survey(Base):
"""
"""
end_point = '/v2/surveys'
def __init__(self, **kwargs):
self.required_fields = []
super(Survey, self).__init__(**kwargs)
@classmethod
def get_multiple(cls, assigned_to_ad... |
from __future__ import absolute_import, division, print_function, unicode_literals
import re
import sys
import json
import requests
from . import APIError, HTTPError
from .monitor import Monitor
from .alert_contact import AlertContact
# Ensure that we can test against the appropriate string types.
if sys.version_in... |
__all__ = ['list', 'time']
time_components = ('weeks', 'days', 'hours', 'minutes', 'seconds')
def list(args, single_suffix='', multi_suffix=''):
"""
Concatenate several strings with some formatting, and optional suffixes.
single_suffix and multi_suffix are for easy pluralization - the correct singular/plural form ... |
import os
import shutil
def recordToFile(record,msg):
'''Record msg to file, using binary mode'''
if len(msg.encode())>50:
while len(msg.encode())>47:
msg=msg[0:-int((len(msg.encode())-47)/2)-1]
msg=msg+'...'
written=record.write( '{: <50}'.format(msg).encode() )
record.seek... |
#!/usr/bin/env python
# -*-coding=utf-8 -*-
import requests
import json
import ConfigParser
config = ConfigParser.RawConfigParser()
config.read('config.ini')
API_KEY = config.get('Last.FM', 'API_KEY')
URL = "https://ws.audioscrobbler.com/2.0/"
def getLovedTracks(username):
result = []
page = ... |
# -*- coding: utf-8 -*-
# Copyright 2012 Akretion <http://www.akretion.com>.
# Copyright 2013-2016 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class DeliveryCarrier(models.Model):
_inherit = 'delivery.carrier'
@api.model
def _get_carr... |
# Copyright 2008-2011 Nokia Networks
# Copyright 2011-2016 Ryan Tomac, Ed Manlove and contributors
# Copyright 2016- Robot Framework 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 Licens... |
from __future__ import unicode_literals
from django.db import models
#from CongressionalRecord import db
from neo4j import contextmanager
from neo4j import connection
from re import escape
from django.conf import settings
connection.http.REQUEST_TIMEOUT = 9999
manager = contextmanager.Neo4jDBConnectionManager(settin... |
from couchdb import Server, ResourceNotFound
from radarpost.cli import COMMANDLINE_PLUGIN, BasicCommand, get_basic_option_parser
from radarpost import plugins
from radarpost.user import User, ROLE_ADMIN
from getpass import getpass
class CreateUserCommand(BasicCommand):
command_name = 'create_user'
description... |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
Packet class. Binding mechanism. fuzz() method.
"""
import time,itertools,os
import copy
from fields import StrField... |
# -*- coding:utf-8 -*-
import sys
import re
import time
import random
import base64
from lxml import etree
from dateutil.relativedelta import relativedelta
reload(sys)
sys.setdefaultencoding('utf8')
import datetime
import traceback
if __name__ == '__main__':
sys.path.append('..')
sys.p... |
#!/usr/bin/env python
#
# genv8constants.py output_file libv8_base.a
#
# Emits v8dbg constants stored in libv8_base.a in a format suitable for the V8
# ustack helper.
#
import re
import subprocess
import sys
import errno
if len(sys.argv) != 3:
print "usage: objsym.py outfile libv8_base.a"
sys.exit(2);
outfile =... |
"""Module provides classification of signals and evaluates models."""
from random import randrange
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import VotingClassifier
from sklearn.ensemble.weight_boosting import AdaBoostClassifier
from sklearn.model_selection import c... |
# -*- coding: utf-8 -*-
"""Example demonstrating the contrib.request classes.
Create a MarketOrderRequest to enter 10000 EUR_USD LONG position along with
- a TakeProfitOrder to take profit @1.10
- a StopLossOrder to take loss @1.07
These values apply for this moment: EUR_USD 1.0605
So when you run the example you may... |
from chiplotle.geometry.core.coordinate import Coordinate
from chiplotle.geometry.core.coordinatearray import CoordinateArray
import math
## TODO: refactor, this is nasty. Take one type only!
def rotate_2d(xy, angle, pivot=(0, 0)):
'''2D rotation.
- `xy` is an (x, y) coordinate pair or a list of coordinate p... |
from __future__ import absolute_import
import unittest
import numpy as np
from tests.sample_data import SampleData
from pyti import linear_weighted_moving_average
class TestLinearWeightedMovingAverage(unittest.TestCase):
def setUp(self):
"""Create data to use for testing."""
self.data = SampleDat... |
# SDT2PrintSDT4.py
#
# Print SDT4 to SDT4
from .SDT3Classes import *
from common.SDTHelper import decTab, incTab, newLine
#
# Print functions
#
def print2DomainSDT4(domain, options):
result = printXMLHeader(domain)
incTab()
result += r(printIncludes(domain.includes)) if len(domain.includes) > 0 else ''
result +... |
# -*- coding: utf-8 -*-
""" S3 Extensions for gluon.dal.Field, reusable fields
@requires: U{B{I{gluon}} <http://web2py.com>}
@copyright: 2009-2012 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associ... |
import os.path
import csv
import re
headers = ['Id', 'KnowledgeId', 'Type', 'Src', 'Name', 'Count']
def doSubject(subject):
idCount = 0
rows = []
for root, dirs, files in os.walk('ChoiceSource/' + subject):
for name in files:
if (name != '.DS_Store'):
idCount += 1
... |
#!/usr/bin/env python
"""
Skype SMS plugin for pagerprinter.
Copyright 2011-2013 Michael Farrell <http://micolous.id.au/>
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 3 of the Licen... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
#!/usr/bin/env python
# encoding: utf-8
"""
use a global dict to store the events,
and here put event related operations wrapper
~~~~~~~~
event.py
"""
from gevent.event import AsyncResult
from .errors import (
EventKeyAlreadyExisted,
EventKeyTypeError,
)
__all__ = [
'set_event',
... |
import os
import random
import time
import json
from locust import HttpLocust, TaskSet, task
from lib.baseTaskSet import baseTaskSet
# TODO - make these config-driven
from lib.openstack.keystone import get_auth_token
from lib.openstack.cinder import list_volumes
from lib.openstack.cinder import list_volumes_detail
f... |
import os, sys
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.plugin import IPlugin
from twisted.python.filepath import FilePath
from twisted.python.usage import UsageError
from zope.interface import implements
from jersey import log
from pub.client import cli
from pub.crypto import Ke... |
# -*- coding: utf-8 -*-
"""
Michaelis-Menten Kinetics
=========================
Implements support for *Michaelis-Menten* kinetics, a model of enzyme kinetics:
- :func:`colour.biochemistry.reaction_rate_MichealisMenten`
- :func:`colour.biochemistry.substrate_concentration_MichealisMenten`
References
----------
-... |
from pprint import pprint
from django.shortcuts import render
from django.urls import reverse
from django.views import View
from fo2.connections import db_cursor_so
import produto.forms as forms
import produto.queries as queries
class Modelo(View):
Form_class = forms.ModeloForm
template_name = 'produto/mod... |
#!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... |
"""Implements the ScoringProtocol, which runs all specified tests
associated with an assignment.
"""
from client.sources.common import core
from client.sources.common import models as sources_models
from client.protocols.common import models as protocol_models
from client.utils import format
from collections import Or... |
""" Calculation of Miller indices """
from __future__ import absolute_import
import decimal
import fractions as fr
import json
import math
import numpy as np
from six.moves import map
from six.moves import range
from functools import reduce
def lcm(a, b):
"""
Returns least common multiple of a, b
Args:... |
import json
import math
import re
from urllib.parse import urlparse, parse_qs
from django import template
from django.utils.safestring import mark_safe
from ui.utils import get_icon_svg
register = template.Library()
@register.filter
def labelize(value):
return mark_safe(re.sub(r"\[(\w+)\]", r'<span class="yell... |
# -*- coding: utf-8 -*-
import unittest
import oss2
from oss2.exceptions import make_exception
import os
import sys
import tempfile
import requests
import datetime
import locale
import io
from functools import partial
from .common import *
import logging
try:
xrange
except NameError:
xrange = range
is_p... |
# -*- coding: utf-8 -*-
from docutils import nodes
from sphinx import addnodes
from sphinx.errors import SphinxWarning
from sphinx.locale import l_, _
from sphinx.domains import Domain, ObjType, Index
from sphinx.util.nodes import make_refnode
from sphinx.util.compat import Directive
from sphinx.roles import XRefRole
... |
## Copyright 2016 Kurt Cutajar, Edwin V. Bonilla, Pietro Michiardi, Maurizio Filippone
##
## 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... |
# coding: utf-8
# The MIT License (MIT)
#
# Copyright 2016 Alan Fachini <https://github.com/alfakini/python-mercadobitcoin>
#
# 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 restrict... |
#!/usr/bin/env python3
import io
import re
import json
import pydoc
import zipfile
import traceback
import argparse
import collections
from datetime import datetime
import urllib.request as request
from itertools import count
Vec3d = collections.namedtuple('Vec3d', 'x,y,z')
Orient3d = collections.namedtuple('Orient3d'... |
# Copyright 2002 Ben Escoto
#
# This file is part of rdiff-backup.
#
# rdiff-backup is free software; you can redistribute it and/or modify
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# rd... |
try:
from django.utils.encoding import smart_unicode
except ImportError:
# Python 3
from django.utils.encoding import smart_text as smart_unicode
from djmoney.utils import get_currency_field_name
def _expand_money_params(kwargs):
from moneyed import Money
try:
from django.db.models.consta... |
"""
11. Relating an object to itself, many-to-one
To define a many-to-one relationship between a model and itself, use
``ForeignKey('self')``.
In this example, a ``Category`` is related to itself. That is, each
``Category`` has a parent ``Category``.
Set ``related_name`` to designate what the reverse relationship is... |
#!/usr/bin/env python3
#
# Copyright 2021 Andrey Izman <izmanw@gmail.com>
#
# 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 requir... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from askbot.utils.console import ProgressBar
def format_group_name(user):
"""returns name of the personal group
given the user object
"""
return '_internal_%s_%d' % (user.user... |
# helpviewer.py
# -*- Mode: Python; indent-tabs-mode: nil; tab-width: 4; coding: utf-8 -*-
import os
import subprocess
# Hardcoded list of available help viewers
# FIXME: khelpcenter support would be nice
#KNOWN_VIEWERS = ["/usr/bin/yelp", "/usr/bin/khelpcenter"]
KNOWN_VIEWERS = ["/usr/bin/yelp"]
class HelpViewer:
... |
import os
import pickle
import sys
import click
from shellsql import aws
from shellsql.models import Dataset
from shellsql.cache import TTLCache, FileCache
from shellsql import utils
@click.group()
def cli():
pass
@cli.command()
def hello():
click.echo("hello world!")
@cli.command()
@click.argument('columns... |
#
# The Multiverse Platform is made available under the MIT License.
#
# Copyright (c) 2012 The Multiverse Foundation
#
# 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 restrict... |
from gevent.queue import Queue
from collections import OrderedDict
import rlp
from rlp.utils import str_to_bytes, is_integer
import struct
import sys
sys.setrecursionlimit(10000) # frames are generated recursively
# chunked-0: rlp.list(protocol-type, sequence-id, total-packet-size)
header_data_sedes = rlp.sedes.List... |
import csv
import os
from nodetraq.model.meta import Session, metadata
from nodetraq.model.nodes import Node
node_replacements = [
('Hostname', 'hostname'),
('Service Tag', 'service_tag'),
('RACK', 'rack'),
('RACK U', 'rack_u'),
('Description', 'description'),
('Firmwar... |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2010, 2011, 2013 CERN.
##
## Invenio 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 2 of the
## License, or (at yo... |
import threading
import time
import requests
import config
import wx_signal
import wx
class UpdateThread(threading.Thread):
def __init__(self, parent, force=False):
threading.Thread.__init__(self)
self.parent = parent
self.force = force
def run(self):
"""Overrides Thread.run. ... |
r"""
===============================================================================
throat_misc -- Miscillaneous and generic functions to apply to throats
===============================================================================
"""
import scipy as _sp
def random(geometry, seed=None, num_range=[0, 1], **kwar... |
# pylint: disable=missing-docstring
import tensorflow as tf
tf_dtype = tf.as_dtype("float32")
def spsa(
model_fn,
x,
y,
eps,
nb_iter,
clip_min=None,
clip_max=None,
targeted=False,
early_stop_loss_threshold=None,
learning_rate=0.01,
delta=0.01,
spsa_samples=128,
sp... |
#
# Copyright (C) 2014 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# This program is distri... |
from src.todoMelvin import settings
from datetime import datetime
from subprocess import check_output
logSender = None
class WarningLevels:
Debug = {'level' : 0, 'tag' : 'DEBUG'}
Info = {'level' : 1, 'tag' : 'INFO'}
Warn = {'level' : 2, 'tag' : 'WARNING'}
Fatal = {'level' : 3, 'tag' : 'FAT... |
# coding:utf-8
from django.test import TestCase
from django.http import HttpResponse
from django.core.mail import send_mail
from models import Photo, Tag, Interest, Collect
from users.models import User
import dbControl
import faceControl
import time
class DBTestCase(TestCase):
""" Test for functions of database... |
# Deep Count
# The built-in len operator outputs the number of top-level elements in a List,
# but not the total number of elements. For this question, your goal is to count
# the total number of elements in a list, including all of the inner lists.
# Define a procedure, deep_count, that takes as input a list, and o... |
# Copyright (c) 2013 Christian Schwede <info@cschwede.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
# Unit tests for typecast functions in django.db.backends.util
import datetime
import unittest
from django.db.backends import utils as typecasts
from django.utils import six
TEST_CASES = {
'typecast_date': (
('', None),
(None, None),
('2005-08-11', datetime.date(2005, 8, 11)),... |
from synapse.tests.common import *
import synapse.tools.easycert as s_easycert
#pars.add_argument('--certdir', default='~/.syn/certs', help='Directory for certs/keys')
##pars.add_argument('--signas', help='sign the new cert with the given cert name')
#pars.add_argument('--ca', default=False, action='stor... |
import pickle
import dataprepper
import outputgenerator
import sensorprocessor
root_folder = '/Users/philliphartin'
taut_folder = '/TAUT'
working_directory = root_folder + taut_folder
sensor_folder = '/SensorRecordings'
database_folder = '/ServerDatabase'
csv_log_file = '/ServerDatabase_2015_11_28_cleaned.csv'
windo... |
"""
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation.
OpenAPI spec version: v1
... |
# Copyright 2018 The TensorFlow 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# Copyright 2017 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
# -*- coding: utf-8 -*-
def converteString (dia, hora):
evento = []
# Parse do dia
num = dia[4:6]
evento.append(int(num))
# Parse da hora
num = hora[0:2]
evento.append(int(num))
# Parse dos minutos
num = hora[5:7]
evento.append(int(num))
# Parse dos segundos
num = hora[1... |
# ==============================================================================
# purpose: create statistical distribution objects, and find shortest paths
# author:
# created: 6/6/15
# revised:
# comments:
# 1. This is based on the object graph on Wikipedia.
# 2. The idea is to create a graph of the various continuo... |
# F3AT - Flumotion Asynchronous Autonomous Agent Toolkit
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
# 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... |
class Sensor :
'''
https://www.google.fr/#q=NVARCHAR+encodage+mysql
https://stackoverflow.com/questions/612430/when-must-we-use-nvarchar-nchar-instead-of-varchar-char-in-sql-servers
Nvarchar ne sert que pour les utilisateurs MS-SQL. '''
def __init__(self) :
pass
class Station :
'''(NULL)'''
def __init__(self) :
... |
# -*- coding: utf-8 -*-
# @COPYRIGHT_begin
#
# Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
#
# 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... |
import sys
import py
import weakref
from rpython.rlib import rgc
from rpython.jit.codewriter.policy import StopAtXPolicy
from rpython.jit.metainterp import history
from rpython.jit.metainterp.test.support import LLJitMixin, noConst
from rpython.jit.metainterp.warmspot import get_stats
from rpython.rlib import rerased... |
import base64
import hashlib
import hmac
from datetime import datetime, timedelta
from Crypto.Cipher import AES
from Crypto import Random
import mock
from django.test.testcases import TestCase
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.test import RequestFac... |
#!/usr/bin/python3
import cv2
import numpy as np
from obstacle_detector.perspective import inv_persp_new
from obstacle_detector.distance_calculator import spline_dist
def video_test(input_video_path=None):
cx = 603
cy = 297
roi_width = 25
roi_length = 90
px_height_of_roi_length = 352
#int(
... |
#!py -3
from solitaire import *
import sys
def main():
opt = int(input("Which game would you like to play?\n\t0: Quit program\n" +
"\t1: Klondike\n"))
if not opt:
sys.exit(0)
if opt == 1:
game = klondike
args = []
game.set_up(*args)
game.show_board()
while Tr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from . import Dataset
import numpy as np
class MiniBatches(Dataset):
def __init__(self, dataset, batch_size=20):
self.origin = dataset
self.size = batch_size
self._train_set = None
self._valid_set = None
self._test_set = None
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Create a Conan Package with QiBuild tools """
from __future__ import absolute_import
from __future__ import unicode_lit... |
__author__ = "HarshaRani"
__credits__ = ["Upi Lab"]
__license__ = "GPL3"
__version__ = "1.0.0"
__maintainer__ = "HarshaRani"
__email__ = "hrani@ncbs.res.in"
__status__ = "Development"
__updated__ = "Oct 26 2018"
'''
2018
Oct 26: xfer molecules are not put into screen
Se... |
import struct
class Unpacker(object):
def __init__(self, buf):
self._buffer = buf
self._offset = 0
self._typemethods = {'b': self.unpack_int8, 'B': self.unpack_uint8,
'h': self.unpack_int16, 'H': self.unpack_uint16,
'i': self.unpack... |
from __future__ import division
from gi.repository import Gtk, GObject, GLib, GdkPixbuf
import cairo
import tweenEquations
import os
import math
import gettext
gettext.install("cinnamon", "/usr/share/locale")
TWEEN_SHAPES = ["Quad", "Cubic", "Quart", "Quint", "Sine", "Expo", "Circ", "Elastic", "Back", "Bounce"]
TWEEN_... |
# Python 2.5 compatibility
from __future__ import with_statement
# Python version
import sys
if sys.version_info < (2, 5):
raise "Required python 2.5 or greater"
import os, sqlite3, itertools, time
from datetime import datetime
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
proj_path = lambda x: os.pat... |
# $Id: SunGridEngine.py 2765 2009-01-20 13:02:14Z oliver $
"""
:mod:`staging.SunGridEngine` --- staging class for SunGridEngine
================================================================
Primitive framework for staging jobs in `Sun Grid Engine`_ via a
customized :class:`Job` class.
Example python submission scr... |
# Test methods with long descriptive names can omit docstrings
# pylint: disable=missing-docstring
import unittest
import numpy as np
from Orange.data import Table
from Orange.classification import TreeLearner
from Orange.regression import TreeRegressionLearner
from Orange.ensembles import SklAdaBoostLearner, SklAdaBo... |
import os.path as op
import numpy as np
from numpy.testing import (assert_allclose, assert_array_equal)
import pytest
from mne import io, pick_types, pick_channels, read_events, Epochs
from mne.channels.interpolation import _make_interpolation_matrix
from mne.datasets import testing
from mne.utils import run_tests_if... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
# test_region_estimates.py: Checks that computed credible regions are working.
##
# © 2014 Chris Ferrie (csferrie@gmail.com) and
# Christopher E. Granade (cgranade@gmail.com)
#
# This file is a part of the Qinfer project.
# Licensed under the AGPL version 3.
##
# This... |
import json
from rest_framework import mixins, viewsets, status
from rest_framework.decorators import action
from rest_framework.response import Response
from core.drf.mixins import NestedGenericModelMixin
from cla_eventlog import event_registry
from legalaid.models import Case
from diagnosis.models import DiagnosisT... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------
# cssqc/__init__.py
#
# css quality control
# ----------------------------------------------------------------
# copyright (c) 2014 - Domen Ipavec
# Distributed under The MIT License, see LICENSE
# -------... |
#!/usr/bin/python -OO
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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, ei... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def VirtualMachineSnapshotInfo(vim, *args, **kwargs):
'''The SnapshotInfo data object typ... |
""" Test cases for time series specific (freq conversion, etc) """
from datetime import datetime, timedelta, date, time
import pytest
from pandas.compat import lrange, zip
import numpy as np
from pandas import Index, Series, DataFrame, NaT
from pandas.compat import is_platform_mac
from pandas.core.indexes.datetimes ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.