content
string
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'wirock_extended.ui' # # by: PyQt4 UI code generator 4.10.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(...
"""Module defining the Sqlite3Connector class.""" from dc.connector import DataConnector from dc.sqlite3.configuration import Sqlite3Configuration from dc.sqlite3.driver import Sqlite3Driver from dc.sqlite3.query_manager import Sqlite3QueryManager from dc.sqlite3.repository_manager import Sqlite3RepositoryManager cla...
""" This script defines a Command extension to the OSGI console. The example Command prints some Jython platform details to the console output. """ import platform from core.osgi import register_service, unregister_service from org.eclipse.smarthome.io.console.extensions import AbstractConsoleCommandExtension from co...
import os import sys import uuid from tuskarclient import exc from tuskarclient.openstack.common import importutils def define_commands_from_module(subparsers, command_module): '''Find all methods beginning with 'do_' in a module, and add them as commands into a subparsers collection. ''' for method_...
#!/usr/bin/env python import logging import os import sys import signal from umobj.handler_queue import HandlerQueue from contextlib import contextmanager from boto.exception import S3ResponseError @contextmanager def boto_error_handler(): '''Errors are caught in order for most to least specific''' try: ...
''' Copyright (c) 2014, NIALL FREDERICK WEEDON All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the f...
from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.contrib import admin admin.autodiscover() from django.views.generic import TemplateView from periodicals.sitemaps import sitemaps_at urlpatterns = \ patterns('', ...
from unittest import mock import pytest from mitmproxy import contentviews from mitmproxy.exceptions import ContentViewException from mitmproxy.net.http import Headers from mitmproxy.test import tutils from mitmproxy.test import tflow class TestContentView(contentviews.View): name = "test" content_types = ["...
from django.db import models # Create your models here. from utils_plus.abstracts import CheckDeletableModelMixin from utils_plus.choices import ChoicesEnum from utils_plus.models import QueryManager from utils_plus.fields import ChoicesEnumField class Title(ChoicesEnum): mr = 'Mr.' ms = 'Ms.' mrs = 'Mrs...
from __future__ import unicode_literals __author__ = 'lexxodus' from dummies.wd_unbalanced import event_handler from dummies.wd_unbalanced.game_objects import Answer, Base, Question, Quiz, Player, Team from dummies.wd_unbalanced.word_domination import WordDomination from random import choice, randint, random, shuffle ...
# -*- coding: utf-8 -*- """ Created on Wed Aug 30 17:28:37 2017 @author: carlos.arana Descripcion: Creación de parámetro P0902 "Arbolado Urbano" """ # Librerias Utilizadas import pandas as pd import numpy as np import sys # Librerias locales utilizadas module_path = r'D:\PCCS\01_Dmine\Scripts' if module_path not in...
# Import a whole load of stuff from System.IO import * from System.Drawing import * from System.Runtime.Remoting import * from System.Threading import * from System.Windows.Forms import * from System.Xml.Serialization import * from System import * from DAQ.Environment import * import time def SMGo(): fileSystem = E...
import os import pdb import sys import tempfile sys.path.append("/opt/tosca") from translator.toscalib.tosca_template import ToscaTemplate import pdb from core.models import Slice,User,Network,NetworkTemplate,NetworkSlice,Service,Tenant from xosresource import XOSResource class XOSNetwork(XOSResource): provides ...
import unittest from random import choice from pluggdapps.plugin import PluginMeta, plugins, pluginname from pluggdapps.platform import Pluggdapps class Test_Plugin( unittest.TestCase, Singleton ): def test( self ): self.test_pluginmeta() super().test() #---- Test cases def te...
""" Existing users can log in using a PUT request at ``/login``: .. testsetup:: >>> _ = getfixture('db_session') >>> Principal = getfixture('principals').Principal >>> _ = Principal(email=u'<EMAIL>', password=u'alice', ... firstname=u'Alice', lastname=u'Kingsleigh') >>> browser = getfixture(...
from __future__ import absolute_import, division, print_function, \ unicode_literals from collections import OrderedDict, namedtuple from astropy import coordinates from astropy.units import degree, hourangle, UnitsError from ..error import UserError class CoordSystem(object): """ Coordinate system enu...
# -*- coding: utf-8 -*- delivery={'weight': '15.0', 'pec_bar': u'7Q197110>59647441500001032', 'suivi_bar': u'7Q5>53894000038', 'cab_prise_en_charge': u'7Q1 97110 964744 1500 001032', 'date': '12/05/2014', 'cab_suivi': u'7Q 53894 00003 8', 'ref_client': u'OUT/00013', 'Instructions': ''} sender={'city': u'city', 'accou...
import os import paramiko def ssh_connection_allowing_proxy_jump(target_user, target_host): """ Uses paramiko package to connect to a remote machine via ssh either directly or through an intermediary machine specified using a proxyjump in the current user's ssh config file. """ # load and par...
# -*- coding: utf-8 -*- from __future__ import (division, absolute_import, unicode_literals, print_function) # flake8: noqa (unused import and line too long due to links) import os import random import string import struct import wave try: import unittest except ImportError: import u...
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import with_statement import re import sys from glob import glob from os import path from subprocess import Popen, PIPE from sys import argv # Local module: generator for texture lookup builtins from texture_builtins import generate_texture_functions builtin...
from urllib.parse import urlparse import scrapy from feeds.loaders import FeedEntryItemLoader from feeds.spiders import FeedsSpider from feeds.utils import generate_feed_header class WienerZeitungAtSpider(FeedsSpider): name = "wienerzeitung.at" _titles = {} _ressorts = set() def start_requests(sel...
# -*- coding: utf-8 -*- ''' premiumizer Add-on Copyright (C) 2016 premiumizer This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at...
"""Utility functions for testing neurodsp functions.""" from functools import wraps import numpy as np import matplotlib.pyplot as plt ################################################################################################### ##################################################################################...
"""Contains low-level implementation details which aren't consumed directly by users of the Kinect API""" import ctypes from pykinect.nui import KinectError, _NUIDLL from pykinect.nui.structs import (ImageFrame, ImageResolution, ImageType, ImageViewArea, SkeletonFrame, ...
""" Python implementation of the fast ICA algorithms. Reference: Tables 8.3 and 8.4 page 196 in the book: Independent Component Analysis, by Hyvarinen et al. """ # Authors: Pierre Lafaye de Micheaux, Stefan van der Walt, Gael Varoquaux, # Bertrand Thirion, Alexandre Gramfort, Denis A. Engemann # License: BS...
import proto # type: ignore __protobuf__ = proto.module( package="google.ads.googleads.v8.enums", marshal="google.ads.googleads.v8", manifest={"CampaignSharedSetStatusEnum",}, ) class CampaignSharedSetStatusEnum(proto.Message): r"""Container for enum describing types of campaign shared set stat...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): depends_on = ( ("account", "0001_initial"), ) def forwards(self, orm): # Adding model 'De...
import sys, os, pwd, signal, time from resource_management import * class Node(Script): def install(self, env): # Install packages listed in metainfo.xml self.install_packages(env) import params Directory(params.traf_conf_dir, mode=0755, owner = params.traf_user, ...
import roslib; roslib.load_manifest('opt_calibration') import rospy import rospkg from opt_msgs.srv import * from geometry_msgs.msg import Transform, Vector3, Quaternion class DetectionInitializer : def __init__(self) : network = rospy.get_param('~network') calib_parameters = rospy.get_param('~poses') ...
import re import datetime import time import sickbeard import generic import urllib from sickbeard.common import Quality, cpu_presets from sickbeard import logger from sickbeard import tvcache from sickbeard import db from sickbeard import classes from sickbeard import helpers from sickbeard import show_name_helpers f...
import logging import subprocess from message.Message import Message from message.CompletedProcessMessage import CompletedProcessMessage logger = logging.getLogger(__name__) class RunProcessMessage(Message): def __init__(self, payload): if not isinstance(payload, dict) or 'args' not in payload \ ...
#pylint: disable=no-init,invalid-name from __future__ import (absolute_import, division, print_function) from mantid.api import * from mantid.simpleapi import * from mantid.kernel import * class LRSubtractAverageBackground(PythonAlgorithm): def category(self): return "Reflectometry\\SNS" def name(se...
import pandas as pd from numba import njit @njit def series_rolling_sum(): series = pd.Series([4, 3, 5, 2, 6]) # Series of 4, 3, 5, 2, 6 out_series = series.rolling(3).sum() return out_series # Expect series of NaN, NaN, 12.0, 10.0, 13.0 print(series_rolling_sum())
def xget(data, columns, default=None, seq=True): '''if seq==True data is treated as sequence of data, otherwise data is single dict or list if columns is sequence, xget returns projection of data sequence containing only that columns if columns is string, xget treats it like 'a.b.c.d' field indirectio...
# -*- coding: utf-8 -*- import redis from flask import Flask, render_template from .api import api from .admin import admin from .website import website from .utils import INSTANCE_FOLDER_PATH from .config import DefaultConfig from .logger import logger from .redis_service import RedisService from .exception import...
import csv import os import scrapy NodePathList = [] LeafPathList = [] with open('RootPath.dat', 'r') as myfile: root = (myfile.read()).replace("\n", "") # read root path from RootPath.dat; NodePathLayer = [root] NodePathList.append(root) while(len(NodePathLayer) > 0): NodePathListNew = [] for element in NodeP...
# -*- coding: utf-8 -*- ######################################################################### ## This scaffolding model makes your app work on Google App Engine too ## File is released under public domain and you can use without limitations ######################################################################### ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from PIL import Image from django import forms from captcha.fields import CaptchaField from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm, AuthenticationForm from .models import Profile from...
#!/usr/local/bin/python2.7 from sys import exit from os import environ, system environ['KERAS_BACKEND'] = 'tensorflow' environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" environ["CUDA_VISIBLE_DEVICES"] = "" import numpy as np from keras.models import Model, load_model from subtlenet import config from subtlenet.genera...
import uncertainties from uncertainties import ufloat import math import numpy import numpy import pylab from scipy.optimize import curve_fit import math import scipy.stats #Misuro a mano con il tester i valori che poi vado a mettere nel file, posso anche lasciare lo sfasamento vuoto def linear(x, a, b): return a*x+...
import json import unittest from embedded_jubatus import Graph from jubatus.graph.types import Edge from jubatus.graph.types import Node from jubatus.graph.types import PresetQuery from jubatus.graph.types import ShortestPathQuery CONFIG = { "parameter": { "damping_factor": 0.9, "landmark_num": 5...
import numpy as np import pytest from pandas.core.dtypes.common import is_datetime64_dtype, is_timedelta64_dtype from pandas.core.dtypes.dtypes import DatetimeTZDtype import pandas as pd from pandas import CategoricalIndex, Series, Timedelta, Timestamp import pandas._testing as tm from pandas.core.arrays import ( ...
''' - login and get token - process 2FA if 2FA is setup for this account - Resets the forgotten password with new password ''' import requests import json get_token_url = "https://api.canopy.cloud:443/api/v1/sessions/" validate_otp_url = "https://api.canopy.cloud:443/api/v1/sessions/otp/validate.json" #calling the ...
from dasbus.server.interface import dbus_interface from dasbus.typing import * # pylint: disable=wildcard-import from pyanaconda.modules.common.base.base_template import InterfaceTemplate from pyanaconda.modules.common.constants.objects import STORAGE_CHECKER __all__ = ["StorageCheckerInterface"] @dbus_interface(ST...
import sched import threading import time import types from django.utils import importlib from dumbwaiter import app_settings from dumbwaiter.models import CachedResult, ErrorReport class Dumbwaiter(object): def __init__(self, functions=None): if functions is None: functions = app_settings.FUNC...
''' Usage splitfm.py featurematrix.fm targetfeature ''' import sys import csv def main(): fm = sys.argv[1] target = sys.argv[2] fo = open(fm) featurereader=csv.reader(fo, delimiter='\t') clasis={} for row in featurereader: if row[0]==target: for i,v in enumerate(row): if i > 0: if not v in clasis:...
import os import requests # pip install requests # The authentication key (API Key). # Get your own by registering at https://app.pdf.co/documentation/api API_KEY = "******************************************" # Base URL for PDF.co Web API requests BASE_URL = "https://api.pdf.co/v1" # Source PDF file SourceFile = "....
import sys import json import logging from pcs import settings, utils from pcs.cli.common.env_cli import Env from pcs.cli.common.lib_wrapper import Library from pcs.cli.common.reports import ( build_report_message, LibraryReportProcessorToConsole, ) from pcs.common import report_codes from pcs.lib.errors impor...
from django.views.generic import UpdateView, CreateView from extra_views import UpdateWithInlinesView, CreateWithInlinesView # ################ # ## Mixins ## # ################ class UpdateWithModifiedByMixin(UpdateView): def post(self, request, *args, **kwargs): res = super(UpdateWithModifiedByMix...
"""ggrc.login.noop Login as example user for development mode. """ import flask_login import json from flask import url_for, redirect, request, session, g, flash default_user_name = 'Example User' default_user_email = '<EMAIL>' def get_user(): if 'X-ggrc-user' in request.headers: json_user = json.loads(reques...
import chartkick from flask import Flask from flask.ext.bootstrap import Bootstrap from flask.ext.mail import Mail from flask.ext.moment import Moment from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import LoginManager from flask.ext.pagedown import PageDown from config import config bootstrap = Boot...
from __future__ import print_function, division from sympy.core import sympify, Lambda, Dummy, Integer, Rational, oo, Float, pi from sympy.core.compatibility import xrange from sympy.functions import sqrt, exp, erf from sympy.printing import sstr from sympy.utilities import default_sort_key import random class Samp...
#!/usr/bin/python """This module solves the challenge for Spotippos. Example requests: * http://{host}:{port}/garbanzo-api/provinces * http://{host}:{port}/garbanzo-api/properties * http://{host}:{port}/garbanzo-api/properties/2 * http://{host}:{port}/garbanzo-api/properties?ax=630&ay=680&bx=685&by=675 """ import urll...
import datetime import re import sys from pip._vendor.toml.decoder import InlineTableDict if sys.version_info >= (3,): unicode = str def dump(o, f): """Writes out dict as toml to a file Args: o: Object to dump into toml f: File descriptor where the toml should be stored Returns: ...
from Tools import * from Agent import * def do1b(address): pass def do2a(address, cycle): self = address # if necessary maxY = 15 # max on Y axis # ask each agent, without parameters # print "Time = ", cycle, "ask all agents to report position and attention" # askEachAgentInCollection(add...
""" This testcase is used to test the REST API in api/caconnector.py to create, update, delete CA connectors. """ from .base import MyApiTestCase import json from privacyidea.lib.caconnector import get_caconnector_list, save_caconnector from privacyidea.lib.policy import set_policy, SCOPE, ACTION from privacyidea.lib....
def read_mailpass(user): import os try: mail = os.path.join(os.environ['HOME'], '.mail') mail_lines = open(mail).read().split() except IOError: pass else: for match in (user, '*'): for line in mail_lines: words = line.strip().split(':') ...
""" biclustlib: A Python library of biclustering algorithms and evaluation measures. Copyright (C) 2017 Victor Alexandre Padilha This file is part of biclustlib. biclustlib is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Export in-class and out-class tweets to separate files as data for ML system""" from __future__ import division # 1/2 == 0.5, as in Py3 from __future__ import absolute_import # avoid hiding global modules with locals from __future__ import print_function # force use o...
"""Gadfly database adapter unit tests. $Id: test_gadflyadapter.py 66859 2006-04-11 17:32:49Z jinty $ """ import os import tempfile from unittest import TestCase, TestSuite, main, makeSuite from zope.interface.verify import verifyObject from zope.rdb import DatabaseAdapterError from zope.rdb.interfaces import IZopeCo...
#!/usr/bin/env python ''' Created on Oct 28, 2012 ''' from __future__ import division __author__ = "Anubhav Jain" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __maintainer__ = "Anubhav Jain" __email__ = "<EMAIL>" __date__ = "Oct 28, 2012" import matplotlib as mpl import matplotlib.pypl...
from numpy import * from scipy import * from pylab import * import collections as cll import csv import os import matplotlib.pyplot as plt ##################################################################################### ## Reading probes into the file folder = "../output" os.chdir(folder) file_vof='...
""" DragonPy - Dragon 32 emulator in Python ======================================= :created: 2014 by Jens Diemer - www.jensdiemer.de :copyleft: 2014-2015 by the DragonPy team, see AUTHORS for more details. :license: GNU GPL v3 or above, see LICENSE for more details. """ import hashlib import log...
""" This module contains fixtures to use when you need a temporary appliance for testing. In cases where you cannot run a certain test againts the primary appliance because of the test's destructive potential (which could render all subsequent testing useless), you want to use a temporary appliance parallel to the pri...
import pytest from .callable_codec import * import dill import numpy as np _global_var = 0 def _known_module_func(self): import foo return foo.bar() def _globals_using_function(self): return _global_var class TestCallableCodec(object): def setup(self): self.codec = CallableCodec() s...
from __future__ import print_function """Generate a HTML report based on network test output """ import os import json import shutil import glob import sys import argparse import jinja2 from .test_suite import registered_properties if sys.version_info[0] == 2: from io import open STATIC_DATA_FILES = { 'res...
# pypcapfile.savefile.py """ Core functionality for reading and parsing libpcap savefiles. This contains the core classes pcap_packet and pcap_savefile, as well as the core function load_savefile. """ import binascii import ctypes import struct import sys import pcapfile.linklayer as linklayer from pcapfile.structs ...
import codecs from setuptools import setup from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with codecs.open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='colorz', version='1.0.3', descri...
from __future__ import unicode_literals from flask import flash from indico.modules.events.abstracts.controllers.base import RHAbstractsBase, RHManageAbstractsBase from indico.modules.events.abstracts.forms import BOASettingsForm from indico.modules.events.abstracts.settings import boa_settings from indico.modules.ev...
#!/usr/bin/env python """ hmm-cnn.py Train an HMM-CNN hybrid system acoustic model. """ import os import logging from configparser import ConfigParser from waveasr.utils import preprocessing, ark, data_provider, feature_reader from waveasr.models import resnet # Local config # CONFIG = 'config/config_TIMIT.cfg' # T...
#!/usr/bin/env python import collections from collections import defaultdict from itertools import tee, ifilterfalse from gemini_subjects import Subject try: from cyordereddict import OrderedDict except ImportError: from collections import OrderedDict def get_gt_cols(cur): keys = ('cid', 'name', 'type', '...
import configargparse import re from typing import Any, Tuple, List, Type from semantic_version import Version as SemVerBase from gopythongo.utils import highlight, ErrorMessage, print_info from gopythongo.versioners.parsers import VersionContainer, BaseVersionParser, UnconvertableVersion from gopythongo.versioners.p...
import aquilon.aqdb.depends from aquilon.aqdb.model.base import Base from aquilon.aqdb.model.stateengine import StateEngine #AUTHORIZATION from aquilon.aqdb.model.role import Role from aquilon.aqdb.model.realm import Realm from aquilon.aqdb.model.user_principal import UserPrincipal #DNS DOMAINS from aquilon.aqdb.mod...
from flask import Blueprint, flash, redirect, render_template, request, url_for from fernet import db, forms from fernet.models import Score mod = Blueprint('library', __name__, url_prefix='/library') @mod.route('/') def index(): scores = Score.query.all() return render_template('library/index.html', scores...
"""A script is a series of operations.""" import json import os from .ops import create class Script(object): """A script is a series of operations.""" def __init__(self, s=None): """Parse a script from a JSON string.""" if s is not None: self.parsed_script = json.loads(s) ...
import base64 import os from selenium.webdriver.common.desired_capabilities import DesiredCapabilities class Options(object): KEY = "goog:chromeOptions" def __init__(self): self._binary_location = '' self._arguments = [] self._extension_files = [] self._extensions = [] ...
import tensorflow as tf from tensorflow_addons.image import utils as img_utils from tensorflow_addons.utils import keras_utils from tensorflow_addons.utils.types import TensorLike from typing import Optional, Union, List, Tuple, Iterable def _pad( image: TensorLike, filter_shape: Union[List[int], Tuple[int]]...
""" tests.components.automation.test_state ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests state automation. """ import unittest from datetime import timedelta import homeassistant.util.dt as dt_util import homeassistant.components.automation as automation import homeassistant.components.automation.state as state from ...
# -*- coding: utf-8 -*- """ Class for transmitting content metadata to SuccessFactors. """ import logging from itertools import islice from django.conf import settings from integrated_channels.exceptions import ClientError from integrated_channels.integrated_channel.transmitters.content_metadata import ContentMetada...
from openerp import models, fields, api, exceptions, tools, _ from openerp.addons.product import _common class MrpBomLine(models.Model): _inherit = 'mrp.bom.line' product_id = fields.Many2one(required=False) product_template = fields.Many2one(comodel_name='product.template', ...
""" Opens an xme, runs AddOns (to refresh libraries), then saves the xme After updating a library, run on all xmes under META\test\InterchangeTest or regression tests fail """ import pythoncom import sys import win32com.client xmefile = sys.argv[1] xme = win32com.client.DispatchEx("Mga.MgaParser") (par...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function, division, absolute_import import random import string def random_string(length=16): """ Generates a random alphanumeric string. :param length: Length of the generated string. """ chars = string.digits + string.ascii_let...
import pickle import pytest import numpy as np from numpy.linalg import LinAlgError from numpy.testing import assert_allclose, assert_array_equal from scipy.stats.qmc import Halton from scipy.spatial import cKDTree from scipy.interpolate._rbfinterp import ( _AVAILABLE, _SCALE_INVARIANT, _NAME_TO_MIN_DEGREE, _monomi...
import struct from django.views.generic.base import View from django.shortcuts import get_object_or_404 from django.http import HttpResponse from .utils import JSONResponse, BinaryResponse from .models import Ship, ShipCategory, ShipModelLOD, Texture class ShipListView(View): def get(self, request, category_id,...
import pylab from matplotlib import patches, lines from matplotlib.colors import ColorConverter from collections import deque class Candlestick(object): def __init__(self, figure,canvas,max_candles=36,ylim_extra=0.1,**kwargs): self.fig = figure self.canvas = canvas # Candle layout configu...
import pygrib import numpy as np import logging def grib_messages(path,print_messages=False,max_messages=9999): """ Compute the number of messages in grib file :param path: path to the file :return: numeb of messages """ grbf = pygrib.open(path) grbf.seek(0) i=0 for grb in grbf: ...
''' CNN MNIST digits classification Project: https://github.com/roatienza/dl-keras Dependencies: keras Usage: python3 <this file> ''' # numpy import numpy as np from keras.models import Sequential from keras.layers import Activation, Dense, Dropout from keras.layers import Conv2D, MaxPooling2D, Flatten from keras.da...
import MySQLdb from .error import StoreError from .crop import Crop class DataStore(object): QUERY_LAPTOP = 'INSERT INTO laptops '\ '(serial_number, build, snapshot, '\ 'updated, collected, stored) '\ 'values (%s, %s, %s, %s, %s, UNIX_TIMESTAMP(now())) '\...
from common import * # nopep8 DEBUG = True TEMPLATE_DEBUG = DEBUG TEMPLATE_STRING_IF_INVALID = '' # see: http://docs.djangoproject.com/en/dev/ref/settings/#databases #postgres DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'formhub_dev', 'USER': 'f...
# Tai Sakuma <<EMAIL>> import numpy as np import functools import pytest from alphatwirl.binning import RoundLog ##__________________________________________________________________|| def test_repr(): obj = RoundLog() repr(obj) def test_default(): obj = RoundLog() assert 1.9952623149688 == pytest.app...
#!/usr/bin/env python # encoding: utf-8 #pylint: disable=no-member, no-init, too-many-public-methods #pylint: disable=attribute-defined-outside-init # This disable is because the tests need to be name such that # you can understand what the test is doing from the method name. #pylint: disable=missing-docstring """ test...
import re, json, sys, os print "Building ligature correction regex...", _ligatures_dict = dict(json.load(open("sanders_ligatures.json"))) _ligatures_re = re.compile("(%s)" % "|".join(map(re.escape, _ligatures_dict.keys())), flags=re.I) def fix_ligatures(text): return _ligatures_re.sub(lambda mo: _ligatures_dict[mo...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ """ import pandas as pd import numpy as np import math import copy import joblib from .utils import _get_bin_count, _get_linecount, make_bins from .plots import heatmap from .models import SMPS __all__ = ["smps_from_txt", "load_sample"] def smps_from_txt(fpath, col...
"""Contains core data container class and related functions.""" import logging from abc import ABCMeta import jsonpickle import numpy as np from astropy.units import Quantity, Unit from gwcs.coordinate_frames import SpectralFrame from specutils import Spectrum1D from .mixins import StoreRegistry __all__ = ['Data'] ...
import inspect import unittest import threading import imath import IECore import IECoreScene import Gaffer import GafferTest import GafferScene import GafferSceneTest class SceneNodeTest( GafferSceneTest.SceneTestCase ) : def testRootConstraints( self ) : # we don't allow the root of the scene ("/") to carry o...
from scap.Model import Model import logging logger = logging.getLogger(__name__) class AdministrativeAreaType(Model): MODEL_MAP = { 'tag_name': 'AdministrativeArea', 'elements': [ {'tag_name': 'AddressLine', 'list': 'address_lines', 'class': 'AddressLineType'}, {'tag_name': ...
import hashlib from rbnics.problems.base import LinearProblem, ParametrizedDifferentialProblem from rbnics.backends import assign, copy, Function, LinearSolver, product, sum from rbnics.utils.cache import Cache StokesProblem_Base = LinearProblem(ParametrizedDifferentialProblem) # Base class containing the definition...
""" Utility script and module for discovering information about a distribution of mixed class files and JARs. :author: Christopher O'Brien <<EMAIL>> :license: LGPL """ from __future__ import print_function import sys from json import dump from argparse import ArgumentParser from os.path import isdir, join from s...
import bpy from mathutils import Vector class AMTH_NODE_OT_AddTemplateVectorBlur(bpy.types.Operator): bl_idname = "node.template_add_vectorblur" bl_label = "Add Vector Blur" bl_description = "Add a vector blur filter" bl_options = {"REGISTER", "UNDO"} @classmethod def poll(cls, context): ...
import proto # type: ignore __protobuf__ = proto.module( package="google.ads.googleads.v7.errors", marshal="google.ads.googleads.v7", manifest={"ResourceAccessDeniedErrorEnum",}, ) class ResourceAccessDeniedErrorEnum(proto.Message): r"""Container for enum describing possible resource access denied ...