content
string
import attr from cached_property import cached_property from navmazing import NavigateToAttribute, NavigateToSibling from widgetastic.utils import Fillable from widgetastic.widget import Text from widgetastic_patternfly import CandidateNotFound from cfme.exceptions import ItemNotFound from cfme.modeling.base import Ba...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os from ansible.errors import AnsibleError from ansible.parsing import DataLoader from ansible.plugins.action import ActionBase class ActionModule(ActionBase): TRANSFERS_FILES = False def run(self, tmp=None, task...
from test_support import TestFailed import bisect import sys nerrors = 0 def check_bisect(func, list, elt, expected): global nerrors got = func(list, elt) if got != expected: print >> sys.stderr, \ "expected %s(%s, %s) -> %s, but got %s" % (func.__name__, ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import pytest from ansible.errors import AnsibleParserError from ansible.parsing.utils.yaml import from_yaml def test_from_yaml_simple(): assert from_yaml(u'---\n- test: 1\n test2: "2"\n- caf\xe9: "caf\xe9"') == [{u'test': ...
# -*- coding: utf-8 -*- from openerp.osv import orm, fields class test_converter(orm.Model): _name = 'website.converter.test' _columns = { 'char': fields.char(), 'integer': fields.integer(), 'float': fields.float(), 'numeric': fields.float(digits=(16, 2)), 'many2one': f...
""" TeXcheck.py -- rough syntax checking on Python style LaTeX documents. Written by Raymond D. Hettinger <python at rcn.com> Copyright (c) 2003 Python Software Foundation. All rights reserved. Designed to catch common markup errors including: * Unbalanced or mismatched parenthesis, brackets, and braces....
import re import sys from markdown.blockprocessors import BlockProcessor from markdown.preprocessors import Preprocessor from markdown.preprocessors import ReferencePreprocessor from markdown.extensions import Extension from markdown import markdown from util import to_abs_path _CHANGELOG_PATH = to_abs_path('../../...
#!/usr/bin/python # -*- coding: utf-8 -*- """Ansible module for modifying OpenShift configs during an upgrade""" import os import yaml def modify_api_levels(level_list, remove, ensure, msg_prepend='', msg_append=''): """ modify_api_levels """ changed = False changes = [] if not ...
""" ============================= Species distribution dataset ============================= This dataset represents the geographic distribution of species. The dataset is provided by Phillips et. al. (2006). The two species are: - `"Bradypus variegatus" <http://www.iucnredlist.org/apps/redlist/details/3038/0>`_...
""" @author: Andrew Case @license: GNU General Public License 2.0 @contact: <EMAIL> @organization: """ import volatility.obj as obj import volatility.plugins.linux.common as linux_common from volatility.plugins.linux.slab_info import linux_slabinfo class linux_vma_cache(linux_common.AbstractLinuxComma...
"""Base classes to represent dependency rules, used by checkdeps.py""" import os import re class Rule(object): """Specifies a single rule for an include, which can be one of ALLOW, DISALLOW and TEMP_ALLOW. """ # These are the prefixes used to indicate each type of rule. These # are also used as values fo...
''' Camera ====== Core class for acquiring the camera and converting its input into a :class:`~kivy.graphics.texture.Texture`. .. versionchanged:: 1.10.0 The pygst and videocapture providers have been removed. .. versionchanged:: 1.8.0 There is now 2 distinct Gstreamer implementation: one using Gi/Gst wo...
# -*- coding: utf-8 -*- ''' Script: MolaBot.py Descripcion: Bot de Telegram que gestiona todo un sistema de reputaciones de los usuarios pertenecientes a un grupo. Permite a un usuario, dar "Likes" a los mensajes de otros, y el numero global de "Likes" (la suma de todos los likes de todos los mensa...
import os # @NoMove import sys # @NoMove sys.path.insert(0, os.path.realpath(os.path.abspath('..'))) import pydevd_reload import tempfile import unittest SAMPLE_CODE = """ class C: def foo(self): return 0 @classmethod def bar(cls): return (0, 0) @staticmethod def stomp(): ...
""" ========================================================== Adjustment for chance in clustering performance evaluation ========================================================== The following plots demonstrate the impact of the number of clusters and number of samples on various clustering performance evaluation me...
"""Reversible residual network compatible with eager execution. Configuration in format of tf.contrib.training.HParams. Supports CIFAR-10, CIFAR-100, and ImageNet datasets. Reference [The Reversible Residual Network: Backpropagation Without Storing Activations](https://arxiv.org/pdf/1707.04585.pdf) """ from __futur...
"""Generates profile dictionaries for Autofill. Used to test autofill.AutofillTest.FormFillLatencyAfterSubmit. Can be used as a stand alone script with -h to print out help text by running: python autofill_dataset_generator.py -h """ import codecs import logging from optparse import OptionParser import os import ra...
"""pytest for using dtf property manager""" from __future__ import absolute_import import pytest import dtf.properties as prop import dtf.testutils as testutils # prop_set() tests def test_set_new_property(): """Attempt to set a new property (existing section)""" value = '1' contents = ("[info]\n" ...
"""Reading and writing of files in the ``gettext`` PO (portable object) format. :see: `The Format of PO Files <http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files>`_ """ from datetime import date, datetime import os import re from babel import __version__ as VERSION from babel.messages.catalog im...
from models import Base from models.actions import Action from models.actions.datetime import Datetime from models.actions.feed import Feed from models.actions.weather import Weather from models.association import Association from models.command import Command from models.scenario import Scenario from sqlalchemy.engine...
from __future__ import unicode_literals from guessit import PY3, u, base_text_type from guessit.matchtree import MatchTree from guessit.textutils import normalize_unicode import logging log = logging.getLogger(__name__) class IterativeMatcher(object): def __init__(self, filename, filetype='autodetect', opts=None...
"""Linter error rules class for Closure Linter.""" __author__ = '<EMAIL> (Robert Walker)' import gflags as flags from closure_linter import errors FLAGS = flags.FLAGS flags.DEFINE_boolean('jsdoc', True, 'Whether to report errors for missing JsDoc.') flags.DEFINE_list('disable', None, ...
from __future__ import unicode_literals import codecs import json import os from nikola.plugin_categories import LateTask from nikola.utils import apply_filters, config_changed, copy_tree, makedirs # This is what we need to produce: # var tipuesearch = {"pages": [ # {"title": "Tipue Search, a jQuery site search e...
import socket import xmlrpclib webfaction = xmlrpclib.ServerProxy('https://api.webfaction.com/') def main(): module = AnsibleModule( argument_spec = dict( name = dict(required=True), state = dict(required=False, choices=['present', 'absent'], default='present'), # You ...
"""Remove dag_stat table Revision ID: a56c9515abdc Revises: c8ffec048a3b Create Date: 2018-12-27 10:27:59.715872 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'a56c9515abdc' down_revision = 'c8ffec048a3b' branch_labels = None depends_on = None def upgrade()...
#!/usr/bin/python # getimage.py - this file is part of dailyimage # Retrieve an image from a google image search import sys # argv import re # finding images import requests # downloading results and images import bs4 # finding images def get_image(query): ''' function get_im...
from cme.helpers.powershell import * from cme.helpers.misc import gen_random_string from cme.servers.smb import CMESMBServer from gevent import sleep from sys import exit import os class CMEModule: ''' Executes PowerSploit's Get-Keystrokes script Module by @byt3bl33d3r ''' name = 'get_keys...
import logging from twitter.common.log.formatters.base import format_message class PlainFormatter(logging.Formatter): """ Format a log in a plainer style: type] msg """ SCHEME = 'plain' LEVEL_MAP = { logging.FATAL: 'FATAL', logging.ERROR: 'ERROR', logging.WARN: ' WARN', logging.INFO: ...
import os import gobject import gtk import gtk.gdk import logging from virtaal.common import GObjectWrapper from virtaal.models.langmodel import LanguageModel from baseview import BaseView from widgets.popupmenubutton import PopupMenuButton class LanguageView(BaseView): """ Manages the language selection on...
from django.template.defaultfilters import truncatewords from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class TruncatewordsTests(SimpleTestCase): @setup({'truncatewords01': '{% autoescape off %}{{ a|truncatewords:"2" }} {{ b|truncatewords:"...
import time from datetime import datetime from openerp.osv import fields, osv from openerp import tools from openerp.tools.translate import _ import openerp.addons.decimal_precision as dp class account_analytic_account(osv.osv): _name = 'account.analytic.account' _inherit = ['mail.thread'] _description = ...
#!/usr/bin/env python """ hdfs.py is a python client for the thrift interface to HDFS. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 ...
import mock from neutron.common import log as call_log from neutron.tests import base MODULE_NAME = 'neutron.tests.unit.test_common_log' class TargetKlass(object): @call_log.log def test_method(self, arg1, arg2, *args, **kwargs): pass class TestCallLog(base.BaseTestCase): def setUp(self): ...
""" this module is actual fix some parameter by using bayesian optimization. if we run this function in parallel, we need to satisfied many condition which mentioned in the paper named 'practical bayesian optimization in machine learning algorithm' """ from math import exp import subprocess import time from multiproces...
"""Verifies that Google Test correctly determines whether to use colors.""" __author__ = '<EMAIL> (Zhanyong Wan)' import os import gtest_test_utils IS_WINDOWS = os.name = 'nt' COLOR_ENV_VAR = 'GTEST_COLOR' COLOR_FLAG = 'gtest_color' COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_color_test_') def SetEnv...
# -*- coding: utf-8 -*- """Plist parser plugin for Safari history plist files.""" from dfdatetime import cocoa_time as dfdatetime_cocoa_time from plaso.containers import events from plaso.containers import time_events from plaso.lib import definitions from plaso.parsers import plist from plaso.parsers.plist_plugins i...
import turtle # Get user's input board_size = input('Enter bord size: ') # Validate user's input try: board_size = int(board_size) if board_size < 8: raise Exception('Board size cannot be less then 8.') except ValueError: print('Invalid input!') exit() except Exception as error: print(er...
from neutron.openstack.common import jsonutils from neutron.plugins.ml2 import db from neutron.plugins.ml2 import driver_api as api class MechanismDriverContext(object): """MechanismDriver context base class.""" def __init__(self, plugin, plugin_context): self._plugin = plugin # This temporari...
import re from pymatgen.core.structure import Molecule from monty.io import zopen """ Module implementing an XYZ file object class. """ __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __maintainer__ = "Shyue Ping Ong" __email__ = "<EMAIL>" __date__ = "Apr 17,...
from setuptools import setup from setuptools import find_packages with open('README.rst') as f: LONG_DESCRIPTION = f.read() MAJOR_VERSION = '0' MINOR_VERSION = '14' MICRO_VERSION = '247' VERSION = "{}.{}.{}".format(MAJOR_VERSION, MINOR_VERSION, MICRO_VERSION) setup( name='yagmail', version=VERSION, de...
from m5.params import * from m5.proxy import * from Device import BasicPioDevice, PioDevice, IsaFake, BadAddr from Platform import Platform from Terminal import Terminal from Uart import Uart8250 class MmDisk(BasicPioDevice): type = 'MmDisk' cxx_header = "dev/sparc/mm_disk.hh" image = Param.DiskImage("Dis...
#nada from django import forms from .models import Category from .models import ForbiddenWords from .models import Post from django import forms #end nada #alem from .models import Post, Reply #end alem #hossam from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.m...
""" RDD-based machine learning APIs for Python (in maintenance mode). The `pyspark.mllib` package is in maintenance mode as of the Spark 2.0.0 release to encourage migration to the DataFrame-based APIs under the `pyspark.ml` package. """ from __future__ import absolute_import # MLlib currently needs NumPy 1.4+, so co...
from dart.client.python.dart_client import Dart from dart.model.dataset import Column, DatasetData, Dataset, DataFormat, FileFormat, RowFormat, DataType, Compression, \ LoadType if __name__ == '__main__': dart = Dart('localhost', 5000) assert isinstance(dart, Dart) dataset = dart.save_dataset(Dataset(...
from logging import getLogger from django.conf.urls import patterns from django.http import HttpResponse from django.template.loader import render_to_string from django.utils import simplejson as json from snf_django.lib import api from synnefo.api import util from synnefo.db.models import Flavor log = getLogger('s...
from jobcert import app @app.template_filter('readability_words') def readability_words_filter(s): score = int(s) if score in range(90, 100): return "Very Easy" elif score in range(80, 89): return "Easy" elif score in range(70, 79): return "Fairly Easy" elif score in range (...
"""Rename `hearing_section` to `alternative`""" # revision identifiers, used by Alembic. revision = '14051cff79e' down_revision = '51051f5b195' from alembic import op def upgrade(): op.rename_table('hearing_section', 'alternative') op.rename_table('hearing_section_version', 'alternative_version') op.al...
# Check every path through every method of UserDict from test import support, mapping_tests import collections d0 = {} d1 = {"one": 1} d2 = {"one": 1, "two": 2} d3 = {"one": 1, "two": 3, "three": 5} d4 = {"one": None, "two": None} d5 = {"one": 1, "two": 1} class UserDictTest(mapping_tests.TestHashMappingProtocol): ...
# -*- coding: utf-8 -*- """ pygments.formatters.img ~~~~~~~~~~~~~~~~~~~~~~~ Formatter for Pixmap output. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys from pygments.formatter import Formatter from pygments.util import ge...
"""A custom list that manages index/position information for contained elements. :author: Jason Kirtland ``orderinglist`` is a helper for mutable ordered relationships. It will intercept list operations performed on a :func:`_orm.relationship`-managed collection and automatically synchronize changes in list position...
from spack import * class RPlotly(RPackage): """Easily translate 'ggplot2' graphs to an interactive web-based version and/or create custom web-based visualizations directly from R.""" homepage = "https://cran.r-project.org/web/packages/plotly/index.html" url = "https://cran.r-project.org/src/con...
import time from openerp.osv import osv from openerp.tools.translate import _ from openerp.report import report_sxw from common_report_header import common_report_header class third_party_ledger(report_sxw.rml_parse, common_report_header): def __init__(self, cr, uid, name, context=None): super(third_part...
""" This script takes a list of keywords and generates a testcase, that checks if using the keyword as identifier fails, for every keyword. The generate test files are set read-only. Test for https://github.com/rust-lang/rust/issues/2275 sample usage: src/etc/generate-keyword-tests.py as break """ import sys import o...
""" MySQL database backend for Django. Requires mysqlclient: https://pypi.python.org/pypi/mysqlclient/ MySQLdb is supported for Python 2 only: http://sourceforge.net/projects/mysql-python """ from __future__ import unicode_literals import datetime import re import sys import warnings from django.conf import settings...
from openerp import models, api, fields from openerp.osv import orm class SaleOrder(models.Model): _inherit = 'sale.order' def _prepare_order_line_procurement(self, cr, uid, order, line, group_id=False, context=None): values = super(SaleOrder, self)._prepare_or...
class DmgTypes: """Container for damage data stats.""" def __init__(self, em, thermal, kinetic, explosive): self.em = em self.thermal = thermal self.kinetic = kinetic self.explosive = explosive self._calcTotal() # Iterator is needed to support tuple-style unpacking ...
from pyparsing import Literal,Suppress,CharsNotIn,CaselessLiteral,\ Word,dblQuotedString,alphanums,SkipTo import urllib import pprint # Define the pyparsing grammar for a URL, that is: # URLlink ::= <a href= URL>linkText</a> # URL ::= doubleQuotedString | alphanumericWordPath # Note that whitespa...
import unittest from datetime import datetime, timedelta from fs.memoryfs import MemoryFS from mock import Mock, patch import itertools from xblock.runtime import KvsFieldData, DictKeyValueStore import xmodule.course_module from xmodule.modulestore.xml import ImportSystem, XMLModuleStore from opaque_keys.edx.locati...
from gnuradio import gr, gr_unittest import math def sincos(x): return math.cos(x) + math.sin(x) * 1j class test_bytes_to_syms (gr_unittest.TestCase): def setUp (self): self.tb = gr.top_block () def tearDown (self): self.tb = None def test_bytes_to_syms_001 (self): src_data...
from __future__ import unicode_literals import frappe from frappe.utils import strip_html from frappe.website.utils import scrub_relative_urls from jinja2.utils import concat from jinja2 import meta import re def render_blocks(context): """returns a dict of block name and its rendered content""" out = {} env = f...
import math import pandas.core.common as com from bokeh.palettes import brewer as bokeh_brewer from .palettes import brewer as snakemakelib_brewer import logging logger = logging.getLogger(__name__) MINSIZE = 3 MAXSIZE = 9 # FIXME: some palettes have 9 as max, some 11 brewer = bokeh_brewer brewer.update(snakemakeli...
"""Tests for google.protobuf.symbol_database.""" try: import unittest2 as unittest #PY26 except ImportError: import unittest from google.protobuf import unittest_pb2 from google.protobuf import descriptor from google.protobuf import descriptor_pool from google.protobuf import symbol_database class SymbolDataba...
import logging from openerp.osv import osv, fields from openerp.tools.translate import _ class ir_logging(osv.Model): _name = 'ir.logging' _order = 'id DESC' EXCEPTIONS_TYPE = [ ('client', 'Client'), ('server', 'Server') ] _columns = { 'create_date': fields.datetime('Crea...
"""Handlers for tr-69 Download and Scheduled Download.""" __author__ = '<EMAIL> (Denton Gentry)' import collections import datetime import errno import os import shutil import time import urlparse import google3 import tornado import tornado.httpclient import tornado.ioloop import tornado.web import core import helpe...
""" Helper functions to be used in bench_pictures.cfg. """ def Config(**kwargs): config = {} for key in kwargs: config[key] = kwargs[key] return config def TileArgs(tile_x, tile_y, timeIndividualTiles=True): config = {'mode': ['tile', str(tile_x), str(tile_y)]} if timeIndividualTiles: config['time...
"""Tests for util module.""" import os import random import sys import unittest import set_sys_path # Update sys.path to locate mod_pywebsocket module. from mod_pywebsocket import util _TEST_DATA_DIR = os.path.join(os.path.split(__file__)[0], 'testdata') class UtilTest(unittest.TestCase): """A unittest for...
#!/usr/bin/env python import os import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Create the RenderWindow, Renderer and interactive renderer # ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.SetMultiSamples(0) renWin.AddRenderer(ren1) ire...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str class VyboryMosIE(InfoExtractor): _VALID_URL = r'https?://vybory\.mos\.ru/(?:#precinct/|account/channels\?.*?\bstation_id=)(?P<id>\d+)' _TESTS = [{ 'url': 'http://vybory.mos.ru/#p...
import django.test from django.contrib.auth.models import User from django.conf import settings from django.http import Http404 from django.test.utils import override_settings from mock import call, patch from student.models import CourseEnrollment from student.tests.factories import UserFactory from course_groups.mo...
""" This module provides classes and functions to parse a KGML pathway map The KGML pathway map is parsed into the object structure defined in KGML_Pathway.py in this module. Classes KGMLParser Parses KGML file Functions read Returns a single Pathway object, using KGMLParser ...
from rez.package_repository import package_repository_manager from rez.package_resources_ import PackageFamilyResource, PackageResource, \ VariantResource, package_family_schema, package_schema, variant_schema, \ package_release_keys from rez.package_serialise import dump_package_data from rez.utils.data_utils ...
""" Unit tests for the differential global minimization algorithm. """ from scipy.optimize import _differentialevolution from scipy.optimize._differentialevolution import DifferentialEvolutionSolver from scipy.optimize import differential_evolution import numpy as np from scipy.optimize import rosen from numpy.testing ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import codecs import re from ansible.errors import AnsibleParserError from ansible.module_utils._text import to_text from ansible.parsing.quoting import unquote # Decode escapes adapted from rspeer's answer here: # http://stacko...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import code import sys import traceback import pyglet.event import pyglet.text from pyglet.window import key from pyglet.gl import * class Console(object): def __init__(self, width, height, globals=None, locals=None): ...
"""RSA module Module for calculating large primes, and RSA encryption, decryption, signing and verification. Includes generating public and private keys. WARNING: this implementation does not use compression of the cleartext input to prevent repetitions, or other common security improvements. Use with care. """ fro...
""" Tools for sending email. """ from __future__ import unicode_literals from django.conf import settings from django.utils.module_loading import import_string # Imported for backwards compatibility, and for the sake # of a cleaner namespace. These symbols used to be in # django/core/mail.py before the introduction o...
"""Spectral operations (e.g. Short-time Fourier Transform).""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import numpy as np from tensorflow.contrib.signal.python.ops import reconstruction_ops from tensorflow.contrib.signal.python.op...
# Waltz # Compare results between wild type and mutant # coding=utf-8 import numpy as np import matplotlib.pyplot as plt import pandas as pd import csv from scipy import stats from pylab import plot, show, savefig, xlim, figure, \ hold, ylim, legend, boxplot, setp, axes import pylab from numpy import *...
from __future__ import absolute_import, unicode_literals import warnings class RemovedInWagtail17Warning(DeprecationWarning): pass removed_in_next_version_warning = RemovedInWagtail17Warning class RemovedInWagtail18Warning(PendingDeprecationWarning): pass class ThisShouldBeAList(list): """ Some...
#!/usr/bin/python import os import sys import codecs import operator from unidecode import unidecode def usage(): return ''' This script extracts words and counts from a 2006 wiktionary word frequency study over American television and movies. To use, first visit the study and download, as .html files, all 26 of...
import string, types, sys, os, StringIO, re, shlex, json, zipfile from collections import OrderedDict from itertools import chain from django.contrib.auth.decorators import login_required from django.core.servers.basehttp import FileWrapper from django.http import HttpResponse, HttpResponseNotFound from django.shortcut...
import os import csv import xlrd # Assumes the directory with the workbook is relative to the script's location. directory = 'workbooks/' file = os.listdir(directory)[0] workbook = (f'{directory}/{file}') # Preps the workbook that contains the information desired. wb = xlrd.open_workbook(workbook) sh = wb.sheet_by_i...
from collections import OrderedDict import numpy as np from bokeh.plotting import ColumnDataSource, figure, show, output_file from bokeh.models import HoverTool from bokeh.sampledata.unemployment1948 import data # Read in the data with pandas. Convert the year column to string data['Year'] = [str(x) for x in data['Y...
def WebIDLTest(parser, harness): parser.parse(""" dictionary Dict { any foo; [ChromeOnly] any bar; }; """) results = parser.finish() harness.check(len(results), 1, "Should have a dictionary") members = results[0].members; harness.check(len(members), 2, "Should have tw...
''' This file is part of VoIPER. VoIPER 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 later version. VoIPER is distributed in the hope that it will be u...
"""Tests for stateless random ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.contrib import stateless from tensorflow.python.framework import dtypes from tensorflow.python.framework import random_seed from tensorf...
import logging import os import shutil import sys import tempfile from pyflink.table import EnvironmentSettings, TableEnvironment def word_count(): content = "line Licensed to the Apache Software Foundation ASF under one " \ "line or more contributor license agreements See the NOTICE file " \ ...
"""XML-RPC methods for Zinnia""" ZINNIA_XMLRPC_PINGBACK = [ ('zinnia.xmlrpc.pingback.pingback_ping', 'pingback.ping'), ('zinnia.xmlrpc.pingback.pingback_extensions_get_pingbacks', 'pingback.extensions.getPingbacks')] ZINNIA_XMLRPC_METAWEBLOG = [ ('zinnia.xmlrpc.metaweblog.get_users_blogs', ...
import json import re from collections import namedtuple import string # INPUT OUTPUT def file_to_list(path): with open(path, 'r') as inputFile: return inputFile.readlines() def json_file_to_dict(path): with open(path, 'r') as jsonFile: return json.load(jsonFile) def to_json(x, path): wi...
'''module for single-thread Heron Instance in python''' import argparse import collections import logging import os import resource import traceback import signal import yaml import heronpy.api.api_constants as api_constants from heronpy.api.state.state import HashMapState from heron.common.src.python.utils import lo...
"""Verifies that Google Test correctly parses environment variables.""" __author__ = '<EMAIL> (Zhanyong Wan)' import os import gtest_test_utils IS_WINDOWS = os.name == 'nt' IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux' COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_env_var_test_') environ = ...
"""Generic thread tests. Meant to be used by dummy_thread and thread. To allow for different modules to be used, test_main() can be called with the module to use as the thread implementation as its sole argument. """ import dummy_thread as _thread import time import Queue import random import unittest from test impo...
"""Tests Google Test's throw-on-failure mode with exceptions disabled. This script invokes gtest_throw_on_failure_test_ (a program written with Google Test) with different environments and command line flags. """ __author__ = '<EMAIL> (Zhanyong Wan)' import os import gtest_test_utils # Constants. # The command li...
from msrest.serialization import Model class ConnectivityHop(Model): """Information about a hop between the source and the destination. Variables are only populated by the server, and will be ignored when sending a request. :ivar type: The type of the hop. :vartype type: str :ivar id: The ID...
#;+ #; NAME: #; x_getsdssimg #; Version 1.1 #; #; PURPOSE: #; Returns an Image by querying the SDSS website #; Will use DSS2-red as a backup #; #; CALLING SEQUENCE: #; #; INPUTS: #; #; RETURNS: #; #; OUTPUTS: #; #; OPTIONAL KEYWORDS: #; #; OPTIONAL OUTPUTS: #; #; COMMENTS: #; #; EXAMPLES: #; #; PROCEDURES/...
"""Provides functions to produce a mirrored object. It just creates a `Part::Mirroring` object, and sets the appropriate `Source` and `Normal` properties. """ ## @package mirror # \ingroup draftfunctions # \brief Provides functions to produce a mirrored object. ## \addtogroup draftfuctions # @{ import FreeCAD as App ...
"""Driver for running multiple profiles concurrently against a cluster. The list of profiles are passed via flag each of which are defined in the profile_details module. """ __author__ = '<EMAIL>' import json import logging from multiprocessing import Process from multiprocessing import Queue import time from absl ...
""" @author: Andrew Case @license: GNU General Public License 2.0 @contact: <EMAIL> @organization: """ import volatility.obj as obj import volatility.plugins.mac.common as common import volatility.plugins.mac.route as route class mac_arp(route.mac_route): """ Prints the arp table """ def...
import pytest from mathmaker.lib.tools.generators.anglessets import AnglesSetGenerator @pytest.fixture() def AG(): return AnglesSetGenerator() def test_AnglesSetGenerator(AG): """Check normal use cases.""" AG.generate(codename='2_1', name='FLUOR', labels=[(1, 36), (2, 40)], variant=0) def...
""" Latent Dirichlet Allocation (LDA) in Python, using all CPU cores to parallelize and speed up model training. The parallelization uses multiprocessing; in case this doesn't work for you for some reason, try the :class:`gensim.models.ldamodel.LdaModel` class which is an equivalent, but more straightforward and singl...