content
stringlengths
4
20k
from cms.plugin_pool import plugin_pool from cms.plugin_base import CMSPluginBase from .forms import MultiColumnForm from .models import MultiColumns, Column from django.utils.translation import ugettext_lazy as _ from cms.models import CMSPlugin class MultiColumnPlugin(CMSPluginBase): model = MultiColumns mo...
import unittest import hid_constants import usb_descriptors class DescriptorWithField(usb_descriptors.Descriptor): pass DescriptorWithField.AddField('bField', 'B') class DescriptorWithDefault(usb_descriptors.Descriptor): pass DescriptorWithDefault.AddField('bDefault', 'B', default=42) class DescriptorWithF...
from openerp.tests import common class TestMail(common.SavepointCase): @classmethod def _init_mock_build_email(cls): cls._build_email_args_list = [] cls._build_email_kwargs_list = [] def setUp(self): super(TestMail, self).setUp() self._build_email_args_list[:] = [] ...
from lxml import etree from requests import Session from requests.auth import HTTPBasicAuth from zeep import Client, Settings, Plugin, xsd from zeep.transports import Transport from zeep.cache import SqliteCache from zeep.plugins import HistoryPlugin from zeep.exceptions import Fault from prettytable import PrettyTabl...
from unittest import TestCase import mock from preggy import expect from thumbor.app import ( ThumborServiceApp ) from thumbor.url import Url class AppTestCase(TestCase): def test_can_create_app(self): ctx = mock.Mock() app = ThumborServiceApp(ctx) expect(app).not_to_be_null() ...
""" Copyright (c) 2003-2010 Gustavo Niemeyer <<EMAIL>> This module offers extensions to the standard Python datetime module. """ __license__ = "Simplified BSD" import datetime import calendar from six import integer_types __all__ = ["relativedelta", "MO", "TU", "WE", "TH", "FR", "SA", "SU"] class weekday(object):...
import json import avro.schema class AvroUtil(object): """Helps with handling avro files. Contains functionality that allows extraction of BigQuery tables to GCS in avro format. Attributes: bq_schema(List[google.cloud.bigquery.schema.SchemaField]): schema of BigQuery table that ...
ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'metadata_version': '1.0'} from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.ce import get_config, load_config from ansible.module_utils.ce import ce_argument_spec class NetStr...
""" This plugin adds a test id (like #1) to each test name output. After you've run once to generate test ids, you can re-run individual tests by activating the plugin and passing the ids (with or without the # prefix) instead of test names. For example, if your normal test run looks like:: % nosetests -v tests.t...
from __future__ import with_statement __license__ = 'GPL 3' __copyright__ = '2009, Kovid Goyal <<EMAIL>>' __docformat__ = 'restructuredtext en' import os, re from calibre.customize.conversion import (OutputFormatPlugin, OptionRecommendation) from calibre import CurrentDir class OEBOutput(OutputFormatPlugin)...
"""Tests for TFGAN's head.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.gan.python import namedtuples as tfgan_tuples from tensorflow.contrib.gan.python.estimator.python import head from tensorflow.python.estimator import m...
# encoding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( float_or_none, parse_age_limit, ) class TvigleIE(InfoExtractor): IE_NAME = 'tvigle' IE_DESC = 'Интернет-телевидение Tvigle.ru' _VALID_URL = r'http://(?:www\.)?tvigle\.ru/(?:[^/]+/)+(?...
from django.utils import http from django.utils import unittest class TestUtilsHttp(unittest.TestCase): def test_same_origin_true(self): # Identical self.assertTrue(http.same_origin('http://foo.com/', 'http://foo.com/')) # One with trailing slash - see #15617 self.assertTrue(http.s...
# a tour of accessing interpreter internals def call_stack(self,*args): print "------- interpreter call stack: " for i in range(self.call_level): s = self.sub_context[i] print "%d: position=%d sequence_number=%d filename=%s subname=%s context_status=%x" % (i, s.position, s.sequence_number,s.fil...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): depends_on = ( ('shop', '0012_auto__add_field_extraorderpricefield_data'), ('shop_richproduct', '0...
"""Adapter-style interface registry See Adapter class. """ from zope.interface import Declaration def _flatten(implements, include_None=0): try: r = implements.flattened() except AttributeError: if implements is None: r=() else: r = Declaration(implements).flat...
import dataclasses from typing import Type, Union class A: pass dataclasses.fields(<warning descr="'dataclasses.fields' method should be called on dataclass instances or types">A</warning>) dataclasses.fields(<warning descr="'dataclasses.fields' method should be called on dataclass instances or types">A()</warn...
"""Utility for diffing a set of URL pairs defined in a config file. Example usage: ./dpxdt/tools/diff_my_urls.py \ --upload_build_id=1234 \ --release_server_prefix=https://my-dpxdt-apiserver.example.com/api \ --release_client_id=<your api key> \ --release_client_secret=<your api secret> \ --upload...
#!/usr/local/bin/python import time, sys, os import numpy as np np.errstate(invalid='ignore') from prospect.models import model_setup from prospect.io import write_results from prospect.io import read_results as pr from prospect import fitting from prospect.likelihood import lnlike_spec, lnlike_phot, write_log, chi_s...
"""SCons.Scanner.Fortran This module implements the dependency scanner for Fortran code. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated...
import logging import sys import warnings from django.conf import settings from django.core import mail from django.core.mail import get_connection from django.utils.deprecation import RemovedInNextVersionWarning from django.utils.module_loading import import_string from django.views.debug import ExceptionReporter, ge...
import statsmodels.formula.api as smf import sklearn.metrics as sm import pandas as pd import numpy as np import math import sys # The path to the data folder should be given as input if len(sys.argv) != 2: print('bitcoin.py <path to data folder>') sys.exit(1) data_path = sys.argv[1] # Reading the vectors f...
import os import unittest from telemetry import value from telemetry.page import page_set from telemetry.value import skip class TestBase(unittest.TestCase): def setUp(self): self.page_set = page_set.PageSet(file_path=os.path.dirname(__file__)) self.page_set.AddPageWithDefaultRunNavigate("http://www.bar.co...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_duration, str_to_int, ) class EpornerIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?eporner\.com/hd-porn/(?P<id>\d+)/(?P<display_id>[\w-]+)' _TEST = { 'url': ...
from datetime import date from itertools import count import pytest import numpy as np from erfa import DJM0 from astropy.time import Time, TimeFormat from astropy.time.utils import day_frac class SpecificException(ValueError): pass @pytest.fixture def custom_format_name(): for i in count(): if n...
__author__ = 'josh' """ Opens a excel workbook and indexes the respective rows """ import xlrd class SP: def __init__(self, last_name, position): self.whois = (last_name, position) def setvalues(self, values): for attr in values: setattr(self, attr, values[attr]) class AP: ...
from m5.SimObject import SimObject class PowerISA(SimObject): type = 'PowerISA' cxx_class = 'PowerISA::ISA' cxx_header = "arch/power/isa.hh"
from tests.support.asserts import assert_error, assert_success from tests.support.inline import inline check_doc = inline(""" <input id=checked type=checkbox checked> <input id=notChecked type=checkbox> """) option_doc = inline(""" <select> <option id=notSelected>r- <option id=selected sel...
""" The sax module contains a collection of classes that provide a (D)ocument (O)bject (M)odel representation of an XML document. The goal is to provide an easy, intuative interface for managing XML documents. Although, the term, DOM, is used above, this model is B{far} better. XML namespaces in suds are represented ...
#!/usr/bin/env python """Doxygen XML to SWIG docstring converter. Usage: doxy2swig.py [options] input.xml output.i Converts Doxygen generated XML files into a file containing docstrings that can be used by SWIG-1.3.x. Note that you need to get SWIG version > 1.3.23 or use Robin Dunn's docstring patch to be able t...
from unittest import TestCase import simplejson as json class TestBitSizeIntAsString(TestCase): # Python 2.5, at least the one that ships on Mac OS X, calculates # 2 ** 31 as 0! It manages to calculate 1 << 31 correctly. values = [ (200, 200), ((1 << 31) - 1, (1 << 31) - 1), ((1 <...
#!/usr/bin/env python3 """ Script to merge scripts""" import numpy as np import matplotlib.pyplot as plt script3 = np.genfromtxt('lin_sweep_kaiser_window_script3.txt') script3_1 = np.genfromtxt('lin_sweep_kaiser_window_script3_1.txt') fade_in_list = script3[:, 0] # Script3 pnr_list = script3[:, 1] spectrum_distan...
"""Metrics classes for computing the output of an evaluation.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import re from tensorflow.contrib.summary import summary_ops from tensorflow.python.eager import context from tensorflow.python.eager import fu...
#!/usr/bin/env python # -*- coding: utf-8 -*- from sqlalchemy import * from sqlalchemy.util import * from sqlalchemy.exc import * from migrate.exceptions import * from migrate.changeset import * from migrate.tests import fixture class CommonTestConstraint(fixture.DB): """helper functions to test constraints. ...
__author__ = '<EMAIL> (Jeff Scudder)' import unittest import all_tests import gdata.test_config as conf conf.options.set_value('runlive', 'true') conf.options.set_value('savecache', 'true') conf.options.set_value('clearcache', 'false') def suite(): return unittest.TestSuite((atom_tests.core_test.suite(),)) if ...
import logging import sys from optparse import OptionParser, IndentedHelpFormatter, SUPPRESS_USAGE, make_option from webkitpy.tool.grammar import pluralize _log = logging.getLogger(__name__) class TryAgain(Exception): pass class Command(object): name = None show_in_main_help = False def __init__(...
"""Tests for lite.py functionality related to TensorFlow 2.0.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from absl.testing import parameterized from six.moves import zip from tensorflow.lite.python.interpreter import Interpreter from ten...
from __future__ import print_function, division, absolute_import import posixpath from .glob import generic_glob from ..base import tokenize import pyarrow as pa class HDFS3Wrapper(pa.filesystem.DaskFileSystem): """Wrapper around `hdfs3.HDFileSystem` that allows it to be passed to pyarrow methods""" de...
import random import mock from six import moves from neutron.openstack.common import uuidutils from neutron.plugins.nec.common import ofc_client from neutron.plugins.nec.db import models as nmodels from neutron.plugins.nec import drivers from neutron.tests import base class TestConfig(object): """Configuration ...
"""Tests for tensorflow.python.framework.ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import random_seed from tensorflow.python.platform import test class RandomSeedTest(test.TestCase): def testRandomSeed(sel...
import os import shelve import threading class PerfDataEntry(object): def __init__(self): self.avg = 0.0 self.count = 0 def AddResult(self, result): kLearnRateLimiter = 99 # Greater value means slower learning. # We use an approximation of the average of the last 100 results here: # The exis...
import unittest from datetime import datetime from airflow.ti_deps.deps.not_running_dep import NotRunningDep from airflow.utils.state import State from fake_models import FakeTI class NotRunningDepTest(unittest.TestCase): def test_ti_running(self): """ Running task instances should fail this dep...
from __future__ import unicode_literals from django.db import utils from django.db.backends.base.features import BaseDatabaseFeatures from django.utils import six from django.utils.functional import cached_property from .base import Database try: import pytz except ImportError: pytz = None class DatabaseFe...
import unittest from src.possibilities import MESSAGES, Possibility as P, flatten_mult from tests.rulestestcase import tree from src.parser import Parser from tests.parser import ParserWrapper def dummy_handler(root, args): # pragma: nocover pass def dummy_handler_msg(root, args): # pragma: nocover pass...
''' DOCUMENTATION: cache: memory short_description: RAM backed, non persistent description: - RAM backed cache that is not persistent. version_added: historical author: core team (@ansible-core) ''' from __future__ import (absolute_import, division, print_function) __metaclass__ = type fr...
# coding=utf-8 import io from PIL import Image from PIL import ImageDraw from PIL import ImageColor from PIL import ImageFont from PIL import ImageOps get_color = lambda name: ImageColor.getrgb(name) def get_placeholder_image(width, height, name=None, fg_color=get_color('black'), bg_color=get_color('grey'),...
try: from pyVmomi import vim, vmodl HAS_PYVMOMI = True except ImportError: HAS_PYVMOMI = False class VMwareCluster(object): def __init__(self, module): self.module = module self.enable_ha = module.params['enable_ha'] self.enable_drs = module.params['enable_drs'] self.en...
""" Publishes an NMP package using the output generated from 'prepare_distribution_package.py' Note that this script relies on the use of Travis CI environment variables, meaning this script can only be run as part of a Travis CI build process It also requires npm-cli-login and NPM_USER, NPM_PASS and NPM_EMAIL presen...
# # script to read the version information from `../configure` # relevant lines are starting with: # `doxygen_version_major` # `doxygen_version_minor` # `doxygen_version_revision` # `doxygen_version_mmn` # the collected information is written to: `../VERSION` and `../src/version.cpp` # import sys import os # ...
# -*- coding: utf-8 -*- """ sphinx.ext.ifconfig ~~~~~~~~~~~~~~~~~~~ Provides the ``ifconfig`` directive that allows to write documentation that is included depending on configuration variables. Usage:: .. ifconfig:: releaselevel in ('alpha', 'beta', 'rc') This stuff is only in...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to manage A10 Networks slb virtual server objects (c) 2014, Mischa Peters <<EMAIL>>, Eric Chou <<EMAIL>> This file is part of Ansible Ansible is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as pu...
data = ( '', # 0x00 '', # 0x01 '', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '', # 0x14 '', # 0x15 '',...
""" Tests for wiki permissions """ from django.contrib.auth.models import Group from nose.plugins.attrib import attr from student.tests.factories import UserFactory from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from courseware.test...
import os import sys from spacewalk.common import usix _topdir = os.path.abspath(os.path.dirname(sys.argv[0])) if _topdir not in sys.path: sys.path.append(_topdir) from spacewalk.server import rhnSQL def main(): rhnSQL.initDB() if not args: print("No module specified") return 0 if ...
data = ( 'ke', # 0x00 'keg', # 0x01 'kegg', # 0x02 'kegs', # 0x03 'ken', # 0x04 'kenj', # 0x05 'kenh', # 0x06 'ked', # 0x07 'kel', # 0x08 'kelg', # 0x09 'kelm', # 0x0a 'kelb', # 0x0b 'kels', # 0x0c 'kelt', # 0x0d 'kelp', # 0x0e 'kelh', # 0x0f 'kem', # 0x10 'keb', # ...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'network'} import re from ansible.module_utils.network.nxos.nxos import get_config, load_config from ansible.module_utils.network.nxos.nxos import nxos_argument_spec from ansible.module_utils...
''' author : https://github.com/Harnek Floyd–Warshall algorithm - All-pairs shortest path problem (for weighted graphs) Complexity: Performance = |V|^3 Space = |V|^2 ''' def allPairsShortestPath(graph): dist = {} pred = {} for u in graph: dist[u] = {} pred[u] = {} for v...
# # cl.h - Compression Library typedefs and prototypes # # 01/07/92 Cleanup by Brian Knittel # 02/18/92 Original Version by Brian Knittel # # # originalFormat parameter values # from warnings import warnpy3k warnpy3k("the CL_old module has been removed in Python 3.0", stacklevel=2) del warnpy3k MAX_NUMBER_O...
import unittest import pingo from pingo.test import level0 from pingo.test import level1 from pingo.detect import check_board running_on_pcduino = check_board(pingo.pcduino.PcDuino) class PcDuinoTest(unittest.TestCase): def setUp(self): self.board = pingo.pcduino.PcDuino() # Level0 Parameters ...
#!/usr/bin/env python __author__ = "Abhinav Sarkar <<EMAIL>>" __version__ = "0.2" __license__ = "GNU Lesser General Public License" __package__ = "lastfm" from lastfm.base import LastfmBase from lastfm.mixin import mixin from lastfm.decorators import cached_property, top_property @mixin("crawlable", "shar...
from __future__ import absolute_import from mock import patch import unittest from bokeh.plotting import figure from bokeh.models import GlyphRenderer from bokeh.models.tools import PanTool class TestPlotSelect(unittest.TestCase): def setUp(self): self._plot = figure(tools='pan') self._plot.cir...
# encoding: utf-8 # module PyQt4.QtNetwork # from /usr/lib/python3/dist-packages/PyQt4/QtNetwork.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import PyQt4.QtCore as __PyQt4_QtCore from .QHttpHeader import QHttpHeader class QHttpRequestHeader(QHttpHeader): """ QHttpRequestHeader() ...
{ 'name' : 'Claim on Deliveries', 'version' : '1.0', 'author' : 'OpenERP SA', 'category' : 'Warehouse Management', 'depends' : ['base', 'crm_claim', 'stock'], 'demo' : [], 'description': """ Create a claim from a delivery order. ===================================== Adds a Claim link to the...
from __future__ import print_function try: from configparser import ConfigParser except ImportError: from ConfigParser import ConfigParser import argparse import fileinput import json import os import re from settings import PROJECT_DIR MAGIC_STRINGS_INI = os.path.join(PROJECT_DIR, 'jerry-core', 'lit', 'li...
# -*- coding: utf-8 -*- import os import time import psutil import socket FILE = socket.gethostname() # store these as .csv files class Measure(): def __init__(self): self.pid = os.getpid() self.process = psutil.Process(self.pid) self.write_to_file = True def start_measurement(self,...
"""Integration tests for bug hunter.""" import csv from optparse import Values import os import unittest from bug_hunter import BugHunter try: import gdata.data import gdata.projecthosting.client except ImportError: logging.error('gdata-client needs to be installed. Please install\n' 'and try a...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.callback.default import CallbackModule as CallbackModule_default class CallbackModule(CallbackModule_default): # pylint: disable=too-few-public-methods,no-init ''' Override for the default callback m...
import pytest from openshift_checks.logging.fluentd_config import FluentdConfig, OpenShiftCheckException def canned_fluentd_pod(containers): return { "metadata": { "labels": {"component": "fluentd", "deploymentconfig": "logging-fluentd"}, "name": "logging-fluentd-1", }, ...
import os import sys import traceback from argparse import ( ArgumentParser, RawDescriptionHelpFormatter ) from . import ( __updated__, __version__ ) from .common import utils from .common.exceptions import ( ApplicationException, ModelError ) program_version = "v%s" % __version__ program_buil...
from nova.tests.integrated.v3 import test_servers class ConsolesSampleJsonTests(test_servers.ServersSampleBase): extension_name = "os-remote-consoles" def setUp(self): super(ConsolesSampleJsonTests, self).setUp() self.flags(vnc_enabled=True) self.flags(enabled=True, group='spice') ...
"""Integration tests for Google providers.""" from third_party_auth import provider from third_party_auth.tests.specs import base class GoogleOauth2IntegrationTest(base.Oauth2IntegrationTest): """Integration tests for provider.GoogleOauth2.""" PROVIDER_CLASS = provider.GoogleOauth2 PROVIDER_SETTINGS = {...
# -*- coding: utf-8 -*- """ *************************************************************************** dinftranslimaccum2.py --------------------- Date : October 2012 Copyright : (C) 2012 by Alexander Bruy Email : alexander dot bruy at gmail dot com ******...
#!/usr/bin/env python # encoding: utf-8 # Hans-Martin von Gaudecker, 2012-16 """ Run a Stata do-script in the directory specified by **ctx.bldnode**. The first and only argument will be the name of the do-script (no extension), which can be accessed inside the do-script by the local macro `1'. Useful for keeping a log...
# This requires aio headers to build. # Should work automagically out of deps now. # NOTE - this should also have the ability to mount a filesystem, # run the tests, unmount it, then fsck the filesystem import os from autotest.client import test, utils class fsx(test.test): version = 3 def initialize(self)...
# -*- coding: utf-8 -*- from __future__ import with_statement from django.template import Template from cms.api import create_page from cms.models import Page from cms.test_utils.testcases import CMSTestCase from cms.templatetags.cms_admin import preview_link from cms.utils.i18n import force_language from menus.base ...
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" enum TestEnum { "", "foo", "bar" }; interface TestEnumInterface { TestEnum doFoo(boolean arg); readonly attribute TestEnum foo; }; """) results = parser.finish...
microcode = ''' def macroop FLDCW_M { ld t1, seg, sib, disp, dataSize=2 wrval fcw, t1 }; def macroop FLDCW_P { ld t1, seg, sib, disp, dataSize=2 wrval fcw, t1 }; # FSTCW def macroop FNSTCW_M { rdval t1, fcw st t1, seg, sib, disp, dataSize=2 }; def macroop FNSTCW_P { rdip t7 rdval t1...
"""Unit tests for source_remote.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import traceback from tensorflow.core.debug import debug_service_pb2 from tensorflow.python.client import session from tensorflow.python.debug.lib import grpc_deb...
"""Linux/Unix branch of the keyboard module It allows to send keystrokes to the active display using python-xlib library. """ from __future__ import print_function from Xlib.display import Display from Xlib import X from Xlib.ext.xtest import fake_input import Xlib.XK import time import six _display = Display() DEB...
r"""marshall.py: Marshal values into strings """ __docformat__ = "restructuredtext en" import math import xapian from replaylog import log as _log def float_to_string(value): """Marshall a floating point number to a string which sorts in the appropriate manner. """ return _log(xapian.sortable_serial...
import sys from types import * import pygtk pygtk.require('2.0') import gtk #import gtk.glade import gobject import locale from locale import gettext as _ from cuon.Databases.SingleData import SingleData import SingleStaff import SingleStaffFee import SingleStaffMisc import SingleStaffVacation import SingleStaffDiseas...
import common.more_exchange_rates as exrate import wiod.common from ca import config from common import matrixutils, sqlhelper from common.dbconnect import db from common.matrixutils import NamedMatrix from common.ioutils import IOMatrixGenerator, EnvMatrixGenerator from common.counterfact import CounterfactGenerator ...
"""Reshape bijectors.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.pytho...
#! /usr/bin/env python """ Interactive viewer for the convolutional weights in a pickled model. Unlike ./show_weights, this shows one unit's weights at a time. This allows it to display weights from higher levels (which can have 100s of input channels), not just the first. """ import os import sys import warnings im...
from twisted.trial import unittest from cStringIO import StringIO from nevow import inevow, flat, context, tags, loaders, rend from nevow import i18n def mockTranslator(s, domain=None): args = {} if domain is not None: args['domain'] = domain return 'MOCK(%s)[%s]' % (', '.join(['%s=%r' % (k,v) ...
''' Authors: Donnie Marino, Kostas Stamatiou Contact: <EMAIL> Unit tests for the gbdxtools.Catalog class ''' from gbdxtools import Interface from gbdxtools.catalog import Catalog from auth_mock import get_mock_gbdx_session import vcr import unittest class TestCatalog(unittest.TestCase): @classmethod def se...
from blackjack.cmake.ScriptBase import ScriptBase from blackjack.cmake.cmdpart.Version import Version class project(ScriptBase): """ CMake Command - Project Defintion """ def __init__(self, name: str, version: Version = None, langs: str = None): super().__init__() self._Name = None ...
""" Course Outline Page for Studio """ from edxapp_acceptance.pages.studio.overview import CourseOutlinePage from selenium.webdriver.common.action_chains import ActionChains from regression.pages.studio.utils import ( click_confirmation_prompt_primary_button ) from regression.tests.helpers import get_url class C...
""" This module contains all of the GEOS ctypes function prototypes. Each prototype handles the interaction between the GEOS library and Python via ctypes. """ from django.contrib.gis.geos.prototypes.coordseq import ( # NOQA create_cs, cs_clone, cs_getdims, cs_getordinate, cs_getsize, cs_getx, cs_gety, cs_...
from yowsup.structs import ProtocolTreeNode from yowsup.layers.protocol_iq.protocolentities import IqProtocolEntity import time class SyncIqProtocolEntity(IqProtocolEntity): ''' <iq type="get" id="{{id}}" xmlns="urn:xmpp:whatsapp:sync"> <sync sid="{{str((int(time.time()) + 11644477200) * 1...
from axolotl.state.signedprekeystore import SignedPreKeyStore from axolotl.state.signedprekeyrecord import SignedPreKeyRecord from axolotl.invalidkeyidexception import InvalidKeyIdException class LiteSignedPreKeyStore(SignedPreKeyStore): def __init__(self, dbConn): """ :type dbConn: Connection ...
#!/usr/bin/env python from gnuradio import gr from gnuradio import trellis, digital, blocks from gnuradio import eng_notation import math import sys import random from gnuradio.trellis import fsm_utils from gnuradio.eng_option import eng_option from optparse import OptionParser import numpy try: from gnuradio imp...
from heapq import heappush, heappop import itertools import random from zort.hex_model import HexMapModel, Cell, evenr_to_axial from zort.environ import util def build_maze_from_hex(model, lower_limit=None, upper_limit=None, height=1.0, raised_tile='tileRock_full.png',...
"""Support for AirVisual air quality sensors.""" from logging import getLogger from homeassistant.const import ( ATTR_LATITUDE, ATTR_LONGITUDE, ATTR_STATE, CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, CONCENTRATION_PARTS_PER_BILLION, CONCENTRATION_PARTS_PER_MILLION, CONF_LATITUDE, CONF_LON...
""" Core Linear Algebra Tools ========================= =============== ========================================================== Linear algebra basics ========================================================================== norm Vector or matrix norm inv Inverse of a square matrix solve ...
import openerp import openerp.exceptions def login(db, login, password): res_users = openerp.registry(db)['res.users'] return res_users._login(db, login, password) def check_super(passwd): if passwd == openerp.tools.config['admin_passwd']: return True else: raise openerp.exceptions.Acc...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from copy import deepcopy from gym.spaces.box import Box import inspect from utils.helpers import Experience # NOTE: here state0 is always "None" from utils.helpers import preproce...
"""Calculates JavaScript dependencies without requiring Google's build system. This tool is deprecated and is provided for legacy users. See build/closurebuilder.py and build/depswriter.py for the current tools. It iterates over a number of search paths and builds a dependency tree. With the inputs provided, it walk...
import json import os from telemetry.page import page as page_module from telemetry.page import shared_page_state from telemetry import story __location__ = os.path.realpath( os.path.join(os.getcwd(), os.path.dirname(__file__))) # Generated on 2013-09-03 13:59:53.459117 by rmistry using # create_page_set.py. ...
import sys import time import os import warnings from django.conf import settings from django.core import mail from django.core.mail.backends import locmem from django.test import signals from django.template import Template from django.utils.translation import deactivate __all__ = ('Approximate', 'ContextList', 'setu...