content
stringlengths
4
20k
"""Add webhooks table Revision ID: 4a571e217ab8 Revises: 3a98a6674cb2 Create Date: 2015-08-17 16:52:28.279419 """ # revision identifiers, used by Alembic. revision = '4a571e217ab8' down_revision = '3a98a6674cb2' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects.postgresql import JSON import da...
import os from controllers.google_maps_earth_ctrl import GoogleMapsEarthController from utils.desktop_utils import open_path class GoogleMapsController(GoogleMapsEarthController): def __init__(self, google_maps_model): super(GoogleMapsController, self).__init__(google_maps_model) self.google_map...
from django.conf import settings from django.template import Library from django.utils.safestring import mark_safe from django.utils.lru_cache import lru_cache from zerver.lib.utils import force_text from typing import List import zerver.lib.bugdown.fenced_code import markdown import markdown.extensions.admonition im...
from __future__ import absolute_import from optparse import make_option from django.core.management.base import BaseCommand from zerver.models import Recipient, Message from zerver.lib.timestamp import timestamp_to_datetime import datetime import time import logging def compute_stats(log_level): logger = logging....
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'network'} import collections from ansible.module_utils.basic import AnsibleModule from ansible.module_u...
# Execution : # $ /Applications/blender/blender.app/Contents/MacOS/blender -b -P ~/test_blender.py -- Scene_2012_01_11_15_10_03 # avec : Scene_2012_01_11_15_10_03 : le nom du fichier obj # # Réalise : import bpy import math import mathutils import sys import os class locationxyz(list): pass # main variables ra...
import numpy as np import mxnet as mx class SimpleBatch(object): def __init__(self, data, label, pad=None): self.data = data self.label = label self.pad = pad class SimpleIter: def __init__(self, mu, sigma, batch_size, num_batches): self.mu = mu self.sigma = sigma ...
r"""Converts checkpoint variables into Const ops in a standalone GraphDef file. This script is designed to take a GraphDef proto, a SaverDef proto, and a set of variable values stored in a checkpoint file, and output a GraphDef with all of the variable ops converted into const ops containing the values of the variable...
"""empty message Revision ID: 1b44691709c Revises: None Create Date: 2015-09-27 15:14:36.967547 """ # revision identifiers, used by Alembic. revision = '1b44691709c' down_revision = None from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql def upgrade(): ### commands auto g...
"""Utility functions related to SignatureDefs.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.core.protobuf import meta_graph_pb2 from tensorflow.lite.tools.signature import _pywrap_signature_def_util_wrapper as signature_def_util def ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import copy from django.forms import Select from django.utils.safestring import mark_safe from .base import WidgetTest class SelectTest(WidgetTest): widget = Select() nested_widget = Select(choices=( ('outer1', 'Outer 1'), ('Gr...
"""Tests for distutils.command.build.""" import unittest import os import sys from test.test_support import run_unittest from distutils.command.build import build from distutils.tests import support from sysconfig import get_platform class BuildTestCase(support.TempdirManager, support.LoggingSilen...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import collections import os import time from multiprocessing import Lock from itertools import chain from ansible import constants as C from ansible.errors import AnsibleError from ansible.plugins.cache import BaseCacheModule tr...
from django.contrib.messages.tests.base import BaseTest from django.contrib.messages.storage.session import SessionStorage def set_session_data(storage, messages): """ Sets the messages into the backend request's session and remove the backend's loaded data cache. """ storage.request.session[stora...
"""Code for setting up summaries for CMP. """ import sys, os, numpy as np import matplotlib.pyplot as plt import tensorflow as tf from tensorflow.contrib import slim from tensorflow.contrib.slim import arg_scope import logging from tensorflow.python.platform import app from tensorflow.python.platform import flags ...
#! /usr/bin/python import sys import csv import os # Here we start processing of a single csv file containg collected results def processCsvFile(fToProcess): rssiReader = csv.DictReader(open(fToProcess, 'rb'), delimiter=';', quotechar='|') txID = fToProcess.split("Tx")[1].split(".")[0] print "Transmitting node: " +...
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 * from lib.logreport import * from lib.rpc import * from ServerParameter import * da...
""" Enrollment operations for use by instructor APIs. Does not include any access control, be sure to check access before calling. """ import json import logging from django.contrib.auth.models import User from django.conf import settings from django.core.urlresolvers import reverse from django.core.mail import send_...
import unittest import sys from PySide2.QtWidgets import QWidget, QPushButton from helper import UsesQApplication class TestBug1002 (UsesQApplication): def testReturnWindow(self): widget = QWidget() button = QPushButton(widget) self.assertEqual(sys.getrefcount(widget), 2) window = ...
from forum.models import Question, Answer, QuestionVote, AnswerVote from rest_framework import serializers class QuestionSerializer(serializers.ModelSerializer): votes = serializers.SerializerMethodField('count_votes') username = serializers.SerializerMethodField('get_username') user_obj = serializers.Se...
"""Miscellaneous functions useful for nD-LSTM models. Some of these functions duplicate functionality in tfslim with slightly different interfaces. Tensors in this library generally have the shape (num_images, height, width, depth). """ from __future__ import absolute_import from __future__ import division from __fut...
"""Convert Caffe's modelzoo """ import os import argparse from convert_model import convert_model from convert_mean import convert_mean import mxnet as mx _mx_caffe_model = 'http://data.mxnet.io/models/imagenet/test/caffe/' """Dictionary for model meta information For each model, it requires three attributes: - p...
"""Tests for distutils.command.install_scripts.""" import os import unittest from distutils.command.install_scripts import install_scripts from distutils.core import Distribution from distutils.tests import support class InstallScriptsTestCase(support.TempdirManager, support.LoggingSil...
from openerp.addons.mail.tests.common import TestMail class test_invite(TestMail): def test_00_basic_invite(self): cr, uid = self.cr, self.uid mail_invite = self.registry('mail.wizard.invite') # Do: create a mail_wizard_invite, validate it self._init_mock_build_email() co...
""" validators/experiments.py: python functions to validate experiments and library experiment objects Copyright (c) 2017-2021, Vanessa Sochat All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistr...
import textwrap import datetime from dateutil import relativedelta from .utils import has_aired_filter def short_episode(episode): return u"S{0:02}E{1:02} '{2}'".format( episode['season_number'], episode['episode_number'], episode['episode_name']) def _build_readable_date(years, months,...
from __future__ import with_statement import os import re import sys import pytz import subprocess _systemconfig_tz = re.compile(r'^Time Zone: (.*)$(?m)') def _tz_from_env(tzenv): if tzenv[0] == ':': tzenv = tzenv[1:] # TZ specifies a file if os.path.exists(tzenv): with open(tzenv, 'rb')...
import chainer from chainer import functions as F import numpy import pytest import chainerx from chainerx_tests import array_utils from chainerx_tests import op_utils _in_out_eval_dtypes = [ (('float16', 'int16')), (('float32', 'int32')), (('float64', 'int64')), (('float32', 'int16')), (('float...
""" .. dialect:: postgresql+pg8000 :name: pg8000 :dbapi: pg8000 :connectstring: \ postgresql+pg8000://user:password@host:port/dbname[?key=value&key=value...] :url: https://pythonhosted.org/pg8000/ .. _pg8000_unicode: Unicode ------- pg8000 will encode / decode string values between it and the server...
"""Here is defined the UnImplemented class.""" import warnings from tables import hdf5extension from tables.utils import SizeType from tables.node import Node from tables.leaf import Leaf class UnImplemented(hdf5extension.UnImplemented, Leaf): """This class represents datasets not supported by PyTables in an HD...
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 2 of the License, or (at your option) any la...
"""The WaveBlocks Project This file contains the abstract base class for representation of potentials for an arbitrary number of components. It defines the interface every subclass must support to represent a potential. @author: R. Bourquin @copyright: Copyright (C) 2010, 2011 R. Bourquin @license: Modified BSD Licen...
from math import * from util import format_number class Vector3(object): __slots__ = ('_v',) _gameobjects_vector = 3 def __init__(self, *args): """Creates a Vector3 from 3 numeric values or a list-like object containing at least 3 values. No arguments result in a null vector. "...
#!/usr/bin/env python import pygame import gummy_panzer import pkg_resources import os import sys #new imports for this tutorial intro from gummy_panzer import util, settings from pygame.locals import * settings.SCREEN_WIDTH = 800 settings.SCREEN_HEIGHT = 600 INTROWIDTH = 1600 NUMINTROS = 4 INTRO = 0 MAINMENU = 1 PLA...
import os import pickle import numpy as np import chainer from multiprocessing import Pool from functools import partial from chainer import Variable from chainer.backends import cuda from qanta.datasets.quiz_bowl import QuizBowlDataset from qanta.guesser.abstract import AbstractGuesser from qanta.util.constants import...
class Fancy: def __init__(self): self.data=[] self.add=[] self.mult=[] def append(self, val: int) -> None: self.data.append(val) if len(self.mult)==0: self.mult.append(1) self.add.append(0) self.mult.append(self.mult[-1]) ...
from openerp.osv import fields from openerp.osv import osv class product_product(osv.osv): _name = 'product.product' _inherit = 'product.product' def compute_price(self, cr, uid, ids, recursive=False, test=False, real_time_accounting = False, context=None): ''' Will return test dict when...
import mock from nova.scheduler.filters import disk_filter from nova import test from nova.tests.unit.scheduler import fakes class TestDiskFilter(test.NoDBTestCase): def setUp(self): super(TestDiskFilter, self).setUp() def test_disk_filter_passes(self): self.flags(disk_allocation_ratio=1.0)...
''' setup.py ======== setup.py is part of the YAYPM library Copyright 2006 Maciek Kaminski. 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 2 of the License, or (at your option) any...
""" Figure 4 (a) of "Why attackers lose: design and security analysis of arbitrarily large XOR arbiter PUFs", Accepted 26 Feb 2019 Journal of Cryptographic Engineering. This study examines the minimum number of votes needed such that for a uniformly random challenge c we have Pr[Stab(c) ≥ 95%] ≥ 80% for different k, a...
""" Admin views for managing volumes. """ from django.core.urlresolvers import reverse from django.utils.datastructures import SortedDict from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import tables from openstack_dashboard.api import cin...
# -*- coding: utf-8 -*- """ Basic JavaLexer Test ~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import unittest from pygments.token import Text, Name, Operator, Keyword from pygments.lexers import JavaLexer class J...
from . import constants import re class CharSetProber: def __init__(self): pass def reset(self): self._mState = constants.eDetecting def get_charset_name(self): return None def feed(self, aBuf): pass def get_state(self): return self._mState ...
# -*- coding: utf-8 -*- from unittest.mock import Mock from django.test import override_settings from rest_framework.test import APIRequestFactory from olympia.amo.templatetags.jinja_helpers import absolutify from olympia.amo.tests import TestCase, addon_factory, user_factory from olympia.ratings.models import Ratin...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import os import collections from PyQt4.QtGui import * class LabelConfig(object): """Mainly to config the labels.""" defalut_color = QColor(255, 0, 0) def __init__(self, filepath, is_global...
""" Tests for compatibility workarounds. """ import os from tests.test_pip import (here, reset_env, run_pip, pyversion, assert_all_changes) def test_debian_egg_name_workaround(): """ We can uninstall packages installed with the pyversion removed from the egg-info metadata dire...
import datetime import decimal import unicodedata from importlib import import_module from django.conf import settings from django.utils import dateformat, datetime_safe, numberformat, six from django.utils.encoding import force_str from django.utils.functional import lazy from django.utils.safestring import mark_safe...
import optparse import urllib import urllib2 parser = optparse.OptionParser() parser.add_option('--db', action='store_const', const='db', dest='profile_type', help='profile the db calls') parser.add_option('-o', '--out', action='store', dest='output_file', ...
import ddt import mock from oslo_utils import strutils import webob from manila.api.v1 import share_types_extra_specs from manila.common import constants from manila import exception from manila import policy from manila import test from manila.tests.api import fakes from manila.tests import fake_notifier import manil...
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para zinwa # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from core import ...
'''Access byte arrays as arrays of vertex attributes. Use `create_attribute` to create an attribute accessor given a simple format string. Alternatively, the classes may be constructed directly. Attribute format strings ======================== An attribute format string specifies the format of a vertex attribute. ...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from django.db.utils import DatabaseError class Migration(SchemaMigration): """ Remove an unwanted index from environments that have it. This is a one-way migration in that bac...
# ACTION_CHECKBOX_NAME is unused, but should stay since its import from here # has been referenced in documentation. from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL from django.contrib.admin.options import StackedInline, TabularInli...
from tempest import config from tempest.lib.common.utils import data_utils import testtools from testtools import testcase as tc from manila_tempest_tests.common import constants from manila_tempest_tests import share_exceptions from manila_tempest_tests.tests.api import base CONF = config.CONF _MIN_SUPPORTED_MICROVE...
from __future__ import absolute_import import theano import theano.tensor as T from .. import activations, initializations, regularizers, constraints from ..layers.core import Layer, MaskedLayer from ..utils.theano_utils import sharedX from ..constraints import unitnorm class Embedding(Layer): ''' Turn ...
""" Read and write the matrix file format described at http://www.cs.nyu.edu/~ylclab/data/norb-v1.0/index.html The format is for dense tensors: - magic number indicating type and endianness - 4bytes - rank of tensor - int32 - dimensions - int32, int32, int32, ... - <data> The number of dimensions and rank is slight...
# -*- coding: utf-8 -*- import time, datetime import re import sys, traceback ####################################### # Time and Date Helpers ####################################### def convDateUtil(timestring, newfrmt='default', in_zone='UTC'): import xbmc try: import json except ImportError: import si...
""" """ import os, sys, posixpath import fnmatch import py # Moved from local.py. iswin32 = sys.platform == "win32" or (getattr(os, '_name', False) == 'nt') try: from os import fspath except ImportError: def fspath(path): """ Return the string representation of the path. If str or byte...
import time import serial import argparse import mosquitto import topicconfig from topictypes import TopicTypes class WinkekatzeConnection: def __init__(self): self._serial = None self.isConnected = False def connect(self, device, baudrate): if self.isConnected: return...
from gnuradio import gr, gr_unittest from gnuradio import blocks import numpy as np import time import ieee802_15_4_swig as ieee802_15_4 class qa_phr_prefixer (gr_unittest.TestCase): def setUp (self): self.tb = gr.top_block () def tearDown (self): self.tb = None def test_001_t (self): ...
""" docker_registry.core.lru ~~~~~~~~~~~~~~~~~~~~~~~~~~ Redis based LRU. Can be activated or de-activated globally. Drivers are largely encouraged to use it. By default, doesn't run, until one calls init(). """ import functools import logging import redis logger = logging.getLogger(__name__) redis_conn = None cache...
from rx.core import Observable, AnonymousObservable from rx.disposables import CompositeDisposable, SingleAssignmentDisposable from rx.internal import extensionmethod, extensionclassmethod @extensionmethod(Observable, instancemethod=True) def zip(self, *args): """Merges the specified observable sequences into one...
import sys sys.path.insert(0, '../functions/') from epsilonDifference import epsilonDifference as floatEq from cluster import Cluster import epsilonDifference as epDiff import matplotlib.pyplot as plt import connectLib as cLib import pickle testData1 = [[3,3,3], [3,3,2], [3,3,4], [3,2,3], [3,4,3], [2,3,3], [4,3,3]] te...
"""This module provides the notification command to gsutil.""" from __future__ import absolute_import import getopt import uuid from gslib.cloud_api import AccessDeniedException from gslib.command import Command from gslib.command import NO_MAX from gslib.command_argument import CommandArgument from gslib.cs_api_map...
import sys sys.path.append("..") import initSettings import argparse import numpy as np import pylab import pickle def plotTrackingHigh(trackResults, settings): fig = pylab.figure() fig.clf() if (settings.plotTrackingNumPts > len(trackResults[0].I_P)): x_pts = [i*0.001 for i in range(len(trackResults[0].I_P...
from typing import TYPE_CHECKING, Optional from kivy.app import App from kivy.factory import Factory from kivy.properties import ObjectProperty from kivy.lang import Builder from electrum_mona.gui.kivy.i18n import _ if TYPE_CHECKING: from ...main_window import ElectrumWindow Builder.load_string(''' <DSCancelDi...
#!/usr/bin/python2 # Not very optimized import sys import math import random import matplotlib.pyplot as plot import numpy def dist(pointA, pointB): "pointA and pointB should be lists" total = 0 for i in range(0, len(pointA)): total += (pointA[i] - pointB[i])**2 return math.sqrt(total) def...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule try: from ansible.module_utils.network.avi.avi import ( avi_common_argument_spec, HAS_AVI, avi_ansible_api) except ...
"""Registering ops in mxnet.numpy for imperative programming.""" from ..base import _init_np_op_module from ..ndarray.register import _make_ndarray_function _init_np_op_module(root_module_name='mxnet', np_module_name='numpy', mx_module_name=None, make_op_func=_make_ndarray_function)
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # create a rendering window and renderer ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) renWin.StereoCapableWindowOn() iren = vtk.vtkRenderWindowInte...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch from ansible.modules.network.nxos import nxos_ospf_vrf from .nxos_module import TestNxosModule, set_module_args class TestNxosOspfVrfModule(TestNxosModule): module = nxos_ospf_vrf ...
from cabby import create_client try: # create a connection client = create_client(host='{{ opentaxii_host }}', port='{{ opentaxii_port }}', discovery_path='/services/discovery') # iterate through each defined collection collections = client.get_collections(uri='{{ opentaxii_domain }}/services/collecti...
from openerp.osv import fields, osv from openerp import netsvc from webkit_report import WebKitParser from openerp.report.report_sxw import rml_parse def register_report(name, model, tmpl_path, parser=rml_parse): """Register the report into the services""" name = 'report.%s' % name if netsvc.Service._servi...
import requests from allauth.socialaccount.providers.base import ProviderException from allauth.socialaccount.providers.oauth2.views import OAuth2Adapter, OAuth2CallbackView, OAuth2LoginView from .provider import DataportenProvider class DataportenAdapter(OAuth2Adapter): provider_id = DataportenProvider.id a...
from textanalyzer import * import math class ReadabilityTool: analyzedVars = {} text = "" lang = "" tests_given_lang = {} def __init__(self, text = ''): self.tests_given_lang['all'] = {} self.tests_given_lang['all']["ARI"] = self.ARI self.tests_given_lang['all']['Fles...
import json import logging import sys from functools import wraps from django.conf import settings from django.core.validators import ValidationError, validate_email from django.views.decorators.csrf import requires_csrf_token from django.views.defaults import server_error from django.http import (Http404, HttpRespons...
"""This module tests the Uploader class.""" from default import Test, with_context from pybossa.uploader.rackspace import RackspaceUploader from mock import patch, PropertyMock, call, MagicMock from werkzeug.datastructures import FileStorage from pyrax.fakes import FakeContainer from pyrax.exceptions import NoSuchObje...
import logging import time from enum import IntEnum import microscope.abc # These classes were originally in testsuite but have been moved to # their own subpackage, these imports are for backwards compatibility. from microscope.simulators import ( SimulatedCamera, SimulatedController as TestController, S...
''' Scons Builder for nanopb .proto definitions. This tool will locate the nanopb generator and use it to generate .pb.c and .pb.h files from the .proto files. Basic example ------------- # Build myproto.pb.c and myproto.pb.h from myproto.proto myproto = env.NanopbProto("myproto") # Link nanopb core to the program e...
from setuptools import setup import os.path import re with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as README: DESCRIPTION = README.read() VERSION_RE = re.compile("^__version__ = '(.+)'$", flags=re.MULTILINE) with open(os.path.join(os.path.dirname(__file__), ...
__version__ = "0.4" import marshal, string import Image, ImageFile, ImagePalette from PngImagePlugin import i16, i32, ChunkStream, _MODES MAGIC = "\212ARG\r\n\032\n" # -------------------------------------------------------------------- # ARG parser class ArgStream(ChunkStream): "Parser callbacks for ARG data...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, parse_iso8601, ) class HeiseIE(InfoExtractor): _VALID_URL = r'''(?x) https?://(?:www\.)?heise\.de/video/artikel/ .+?(?P<id>[0-9]+)\.html(?:$|[?#]...
""" These are debug machines used for content creators, so they're kind of a cross between dev machines and AWS machines. """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=wildcard-import, unused-wildcard-import from .aws im...
import numpy as np import logging from openmodes.eig import (eig_linearised, eig_newton, poles_cauchy, ConvergenceError) from openmodes.array import LookupArray class Operator(object): "A base class for operator equations" def impedance(self, s, parent_o, parent_s, metadata=None)...
import argparse import io from six.moves import configparser, StringIO import fnmatch import logging import os import platform import sys import yaml import jenkins_jobs.version from jenkins_jobs.builder import Builder from jenkins_jobs.errors import JenkinsJobsException logging.basicConfig(level=logging.INFO) logger...
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutSets(Koan): def test_sets_make_keep_lists_unique(self): highlanders = ['MacLeod', 'Ramirez', 'MacLeod', 'Matunas', 'MacLeod', 'Malcolm', 'MacLeod'] there_can_only_be_only_one = set(highlanders) self.assert...
""" A helper class for proxy objects to remote APIs. For more information about rpc API version numbers, see: rpc/dispatcher.py """ from nova.openstack.common import rpc class RpcProxy(object): """A helper class for rpc clients. This class is a wrapper around the RPC client API. It allows you to ...
from urllib.parse import urlparse from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.urlresolvers import get_script_prefix, resolve from django.http import Http404 from django.shortcuts import resolve_url from django.utils.encoding import force_str from django.utils.t...
from __future__ import absolute_import, division, print_function __metaclass__ = type import pytest from ansible.module_utils.common.network import ( to_masklen, to_netmask, to_subnet, to_ipv6_network, is_masklen, is_netmask ) def test_to_masklen(): assert 24 == to_masklen('255.255.255.0...
# -*- coding: utf-8 -*- """ sysinfo.py [host1] [host2] [options] obtain system info from remote machine. (c) Holger Krekel, MIT license """ import optparse import re import sys import execnet import py parser = optparse.OptionParser(usage=__doc__) parser.add_option( "-f", "--sshconfig", action="store",...
import sys import os, os.path import string import traceback import antlr version = sys.version.split()[0] if version < '2.2.1': False = 0 if version < '2.3': True = not False import LinkExtractor class LinkListener: def hrefReference(self, target, line): raise NotImplementedError def image...
# coding=UTF-8 """ tests for overrides """ import datetime import mock import pytz from nose.plugins.attrib import attr from courseware.field_overrides import OverrideFieldData from django.test.utils import override_settings from lms.djangoapps.courseware.tests.test_field_overrides import inject_field_overrides from r...
"""The Apple System Log Parser.""" import construct import logging import os from plaso.lib import errors from plaso.lib import event from plaso.lib import eventdata from plaso.lib import timelib from plaso.parsers import interface from plaso.parsers import manager __author__ = 'Joaquin Moreno Garijo (<EMAIL>)' # ...
""" General-purpose decorators for use with Horizon. """ import functools from django.utils.decorators import available_attrs from django.utils.translation import ugettext_lazy as _ def _current_component(view_func, dashboard=None, panel=None): """ Sets the currently-active dashboard and/or panel on the request....
import os from six.moves.configparser import ConfigParser, NoSectionError from six.moves import urllib from conans.errors import ConanException from conans.model.env_info import unquote from conans.paths import conan_expand_user, DEFAULT_PROFILE_NAME from conans.util.env_reader import get_env from conans.util.files i...
from __future__ import absolute_import, division, print_function __metaclass__ = type ################################################################################ # Documentation ################################################################################ ANSIBLE_METADATA = {'metadata_version': '1.1', ...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, unified_strdate, ) class ExpoTVIE(InfoExtractor): _VALID_URL = r'https?://www\.expotv\.com/videos/[^?#]*/(?P<id>[0-9]+)($|[?#])' _TEST = { 'url': 'http://www.expotv.com/vide...
# -*- coding: utf-8 -*- """ *************************************************************************** doPctRgb.py --------------------- Date : June 2010 Copyright : (C) 2010 by Giuseppe Sucameli Email : brush dot tyler at gmail dot com *******************...
"""Use basics.topology.mount to mount all unmounted devices in settings.config['network_device'] Print the function's documentation then apply the function to every device that is configured and not mounted. """ from __future__ import print_function import pydoc import settings from basics import topology def mount_...
"""Should be run with valgrind to get memory consumption for sparse format storage and dot operators. This script can be used for memory benchmarking on CPU only""" import ctypes import sys import argparse import mxnet as mx from mxnet.test_utils import rand_ndarray from mxnet.base import check_call, _LIB def p...