content
string
import stock_picking_wave import wizard import controllers # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
"""display and filter the list of maniphest tasks. you can use the 'task id' output from this command as input to the 'arcyon task-update' command. usage examples: list all tasks: $ arcyon task-query output formats: --format-ids 3 2 1 --format-short 8 / Open / High / ...
from objects.file import FileObject from helperFunctions.hash import get_md5 from helperFunctions.tag import TagColor from contextlib import suppress class Firmware(FileObject): ''' This objects represents a firmware ''' def __init__(self, binary=None, file_name=None, file_path=None, scheduled_analys...
from djangae.test import TestCase from djangae.db import transaction from djangae.contrib import sleuth class TransactionTests(TestCase): def test_repeated_usage_in_a_loop(self): from .test_connector import TestUser pk = TestUser.objects.create(username="foo").pk for i in xrange(4): ...
#/u/GoldenSights import praw # simple interface to the reddit API, also handles rate limiting of requests import time import sqlite3 import random '''USER CONFIGURATION''' USERNAME = "" #This is the bot's Username. In order to send mail, he must have some amount of Karma. PASSWORD = "" #This is the bot's Password. ...
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_...
""" Allows XML files to be operated on like Python objects. Features: - load XML source from file pathnames, readable file objects or raw strings - add, get and set tag attributes like with python attributes - iterate over nodes - save the modified XMLFile or XMLObject to file Example XML file:: ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import glob import os import re from ansible.module_utils.facts.virtual.base import Virtual, VirtualCollector from ansible.module_utils.facts.utils import get_file_content, get_file_lines class LinuxVirtual(Virtual): """ ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.action import ActionBase from ansible.plugins.action.template import ActionModule as TemplateActionModule # Even though TemplateActionModule inherits from ActionBase, we still need to # directly inherit from ...
"""ARI client library. """ import json import logging import urlparse import swaggerpy.client from ari.model import * log = logging.getLogger(__name__) class Client(object): """ARI Client object. :param base_url: Base URL for accessing Asterisk. :param http_client: HTTP client interface. """ ...
# This test is exactly like uctypes_le.py, but uses native structure layout. # Codepaths for packed vs native structures are different. This test only works # on little-endian machine (no matter if 32 or 64 bit). import sys import uctypes if sys.byteorder != "little": print("SKIP") sys.exit() desc = { "s...
"""Tests for gen_html.""" import json import os import shutil import tempfile import unittest import gen_html TEST_DATA = { "test1": {"kubernetes-release": [{"build": 3, "failed": False, "time": 3.52}, {"build": 4, "failed": True, "time": 63.21}], "kubernetes-debug": [{"b...
"""Implementation of legacy Invenio methods for Flask session.""" from flask import current_app, request from flask.sessions import SessionMixin from flask_login import current_user from werkzeug.datastructures import CallbackDict class Session(CallbackDict, SessionMixin): """Implement compatible legacy Invenio...
# -*- 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): # Adding model 'CourseCohort' db.create_table('course_groups_coursecohort', ( ('id', self.gf('dj...
from __future__ import division from sympy import I, Rational, Symbol, pi, sqrt from sympy.geometry import Line, Point, Point2D, Point3D, Line3D from sympy.geometry.entity import rotate, scale, translate from sympy.matrices import Matrix from sympy.utilities.pytest import raises def test_point(): x = Symbol('x',...
# ----------------------------------------------------------------------------- # yacc_error4.py # # Attempt to define a rule named 'error' # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex i...
# FOR GRID SEARCH CANDIDATES import itertools import numpy import os import pandas import scipy.stats from grocsvs import step from grocsvs import structuralvariants from grocsvs.stages import sv_candidates class CombineRefinedBreakpointsStep(step.StepChunk): @staticmethod def get_steps(options): y...
from test_plus.test import TestCase from ..admin import MyUserCreationForm class TestMyUserCreationForm(TestCase): def setUp(self): self.user = self.make_user('notalamode', 'notalamodespassword') def test_clean_username_success(self): # Instantiate the form with a new username form ...
from distutils.version import LooseVersion try: import pyrax HAS_PYRAX = True except ImportError: HAS_PYRAX = False def cloud_block_storage(module, state, name, description, meta, size, snapshot_id, volume_type, wait, wait_timeout, image): changed = Fal...
"""Functions to compute receptive field of a fully-convolutional network. Please refer to the following g3doc for detailed explanation on how this computation is performed, and why it is important: g3doc/photos/vision/features/delf/g3doc/rf_computation.md """ from __future__ import absolute_import from __future__ imp...
import os import jsonpickle import argparse from model import Contact from model.utils import random_phone, random_email, random_string class ContactGenerator: def __init__(self, name_max_len=10, tel_max_len=10, email_max_len=15, data_max_len=15): self.name_max_len = name_max_len self.tel_max_len =...
from openerp.tests.common import TransactionCase class TestTax(TransactionCase): """Tests for taxes (account.tax) We don't really need at this point to link taxes to tax codes (account.tax.code) nor to companies (base.company) to check computation results. """ def setUp(self): super(T...
from __future__ import division, print_function import numpy as np from itertools import product from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils....
"""Provides utility functions for TCP/UDP echo servers and clients. This program has classes and functions to encode, decode, calculate checksum and verify the "echo request" and "echo response" messages. "echo request" message is an echo message sent from the client to the server. "echo response" message is a respons...
import requests import sys import colorsys ###################### #Configuration constants DAILY_STD_DEV = 1.120 #In %, what is the standard deviation of stock price change? CALL_FREQUENCY = 5 #How often this script will be called, in minutes STOCK_TO_TRACK = '.dji' GOOD_HUE = 120 ...
from base import * import re class DatabaseTests(GeneralTest): def setUp(self): super().setUp() self.cloud = main.ImageCloud(self.test_csv_in, self.database, 'media_urls') self.cloud.write_csv_file_to_database() ...
""" Utility classes for spread. """ from twisted.internet import defer from twisted.python.failure import Failure from twisted.spread import pb from twisted.protocols import basic from twisted.internet import interfaces from zope.interface import implements class LocalMethod: def __init__(self, local, name): ...
import pytest from django.conf import settings from django.db.models import Sum from django.test.utils import override_settings from shuup.core.models import ShippingMode from shuup.front.basket import get_basket from shuup.front.models import StoredBasket from shuup.testing.factories import ( create_product, get_...
from __future__ import absolute_import, division, print_function import abc import six from cryptography import utils from cryptography.exceptions import AlreadyFinalized from cryptography.hazmat.bindings._padding import lib @six.add_metaclass(abc.ABCMeta) class PaddingContext(object): @abc.abstractmethod ...
import copy from topaz.module import ClassDef from topaz.objects.objectobject import W_Object class W_ThreadObject(W_Object): classdef = ClassDef("Thread", W_Object.classdef) def __init__(self, space): W_Object.__init__(self, space) # TODO: This should be a map dict. self.local_stora...
import wizard
import json import os import socket import threading import time import traceback from .base import (Protocol, RefTestExecutor, RefTestImplementation, TestharnessExecutor, strip_server) from ..testrunner import Stop webdriver = None here = o...
"""Provides generic filtering backends that can be used to filter the results returned by list views.""" from sqlalchemy import func, or_ from sqlalchemy.sql import operators from django.template import loader from django.utils.encoding import force_text from django.utils.translation import gettext_lazy from rest_f...
""" searchutils.py Contains utility functions for adding normalized searching values to dictionaries of search parameters. """ def add_string(search_params, key, value): """ Adds a string value to the provided search parameters dictionary if it is non-empty. Args: search_params: The parame...
import urllib import os import gi import threading #simport src.SettingsManager from SettingsManager import SettingsManager gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk, GObject import html GObject.threads_init() class Sync: _window = None _100th_counting = 0 _phrase_list = None ...
from django.conf.urls.defaults import * from django.contrib import admin import views admin.autodiscover() urlpatterns = patterns('', (r'^$', views.index), (r'^openid/', include('django_openid_auth.urls')), (r'^logout/$', 'django.contrib.auth.views.logout'), (r'^private/$', views.require_authenticat...
# -*- coding: utf-8 -*- """ Using a custom primary key By default, Django adds an ``"id"`` field to each model. But you can override this behavior by explicitly adding ``primary_key=True`` to a field. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_...
import sys class TType: STOP = 0 VOID = 1 BOOL = 2 BYTE = 3 I08 = 3 DOUBLE = 4 I16 = 6 I32 = 8 I64 = 10 STRING = 11 UTF7 = 11 STRUCT = 12 MAP = 13 SET = 14 LIST = 15 UTF8 = 16 UTF16 = 17 _VALUES_TO_NAMES = ('STOP', 'VOID', ...
""" MORE INFO AT: http://code.google.com/p/django-rest-interface/wiki/RestifyDjango Data format classes ("responders") that can be plugged into model_resource.ModelResource and determine how the objects of a ModelResource instance are rendered (e.g. serialized to XML, rendered by templates, ...). """ from django.core ...
""" raven.core.processors ~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import re import warnings from raven.utils.compat import string_types, text_type, PY3 from raven.utils im...
import email import datetime from django.utils import dateformat from tastypie.utils.timezone import make_aware, make_naive, aware_datetime # Try to use dateutil for maximum date-parsing niceness. Fall back to # hard-coded RFC2822 parsing if that's not possible. try: from dateutil.parser import parse as mk_datetim...
#!/usr/bin/env python3 """Project Euler - Problem 67 Module""" import os def problem67(triangle_fileloc): """Problem 67 - Maximum path sum II""" # We model tree node with dict: # node = { 'value':123, 'left': {}, 'right': {}, 'depth':1} root = {} cur_depth = [root] d = 0 d_nodelist = [...
"""benchmarking through py.test""" from __future__ import print_function, division import py from py.__.test.item import Item from py.__.test.terminal.terminal import TerminalSession from math import ceil as _ceil, floor as _floor, log10 import timeit from inspect import getsource from sympy.core.compatibility imp...
import yaml import yamlordereddictloader from collections import OrderedDict import logging logger = logging.getLogger('vswitch') hdlr = logging.FileHandler('/var/log/chaperone/ChaperoneNSXtLog.log') formatter = logging.Formatter('%(asctime)s [%(levelname)s] %(funcName)s: %(message)s') hdlr.setFormatter(formatter) log...
import time from datetime import datetime, timedelta from StringIO import StringIO from django.core.handlers.modpython import ModPythonRequest from django.core.handlers.wsgi import WSGIRequest, LimitedStream from django.http import HttpRequest, HttpResponse, parse_cookie from django.utils import unittest from django.u...
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
"""Gradients for operators defined in control_flow_ops.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.python.framework import ops from tensorflow.python.framework impo...
import os import sys import numpy as np import mdtraj as md import tables from IPython.utils.traitlets import Int, Enum, Instance, Bool, List from msmbuilder3.config.app import MSMBuilderApp from msmbuilder3.cluster import KCenters from msmbuilder3 import DataSet from .ticaapp import TICAApp from .vectorapp import Vec...
class ImportStatement(object): """Represent an import in a module `readonly` attribute controls whether this import can be changed by import actions or not. """ def __init__(self, import_info, start_line, end_line, main_statement=None, blank_lines=0): self.start_line = st...
#!/usr/bin/env python # # $1 Generated documentation directory # The following transforms are performed: # - Strip useless "[implementation]" littering the docs # - Change "Static Public Member Functions" to "Class Methods" # - Change "Public Member Functions" to "Instance Methods" # - Change "Member Function Document...
""" Things likely to be used by writers of unit tests. """ from __future__ import division, absolute_import # Define the public API from the two implementation modules from twisted.trial._synctest import ( FailTest, SkipTest, SynchronousTestCase, PyUnitResultAdapter, Todo, makeTodo) from twisted.trial._asynct...
"""Unit tests for the Deposit models.""" from flask_registry import RegistryError from invenio.testsuite import InvenioTestCase, make_test_suite, run_test_suite class DepositionTest(InvenioTestCase): """Test.""" def setUp(self): """Test.""" from invenio.modules.deposit.models import Deposi...
"""Operators corresponding to Python builtin functions. List of built-in functions: https://docs.python.org/3/library/functions.html """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import six from tensorflow.python.autograph.utils import py_func from ...
try: from keystoneclient.v2_0 import client except ImportError: keystoneclient_found = False else: keystoneclient_found = True def authenticate(endpoint, token, login_user, login_password, login_tenant_name): """Return a keystone client object""" if token: return client.Client(endpoint=en...
from privacyidea.lib.applications import MachineApplicationBase import logging log = logging.getLogger(__name__) from privacyidea.lib.crypto import geturandom import binascii from privacyidea.lib.token import get_tokens class MachineApplication(MachineApplicationBase): """ This is the application for LUKS. ...
page_footer = """ <footer>Happy Hunting </footer> <div id="hashModal" class="modal"> <div class="modal-content"> <div class="modal-header"> <span class="close">&times;</span> <h2>Captured Hashes</h2> </div> <div class="modal-body"> <p id='dumped_hashes'></p> </div> <div class="...
"""distutils.command.install_headers Implements the Distutils 'install_headers' command, to install C/C++ header files to the Python include directory.""" __revision__ = "$Id$" from distutils.core import Command # XXX force is never used class install_headers(Command): description = "install C/C++ header file...
"""Policy implementation that applies temperature to a distribution.""" from __future__ import absolute_import from __future__ import division # Using Type Annotations. from __future__ import print_function from typing import Optional, Text import gin import tensorflow as tf # pylint: disable=g-explicit-tensorflow-...
from __future__ import division, absolute_import import sys import traceback from zope.interface import implementer from twisted.python.failure import Failure from twisted.trial.unittest import SynchronousTestCase, PyUnitResultAdapter from twisted.trial.itrial import IReporter, ITestCase import unittest as pyunit ...
""" This module provides some useful functions for working with scrapy.http.Response objects """ import os import weakref import webbrowser import tempfile from twisted.web import http from scrapy.utils.python import to_bytes, to_native_str from w3lib import html from scrapy.utils.decorators import deprecated @depr...
import abc from oslo_serialization import jsonutils from neutron.api import extensions from neutron import wsgi class FoxInSocksController(wsgi.Controller): def index(self, request): return "Try to say this Mr. Knox, sir..." class FoxInSocksPluginInterface(extensions.PluginInterface): @abc.abstr...
import os import unittest from unittest import skipUnless from django.contrib.gis.gdal import HAS_GDAL from ..test_data import TEST_DATA, TestDS, get_ds_file if HAS_GDAL: from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, GDALException, OGRIndexError, GDAL_VERSION from django.contrib.gis....
""" Module for performing checks on a Kibana logging deployment """ import json import ssl # pylint can't find the package when its installed in virtualenv # pylint: disable=import-error,no-name-in-module from ansible.module_utils.six.moves.urllib import request # pylint: disable=import-error,no-name-in-module from a...
from nose.tools import eq_ from pyquery import PyQuery as pq from kitsune.gallery.models import Image, Video from kitsune.gallery.tests import ImageFactory, VideoFactory from kitsune.sumo.templatetags.jinja_helpers import urlparams from kitsune.sumo.tests import TestCase, get, LocalizingClient, post from kitsune.sumo....
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import getpass import os import shutil import time import tempfile import six from binascii import unhexlify from binascii import hexlify from nose.plugins.skip import SkipTest from ansible.compat.tests import unittest from ansib...
from __future__ import unicode_literals from django import http from django.apps import apps from django.contrib.contenttypes.models import ContentType from django.contrib.sites.requests import RequestSite from django.core.exceptions import ObjectDoesNotExist from django.utils.translation import ugettext as _ def sh...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'network'} import re from ansible.module_utils.network.nxos.nxos import get_config, load_config, run_commands from ansible.module_utils.network.nxos.nxos import nxos_argument_spec, check_args...
# -*- 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): # Adding model 'SuccessNotification' db.create_table('robokassa_successnotification', ( ('id', s...
""" Tests for wiki permissions """ from django.contrib.auth.models import Group from nose.plugins.attrib import attr from student.tests.factories import UserFactory from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from courseware.test...
import yaml import pprint import sys def _load_code(expression): return eval(expression) def myconstructor1(constructor, tag, node): seq = constructor.construct_sequence(node) return {tag: seq } def myconstructor2(constructor, tag, node): seq = constructor.construct_sequence(node) string = '' ...
import pyparsing as pp def jsParse(inStr): # This disaster is a context-free grammar parser for parsing javascript object literals. # It needs to be able to handle a lot of the definitional messes you find in in-the-wild # javascript object literals. # Unfortunately, Javascript is /way/ more tolerant then JSON whe...
import sys import os import glob import subprocess class Entry: def __init__(self, path, parent): self.path = path self.parent = parent self.isdir = os.path.isdir(path) @classmethod def all_entries(self, path=""): def recurse(parent_path, parent): for path in glob.glob(os.path.join(parent_path, "*")): ...
import sys import commands from twisted.internet import reactor from twisted.protocols.basic import LineReceiver from pyspades.types import AttributeSet stdout = sys.__stdout__ if sys.platform == 'win32': # StandardIO on Windows does not work, so we create a silly replacement import msvcrt class Stan...
""" Constants used throughout the cea.technologies package. History lesson: This is a first step at removing the `cea.globalvars.GlobalVariables` object. """ # Heat Exchangers U_COOL = 2500.0 # W/m2K U_HEAT = 2500.0 # W/m2K DT_HEAT = 5.0 # K - pinch delta at design conditions DT_COOL = 2.0 # K - pinch del...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = r''' --- module: bigiq_regkey_pool short_description: Manages registration k...
""" Verifies that app bundles are built correctly. """ import TestGyp import os import plistlib import subprocess import sys def GetStdout(cmdlist): return subprocess.Popen(cmdlist, stdout=subprocess.PIPE).communicate()[0].rstrip('\n') def ExpectEq(expected, actual): if expected != act...
"""Run Inspector's perf tests in perf mode.""" import logging import sys from webkitpy.performance_tests.perftestsrunner import PerfTestsRunner _log = logging.getLogger(__name__) if '__main__' == __name__: logging.basicConfig(level=logging.INFO, format="%(message)s") sys.exit(PerfTestsRunner(args=['inspecto...
# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <<EMAIL>> # GPLv2 or later # Features: # * set proper default encoding # * enable readline completion in the interactive interpreter # * load command line history on startup # * save command line history on exit import os def __exithandler(): t...
""" TIFF image parser. Authors: Victor Stinner, Sebastien Ponce, Robert Xiao Creation date: 30 september 2006 """ from hachoir_parser import Parser from hachoir_core.field import FieldSet, SeekableFieldSet, RootSeekableFieldSet, Bytes from hachoir_core.endian import LITTLE_ENDIAN, BIG_ENDIAN from hachoir_parser.image...
import inspect import time from flask import jsonify, request from engine.controllers.eval_controller import EvalController from engine.services.csv.eval import eval_to_csv from engine.services.db.eval import insert_eval_result from . import api @api.route('/create_domains', methods=['GET']) def create_domains(): ...
import pandas as pd #Enumerate colors. class COLOR: RED = "tomato" GREEN = "yellowgreen" BLUE = "lightblue" NEWLINE_INDENT = "\n " def fill(color): return f"[style=filled fillcolor=\"{color}\"]" def dual_label(weapon, n): return f"[label=\"{weapon}\" taillabel=\"{n}\"]" def solo_node(player, color): return f...
#!/usr/bin/python # # This tools exploits the data of csv files produced by script collect-ce-job-status.py, to # compute the number of CEs grouped by slice of ratio R/(R+W) as a function of time: # between 0 and 0,5, and between 0,5 and 1, exactly 1 or not calculable. # # Results are stored in file running_ratio_slic...
from django.core import validators from django.core.exceptions import ValidationError from django.contrib.auth.models import User from django.db import models from contactboard.models import Alumne class Profile(models.Model): class Meta: verbose_name = 'perfil' ordering = ['alumne'] user = m...
# ----- Info ------------------------------------------------------------------ __author__ = 'Michael Montero <<EMAIL>>' # ----- Imports --------------------------------------------------------------- from tinyAPI.base.services.geo.api.CountryCode import CountryCode import tinyAPI import unittest # ----- Tests ---...
import time def main(): arg_spec = dict( name=dict(required=True), timeout=dict(default=300, type='int'), state=dict(required=True, choices=['present', 'started', 'restarted', 'stopped', 'monitored', 'unmonitored', 'reloaded']) ) module = AnsibleModule(argument_spec=arg_spec, suppo...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.manageiq import ManageIQ, manageiq_arg...
"""Utilities used in autograph-generated code.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import tensor_util def is_tensor(*args): """Check if any arguments are tensors. Args: *args: Python objects that ma...
"""Script to install/uninstall HA into OS X.""" import os import time # mypy: allow-untyped-calls, allow-untyped-defs def install_osx(): """Set up to run via launchd on OS X.""" with os.popen("which hass") as inp: hass_path = inp.read().strip() with os.popen("whoami") as inp: user = inp....
""" Utilities for fast persistence of big data, with optional compression. """ # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import pickle import traceback import sys import os import zlib import warnings from ._compat import _basestring from io import BytesIO if sys.version_info[0] >= 3: ...
""" Handles making requests and formatting the responses. """ import code import socket import stem import stem.control import stem.descriptor.remote import stem.interpreter.help import stem.util.connection import stem.util.str_tools import stem.util.tor_tools from stem.interpreter import STANDARD_OUTPUT, BOLD_OUTPU...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2, 7): pytestmark = pytest.mark.skip("F5 Ansible modules require Python >= 2.7") from ansible.module_utils.basic import AnsibleModule try: from librar...
from __future__ import unicode_literals import frappe, json from frappe import _, throw, msgprint from frappe.utils import cstr, nowdate from frappe.model.document import Document class SMSSettings(Document): pass def validate_receiver_nos(receiver_list): validated_receiver_list = [] for d in receiver_list: # ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'core'}
"""Unit test for the gtest_xml_output module.""" import os from xml.dom import minidom, Node import gtest_test_utils import gtest_xml_test_utils GTEST_OUTPUT_SUBDIR = "xml_outfiles" GTEST_OUTPUT_1_TEST = "gtest_xml_outfile1_test_" GTEST_OUTPUT_2_TEST = "gtest_xml_outfile2_test_" EXPECTED_XML_1 = """<?xml version="1....
######################## # Prelude to the example ######################## """ This example is realized with a DP-VBGMM model The other mixtures and the K-means are working in the same way The available classes are: - Kmeans (kmeans) - GaussianMixture (GMM) - VariationalGaussianMixture (VBGMM) - DPVariation...
""" .. _tut_compute_covariance: Computing a covariance matrix ============================= Many methods in MNE, including source estimation and some classification algorithms, require covariance estimations from the recordings. In this tutorial we cover the basics of sensor covariance computations and construct a no...
"""Snapcraft external snaps tests. This will clone the external repository, search for snapcraft.yaml files and snap the packages. Usage: external_snaps_tests REPO_URL [--repo-branch BRANCH] [--cleanbuild] [--keep-dir] Arguments: REPO_URL The URL of the repository to build. ...
""" Views for hint management. Get to these views through courseurl/hint_manager. For example: https://courses.edx.org/courses/MITx/2.01x/2013_Spring/hint_manager These views will only be visible if FEATURES['ENABLE_HINTER_INSTRUCTOR_VIEW'] = True """ import json import re from django.http import HttpResponse, Http...
from __future__ import division from collections import Counter import math, random, csv, json from bs4 import BeautifulSoup import requests ###### # # BOOKS ABOUT DATA # ###### def is_video(td): """it's a video if it has exactly one pricelabel, and if the stripped text inside that pricelabel starts with 'Vi...
ANSIBLE_METADATA = { 'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community' } import re from ansible.module_utils.nxos import get_config, load_config, run_commands from ansible.module_utils.nxos import nxos_argument_spec, check_args from ansible.module_utils.basic import AnsibleModu...