content
string
""" OneWire library ported to MicroPython by Jason Hildebrand. TODO: * implement and test parasite-power mode (as an init option) * port the crc checks The original upstream copyright and terms follow. ------------------------------------------------------------------------------ Copyright (c) 2007, Jim Studt ...
"""Utility functions for the server. This includes the interface from the server implementation to the payment channel and lightning network APIs. requires_auth -- decorator which makes a view function require authentication authenticate_before_request -- a before_request callback for auth api_factory -- returns a fl...
from openerp.tools.translate import _ from openerp.osv import fields, osv class report_webkit_actions(osv.osv_memory): _name = "report.webkit.actions" _description = "Webkit Actions" _columns = { 'print_button':fields.boolean('Add print button', help="Check this to add a Print action for this Report...
import os import re import subprocess from create_kart_properties import functions def main(): # Check, if it runs in the root directory if not os.path.isfile("tools/update_characteristics.py"): print("Please run this script in the root directory of the project.") exit(1) for operation, fu...
from .script_interface import ScriptObjectRegistry, ScriptInterfaceHelper, script_interface_register import espressomd.code_info if any(i in espressomd.code_info.features() for i in ["LB_BOUNDARIES", "LB_BOUNDARIES_GPU"]): @script_interface_register class LBBoundaries(ScriptObjectRegistry): """ ...
# -*- coding: utf-8 -*- { 'name' : 'Booking management', 'version' : '1.2', 'author' : 'Alicia FLOREZ & Sébastien CHAZALLET', 'category': 'Sales Management', 'summary': 'Management of house, guestroom or hotel bookings.', 'description' : """ Manage your bookings ==================== This modul...
"""Test functions for the sparse.linalg.norm module """ from __future__ import division, print_function, absolute_import import numpy as np from numpy.linalg import norm as npnorm from numpy.testing import assert_allclose from pytest import raises as assert_raises import scipy.sparse from scipy.sparse.linalg import ...
__version__ = "0.1" import string import Image, TiffImagePlugin from OleFileIO import * # # -------------------------------------------------------------------- def _accept(prefix): return prefix[:8] == MAGIC ## # Image plugin for Microsoft's Image Composer file format. class MicImageFile(TiffImagePlugin.Ti...
from test_framework import BitcoinTestFramework from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from util import * def check_array_result(object_array, to_match, expected): """ Pass in array of JSON objects, a dictionary with key/value pairs to match against, and another dictionary wit...
# -*- coding: utf-8 -*- """ 42. Serialization ``django.core.serializers`` provides interfaces to converting Django ``QuerySet`` objects to and from "flat" data (i.e. strings). """ from __future__ import unicode_literals from decimal import Decimal from django.db import models from django.utils import six from django...
# coding: utf-8 from django.test import TestCase from django.core.urlresolvers import reverse as r from eventex.subscriptions.forms import SubscriptionForm from eventex.subscriptions.models import Subscription class SubscribeTest(TestCase): def setUp(self): self.resp = self.client.get(r('subscriptions:sub...
""" A path/directory class. """ import os import shutil import logging from migrate import exceptions from migrate.versioning.config import * from migrate.versioning.util import KeyedInstance log = logging.getLogger(__name__) class Pathed(KeyedInstance): """ A class associated with a path/directory tree...
__author__ = "Brian Lenihan <<EMAIL>" __copyright__ = "Copyright (c) 2012 Python for Android Project" __license__ = "Apache License, Version 2.0" import logging import sl4a from pyxmpp2.jid import JID from pyxmpp2.client import Client from pyxmpp2.settings import XMPPSettings from pyxmpp2.interfaces import XMPPFeatur...
"""Something just to look at via pydoc.""" import types class A_classic: "A classic class." def A_method(self): "Method defined in A." def AB_method(self): "Method defined in A and B." def AC_method(self): "Method defined in A and C." def AD_method(self): "Method de...
"""Static information resolution. This module contains utilities to help annotate AST nodes with as much runtime information as can be possibly extracted without actually executing the code, under that assumption that the context in which the code will run is known. Overall, the different analyses have the functions ...
"""Tensor utility functions.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.framework import sparse_tensor from tensorflow...
from __future__ import unicode_literals import sys import logging import datetime from django.utils import timezone from modularodm import Q from modularodm.storage.base import KeyExistsException from scripts import utils as script_utils from framework.transactions.context import TokuTransaction from website.files...
from __future__ import absolute_import, division, print_function import re from unittest import TestCase from webob import Request, Response from webtest import TestApp, TestRequest from manhattan.middleware import ManhattanMiddleware from manhattan.record import Record from manhattan.log.memory import MemoryLog cl...
import argparse import datetime import json import os import sys import logging import requests import subprocess import six import time import yaml from subprocess import Popen,PIPE from shlex import split from utils import * # Generate common options def generate_options(args): gpus = args.gpus cpu = args.c...
{ 'name': 'Multiple Analytic Plans', 'version': '1.0', 'category': 'Accounting & Finance', 'description': """ This module allows to use several analytic plans according to the general journal. ================================================================================== Here multiple analytic line...
"""Database setup and migration commands.""" from oslo_log import log as logging from jacket.db.sqlalchemy import migration LOG = logging.getLogger(__name__) IMPL = migration def db_sync(version=None, database='main'): """Migrate the database to `version` or the most recent version.""" return IMPL.db_sy...
import xml.etree.ElementTree as ET import re import time import os, csv from nltk.tokenize import sent_tokenize from textblob.classifiers import NaiveBayesClassifier from nltk.corpus import stopwords from nltk.tokenize import word_tokenize from nltk.stem import PorterStemmer from sklearn import naive_bayes from random ...
import re from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter import logging from csv import DictReader from pathlib import Path from micall.utils.sample_sheet_parser import sample_sheet_parser logger = logging.getLogger(__name__) def parse_args(): parser = ArgumentParser( description="Lo...
try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.contrib.auth.management import create_permissions from django.contrib.auth import models as auth_models from django.contrib.contenttypes import models as contenttypes_models from django.core.management import call...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, float_or_none, int_or_none, ) class StreamableIE(InfoExtractor): _VALID_URL = r'https?://streamable\.com/(?:[es]/)?(?P<id>\w+)' _TESTS = [ { ...
import os import types import shlex import sys import codecs import tempfile import tkinter.filedialog as tkFileDialog import tkinter.messagebox as tkMessageBox import re from tkinter import * from tkinter.simpledialog import askstring from idlelib.configHandler import idleConf from codecs import BOM_UTF8 # Try sett...
# -*- coding: utf-8 -*- from openerp.addons.project.tests.test_access_rights import TestPortalProjectBase from openerp.exceptions import AccessError from openerp.tools import mute_logger class TestPortalProjectBase(TestPortalProjectBase): def setUp(self): super(TestPortalProjectBase, self).setUp() ...
import uno import string import unohelper import xmlrpclib from com.sun.star.task import XJobExecutor if __name__<>"package": from lib.gui import * from lib.error import ErrorDialog from lib.functions import * database="test" uid = 3 class Expression(unohelper.Base, XJobExecutor ): def __init__...
import random import threading from collections import defaultdict import logging import time from typing import Any, Dict, List, Optional from ray.autoscaler.node_provider import NodeProvider from ray.autoscaler.tags import TAG_RAY_CLUSTER_NAME, TAG_RAY_NODE_NAME, \ TAG_RAY_LAUNCH_CONFIG, TAG_RAY_NODE_KIND, \ ...
import subprocess from hierarchyclass import * from tikzify import * formulae = 'tt lem wlem dgp glpoa gmp dp he dnsu dnse ud'.split() globals().update({f: f for f in formulae}) efq = 'efq' globals().update({future: future for future in 'dpn glpon mgmp glpon'.split()}) # These are actually equivalent. ip = he glpo ...
# Prewitt External Attribute import sys,os import numpy as np from scipy.ndimage import prewitt sys.path.insert(0, os.path.join(sys.path[0], '..')) import extattrib as xa xa.params = { 'Inputs': ['Input'], 'Output' : ['Average Gradient', 'In-line gradient', 'Cross-line gradient', 'Z gradient'], 'ZSampMargin' : {'Va...
from unittest import main from mock import Mock from os.path import exists, isdir, join, basename from os import remove, makedirs, close from shutil import rmtree from tempfile import mkdtemp, mkstemp from biom.util import biom_open from biom import example_table as et from qiita_pet.test.tornado_test_base import Tes...
from urbansim.abstract_variables.abstract_number_of_agents_with_same_attribute_value import abstract_number_of_agents_with_same_attribute_value class same_sector_employment_in_building(abstract_number_of_agents_with_same_attribute_value): """""" agent_attribute_name = "job.sector_id" agent_d...
""" Convert printer `vendor` and `product` to int type. And add `name`. Revision ID: b41c62db00a1 Revises: d37b1524c3fc Create Date: 2020-06-06 16:49:00.859545 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'b41c62db00a1' down_revision = 'd37b1524c3fc' branch...
'''This utility cleans up the html files as emitted by doxygen so that they are suitable for publication on a Google documentation site. ''' import optparse import os import re import shutil import string import sys try: from BeautifulSoup import BeautifulSoup, Tag except (ImportError, NotImplementedError): print ...
#!/usr/bin/env python # coding: utf-8 from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from youtube_dl.compat import ( compat_getenv, compat_setenv, compat_etree_fromstring, compa...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( parse_duration, int_or_none, ExtractorError, ) class Porn91IE(InfoExtractor): IE_NAME = '91porn' _VALID_URL = r'(?:https?://)(?:www\.|)91porn\.com/.+?\?viewkey=(?P<id>[\w\d]+)' _TE...
# stdlib from socket import socket import unittest import xmlrpclib # 3p from mock import patch # project from checks import AgentCheck from tests.checks.common import get_check class TestSupervisordCheck(unittest.TestCase): TEST_CASES = [{ 'yaml': """ init_config: instances: - name: server1 ...
import sys import base64 import hashlib import hmac import time from libcloud.utils.py3 import PY3 from libcloud.utils.py3 import b from libcloud.utils.py3 import httplib from libcloud.utils.py3 import next from libcloud.utils.py3 import urlparse from libcloud.utils.py3 import urlencode from libcloud.utils.py3 import ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.contrib import linalg as linalg_lib from tensorflow.contrib.linalg.python.ops import linear_operator_test_util from tensorflow.python.framework import dtypes from tensorflow....
"""upload_gmock.py v0.1.0 -- uploads a Google Mock patch for review. This simple wrapper passes all command line flags and --cc=<EMAIL> to upload.py. USAGE: upload_gmock.py [options for upload.py] """ __author__ = '<EMAIL> (Zhanyong Wan)' import os import sys CC_FLAG = '--cc=' GMOCK_GROUP = '<EMAIL>' def main():...
from openerp.osv.orm import Model from openerp.osv import fields class stock_picking(Model): _inherit = 'stock.picking' _columns = { 'carrier_partner_id': fields.related('carrier_id', 'partner_id', type='many2one', ...
from __future__ import unicode_literals from datetime import date from django.contrib.auth import models, management from django.contrib.auth.management import create_permissions from django.contrib.auth.management.commands import changepassword from django.contrib.auth.models import User from django.contrib.auth.test...
import string from dvbobjects.MPEG.Section import Section from dvbobjects.utils import * ###################################################################### class master_guide_section(Section): table_id = 0xC7 section_max_size = 4096 def pack_section_body(self): # pack tables_loop ...
"""NDArray namespace used to register internal functions.""" import os as _os import sys as _sys import numpy as np try: if int(_os.environ.get("MXNET_ENABLE_CYTHON", True)) == 0: from .._ctypes.ndarray import NDArrayBase, CachedOp from .._ctypes.ndarray import _set_ndarray_class, _imperative_invo...
import Queue import copy fd = open('processes.txt') processes = [] endTime = 0 time = 0 for line in fd: tempProc = line.split(" ") tempProc[0] = int(tempProc[0]) tempProc[1] = int(tempProc[1]) tempProc.append(0) tempProc.append(0) tempProc.append(0) process = (arrival, burst, tw, tr, visi...
"""Define and process configuration from command-line or config file.""" __author__ = '<EMAIL> (Thomas Stromberg)' import ConfigParser import csv import optparse import os.path import re import StringIO import tempfile import nb_third_party # from third_party import httplib2 import addr_util import data_sources i...
from pyspark import SparkContext if __name__ == "__main__": sc = SparkContext(appName="StratifiedSamplingExample") # SparkContext # $example on$ # an RDD of any key value pairs data = sc.parallelize([(1, 'a'), (1, 'b'), (2, 'c'), (2, 'd'), (2, 'e'), (3, 'f')]) # specify the exact fraction desire...
import re import urlparse from google.appengine._internal.django.core.exceptions import ValidationError from google.appengine._internal.django.utils.translation import ugettext_lazy as _ from google.appengine._internal.django.utils.encoding import smart_unicode # These values, if given to validate(), will trigger the...
def npartitions(n): """ Calculate the partition function P(n), i.e. the number of ways that n can be written as a sum of positive integers. P(n) is computed using a straightforward implementation of the Hardy-Ramanujan-Rademacher formula, described e.g. at http://mathworld.wolfram.com/Pa...
""" This module provides a set of REST API for switch configuration. - Per-switch Key-Value store Used by OpenStack Ryu agent. """ import httplib import json import logging from webob import Response from ryu.app.wsgi import ControllerBase from ryu.base import app_manager from ryu.controller import conf_switch from ...
import os import fnmatch import sys from tkinter import * from idlelib import SearchEngine from idlelib.SearchDialogBase import SearchDialogBase def grep(text, io=None, flist=None): root = text._root() engine = SearchEngine.get(root) if not hasattr(engine, "_grepdialog"): engine._grepdialog = GrepD...
from odoo.tests.common import TransactionCase class TestEmployeeDisplayOwnInfo(TransactionCase): def setUp(self): super(TestEmployeeDisplayOwnInfo, self).setUp() self.user_test = self.env.ref('base.user_demo') self.employee = self.env['hr.employee'].create({ 'name': 'Employee...
import command import re import os import series import settings import subprocess import sys import terminal def CountCommitsToBranch(): """Returns number of commits between HEAD and the tracking branch. This looks back to the tracking branch and works out the number of commits since then. Return: ...
from .common import _ParserScraper class NamirDeiter(_ParserScraper): imageSearch = '//img[contains(@src, "comics/")]' prevSearch = ('//a[@rel="prev"]', '//a[./img[contains(@src, "previous")]]', '//a[contains(text(), "Previous")]') def __init__(self, name, baseUrl, fir...
import h2o_nodes from h2o_test import dump_json, verboseprint import h2o_util import h2o_print as h2p from h2o_test import OutputObj #************************************************************************ def runStoreView(node=None, **kwargs): print "FIX! disabling runStoreView for now" return {} if not...
from optparse import OptionParser from random import randint import os import sys import re from numpy import * import random from subprocess import Popen,PIPE import shlex import datetime from voltdbclient import FastSerializer, VoltProcedure import time CSVLOADER = "bin/csvloader" #SQLCMD = "$VOLTDB_HOME/bin/sqlcmd ...
""" RealMedia (.rm) parser Author: Mike Melanson Creation date: 15 december 2006 References: - http://wiki.multimedia.cx/index.php?title=RealMedia - Appendix E: RealMedia File Format (RMFF) Reference https://common.helixcommunity.org/nonav/2003/HCS_SDK_r5/htmfiles/rmff.htm Samples: - http://samples.mplayerhq.hu/re...
{ 'name': 'Associations Management', 'version': '0.1', 'category': 'Specific Industry Applications', 'description': """ This module is to configure modules related to an association. ============================================================== It installs the profile for associations to manage events...
"""Stock market information from Alpha Vantage.""" from datetime import timedelta import logging from alpha_vantage.foreignexchange import ForeignExchange from alpha_vantage.timeseries import TimeSeries import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const impor...
from __future__ import absolute_import from django.http import HttpResponse, HttpResponseNotAllowed import ujson class HttpResponseUnauthorized(HttpResponse): status_code = 401 def __init__(self, realm): HttpResponse.__init__(self) self["WWW-Authenticate"] = 'Basic realm="%s"' % (realm,) def...
from flask import Flask, redirect, url_for, session, request, jsonify from flask_oauthlib.client import OAuth app = Flask(__name__) app.debug = True app.secret_key = 'development' oauth = OAuth(app) linkedin = oauth.remote_app( 'linkedin', consumer_key='k8fhkgkkqzub', consumer_secret='ZZtLETQOQYNDjMrz', ...
"""Functional tests for Transpose op.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import itertools import numpy as np from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framewor...
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin class Psacct(Plugin): """Process accounting related information """ option_list = [("all", "collect all process accounting files", "slow", False)] packages = [ "psacct" ] class RedHatPsacct(Psacct, RedH...
""" Tests of connection with rule fixed_indegree and parameter arrays in syn_spec """ import unittest import nest import numpy @nest.ll_api.check_stack class ConnectArrayFixedIndegreeTestCase(unittest.TestCase): """Tests of connections with fixed indegree and parameter arrays""" def test_Connect_Array_Fixed...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule, BOOLEANS_TRUE from ansible.module_utils.pycompat24 import get_exception import subprocess class GConf2Preference(object): ...
import hr_payroll import report import wizard import res_config # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'daqcontrol/config.ui' # # Created by: PyQt5 UI code generator 5.9 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): M...
# -*- coding: utf-8 -*- import pytest import sys from .test_base_class import TestBaseClass from aerospike import exception as e aerospike = pytest.importorskip("aerospike") try: import aerospike except: print("Please install aerospike python client.") sys.exit(1) class TestRemovebin(object): def se...
"""Classes to generate plain text from a message object tree.""" __all__ = ['Generator', 'DecodedGenerator'] import re import sys import time import random import warnings from cStringIO import StringIO from email.header import Header UNDERSCORE = '_' NL = '\n' fcre = re.compile(r'^From ', re.MULTILINE) def _is8b...
#!/usr/bin/env python # encoding: utf-8 import pytest from pytest_ringo import login, transaction_begin, transaction_rollback class TestList: def test_GET(self, app): login(app, "admin", "secret") app.get("/forms/list") class TestRead: # FIXME: There is currently no form in the database ()...
# coding=utf-8 import os import textwrap import unittest from nose.plugins.attrib import attr from conans.test.functional.scm.workflows.common import TestWorkflow from conans.test.utils.tools import SVNLocalRepoTestCase from conans.test.utils.tools import TestClient, create_local_git_repo class SCMSubfolder(TestWo...
from __future__ import print_function import argparse import fileinput import sys # Maximum value of a signed 32 bit integer (2**31 - 1). MAX_CHROM_LEN = 2147483647 def stop_err(msg): sys.stderr.write(msg) sys.exit(1) parser = argparse.ArgumentParser() parser.add_argument('--input', dest='input', help="In...
{ 'name': 'Uruguay - Chart of Accounts', 'version': '0.1', 'author': 'Uruguay l10n Team & Guillem Barba', 'category': 'Localization/Account Charts', 'website': 'https://launchpad.net/openerp-uruguay', 'description': """ General Chart of Accounts. ========================== Provide Templates for...
"""Unittests for SurfaceStatsCollector.""" # pylint: disable=W0212 import unittest from pylib.perf.surface_stats_collector import SurfaceStatsCollector class TestSurfaceStatsCollector(unittest.TestCase): @staticmethod def _CreateUniformTimestamps(base, num, delta): return [base + i * delta for i in range(1,...
# =========================================== # Module execution. # def main(): module = AnsibleModule( argument_spec=dict( token=dict(required=True), msg=dict(required=True), type=dict(required=True, choices=["inbox","chat"]), external_user_name=dict(requir...
import os import shutil from django.conf import settings import test_utils from bedrock.settings.base import get_dev_languages, path class AcceptedLocalesTest(test_utils.TestCase): """Test lazy evaluation of locale related settings. Verify that some localization-related settings are lazily evaluated based ...
"""Functions for accessing docker via the docker cli.""" from __future__ import absolute_import, print_function import json import os import time from lib.executor import ( SubprocessError, ) from lib.util import ( ApplicationError, run_command, common_environment, display, find_executable, ...
"""Module for variants of ops in tf.nn. @@alpha_dropout @@conv1d_transpose @@deprecated_flipped_softmax_cross_entropy_with_logits @@deprecated_flipped_sparse_softmax_cross_entropy_with_logits @@deprecated_flipped_sigmoid_cross_entropy_with_logits @@nth_element @@rank_sampled_softmax_loss @@sampled_sparse_softmax_loss ...
import numpy # Coefficients of order r=2 # On smooth solutions this should converge with order r=3 C_2 = numpy.array([ 1, 2 ]) / 3 a_2 = numpy.array([ [ 3, -1], [ 1, 1], ]) / 2 sigma_2 = numpy.array([ [ [ 1, 0...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants_test.pants_run_integration_test import PantsRunIntegrationTest class AntlrJavaGenIntegrationTest(PantsRunIntegrationTest): def test_run_antlr3(self): ...
# install_twisted_rector must be called before importing the reactor from __future__ import unicode_literals from kivy.support import install_twisted_reactor install_twisted_reactor() # A Simple Client that send messages to the Echo Server from twisted.internet import reactor, protocol class EchoClient(protocol.Pr...
#!/usr/bin/env python """ Create firmware for 4/8MB Bifferboards, suitable for uploading using either bb_upload8.py or bb_eth_upload8.py """ import struct, sys # Increase the kmax value if the script gives errors about the kernel being # too large. You need to set the Biffboot kmax value to the same value yo...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import traceback from ansible.module_utils.basic import AnsibleModule from ansible.module_u...
#!/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...
# 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): if db.backend_name == 'mysql': db.execute_many(""" ALTER DATABASE CHARACTER SET utf8 COLLATE utf8_...
""" This module provides support for Twisted to interact with the glib/gtk2 mainloop. In order to use this support, simply do the following:: | from twisted.internet import gtk2reactor | gtk2reactor.install() Then use twisted.internet APIs as usual. The other methods here are not intended to be called dir...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import fnmatch import traceback from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.ovirt import ( check_sdk, create_connection, get_dict_o...
"""Tests for distutils.command.bdist_wininst.""" import unittest from test.support import run_unittest from distutils.command.bdist_wininst import bdist_wininst from distutils.tests import support class BuildWinInstTestCase(support.TempdirManager, support.LoggingSilencer, ...
from django.core.management.base import BaseCommand from django.contrib.auth.models import User from student.models import UserTestGroup import random import sys import datetime from textwrap import dedent import json from pytz import UTC def group_from_value(groups, v): ''' Given group: (('a',0.3),('b',0.4),(...
import datetime from django.conf import settings from django.db.backends.util import truncate_name, typecast_date, typecast_timestamp from django.db.models.sql import compiler from django.db.models.sql.constants import MULTI from django.utils import six from django.utils.six.moves import zip, zip_longest from django.u...
{ "name" : "Spanish Charts of Accounts (PGCE 2008)", "version" : "4.0", "author" : "Spanish Localization Team", 'website' : 'https://launchpad.net/openerp-spain', "category" : "Localization/Account Charts", "description": """ Spanish charts of accounts (PGCE 2008). ==============================...
"""Unit test utilities for Google C++ Testing Framework.""" __author__ = '<EMAIL> (Zhanyong Wan)' import atexit import os import shutil import sys import tempfile import unittest _test_module = unittest # Suppresses the 'Import not at the top of the file' lint complaint. # pylint: disable-msg=C6204 try: import sub...
from pox.lib.addresses import * import pox.lib.packet as pkt from struct import pack import time from struct import pack import time class SocketWedge (object): def __init__ (self, socket): self._socket = socket def send (self, string, *args, **kw): r = self._socket.send(string, *args, **kw) self._s...
from __future__ import unicode_literals import base64 import logging import string from datetime import datetime, timedelta from django.conf import settings from django.contrib.sessions.exceptions import SuspiciousSession from django.core.exceptions import SuspiciousOperation from django.utils import timezone from dj...
'''This file contains the following utilities: joinlines (input, delim=" ", missing="Missing", maxchars=161, shortest=True) joinlists (list1, list2, delim=" ", missing="Missing", shortest=True) atList (input, filenames) expandlist (input) ''' #----------------------------------------...
""" Services. """ import logging import requests from urllib.parse import urlparse, parse_qs from drf_requests_jwt import settings from drf_requests_jwt.backends.utils import build_url logger = logging.getLogger(__name__) class HttpRequestService(object): obtain_jwt_allowed_fail_attempts = settings.DEFAULTS.get...
"""Fixer for sys.exc_{type, value, traceback} sys.exc_type -> sys.exc_info()[0] sys.exc_value -> sys.exc_info()[1] sys.exc_traceback -> sys.exc_info()[2] """ # By Jeff Balogh and Benjamin Peterson # Local imports from .. import fixer_base from ..fixer_util import Attr, Call, Name, Number, Subscript, Node, syms clas...
"""Helper to provide extensibility for pickle. This is only useful to add pickle support for extension types defined in C, not for instances of user-defined classes. """ __all__ = ["pickle", "constructor", "add_extension", "remove_extension", "clear_extension_cache"] dispatch_table = {} def pickle(ob_typ...
"""Helpers shared by cloudstorage_stub and cloudstorage_api.""" __all__ = ['CS_XML_NS', 'CSFileStat', 'dt_str_to_posix', 'local_api_url', 'LOCAL_GCS_ENDPOINT', 'local_run', 'get_access_token', 'get_stored_content_length', 'get_...