content
string
"""Functions for generating interesting polynomials, e.g. for benchmarking. """ from __future__ import print_function, division from sympy.core import Add, Mul, Symbol, sympify, Dummy, symbols from sympy.functions.elementary.miscellaneous import sqrt from sympy.core.singleton import S from sympy.polys.polytools impo...
from __future__ import absolute_import, division, print_function from cryptography import utils from cryptography.hazmat.primitives.ciphers import ( BlockCipherAlgorithm, CipherAlgorithm ) from cryptography.hazmat.primitives.ciphers.modes import ModeWithNonce def _verify_key_size(algorithm, key): # Verify th...
import gl_XML, glX_XML import license import sys, getopt, copy, string class glx_enum_function: def __init__(self, func_name, enum_dict): self.name = func_name self.mode = 1 self.sig = None # "enums" is a set of lists. The element in the set is the # value of the enum. The list is the list of names for ...
import os import numpy as np import tensorflow as tf import random from unittest.mock import MagicMock def _print_success_message(): print('Tests Passed') def test_folder_path(cifar10_dataset_folder_path): assert cifar10_dataset_folder_path is not None,\ 'Cifar-10 data folder not set.' assert ci...
from __future__ import unicode_literals import bisect import io import logging import os import pkgutil import shutil import sys import types import zipimport from . import DistlibException from .util import cached_property, get_cache_base, path_to_cache_dir, Cache logger = logging.getLogger(__name__) cache = None...
from zerver.lib.test_classes import WebhookTestCase class FreshpingHookTests(WebhookTestCase): STREAM_NAME = "freshping" URL_TEMPLATE = "/api/v1/external/freshping?api_key={api_key}&stream={stream}" FIXTURE_DIR_NAME = "freshping" def test_freshping_check_test(self) -> None: """ Tests ...
from django.conf import settings from django.core import urlresolvers from django.core.exceptions import ImproperlyConfigured from django.contrib.comments.models import Comment from django.contrib.comments.forms import CommentForm from django.utils.importlib import import_module DEFAULT_COMMENTS_APP = 'django.contrib....
from conf import config from util import * import settings import base64 import os import re qpat = re.compile(r'\?') if settings.DEBUG: import logging logging.basicConfig() log = logging.getLogger('PyGoogleVoice') log.setLevel(logging.DEBUG) else: log = None class Voice(object): """ Main...
"""Facebook-specific test functions. Creating facebook test users should only need to be done once--they persist across unittest runs and are shared by all developers. Create the universe of test users with: % python -m viewfinder.backend.www.test.facebook_utils --create --num_users=<num> Query users with: % python...
from __future__ import absolute_import from __future__ import with_statement from functools import wraps from celery import routes from celery import current_app from celery.exceptions import QueueNotFound from celery.utils import maybe_promise from celery.tests.utils import unittest def E(queues): def expand(a...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} HAS_BOTO = False try: import boto import boto.cloudtrail from boto.regioninfo import RegionInfo HAS_BOTO = True except ImportError: HAS_BOTO = False from ansi...
#!/usr/bin/python """A session demonstration app.""" import calendar from datetime import datetime import sys import cherrypy from cherrypy.lib import sessions page = """ <html> <head> <style type='text/css'> table { border-collapse: collapse; border: 1px solid #663333; } th { text-align: right; background-color: #6...
"""Home Connect entity base class.""" import logging from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import Entity from .api import HomeConnectDevice from .const import DOMAIN, SIGNAL_UPDATE_ENTITIES _LOGGER = logging.ge...
# -*- coding: utf-8 -*- # # pylearn2 documentation build configuration file # It is based on Theano documentation build # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleable (module impo...
from params import * import dbg, util class DetMapInfo2: def __init__(self, config, hspace, replica, version): self.config = config self.replica = replica self.hspace = hspace self.version = version self._load(config) def _load(self, config): nspace = [] ...
"""Python2 and 3 test for the MLIR EDSC Python bindings""" import google_mlir.bindings.python.pybind as E import inspect # Prints `str` prefixed by the current test function name so we can use it in # Filecheck label directives. # This is achieved by inspecting the stack and getting the parent name. def printWithCurr...
"""Test the ZooKeeper driver for servicegroup. You need to install ZooKeeper locally and related dependencies to run the test. It's unclear how to install python-zookeeper lib in venv so you might have to run the test without it. To set up in Ubuntu 12.04: $ sudo apt-get install zookeeper zookeeperd python-zookeeper ...
#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error class pixman(test.test): """ Autotest module for testing basic functionality of pixman @author Kingsuk Deb, <EMAIL> ## """ version = 1 nf...
import numpy as np from dipy.data import read_viz_icons # Conditional import machinery for vtk. from dipy.utils.optpkg import optional_package # Allow import, but disable doctests if we don't have vtk. from dipy.viz import ui, window vtk, have_vtk, setup_module = optional_package('vtk') if have_vtk: vtkInterac...
import purchase_double_validation_installer # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
#!/usr/bin/env python """ Automatically creates python-wrapper subroutines from the interface file SHTOOLS.f95. Unfortunately all assumed array shapes have to be changed because their structure is only known by the Fortran compiler and can not be directly exposed to C. It is possible that newer f2py versions can handle...
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- factory_settings["a10_cpu_default_levels"] = {'cpu': (80.0, 90.0),} a10_cpus = { 0: "average", 1: "Control", 2: "Data" } def inventory_a10_cpu(info): if info: return [ (None, "a10_cpu_default_...
"""Takes a screenshot or a screen video capture from an Android device.""" import logging import optparse import os import sys from pylib import android_commands from pylib import screenshot def _PrintMessage(heading, eol='\n'): sys.stdout.write('%s%s' % (heading, eol)) sys.stdout.flush() def _CaptureScreensh...
# python import unittest # datadog from datadog import initialize, api from datadog.api.base import CreateableAPIResource, UpdatableAPIResource, DeletableAPIResource,\ GetableAPIResource, ListableAPIResource, ActionAPIResource from datadog.util.compat import iteritems, json # 3p import requests from mock import p...
# -*- coding: 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 'UserProfile.country' db.add_column('auth_userprofile', 'country', self...
from django.core.urlresolvers import reverse from taiga.base.utils import json from tests import factories as f from tests.utils import disconnect_signals, reconnect_signals import pytest pytestmark = pytest.mark.django_db def setup_module(module): disconnect_signals() def teardown_module(module): reconn...
""" Test the HTML builder. """ import TestSCons test = TestSCons.TestSCons() try: import libxml2 import libxslt except: try: import lxml except: test.skip_test('Cannot find installed Python binding for libxml2 or lxml, skipping test.\n') test.dir_fixture('image') # Normal invocation...
# -*- coding: utf-8 -*- from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class FastixRu(Account): __name__ = "FastixRu" __type__ = "account" __version__ = "0.08" __status__ = "testing" __config__ = [("mh_mode" , "all;listed;unlisted", ...
""" Bofh client/server exceptions. The errors defined in this class, are errors that the bofhd server can communicate to the client. All client implementations should be aware of these exception types. """ class CerebrumError(StandardError): """ Signal a user-error. """ pass class PermissionDenied(Cere...
""" Verifies that a failing postbuild step lets the build fail. """ import TestGyp import sys if sys.platform == 'darwin': # set |match| to ignore build stderr output. test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'], match = lambda a, b: True) test.run_gyp('test.gyp', chdir=...
""" * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you...
ANSIBLE_METADATA = { 'status': ['preview'], 'supported_by': 'community', 'version': '1.0' } from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.nxos import get_config, load_config from ansible.module_utils.nxos import nxos_argument_spec from ansible.module_utils.nxos import check...
import json from django.contrib.auth.models import AnonymousUser from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse from django.http import Http404 from django.test import TestCase from django.test.client import RequestFactory from django.test.utils import override_setting...
""" Script that creates zip files from Vesper archive clip directories. The script puts the zip files in a directory called "Clips (zipped)" that is a sibling of the archive's "Clips" directory. The "Clips (zipped)" directory has the same structure as the "Clips" directory, except that each grandchild directory of the...
""" A dumb OpenFlow 1.0 responder for benchmarking the controller framework. Intended to be used with oflops cbench. """ from ryu.base import app_manager from ryu.controller import ofp_event from ryu.controller.handler import MAIN_DISPATCHER from ryu.controller.handler import set_ev_cls from ryu.ofproto import ofproto...
"""Test code for reduce.""" import os import numpy as np import tvm import topi from common import get_all_backend def _my_npy_argmax(arr, axis, keepdims): if not keepdims: return arr.argmax(axis=axis) else: if axis is not None: out_shape = list(arr.shape) out_shape[axi...
"""Functionality related with filters in a PyTables file.""" # Imports # ======= import warnings import numpy from tables import ( utilsextension, blosc_compressor_list, blosc_compcode_to_compname) from tables.exceptions import FiltersWarning # Public variables # ================ __docformat__ = 'reStructuredTe...
import unittest from test_common import * class TestOSGiReq(unittest.TestCase): @osgireq(["basic/buildroot/usr/share/META-INF/MANIFEST.MF"]) def test_basic(self, stdout, stderr, return_value): self.assertEqual(return_value, 0, stderr) sout = [x for x in stdout.split('\n') if x] asser...
import os import _winreg import cPickle import logging import string import tempfile import traceback import shutil from miro import app from miro import prefs from miro import util from miro import u3info from miro import fileutil from miro.plat import proxyfind from miro.plat import resources from miro.plat import s...
""" Russian-language mappings for language-dependent features of Docutils. """ __docformat__ = 'reStructuredText' labels = { u'abstract': u'Аннотация', u'address': u'Адрес', u'attention': u'Внимание!', u'author': u'Автор', u'authors': u'Авторы', u'caution': u'Осторожно!', u'c...
from django.test import TestCase from django.utils import timezone from twitchalerts.models import TwitchalertsUpdate, TwitchalertsEvent from django.contrib.auth.models import User from donations.models import Donation from twitchalerts.support import run_twitchalerts SAMPLE = { "data":[ { "donation_id":...
import itertools import os import scipy import struct from pybrain.datasets import SupervisedDataSet def labels(filename): fp = file(filename) magicnumber, length = struct.unpack('>ii', fp.read(8)) assert magicnumber in (2049, 2051), ("Not an MNIST file: %i" % magicnumber) for _ in xrange(length): ...
"""Unit tests for parental controls.""" import datetime from django.test import TestCase from django.test.utils import override_settings from student.models import UserProfile from student.tests.factories import UserFactory class ProfileParentalControlsTest(TestCase): """Unit tests for requires_parental_consent...
#!/usr/bin/python import errno import os import re import sys import hashlib from collections import defaultdict from pprint import pprint # TODO: handle commands with the same name in multiple files # TODO: handle #ifdefs HELP_START = re.compile(r"""^BAREBOX_CMD_HELP_START\s*\((\w+)\)?\s*$""") HELP_TEXT = re.comp...
from django.conf import settings if settings.FILE_DB == settings.S3: from cripts.core.s3_tools import get_file_s3 import gridfs import pymongo import magic class MongoError(Exception): """ Generic MongoError exception. """ pass # TODO: mongo_connector() and gridfs_connector() can probably be com...
#!/usr/bin/env python # continuous integration # build daily reports (doxygen,coverage,etc) import datetime import time import subprocess import pexpect import glob import sys # Upload file to sourceforge web server using scp def upload(file_to_upload, destination): try: password = sys.argv[1] c...
''' Contains base class definition for simulated entries. ''' #--REGULAR IMPORTS------------------------------------------------------------- from copy import copy from inspect import isfunction #--CORBA STUBS----------------------------------------------------------------- #--ACS Imports---------------------------...
# note: this module named xossite.py instead of site.py due to conflict with # /usr/lib/python2.7/site.py import os import pdb import sys import tempfile sys.path.append("/opt/tosca") from translator.toscalib.tosca_template import ToscaTemplate from core.models import User,Controller,Deployment from xosresource i...
#!/usr/bin/env python ######################################################################## # $HeadURL$ # File : dirac-dms-pfn-accessURL ######################################################################## """ Retrieve an access URL for a PFN given a valid DIRAC SE """ __RCSID__ = "$Id$" import DIRAC from D...
import datetime from django.db import connection, models, transaction from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature from .models import ( Award, AwardNote, Book, Child, Eaten, Email, File, Food, FooFile, FooFileProxy, FooImage, FooPhoto, House, Image, Item, Location, Login, Or...
import log_utils class URL_Dispatcher: def __init__(self): self.func_registry = {} self.args_registry = {} self.kwargs_registry = {} def register(self, mode, args=None, kwargs=None): """ Decorator function to register a function as a plugin:// url endpoint mode...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import int_or_none class PyvideoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?pyvideo\.org/(?P<category>[^/]+)/(?P<id>[^/?#&.]+)' _TESTS = [{ 'url': 'http://pyvide...
from django.urls import reverse, reverse_lazy class Menu(object): """One menu item.""" def __init__(self, label="", icon="", url="#", order=50): """label is the text that is displayed on the menu. icon is the icon to be displayed next to the label. Choose from the Glyphicon set: ...
#! /usr/bin/python3 class ConfigurationError (Exception): pass class DatabaseError (Exception): pass class VersionError (Exception): pass class ClientVersionError (VersionError): pass class DatabaseVersionError (VersionError): pass class TransactionError(Exception): pass class InputError(Excep...
"""Tests that leaked mock objects can be caught be Google Mock.""" __author__ = '<EMAIL> (Zhanyong Wan)' import gmock_test_utils PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_leak_test_') TEST_WITH_EXPECT_CALL = [PROGRAM_PATH, '--gtest_filter=*ExpectCall*'] TEST_WITH_ON_CALL = [PROGRAM_PATH, '--gtes...
"""## Data IO (Python Functions) A TFRecords file represents a sequence of (binary) strings. The format is not random access, so it is suitable for streaming large amounts of data but not suitable if fast sharding or other non-sequential access is desired. @@TFRecordWriter @@tf_record_iterator - - - ### TFRecords ...
from setuptools import setup try: import pypandoc long_description = pypandoc.convert('README.md', 'rst') except(IOError, ImportError): long_description = open('README.md').read() setup( name='pyvault', version='2.4', description='Python password manager', long_description=long_description...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.network.cloudengine.ce import get_config, load_config from ansible.module_utils.network.cloudengine.c...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import ast import yaml from collections import MutableMapping, MutableSet, MutableSequence from ansible.module_utils.six import string_types from ansible.parsing.yaml.loader import AnsibleLoader from ansible.plugins import fragme...
""" Run tests OWSProxy tests with external WPS. Please start `Emu WPS <https://emu.readthedocs.io/en/latest/>`_ on port 5000: http://localhost:5000/wps """ import pytest from .base import FunctionalTest class OWSProxyAppTest(FunctionalTest): def setUp(self): super(OWSProxyAppTest, self).setUp() ...
# Quick tests for the markup templatetags (django.contrib.markup) import re from django.template import Template, Context, add_to_builtins from django.utils import unittest from django.utils.html import escape add_to_builtins('django.contrib.markup.templatetags.markup') try: import textile except ImportError: ...
class ModuleDocFragment(object): # Standard Rackspace only documentation fragment DOCUMENTATION = """ options: api_key: description: - Rackspace API key (overrides I(credentials)) aliases: - password credentials: description: - File to find the Rackspace credentials in (ignore...
# -*- coding: utf-8 -*- """ Created on Wed Feb 29 10:34:00 2012 Author: Josef Perktold """ from statsmodels.compat import lrange, zip_longest, combinations from numpy.testing import assert_ def test_zip_longest(): lili = [['a0', 'b0', 'c0', 'd0'], ['a1', 'b1', 'c1'], ['a2', 'b2', 'c2', '...
"""DNS Rdata Classes. @var _by_text: The rdata class textual name to value mapping @type _by_text: dict @var _by_value: The rdata class value to textual name mapping @type _by_value: dict @var _metaclasses: If an rdataclass is a metaclass, there will be a mapping whose key is the rdatatype value and whose value is Tru...
""" Demo to demonstrate use of temporal reasoning pipeline 1. RelEx and RelEx2Logic process natural language sentences 2. PLN performs inferences using AI on output atoms """ from __future__ import print_function from opencog.atomspace import types, AtomSpace, TruthValue from opencog.scheme_wrapper import load_scm, sc...
""" The AlertManager handles all the libtorrent alerts. This should typically only be used by the Core. Plugins should utilize the `:mod:EventManager` for similar functionality. """ from twisted.internet import reactor import deluge.component as component from deluge._libtorrent import lt from deluge.log import ...
from __future__ import annotations from tuxemon.event.eventaction import EventAction import logging from typing import NamedTuple, final logger = logging.getLogger(__name__) class ClearVariableActionParameters(NamedTuple): variable: str # noinspection PyAttributeOutsideInit @final class ClearVariableAction(Eve...
import warnings from django.contrib.auth.backends import ModelBackend from django.core.exceptions import ImproperlyConfigured from oscar.apps.customer.utils import normalise_email from oscar.core.compat import get_user_model User = get_user_model() if hasattr(User, 'REQUIRED_FIELDS'): if not (User.USERNAME_FIEL...
""" Requires Mark Hammond's pywin32 package. """ # Python stdlib imports import sys import logging import os, os.path if getattr(sys, 'frozen', False): # frozen dir = os.path.dirname(sys.executable) sys.path.append(dir) os.environ['PATH'] = (os.environ['PATH']+";").join(p+";" for p in ...
import unittest from ingenico.connect.sdk.merchant.products.directory_params import DirectoryParams from tests.unit.comparable_param import ComparableParam class DirectoryParamsTest(unittest.TestCase): """Tests if instances of the DirectoryParams class for products can be correctly converted to RequestParame...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule try: from ansible.module_utils.network.avi.avi import ( avi_common_argument_spec, avi_ansible_api, HAS_AVI) except ...
"""Perform some tests with Forte Agent NOTE: Forte Agent has a very dynamic interface e.g. whether it is free or not, whether it is still in the grace period. For this reason this example script may or may not work well for you""" print __doc__ import time from pprint import pprint from pywinauto.applic...
import Image ## # (New in 1.1.3) The <b>ImageGrab</b> module can be used to copy # the contents of the screen to a PIL image memory. # <p> # The current version works on Windows only.</p> # # @since 1.1.3 ## try: # built-in driver (1.1.3 and later) grabber = Image.core.grabscreen except AttributeError: #...
from builtins import str, zip from configargparse import ArgParser from itertools import repeat from neon import logger as neon_logger from neon.util.persist import ensure_dirs_exist from PIL import Image import logging import multiprocessing import numpy as np import os import re import shutil import tarfile import tq...
""" .. _tutorial-deploy-model-on-rasp: Deploy the Pretrained Model on Raspberry Pi =========================================== **Author**: `Ziheng Jiang <https://ziheng.org/>`_, \ `Hiroyuki Makino <https://makihiro.github.io/>`_ This is an example of using Relay to compile a ResNet model and deploy it on ...
import BoostBuild def test_exit(name): t = BoostBuild.Tester(["-ffile.jam"], pass_toolset=0) t.write("file.jam", "%s ;" % name) t.run_build_system(status=1, stdout="\n") t.rm(".") t.write("file.jam", "%s : 0 ;" % name) t.run_build_system(stdout="\n") t.rm(".") t.write("file.jam", "%s...
# -*- coding: utf-8 -*- import os import sys import glob import traceback from email.parser import Parser as EmailParser import email.utils import OleFileIO_PL as OleFile import email import random import string import mimetypes from email import encoders from email.message import Message from email.mime....
import json from contextlib import closing from typing import Any, Dict, Optional from flask_appbuilder.security.sqla.models import User from flask_babel import gettext as __ from sqlalchemy.engine.url import make_url from superset.commands.base import BaseCommand from superset.databases.commands.exceptions import ( ...
from functools import reduce import unittest import numpy from pyscf import gto from pyscf import scf from pyscf import ao2mo from pyscf import fci norb = 6 nelec = 6 na = fci.cistring.num_strings(norb, nelec//2) numpy.random.seed(1) ci0 = numpy.random.random((na,na)) ci0 = ci0 + ci0.T rdm1, rdm2 = fci.direct_spin1.ma...
"""Management command tests.""" import os import shutil import tempfile from unittest import mock from django.core.management import call_command from django.test import override_settings from django.urls import reverse from modoboa.lib.tests import ModoTestCase from .. import factories, models @override_settings(...
"""Unittest that directly tests the output of the pure-Python protocol compiler. See //net/proto2/internal/reflection_test.py for a test which further ensures that we can use Python protocol message objects as we expect. """ __author__ = '<EMAIL> (Will Robinson)' import unittest from google.protobuf import unittest_...
""" XPath query support. This module provides L{XPathQuery} to match L{domish.Element<twisted.words.xish.domish.Element>} instances against XPath-like expressions. """ from __future__ import absolute_import, division from io import StringIO from twisted.python.compat import StringType, unicode class LiteralValue(u...
from openerp.osv import fields, osv class product_category(osv.osv): _inherit = "product.category" _columns = { 'property_account_creditor_price_difference_categ': fields.property( type='many2one', relation='account.account', string="Price Difference Account", ...
from PyQt4.QtGui import * from electrum import BasePlugin from electrum.i18n import _ class Plugin(BasePlugin): def fullname(self): return 'Virtual Keyboard' def description(self): return '%s\n%s' % (_("Add an optional, mouse keyboard to the password dialog."), _("Warning: do not use this if...
#-*- coding: utf-8 -*- """ Unit tests for video-related REST APIs. """ # pylint: disable=attribute-defined-outside-init import csv import json import dateutil.parser import re from StringIO import StringIO from django.conf import settings from django.test.utils import override_settings from mock import Mock, patch fr...
''' Created on Nov 13, 2009 @author: Cory Zue ''' from __future__ import absolute_import from xml.etree import ElementTree from xml.etree.ElementTree import Element, SubElement from django.db import models class SerializableModel(): '''A serializable model. Override the ATTRS and ELEMS property on the t...
import os import xbmcgui from elementum.addon import ADDON_PATH from dialog import * # NOQA class DialogSelect(xbmcgui.WindowXMLDialog): def __init__(self, *args, **kwargs): xbmcgui.WindowXML.__init__(self) self.items = kwargs['items'] self.title = kwargs['title'] self.count = 0 ...
from syncthing.bep.serializable import BEPSerializable from syncthing.bep.blockinfo import BEPBlockInfo from syncthing.xdr.XDRStringUnserializer import XDRStringUnserializer from syncthing.xdr.XDRIntegerUnserializer import XDRIntegerUnserializer from syncthing.xdr.XDRLongIntegerUnserializer import XDRLongIntegerUnseria...
# -*- coding: utf-8 -*- from .structures import LookupDict _codes = { # Informational. 100: ('continue',), 101: ('switching_protocols',), 102: ('processing',), 103: ('checkpoint',), 122: ('uri_too_long', 'request_uri_too_long'), 200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'...
from numba import njit from tardis.montecarlo.montecarlo_numba import njit_dict, njit_dict_no_parallel from tardis.montecarlo.montecarlo_numba.numba_interface import ( LineInteractionType, ) from tardis.montecarlo import ( montecarlo_configuration as montecarlo_configuration, ) from tardis.montecarlo.montecarl...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} import atexit import urllib import mmap import errno import socket from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.pycompat24 import get_exception ...
#!/usr/bin/env python import subprocess import os import errno import collections import glob import argparse class Platform(object): pass class simulator_platform(Platform): directory = 'darwin_ios' sdk = 'iphonesimulator' arch = 'i386' triple = 'i386-apple-darwin11' version_min = '-miphoneos...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # 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 Lic...
""" Unittests for deleting a split mongo course """ import unittest from StringIO import StringIO from mock import patch from django.contrib.auth.models import User from django.core.management import CommandError, call_command from django.test.utils import override_settings from contentstore.management.commands.rollba...
from __future__ import absolute_import import sys from unittest import TestCase from plotly.optional_imports import get_module class OptionalImportsTest(TestCase): def test_get_module_exists(self): import math module = get_module("math") self.assertIsNotNone(module) self.assertEqu...
""" raven.contrib.django.models ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Acts as an implicit hook for Django installs. :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import sys import logging import warnings ...
#! /usr/bin/python import requests from bs4 import BeautifulSoup import re import sys reload(sys) sys.setdefaultencoding("utf-8") var=requests.get("http://www.bookadda.com") soup=BeautifulSoup(var.text) find1=soup.find('ul',{"class":"left_menu"}) f=open("bookaddalinks.txt",'w') for link in find1.find_all('a'): f.w...
"""Tests for Python ops defined in math_grad.py.""" 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 impor...
#!/usr/bin/env python3 import sys import dmi from hooks.merge_frontend import MergeDriver def images_equal(left, right): if left.size != right.size: return False w, h = left.size left_load, right_load = left.load(), right.load() for y in range(0, h): for x in range(0, w): l...
""" Google (News) @website https://news.google.com @provide-api no @using-api no @results HTML @stable no @parse url, title, content, publishedDate """ from lxml import html from searx.engines.google import _fetch_supported_languages, supported_languages_url from searx.url_utils import ur...