src stringlengths 721 1.04M |
|---|
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2016 Alex Forencich
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... |
# Edge flow
# Mikhail Dubov
# 2015-11-24
from math import radians, pi, sin, tan
import rhinoscriptsyntax as rs
# Some shortcuts for vector operations to improve code readability
unit = rs.VectorUnitize
subtract = rs.VectorSubtract
scale = rs.VectorScale
rev = rs.VectorReverse
length = rs.VectorLength
r... |
#!/usr/bin/python
########################################################################
# 20 Oct 2014
# Patrick Lombard, Centre for Stem Stem Research
# Core Bioinformatics Group
# University of Cambridge
# All right reserved.
########################################################################
import argparse... |
import json
from django.contrib import messages
from django.http import HttpResponse
from django.views.generic.edit import CreateView, UpdateView, FormView
from django.core.serializers.json import DjangoJSONEncoder
class AjaxFormMixin(object):
"""
Mixin which adds support of AJAX requests to the form.
Ca... |
# -*- coding: utf-8 -*-
import unittest
from odin import exceptions
class ValidationException(unittest.TestCase):
def test_with_string(self):
test_message = "Test message"
target = exceptions.ValidationError(test_message)
self.assertListEqual([test_message], target.messages)
self.... |
"""
Copyright 2015 Paul T. Grogan, Massachusetts Institute of Technology
Copyright 2017 Paul T. Grogan, Massachusetts Institute of Technology
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
htt... |
import tensorflow as tf
# Thanks, https://github.com/tensorflow/tensorflow/issues/4079
def LeakyReLU(x, leak=0.1, name="lrelu"):
with tf.variable_scope(name):
f1 = 0.5 * (1.0 + leak)
f2 = 0.5 * (1.0 - leak)
return f1 * x + f2 * abs(x)
def average_endpoint_error(labels, predictions):
... |
import logging
import sys
import re
from errbot.utils import mess_2_embeddablehtml
try:
from PySide import QtCore, QtGui, QtWebKit
from PySide.QtGui import QCompleter
from PySide.QtCore import Qt, QUrl, QObject
except ImportError:
logging.exception("Could not start the graphical backend")
logging.f... |
# -*- coding: utf-8 -*-
# Copyright 2015 Google Inc. 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 require... |
#!/usr/bin/python
# Copyright 2010 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
import glob
import os
import sys
import dirtree
import btarget
import treemappers
script_dir = os.path.abspath(os.path.dirname(__... |
class DashFinder:
def __init__(self):
self.f = ""
self.counter = 0
#Path is inputted from AIPController
#Returns dash counter
def sendFile(self, path):
self.f = open(path)
for line in self.f:
try:
self.counter += self.get_all_dashes(... |
#!/usr/bin/env python3
#encoding: UTF-8
import numpy as np
import os.path
from .readutils import ( read_charge_file_hdf5,
read_wavefunction_file_hdf5, write_charge, create_header
)
from .compute_vs import compute_v_bare, compute_v_h, compute_v_xc
# from .pyqe import pyqe_getcelldms
# TODO this function must be re... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
from __future__ import (unicode_literals, absolute_import,
division, print_function)
import logging
from collections import OrderedDict
from snisi_core.indicators import Indicator
from snisi_core.models.Reporting imp... |
#!/usr/bin/python3
from rust_swig_test_python import TestStaticClass, TestEnum, TestClass, TestArc, TestArcMutex, TestBox, Error as TestError
def test_static_methods():
assert TestStaticClass.hello() == "Hello from rust"
assert TestStaticClass.format_number(123) == "format_number: 123"
assert TestStaticCl... |
__author__ = 'Asus'
import sys
import getopt
from QuestionsHandling.QuestionBase import QuestionBase
from Classifiers.GloveCenteredESLExtendedClassifier import GloveClassifier
from Utils.utilities import load_stf
from Utils.retrofitNew_gloveInstance import retrofit_new
from Utils.retrofitNew_gloveInstance im... |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# 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 applicab... |
## Copyright 2003-2006 Luc Saffre
## This file is part of the Lino project.
## Lino 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 your option) any later version... |
# -*- coding: utf-8 -*-
#
# Test link:
# http://mystore.to/dl/mxcA50jKfP
import re
from pyload.plugin.internal.SimpleHoster import SimpleHoster
class MystoreTo(SimpleHoster):
__name = "MystoreTo"
__type = "hoster"
__version = "0.03"
__pattern = r'https?://(?:www\.)?mystore\.to/dl/.+'
__... |
# THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python train_rel.py
from six.moves import cPickle
import numpy as np
import theano
import theano.tensor as T
import lasagne as L
import random
import time
import string
import argparse
# parse command line arguments
parser = argparse.ArgumentParser(formatter_class... |
#
# Copyright (c) 2004 Conectiva, Inc.
#
# Written by Gustavo Niemeyer <niemeyer@conectiva.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager 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 Fou... |
'''
Created on Jul 29, 2012
@author: rafaelolaechea
'''
import argparse
from xml.etree import ElementTree
from xml_parser_helper import load_xml_model
import spl_claferanalyzer
import math
_namespaces = {'c1': 'http://gsd.uwaterloo.ca/clafer', 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}
def generate_and_ap... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function
from gensim.models import Word2Vec
from keras.callbacks import ModelCheckpoint
from keras.layers import Dense, Merge, Dropout, Reshape, Flatten
from keras.layers.embeddings import Embedding
from keras.layers.recurrent import LSTM
from keras.layers.... |
from .handler import Handler
from .pull_request_event import GetBaseBranch, GetPullRequest, GetTitle, GetRepo
from gh import ReleaseBranchFor, ParseCommitMessage
format_message = ('Features cannot be merged into release branches. The following commits ' +
'are not tagged as one of "{}":\n\n{}\n\n' +
'Read more... |
""" Tests for commerce views. """
import json
from uuid import uuid4
from nose.plugins.attrib import attr
import ddt
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
import mock
from xmodule.modulestore.tests... |
from __future__ import print_function
from __future__ import absolute_import
import os_migrate.ds.base as base
class Datasource (base.Datasource):
description = '''Migration driver for the identity service (Keystone)'''
def store(self):
resources = {}
self.export_projects(resources)
... |
"""Stomp Protocol Connectivity
This provides basic connectivity to a message broker supporting the 'stomp' protocol.
At the moment ACK, SEND, SUBSCRIBE, UNSUBSCRIBE, BEGIN, ABORT, COMMIT, CONNECT and DISCONNECT operations
are supported.
This changes the previous version which required a listener... |
######################
# Required variables #
######################
SECRET_KEY = ''
POSTGRES_DB = {
'NAME': '',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': ''
}
NERD_SERVICE_SERVER = 'http://traces1.saclay.inria.fr/nerd/service/processNERDText'
SEMANTIC_STORE = 'Sleepycat'
#SEMANTIC_PATH = o... |
"""Provides an abstraction layer to pygit2"""
from os.path import join as path_join, isdir
import pygit2
from . import Repository, Commit, Tree, Blob
class GitRepository(Repository):
"""A basic Git repository"""
def __init__(self, directory, url=None, default_branch='master'):
try:
self.dir... |
#!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------##
#
# Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2003 Mt. Hood Playing Card Co.
# Copyright (C) 2005-2009 Skomoroh
#
# This program is free softwa... |
from __future__ import absolute_import
import re
import six
from sentry_sdk.hub import Hub
from sentry_sdk.integrations import Integration
from sentry_sdk.scope import add_global_event_processor
from sentry.utils.safe import get_path
SYSTEM_FRAMES = [
"std::",
"core::",
"alloc::",
"backtrace::",
... |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... |
import json
import urllib3
from urllib.parse import quote, urlparse
from aqbot.lib.plugins.plugin import PluginObject
__all__ = ["JavascriptPlugin"]
class JavascriptPlugin(PluginObject):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def setup(self):
self.command_ma... |
from Framework.Pedido import Pedido
from Framework.ErroNoHTTP import ErroNoHTTP
class PedidoEditar(Pedido):
def __init__(self,variaveis_do_ambiente):
super(PedidoEditar, self).__init__(variaveis_do_ambiente)
try:
self.id = self.corpo['id']
self.nome = self.corpo['nome']
self.codigo = self.corpo['... |
# implementation of card game - Memory
# I originally coded this with timers for hiding the cards instead of hiding them
# on a mouse click. And I removed cards that matched instead of leaving them face up.
# I thought it worked pretty well but it didn't meet the requirements of the grading
# rubrick, so I had to mak... |
import pytest
import testutils
securedrop_test_vars = testutils.securedrop_test_vars
testinfra_hosts = [securedrop_test_vars.app_hostname]
python_version = securedrop_test_vars.python_version
def test_apache_default_docroot_is_absent(host):
"""
Ensure that the default docroot for Apache, containing static ... |
# Copyright 2013 Mitchell Stanton-Cook Licensed under the
# Educational Community 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.osedu.org/licenses/ECL-2.0
#
# Unless required by appli... |
# Change priority of submeshes in Mesh
import salome
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy)
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy)
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
[Face_1... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygame
from librerias import pantalla
from librerias.boton import boton
from librerias.texto import texto
from librerias.popups import PopUp
from librerias.imagen import imagen
from librerias.contenido import cont
from librerias.imgfondo import fondo
from librerias.p... |
# Copyright 2015 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
#
# Unless required by applicable law or agre... |
import os
drc_base_path = os.getenv("DRC_BASE")
import sys
sys.path.append(os.path.join(drc_base_path, "software", "models",
"model_transformation"))
import mitUrdfUtils as mit
from jointNameMap import jointNameMap
from lxml import etree
import tempfile
from glob import glob
os.chdir(os.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
# from future import standard_library
# standard_library.install_aliases()
from builtins import str
import sys
import copy
import pickle
import atexit
from psychopy import logging
from psychopy.tools.filetools import... |
#!/usr/bin/env python
# Copyright (C) 2015 University of Southern California and
# Nan Hua
#
# Authors: Nan Hua
#
# 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, eith... |
# Copyright (c) 2014 Mirantis 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
#
# Unless required by applicable law or ... |
#!/usr/bin/env python
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this fi... |
import numpy as np
a = np.arange(16).reshape(4, 4)
print(a)
# [[ 0 1 2 3]
# [ 4 5 6 7]
# [ 8 9 10 11]
# [12 13 14 15]]
a_split = np.split(a, 2)
print(type(a_split))
# <class 'list'>
print(len(a_split))
# 2
print(a_split[0])
# [[0 1 2 3]
# [4 5 6 7]]
print(a_split[1])
# [[ 8 9 10 11]
# [12 13 14 15]]
... |
#!/usr/local/bin/python2.7
# -*- coding: utf-8-sig -*-
import argparse
import logging
import os
import sqlalchemy
from sqlalchemy.ext.declarative.api import declarative_base
from sqlalchemy.orm.session import sessionmaker
#if no env variable has been defined, a default one is set
if not(os.environ.has_key("SUBDB")):
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2013 Raphaël Barrois
import functools
import logging
import socket
import time
class AutoRetryConfig(object):
"""Hold the auto-retry configuration.
Attributes:
retry_attempts (int): Maximum number of connection retries
retry_wait (int): The initia... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from itertools import ... |
#!usr/bin/python
#Sub-domain collector from ip range
#that also can check for an open port.
#http://www.darkc0de.com
#d3hydr8[at]gmail[dot]com
import sys, socket
def pcheck(ip):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(7)
s.connect((ip, int(sys.argv[2])))
s.close()
return "... |
#
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl,
# K.U. Leuven. All rights reserved.
# Copyright (C) 2011-2014 Greg Horn
#
# CasADi is free software; you can... |
import random
import argparse
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input", dest="infile", required=True, help="A two column file in format LABEL\tPATH_TO_FILE with the strain label and the path to a file containing reads")
parser.add_argument("-n", "--num-infs",... |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2017 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... |
from __future__ import absolute_import
import copy
import datetime
from itertools import chain
from urlparse import urljoin
from django.conf import settings
from django.forms.util import flatatt, to_current_timezone
from django.utils.datastructures import MultiValueDict, MergeDict
from django.utils.html import escape... |
import os
import pygments.lexers
from pygments import highlight
from pygments.formatters import HtmlFormatter
from flask import Flask, request, make_response
from db import insert, find
from bson.errors import InvalidId
from settings import *
app = Flask(__name__)
HOME = """
<style> a { text-decoration: none } </s... |
#
# File: sim.py
#
# Provides simulation kernel (queues, simulation objects, etc.). It is not intended to be called directly,
# the API layer is given in a separate module.
#
from enum import Enum
from decimal import Decimal
import pyons.queues as queues
class Singleton(type):
"""
Metaclass for all singleto... |
#!/usr/bin/python3
################################
# File Name: itemStore.py
# Author: Chadd Williams
# Date: 11/17/2014
# Class: CS 360
# Assignment: Lecture Examples
# Purpose: Demonstrate the inventory system on an online store
################################
import unittest
import csv
from SaleItem import ... |
"""
Get galaxy metadata from a CasJobs fits table.
Add an SFD extinction field, and optional custom fields from HealPix maps.
"""
import cProfile
from collections import namedtuple
import astropy.table as table
import astropy.units as u
import healpy as hp
import numpy as np
from astropy.coordinates import SkyCoord
f... |
from datetime import (
date,
datetime,
timedelta,
)
import numpy as np
import pytest
from pandas.core.dtypes.cast import (
infer_dtype_from,
infer_dtype_from_array,
infer_dtype_from_scalar,
)
from pandas.core.dtypes.common import is_dtype_equal
from pandas import (
Categorical,
Interv... |
#!/usr/bin/env python
import os
import sys
from argparse import ArgumentParser
import subprocess
from phillip import util
import json
from launch_lib import add_options, launch
parser = ArgumentParser()
parser.add_argument('path', type=str, help="path to enemies file")
add_options(parser)
args = parser.parse_args()... |
import unittest
import os
from os.path import join
import json
import shutil
from codebuild_emulator import CodebuildEmulator
from codebuild_emulator import CodebuildRun
this_dir = os.path.dirname(os.path.realpath(__file__))
with open(join(this_dir, 'data', 'batch-get-projects.out'), 'r') as batchgetprojects:
bat... |
'''
A class for running a single instance of a NeuroML model by generating a
LEMS file and using pyNeuroML to run in a chosen simulator
'''
import sys
import time
from pyneuroml import pynml
from pyneuroml.lems import generate_lems_file_for_neuroml
try:
import pyelectro # Not used here, just f... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 McKinsey Academy
#
# Authors:
# Jonathan Piacenti <jonathan@opencraft.com>
#
# This software's license gives you freedom; you can copy, convey,
# propagate, redistribute and/or modify this program under the terms of
# the GNU Affero General Public License (AGPL) a... |
from glob import glob
from importlib import import_module
from inspect import getargspec, getmembers
from os import path
from types import FunctionType
from unittest import TestCase
from pyinfra import operations
from pyinfra.api.operation_kwargs import OPERATION_KWARGS
def _is_pyinfra_operation(module, key, value):... |
#!/usr/bin/env python
# -*- coding: utf-8 -*
import logging
from flask import request, session
from flask.ext.admin import Admin
from flask.ext.admin.contrib import fileadmin
from .models import ModelAdmin
from .views import IndexView
logger = logging.getLogger()
class QuokkaAdmin(Admin):
def register(self, mo... |
_base_ = '../retinanet/retinanet_r50_fpn_1x_coco.py'
model = dict(
bbox_head=dict(
_delete_=True,
type='GARetinaHead',
num_classes=80,
in_channels=256,
stacked_convs=4,
feat_channels=256,
approx_anchor_generator=dict(
type='AnchorGenerator',
... |
from __future__ import division
from abc import ABCMeta, abstractmethod
class TrainingContext:
__metaclass__ = ABCMeta
# TODO: abstract away the computation of statistics
@abstractmethod
def compute_statistics(self, sample_indices): pass
@abstractmethod
def sample_split_points(self, sample_... |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from apps.ar... |
#!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... |
import unittest
import bright
from tests import settings
from bright.helpers import Forbidden, ResourceNotFound
class UserTests(unittest.TestCase):
@classmethod
def setupClass(self):
scopes = ["user:read", "user:write", "user:follow", "artworks:read",
"collections:read"]
s... |
import datetime
from django.http import HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.views.generic import TemplateView
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
from dja... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ygo_cards', '0011_auto_20150428_1928'),
]
operations = [
migrations.AddField(
model_name='cardversion',
... |
# -*- coding: utf-8 -*-
# Copyright(C) 2011 Gabriel Kerneis
# Copyright(C) 2010-2011 Jocelyn Jaubert
#
# This file is part of weboob.
#
# weboob 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, eit... |
#!/usr/bin/python
"""
generate_ufuncs.py
Generate Ufunc definition source files for scipy.special. Produces
files '_ufuncs.c' and '_ufuncs_cxx.c' by first producing Cython.
This will generate both calls to PyUFunc_FromFuncAndData and the
required ufunc inner loops.
The syntax in the ufunc signature list is
<li... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import sys
from tensorflow.core.framework import graph_pb2
from tensorflow.python.client import session
from tensorflow.python.framework import importer
from tensorflow.python.framework import ... |
import pytest
import datetime
from django.shortcuts import reverse
from django.core.files.uploadedfile import SimpleUploadedFile
from adesao.models import SistemaCultura
from planotrabalho.models import Componente
from planotrabalho.models import FundoDeCultura
from planotrabalho.models import Conselheiro
from planot... |
# -*- coding: utf-8 -*-
""" S3 User Roles Management
@copyright: 2018-2019 (c) Sahana Software Foundation
@license: MIT
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 withou... |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... |
"""Aiohttp test utils."""
import asyncio
from contextlib import contextmanager
import functools
import json as _json
from unittest import mock
class AiohttpClientMocker:
"""Mock Aiohttp client requests."""
def __init__(self):
"""Initialize the request mocker."""
self._mocks = []
self.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of t... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
'''-------------------------------------------------------------------------
Copyright IBM Corp. 2015, 2015 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 c... |
#!/usr/bin/env python
#
# Electrum - Lightweight Bitcoin Client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... |
from math import *
import thread
import random
import time
import visual
cat_catch_rate=5*10**-4 #parameter
cat_efficiency=0.8 #parameter
a=0.2 #will ge... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-07 19:52
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependen... |
# -*- coding: utf-8 -*-
from twisted.internet import threads
from config import config
from enigma import eDBoxLCD, eTimer, iPlayableService, pNavigation, iServiceInformation
import NavigationInstance
from Tools.Directories import fileExists
from Components.ParentalControl import parentalControl
from Components.Service... |
"""
A module for defining generative distribution function models.
All models *must* be subclassed from :class:`~Model`, which provides the abstract base methods required to implement.
"""
import numpy as np
from .utils import numerical_jac, numerical_hess
class Model(object):
"""
Base class defining a gene... |
# Copyright 2021 The FedLearner 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 2015 Christian Fobel
This file is part of zmq_hub_plugin.
zmq_hub_plugin 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.
dmf... |
# Copyright 2013 Openstack Foundation
# 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 requ... |
# Copyright 2016-7 Donour Sizemore
#
# This file is part of RacePi
#
# RacePi 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, version 2
#
# RacePi is distributed in the hope that it will be useful,
# but WITHO... |
# Check every path through every method of UserDict
from test import mapping_tests
import unittest
import collections
d0 = {}
d1 = {"one": 1}
d2 = {"one": 1, "two": 2}
d3 = {"one": 1, "two": 3, "three": 5}
d4 = {"one": None, "two": None}
d5 = {"one": 1, "two": 1}
class UserDictTest(mapping_tests.TestHashMappingProto... |
from .exceptions import _ParallelBackgroundException
from .worker import ThreadWorker, ProcessWorker
from itertools import zip_longest
WORKERTYPE_THREAD = ThreadWorker
WORKERTYPE_PROCESS = ProcessWorker
class IterDispatcher:
def __init__(
self,
func,
*args,
maximum=15,
wor... |
"""
Copyright (C) 2013-2018 Calliope contributors listed in AUTHORS.
Licensed under the Apache 2.0 License (see LICENSE file).
lookup.py
~~~~~~~~~~~~~~~~~~
Functionality to create DataArrays for looking up string values between loc_techs
and loc_tech_carriers, to avoid string operations during backend operations.
""... |
# -*- coding: utf-8 -*-
# Copyright 2020 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/LICENSE-2.0
#
# Unless required by applicable law o... |
"""convert.py
Some format conversion utilities. Run all commands below from the parent
directory using the -m option.
1. Convert LDC TimeBank into a modern TimeBank in the TTK format.
$ python -m utilities.convert --timebank2ttk TIMEBANK_DIR TTK_DIR
Converts TimeBank 1.2 as released by LDC into a version with... |
import os
import os.path
from setuptools import setup, find_packages
def find_packages_data(start_dir):
packages = {}
for package_name in os.listdir(start_dir):
package_dir = os.path.join(start_dir, package_name)
if os.path.exists(os.path.join(package_dir, '__init__.py')):
files =... |
# coding: utf-8
import logging
from sqlalchemy.sql import func
from ppyt.filters import FilterBase
from ppyt.models.orm import start_session, History
logger = logging.getLogger(__name__)
class AverageVolumeFilter(FilterBase):
"""平均出来形で銘柄を絞り込むクラスです。"""
_findkey = '平均出来高フィルタ' # フィルタを一意に特定できる名前をつけます。
def... |
#!/usr/bin/env python
#
# Copyright 2005-2019 The Mumble Developers. All rights reserved.
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>.
# Extracts the progress of translations from th... |
from django.apps import apps
from django.conf import settings
import os, inspect
import logging
from ..util import log
##############################################################
### Abstract Provider Base
class BaseProvider(object):
'''
Abstract base provider class. Instances of this class are created... |
'''
Task Coach - Your friendly task manager
Copyright (C) 2004-2010 Task Coach developers <developers@taskcoach.org>
Task Coach 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
... |
from __future__ import unicode_literals
import sys
if sys.version_info[0] > 2:
basestring = unicode = str
import configparser as ConfigParser
else:
import ConfigParser
import os
import encodings
import codecs
import logging
import logging.handlers
#bots-modules
from . import botsglobal
from . ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.