content
string
# -*- coding: utf-8 -*- from __future__ import unicode_literals # Converted from the original South migration 0002_default_rate_limit_config.py from django.db import migrations, models from django.conf import settings from django.core.files import File def forwards(apps, schema_editor): """Add default modes""" ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # models/fmt.py """ Helper functions for formatting pretty representations of PyPhi models. """ from itertools import chain from .. import config, utils # TODO: will these print correctly on all terminals? SMALL_PHI = "\u03C6" BIG_PHI = "\u03D5" # repr verbosity leve...
import numpy as np from statsmodels.graphics.dotplots import dot_plot import pandas as pd from numpy.testing import dec # If true, the output is written to a multi-page pdf file. pdf_output = False try: import matplotlib.pyplot as plt import matplotlib have_matplotlib = True except ImportError: have_m...
''' Location example for Jeeves with confidentiality policies. ''' from abc import ABCMeta, abstractmethod from macropy.case_classes import macros, enum import JeevesLib from sourcetrans.macro_module import macros, jeeves class InternalError(Exception): def __init__(self, message): self.message = message # De...
from __future__ import unicode_literals import datetime from dateutil.relativedelta import relativedelta import pytz from tracpro.test import factories from tracpro.test.cases import TracProTest from ..charts import chart_baseline from ..forms import BaselineTermFilterForm from ..models import BaselineTerm class...
#sudo apt-get install pypy pypy-setuptools #git clone https://github.com/eleme/thriftpy.git #cd thriftpy #make sudo pypy setup.py install #from thriftpy.protocol.binary import TBinaryProtocolFactory #from thriftpy.transport.buffered import TBufferedTransportFactory #from thriftpy.transport.framed import TFramedTranspo...
from textwrap import wrap from weblate.addons.models import ADDONS, Addon from weblate.trans.models import Component, Project from weblate.utils.management.base import BaseCommand class Command(BaseCommand): help = "List installed add-ons" def handle(self, *args, **options): """List installed add-on...
from openerp.osv.orm import Model class MrpProcurement(Model): """Mrp Procurement we override action_po assing to get the cheapest supplier, if you want to change priority parameters just change the _supplier_to_tuple function TODO remove hack if merge proposal accepted look in action_po_assing for d...
import ansible from ansible.callbacks import vv from ansible.errors import AnsibleError as ae from ansible.runner.return_data import ReturnData from ansible.utils import parse_kv, check_conditional import ansible.utils.template as template class ActionModule(object): ''' Create inventory groups based on variables...
from __future__ import unicode_literals import logging import sys import types import warnings from django.conf import settings from django.core import signals from django.core.exceptions import ImproperlyConfigured, MiddlewareNotUsed from django.db import connections, transaction from django.urls import get_resolver...
import json import unittest from django.contrib.postgres import forms from django.contrib.postgres.fields import HStoreField from django.contrib.postgres.validators import KeysValidator from django.core import exceptions, serializers from django.db import connection from django.test import TestCase from .models impor...
""" Run the CEA scripts and unit tests as part of our CI efforts (cf. The Jenkins) """ import os import shutil import tempfile import cea.config import cea.inputlocator import cea.workflows.workflow __author__ = "Daren Thomas" __copyright__ = "Copyright 2020, Architecture and Building Systems - ETH Zurich" __cred...
""" Implement different Image blend Mode. Author: Chienli Ma Date: 2015.01.08 Incentive: It's hard to find a image blending tool in python. Some rare tool either have little mode or out_of_dated and hard to install. Therefore I just implement all methods available on in Internet. Recommended usage: ...
# -*- coding: utf-8 -*- import logging if __name__ == '__main__': logging.basicConfig() _log = logging.getLogger(__name__) import unittest import pyxb import sample from pyxb.namespace.builtin import XMLSchema_instance as xsi class TestTrac0202 (unittest.TestCase): def tearDown (self): pyxb.utils.domut...
from __future__ import unicode_literals from django.conf.urls import include, url from django.test import TestCase from django.utils import six from rest_framework import generics, routers, serializers, status, viewsets from rest_framework.renderers import ( BaseRenderer, BrowsableAPIRenderer, JSONRenderer ) from...
""" Verifies building a target and a subsidiary dependent target from a .gyp file in a subdirectory, without specifying an explicit output build directory, and using the generated solution or project file at the top of the tree as the entry point. There is a difference here in the default behavior of the underlying bu...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils import timezone from django.db import models, migrations def fill_tables(apps, schema_editor): eventsforbusv2 = apps.get_model('AndroidRequests', 'EventForBusv2') eventsforbusstop = apps.get_model('AndroidRequests', 'EventForBus...
from ctypes import byref, c_int from datetime import date, datetime, time from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import ds as capi from django.utils.encoding import force_text # For more information, see the OG...
"Base Cache class." import warnings from django.core.exceptions import ImproperlyConfigured, DjangoRuntimeWarning class InvalidCacheBackendError(ImproperlyConfigured): pass class CacheKeyWarning(DjangoRuntimeWarning): pass # Memcached does not accept keys longer than this. MEMCACHE_MAX_KEY_LENGTH = 250 cl...
#!/usr/bin/env python from __future__ import division, absolute_import, print_function import os import sys import tempfile def run_command(cmd): print('Running %r:' % (cmd)) os.system(cmd) print('------') def run(): _path = os.getcwd() os.chdir(tempfile.gettempdir()) print('------') pr...
"""Overlapping Test **What is checked** The overlapping test checks for controls that occupy the same space as some other control in the dialog. + If the reference controls are available check for each pair of controls: - If controls are exactly the same size and position in reference then make ...
import logging from django.forms import ValidationError # noqa from django import http from django.utils.translation import ugettext_lazy as _ from django.views.decorators.debug import sensitive_variables # noqa from horizon import exceptions from horizon import forms from horizon import messages from horizon.utils...
from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class ChainingTests(SimpleTestCase): """ Chaining safeness-preserving filters should not alter the safe status. """ @setup({'chaining01': '{{ a|capfirst|center:"7" }}.{{ b|capfirst|center:"...
import sys import decimal from unittest import TestCase import json import json.decoder class TestScanString(TestCase): def test_py_scanstring(self): self._test_scanstring(json.decoder.py_scanstring) def test_c_scanstring(self): self._test_scanstring(json.decoder.c_scanstring) def _test_...
""" ====================================== Probability calibration of classifiers ====================================== When performing classification you often want to predict not only the class label, but also the associated probability. This probability gives you some kind of confidence on the prediction. However,...
"""Defines the public namespace for SQL expression constructs. Prior to version 0.9, this module contained all of "elements", "dml", "default_comparator" and "selectable". The module was broken up and most "factory" functions were moved to be grouped with their associated class. """ __all__ = [ 'Alias', 'Claus...
""" WSGI config for bionetbook project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION...
''' This program visualizes ECG waveforms on the PC Copyright (C) 2014 Sagar G V (<EMAIL>) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option...
import sys import os COPYRIGHTS = { "slash": """ /* * Copyright 2017-present Open Networking Foundation * 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/licen...
""" Functional constructs for ORM configuration. See the SQLAlchemy object relational tutorial and mapper configuration documentation for an overview of how this module is used. """ from . import exc from .mapper import ( Mapper, _mapper_registry, class_mapper, configure_mappers, reconstructor, ...
""" .. dialect:: firebird+fdb :name: fdb :dbapi: pyodbc :connectstring: firebird+fdb://user:password@host:port/path/to/db[?key=value&key=value...] :url: http://pypi.python.org/pypi/fdb/ fdb is a kinterbasdb compatible DBAPI for Firebird. .. versionadded:: 0.8 - Support for the fdb Firebird dri...
#!/bin/python3 import os import yaml config = '' subdir = '__output__' with open("shop.yml", 'r') as stream: try: config = yaml.load(stream) except yaml.YAMLError as exc: print(exc) try: os.mkdir(subdir) except Exception: pass for shop in config['shop']: with open(os.path.join(su...
from bpy import data, types from .. import constants, logger from .constants import MULTIPLY, WIRE, IMAGE def _material(func): """ :param func: """ def inner(name, *args, **kwargs): """ :param name: :param *args: :param **kwargs: """ if isinstance(...
import time import FacebookService import thrift.reflection.limited from ttypes import fb_status class FacebookBase(FacebookService.Iface): def __init__(self, name): self.name = name self.alive = int(time.time()) self.counters = {} def getName(self, ): return self.name d...
"""Channel notifications support. Classes and functions to support channel subscriptions and notifications on those channels. Notes: - This code is based on experimental APIs and is subject to change. - Notification does not do deduplication of notification ids, that's up to the receiver. - Storing the Chan...
from django import template try: from django.urls import reverse except ImportError: # For Django < 1.10 from django.core.urlresolvers import reverse from django.template.loader import render_to_string # Issue 182: six no longer included with Django 3.0 try: from django.utils import six except ImportErr...
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2017 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the righ...
"""Check a project and backend by attempting to build using PEP 517 hooks. """ import argparse import logging import os from os.path import isfile, join as pjoin from pip._vendor.pytoml import TomlError, load as toml_load import shutil from subprocess import CalledProcessError import sys import tarfile from tempfile im...
#coding:utf8 ''' Created on 2013-5-8 @author: lan (www.9miao.com) ''' from memclient import mclient from memobject import MemObject import util import time MMODE_STATE_ORI = 0 #未变更 MMODE_STATE_NEW = 1 #创建 MMODE_STATE_UPDATE = 2 #更新 MMODE_STATE_DEL = 3 #删除 TIMEOUT = 1800 def _insert(args): record,...
""" @author: Andrew Case @license: GNU General Public License 2.0 @contact: <EMAIL> @organization: """ import os import volatility.debug as debug import volatility.plugins.linux.common as linux_common from volatility.plugins.linux.slab_info import linux_slabinfo class linux_sk_buff_cache(linux_common....
"""CloudStack plugin for integration tests.""" from __future__ import absolute_import, print_function import json import os import re import time from lib.cloud import ( CloudProvider, CloudEnvironment, ) from lib.util import ( find_executable, ApplicationError, display, SubprocessError, ...
import calendar import json import os from datetime import * import xlsxwriter """generate_annual_income_worksheet.py: Automates my personal Income Statement Excel workbook""" __author__ = "Prajesh Ananthan 2016" def create_excel_sheet(year): workbook = None table_position = 'B3:D13' merge_range = 'B2:...
"""Support for scripts.""" from __future__ import annotations import asyncio import logging import voluptuous as vol from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_MODE, ATTR_NAME, CONF_ALIAS, CONF_DEFAULT, CONF_DESCRIPTION, CONF_ICON, CONF_MODE, CONF_NAME, CONF_SELECT...
import fixtures from neutron.openstack.common import lockutils class LockFixture(fixtures.Fixture): """External locking fixture. This fixture is basically an alternative to the synchronized decorator with the external flag so that tearDowns and addCleanups will be included in the lock context for lo...
import string import types ## json.py implements a JSON (http://json.org) reader and writer. ## Copyright (C) 2005 Patrick D. Logan ## Contact mailto:<EMAIL> ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public ## License a...
import sys import ModeControllerCreator from optparse import Option, OptionParser def main(): optionsTable = [ Option('--enable-deploy', action='store_true', help='Allow rhncfg-client to deploy files.', default=0), Option('--enable-diff', action='store_true', help='Allow rh...
"""Starter script for Nova Compute.""" import sys import traceback from oslo_config import cfg from oslo_log import log as logging from oslo_reports import guru_meditation_report as gmr from nova.conductor import rpcapi as conductor_rpcapi from nova import config import nova.db.api from nova import exception from no...
import Image import FontFile import string # -------------------------------------------------------------------- # parse X Bitmap Distribution Format (BDF) # -------------------------------------------------------------------- bdf_slant = { "R": "Roman", "I": "Italic", "O": "Oblique", "RI": "Reverse Ita...
from django.conf import settings from django.contrib.auth.models import User from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from django.test import TestCase, modify_settings, override_settings from .settings import FLATPAGES_TEMPLATES class TestDataMixin(object): ...
from __future__ import unicode_literals import datetime from django.contrib.admin.utils import quote from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.template.response import TemplateResponse from django.test import TestCase, override_settings from .models import A...
""" Tests for solver scheduler constraints. """ import mock from nova import context from nova import test from nova_solverscheduler.scheduler.solvers import constraints from nova_solverscheduler.tests.scheduler import solver_scheduler_fakes \ as fakes class ConstraintTestBase(test.NoDBTestCase): """Bas...
# -*- coding: utf-8 -*- """ werkzeug.debug.repr ~~~~~~~~~~~~~~~~~~~ This module implements object representations for debugging purposes. Unlike the default repr these reprs expose a lot more information and produce HTML instead of ASCII. Together with the CSS and JavaScript files of the debug...
# -*- coding: utf-8 -*- from __future__ import print_function from math import sin, cos, atan2, sqrt, radians import numpy as np import scipy.ndimage as im from bokeh.document import Document from bokeh.embed import file_html from bokeh.resources import INLINE from bokeh.browserlib import view from bokeh.models.gl...
"""CLI argument parsing related tests.""" import json # noinspection PyCompatibility import argparse import pytest from requests.exceptions import InvalidSchema from httpie import input from httpie.input import KeyValue, KeyValueArgType, DataDict from httpie import ExitStatus from httpie.cli import parser from utils ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Written in place of AboutBlocks in the Ruby Koans # # Note: Both blocks and generators use a yield keyword, but they behave # a lot differently # from runner.koan import * class AboutGenerators(Koan): def test_generating_values_on_the_fly(self): result =...
""" Middleware to serve assets. """ import logging import datetime log = logging.getLogger(__name__) try: import newrelic.agent except ImportError: newrelic = None # pylint: disable=invalid-name from django.http import ( HttpResponse, HttpResponseNotModified, HttpResponseForbidden, HttpResponseBadRequ...
""" Cimi middleware. """ from nova.openstack.common import log as logging from urllib import unquote from webob import Request from urlparse import urlparse import json import threading from cimiapp.machine import (MachineCtrler, MachineColCtrler) from cimiapp.machineimage import...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests import unittest from ansible.compat.tests.mock import MagicMock from ansible.executor.playbook_executor import PlaybookExecutor from ansible.playbook import Playbook from ansible.template import Templar ...
#!/usr/bin/env python3 # test_reg.py # import time import unittest # from rnglib import SimpleRNG from wireops.enum import FieldTypes from fieldz.reg import NodeReg from fieldz.enum import CoreTypes # TESTS -------------------------------------------------------------- class TestReg(unittest.TestCase): def te...
from flask.ext.admin.contrib.sqla import ModelView from flask.ext import login from flask_wtf import Form from wtforms import validators from models import User class UserView(ModelView): """ ModelView override of Flask Admin for Users. """ # CSRF protection form_base_class = Form # Ensure us...
#!/usr/bin/env python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthe...
import logging import subprocess import sys import unittest from benchexec import check_cgroups sys.dont_write_bytecode = True # prevent creation of .pyc files class TestCheckCgroups(unittest.TestCase): @classmethod def setUpClass(cls): cls.longMessage = True cls.maxDiff = None logg...
#!/usr/bin/env python """ Calculate RMSD between two XYZ files by: Jimmy Charnley Kromann <<EMAIL>> and Lars Andersen Bratholm <<EMAIL>> project: https://github.com/charnley/rmsd license: https://github.com/charnley/rmsd/blob/master/LICENSE """ import numpy as np import re from rna_tools.tools.extra_functions.select...
"""delete English history records over 50 Revision ID: d5126053d47e Revises: bbe219b77366 Create Date: 2019-01-06 18:12:12.357726 """ # revision identifiers, used by Alembic. revision = 'd5126053d47e' down_revision = 'bbe219b77366' import sys import time from alembic import op import sqlalchemy as sa import sqlalch...
"""Do a minimal test of all the modules that aren't otherwise tested.""" from test import support import sys import unittest class TestUntestedModules(unittest.TestCase): def test_at_least_import_untested_modules(self): with support.check_warnings(quiet=True): import bdb import cgi...
import logging import random import time import pyautogui from .constants import slime_blasting_config as config from .components import Button, Mouse logger = logging.getLogger(__name__) start = Button("start.png", config["start"]) character1 = Button("character.png", config["character1"]) skill = Button("skill.p...
""" stubs.py provides interface methods for the database test cases """ import logging from quantum.db import api as db LOG = logging.getLogger('quantum.tests.database_stubs') class QuantumDB(object): """Class conisting of methods to call Quantum db methods""" def get_all_networks(self, tenant_id): ...
"""Template for the external collections search.""" __revision__ = "$Id$" import cgi from invenio.config import CFG_SITE_LANG from invenio.messages import gettext_set_language from invenio.urlutils import create_html_link class Template: """Template class for the external collection search. To be loaded with te...
""" @author: Edwin Smulders @license: GNU General Public License 2.0 or later @contact: <EMAIL> """ import volatility.plugins.linux.pslist as linux_pslist from volatility.renderers.basic import Address from volatility.renderers import TreeGrid class linux_threads(linux_pslist.linux_pslist): """ Prints threads of ...
import unittest from io import StringIO from test import support NotDefined = object() # A dispatch table all 8 combinations of providing # sep, end, and file. # I use this machinery so that I'm not just passing default # values to print, I'm either passing or not passing in the # arguments. dispatch = { (False,...
# Formatter (c) 2002, 2004, 2007, 2008 David Turner <<EMAIL>> # from sources import * from content import * from utils import * # This is the base Formatter class. Its purpose is to convert # a content processor's data into specific documents (i.e., table of # contents, global index, and individual API reference ...
"""Script to convert Caffe .modelfile to MXNet .params file""" from __future__ import print_function import argparse import mxnet as mx import caffe from caffe.proto import caffe_pb2 class CaffeModelConverter(object): """Converts Caffe .modelfile to MXNet .params file""" def __init__(self): self.dict_...
"""Provides input and output functions for Healpix maps, alm, and cl. """ import pyfits as pyf import numpy as npy import pixelfunc from sphtfunc import Alm import warnings from _healpy_pixel_lib import UNSEEN from exceptions import NotImplementedError class HealpixFitsWarning(Warning): pass def read_cl(filename...
# $Id$ import time import imp import sys import inc_const as const from inc_cfg import * # Load configuration cfg_file = imp.load_source("cfg_file", ARGS[1]) # Check media flow between ua1 and ua2 def check_media(ua1, ua2): ua1.send("#") ua1.expect("#") ua1.send("1122") ua2.expect(const.RX_DTMF + "1") ua2.expect...
"""Zoe backend implementation for one or more Docker Engines.""" import logging import re import time from typing import Union from zoe_lib.config import get_conf from zoe_lib.state import Service import zoe_master.backends.base from zoe_master.backends.docker.api_client import DockerClient from zoe_master.backends.d...
from flask import render_template, request, json, send_from_directory from bleach import linkify from app import app, db import models as m @app.route('/') def index(): params = { 'title': 'Hashtag Listener', } return render_template('index.html', **params) @app.route('/api', methods=['POST']) ...
import math import numpy as np import matplotlib import matplotlib.pyplot as plt from scipy.ndimage import zoom from scipy.spatial.distance import cdist from scipy.ndimage.filters import gaussian_filter from numpy.fft import rfft2, ifftshift, irfft2 def extract(Z, position, shape, fill=0): # assert(len(position) =...
"""Wrapper around gym env. Allows for using batches of possibly identitically seeded environments. """ import gym import numpy as np import random import env_spec def get_env(env_str): return gym.make(env_str) class GymWrapper(object): def __init__(self, env_str, distinct=1, count=1, seeds=None): self.d...
# -*- coding: utf-8 -*- """ resolver.py - A fast multi-threaded DNS resolver using the dnspython library Examples: # Importing the library # from fastdns import resolver # Resolving many DNS hosts # >>> from pprint import pprint # >>> r = resolver.Resolver(domain='cisco.com') # >>> r.hostnames...
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, avi_ansible_api, HAS_AVI) except ...
import sys import json import requests import traceback from flask import current_app from flask.ext.wtf import TextField, Required, URL, PasswordField, SelectField from labmanager.forms import AddForm, RetrospectiveForm, GenericPermissionForm from labmanager.rlms import register, Laboratory, BaseRLMS, BaseFormCreat...
from __future__ import absolute_import import sys import re import fnmatch import logging import os import shutil import warnings import zipfile from pip.utils import display_path, backup_dir, rmtree from pip.utils.deprecation import RemovedInPip7Warning from pip.utils.logging import indent_log from pip.exceptions im...
""" Preprocess the CoLA (The Corpus of Linguistic Acceptability) grammar dataset classification task.""" import argparse import csv import os import random import preprocess_utils PREPROCESSED_FILE_PATH = "~/classifier_preprocessed_cola_dataset.tsv" MIXED_FILE_PATH = "~/classifier_mixed_training_set_grammar.tsv" ...
import re from django.template import Library try: from django.utils.encoding import force_text except ImportError: # Django 1.4 compatibility from django.utils.encoding import force_unicode as force_text register = Library() re_widont = re.compile(r'\s+(\S+\s*)$') re_widont_html = re.compile(r'([^<>\s])\s...
""" Support for Nest thermostats. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.nest/ """ import logging import voluptuous as vol import homeassistant.components.nest as nest from homeassistant.components.climate import ( STATE_AUTO, STATE_C...
from oslo_log import log as logging import oslo_messaging import six from neutron.common import constants from neutron.common import rpc as n_rpc from neutron.common import topics from neutron.common import utils from neutron.db import agentschedulers_db from neutron import manager from neutron.plugins.common import c...
from tatoeba2.models import Sentences, SentenceComments, SentencesTranslations, Users, TagsSentences, SentencesSentencesLists, FavoritesUsers, SentenceAnnotations, Contributions, Wall from datetime import datetime from tatoeba2.management.commands.deduplicate import Dedup from django.db import connections from django.d...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class WeiqiTVIE(InfoExtractor): IE_DESC = 'WQTV' _VALID_URL = r'https?://(?:www\.)?weiqitv\.com/index/video_play\?videoId=(?P<id>[A-Za-z0-9]+)' _TESTS = [{ 'url': 'http://www.weiqitv.com/index/video_play?vi...
"""Unit tests for python.py.""" import os import unittest from python import PythonChecker class PythonCheckerTest(unittest.TestCase): """Tests the PythonChecker class.""" def test_init(self): """Test __init__() method.""" def _mock_handle_style_error(self): pass check...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import copy import datetime import pytest import processors.euctr.extractors as extractors class TestEUCTRExtractors(object): def test_stub_...
import json from django.test.client import Client, RequestFactory from django.test.utils import override_settings from mock import patch, MagicMock from courseware.models import XModuleUserStateSummaryField from courseware.tests.factories import UserStateSummaryFactory from courseware.tests.modulestore_config import ...
"""text_file provides the TextFile class, which gives an interface to text files that (optionally) takes care of stripping comments, ignoring blank lines, and joining lines with backslashes.""" import sys, os, io class TextFile: """Provides a file-like object that takes care of all the things you commonl...
""" Writes MIDI events to a MIDI output. """ import contextlib from . import event class Output(object): """Abstract base class for a MIDI output. Inherit to implement the actual writing to MIDI ports. The midiplayer.Player calls midi_event and all_notes_off. """ def midi_event(s...
__author__ = 'Sean Griffin' __version__ = '1.0.0' __email__ = '<EMAIL>' import sys import os.path import json import shutil from pymel.core import * from maya.OpenMaya import * from maya.OpenMayaMPx import * kPluginTranslatorTypeName = 'Three.js' kOptionScript = 'ThreeJsExportScript' kDefaultOptionsString = '0' FL...
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate...
""" flask-bundle-system ------------------- Links ````` * `documentation <http://packages.python.org/flask-bundle-system>`_ * `development version <http://github.com/yograterol/flask-bundle-system/zipball/master>`_ """ from setuptools import setup setup( name='flask-bundle-system', version='0.2', l...
"""Support for tracking the proximity of a device.""" import logging import voluptuous as vol from homeassistant.const import ( CONF_DEVICES, CONF_UNIT_OF_MEASUREMENT, CONF_ZONE) import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.helpers.event i...
import sys import re import fnmatch import os import shutil import zipfile from pip.util import display_path, backup_dir, rmtree from pip.log import logger from pip.exceptions import InstallationError from pip.basecommand import Command class ZipCommand(Command): """Zip individual packages.""" name = 'zip' ...
""" Provide API-callable functions for knowledge base management (using kb's). """ from invenio import bibknowledge_dblayer from invenio.bibformat_config import CFG_BIBFORMAT_ELEMENTS_PATH from invenio.config import CFG_WEBDIR import os import sys import re if sys.hexversion < 0x2060000: try: import simp...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import string from ansible.errors import AnsibleError, AnsibleAssertionError from ansible.module_utils._text import to_bytes, to_native, to_text from ansible.parsing.splitter import parse_kv from ansible.plugins.lookup i...