content
stringlengths
4
20k
""" Odnoklassniki OAuth2 and Iframe Application backends, docs at: http://psa.matiasaguirre.net/docs/backends/odnoklassnikiru.html """ from hashlib import md5 from social.p3 import unquote from social.backends.base import BaseAuth from social.backends.oauth import BaseOAuth2 from social.exceptions import AuthFaile...
from __future__ import print_function import getpass import inspect import os import sys import textwrap from oslo_utils import encodeutils from oslo_utils import strutils import prettytable import six from six import moves from nova.openstack.common._i18n import _ class MissingArgs(Exception): """Supplied arg...
try: from decimal import Decimal have_decimal = True except ImportError: have_decimal = False import doctest import unittest from babel import numbers class FormatDecimalTestCase(unittest.TestCase): def test_patterns(self): self.assertEqual(numbers.format_decimal(12345, '##0'...
from __future__ import nested_scopes # Backward compat for 2.1 from unittest import TestCase from wsgiref.util import setup_testing_defaults from wsgiref.headers import Headers from wsgiref.handlers import BaseHandler, BaseCGIHandler from wsgiref import util from wsgiref.validate import validator from wsgiref.simple...
# coding=utf-8 from __future__ import unicode_literals from collections import OrderedDict from .. import Provider as ColorProvider class Provider(ColorProvider): # Source: uk.wikipedia.org/wiki/Список_кольорів all_colors = OrderedDict(( ('Абрикосовий', '#FBCEB1'), ('Аквамариновий', '#7FFFD4...
# coding=utf-8 class DomainException(Exception): pass class Colour(object): def __init__(self): pass Red, Green, Blue = range(3) class Variable(object): def __init__(self, fixed_value=None): # załpżono, że dziedzina dla wszystkich zmiennych jest taka sama [1..20] # ale równi...
#!/usr/bin/env python import os import sys import subprocess import importlib from utilities import isGit, isMercurial, isBazaar class CodeRepository: def __init__(self): ''' Initialize the code repository class. ''' self.executingDirectory = os.path.dirname(os.path.realpath(__fi...
"""Handles all requests relating to OperationEngine.""" from karbor.db import base from karbor.services.operationengine import rpcapi as oe_rpcapi class API(base.Base): """API for interacting with the OperationEngine manager.""" def __init__(self, db_driver=None): self.operationengine_rpcapi = oe_r...
import typing from mitmproxy import exceptions from mitmproxy import flowfilter from mitmproxy import ctx class StickyAuth: def __init__(self): self.flt = None self.hosts = {} def load(self, loader): loader.add_option( "stickyauth", typing.Optional[str], None, ...
from pycp2k.inputsection import InputSection class _each86(InputSection): def __init__(self): InputSection.__init__(self) self.Just_energy = None self.Powell_opt = None self.Qs_scf = None self.Xas_scf = None self.Md = None self.Pint = None self.Metad...
"""SCons.Platform.cygwin Platform-specific initialization for Cygwin systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to an...
from xml.dom import minidom from django.test import TestCase from models import City class GeoFeedTest(TestCase): urls = 'django.contrib.gis.tests.geoapp.urls' def assertChildNodes(self, elem, expected): "Taken from regressiontests/syndication/tests.py." actual = set([n.nodeName for n i...
"""This code example gets all line item creative associations (LICA). To create LICAs, run create_licas.py or associate_creative_set_to_line_item.py.""" __author__ = '<EMAIL> (Jeff Sham)' # Locate the client library. If module was installed via "setup.py" script, then # the following two lines are not needed. import ...
""" Provide the space before and after operators. There are variation to provide spaces. In the binary operator. Spaces should be provided before and after the operator. For example, +, /, %.... In the unary operator, Spaces should be provided before or after the operator. However, when it's used in the (AA++), [--BB]...
from __future__ import absolute_import #!/usr/bin/env python import sys import unittest sys.path.append('xypath') import xypath import messytables try: import hamcrest except ImportError: hamcrest = None import re import tcore class Test_Import_Missing(tcore.TMissing): def test_table_has_properties_at_all(...
from __future__ import absolute_import from celery import Celery from celery.utils.text import indent from celery.tests.utils import Case RANDTEXT = """\ The quick brown fox jumps over the lazy dog\ """ RANDTEXT_RES = """\ The quick brown fox jumps over the lazy dog\ """ QUEUES = {"queue1": { ...
"""SQL connections, SQL execution and high-level DB-API interface. The engine package defines the basic components used to interface DB-API modules with higher-level statement construction, connection-management, execution and result contexts. The primary "entry point" class into this package is the Engine and it's p...
import datetime import pytest import pytz import urlparse from dateutil.parser import parse as parse_date from api.base.settings.defaults import API_BASE from framework.auth.core import Auth from osf.models import NodeLog, Registration, Sanction from osf_tests.factories import ( AuthUserFactory, ProjectFactor...
# -*- coding: utf-8 -*- """ *************************************************************************** r_li_shannon_ascii.py --------------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ****************...
from __future__ import division try: import pymqi except ImportError: pymqi = None # Metric types GAUGE = 'gauge' COUNT = 'count' METRIC_PREFIX = 'ibm_mq' def queue_metrics(): return { 'service_interval': pymqi.CMQC.MQIA_Q_SERVICE_INTERVAL, 'inhibit_put': pymqi.CMQC.MQIA_INHIBIT_PUT, ...
#! /usr/bin/env python # -*- coding: utf-8 -*- ''' Manage your Nagios on-call roster with Google apps. Usage: googios --help googios setup googios <roster> current [start end name email phone] [--echo] googios <roster> query [--start=<start> --end=<end> | --at=<at>] [--echo] googios <roster> repor...
from __future__ import unicode_literals import sys import time import zalpha_api if sys.version_info[0] < 3: user_input = raw_input else: user_input = input info = """ ------------------------------------------------------------------------------ This demo client can perform the following operations: -----...
import json import testtools from tests.api import test_api class TestAPICompanies(test_api.TestAPI): @testtools.skip("failing ci") def test_get_companies(self): with test_api.make_runtime_storage( {'repos': [{'module': 'nova', 'project_type': 'openstack', ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.contrib.sites.models from django.contrib.sites.models import _simple_domain_name_validator from django.db import migrations, models class Migration(migrations.Migration): dependencies = [] operations = [ migrations.Create...
"""Benchmark for KPL implementation of vocabulary columns from lists with dense inputs.""" from tensorflow.python import keras from tensorflow.python.compat import v2_compat from tensorflow.python.eager.def_function import function as tf_function from tensorflow.python.feature_column import feature_column_v2 as fcv2 f...
from assertpy import assert_that,fail def test_is_equal(): assert_that('foo').is_equal_to('foo') assert_that(123).is_equal_to(123) assert_that(0.11).is_equal_to(0.11) assert_that(['a','b']).is_equal_to(['a','b']) assert_that((1,2,3)).is_equal_to((1,2,3)) assert_that(1 == 1).is_equal_to(True) ...
""" A set of request processors that return dictionaries to be merged into a template context. Each function takes the request object as its only parameter and returns a dictionary to add to the context. These are referenced from the 'context_processors' option of the configuration of a DjangoTemplates backend and use...
# -*- coding: utf-8 -*- """ Test suite for the util module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import unittest from pygments import util class FakeLexer(object): def analyse(text)...
class DBSnapshot(object): """ Represents a RDS DB Snapshot Properties reference available from the AWS documentation at http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/API_DBSnapshot.html :ivar engine_version: Specifies the version of the database engine :ivar license_model: Licens...
import logging from openerp import models, fields, tools, api from openerp.tools.translate import _ class ResPartner(models.Model): _inherit = 'res.partner' #@api.one #def _loyalty_points(self): # self.loyalty_points = sum([o.loyalty_points for o in self.sale_order_ids.filtered(lambda o: o.state =...
"""A simple auth command to bootstrap authentication with oauth2.""" import getpass from googlecloudsdk.api_lib.auth import service_account as auth_service_account from googlecloudsdk.calliope import base from googlecloudsdk.calliope import exceptions as c_exc from googlecloudsdk.core import log from googlecloudsdk.c...
from gi.repository import Gtk class NoDevice: pass NotListed = NoDevice() import cups from gi.repository import GObject from timedops import TimedOperation from .base import * class DeviceListed(Question): def __init__ (self, troubleshooter): # Is the device listed? Question.__init__ (self, t...
__revision__ = "$Id: select_trigger.py,v 1.4 2003/01/09 15:49:15 akuchling Exp $" import asyncore_25 as asyncore import asynchat_25 as asynchat import os import socket import string import thread if os.name == 'posix': class trigger (asyncore.file_dispatcher): "Wake up a call to select() running in the...
import os import tempfile import unittest from nose.tools import raises from ansible import errors from ansible.module_common import ModuleReplacer from ansible.utils import md5 as utils_md5 TEST_MODULE_DATA = """ from ansible.module_utils.basic import * def get_module(): return AnsibleModule( argument_...
import logging import os import shutil import unittest from unittest import mock import elasticsearch import pendulum from airflow.configuration import conf from airflow.models import DAG, TaskInstance from airflow.operators.dummy_operator import DummyOperator from airflow.utils import timezone from airflow.utils.log...
__reversion__ = "$Revision: 20 $" __author__ = "$Author: holtwick $" __date__ = "$Date: 2007-10-09 12:58:24 +0200 (Di, 09 Okt 2007) $" """ Helper for complex CSS definitons like font, margin, padding and border Optimized for use with PISA """ import types import logging log = logging.getLogger("ho.css") def toLis...
#!/usr/bin/env python # -*- coding: utf-8 -*- # """Matching for all objects with test images Usage ----- $ # for sift $ roslaunch jsk_2015_05_baxter_apc test_sift_matching.launch \ knn_threshold:=0.8 $ # for color_histogram $ rolaunch jsk_2015_05_baxter_apc test_color_histogram_matching.launc...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = r''' --- module: bigip_vlan short_description: Manage VLANs on a BIG-IP syst...
#!/usr/bin/python # -*- coding: utf-8 -*- """ PyCOMPSs Testbench Tasks ======================== """ # Imports import unittest from pycompss.api.task import task from modules.MyClass import MyClass def par_func(): return "function" class testClass(unittest.TestCase): @task(returns=MyClass) def func...
import sys from django.core.management.base import LabelCommand from django.template import TemplateDoesNotExist, loader from django_extensions.management.utils import signalcommand def get_template_path(path): try: template = loader.find_template(path) if template[1]: return templat...
""" EasyBuild support for cgompi compiler toolchain (includes Clang, GFortran and MPICH). @author: Dmitri Gribenko (National Technical University of Ukraine "KPI") """ from easybuild.toolchains.clanggcc import ClangGcc from easybuild.toolchains.mpi.mpich import Mpich class Cgmpich(ClangGcc, Mpich): """Compiler ...
from django.apps.registry import Apps from django.db import models from django.db.utils import DatabaseError from django.utils.timezone import now from .exceptions import MigrationSchemaMissing class MigrationRecorder: """ Deal with storing migration records in the database. Because this table is actual...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os from ansible.errors import * from ansible.plugins.lookup import LookupBase ANSIBLE_HASHI_VAULT_ADDR = 'http://127.0.0.1:8200' if os.getenv('VAULT_ADDR') is not None: ANSIBLE_HASHI_VAULT_ADDR = os.environ['VAULT_AD...
import regex from stat import * class FilterRuleset(object): def __init__(self, filters): ''' split string and store in list of FilterRules ''' self.rules = []; for s in filters.splitlines(): secs = s.split(' ', 1) if len(secs) == 2: i...
""" IPython extension management tools. After installation, you'll have the 'extutil' object in your namespace. to. """ # for the purposes of this module, every module that has the name 'ip' globally # installed as below is an IPython extension import IPython.ipapi ip = IPython.ipapi.get() import sys,textwrap,inspe...
""" Support for ASUSWRT routers. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.asuswrt/ """ import logging import re import socket import telnetlib import threading from collections import namedtuple from datetime import timedelta import...
import collections class BitReader: """ Gets a string or a iterable of chars (also mmap) representing bytes (ord) and permits to extract bits one by one like a stream """ def __init__(self, bytes): self._bits = collections.deque() for byte in bytes: #byte = ord(byt...
import httplib import unittest from os import path import mock from mock import mock from orangecloud_client_test.fake_requests import mock_api_response, mock_upload_response, mock_response from orangecloud_client.files import Files class MockFile(object): def __init__(self): self.buffer = [] def w...
"""PRCS source add-on for the convert extension""" from mercurial import extensions def extsetup(ui): try: # import hgext.convert global _convert _convert = extensions.find('convert') # from hgext.convert.convcmd import source_converters _convcmd = __import__( ...
from base import GMLRangeBase, GMLBase class GMLLowerCorner(GMLRangeBase): TAG = "lowerCorner" def __init__(self, limits, **attributes): """ It defines a GMLLowerCorner node based in WCS 2.0 """ super(GMLLowerCorner, self).__init__(limits, **attributes) class GMLUpperCorner(GMLRangeBase): ...
# -*- coding: utf-8 -*- """Functions for enriching the origins of Proteins, RNAs, and miRNAs.""" from ...graph import BELGraph from ...pipeline import in_place_transformation from ....constants import FUNCTION, FUSION, MIRNA, RNA, VARIANTS from ....dsl import Protein __all__ = [ 'enrich_rnas_with_genes', 'en...
from lib.alerttask import AlertTask, add_hostname_to_ip from mozdef_util.query_models import SearchQuery, TermMatch, PhraseMatch import re import netaddr # This alert requires a configuration file, ssh_lateral.json to exist # in the alerts directory. # # hostmustmatch: # List of regex, if one matches the source of t...
from __future__ import unicode_literals from utilities import getSettingAsBool import logging import xbmc import xbmcaddon class KodiLogHandler(logging.StreamHandler): def __init__(self): logging.StreamHandler.__init__(self) addon_id = xbmcaddon.Addon().getAddonInfo('id') prefix = b"[%s]...
import random from urllib import urlopen import sys WORD_URL = "http://learncodethehardway.org/words.txt" WORDS = [] PHRASES = { "class %%%(%%%):": "Make a class named %%% that is-a %%%.", "class %%%(object):\n\tdef __init__(self, ***)" : "class %%% has-a __init__ that takes self and *** parameter...
""" A text buffering object. """ import re class Text(object): """ Wrap text file objects. """ def __init__(self, text: str, sentence_endings: str='.!?'): """ Text(text) -> Just a regular file object. """ self._text = text.encode() # Only read one line/sentence at a ...
from neutron.api.v2 import attributes from neutron.common import exceptions as nexception class PortSecurityPortHasSecurityGroup(nexception.InUse): message = _("Port has security group associated. Cannot disable port " "security or ip address until security group is removed") class PortSecurityA...
""" Installs the development dependancies """ import os import _project_cfg_importer project_cfg = _project_cfg_importer.get_project_cfg() def main(): """ Entry point of script """ print("********************************************************************************\n" "* ...
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "script-src 'self' 'un...
# -*- coding: utf-8 -*- """ pygments.styles.colorful ~~~~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by CodeRay. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, ...
# -*- coding: utf-8 -*- """ Created on Sun May 26 13:23:40 2013 Author: Josef Perktold, based on Enrico Giampieri's multiOLS """ #import numpy as np import pandas as pd import statsmodels.api as sm from statsmodels.sandbox.multilinear import multiOLS, multigroup data = sm.datasets.longley.load_pandas() df = data.e...
"""SCons.Tool.gnulink Tool-specific initialization for the gnu linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012...
"""This package provides helpers for randomzied testsing.""" from six.moves.urllib_parse import quote import os from ironblogger.app import db from ironblogger.model import Blogger, Blog, Post, Party from ironblogger.date import to_dbtime, duedate, duedate_seek import arrow random_ncalls = int(os.getenv('NUM_RANDOM_CA...
"""Tests for tensorflow.ops.data_flow_ops.dynamic_stitch.""" 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.ops import data_flow_ops from tensorflow.python.ops i...
from lxml import etree import webob from nova.api.openstack.compute.contrib import quotas from nova.api.openstack import wsgi from nova import test from nova.tests.api.openstack import fakes def quota_set(id): return {'quota_set': {'id': id, 'metadata_items': 128, 'volumes': 10, 'gigabytes': 1000, 'r...
from openerp import api from openerp.fields import Integer, One2many, Html from openerp.osv import fields, osv from openerp.tools.translate import _ import openerp.addons.decimal_precision as dp class product_template(osv.osv): _inherit = 'product.template' _columns = { 'event_ok': fields.boolean('Even...
import json import os import socket import threading import time import traceback from .base import (Protocol, RefTestExecutor, RefTestImplementation, TestharnessExecutor, strip_server) from .. import webdriver from ..testrunner import Stop w...
"""Tests for JavaScript library dependencies.""" __author__ = 'Sean Lip' from core.domain import dependency_registry from core.domain import exp_services from core.domain import interaction_registry from core.tests import test_utils import feconf class DependencyRegistryTests(test_utils.GenericTestBase): """Tes...
""" # Tests for stuff in django.utils.datastructures. >>> from django.utils.datastructures import * ### MergeDict ################################################################# >>> d1 = {'chris':'cool','camri':'cute','cotton':'adorable','tulip':'snuggable', 'twoofme':'firstone'} >>> d2 = {'chris2':'cool2','camri2...
"""Checker for using assertTrue/False instead of a more precise assert. Hattip to Ned Batchelder for the idea: http://nedbatchelder.com/blog/201505/writing_pylint_plugins.html """ import astroid from pylint.interfaces import IAstroidChecker from pylint.checkers import BaseChecker, utils from .common import BASE_ID, ...
"""Minio component.""" import logging import os from queue import Queue import threading from typing import List import voluptuous as vol from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP import homeassistant.helpers.config_validation as cv from .minio_helper import MinioEventThread...
from __future__ import absolute_import from zerver.models import PushDeviceToken from zerver.lib.timestamp import timestamp_to_datetime from zerver.decorator import statsd_increment from apnsclient import Session, Message, APNs import gcmclient from django.conf import settings import base64, binascii, logging, os ...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( xpath_text, int_or_none, ) class WallaIE(InfoExtractor): _VALID_URL = r'http://vod\.walla\.co\.il/[^/]+/(?P<id>\d+)/(?P<display_id>.+)' _TEST = { 'url': 'http://vod.walla...
"""Test sparse rational functions. """ from sympy.polys.fields import field, FracField from sympy.polys.rings import ring from sympy.polys.domains import ZZ, QQ, RR from sympy.polys.orderings import lex, grlex from sympy.utilities.pytest import raises, XFAIL from sympy.core import Symbol, symbols from sympy import sq...
from __future__ import unicode_literals from django.utils.translation import gettext_lazy as _ from django.contrib import admin from leaflet.admin import LeafletGeoAdmin from .models import SensorStation, SensorReport class SensorStationAdmin(LeafletGeoAdmin): settings_overrides = { 'DEFAULT_ZOOM': 13,...
""" @author: Andrew Case @license: GNU General Public License 2.0 @contact: <EMAIL> @organization: """ import volatility.obj as obj import volatility.plugins.mac.common as common class mac_timers(common.AbstractMacCommand): """ Reports timers set by kernel drivers """ def calculate(self): ...
"""Methods related to optimizers used in canned_estimators.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import six from tensorflow.python.training import adagrad from tensorflow.python.training import adam from tensorflow.python.training import ftr...
"""Test validation in Zenodo deposit REST API.""" from __future__ import absolute_import, print_function, unicode_literals import json from datetime import datetime import jwt from flask import url_for from invenio_search import current_search from six import BytesIO from zenodo.modules.deposit.resolvers import dep...
# -*- coding:utf-8 -*- import os from sqlalchemy import create_engine from pandas.io.pytables import HDFStore import tushare as ts def csv(): df = ts.get_hist_data('000875') df.to_csv('c:/day/000875.csv',columns=['open','high','low','close']) def xls(): df = ts.get_hist_data('000875') #直接保存 df.t...
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding # from codecs import open # from os import path # here = path...
import time from datetime import datetime from openerp.osv import fields, osv from openerp.tools.translate import _ class hr_action_reason(osv.osv): _name = "hr.action.reason" _description = "Action Reason" _columns = { 'name': fields.char('Reason', required=True, help='Specifies the reason for S...
import imp import os import sys import unittest from nose.loader import TestLoader as Loader from nose import util, loader, selector # so we can set mocks import nose.case def safepath(p): """Helper function to make cross-platform safe paths """ return p.replace('/', os.sep) def mods(): # # Set...
from __future__ import unicode_literals from guessit import UnicodeMixin, base_text_type, u, s from guessit.fileutils import load_file_in_same_dir from guessit.textutils import find_words from guessit.country import Country import re import logging __all__ = [ 'is_iso_language', 'is_language', 'lang_set', 'Language', ...
""" Aliases for functions which may be accelerated by Scipy. Scipy_ can be built to use accelerated or otherwise improved libraries for FFTs, linear algebra, and special functions. This module allows developers to transparently support these accelerated functions when scipy is available but still support users who hav...
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.hvac_templates import HvactemplatePlantTowerObjectReference log = logging.getLogger(__name__) class TestHvactemplatePlantTowerObjectReference(unittest.TestCase): def setUp(...
"""Tests for slices module.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.autograph.operators import slices from tensorflow.python.framework import constant_op from tensorflow.python.ops import list_ops from tensorflow.python.pla...
[{'bgcolor': u'#E5E5E5', 'components': [{'left': '10', 'name': 'field1', 'top': '10', 'type': 'TextBox', 'value': u'Hello gui2py', 'width': '288'}, {'bgcolor': u'#E5E5E5', 'components': [{'id':...
# coding: utf-8 import codecs import os.path from setuptools import setup, find_packages from distutils.command.build_py import build_py import os with open('README.md') as file: long_description = file.read() def read(rel_path): here = os.path.abspath(os.path.dirname(__file__)) with codecs.open(os.pat...
# pylint: disable=missing-docstring,no-member import uuid from django.http import HttpRequest from django.template import VariableDoesNotExist from django.test import override_settings from mock import patch from edx_ace import Message, Recipient from openedx.core.djangoapps.ace_common.templatetags.ace import ( e...
from unittest import TestCase import simplejson.encoder CASES = [ (u'/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'), (u'\u0123\u4567\u89ab\ucdef\uabcd\uef4a', '"\\u0...
from __future__ import absolute_import, print_function import os import subprocess import sys from contextlib import contextmanager from distutils import sysconfig from site import USER_SITE import pkg_resources from pkg_resources import EntryPoint, WorkingSet, find_distributions from .common import die from .compat...
""" Verifies make_global_settings. """ import os import sys import TestGyp test_format = ['ninja'] if sys.platform in ('linux2', 'darwin'): test_format += ['make'] test = TestGyp.TestGyp(formats=test_format) test.run_gyp('make_global_settings.gyp') if test.format == 'make': cc_expected = """ifneq (,$(filter $(...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = r''' --- module: purefa_host version_added: '2.4' short_description: Manage h...
import requests from requests_toolbelt import MultipartEncoder, MultipartEncoderMonitor from resource import ReadymapObject, Layer from readymap import error class ReadyMap(object): """ Client object for interacting with a ReadyMap server. """ def __init__(self, url, token): self.ur...
import os from telemetry import page as page_module from telemetry.page import page_set from telemetry.results import base_test_results_unittest from telemetry.results import page_test_results from telemetry.timeline import trace_data from telemetry.value import failure from telemetry.value import histogram from telem...
"""QtWebKit specific part of the web element API.""" from PyQt5.QtCore import QRect from PyQt5.QtWebKit import QWebElement from qutebrowser.config import config from qutebrowser.utils import log, utils, javascript from qutebrowser.browser import webelem class IsNullError(webelem.Error): """Gets raised by WebKi...
# -*- coding: utf-8 -*- """ *************************************************************************** i.py ---- Date : April 2016 Copyright : (C) 2016 by Médéric Ribreux Email : mederic dot ribreux at medspx dot fr ****************************************...
import mxnet as mx import random from mxnet.io import DataBatch, DataIter import numpy as np def add_data_args(parser): data = parser.add_argument_group('Data', 'the input images') data.add_argument('--data-train', type=str, help='the training data') data.add_argument('--data-train-idx', type=str, default=...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } import json from ansible.module_utils.network.aci.aci import ACIModule, aci_argument_spec from ansible.module_utils.ba...
""" Demostrative PURL implementing a redirection to the very last record (of a collection) """ from invenio.config import CFG_SITE_NAME, CFG_SITE_RECORD from invenio.search_engine import perform_request_search from invenio.bibdocfile import BibRecDocs, InvenioBibDocFileError def goto(cc=CFG_SITE_NAME, p='', f='', sf=...
from scipy.stats import maxwell import matplotlib.pyplot as plt fig, ax = plt.subplots(1, 1) # Calculate a few first moments: mean, var, skew, kurt = maxwell.stats(moments='mvsk') # Display the probability density function (``pdf``): x = np.linspace(maxwell.ppf(0.01), maxwell.ppf(0.99), 100) ax.plot...