content
string
# -*- coding: utf-8 -*- try: # Python 2.7 from collections import OrderedDict except: # Python 2.6 from gluon.contrib.simplejson.ordered_dict import OrderedDict from gluon import current from gluon.storage import Storage from s3.s3forms import S3SQLCustomForm, S3SQLInlineComponent, S3SQLInlineCompone...
"""A bare-bones and non-compliant XMPP server. Just enough of the protocol is implemented to get it to work with Chrome's sync notification system. """ import asynchat import asyncore import base64 import re import socket from xml.dom import minidom # pychecker complains about the use of fileno(), which is implement...
# -*- coding: utf-8 -*- import scrapy import json from locations.items import GeojsonPointItem class LifetimeFitnessSpider(scrapy.Spider): name = "lifetimefitness" allowed_domains = ['lifetime.life'] start_urls = ( 'https://www.lifetime.life/view-all-locations.html', ) def parse(self, res...
# WebDriver specification ID: dfn-error-response-data errors = { "element click intercepted": 400, "element not selectable": 400, "element not interactable": 400, "insecure certificate": 400, "invalid argument": 400, "invalid cookie domain": 400, "invalid coordinates": 400, "invalid elem...
import django.utils.timezone import model_utils.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('student', '0001_squashed_0031_auto_20200317_1122'), ] operations = [ migrations.CreateModel( name='Schedule', ...
# -*- coding: utf-8 -*- ''' Exodus Add-on This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This progra...
from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase from django.utils import six from .models import ( Entry, Line, Post, RegressionModelSplit, SelfRefer, SelfReferChild, SelfReferChildSibling, Tag, TagCollection, Worksheet, ) class M2MRegre...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class Insert(Choreography): def __init__(self, temboo_session): """ Create a new in...
#!/usr/bin/env python3 import itertools import networkx as nx from pgmpy.base import UndirectedGraph class DirectedGraph(nx.DiGraph): """ Base class for all Directed Graphical Models. Each node in the graph can represent either a random variable, `Factor`, or a cluster of random variables. Edges i...
from __future__ import unicode_literals import json import time from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) from ..utils import ( ExtractorError, ) class HypemIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?hypem\.com/track/(?P<id>[^/]+)/...
#!/usr/bin/env python import os import sys from starcluster.config import StarClusterConfig print 'Simple wrapper script for s3fs (http://s3fs.googlecode.com/)' cfg = StarClusterConfig().load() ec2 = cfg.get_easy_ec2() buckets = ec2.s3.get_buckets() counter = 0 for bucket in buckets: print "[%d] %s" % (counter,b...
""" Module for abstract serializer/unserializer base classes. """ from StringIO import StringIO from django.db import models from django.utils.encoding import smart_unicode class SerializerDoesNotExist(KeyError): """The requested serializer was not found.""" pass class SerializationError(Exception): """...
from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y. F j.' TIME_FORMAT = 'G.i' DATETIME_FORMAT = 'Y. F j. G.i' YEAR_MONTH_FORMAT = 'Y. F' MONTH_DAY_FORMAT = 'F j.' SHORT_DATE_FORMAT = ...
import unittest import wikichatter.indentblock as indentblock import wikichatter.mwparsermod as mwpm EMPTY = "\n" LEVEL0 = "Level 0\n" LEVEL1 = ":Level 1\n" LEVEL2 = "::Level 2\n" LEVEL3 = ":::Level 3\n" LEVEL4 = "::::Level 4\n" LIST1 = "*Level 1\n" LIST2 = "**Level 2\n" LIST3 = "***Level 3\n" LIST4 = "****Level 4\n...
"""Tests for distutils.command.check.""" import unittest from test.test_support import run_unittest from distutils.command.check import check, HAS_DOCUTILS from distutils.tests import support from distutils.errors import DistutilsSetupError class CheckTestCase(support.LoggingSilencer, support.Temp...
from slicc.symbols.Symbol import Symbol class State(Symbol): def __repr__(self): return "[State: %s]" % self.ident __all__ = [ "State" ]
""" A Django command that exports a course to a tar.gz file. If <filename> is '-', it pipes the file to stdout """ import os import re import shutil import tarfile from tempfile import mktemp, mkdtemp from textwrap import dedent from path import path from django.core.management.base import BaseCommand, CommandErro...
#-*- coding: utf-8 -*- from django.http import HttpResponseForbidden, Http404, HttpResponse from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth import logout from django.contrib.auth.decorators import login_required from accueil.models import Classe, Matiere, Colleur, Message, Dest...
# -*- coding: utf-8 -*- import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class EuroshareEu(SimpleHoster): __name__ = "EuroshareEu" __type__ = "hoster" __version__ = "0.30" __status__ = "testing" __pattern__ = r'http://(?:www\.)?euroshare\.(eu|sk|cz|...
from .. import util from . import util as source_util machinery = util.import_importlib('importlib.machinery') import codecs import importlib.util import re import sys import types # Because sys.path gets essentially blanked, need to have unicodedata already # imported for the parser to use. import unicodedata import...
from __future__ import print_function from .common import BloomGenerator from .common import GeneratorError from .common import list_generators from .common import load_generator from .common import resolve_dependencies from .common import update_rosdep __all__ = [ 'BloomGenerator', 'GeneratorError', 'list_ge...
#!/usr/bin/env python3 """ FastQC - A quality control analysis tool for high throughput sequencing data https://github.com/s-andrews/FastQC """ import os import re from paleomix.common.command import AtomicCmd, InputFile, OutputFile from paleomix.common.versions import Requirement from paleomix.node import CommandNod...
# -*- coding: utf-8 -*- """ *************************************************************************** r_statistics.py --------------- Date : September 2017 Copyright : (C) 2017 by Médéric Ribreux Email : medspx at medspx dot fr ***************************...
# vim: ts=4 sw=4 expandtab import cgi import os.path import re import unittest _identifier = re.compile('^[A-Za-z_$][A-Za-z0-9_$]*$') _contenttypes = ( 'text/javascript', 'text/ecmascript', 'application/javascript', 'application/ecmascript', 'application/x-javascript', ) class JSVersion: def ...
"""Extras for django-taggit Includes: - Handle tag namespaces (eg. tech:javascript, profile:interest:homebrewing) TODO: - Permissions for tag namespaces (eg. system:* is superuser-only) - Machine tag assists """ from datetime import date, timedelta from django.db import models from django.db.models.fields import BLA...
import os import sys import subprocess from gi.repository import GLib from sugar3.logger import get_logs_dir def _test_child_watch_cb(pid, condition, log_file): if os.WIFEXITED(condition): log_file.close() sys.exit(os.WEXITSTATUS(condition)) def check_environment(): run_test = os.environ.g...
from __future__ import absolute_import, print_function from builtins import super # provides Py3-style super() using python-future from os import path from psychopy.experiment.components import BaseVisualComponent, Param, getInitVals, _translate # the absolute path to the folder containing this path thisFolder = pat...
from printer import Printer from camera import Camera from grid import Grid from vector import Vector from gridworld import GridWorld from ann import Network class AnnRunner(object): """Wraps up the gross reality of running a ``print'' using the printer simulation (controlled by a neural network)""" camera_si...
"""Test mempool limiting together/eviction with the wallet.""" from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * class MempoolLimitTest(BitcoinTestFramework): def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 1 self.ext...
""" A file system tree. """ # Standard library imports. from os import listdir from os.path import basename, isdir, isfile, join # Enthought library imports. from enthought.pyface.tree.api import NodeManager, NodeType class FileNode(NodeType): """ Node type for files. """ #################################...
import os import socket import atexit import re from setuptools.extern.six.moves import urllib, http_client, map import pkg_resources from pkg_resources import ResolutionError, ExtractionError try: import ssl except ImportError: ssl = None __all__ = [ 'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_avail...
"""Keras built-in activation functions.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function # Activation functions. from tensorflow.contrib.keras.python.keras.activations import elu from tensorflow.contrib.keras.python.keras.activations import hard_sigmoid f...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { "metadata_version": "1.1", "status": ["preview"], "supported_by": "community", } from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native from ansible.mo...
import asyncio import aiohttp import logging log = logging.getLogger(__name__) @asyncio.coroutine def http_post_request(url, headers): # pragma: no cover response = yield from aiohttp.post(url, headers=headers) if not response.status == 200: text = yield from response.text() log.error("URL: %...
from Screen import Screen from Screens.MessageBox import MessageBox from Screens.ParentalControlSetup import ProtectedScreen from Components.Sources.List import List from Components.ActionMap import NumberActionMap, ActionMap from Components.Sources.StaticText import StaticText from Components.config import configfile ...
"""Random forest implementation in tensorflow.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function # pylint: disable=unused-import from tensorflow.contrib.tensor_forest.client import eval_metrics from tensorflow.contrib.tensor_forest.client import random_fore...
import os import StringIO import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from testing_support.super_mox import SuperMoxTestBase from testing_support import trial_dir import gclient_utils import subprocess2 class GclientUtilBase(SuperMoxTestBase): def setUp(self): s...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import time from ansible.module_utils.azure_rm_common import AzureRMModuleBase try: fr...
from __future__ import nested_scopes """ GSIServer - Contributed by Ivan R. Judson <<EMAIL>> ################################################################################ # # SOAPpy - Cayce Ullman (<EMAIL>) # Brian Matthews (<EMAIL>) # Gregory Warnes (<EMAIL>) # Christophe...
"""An Python re-implementation of hierarchical module import. This code is intended to be read, not executed. However, it does work -- all you need to do to enable it is "import knee". (The name is a pun on the klunkier predecessor of this module, "ni".) """ import sys, imp, __builtin__, string # Replacement for...
"""Test for telluride_decoding.scaled_lda.""" import os from absl.testing import absltest import matplotlib.pyplot as plt import numpy as np from telluride_decoding import scaled_lda class ScaledLdaTest(absltest.TestCase): def test_one_dimensional_data(self): num_points = 1000 d1 = np.random.randn(num_...
from test_framework import BitcoinTestFramework from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from util import * def get_sub_array_from_array(object_array, to_match): ''' Finds and returns a sub array from an array of arrays. to_match should be a unique idetifier of a sub arr...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'network'}
#!/usr/bin/env python """ Copyright 2001 Pearu Peterson all rights reserved, Pearu Peterson <<EMAIL>> Permission to use, modify, and distribute this software is given under the terms of the LGPL. See http://www.fsf.org NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. $Revision: 1.1 $ $Date: 2001...
#------------------------------------------------------------------------------ # BuildExeStartup.py # Initialization script for cx_Freeze which manipulates the path so that the # directory in which the executable is found is searched for extensions but # no other directory is searched. It also sets the attribute...
import logging from urllib.parse import quote, urlparse, urlunparse import datetime from requests import Session from pajbot import constants from pajbot.apiwrappers.response_cache import APIResponseCache log = logging.getLogger(__name__) class BaseAPI: def __init__(self, base_url, redis=None): self.b...
"""Fixes bug 1047079 - remove processors, jobs tables Revision ID: 235c80dc2e12 Revises: 556e11f2d00f Create Date: 2014-12-30 13:29:15.108296 """ # revision identifiers, used by Alembic. revision = '235c80dc2e12' down_revision = '556e11f2d00f' from alembic import op from socorro.lib import citexttype, jsontype, bui...
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. Retur...
from donut import email_utils from donut.modules.feedback import email_templates import flask import pymysql.cursors from donut.modules.feedback.groups import groupInt, groupName import donut.modules.groups.helpers as groups import donut.modules.newsgroups.helpers as newsgroups def send_update_email(group, email, com...
import json from ansible.module_utils.six.moves.urllib.error import HTTPError from units.compat import mock from units.compat import unittest from units.compat.builtins import BUILTINS from units.compat.mock import mock_open, patch from ansible.errors import AnsibleConnectionFailure from ansible.module_utils.connecti...
from __future__ import unicode_literals import datetime import json import pytz from django.core.urlresolvers import reverse from django.test import RequestFactory from oscar.core.loading import get_model from ecommerce.coupons.tests.mixins import CouponMixin from ecommerce.courses.models import Course from ecommerc...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.cache.base import BaseCacheModule class CacheModule(BaseCacheModule): def __init__(self, *args, **kwargs): self._cache = {} def get(self, key): return self._cache.get(key) def se...
# -*- coding: UTF-8 -*- """ Functions to manage internationalisation (i18n): - initLocale(): setup locales and install Unicode compatible stdout and stderr ; - getTerminalCharset(): guess terminal charset ; - gettext(text) translate a string to current language. The function always returns Unicode string. You can a...
"""Support for KNX/IP lights.""" from enum import Enum import voluptuous as vol from xknx.devices import Light as XknxLight from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, ATTR_WHITE_VALUE, PLATFORM_SCHEMA, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, ...
'''Unit tests for watchlist.py.''' import unittest2 as unittest import watchlist class MockErrorHandler(object): def __init__(self, handle_style_error): self.turned_off_filtering = False self._handle_style_error = handle_style_error def turn_off_line_filtering(self): self.turned_o...
import os, sys, thread, time sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * usage = "perf script -s sctop.py [comm] [interval]\n"; for_comm = None default_interval = 3 interval = default_inter...
"""This file provides the opening handshake processor for the WebSocket protocol (RFC 6455). Specification: http://tools.ietf.org/html/rfc6455 """ # Note: request.connection.write is used in this module, even though mod_python # document says that it should be used only in connection handlers. # Unfortunately, we ha...
import os import time from oslo_config import cfg from oslo_log import log as logging from oslo_serialization import jsonutils from nova import utils LOG = logging.getLogger(__name__) CONF = cfg.CONF TWENTY_FOUR_HOURS = 3600 * 24 # NOTE(morganfainberg): Due to circular import dependencies, the use of the # CONF....
#! /usr/bin/env python """A multi-threaded telnet-like server that gives a Python prompt. This is really a prototype for the same thing in C. Usage: pysvr.py [port] For security reasons, it only accepts requests from the current host. This can still be insecure, but restricts violations from people who can log in o...
import rdflib from rdflib import URIRef from rdflib.namespace import RDFS from jinja2 import Template import random import urllib import json import time import re from altuniverse import alternate_universe def get_random_class(g): return random.choice(list(g.subjects(RDFS.subClassOf, None))) def get_label_str...
"""SCons.Tool.wix Tool-specific initialization for wix, the Windows Installer XML Tool. 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, ...
import types from boto.gs.user import User from boto.exception import InvalidCorsError from xml.sax import handler # Relevant tags for the CORS XML document. CORS_CONFIG = 'CorsConfig' CORS = 'Cors' ORIGINS = 'Origins' ORIGIN = 'Origin' METHODS = 'Methods' METHOD = 'Method' HEADERS = 'Resp...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'ShortURL.collect_tries' db.add_column('shortim_shorturl', 'collect_tries', self.gf('django...
"""Tests for Red Hat Access Insights :Requirement: Rhai :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: UI :TestType: Functional :CaseImportance: High :Upstream: No """ import time from fauxfactory import gen_string from nailgun import entities from robottelo import manifests from robottelo.ap...
#! /usr/bin/env python """Whimpy test script for the cl module Roger E. Masse """ import cl from test_support import verbose clattrs = ['ADDED_ALGORITHM_ERROR', 'ALAW', 'ALGORITHM_ID', 'ALGORITHM_VERSION', 'AUDIO', 'AWARE_ERROR', 'AWARE_MPEG_AUDIO', 'AWARE_MULTIRATE', 'AWCMP_CONST_QUAL', 'AWCMP_FIXED_RATE', 'AWCMP_...
# tests for slice objects; in particular the indices method. import unittest from test import test_support from cPickle import loads, dumps import sys class SliceTest(unittest.TestCase): def test_constructor(self): self.assertRaises(TypeError, slice) self.assertRaises(TypeError, slice, 1, 2, 3, ...
from __future__ import print_function import re r_line = re.compile(r"^(syn keyword vimCommand contained|syn keyword vimOption " r"contained|syn keyword vimAutoEvent contained)\s+(.*)") r_item = re.compile(r"(\w+)(?:\[(\w+)\])?") def getkw(input, output): out = file(output, 'w') output_in...
from migrate import ForeignKeyConstraint, UniqueConstraint from oslo_db.sqlalchemy import utils from sqlalchemy import MetaData, schema, Table FKEYS = [ ('fixed_ips', 'instance_uuid', 'instances', 'uuid', 'fixed_ips_instance_uuid_fkey'), ('block_device_mapping', 'instance_uuid', 'instances', 'uuid', ...
""" Support for creating a service which runs a process monitor. """ from twisted.python import usage from twisted.runner.procmon import ProcessMonitor class Options(usage.Options): """ Define the options accepted by the I{twistd procmon} plugin. """ synopsis = "[procmon options] commandline" o...
from alembic import op import sqlalchemy as sa action_types = sa.Enum('allow', 'deny', name='firewallrules_action') def upgrade(): op.create_table( 'firewall_policies', sa.Column('tenant_id', sa.String(length=255), nullable=True), sa.Column('id', sa.String(length=36), nullable=False), ...
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import ( compat_urlparse, ) from ..utils import ( ExtractorError, ) class SlideshareIE(InfoExtractor): _VALID_URL = r'https?://www\.slideshare\.net/[^/]+?/(?P<title>.+?)($|\?)' _TEST = { ...
#!/usr/bin/env python # -*- coding: utf-8 -*- __license__ = """ GoLismero 2.0 - The web knife - Copyright (C) 2011-2014 Golismero project site: https://github.com/golismero Golismero project mail: <EMAIL> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Publi...
# flash LED #1 using inline assembler # this version is overly verbose and uses word stores @micropython.asm_thumb def flash_led(r0): movw(r1, (stm.GPIOA + stm.GPIO_BSRRL) & 0xFFFF) movt(r1, ((stm.GPIOA + stm.GPIO_BSRRL) >> 16) & 0x7FFF) movw(r2, 1 << 13) movt(r2, 0) movw(r3, 0) movt(r3, 1 << 13...
import sys import vlc from PyQt4 import QtGui, QtCore from Messenger import Messenger class Player(QtGui.QMainWindow): """A simple Media Player using VLC and Qt """ def __init__(self, master=None): QtGui.QMainWindow.__init__(self, master) self.setWindowTitle("Media Player") # cre...
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, qualities, ) class NDRIE(InfoExtractor): IE_NAME = 'ndr' IE_DESC = 'NDR.de - Mediathek' _VALID_URL = r'https?://www\.ndr\.de/.+?(?P<id>\d+)...
""" Tests of student.roles """ import ddt from django.test import TestCase from courseware.tests.factories import UserFactory, StaffFactory, InstructorFactory from student.tests.factories import AnonymousUserFactory from student.roles import ( GlobalStaff, CourseRole, CourseStaffRole, CourseInstructorRole, Or...
import splicer_GUI_FB from templatesGCodePanel import GCodePanel from templatesTransitionPanel import TransitionPanel import wx import wx.xrc import logging import splicer logger = logging.getLogger(__name__) # Logic implementation file for the GUI class MyFrame( splicer_GUI_FB.mainFrameGUI ): def __init__( self, p...
class Event: """An Event. `evt' is 'key' or somesuch.""" def __init__(self, evt, data, raw=''): self.evt = evt self.data = data self.raw = raw def __repr__(self): return 'Event(%r, %r)'%(self.evt, self.data) class Console: """Attributes: screen, height, w...
import proto # type: ignore __protobuf__ = proto.module( package="google.ads.googleads.v7.services", marshal="google.ads.googleads.v7", manifest={"GetDetailPlacementViewRequest",}, ) class GetDetailPlacementViewRequest(proto.Message): r"""Request message for [DetailPlacementViewService.GetDetai...
#!/usr/bin/env python # -*- coding: utf-8 -*- """cmake_sanity_check.py: Check if Cmake files are ok. Last modified: Sat Jan 18, 2014 05:01PM NOTE: Run in this directory only. """ __author__ = "Dilawar Singh" __copyright__ = "Copyright 2013, Dilawar Singh and NCBS Bangalore" __credits__ = ...
"""Abstract Base Classes (ABCs) according to PEP 3119.""" from _weakrefset import WeakSet def abstractmethod(funcobj): """A decorator indicating abstract methods. Requires that the metaclass is ABCMeta or derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unle...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.azure_rm_common import AzureRMModuleBase try: from msrestazu...
import ConfigParser import datetime import phil.util from phil.util import ( out, err, parse_configuration, parse_ics, get_next_date, should_remind, format_date, generate_date_bits) class Phil(object): def __init__(self, quiet=False, debug=False): self.config = None self.quiet = quiet ...
from decimal import Decimal from boto.compat import filter, map def ResponseFactory(action): class FPSResponse(Response): _action = action _Result = globals().get(action + 'Result', ResponseElement) # due to nodes receiving their closing tags def endElement(self, name, value, conn...
"""Tests for Bijector.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.contrib.distributions.python.ops.bijectors.softplus import Softplus from tensorflow.python.ops.distributions.bijector_test_util import assert_bijec...
# -*- coding: utf-8 -*- """ click ~~~~~ Click is a simple Python module that wraps the stdlib's optparse to make writing command line scripts fun. Unlike other modules, it's based around a simple API that does not come with too much magic and is composable. In case optparse ever gets removed ...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, float_or_none, int_or_none, parse_filesize, ) class LibraryOfCongressIE(InfoExtractor): IE_NAME = 'loc' IE_DESC = 'Library of Congress' _VALID_URL = r...
"""Format tensors (ndarrays) for screen display and navigation.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy import re import numpy as np from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.python.debug.cli i...
"""TLS Lite + imaplib.""" import socket from imaplib import IMAP4 from gdata.tlslite.TLSConnection import TLSConnection from gdata.tlslite.integration.ClientHelper import ClientHelper # IMAP TLS PORT IMAP4_TLS_PORT = 993 class IMAP4_TLS(IMAP4, ClientHelper): """This class extends L{imaplib.IMAP4} with TLS suppor...
from django.utils.encoding import python_2_unicode_compatible from ..models import models @python_2_unicode_compatible class NamedModel(models.Model): name = models.CharField(max_length=30) objects = models.GeoManager() class Meta: abstract = True required_db_features = ['gis_enabled'] ...
""" Test finding orphans via the view and django config """ import json from contentstore.tests.utils import CourseTestCase from student.models import CourseEnrollment from contentstore.utils import reverse_course_url class TestOrphanBase(CourseTestCase): """ Base class for Studio tests that require orphaned ...
import logging from graphite.storage import Store from django.conf import settings from django.test import TestCase # Silence logging during tests LOGGER = logging.getLogger() # logging.NullHandler is a python 2.7ism if hasattr(logging, "NullHandler"): LOGGER.addHandler(logging.NullHandler()) class StorageTes...
from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal class GetChainTipsTest (BitcoinTestFramework): def __init__(self): super().__init__() self.num_nodes = 4 self.setup_clean_chain = False def run_test (self): tips = self....
from .base import require_arg from .base import get_timeout_multiplier # noqa: F401 from .chrome import executor_kwargs as chrome_executor_kwargs from .chrome_android import ChromeAndroidBrowserBase from ..executors.executorwebdriver import (WebDriverTestharnessExecutor, # noqa: F401 ...
"""A dumb and slow but simple dbm clone. For database spam, spam.dir contains the index (a text file), spam.bak *may* contain a backup of the index (also a text file), while spam.dat contains the data (a binary file). XXX TO DO: - seems to contain a bug when updating... - reclaim free space (currently, space once o...
"""Python utilities required by Keras.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import marshal import sys import time import types as python_types import numpy as np import six from tensorflow.python.util import tf_decorator from tensorflow.pytho...
from pymongo import MongoClient from time import time from datetime import timedelta, datetime from sys import argv def check_coll(collection, collection_name): n = 0 for doc in collection.find(): id = doc['_id'] if collection_name == CSUB_COLL or collection_name == CASUB_COLL: ref...
from util import hook, user, database import os import sys import re import json import time import subprocess # @hook.command(autohelp=False, permissions=["permissions_users"], adminonly=True) # def permissions(inp, bot=None, notice=None): # """permissions [group] -- lists the users and their permission level w...
import os import socket import atexit import re import pkg_resources from pkg_resources import ResolutionError, ExtractionError from setuptools.compat import urllib2 try: import ssl except ImportError: ssl = None __all__ = [ 'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_available', 'cert_paths', 'op...
"""Carry out voice commands by recognising keywords.""" import datetime import logging import subprocess import vlc import time import requests import re import actionbase # ============================================================================= # # Hey, Makers! # # This file contains some examples of voice co...