content
string
import sys from io import StringIO from django.apps import apps from django.conf import settings from django.core import serializers from django.db import router # The prefix to put on the default database name when creating # the test database. TEST_DATABASE_PREFIX = 'test_' class BaseDatabaseCreation: """ ...
''' Copyright (C) 2021 Gitcoin Core This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero 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...
import os import sys import tempfile import operator import functools import itertools import re import contextlib import pickle import textwrap from setuptools.extern import six from setuptools.extern.six.moves import builtins, map import pkg_resources.py31compat if sys.platform.startswith('java'): import org.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): # Removing unique constraint on 'XModuleSettingsField', fields ['usage_id', 'field_name'] db.delete_unique('...
import socket import copy import threading import logging import requests import urllib3 from .response_decoder import decode_response MAX_FILE_SIZE = 20000000 MIN_FILE_SIZE = 10 LOGGER = logging.getLogger(__name__) # customize headers HEADERS = { 'Connection': 'close', 'User-Agent': 'Mozilla/5.0 (Macintos...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from six import StringIO from ansible.compat.tests import unittest from ansible.playbook.play_context import PlayContext from ansible.plugins.connections import ConnectionBase #from ansible.plugins.connections.accelerate import C...
"""CPU profiler that works by instrumenting all function calls (uses cProfile). This profiler provides detailed function timings for all function calls during a request. This is just a simple wrapper for cProfile with result formatting. See http://docs.python.org/2/library/profile.html for more. PRO: since every fun...
"""Contains objects used with Google Apps.""" __author__ = '<EMAIL>' import atom import gdata # XML namespaces which are often used in Google Apps entity. APPS_NAMESPACE = 'http://schemas.google.com/apps/2006' APPS_TEMPLATE = '{http://schemas.google.com/apps/2006}%s' class Rfc822Msg(atom.AtomBase): """The Migr...
import base64 import binascii from distutils import version import os import sys import time import uuid from oslo.config import cfg from nova.api.metadata import password from nova.compute import utils as compute_utils from nova import context from nova import crypto from nova import exception from nova.i18n import ...
try: from distutils.version import LooseVersion HAS_LOOSE_VERSION = True except: HAS_LOOSE_VERSION = False def aws_common_argument_spec(): return dict( ec2_url=dict(), aws_secret_key=dict(aliases=['ec2_secret_key', 'secret_key'], no_log=True), aws_access_key=dict(aliases=['ec2...
from _testcapi import test_structmembersType, \ CHAR_MAX, CHAR_MIN, UCHAR_MAX, \ SHRT_MAX, SHRT_MIN, USHRT_MAX, \ INT_MAX, INT_MIN, UINT_MAX, \ LONG_MAX, LONG_MIN, ULONG_MAX, \ LLONG_MAX, LLONG_MIN, ULLONG_MAX import warnings, exceptions, unittest, sys from test import test_support ts=test_structm...
from __future__ import absolute_import from PyQt4.QtGui import QDialog from PyQt4.QtGui import QListWidget from PyQt4.QtGui import QListWidgetItem from PyQt4.QtGui import QLabel from PyQt4.QtGui import QHBoxLayout from PyQt4.QtGui import QVBoxLayout from PyQt4.QtGui import QPushButton from PyQt4.QtGui import QSpacerIt...
"""This module provides mechanisms to use signal handlers in Python. Functions: alarm() -- cause SIGALRM after a specified time [Unix only] setitimer() -- cause a signal (described below) after a specified float time and the timer may restart then [Unix only] getitimer() -- get current value of timer [...
from distutils.errors import DistutilsArgError import inspect import glob import warnings import platform import distutils.command.install as orig import setuptools # Prior to numpy 1.9, NumPy relies on the '_install' name, so provide it for # now. See https://github.com/pypa/setuptools/issues/199/ _install = orig.in...
# # doctest.py: Syntax Highlighting for doctest blocks # Edward Loper # # Created [06/28/03 02:52 AM] # $Id: restructuredtext.py 1210 2006-04-10 13:25:50Z edloper $ # """ Syntax highlighting for doctest blocks. This module defines two functions, L{doctest_to_html()} and L{doctest_to_latex()}, which can be used to per...
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response from nssrc.com.citrix.netscaler.nitro.service.options import options from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_...
#!/usr/bin/python # # Send arbitrary command to a switch # import getopt,sys,os import httplib import simplejson import urllib # TODO: need to set the path for this from nox.webapps.webserviceclient.simple import PersistentLogin, NOXWSClient def usage(): print """ Usage: switch_command.py -d <direc...
""" Cross Site Request Forgery Middleware. This module provides a middleware that implements protection against request forgeries from other sites. """ import logging import re import string from urllib.parse import urlparse from django.conf import settings from django.core.exceptions import ImproperlyConfigured from...
from __future__ import division import numpy as np from sklearn.utils.linear_assignment_ import linear_assignment from sklearn.utils.validation import check_consistent_length, check_array __all__ = ["consensus_score"] def _check_rows_and_columns(a, b): """Unpacks the row and column arrays and checks their shap...
""" Test suite for OS X interpreter environment variables. """ from test.support import EnvironmentVarGuard, run_unittest import subprocess import sys import sysconfig import unittest @unittest.skipUnless(sys.platform == 'darwin' and sysconfig.get_config_var('WITH_NEXT_FRAMEWORK'), ...
import sys from pyspark import since from pyspark.rdd import ignore_unicode_prefix, PythonEvalType from pyspark.sql.column import Column, _to_seq from pyspark.sql.dataframe import DataFrame from pyspark.sql.types import * __all__ = ["GroupedData"] def dfapi(f): def _api(self): name = f.__name__ ...
from pygments.lexers.web import \ HtmlLexer, XmlLexer, JavascriptLexer, CssLexer from pygments.lexers.agile import PythonLexer, Python3Lexer from pygments.lexer import DelegatingLexer, RegexLexer, bygroups, \ include, using from pygments.token import \ Text, Comment, Operator, Keyword, Name, String, Other f...
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 = 'j. E Y' TIME_FORMAT = 'G:i' DATETIME_FORMAT = 'j. E Y G:i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'j. F' SHORT_DATE_FORMAT = 'd....
"""Tests for Adadelta Optimizer.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.eager import context from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tenso...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import getpass import locale import signal import sys from ansible import constants as C from ansible.errors import * from ansible.executor.task_queue_manager import TaskQueueManager from ansible.playbook import Playbook from ansi...
import calendar import time def fixed_mktime_tz(data): if data[9] is None: # No zone info, so localtime is better assumption than GMT return time.mktime(data[:8] + (-1,)) else: t = calendar.timegm(data) return t - data[9] def patch(): # Fix for http://bugs.python.org/issu...
import os import platform import sys from logging.handlers import SysLogHandler LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] def get_logger_config(log_dir, logging_env="no_env", tracking_filename="tracking.log", edx_filename="edx.log...
import uuid import random class Car: speed = 0 change_lane_intention = 0 street = None next_street = None probability = {} def __init__(self, **kwargs): if 'id' in kwargs: self.id = kwargs['id'] else: self.id = str(uuid.uuid4()) if 'speed' in...
import sys import traceback import math # How do we generate concentric circles? # We generate n circles of varying size. # The higher the density, the more circles # So we can take the density and create a big circle of size = density and iterate down to zero # How do we ensure the circles are spaced far enough apart...
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 SUPPORTED_PROTOCOLS = ['ipv4', 'ipv6...
try: try: import ubinascii as binascii except ImportError: import binascii except ImportError: print("SKIP") raise SystemExit print(binascii.a2b_base64(b"")) print(binascii.a2b_base64(b"Zg==")) print(binascii.a2b_base64(b"Zm8=")) print(binascii.a2b_base64(b"Zm9v")) print(binascii.a2b_ba...
from openerp import _, api, fields, models from openerp.tools import DEFAULT_SERVER_DATE_FORMAT from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta from openerp.exceptions import UserError import pytz class AccountInvoice(m...
"""Django admin interface for the shopping cart models. """ from ratelimitbackend import admin from shoppingcart.models import ( PaidCourseRegistrationAnnotation, Coupon, DonationConfiguration, Invoice, CourseRegistrationCodeInvoiceItem, InvoiceTransaction ) class SoftDeleteCouponAdmin(admin.M...
from lib.utility import misc class TemplateSnippet(object): def __init__(self, snippet_name = None, source_url = None, order = None): self._snippet_name = snippet_name self._source_url = source_url self._order = order @property def snippet_name(self): return self._snip...
import pytest import os import ipaddress from scapy.all import rdpcap, IP, IPv6, TCP, UDP from .test_utils import ExampleTest class TestPcapSplitter(ExampleTest): pytestmark = [pytest.mark.pcapsplitter, pytest.mark.no_network] def test_split_by_file_size(self, tmpdir): args = { '-f': os.path.join('pcap_exampl...
"""SavedModel simple save functionality.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import ops from tensorflow.python.saved_model import builder from tensorflow.python.saved_model import signature_constants from tens...
"""Tests for polyutils module. """ from __future__ import division, absolute_import, print_function import numpy as np import numpy.polynomial.polyutils as pu from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run_module_suite) class TestMisc(TestCase): def...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Nov 20 16:40:22 2017 @author: santi """ import pandas as pd import numpy as np import networkx as nx from matplotlib import pyplot as plt if __name__ == "__main__": # load data conn_df = pd.read_excel('substation.xl...
__all__ = [ 'ZerigoDNSDriver' ] import copy import base64 from libcloud.utils.py3 import httplib from libcloud.utils.py3 import b try: from lxml import etree as ET except ImportError: from xml.etree import ElementTree as ET from libcloud.utils.misc import merge_valid_keys, get_new_obj from libcloud.uti...
# -*- coding: utf-8 -*- # Tests for the contrib/localflavor/ AU form fields. tests = r""" ## AUPostCodeField ########################################################## A field that accepts a four digit Australian post code. >>> from django.contrib.localflavor.au.forms import AUPostCodeField >>> f = AUPostCodeField()...
import re from acceptedlangs import accepted_langs_normal, accepted_langs_lower def tweetParse(tweetString): # first identify if mentor or mentee isMentorBool = '#mentor' in tweetString.lower() isMentor = 'mentor' if isMentorBool else 'mentee' # then identify indices of '-'s in string indices = [i ...
from os.path import join, normcase, abspath, sep def safe_join(base, *paths): """ Joins one or more path components to the base path component intelligently. Returns a normalized, absolute version of the final path. The final path must be located inside of the base path component (otherwise a Valu...
# # vim: set sw=4 sts=4 et tw=80 fileencoding=utf-8: # """weather_stations - Imports weather station data files""" # Copyright (C) 2007-2010 James Rowe # # 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 Fou...
ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} PORTS_CONF = '/etc/cumulus/ports.conf' def hash_existing_ports_conf(module): module.ports_conf_hash = {} if not os.path.exists(PORTS_CONF): return False try: ...
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface AttrSequenceType { attribute sequence<object> foo; }; """) results = parser.finish() except: threw = True harness.ok(threw, "Attribute type must not be a...
from keystoneauth1 import loading as ka_loading WATCHER_CLIENTS_AUTH = 'watcher_clients_auth' def register_opts(conf): ka_loading.register_session_conf_options(conf, WATCHER_CLIENTS_AUTH) ka_loading.register_auth_conf_options(conf, WATCHER_CLIENTS_AUTH) def list_opts(): return [(WATCHER_CLIENTS_AUTH, k...
import json import unittest from extensions_paths import SERVER2 from server_instance import ServerInstance from template_data_source import TemplateDataSource from test_util import DisableLogging, ReadFile from third_party.handlebar import Handlebar def _ReadFile(*path): return ReadFile(SERVER2, 'test_data', 'temp...
from __future__ import unicode_literals, print_function from inspect import getsource import os from os.path import dirname as dirn import sys print('WARNING: Lazy loading extractors is an experimental feature that may not always work', file=sys.stderr) sys.path.insert(0, dirn(dirn((os.path.abspath(__file__))))) la...
from discord.ext import commands from datetime import datetime from bs4 import BeautifulSoup import discord import re class VisWax: def __init__(self, bot): self.bot = bot @commands.command(pass_context=True, aliases=['wax'], description='Shows the combination of runes needed f...
""" This script processes the output from the C preprocessor and extracts all qstr. Each qstr is transformed into a qstr definition of the form 'Q(...)'. This script works with Python 2.6, 2.7, 3.3 and 3.4. """ from __future__ import print_function import re import sys import os # Python 2/3 compatibility: # - it...
import numpy as np import theano.tensor as T from numpy import linalg as la, random as rnd import pymanopt from pymanopt.manifolds import Sphere from pymanopt.solvers import ConjugateGradient def dominant_eigenvector(A): """ Returns the dominant eigenvector of the symmetric matrix A. Note: For the same ...
import sys import logging from scripts import utils as script_utils from framework.transactions.context import TokuTransaction from website.app import init_app from website.addons.osfstorage import model logger = logging.getLogger(__name__) def do_migration(): count = 0 errored = 0 for node_settings in ...
"""ACME Identifier Validation Challenges.""" import abc import functools import hashlib import logging import socket from cryptography.hazmat.primitives import hashes import OpenSSL import requests from acme import errors from acme import crypto_util from acme import fields from acme import jose logger = logging.ge...
from nova.api.openstack.compute.plugins.v3 import migrate_server from nova import exception from nova.openstack.common import uuidutils from nova.tests.api.openstack.compute.plugins.v3 import \ admin_only_action_common from nova.tests.api.openstack import fakes class MigrateServerTests(admin_only_action_common.C...
from __future__ import unicode_literals from django.apps.registry import apps as global_apps from django.db import migrations from .loader import MigrationLoader from .recorder import MigrationRecorder from .state import ProjectState class MigrationExecutor(object): """ End-to-end migration execution - load...
import unittest from test import test_support import operator from sys import maxint maxsize = test_support.MAX_Py_ssize_t minsize = -maxsize-1 class oldstyle: def __index__(self): return self.ind class newstyle(object): def __index__(self): return self.ind class TrapInt(int): def __index...
""" Create copies of wiki pages for existing forks and registrations instead of using the same NodeWikiPage objects as the original node. """ import logging import sys from modularodm import Q from framework.mongo import database as db from framework.transactions.context import TokuTransaction from website.addons.wi...
# AUTHORS: # Hakan Ozadam # Rachel Brown # # Moore Laboratory # UMASS Medical School / HHMI # RNA Therapeutics Institute # Albert Sherman Center, ASC4-1009 # 368 Plantation Street # Worcester, MA 01605 # USA # ###############################################...
import wizard import c2c_budget_item import report import c2c_budget_sequence
""" Verifies build of an executable with C++ define specified by a gyp define using various special characters such as quotes, commas, etc. """ import os import TestGyp test = TestGyp.TestGyp() # Tests string literals, percents, and backslash escapes. try: os.environ['GYP_DEFINES'] = ( r"""test_format='\n%s\...
""" Takend from http://flask.pocoo.org/snippets/63/ """ from urlparse import urlparse, urljoin from flask import request, url_for, redirect from flask.ext.wtf import Form from wtforms import HiddenField def is_safe_url(target): ref_url = urlparse(request.host_url) test_url = urlparse(urljoin(request.host_ur...
import datetime from ..core import db from ..models import UserModel from ..models import FileModel import json from bson import ObjectId class ProfileModel(db.Document): created_at = db.StringField(default=str(datetime.datetime.utcnow())) user = db.ReferenceField(UserModel, reverse_delete_rule=db.CA...
# encoding: UTF-8 '''一个简单的通联数据客户端,主要使用requests开发,比通联官网的python例子更为简洁。''' import requests import json FILENAME = 'datayes.json' HTTP_OK = 200 ######################################################################## class DatayesClient(object): """通联数据客户端""" name = u'通联数据客户端' #---------------------...
# http://wiki.python.org/moin/BytesIO # # A skeleton one used for systems that don't have BytesIO. # # It's enough for subunit at least.... class BytesIO(object): """ A file-like API for reading and writing bytes objects. Mostly like StringIO, but write() calls modify the underlying bytes object. >>>...
#!/usr/bin/env python import os from setuptools import setup from setuptools import find_packages PROJECT = u'AnsibleCharm' VERSION = '0.1' URL = "https://blog.juju.solutions" AUTHOR = u'Whit Morriss <<EMAIL>>' AUTHOR_EMAIL = u'<EMAIL>' DESC = "Python library for charming with ansible" def read_file(file_name): ...
"""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.exp import Exp from tensorflow.contrib.distributions.python.ops.bijectors.inline import Inline from tens...
import distutils from distutils.core import setup, Extension from distutils.command.build_ext import build_ext from distutils.cmd import Command import platform import os import re CURR_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) # when compiling for Windows Python 2.7, force distutils to use ...
"""A Web interface to beets.""" from __future__ import division, absolute_import, print_function from beets.plugins import BeetsPlugin from beets import ui from beets import util import beets.library import flask from flask import g from werkzeug.routing import BaseConverter, PathConverter import os import json # Ut...
ASANA_API_KEY = "0123456789abcdef0123456789abcdef" # Change these values to the credentials for your Asana bot. ZULIP_USER = "<EMAIL>" ZULIP_API_KEY = "0123456789abcdef0123456789abcdef" # The Zulip stream that will receive Asana task updates. ZULIP_STREAM_NAME = "asana" ### OPTIONAL CONFIGURATION ### # Set to None...
"""Test runner for TensorFlow tests.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import os import shlex from string import maketrans import sys import time from google.protobuf import json_format from google.protobuf import text_form...
{ 'name': 'EU Mini One Stop Shop (MOSS)', 'version': '1.0', 'author': 'Odoo SA', 'website': 'http://www.odoo.com', 'category': '', 'description': """ EU Mini One Stop Shop (MOSS) VAT for telecommunications, broadcasting and electronic services ====================================================...
from math import * from random import * class rabin: def __init__(self): pass def get_big(self, bit): #get a big number x that x % 4 = 3 big = 1 for i in range(bit-3): temp = randrange(0,2) big = big * 2 + temp big = big * 4 + 3 ret...
"""Tests for XLA JIT compiler.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.compiler.tests.xla_test import XLATestCase from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from ...
"""A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structure that small copy overhead ends up taking seconds in a project the size of Chromium.""" class Error(Exception): pass __all__ = ["Error", "deepcopy"] ...
import os import shutil import sys import logging import heapq import yaml import re from distutils.util import strtobool from pkg_resources import resource_string from argparse import ArgumentParser, RawTextHelpFormatter from pywb.utils.loaders import load_yaml_config from pywb.utils.timeutils import timestamp20_no...
"""Check for an aggregated logging Elasticsearch deployment""" import json import re from openshift_checks import OpenShiftCheckException, OpenShiftCheckExceptionList from openshift_checks.logging.logging import LoggingCheck class Elasticsearch(LoggingCheck): """Check for an aggregated logging Elasticsearch dep...
""" An interface to the small NORB dataset. Unlike `./norb_small.py`, this reads the original NORB file format, not the LISA lab's `.npy` version. Currently only supports the Small NORB Dataset. Download the dataset from `here <http://www.cs.nyu.edu/~ylclab/data/norb-v1.0-small/>`_. NORB dataset(s) by Fu Jie Huang a...
"""Test the invalidateblock RPC.""" from test_framework.test_framework import nealcoinTestFramework from test_framework.util import * class InvalidateTest(nealcoinTestFramework): def __init__(self): super().__init__() self.setup_clean_chain = True self.num_nodes = 3 def ...
"""Analytics helpers library.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function def track_usage(tool_id, tags): """No usage tracking for external library. Args: tool_id: A string identifier for tool to be tracked. tags: list of string tags tha...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import os try: from ipaddress import ip_network HAS_IPADDRESS = True except Import...
import logging from oslo_log import versionutils from keystone.endpoint_policy.backends import sql LOG = logging.getLogger(__name__) _OLD = 'keystone.contrib.endpoint_policy.backends.sql.EndpointPolicy' _NEW = 'keystone.endpoint_policy.backends.sql.EndpointPolicy' class EndpointPolicy(sql.EndpointPolicy): @v...
import unittest import os import copy # internal modules: from yotta.test.cli import cli from yotta.test.cli import util Test_Target = "x86-osx-native,*" Test_Target_Name = 'x86-osx-native' Test_Target_Old_Version = '0.0.7' Test_Shrinkwrap = { 'module.json':'''{ "name": "test-shrinkwrap", "version": "0.0.0", "...
from config import settings from salmon import view from salmon.routing import Router from salmon.server import Relay import jinja2 import logging import logging.config import os logging.config.fileConfig("config/test_logging.conf") # the relay host to actually send the final message to (set debug=1 to see what # the...
""" Error checking functions for GEOS ctypes prototype functions. """ from ctypes import c_void_p, string_at from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc # Getting the `free` routine used to free the memory allocated for # string pointers ...
from django.http import HttpResponse from django.template import Template, Context from django.template.response import TemplateResponse from django.test import TestCase, RequestFactory from django.utils.decorators import decorator_from_middleware class ProcessViewMiddleware(object): def process_view(self, reques...
"""Buildgen vsprojects plugin. This parses the list of libraries, and generates globals "vsprojects" and "vsproject_dict", to be used by the visual studio generators. """ import hashlib import re def mako_plugin(dictionary): """The exported plugin code for generate_vsprojeccts We want to help the work of the...
""" Built-in, globally-available admin actions. """ from django.core.exceptions import PermissionDenied from django.contrib.admin import helpers from django.contrib.admin.util import get_deleted_objects, model_ngettext from django.db import router from django.template.response import TemplateResponse from django.utils...
""" This module contains the main script for running AvoPlot. """ import optparse import avoplot from avoplot.gui import main def __parse_cmd_line(): """ Function parses the command line input and returns a tuple of (options, args). """ usage = ("Usage: %prog [options]") parser = o...
from email.utils import formatdate from scrapy import signals from scrapy.exceptions import NotConfigured, IgnoreRequest from scrapy.utils.misc import load_object class HttpCacheMiddleware(object): def __init__(self, settings, stats): if not settings.getbool('HTTPCACHE_ENABLED'): raise NotCon...
"""TensorBoard Plugin abstract base class. Every plugin in TensorBoard must extend and implement the abstract methods of this base class. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from abc import ABCMeta from abc import abstractmethod class TBP...
from .abstract_arquivos_governo import AbstractArquivosGoverno class Grrf(AbstractArquivosGoverno): # Informações do Responsavel def _registro_00(self): registro_00 = self.tipo_de_registro_00 registro_00 += str.ljust('', 51) registro_00 += self._validar(self.tipo_de_remessa, 1, 'N') ...
class BSTNode(object): """A node in a binary search tree.""" def __init__(self, data, left=None, right=None): self.data = data self.left = left self.right = right class BinarySearchTree(object): """A class for a binary search tree that stores unique values.""" def __init__(sel...
from . import SimIRStmt from ... import s_options as o from ...s_action_object import SimActionObject from ...s_action import SimActionData class SimIRStmt_StoreG(SimIRStmt): def _execute(self): addr = self._translate_expr(self.stmt.addr) data = self._translate_expr(self.stmt.data) expr = d...
#!/usr/bin/env python from setuptools import setup, Command import subprocess, os, shutil, glob, sys coffee_files = [ 'cldoc.coffee', 'page.coffee', 'sidebar.coffee', 'node.coffee', 'type.coffee', 'doc.coffee', 'category.coffee', 'enum.coffee', 'templated.coffee', 'struct.coff...
import srddl.data as sd import srddl.fields as sf import srddl.helpers as sh import srddl.models as sm class PcapFileHeader(sm.Struct): magic = sf.IntField('magic', size=4) version_major = sf.IntField('', size=2) version_minor = sf.IntField('', size=2) thiszone = sf.IntField('gmt to local correction', size=4) ...
"""Kea database config backend commands hook testing""" import pytest import srv_msg from cb_model import setup_server_for_config_backend_cmds pytestmark = [pytest.mark.v6, pytest.mark.kea_only, pytest.mark.controlchannel, pytest.mark.hook, pytest.mark.config_b...
import xml.dom.minidom as minidom from xml.parsers.expat import ExpatError import crash_utils from repository_parser_interface import ParserInterface # This number is 6 because each linediff page in src.chromium.org should # contain the following tables: table with revision number, table with actual # diff, table wi...
'''Support for gathering resources from RC files. ''' import re from grit import exception from grit import lazy_re from grit import tclib from grit.gather import regexp # Find portions that need unescaping in resource strings. We need to be # careful that a \\n is matched _first_ as a \\ rather than matching as...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.cloudstack import ( AnsibleCloudStack, cs_argument_spec, cs_required_together, )...
from iptest.assert_util import * add_clr_assemblies("loadorder_3") # namespace First { # public class Generic1<K, V> { # public static string Flag = typeof(Generic1<,>).FullName; # } # } import First from First import * AreEqual(First.Generic1[str, str].Flag, "First.Generic1`2") add_clr_asse...