code
stringlengths
1
199k
import numpy as np from bokeh.document import Document from bokeh.models import ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid from bokeh.models.glyphs import Patch from bokeh.plotting import show N = 30 x1 = np.linspace(-2, 2, N) x2 = x1[::-1] y1 = x1**2 y2 = x2**2 + (x2+2.2) x = np.hstack((x1, x2)) y = np.hsta...
import os import unittest from coverage import coverage cov = coverage(branch = True, omit = ['flask/*', 'tests.py']) cov.start() from config import basedir from app import app, db from app.models import User from datetime import datetime, timedelta from app.models import User, Post class TestCase(unittest.TestCase): ...
__author__ = 'shin' import jieba namelist_answer=[] ''' namelist_answer.append('[slot_name]。') namelist_answer.append('叫[slot_name]。') namelist_answer.append('姓名是[slot_name]。') namelist_answer.append('我是[slot_name]。') namelist_answer.append('您好,我叫[slot_name]。') namelist_answer.append('[slot_name]') namelist_answer.appe...
def g(x): import random return int(x * random.random()) def h(x): return sum(tmap(g, x)) def f(x,y): return x*y x = range(10) y = range(5) if __name__ == '__main__': from pathos.helpers import freeze_support freeze_support() from pathos.pools import ProcessPool, ThreadPool amap = ProcessPool().a...
import re with open('d07.txt') as f: raw_input = f.readlines() test_input = """abba[mnop]qrst abcd[bddb]xyyx aaaa[qwer]tyui ioxxoj[asdfgh]zxcvbn asdfasdf[qwerqwer]asdffdsa[12341234]zcxvzcv""".splitlines() def group_finder(s): head, _, tail = s.partition('[') yield head if tail: yield from group_...
import collections import lxml.objectify import mock import zeit.cms.repository.interfaces import zeit.cms.tagging.interfaces import zeit.cms.tagging.tag import zope.component import zope.interface NAMESPACE = "http://namespaces.zeit.de/CMS/tagging" KEYWORD_PROPERTY = ('testtags', NAMESPACE) class DummyTagger(object): ...
import os import logging import tqdm from urllib.request import urlretrieve, URLError import multiprocessing as mp import itertools import numpy as np log = logging.getLogger(__name__) def download_PHOENIX_models(path, ranges=None, parameters=None): """ Download the PHOENIX grid models from the Goettingen serve...
import sys import os cwd = os.getcwd() project_root = os.path.dirname(cwd) sys.path.insert(0, project_root) import mavlog extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'MAVLog' copyright = u'2014, Gareth R' version = mav...
"""Base class for undirected graphs. The Graph class allows any hashable object as a node and can associate key/value attribute pairs with each undirected edge. Self-loops are allowed but multiple edges are not (see MultiGraph). For directed graphs see DiGraph and MultiDiGraph. """ from copy import deepcopy import netw...
"""See docstring for AndroidSDKVersioner class""" import xml.etree.cElementTree as ET import urllib2 from autopkglib import Processor, ProcessorError __all__ = ["AndroidSDKVersioner"] class AndroidSDKVersioner(Processor): # pylint: disable=missing-docstring description = ("Parse the XML file for the latest version ...
from __future__ import division, print_function, absolute_import import math import types import warnings from . import statlib from . import stats from .stats import find_repeats from . import distributions from numpy import isscalar, r_, log, sum, around, unique, asarray from numpy import zeros, arange, sort, amin, a...
import unittest from catapult_base.dependency_manager import dependency_info class DependencyInfoTest(unittest.TestCase): def testInitRequiredInfo(self): # Must have a dependency, platform and file_path. self.assertRaises(ValueError, dependency_info.DependencyInfo, None, None, None) ...
from csv import DictReader from django.core.management.base import BaseCommand from registrations.models import ClinicCode class Command(BaseCommand): help = ( "This command takes in a CSV with the columns: uid, code, facility, province," "and location, and creates/updates the cliniccodes in the dat...
from django.conf import settings REDMINE_SERVER_URL = getattr(settings, 'REDMINE_SERVER_URL', 'https://localhost')
from traits.api import Bool, Float, Tuple from tvtk.api import tvtk from .volume_scene_member import ABCVolumeSceneMember FloatPair = Tuple(Float, Float) class VolumeAxes(ABCVolumeSceneMember): """ An object which builds a CubeAxesActor for a scene containing a Volume. """ # If True, show the minor tick mar...
from __future__ import unicode_literals try: import unittest2 as unittest except ImportError: import unittest from rpaths import unicode, PY3, AbstractPath, PosixPath, WindowsPath class TestAbstract(unittest.TestCase): def test_construct(self): """Tests building an AbstractPath.""" with self...
import unittest from exporters.readers.base_reader import BaseReader from exporters.readers.random_reader import RandomReader from .utils import meta class BaseReaderTest(unittest.TestCase): def setUp(self): self.reader = BaseReader({}, meta()) def test_get_next_batch_not_implemented(self): with...
"""Accessors for Amber TI datasets. """ from os.path import dirname, join from glob import glob from .. import Bunch def load_bace_improper(): """Load Amber Bace improper solvated vdw example Returns ------- data: Bunch Dictionary-like object, the interesting attributes are: - 'data' : t...
import sys from django.core.management.base import BaseCommand from ietf.community.constants import SIGNIFICANT_STATES from ietf.community.models import DocumentChangeDates from ietf.doc.models import Document class Command(BaseCommand): help = (u"Update drafts in community lists by reviewing their rules") def ...
""" Utilities and helper functions """ def get_object_or_none(model, **kwargs): try: return model.objects.get(**kwargs) except model.DoesNotExist: return None
""" Utility module to determine the OS Python running on -------------------------------------------------------------------------- File: utilsOsType.py Overview: Python module to supply functions and an enumeration to help determine the platform type, bit size and OS curre...
from taptaptap.proc import plan, ok, not_ok, out plan(first=1, last=13) ok('Starting the program') ok('Starting the engine') ok('Find the object') ok('Grab it', todo=True) ok('Use it', todo=True) 2 * 2 == 4 and ok('2 * 2 == 4') or not_ok('2 * 2 != 4') out()
import logging import matplotlib as mpl from .tools import get_figure_size _logger = logging.getLogger("mpl_settings") orig_settings = {**mpl.rcParams} latex_settings = { # change this if using contex, xetex or lualatex "pgf.texsystem": "pdflatex", # use LaTeX to write all text "text.usetex": True, ...
{% if cookiecutter.use_celery == 'y' %} import os from celery import Celery from django.apps import apps, AppConfig from django.conf import settings if not settings.configured: # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.loc...
import numpy as np def multiprod(A, B): """ Inspired by MATLAB multiprod function by Paolo de Leva. A and B are assumed to be arrays containing M matrices, that is, A and B have dimensions A: (M, N, P), B:(M, P, Q). multiprod multiplies each matrix in A with the corresponding matrix in B, using matr...
import os import sys import json import time import numpy import dendropy from collections import defaultdict import pdb def parse_site_rates(rate_file, correction = 1, test = False, count = 0): """Parse the site rate file returned from hyphy to a vector of rates""" # for whatever reason, when run in a virtuale...
import sys print "Gene\tTranscript\tExpression" for l in sys.stdin: t = l.strip().split('\t') if float(t[2]) > 1.1: print '\t'.join(t[0:3])
from django.shortcuts import render from django.views.generic.base import TemplateView from django.views.generic.list import ListView from django.views.generic.detail import DetailView from django.contrib.syndication.views import Feed from django.utils.feedgenerator import Atom1Feed from blog.models import Post from ta...
"""Polynomial factorization routines in characteristic zero. """ from __future__ import print_function, division from sympy.polys.galoistools import ( gf_from_int_poly, gf_to_int_poly, gf_lshift, gf_add_mul, gf_mul, gf_div, gf_rem, gf_gcdex, gf_sqf_p, gf_factor_sqf, gf_factor) from sympy.polys.d...
from djangocms_text_ckeditor.models import Text from django.contrib.admin.sites import site from django.contrib.admin.utils import unquote from django.contrib.auth import get_user_model from django.contrib.auth.models import AnonymousUser, Group, Permission from django.contrib.sites.models import Site from django.core....
import logging class Error(Exception): def __init__(self, message, data = {}): self.message = message self.data = data def __str__(self): return self.message + ": " + repr(self.data) @staticmethod def die(code, error, message = None): if isinstance(error, Exception): ...
""" flask.ctx ~~~~~~~~~ Implements the objects required to keep the context. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import with_statement import sys from functools import update_wrapper from werkzeug.exceptions import HTTPException fr...
from gevent import Greenlet from gevent import sleep from .base import SchedulerMixin class Scheduler(SchedulerMixin, Greenlet): """ Gevent scheduler. Only replaces the sleep method for correct context switching. """ def sleep(self, seconds): sleep(seconds) def return_callback(self, *arg...
from __future__ import absolute_import, division, print_function from collections import Iterator from flask import Flask, request, jsonify, json from functools import partial, wraps from .index import parse_index class Server(object): __slots__ = 'app', 'datasets' def __init__(self, name='Blaze-Server', datase...
import time import os.path from collections import OrderedDict, namedtuple import gevent import flask from digits import device_query from digits.task import Task from digits.utils import subclass, override PICKLE_VERSION = 2 NetworkOutput = namedtuple('NetworkOutput', ['kind', 'data']) @subclass class TrainTask(Task):...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Anscombe'] , ['Lag1Trend'] , ['Seasonal_WeekOfYear'] , ['SVR'] );
from setuptools import setup, find_packages from orotangi import __version__ as version install_requires = [ 'Django==1.11.18', 'djangorestframework==3.6.2', 'django-cors-headers==2.0.2', 'django-filter==1.0.2', 'python-dateutil==2.6.0' ] setup( name='orotangi', version=version, descript...
""" An interface to the zhuyin <-> pinyin table. """ from functools import partial from . import cjkdata from cjktools.common import get_stream_context, stream_codec def _default_stream(): return open(cjkdata.get_resource('tables/zhuyin_pinyin_conv_table')) _get_stream_context = partial(get_stream_context, _default...
import tests.periodicities.period_test as per per.buildModel((24 , 'BH' , 50));
from django.http import HttpRequest import mock import pytest from nose.tools import assert_false from olympia import amo from olympia.amo.tests import TestCase, req_factory_factory from olympia.amo.urlresolvers import reverse from olympia.addons.models import Addon, AddonUser from olympia.users.models import UserProfi...
import collections import difflib import inspect import logging import os.path import warnings import os import importlib import cherrypy import yaml from yaml import load try: from yaml import CLoader as Loader except ImportError: from yaml import Loader json = None for pkg in ['ujson', 'yajl', 'simplejson', '...
import os import sys import shutil setup = os.path.abspath(sys.argv[0]) parent = os.path.dirname(setup) pkg = os.path.basename(parent) if pkg.startswith("py-mapzen"): pkg = pkg.replace("py-", "") pkg = pkg.replace("-", ".") egg_info = "%s.egg-info" % pkg egg_info = os.path.join(parent, egg_info) if ...
from productos.models import Categoria, Imagen from django.contrib import admin from imagekit.admin import AdminThumbnail class ImagenAdmin(admin.ModelAdmin): imagen = AdminThumbnail(image_field='imagen_miniatura') list_display = ('nombre', 'categoria','imagen') admin.site.register(Categoria) admin.site.registe...
from unittest import TestCase, main from qiita_core.exceptions import IncompetentQiitaDeveloperError from qiita_core.util import qiita_test_checker from qiita_core.qiita_settings import qiita_config import qiita_db as qdb @qiita_test_checker() class QiitaBaseTest(TestCase): """Tests that the base class functions ac...
import datetime from mock import patch from pretend import stub from gurtel import session def test_annotates_request(): """Annotates request with ``session`` property.""" request = stub( cookies={}, app=stub(secret_key='secret', is_ssl=True, config={}), ) session.session_middleware(...
""" Django settings for LittleSportsBiscuit project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ from __future__ import absolute_import, unicode_literals import e...
"""ZFS based backup workflows.""" import datetime import shlex import gflags import lvm import workflow FLAGS = gflags.FLAGS gflags.DEFINE_string('rsync_options', '--archive --acls --numeric-ids --delete --inplace', 'rsync command options') gflags.DEFINE_string('rsync_path', '/...
from django.contrib import admin from workflow.models import State, StateLog, NextState, Project, Location from workflow.activities import StateActivity class NextStateInline(admin.StackedInline): model = NextState fk_name = 'current_state' extra = 0 class StateAdmin(admin.ModelAdmin): inlines = [NextSt...
""" A class used for computing different types of drug descriptors! You can freely use and distribute it. If you have any problem, you could contact with us timely. Authors: Dongsheng Cao and Yizeng Liang. Date: 2012.09.24 Email: oriental-cds@163.com """ import string from rdkit import Chem from PyBioMed.PyGetMol impor...
import datetime import Adafruit_BBIO.GPIO as GPIO import tornado.gen class Baster(object): """ Controller for the baster """ def __init__(self, baster_pin): """ Initializes the controller for a baster and sets it closed :param baster_pin: The BBB GPIO to use, e.g. P8_14 :...
""" WSGI config for jobboardscraper project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_S...
import datetime import json import os import shutil from django.conf import settings from django.core.files.storage import default_storage as storage from django.core.urlresolvers import reverse import mock from nose.tools import eq_, ok_ from pyquery import PyQuery as pq import mkt from mkt.constants.applications impo...
import json from djpcms import test from djpcms.plugins.text import Text class Editing(test.TestCase): def setUp(self): super(Editing,self).setUp() p = self.get()['page'] p.set_template(p.create_template('thre-columns', '{{ content0 }} {{ content1 }} ...
default_app_config = 'wagtail_commons.core.apps.WagtailCommonsCoreConfig'
""" Filename: robustlq.py Authors: Chase Coleman, Spencer Lyon, Thomas Sargent, John Stachurski Solves robust LQ control problems. """ from __future__ import division # Remove for Python 3.sx import numpy as np from lqcontrol import LQ from quadsums import var_quadratic_sum from numpy import dot, log, sqrt, identity, ...
from omnibus.factories import websocket_connection_factory def mousemove_connection_factory(auth_class, pubsub): class GeneratedConnection(websocket_connection_factory(auth_class, pubsub)): def close_connection(self): self.pubsub.publish( 'mousemoves', 'disconnect', ...
from reports.accidents.models import *
""" Client for the library API. """ class LibraryClient(object): """ Library API client. """ def __init__(self,axilent_connection): self.content_resource = axilent_connection.resource_client('axilent.library','content') self.api = axilent_connection.http_client('axilent.library') def...
from __future__ import print_function, absolute_import, division import numpy as np import pandas as pd from toolz import partition def loc(df, ind): return df.loc[ind] def index_count(x): # Workaround since Index doesn't implement `.count` return pd.notnull(x).sum() def mean_aggregate(s, n): try: ...
from __future__ import unicode_literals import itertools import os import re from django import forms from django.conf import settings as django_settings from django.contrib import messages from django.contrib.admin import helpers from django.contrib.admin.util import quote, unquote, capfirst from django.core.exception...
import sys import time import json import logging import random import tornado.options from tornado.options import define, options from tornado import gen define('srp_root',default='http://192.168.56.1') define('debug',default=True) define('verbose',default=1, type=int) tornado.options.parse_command_line() if options.d...
from __future__ import absolute_import import os import time from math import pi import numpy as nm from sfepy.base.base import Struct, output, get_default from sfepy.applications import PDESolverApp from sfepy.solvers import Solver from six.moves import range def guess_n_eigs(n_electron, n_eigs=None): """ Gues...
""" calabar.tunnels This module encapsulates various tunnel processes and their management. """ import signal import os import sys import psi.process TUN_TYPE_STR = 'tunnel_type' # Configuration/dictionary key for the type of tunnel PROC_NOT_RUNNING = [ psi.process.PROC_STATUS_DEAD, psi.process.PROC_STATUS_ZOMB...
__author__ = 'swhite' """ This package contains the test modules for the repository app of the ReFlow project, organized by test type (unit, integration, etc.) To run all the tests in the repository app, using the manage.py command: "python manage.py test repository". Notes: - add new test constants in the constants mo...
from django.conf.urls.defaults import * from availablejob.views import * urlpatterns = patterns("availablejob.views", url(r"^sendcv/$",send_cv), url(r"^detail/(?P<id>\d+)/$", 'detail',name="job-detail"), url(r"^apply/(?P<id>\d+)/$", 'show_form',name="show-form"), url(r"^$", 'index', name="vacancy-in...
""" Image processing and feature extraction functions. """ import cv2 import numpy as np def pad_image(im, width, height, border=255): """pad char image in a larger image""" xoff = abs(int((im.shape[1] - width) / 2)) yoff = abs(int((im.shape[0] - height) / 2)) if width >= im.shape[1]: x_min_old ...
import argparse import contextlib import logging import os import subprocess import sys _SRC_ROOT = os.path.abspath( os.path.join(os.path.dirname(__file__), '..', '..', '..', '..')) sys.path.append(os.path.join(_SRC_ROOT, 'third_party', 'catapult', 'devil')) from devil import base_error from devil.android import de...
"""A simple, direct connection to the vtgate proxy server, using gRPC. """ import logging import re from urlparse import urlparse import google.protobuf # pylint: disable=unused-import from grpc.beta import implementations from grpc.beta import interfaces from grpc.framework.interfaces.face import face from vtproto im...
import json import logging import os import pickle import sys import uuid from unittest.mock import Mock, PropertyMock, patch, MagicMock, ANY import celery import yaml from billiard.einfo import ExceptionInfo from django.conf import settings from django.contrib.auth.models import Group, User from django.contrib.gis.geo...
import polyadcirc.run_framework.domain as dom import polyadcirc.pyGriddata.manufacture_gap as manu grid_dir = '.' domain = dom.domain(grid_dir) domain.read_spatial_grid() x_values = [n.x for n in domain.node.values()] y_values = [n.y for n in domain.node.values()] xr = max(x_values) xl = min(x_values) yu = max(y_values...
import zlib import struct import time def parse_encoding_header(header): """ Break up the `HTTP_ACCEPT_ENCODING` header into a dict of the form, {'encoding-name':qvalue}. """ encodings = {'identity':1.0} for encoding in header.split(","): if(encoding.find(";") > -1): encoding...
from django.contrib import admin from .models import Topping, Pizza class ToppingInlineAdmin(admin.TabularInline): model = Topping extra = 1 class PizzaAdmin(admin.ModelAdmin): fieldsets = ( ('', { 'fields': ('description',), }), ('Advanced', { 'classes': ('co...
"""The :class:`FunctionalTester` object provides a higher-level interface to working with a Trac environment to make test cases more succinct. """ import io import re from trac.tests.functional import internal_error from trac.tests.functional.better_twill import tc, b from trac.tests.contentgen import random_page, rand...
import numpy as np from numpy.testing import assert_equal, assert_array_equal from scipy.stats import rankdata, tiecorrect class TestTieCorrect(object): def test_empty(self): """An empty array requires no correction, should return 1.0.""" ranks = np.array([], dtype=np.float64) c = tiecorrect...
""" COMMAND-LINE SPECIFIC STUFF ============================================================================= """ import markdown import sys import optparse import logging from logging import DEBUG, INFO, CRITICAL logger = logging.getLogger('MARKDOWN') def parse_options(): """ Define and parse `optparse` optio...
''' Created on 2013-7-21 @author: hujin ''' import sys from PySide.QtGui import QApplication from mdeditor.ui.window import MainWindow class Application(QApplication): def __init__(self): ''' Constructor ''' super(Application, self).__init__(sys.argv) def run(self): ''' ...
from rauth import OAuth1Service, OAuth2Service from flask import current_app, url_for, request, redirect, session import json class OAuthSignIn(object): providers = None def __init__(self, provider_name): self.provider_name = provider_name credentials = current_app.config['OAUTH_CREDENTIALS'][pr...
import glob import os import signal import shutil import time import unittest import test_base class DaemonTests(test_base.ProcessGenerator, unittest.TestCase): @test_base.flaky def test_1_daemon_without_watchdog(self): daemon = self._run_daemon({ "disable_watchdog": True, "disab...
import os import sys import time import itertools def get_sleeper(): if os.isatty(sys.stdout.fileno()): return PrettySleeper() return Sleeper() _PROGRESS_WIDTH = 50 _WATCHING_MESSAGE = "Watching for changes... " _PROGRESS_BAR = [ _WATCHING_MESSAGE + "".join('>' if offset == position else ' ' for off...
"""Code for performing requests""" import json import logging import urllib.request import zlib from urllib.error import HTTPError import requests from defusedxml import ElementTree from scout.constants import CHROMOSOMES, HPO_URL, HPOTERMS_URL from scout.utils.ensembl_rest_clients import EnsemblBiomartClient LOG = log...
emails = sorted(set([line.strip() for line in open("email_domains.txt")])) for email in emails: print("'{email}',".format(email=email))
import rocksdb, pointless, random, string, itertools, collections from twisted.internet import reactor, defer, threads def compare(a, b): return cmp(a, b) c = 'bytewise' c = ('rocksdb.BytewiseComparator', compare) kw = { 'create_if_missing': True, 'error_if_exists': False, 'paranoid_checks': False, 'block_cache_si...
""" Copyright (c) 2014, Kersten Doering <kersten.doering@gmail.com>, Bjoern Gruening <bjoern.gruening@gmail.com> """ import xappy searchConn = xappy.SearchConnection("xapian/xapian2015") searchConn.reopen() querystring1 = "scaffolds" querystring2 = "finger" terms = querystring1.split(' ') querystring1 = " NEAR/3 "....
import argparse import docker import logging import os import docket logger = logging.getLogger('docket') logging.basicConfig() parser = argparse.ArgumentParser(description='') parser.add_argument('-t --tag', dest='tag', help='tag for final image') parser.add_argument('--verbose', dest='verbose', action='store_true', h...
_b32alphabet = { 0: 'A', 9: 'J', 18: 'S', 27: '3', 1: 'B', 10: 'K', 19: 'T', 28: '4', 2: 'C', 11: 'L', 20: 'U', 29: '5', 3: 'D', 12: 'M', 21: 'V', 30: '6', 4: 'E', 13: 'N', 22: 'W', 31: '7', 5: 'F', 14: 'O', 23: 'X', 6: 'G', 15: 'P', 24: 'Y', 7: 'H', 16: 'Q', 25: 'Z', 8: 'I', 17: 'R...
from openturns import * TESTPREAMBLE() RandomGenerator.SetSeed(0) try: # Instanciate one distribution object dimension = 3 meanPoint = NumericalPoint(dimension, 1.0) meanPoint[0] = 0.5 meanPoint[1] = -0.5 sigma = NumericalPoint(dimension, 1.0) sigma[0] = 2.0 sigma[1] = 3.0 R = Correl...
doTimingAttackMitigation = False import base64 import errno import math import time import threading import shared import hashlib import os import select import socket import random import ssl from struct import unpack, pack import sys import traceback from binascii import hexlify from addresses import * from class_obj...
from iris_sdk.models.maps.base_map import BaseMap class CitiesMap(BaseMap): result_count = None cities = None
"""Test various fingerprinting protections. If a stale block more than a month old or its header are requested by a peer, the node should pretend that it does not have it to avoid fingerprinting. """ import time from test_framework.blocktools import (create_block, create_coinbase) from test_framework.messages import CI...
import unittest from wechatpy.replies import TextReply, create_reply class CreateReplyTestCase(unittest.TestCase): def test_create_reply_with_text_not_render(self): text = "test" reply = create_reply(text, render=False) self.assertEqual("text", reply.type) self.assertEqual(text, repl...
""" tests specific to "pip install --user" """ import os import textwrap from os.path import curdir, isdir, isfile import pytest from pip._internal.compat import cache_from_source, uses_pycache from tests.lib import pyversion from tests.lib.local_repos import local_checkout def _patch_dist_in_site_packages(script): ...
from flask_restplus import Namespace, Resource from flask import current_app from cea.glossary import read_glossary_df api = Namespace('Glossary', description='Glossary for variables used in CEA') @api.route('/') class Glossary(Resource): def get(self): glossary = read_glossary_df(plugins=current_app.cea_co...
""" Landing pages administration module =============================================== .. module:: landingpages.admin :platform: Django :synopsis: Landing pages administration module .. moduleauthor:: (C) 2015 Oliver Gutiérrez """ from django.contrib import admin from sitetools.admin import BaseModelAdmin from...
""" General utilities used by the stats package. """ __all__ = ['add_partial', 'coroutine','minmax'] import collections import functools import itertools import math class StatsError(ValueError): pass def sorted_data(func): """Decorator to sort data passed to stats functions.""" @functools.wraps(func) d...
import _plotly_utils.basevalidators class TickformatstopsValidator(_plotly_utils.basevalidators.CompoundArrayValidator): def __init__( self, plotly_name="tickformatstops", parent_name="contour.colorbar", **kwargs ): super(TickformatstopsValidator, self).__init__( plotly_name=plotly_n...
from requests import Request from oauthlib.common import unquote from requests_oauthlib import OAuth1 from requests_oauthlib.oauth1_auth import SIGNATURE_TYPE_BODY from tool_base import ToolBase from launch_params import LAUNCH_PARAMS_REQUIRED from utils import parse_qs, InvalidLTIConfigError, generate_identifier class...
from __future__ import absolute_import, print_function, unicode_literals import re import json import tempfile import toml import os class RequirementsTXTUpdater(object): SUB_REGEX = r"^{}(?=\s*\r?\n?$)" @classmethod def update(cls, content, dependency, version, spec="==", hashes=()): """ Up...
"""Ttk wrapper. This module provides classes to allow using Tk themed widget set. Ttk is based on a revised and enhanced version of TIP #48 (http://tip.tcl.tk/48) specified style engine. Its basic idea is to separate, to the extent possible, the code implementing a widget's behavior from the code implementing its appea...
"""Doctest for method/function calls. We're going the use these types for extra testing >>> from UserList import UserList >>> from UserDict import UserDict We're defining four helper functions >>> def e(a,b): ... print a, b >>> def f(*a, **k): ... print a, test_support.sortdict(k) >>...
from asposebarcode import Settings from com.aspose.barcoderecognition import BarCodeReadType from com.aspose.barcoderecognition import BarCodeReader class GetBarcodeRecognitionQuality: def __init__(self): dataDir = Settings.dataDir + 'WorkingWithBarcodeRecognition/AdvancedBarcodeRecognitionFeatures/GetBarco...