content string |
|---|
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from flexget import plugin
from flexget.event import event
from . import seen as plugin_seen
class FilterSeenInfoHash(plugin_seen.FilterSeen):
"""Prevents the same t... |
import dbus, dbus.service
import datetime as dt
from calendar import timegm
import gio
from lib import stuff
def to_dbus_fact(fact):
"""Perform the conversion between fact database query and
dbus supported data types
"""
return (fact['id'],
timegm(fact['start_time'].timetuple()),
... |
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "django-tellafriend",
version = __import__('tellafriend').get_version(),
author = "Philipp Bosch",
author_email = "<EMAIL>",
description = "Te... |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2014-2020 OSMC (KodeKarnage)
This file is part of script.module.osmcsetting.services
SPDX-License-Identifier: GPL-2.0-or-later
See LICENSES/GPL-2.0-or-later for more information.
"""
import os
import subprocess
from collections import OrderedDict
from io impo... |
import time
import unittest
import config
import node
LEADER = 1
ROUTER1 = 2
ROUTER2 = 3
ED = 4
class Cert_6_1_5_RouterAttachLinkQuality(unittest.TestCase):
def setUp(self):
self.simulator = config.create_default_simulator()
self.nodes = {}
for i in range(1,5):
self.nodes[i] ... |
"""
Given node.function instance, apply it
to argument list, such as ["i","d"]
and return the result.
"""
import node,options
from node import extend,exceptions
callstack = set()
@extend(node.function)
@exceptions
def apply(self,args,symtab):
name = self.head.ident.name
if name in callstack:
return
... |
#Page 45, Figure 4.6
def factI(n):
"""Assumes that n is an int > 0
Returns n!"""
result = 1
while n > 1:
result = result * n
n -= 1
return result
def factR(n):
"""Assumes that n is an int > 0
Returns n!"""
if n == 1:
return n
else:
return n*factR(n - 1)
#Pa... |
# -*- encoding: utf-8 -*-
from oas.oas_api import OASAPI
from oas.ease.vault import Vault
import json
import datetime
from dateutil import rrule
# 阿里云oas定期删除归档
# 载入数据
def load(file_path):
with open(file_path) as json_file:
data = json.load(json_file)
return data
# 计算日期差
def days_between(start_dat... |
from django.shortcuts import render
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from django.core import serializers
from website.models import ApartmentsNY
def home(request):
return render(request, 'website/home.html')
def info(reques... |
"""
DXApplet Handler
++++++++++++++++
Applets are data objects that store application logic, including
specifications for executing it, and (optionally) input and output
signatures. They can be run by calling the :func:`DXApplet.run` method.
"""
from __future__ import print_function, unicode_literals, division, abso... |
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, FieldList, BooleanField, SelectField
from wtforms.validators import DataRequired, Email, Required
age_choices = [
('Age 15-24', 'Age 15-24'),
('Age 25-44', 'Age 25-44'),
('Age 45-64', 'Age 45-64'),
('Age 65+', 'Age 65+')]
... |
"""Contains the logic for `aq show service address`."""
from aquilon.aqdb.model import ServiceAddress
from aquilon.worker.broker import BrokerCommand # pylint: disable=W0611
from aquilon.worker.commands.show_resource import CommandShowResource
class CommandShowServiceAddress(CommandShowResource):
resource_clas... |
"""
quotation module - Functions to be used in the Structured Perceptron algorithm,
specifics for the Quotation Extraction Task.
"""
__version__="1.0"
import numpy as np
from qextractor.wis import wis
def argmax(w, e, loss=0):
"""Function that predicts the Quotation and the Author, given an example.
Args:
... |
import re
import rfc3987
from jsonschema_serialize_fork import FormatChecker
from pyramid.threadlocal import get_current_request
from uuid import UUID
accession_re = re.compile(r'^ENC(FF|SR|AB|BS|DO|GM|LB|PL|AN)[0-9][0-9][0-9][A-Z][A-Z][A-Z]$')
test_accession_re = re.compile(r'^TST(FF|SR|AB|BS|DO|GM|LB|PL|AN)[0-9][0-9... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from ansible.compat.tests.mock import patch
from ansible.modules.network.ios import ios_vlan
from ansible.modules.network.ios.ios_vlan import parse_vlan_brief
from units.modules.utils import set_module_args
from .ios_m... |
"""
Testsuite for Topology PyNEST Interface.
This testsuite mainly tests the PyNEST interface to the
topology module, not the underlying topology module functions.
It also tests the visualization functions that are available
in PyNEST only.
"""
import unittest
from nest.tests import compatibility
from . import tes... |
import os
import re
from xml.etree import ElementTree
import requests
import platform
from webdriver_manager.logger import log
from webdriver_manager.utils import (
validate_response,
chrome_version,
ChromeType,
os_name,
OSType,
firefox_version,
)
class Driver(object):
def __init__(self,... |
# -*- python -*-
# stdlib imports ---
import os
import os.path as osp
# waf imports ---
import waflib.Utils
import waflib.Logs as msg
from waflib.Configure import conf
#
_heptooldir = osp.dirname(osp.abspath(__file__))
def options(ctx):
ctx.load('hwaf-base', tooldir=_heptooldir)
ctx.add_option(
'--w... |
from console import console
from graphic import GraphicChar
import icon
import settings
class InstantAnimation(object):
def __init__(self, game_state):
self.game_state = game_state
def run_animation(self):
pass
class MissileAnimation(InstantAnimation):
def __init__(self, game_state, sym... |
# -*- coding: ascii -*-
import sys, os, os.path
import unittest, doctest
import cPickle as pickle
from datetime import datetime, tzinfo, timedelta
if __name__ == '__main__':
# Only munge path if invoked as a script. Testrunners should have setup
# the paths already
sys.path.insert(0, os.path.abspath(os.pa... |
"""A module that provides rapt authentication errors."""
class ReauthError(Exception):
"""Base exception for reauthentication."""
pass
class ReauthUnattendedError(ReauthError):
"""An exception for when reauth cannot be answered."""
def __init__(self):
super(ReauthUnattendedError, self).__init__(
... |
#!/usr/bin/env python
# cardinal_pythonlib/sqlalchemy/alembic_func.py
"""
===============================================================================
Original code copyright (C) 2009-2021 Rudolf Cardinal (<EMAIL>).
This file is part of cardinal_pythonlib.
Licensed under the Apache License, Version 2... |
"""
.. module:: anyconfig
:platform: Unix, Windows
:synopsis: Generic interface to loaders for various config file formats.
Instead of::
import json, yaml
jd = json.load(open("foo.json"))
yd = yaml.load(open("bar.yaml"))
...
json.dump(open("foo-new.json", w))
yaml.dump(open("bar-new.... |
import sys
import getopt
from giantcellsim_motifoutput import giantcellsim_motifoutput
from giantcellsim_fulltrialoutput import giantcellsim_fulltrialoutput
from giantcellsim_allstrandoutput import giantcellsim_allstrandoutput
def usage():
print "Running a Motif Simulation using the parameters designated by options\n... |
#!/usr/bin/python
# Title: arm_controller.py
#
# Description:
# This program offers higher level functions for controlling arm movement based on
# the controllerManager program from the gripper_reactive_approach package.
# run this program with this launch files:
# roslaunch pr2_tabletop_manipulation_launch pr2_table... |
from chapter02.exercise2_3_5 import iterative_binary_search
from chapter02.textbook2_3 import merge
from datastructures.array import Array
from util import between
def dynamic_binary_search(A, x):
k = A.length
for i in between(0, k - 1):
if A.length != 0:
j = iterative_binary_search(A[i], ... |
# This testfile tests SymPy <-> Sage compatibility
#
# Execute this test inside Sage, e.g. with:
# sage -python bin/test sympy/test_external/test_sage.py
#
# This file can be tested by Sage itself by:
# sage -t sympy/test_external/test_sage.py
# and if all tests pass, it should be copied (verbatim) to Sage, so that it ... |
"""
Support for fetching WiFi associations through SNMP.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.snmp/
"""
import binascii
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassis... |
# __openerp__.py
{
'name': 'Amdeb Amazon Integration',
'summary': 'Integrate Amazon Marketplace as an Odoo sales channel',
'version': '0.2',
'category': 'Amdeb Integration',
'website': 'https://github.com/amdeb/amdeb-amazon',
'author': 'Amdeb Developers',
'description': """
Amdeb Amazon Int... |
from setup import tc, rm, get_sandbox_path
import logging
logger = logging.getLogger(__name__)
import os
def test_arima_save_load(tc):
ts = [12.88969427, 13.54964408, 13.8432745, 12.13843611, 12.81156092, 14.2499628, 15.12102595]
save_path = "sandbox/arima_save_test"
original_model = tc.models.timeseries.... |
from lia.analysis.AnalyzerUtils import AnalyzerUtils
from lia.analysis.synonym.WordNetSynonymEngine import WordNetSynonymEngine
from lia.analysis.synonym.SynonymAnalyzer import SynonymAnalyzer
class SynonymAnalyzerViewer(object):
def main(cls, argv):
engine = WordNetSynonymEngine(argv[1])
text ... |
"""Lint checks of other file types."""
from __future__ import absolute_import # pylint: disable=import-only-modules
from __future__ import unicode_literals # pylint: disable=import-only-modules
import glob
import json
import os
import python_utils
from .. import concurrent_task_utils
STRICT_TS_CONFIG_FILE_NAME ... |
from __future__ import print_function
import sys
import argparse
def usage(error_message):
"""Display the usage message describing how to use owtf."""
full_path = sys.argv[0].strip()
main = full_path.split('/')[-1]
print("Current Path: " + full_path)
print(
"Syntax: " + main +
" [... |
from spack import *
class PyTyping(PythonPackage):
"""This is a backport of the standard library typing module to Python
versions older than 3.6."""
homepage = "https://docs.python.org/3/library/typing.html"
url = "https://pypi.io/packages/source/t/typing/typing-3.7.4.1.tar.gz"
import_modul... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import difflib
import json
import sys
import warnings
from copy import deepcopy
from ansiblite import constants as C
from ansiblite.utils._text import to_text
from ansiblite.utils.color import stringc
from ansiblite.vars import st... |
class Email:
client = None
optional_arguments = [
"antispamlevel",
"antivirus",
"autorespond",
"autorespondsaveemail",
"autorespondmessage",
"password",
"quota"
]
def __init__(self, client):
self.client = client
def overview(self):
return self.client.get("/email/overview")
def globalquota(se... |
import unittest
import mock
from apache_beam.examples.snippets.util import assert_matches_stdout
from apache_beam.testing.test_pipeline import TestPipeline
from . import min as beam_min
def check_min_element(actual):
expected = '''[START min_element]
1
[END min_element]'''.splitlines()[1:-1]
assert_matches_std... |
from fits import *
import numpy as np
import unittest
class TestSlices(unittest.TestCase):
def setUp(self):
T = tabledata()
T.x1 = np.arange(10).astype(int)
T.x2 = np.arange(10).astype(float)
T.x3 = [i for i in range(10)]
T.x4 = tuple([i for i in range(10)])
self.assertEqual(len(T), 10)
T.about()
sel... |
"""Network constants and associated functions."""
import copy
from collections import defaultdict
from typing import Dict, List, TypedDict, Union
from .curve import Curve
from .curves import secp256k1
class Network(TypedDict):
curve: Curve
wif: bytes
p2pkh: bytes
p2sh: bytes
p2w: str
bip32_p... |
import six
from mistral.lang import types
from mistral.lang.v2 import base
class RetrySpec(base.BaseSpec):
# See http://json-schema.org
_retry_dict_schema = {
"type": "object",
"properties": {
"count": {
"oneOf": [
types.EXPRESSION,
... |
#!/usr/bin/env python
import os
import sys
import requests
from bs4 import BeautifulSoup
def get_movie():
"""Gets the movie name from user and formats it."""
try:
movie_name = raw_input("Enter movie name : ")
query = (movie_name).replace(' ', '%20')+'/'
except Exception as e:
pri... |
# -*- coding: utf-8 -*-
"""
Test pwb.py.
If pwb.py does not load python files as expected, more tests from coverage
should be added locally.
https://bitbucket.org/ned/coveragepy/src/default/tests/test_execfile.py
"""
#
# (C) Pywikibot team, 2007-2019
#
# Distributed under the terms of the MIT license.
#
from __future_... |
"""
Check that resetting the hdfs module after changing
os.environ['HADOOP_CONF_DIR'] works (i.e., Pydoop references the
correct HDFS service).
Note that it does **NOT** work if you've already instantiated an hdfs
handle, and this is NOT due to the caching system.
"""
import sys
import os
import argparse
import pydo... |
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <<EMAIL>>'
__docformat__ = 'restructuredtext en'
import os
import logging
from logging.handlers import RotatingFileHandler
import cherrypy
from cherrypy.process.plugins import SimplePl... |
"""
The Bundle object is the primary manipulator for Treants in aggregate.
They are returned as queries to Groups, Coordinators, and other Bundles. They
offer convenience methods for dealing with many Treants at once.
"""
import os
import numpy as np
import multiprocessing as mp
import glob
import fnmatch
from datre... |
def setup_path():
"""Sets up the python include paths to include src"""
import os.path; import sys
if sys.argv[0]:
top_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
sys.path = [os.path.join(top_dir, "src")] + sys.path
pass
return
def main():
setup_path()
from mo... |
import abc
import six
from poppy.notification.base import controller
@six.add_metaclass(abc.ABCMeta)
class ServicesControllerBase(controller.NotificationControllerBase):
"""Services Controller Base class."""
def __init__(self, driver):
super(ServicesControllerBase, self).__init__(driver)
def ... |
import json
import os
import shutil
import subprocess
import sys
import time
import unittest
from .. import constants
class ScriptTestCase(unittest.TestCase):
"""
Tests for command-line scripts
"""
@classmethod
def setUpClass(cls):
cls.tests_dir = os.path.abspath(os.path.dirname(__file__)... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
from django.utils.translation import ugettext_lazy as _
from ..forms import EmailUniqueMixin
User = get_u... |
#!/usr/bin/env python
import config
from comodit_client.api import Client
from comodit_client.api.application import Package
from comodit_client.api.collection import EntityNotFoundException
from comodit_client.api.importer import Import
def setup():
# Connect to the ComodIT API
client = Client(config.endpo... |
from __future__ import division, absolute_import, print_function
import sys
import numpy as np
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_raises,
assert_array_equal, HAS_REFCOUNT
)
class TestTake(TestCase):
def test_simple(self):
a = [[1, 2], [3, 4]]
a_str = ... |
"""WebJournal Regression Test Suite."""
__revision__ = "$Id$"
import datetime
import unittest
import urllib
from invenio import webjournal_utils as wju
from invenio.config import CFG_SITE_URL, \
CFG_SITE_LANG, \
CFG_SITE_SUPPORT_EMAIL
from invenio.testutils import... |
#!/usr/bin/env python
import codecs
import os
from setuptools import setup
def read(*parts):
filename = os.path.join(os.path.dirname(__file__), *parts)
with codecs.open(filename, encoding='utf-8') as fp:
return fp.read()
setup(
name='django-dynamic-forms',
version='0.4.0.post3',
descrip... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""rna_pairs2SimRNArestrs.py - convert pairs to SimRNA restraints
Example::
$ rna_pairs2SimRNArestrs.py rp06_pairs_delta.txt -v
# of pairs: 42
SLOPE A/2/MB A/172/MB 0 6 1
SLOPE A/2/MB A/172/MB 0 7 -1
SLOPE A/3/MB A/169/MB 0 6 1
SLOPE A/3/MB A/169/M... |
# -*- coding: utf-8 -*-
"""
pyvisa-py.tcpip
~~~~~~~~~~~~~~~~
TCPIP Session implementation using Python Standard library.
:copyright: 2014 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
import random
from pyvisa import constants, attributes
... |
import os
from qtpy import QtCore, QtGui, QtWidgets, QtWebEngineWidgets
def assert_pyside():
"""
Make sure that we are using PySide
"""
import PySide
assert QtCore.QEvent is PySide.QtCore.QEvent
assert QtGui.QPainter is PySide.QtGui.QPainter
assert QtWidgets.QWidget is PySide.QtGui.QWidge... |
import logging
import os
import signal
import time
import uuid
from openerp.tools import config
from openerp.service import web_services
from openerp.service.web_services import objects_proxy, report_spool, wizard
_logger = logging.getLogger('openerp.smile_detective')
web_services._requests = {}
_requests = web_servi... |
from combat import targets
from combat.attackresult import AttackResult
from combat.attacks.base import Attack
from combat.enums import DamageType
from echo import functions
from stats.enums import StatsEnum
from util import check_roller, gridhelpers
from util.dice import Dice, DiceStack
class MeleeAttack(Attack):
... |
# Adapted from flask_mail
import time
import requests
import sys
from requests.auth import HTTPBasicAuth
from flask_mail import Message, BadHeaderError, sanitize_addresses, email_dispatched, contextmanager, current_app
class Connection(object):
def __init__(self, mail):
self.mail = mail
def __enter__(s... |
#!/usr/bin/env python
import sys
from pulp import LpVariable, LpBinary, lpSum, value, LpProblem, LpMaximize, LpAffineExpression
try:
import path
except ImportError:
pass
try:
import src.dippy as dippy
from src.dippy import DipSolStatOptimal
except ImportError:
import coinor.dippy... |
r"""
Plotting functions related to Batch Parameter Estimation.
Notes
-----
#. Written by David C. Stauffer in July 2016.
#. Moved to joint plotting submodule by David C. Stauffer in July 2020.
"""
#%% Imports
import doctest
import unittest
from dstauffman import HAVE_MPL, HAVE_NUMPY
from dstauffman.plotting.plott... |
import time
import pulsar
from pulsar import _pulsar
from fate_arch.common import log
LOGGER = log.getLogger()
CHANNEL_TYPE_PRODUCER = 'producer'
CHANNEL_TYPE_CONSUMER = 'consumer'
DEFAULT_TENANT = 'fl-tenant'
DEFAULT_CLUSTER = 'standalone'
TOPIC_PREFIX = DEFAULT_TENANT + '/{}/{}'
UNIQUE_PRODUCER_NAME = 'unique_produ... |
import time
from carrot.consumer import ConsumerSet, LOGGING_FORMAT
from carrot.models import ScheduledTask
from carrot.objects import VirtualHost
from carrot.scheduler import ScheduledTaskManager
from django.core.management.base import BaseCommand, CommandParser
from django.conf import settings
from carrot import DEF... |
from oslo_db import exception as db_exc
from oslo_log import log as logging
import sqlalchemy.exc as sa_exc
import sqlalchemy.orm as sa_orm
from glance.common import exception as exc
import glance.db.sqlalchemy.metadef_api.utils as metadef_utils
from glance.db.sqlalchemy import models_metadef as models
LOG = logging.... |
#!/usr/bin/env python
# encoding: utf-8
# ----------------------------------------------------------------------------
from setuptools import setup
from django_mailer import get_version
setup(
name='django-mailer-2',
version=get_version(),
description=("A reusable Django app for queueing the sending of em... |
"""
Test dbcollection/utils/string_ascii.py.
"""
import pytest
import numpy as np
from dbcollection.utils.string_ascii import (
str_to_ascii,
ascii_to_str,
convert_str_to_ascii,
convert_ascii_to_str
)
testdata_single_string = [
('string1', [115, 116, 114, 105, 110, 103, 49]),
('string2', [1... |
"""Tests for Autograph lists."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.autograph.utils import tensor_list as tl
from tensorflow.python.client.session import Session
from tensorflow.python.eager import context
from tensorflo... |
import unittest
from ppp_datamodel import Missing, Triple, Resource, Sentence, List
from ppp_datamodel import Intersection, JsonldResource
from ppp_datamodel.communication import Request, TraceItem, Response
from ppp_libmodule.tests import PPPTestCase
from ppp_hal import app
# Spambot-proof
EC_ID = 'http://graal.ens-... |
# coding: utf-8
# In[32]:
import pandas as pd
import plotly
import plotly.plotly as py
from plotly.graph_objs import *
import matplotlib.pyplot as plt
import plotly.tools as tls
# In[ ]:
plotly.tools.set_credentials_file(username='DemoAccount', api_key='lr1c37zw81')
# In[87]:
df = pd.read_csv('../data/cs-tra... |
import os
from django.contrib.auth.models import Permission, User
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.test import TestCase, Client, override_settings, modify_settings
from glitter.blocks.html.models import HTML
from glitter.models import ... |
from slicc.symbols.Symbol import Symbol
class Transition(Symbol):
def __init__(self, table, machine, state, event, nextState, actions,
location, pairs):
ident = "%s|%s" % (state, event)
super(Transition, self).__init__(table, ident, location, pairs)
self.state = machine.st... |
import numpy as np
from GPyOpt.models.base import BOModel
class MockModel(BOModel):
def __init__(self):
self.params = []
self.X = []
self.Y = []
def f(self, x):
return np.dot(np.insert(x, 0, 1.0), self.params)
def updateModel(self, X_all, Y_all, X_new, Y_new):
sel... |
import time
import storjnode
from kademlia.node import Node
from crochet import TimeoutError
from threading import Thread
from threading import RLock
from storjnode import util
from storjnode.common import THREAD_SLEEP
from storjnode.network.server import QUERY_TIMEOUT
_log = storjnode.log.getLogger(__name__)
class... |
import os
from io import BytesIO
import pytest
from twitter.common.contextutil import temporary_dir
from apache.aurora.client import config
from apache.aurora.client.config import get_config as get_aurora_config
from apache.aurora.config import AuroraConfig
from apache.aurora.config.loader import AuroraConfigLoader
f... |
from azure.cli.core.commands import register_cli_argument
from azure.mgmt.web import WebSiteManagementClient
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.cli.core.commands.parameters import (resource_group_name_type, location_type,
... |
# -*- coding: utf-8 -*-
"""Pyplis test module for image.py base module of Pyplis.
Author: Jonas Gliss
Email: <EMAIL>
License: GPLv3+
"""
from __future__ import (absolute_import, division)
from pyplis import Img, __dir__ as pyplis__dir__
from os.path import join, exists
from numpy import nan, zeros
from numpy.testing ... |
"""
Collection of utils for working with the
PCRaster python bindings.
"""
import os.path
import numpy
from math import *
try:
from PCRaster import *
from PCRaster.Framework import *
from PCRaster.NumPy import *
except ImportError:
from pcraster import *
from pcraster.framework import *
#from ... |
from django.contrib.auth.models import User
from django.core import mail
from django.test import TestCase
from mock import patch
from requests.exceptions import ReadTimeout
from hc.api.models import Channel, Check, Notification
class NotifyTestCase(TestCase):
def _setup_data(self, channel_kind, channel_value, e... |
import mock
from oslo.config import cfg
from nova.scheduler.filters import affinity_filter
from nova import test
from nova.tests.unit.scheduler import fakes
CONF = cfg.CONF
CONF.import_opt('my_ip', 'nova.netconf')
@mock.patch('nova.compute.api.API.get_all')
class TestDifferentHostFilter(test.NoDBTestCase):
de... |
from beritest_tools import BaseBERITestCase
class test_raw_bgezal_lt(BaseBERITestCase):
def test_before_bgezal(self):
self.assertRegisterEqual(self.MIPS.a0, 1, "instruction before bgezal missed")
def test_bgezal_branch_delay(self):
self.assertRegisterEqual(self.MIPS.a1, 2, "instruction in bra... |
__version__ = '1.0'
import os
import sys
import time
import chipsec_util
from chipsec.command import BaseCommand
from chipsec.logger import *
from chipsec.file import *
from chipsec.hal.msgbus import MsgBus
# Message Bus
class MsgBusCommand(BaseCommand):
"""
>>> chipsec_util msgbus read <po... |
from __future__ import print_function, division
import sys, os
sys.path.append(os.path.abspath("."))
from utils.lib import *
from algorithms.algorithm import Algorithm
import utils.tools as tools
from configs import moead_settings as default_settings
from algorithms.nsga3.reference import cover, DIVISIONS
from utils.di... |
import theano
from theano import tensor
from loss.loss import Loss
from theano_impl.theano_smart_layer import TheanoSmartLayer
class BinaryCrossEntropyLoss(Loss, TheanoSmartLayer):
def __init__(self, name, params, core):
TheanoSmartLayer.__init__(self, name, params, core) # this is necessary because mu... |
import numpy as np
import codecs
from collections import defaultdict
from math import log
from hashmapd.common import debug
from hashmapd.token_counts import TokenCounts
min_token_count=10 #minimum number of times a token must have been used (across all users)
skip_common_tokens_cutoff=0.0001 #skip the top 0.01% most ... |
"""Read .eeg files
"""
#
# License: BSD (3-clause)
import numpy as np
from os.path import join
from os import listdir
from ...utils import logger, warn
from ..constants import FIFF
from .res4 import _make_ctf_name
from ...transforms import apply_trans
_cardinal_dict = dict(nasion=FIFF.FIFFV_POINT_NASION,
... |
"""Operation Fox Assault Version Information"""
VERSION = (1, 5, 0, 'alpha', 1)
BASE_VERSION_STR = '.'.join([str(x) for x in VERSION[:3]])
VERSION_STR = {
'final': BASE_VERSION_STR,
'alpha': BASE_VERSION_STR + 'a' + str(VERSION[4]),
'rc': BASE_VERSION_STR + 'rc' + str(VERSION[4]),
}[VERSION[3]]
# incremem... |
name = 'jamenson'
version = '0.0.1'
from distutils.core import setup
setup(
name=name,
version=version,
url='https://github.com/matthagy/Jamenson',
author='Matt Hagy',
author_email='hagy@gatech,.edu',
description='Scheme compiler and runtime for Python',
long_description='''
Jamenson is a ... |
"""Accesses the google.cloud.talent.v4beta1 Completion API."""
import pkg_resources
import warnings
from google.oauth2 import service_account
import google.api_core.client_options
import google.api_core.gapic_v1.client_info
import google.api_core.gapic_v1.config
import google.api_core.gapic_v1.method
import google.ap... |
from openerp import models, fields, api, _
"""
Hilfsklassen für die Anzeige von Meldungen in Odoo
"""
class eq_message(models.TransientModel):
_name = "eq_message"
eq_info = fields.Char("Info")
eq_message_text = fields.Char("Message")
class eq_prot_message(models.TransientModel):
_inhe... |
from controller_class import *
class CustomerController(ShopController):
"""creates a controller to add/delete/amend customer records in the
myshop database"""
def __init__(self):
super(CustomerController,self).__init__()
def add_customer(self,fn,ln,sa,t,pc,tn):
sql = """insert in... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cbh_chembl_model_extension', '0024_auto_20150806_0115'),
]
state_operations = [
migrations.RemoveField(
model_na... |
from invenio.bibworkflow_worker_engine import (run_worker,
restart_worker,
continue_worker)
from invenio.celery import celery
@celery.task(name='invenio.bibworkflow_workers.worker_celery.run_worker')
def celery_run(workflow_... |
#!/usr/bin/python
from Axon.experimental.Process import ProcessPipeline
from Axon.experimental.Process import ProcessGraphline
from Kamaelia.Chassis.Graphline import Graphline
import Axon
import time
from Kamaelia.Util.Console import ConsoleEchoer
from Kamaelia.Util.PureTransformer import PureTransformer
from Kamael... |
from twisted.internet import defer
from wiremaps.collector.helpers.speed import SpeedCollector
class MltCollector:
"""Collect data using MLT.
There are two attributes available after collection:
- C{mlt} which is a mapping from MLT ID to list of ports
- C{mltindex} which is a mapping from IF index ... |
from django.views.generic import TemplateView, View
from django.utils.translation import gettext as _
from django.db import IntegrityError, transaction
from django.urls import reverse
from django.http import HttpResponseRedirect
from django.template.loader import render_to_string
from django.shortcuts import render
fro... |
import numpy as np
import pandas as pd
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
import json
hash_embedding = pd.read_csv('../preprocessing/ner-auto-encoder-2/auto-encoder-embeddings.txt', delimiter=' ', header=None)
hash_embedding = hash_embedding.values
with open('../preprocessing/ner-... |
"""
********************************
tabulated - write tabulated file
********************************
"""
import espressopp
from espressopp import Real3D
def writeTabFile(pot, name, N, low=0.0, high=2.5, body=2):
"""
writeTabFile can be used to create a table for any potential
Parameters are:
* pot ... |
from __future__ import absolute_import, division, unicode_literals
from jx_base.expressions.expression import Expression
from jx_base.expressions.false_op import FALSE
from jx_base.expressions.literal import Literal, is_literal
from jx_base.expressions.null_op import NULL
from mo_dots import is_many
from mo_json impor... |
import frida
import sys
import time
import logging
#import analysis
import subprocess
import os, threading
class Monitor(object):
"""
this class monitor the sensitive api
"""
def __init__(self):
self.packageName = None
self.device = None
self.sensitive_api = list()
... |
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
request_path = self... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.