gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
""" Calculate factors for hyperfine structure in single-electron atoms.
"""
import sys
import json
from itertools import product
from maxwellbloch.angmom import calc_clebsch_hf
import numpy as np
class Atom1e(object):
""" Represents an atom object and contains a list of J levels. """
def __init__(self, ele... | |
# 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 field 'Submission.required_effort'
db.add_column('challenges_submission', 'required_effort', self... | |
from cStringIO import StringIO
from collections import OrderedDict
from itertools import imap
from mmap import mmap
import os
import struct
import sys
from accents import AccentsTable, Accents
from pydic import NAME_FILENAME, FORMS_HASH_FILENAME, FORMS_RECNO_FILENAME, ConfigurationErrorException, FORMS_RECNO_INDEX_FILE... | |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Lice... | |
# -*- 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 or... | |
#!/usr/bin/env python
"""
@package mi.dataset.parser.optaa_ac_mmp_cds
@file marine-integrations/mi/dataset/parser/optaa_ac_mmp_cds.py
@author Mark Worden
@brief Parser for the optaa_ac_mmp_cds dataset driver
Release notes:
initial release
"""
__author__ = 'Mark Worden'
__license__ = 'Apache 2.0'
import struct
from... | |
# Copyright (c) 2012 Rackspace Hosting
# All Rights Reserved.
# Copyright 2013 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/license... | |
from CrateGlobals import *
from otp.level import DistributedEntityAI
from direct.directnotify import DirectNotifyGlobal
class DistributedGridAI(DistributedEntityAI.DistributedEntityAI):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedGridAI')
def __init__(self, level, entId):
self.ini... | |
#
# Script to update and run an existing SQL restore job
# --restore parameter is always required
# Use the --cancel="True" parameter to cancel an active restore job
# --source, --tinst, and --tdb, parameters are required for restore
# --start, --end, and --backup are optional to determine copy version used for restore... | |
'''
Set of classes and functions fundamental to designing an optical ray tracing system.
This module can be used to model:
Refraction of rays through surfaces of various refractive indicies and curvatures.
Dispersion through water and glass, for visible light wavelengths.
'''
import numpy as np
import genpolar ... | |
# Copyright 2013-2021 Aerospike, 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 agreed to in writ... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import datetime
import email
import email.utils
import imaplib
import poplib
import re
import time
import json
from email.header import decode_header
import _socket
import chardet
from email_reply_parser import EmailReply... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and contributors
# License: MIT. See LICENSE
import frappe
from frappe import _
import datetime
import json
from frappe.utils.dashboard import cache_source
from frappe.utils import nowdate, getdate, get_datetime, cint, now_datetime
from frappe.utils.dat... | |
#!/usr/bin/env python
#
# Copyright 2001 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... | |
# 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... | |
#!/usr/bin/env python
#
# Copyright 2007 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import copy
import o... | |
from __future__ import with_statement
import datetime
import os
import unittest
import uuid
import tempfile
from decimal import Decimal
from bson import Binary, DBRef, ObjectId
import gridfs
from nose.plugins.skip import SkipTest
from mongoengine import *
from mongoengine.connection import get_db
from mongoengine.ba... | |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | |
"""
Utility function to facilitate testing.
"""
import os
import sys
import re
import operator
import types
import warnings
from nosetester import import_nose
__all__ = ['assert_equal', 'assert_almost_equal','assert_approx_equal',
'assert_array_equal', 'assert_array_less', 'assert_string_equal',
... | |
# Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... | |
import unittest
import random, sys, time, os
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i, h2o_exec as h2e
import codecs
print 'Maybe h2o is supposed to NA rows if they start with an unmatched "'
print "For now, complain if numRows isn't what I generated"
print
print "We throw in do... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from thrift.protocol import fastproto, TBinaryProtocol, TCompactProtocol
from thrift.transport import TTransport
import timeit
import gc
from multiprocessing import Proc... | |
# django imports
from django.db.models import Count, Q
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render, redirect, render_to_response
from django.views.generic import View
from django.views.generic.list import ListView
# django user authentication imports
from django.contr... | |
import os
import stat
import tempfile
import pytest
from mock import Mock, patch
from nose import SkipTest
from nose.tools import eq_
from django.conf import settings
from olympia import amo
from olympia.amo.tests import TestCase
from olympia.amo.tests.test_helpers import get_image_path
from olympia.devhub.models im... | |
# -*- coding: utf-8 -*-
"""Loader base class."""
from __future__ import absolute_import, unicode_literals
import importlib
import os
import re
import sys
from datetime import datetime
from kombu.utils import json
from kombu.utils.objects import cached_property
from celery import signals
from celery.five import rerai... | |
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | |
#!/usr/bin/env python3
"""Firebase Admin SDK ML quickstart example."""
import argparse
from datetime import datetime
from datetime import timezone
from beautifultable import BeautifulTable
import firebase_admin
from firebase_admin import ml
# TODO(user): Configure for your project. (See README.md.)
SERVICE_ACCOUNT_... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import ast
import warnings
import pathlib
import click
import numpy as np
from . import _dedup, _fileio, _pairsam_format, _headerops, cli, common_io_options
from .pairsam_markasdup import mark_split_pair_as_dup
from .pairsam_stats import PairCounter
UTIL_NA... | |
import collections
import logging
import pickle
import time
from asgiref.sync import async_to_sync
from channels.db import database_sync_to_async
from channels.layers import get_channel_layer
from django.core import exceptions as django_exceptions
from django.db import IntegrityError, connection, transaction
from djan... | |
# -*- coding: utf-8 -*-
# vim: ts=2 sw=2 et ai
###############################################################################
# Copyright (c) 2012,2013-2021 Andreas Vogel andreas@wellenvogel.net
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documen... | |
import math
import unittest
import pickle
from io import StringIO
import numpy as np
from Orange.testing import create_pickling_tests
from Orange.data import Variable, ContinuousVariable, DiscreteVariable, \
StringVariable, TimeVariable, Unknown, Value
from Orange.data import Table
from Orange.data.io import CSVF... | |
# -*- coding: utf-8 -*-
"""
HMS Hospital Status Assessment and Request Management System
@author: nursix
"""
module = request.controller
resourcename = request.function
if not deployment_settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# --------------------------------... | |
#!/usr/bin/env python
"""This program is a five in row game, which is used for the coding
camp 2015 in WindRiver.com"""
import os
import sys, getopt
import pygame as pg
import threading
import json
from toolbox import button
from toolbox import tools
from AI import searcher
import time
from REC import chess_board_rec... | |
#!/usr/bin/env python
# encoding: utf-8
import os
from modularodm import Q
from modularodm.exceptions import ModularOdmException
from framework.auth.core import User
from website import settings
from website.app import init_app
from website.conferences.model import Conference
def main():
init_app(set_backends... | |
# -*- coding: utf-8 -*-
"""
hpack/hpack
~~~~~~~~~~~
Implements the HPACK header compression algorithm as detailed by the IETF.
"""
import logging
from .table import HeaderTable, table_entry_size
from .compat import to_byte, to_bytes
from .exceptions import (
HPACKDecodingError, OversizedHeaderListError, InvalidTa... | |
from pyqtgraph.Qt import QtGui, QtCore
from .UIGraphicsItem import UIGraphicsItem
from .InfiniteLine import InfiniteLine
import pyqtgraph.functions as fn
import pyqtgraph.debug as debug
__all__ = ['LinearRegionItem']
class LinearRegionItem(UIGraphicsItem):
"""
**Bases:** :class:`UIGraphicsItem <pyqtgraph.UIGr... | |
"""
conway.py
Author: <your name here>
Credit: <list sources used, if any>
Assignment:
Write and submit a program that plays Conway's Game of Life, per
https://github.com/HHS-IntroProgramming/Conway-Life
from ggame import App, RectangleAsset, ImageAsset, Sprite, LineStyle, Color, Frame
class Cubey(Sprite):
def ... | |
import copy
import pytest
from ray.autoscaler._private.aws.config import _get_vpc_id_or_die, \
bootstrap_aws, log_to_cli, \
DEFAULT_AMI
import ray.tests.aws.utils.stubs as stubs
import ray.tests.aws.utils.helpers as helpers
from ray.tests.aws.utils.constants import AUX_SUBNET, DEFAULT_SUBNET, \
DEFAULT_SG... | |
# Copyright 2019 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... | |
from ga_ows.views.wms.base import WMSAdapterBase, WMSCache
from django.contrib.gis.geos import Point
from osgeo import osr
from ga_ows.rendering.cairo_geodjango_renderer import RenderingContext
from ga_ows.utils import create_spatialref
class OGRDatasetCollectionAdapter(WMSAdapterBase):
def __init__(self, collect... | |
import dj_database_url
import os
from django.core.urlresolvers import reverse_lazy
from django.utils.six.moves.urllib import parse
try:
from prod import environ
environ.update(os.environ.__dict__)
except ImportError:
environ = os.environ
OUR_ROOT = os.path.realpath(os.path.dirname(__file__))
DEBUG = bo... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
"""Copyright 2008 Orbitz WorldWide
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... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
<<<<<<< HEAD
<<<<<<< HEAD
"""Test program for the fcntl C module.
"""
import platform
import os
import struct
import sys
import unittest
from test.support import (verbose, TESTFN, unlink, run_unittest, import_module,
cpython_only)
# Skip test if no fcntl module.
fcntl = import_module('fcntl')... | |
writePdbAA = {'A' : {
'Res_name': 'ALA',
'atoms':['N','CA','C','O','CB'],
'atom_type':['N','C','C','O','C']},
'Ala' : {
'Res_name': 'ALA',
'atoms':['N','CA','C','O','CB'],
'atom_type':['N','C','C','O','C']},
'R' : {
'Res_name': 'ARG',
'atoms':['N','CA','C','O',... | |
"""
.. todo::
WRITEME
"""
import logging
import warnings
from .general import is_iterable, contains_nan, contains_inf, isfinite
import theano
from theano.compat.six.moves import input, zip as izip
# Delay import of pylearn2.config.yaml_parse and pylearn2.datasets.control
# to avoid circular imports
yaml_parse = N... | |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module tests some of the methods related to the ``ECSV``
reader/writer.
"""
from astropy.table.column import MaskedColumn
import os
import copy
import sys
from io import StringIO
from contextlib import nullcontext
import pytest
import numpy as n... | |
# Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
from collections import OrderedDict
import os
import shutil
import signal
import time
import traceback
import gevent
import gevent.event
import gevent.queue
from . import utils
from .config import config_value... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... | |
#!/usr/bin/python
##############################################################################################
#AUTHOR: JOSH MADELEY
#CONTACT: JOSH.MADELEY@ME.COM
#VERSION 1.0
#PYTHON LOG PARSER. WILL LOOK FOR THE DESTINATION IP ADDRESS OF A VPN LOG AND DO A GEOIP LOOKUP.
#ADD TIMESTAMP TO CACHE###
#THIS SCRIPT IS DE... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""This file is part of the django ERP project.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND... | |
# Copyright 2019 Fortinet, Inc.
#
# 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 the... | |
"""XML-RPC methods of Zinnia metaWeblog API"""
import os
from datetime import datetime
from xmlrpclib import Fault
from xmlrpclib import DateTime
from django.conf import settings
from django.utils import timezone
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.... | |
# Copyright 2015 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 2010-2015 RethinkDB, all rights reserved.
__all__ = ['expr', 'RqlQuery', 'ReQLEncoder', 'ReQLDecoder']
import datetime
import collections
import base64
import binascii
import json as py_json
import threading
from .errors import ReqlDriverError, ReqlDriverCompileError, QueryPrinter, T
from . import ql2_pb... | |
import sys
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import generic_dna
from Bio import SeqIO
import numpy
import math
import itertools as it
MATERNALFASTAFILENAMELISTFILENAME = sys.argv[1]
PATERNALFASTAFILENAMELISTFILENAME = sys.argv[2]
PEAKHEIGHTFILENAME = sys.argv[3]
VALUEFILENAM... | |
import os
import sys
import string
import binwalk.core.common as common
from binwalk.core.compat import *
from binwalk.core.module import Module, Option, Kwarg
class HexDiff(Module):
COLORS = {
'red' : '31',
'green' : '32',
'blue' : '34',
}
SEPERATORS = ['\\', '/']
DEFAULT... | |
#
# File : building.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
#
# 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 of... | |
# -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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... | |
import logging
import re
import copy
from collections import OrderedDict
#: Macro regex
RE_MACRO = re.compile(r'\$\{(.+?)\}')
#: Macro variable regex
RE_MACRO_VAR = re.compile(r'[a-z][a-z0-9\._]*', flags=re.IGNORECASE)
class Context(OrderedDict):
"""
An environment variable and context
"""
@staticmethod
def ... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2021, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | |
from model.contact import Contact
import re
class ContactHelper:
def __init__(self, app):
self.app = app
def change_field_value(self, field_name, text):
wd = self.app.wd
if text is not None:
wd.find_element_by_name(field_name).click()
wd.find_element_by_name(fi... | |
# Copyright 2016 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... | |
import pytest
from great_expectations.core import ExpectationConfiguration
from great_expectations.core.expectation_validation_result import (
ExpectationValidationResult,
)
from great_expectations.data_asset import DataAsset
from great_expectations.dataset import MetaPandasDataset, PandasDataset
class Expectati... | |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Initialize RBAC"""
import datetime
import itertools
import sqlalchemy.orm
from sqlalchemy import and_
from sqlalchemy import case
from sqlalchemy import literal
from sqlalchemy import or_
from sqlalchem... | |
###
# StBot Base 64 core lib revised
#
# Filename: stbot64_core
# Author: StBot
# Date: June 18, 2013
# Version: 1.0
#
###
# Revisions
# FILE rewrite ON 6/18/13 - learning python it was ugly
# 6/18/13
# 1. better name scheem and documentation
# 2. Replced flag Names to ... | |
r"""
# send in job name and kwargs for slurm params:
>>> s = Slurm("job-name", {"account": "ucgd-kp", "partition": "ucgd-kp"})
>>> print(str(s))
#!/bin/bash
<BLANKLINE>
#SBATCH -e logs/job-name.%J.err
#SBATCH -o logs/job-name.%J.out
#SBATCH -J job-name
<BLANKLINE>
#SBATCH --account=ucgd-kp
#SBATCH --partition=ucgd-kp
#... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Yahoo! 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... | |
# nxt.motor module -- Class to control LEGO Mindstorms NXT motors
# Copyright (C) 2006 Douglas P Lau
# Copyright (C) 2009 Marcus Wanner, rhn
# Copyright (C) 2010 rhn
#
# 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 F... | |
# Copyright 2011 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... | |
"""This module implements a number of functions that can be used to
validate INDRA Statements. The available functions include ones that
raise custom exceptions derived from ValueError if an invalidity is
found. These come with a helpful error message that can be caught
and printed to learn about the specific issue. An... | |
# topsort - dependency (topological) sorting and cycle finding functions
# Copyright (C) 2007 RADLogic
#
# This library 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;
# version 2.1 of the License.
# ... | |
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from builtins import str as unicode
from quark_runtime import *
_lazyImport.plug("slackpack_md.slack_event_SlackEvent_load_Method")
import quark.reflect
class slack_even... | |
"""Class of Augeas Configurators."""
import logging
import augeas
from certbot import errors
from certbot import reverter
from certbot.plugins import common
from certbot_apache import constants
logger = logging.getLogger(__name__)
class AugeasConfigurator(common.Plugin):
"""Base Augeas Configurator class.
... | |
""" Module providing a basic routine for plotting a shot overview """
# Built-in
import warnings
# Common
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
# tofu
try:
from tofu.version import __version__
import tofu.utils as utils
except Exception:
from tofu.vers... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_txbalanced
----------------------------------
Tests for `txbalanced` module.
"""
from twisted.trial import unittest
import txbalanced
import mock
import treq
import json
import glob
import os
import datetime
from twisted.internet import defer
from twisted.web.c... | |
import pyshark
import collections
import time
import operator
import logging
import serial
import struct
import socket
### LOGGING AND SERIAL SETUP ###################################################
logging.basicConfig(level=logging.WARNING,
format='%(asctime)s %(levelname)s %(message)s',
... | |
__author__ = 'Dennis'
from log import Log
from visualize import *
class Sensor(object):
def __init__(self):
"""
Attributes
----------
observations
Reference to the observations list of the Entity with this Sensor.
signals : {name: [value]}
"""
s... | |
'''
Multipoint communication service protocol (T.125)
'''
import logging
import ptypes
from ptypes import *
from protocol import gcc, ber, per
ptypes.setbyteorder(ptypes.config.byteorder.bigendian)
### MCS protocol data (BER Encoding)
class Protocol(ber.Protocol.copy(recurse=True)):
pass
class Element(ber.Eleme... | |
# GUI Application automation and testing library
# Copyright (C) 2006-2017 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# ... | |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
from collections import OrderedDict
import numpy as np
import theano
theano.config.compute_test_value = 'raise'
import theano.tensor as T
from layers import (AffineLayer, ConvBiasLayer, ConvLayer, Dropout,
MaxPoolLayer, RandCropAndFlip, Relu, Softmax, R... | |
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI
from toontown.fishing import BingoGlobals
from toontown.fishing import FishGlobals
from toontown.toonbase import ToontownGlobals
from toontown.fishing.NormalBingo import NormalBingo
from toontown.fi... | |
"""
Soft Voting/Majority Rule classifier.
This module contains a Soft Voting/Majority Rule classifier for
classification estimators.
"""
# Authors: Sebastian Raschka <se.raschka@gmail.com>,
# Gilles Louppe <g.louppe@gmail.com>
#
# License: BSD 3 clause
import numpy as np
import warnings
from ..base import... | |
import re
import urllib
REGEXP_TYPE = type(re.compile(''))
PATH_REGEXP = re.compile('|'.join([
# Match escaped characters that would otherwise appear in future matches.
# This allows the user to escape special characters that won't transform.
'(\\\\.)',
# Match Express-style parameters and un-named par... | |
#
# 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 ... | |
#!/usr/bin/env python3
# Copyright (c) 2020-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test coinstatsindex across nodes.
Test that the values returned by gettxoutsetinfo are consistent
betw... | |
# -*- coding: utf-8 -*-
# File: graph.py
""" Graph related callbacks"""
import numpy as np
import os
from ..compat import tfv1 as tf
from ..tfutils.common import get_op_tensor_name
from ..utils import logger
from .base import Callback
__all__ = ['RunOp', 'RunUpdateOps', 'ProcessTensors', 'DumpTensors',
... | |
# This file is part of Moksha.
# Copyright (C) 2008-2010 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 b... | |
# Copyright (c) 2011 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 ... | |
# Copyright 2016 Pinterest, 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 agreed to in writi... | |
# Copyright 2013: Mirantis 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 required b... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you m... | |
#!/usr/bin/env python2.7
"""
File : storage.py
Author : Bjorn Barrefors <bjorn dot peter dot barrefors AT cern dot ch>
Description: Maintain a mongodb instance which is used for caching data, store calculated data and logging
"""
# system modules
import logging
import datetime
from subprocess import call
fro... | |
import weakref
import threading
from base64 import b64encode, b64decode
from idiokit.xmlcore import Element
from . import rules
class NameAlreadyRegistered(Exception):
pass
class UnregisteredType(Exception):
pass
class UnregisteredName(Exception):
pass
class Serializer(object):
def __init__(sel... | |
# -*- coding: utf-8 -*-
"""Tests for the ZMQ Broker"""
import pytest
import six
from .broker import ZMQBroker
from .protocol import ZMQCauldronMessage
from ..conftest import fail_if_not_teardown, available_backends
import time
pytestmark = pytest.mark.skipif("zmq" not in available_backends, reason="requires zmq")
@... | |
"""Tests the HASS workday binary sensor."""
from freezegun import freeze_time
from homeassistant.components.binary_sensor.workday import day_to_string
from homeassistant.setup import setup_component
from tests.common import (
get_test_home_assistant, assert_setup_component)
class TestWorkdaySetup(object):
""... | |
#!/usr/bin/env python
# Copyright 2013 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.