code
stringlengths
1
199k
import os import pathomx.ui as ui from pathomx.plugins import AnalysisPlugin from pathomx.data import DataDefinition from pathomx.qt import * class TwoSampleConfigPanel(ui.ConfigPanel): def __init__(self, parent, *args, **kwargs): super(TwoSampleConfigPanel, self).__init__(parent, *args, **kwargs) s...
""" black_rhino is a multi-agent simulator for financial network analysis Copyright (C) 2016 Co-Pierre Georg (co-pierre.georg@keble.ox.ac.uk) Pawel Fiedor (pawel@fiedor.eu) 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 ...
import os CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', 'LOCATION': os.environ.get('MEMCACHE_URL'), } } SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
import hr import hr_contract
from django.contrib.syndication.views import Feed from django.utils.translation import get_language from django_zoook.tools.zoook import siteConfiguration from django_zoook.catalog.models import ProductTemplate from django_zoook.transurl import * from django_zoook.settings import * class ProductFeed(Feed): """ ...
""" Tests for any Teams app services """ from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory from lms.djangoapps.teams.services import TeamsService from lms.djangoapps.teams.tests.factories import CourseTeamFactory from openedx.core.djangoapps.catalog.tests.factories import Course...
import pytest from django.utils.translation import activate from shuup.campaigns.models.basket_conditions import ( ContactBasketCondition, ContactGroupBasketCondition ) from shuup.campaigns.models.basket_effects import BasketDiscountAmount from shuup.campaigns.models.campaigns import BasketCampaign from shuup.core....
from unittest import skip from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.test.client import Client from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase class InternationalizationTest(ModuleStoreTestCase): """ Tests to validate International...
from shuup.core.utils.name_mixin import NameMixin class Ahnuld(NameMixin): def __init__(self, first_name, last_name="", prefix="", suffix=""): self.first_name_str = first_name self.last_name_str = last_name self.name = "%s %s" % (first_name, last_name) self.prefix = prefix se...
from django.http import HttpResponse from django.shortcuts import get_object_or_404 from angkot.common.decorators import wapi from angkot.common.utils import gpolyencode from angkot.line.models import Line def _line_to_dict(item): pid, cid = None, None if item.city is not None: cid = item.city.id ...
from functools import wraps from flask import g, request from werkzeug.exceptions import Unauthorized from skylines.model import User def check(): """ Checks for the Authorization header, searches for the corresponding user, validates the password and saves the user to ``g.user``. If no user could be fo...
"""!@package grass.script.db @brief GRASS Python scripting module (database functions) Database related functions to be used in Python scripts. Usage: @code from grass.script import db as grass grass.db_describe(table) ... @endcode (C) 2008-2009 by the GRASS Development Team This program is free software under the GNU ...
""" worldship_api :copyright: (c) 2014 by Openlabs Technologies & Consulting (P) Limited :copyright: (c) 2014 by United Parcel Service of America (Documentation) :license: BSD, see LICENSE for more details. API to create XML for worldship .. note:: The documentation is partly extracted f...
""" Decorators for Mobile APIs. """ import functools from django.http import Http404 from opaque_keys.edx.keys import CourseKey from rest_framework import status from rest_framework.response import Response from lms.djangoapps.courseware.courses import get_course_with_access from lms.djangoapps.courseware.courseware_ac...
import requests import datetime from django.conf import settings from django.core.exceptions import PermissionDenied from django.contrib import messages from django.contrib.auth.decorators import login_required, permission_required from django.contrib.auth.models import User from django.contrib.contenttypes.models impo...
import multiprocessing import unittest from os.path import abspath from coalib.bears.Bear import Bear from coalib.results.Result import Result from coalib.output.printers.LOG_LEVEL import LOG_LEVEL from coalib.processes.communication.LogMessage import LogMessage from coalib.settings.Section import Section from coalib.s...
import unittest from apps.preferences import enhance_document_with_default_prefs class DefaultUserPrefsTestCase(unittest.TestCase): def test_enhance(self): doc = { "user_preferences": { "workqueue:items": ["abc"], "editor:theme": {"label": "Editor"}, }...
import os import sys from ast import Str from ast import Name from ast import List from ast import Tuple from ast import parse from ast import Assign from ast import Global from ast import FunctionDef from ast import NodeVisitor from ..utils import YieldSearch, Writer class Veloce(NodeVisitor): @classmethod def...
""" Tests for the Geostationary projection. """ from numpy.testing import assert_almost_equal import cartopy.crs as ccrs from .helpers import check_proj_params class TestGeostationary: test_class = ccrs.Geostationary expected_proj_name = 'geos' def adjust_expected_params(self, expected): # Only for ...
import sys import os import settings.roots as roots import settings.config from ztec.zdb import DB name_db=settings.config.dbs[0] #main_db p=settings.config.p root_db=p["base_root"]+"../admin/"+roots.models_folder+name_db+"_db.py" if os.path.exists(p["base_root"]+"../admin/"+roots.models_folder+name_db+"_db.py"): db=D...
''' Created on Nov 25, 2013 @author: jurek ''' import sys import os.path as fs sys.path.append('/ssd_dev/git_repos/HRA/HRAMath/src') sys.path.append('/ssd_dev/git_repos/HRA/HRACore/src') from hra_core.io_utils import as_path import hra_math.time_domain.poincare_plot.poincare_plot as poincare root_dir = '/home/jurek/vol...
def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_chem_dispersion_device_generic.iff'] def customItemName(): return 'Chemical Dispersion Unit' def stackable(): return 1 def junkDealerPrice(): return 28 def junkType(): return 0
import proxy12 from pymomo.commander.exceptions import * from pymomo.commander.types import * from pymomo.commander.cmdstream import * from pymomo.utilities.console import ProgressBar import struct from pymomo.utilities.intelhex import IntelHex from time import sleep class MultiSensorModule (proxy12.MIB12ProxyObject): ...
import threading import time from amber.common import runtime from navi.web.page import run_flask, stop_flask from navi.web.push import run_tornado, stop_tornado from navi.app.main import run_main, stop_main _registry = dict() def stop(): _registry['alive'] = False if __name__ == '__main__': _tornado_thread = t...
"""Save and restore variables.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import os.path import re import time import numpy as np import six from google.protobuf.any_pb2 import Any from google.protobuf import text_format from tensor...
import unittest from yabgp.common import constants as bgp_cons from yabgp.message.attribute.nlri.evpn import EVPN class TestEVPN(unittest.TestCase): def test_parse_mac_ip_adv(self): data_hex = b'\x02\x25\x00\x01\xac\x11\x00\x03\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' \ b'\x00\x00...
import enum from collections.abc import Mapping from voluptuous import validators SCHEMA_KWD = "schema" META_KWD = "meta" def lockfile_version_schema(value): expected = [LOCKFILE_VERSION.V2.value] # pylint: disable=no-member msg = "invalid schema version {}, expected one of {}".format( value, expected ...
__author__ = "Satish Palaniappan" import pickle import sys from scoreScaler import scorer from SocialFilter.Twokenize.twokenize import * import os, sys, inspect cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0])) if cmd_folder not in sys.path: sys.path.insert(0, cm...
import numpy as np import pytest from unittest import mock import tvm from tvm import relay from tvm.relay import transform from tvm.contrib.target import coreml as _coreml pytest.importorskip("coremltools") def _has_xcode(): try: tvm.contrib.xcode.xcrun([]) return True except FileNotFoundError:...
import os import logging import datetime import decimal os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' from django.core.management import setup_environ import settings setup_environ(settings) from sell.models import Sell from shops.models import Shop from market_buy.models import BestSeller def get_week_top_seller()...
"""measure bandwidth and compute peak""" import logging import tvm from tvm import te from . import util from .. import rpc def _convert_to_remote(func, remote): """ convert module function to remote rpc function""" temp = util.tempdir() path_dso = temp.relpath("tmp_func.tar") func.export_library(path_d...
""" Testing for the forest module (sklearn.ensemble.forest). """ import pickle from collections import defaultdict from itertools import product import numpy as np from scipy.sparse import csr_matrix, csc_matrix, coo_matrix from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_a...
""" django-bitfield ~~~~~~~~~~~~~~~ """ try: VERSION = __import__('pkg_resources') \ .get_distribution('bitfield').version except Exception: VERSION = 'unknown' from bitfield.models import Bit, BitHandler, CompositeBitField, BitField # noqa
import logging from azure.mgmt.resource.resources.models import GenericResource, ResourceGroupPatchable class TagHelper: log = logging.getLogger('custodian.azure.utils.TagHelper') @staticmethod def update_resource_tags(tag_action, resource, tags): client = tag_action.session.client('azure.mgmt.resou...
from __future__ import print_function from future.utils import tobytes import utils import proto from .security import * from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey, X25519PublicK...
extensions = ['rst2pdf.pdfbuilder'] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'Stratio Cassandra Lucene Index' copyright = u'2015 Stratio' version = '${project.version}' release = version language = None exclude_patterns = ['_build'] pygments_style = 'sphinx' highlight_langu...
''' Tests for order module. ''' import cStringIO import unittest from room import models from room import order class SomeOrdersTest(unittest.TestCase): def setUp(self): unittest.TestCase.setUp(self) self.os = models.OrderSheet() self.os.delivery_options = 'Yes' self.os.put() ...
__version__ = 1.1
"""mütesync binary sensor entities.""" from homeassistant.components.binary_sensor import BinarySensorEntity from homeassistant.helpers import update_coordinator from homeassistant.helpers.device_registry import DeviceEntryType from homeassistant.helpers.entity import DeviceInfo from .const import DOMAIN SENSORS = { ...
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel" __version__ = "sprint1" __credits__ = ["Tony"] from ServerPackage.TournamentService import * from AvailablePlayers.RPSPlayerExample import * from AvailableGames.RockPaperScissors import * from ServerPackage.Display import * from AvailablePlayers.BEPCPlayer import...
from mesonbuild import environment, mesonlib import argparse, sys, os, subprocess, pathlib, stat import typing as T def coverage(outputs: T.List[str], source_root: str, subproject_root: str, build_root: str, log_dir: str, use_llvm_cov: bool) -> int: outfiles = [] exitcode = 0 (gcovr_exe, gcovr_new_rootdir, ...
import json import logging from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import workflows from openstack_dashboard.api import sahara as saharaclient import openstack_dashboard.dashboards.project.data_processing. \ cluster_templates.work...
from zerver.lib.import_realm import ( do_import_realm, ) from zerver.lib.test_classes import ( ZulipTestCase, ) from zerver.models import ( get_realm, UserProfile, Message, ) from zerver.data_import.gitter import ( do_convert_data, get_usermentions, ) import ujson import logging import os im...
import string, gettext _ = gettext.gettext try: frozenset except NameError: # Import from the sets module for python 2.3 from sets import Set as set from sets import ImmutableSet as frozenset EOF = None E = { "null-character": _(u"Null character in input stream, replaced with U+FFFD."), "...
from a10sdk.common.A10BaseClass import A10BaseClass class RulesList(A10BaseClass): """This class does not support CRUD Operations please use parent. :param std_list_action: {"enum": ["deny", "permit"], "type": "string", "description": "'deny': Specify community to reject; 'permit': Specify community to accept; ...
''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
"""Integration tests for the "prop" utility""" from __future__ import absolute_import import dtf.testutils as testutils def test_no_args(): """Running with no args""" testutils.deploy_config(testutils.get_default_config()) rtn = testutils.dtf("prop") testutils.undeploy() assert(rtn.return_code == 0)...
import signal import requests import docker import json import time import sys def signal_handler(signal, frame): print("Stopping Grafana...") docker_client = client.from_env() try: grafana = [ c for c in docker_client.containers.list() if c.attrs['Config']['Image'] == "grafa...
import copy import datetime import uuid from keystone import auth from keystone import config from keystone import exception from keystone import identity from keystone.openstack.common import timeutils from keystone import test from keystone import token from keystone import trust import default_fixtures CONF = config...
from django.apps import apps import logging from future.moves.urllib.parse import urljoin import random import requests from framework.exceptions import HTTPError from framework.celery_tasks import app as celery_app from framework.postcommit_tasks.handlers import enqueue_postcommit_task, get_task_from_postcommit_queue ...
from __future__ import absolute_import, division, print_function import warnings import six from cryptography import utils from cryptography.exceptions import UnsupportedAlgorithm, _Reasons from cryptography.hazmat.backends.interfaces import RSABackend def generate_private_key(public_exponent, key_size, backend): i...
import sys import unittest from iptest import IronPythonTestCase, is_cli, run_test, skipUnlessIronPython def get_builtins_dict(): if type(__builtins__) is type(sys): return __builtins__.__dict__ return __builtins__ class complextest: def __init__(self, value): self.value = value def __float__(se...
import sys import numpy as np import math order=[4, 6, 8, 10] for pe in order: width = np.power(2, pe) out = sys.stdout out.write("instance PriorityEncoder#(%s);\n" % width); out.write(" module mkPriorityEncoder(PEnc#(%s));\n" % width); out.write(" Vector#(4, Reg#(Bit#(%s))) binIR <- replicat...
import sys import time import argparse from scipy.ndimage import gaussian_filter from scipy.ndimage.interpolation import rotate parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group(required=True) group.add_argument('-a', '--use-afnumpy',action='store_true') group.add_argument('-n', '--use-nump...
import hashlib import os def upload_path(instance, filename, **kwargs): hasher = hashlib.md5() for chunk in instance.image.chunks(): hasher.update(chunk) hash = hasher.hexdigest() base, ext = os.path.splitext(filename) return '%(first)s/%(second)s/%(hash)s/%(base)s%(ext)s' % { 'first...
""" Class for reading data from maxwell biosystem device: * MaxOne * MaxTwo https://www.mxwbio.com/resources/mea/ The implementation is a mix between: * the implementation in spikeextractors https://github.com/SpikeInterface/spikeextractors/blob/master/spikeextractors/extractors/maxwellextractors/maxwellextr...
import numpy as np import scipy.sparse as sp from scipy import linalg from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_ar...
from django.test import TestCase from survey.models import AboutUs class AboutUsContentTest(TestCase): def test_fields(self): about_us_content = AboutUs() fields = [str(item.attname) for item in about_us_content._meta.fields] self.assertEqual(4, len(fields)) for field in ['id', 'crea...
from tornado.web import authenticated from amgut.lib.util import external_surveys from amgut.handlers.base_handlers import BaseHandler from amgut import media_locale from amgut.connections import ag_data class HumanSurveyCompletedHandler(BaseHandler): @authenticated def get(self): human_survey_id = self...
""" CONTEXT structure for i386. """ __revision__ = "$Id$" from winappdbg.win32.defines import * from winappdbg.win32.version import ARCH_I386 _all = None _all = set(vars().keys()) EXCEPTION_READ_FAULT = 0 # exception caused by a read EXCEPTION_WRITE_FAULT = 1 # exception caused by a write EXCEPTION...
import cgi import re from subprocess import check_output try: from urllib.parse import quote as stdlib_quote except ImportError: from urllib2 import quote as stdlib_quote from IPython.utils import py3compat def quote(s): """unicode-safe quote - Python 2 requires str, not unicode - always return unic...
import os.path as op import warnings from nose.tools import assert_true import numpy as np from numpy.testing import assert_raises, assert_equal from mne import (make_field_map, pick_channels_evoked, read_evokeds, read_trans, read_dipole, SourceEstimate) from mne.io import read_raw_ctf, read_raw_bti, r...
class Code(object): """A convenience object for constructing code. Logically each object should be a block of code. All methods except |Render| and |IsEmpty| return self. """ def __init__(self, indent_size=2, comment_length=80): self._code = [] self._indent_level = 0 self._indent_size = indent_siz...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('worlddata', '0001_initial'), ] operations = [ migrations.CreateModel( name='world_areas', fields=[ ('id', models....
from urlparse import urlparse from django.template import Library from django.utils.html import escape from django.utils.safestring import mark_safe register = Library() def shy(value, max_length=None): """ Inserts &shy; elements in over-long strings. """ if not max_length: return value resu...
""" Class that constructs a MultiplexMarkovchain given the counts. Also has methods to get the null model and the parameters of the probability distribution associated with the Markov chain. Currently handles only 4-state Markov chains (i.e. two layer networks). """ from __future__ import division import numpy as np fr...
from __future__ import division from xml.parsers.expat import ExpatError import xml.dom.minidom from vistrails.db import VistrailsDBException from vistrails.db.versions.v0_5_0 import version as my_version def parse_xml_file(filename): try: return xml.dom.minidom.parse(filename) except xml.parsers.expat....
command = testshade("-od half -o a a.exr -o b b.exr -o c c.exr -g 64 64 test") outputs = [ "a.exr", "b.exr", "c.exr", "out.txt" ]
"""SQL io tests The SQL tests are broken down in different classes: - `PandasSQLTest`: base class with common methods for all test classes - Tests for the public API (only tests with sqlite3) - `_TestSQLApi` base class - `TestSQLApi`: test the public API with sqlalchemy engine - `TestSQLiteFallbackApi`: tes...
"""Qemu is used to help with executing and debugging non-x86_64 binaries.""" from __future__ import print_function import array import errno import os from chromite.lib import cros_logging as logging from chromite.lib import osutils class Qemu(object): """Framework for running tests via qemu""" # The binfmt regist...
""" Implementation of Von-Mises-Fisher Mixture models, i.e. the equaivalent of mixture of Gaussian on the sphere. Author: Bertrand Thirion, 2010-2011 """ from __future__ import print_function from __future__ import absolute_import import numpy as np from warnings import warn warn('Module nipy.algorithms.clustering.von_...
from openstatesapi.jurisdiction import make_jurisdiction J = make_jurisdiction('ma') J.url = 'http://mass.gov'
import sys import math import numpy as np from numpy import sqrt, cos, sin, arctan, exp, log, pi, Inf from numpy.testing import (assert_, assert_allclose, assert_array_less, assert_almost_equal) from pytest import raises as assert_raises from scipy.integrate import quad, dblquad, tplquad, nquad from scipy._lib....
"""A command line interface to the ChromeOS gerrit instances Internal Note: To expose a function directly to the command line interface, name your function with the prefix "UserAct". """ import inspect import os from chromite.buildbot import constants from chromite.lib import commandline from chromite.lib import cros_b...
import logging import sys import unittest import StringIO from webkitpy.common.system.filesystem import FileSystem from webkitpy.common.system.executive import Executive from webkitpy.common.system.outputcapture import OutputCapture from webkitpy.test.main import Tester, _Loader STUBS_CLASS = __name__ + ".TestStubs" cl...
from kokki import Package, Service env.include_recipe("flume") Package("flume-node") import os def flume_node_status(): pid_path = "/var/run/flume/flume-flume-node.pid" try: with open(pid_path, "rb") as fp: pid = int(fp.read().strip()) os.getpgid(pid) # Throws OSError if processes do...
"""Metrics to assess performance on classification task given class prediction Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ from __future__ import division import warnings i...
import hail as hl ht_samples = hl.read_table('gs://hail-datasets-hail-data/1000_Genomes_phase3_samples.ht') ht_relationships = hl.read_table('gs://hail-datasets-hail-data/1000_Genomes_phase3_sample_relationships.ht') mt = hl.import_vcf( 'gs://hail-datasets-raw-data/1000_Genomes/1000_Genomes_phase3_chr{1,2,3,4,5,6,7...
class Parent(object): def override(self): print "PARENT override()" class Child(Parent): def override(self): print "CHILD override()" dad = Parent() son = Child() dad.override() son.override()
"""Test cases for traceback module""" from _testcapi import traceback_print from StringIO import StringIO import sys import unittest from imp import reload from test.test_support import run_unittest, is_jython, Error import traceback class TracebackCases(unittest.TestCase): # For now, a very minimal set of tests. ...
from __future__ import unicode_literals import json import random import contextlib import shutil import pytest import tempfile from pathlib import Path from thinc.neural.optimizers import Adam from ...gold import GoldParse from ...pipeline import EntityRecognizer from ...lang.en import English try: unicode except ...
from django.test import Client, TestCase from django.urls import reverse from users.models import User data_user = { 'username': 'john-doe', 'email': 'john-doe@user.com', 'password1': 'password123!', 'password2': 'password123!', 'password': 'password123!' } class UserTestCase(Tes...
import datetime import os import json import logging from google.appengine.ext import ndb from consts.account_permissions import AccountPermissions from consts.media_type import MediaType from controllers.suggestions.suggestions_review_base_controller import SuggestionsReviewBaseController from helpers.media_manipulato...
test = { 'name': 'intersect', 'points': 1, 'suites': [ { 'cases': [ { 'code': r""" scm> (intersect odds (list 2 3 4 5)) (3 5) """, 'hidden': False, 'locked': False }, { 'code': r""" scm> (intersect od...
import sys, os, tempfile, subprocess, lxml.etree, zipfile, urllib, hashlib def getODFVersion(zip): content = lxml.etree.parse(zip.open("content.xml", "r")) return content.getroot().get( "{urn:oasis:names:tc:opendocument:xmlns:office:1.0}version") def getJing(): jingjar = "jing-20091111/bin/jing.jar" path = os.pat...
from virtinst.VirtualDevice import VirtualDevice from virtinst.util import xml_escape from virtinst.XMLBuilderDomain import _xml_property class VirtualCharDevice(VirtualDevice): """ Base class for all character devices. Shouldn't be instantiated directly. """ DEV_SERIAL = "serial" DEV_PARALLEL...
""" EasyBuild support for building and installing a Pythonpackage independend of a python version as an easyblock. Python installs libraries by defailt in site-packages/python-xxx/ But packages that are not dependend on the python version can be installed in a different prefix, e.g. lib as long as we add this folder to...
from translate.convert import po2csv from translate.convert import csv2po from translate.convert import test_convert from translate.misc import wStringIO from translate.storage import po from translate.storage import csvl10n from translate.storage.test_base import headerless_len, first_translatable class TestPO2CSV: ...
"""Routines for saving and loading the id-map file.""" import os def save_id_map(filename, revision_ids): """Save the mapping of commit ids to revision ids to a file. Throws the usual exceptions if the file cannot be opened, written to or closed. :param filename: name of the file to save the data to ...
'''OpenGL extension NV.vertex_program2_option Automatically generated by the get_gl_extensions script, do not edit! ''' from OpenGL import platform, constants, constant, arrays from OpenGL import extensions from OpenGL.GL import glget import ctypes EXTENSION_NAME = 'GL_NV_vertex_program2_option' _DEPRECATED = False def...
from app.mod_shared.models.db import db class GroupMembership(db.Model): # Attributes id = db.Column(db.Integer, primary_key=True) is_admin = db.Column(db.Boolean) # Foreign keys group_id = db.Column(db.Integer, db.ForeignKey('group.id')) group_membership_type_id = db.Colum...
from resources.hosters.hoster import iHoster from resources.lib.handler.requestHandler import cRequestHandler from resources.lib.parser import cParser from resources.lib.gui.gui import cGui from resources.lib.config import cConfig import cookielib import json import urllib2,urllib,re import unicodedata import xbmcgui c...
''' Script to create biplots of a cross product of all Parameters in a database. Mike McCann MBARI 10 February 2014 ''' import os import sys if 'DJANGO_SETTINGS_MODULE' not in os.environ: os.environ['DJANGO_SETTINGS_MODULE']='settings' sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../../")) # setting...
import warnings from astropy.io import fits import numina.array def get_hdu_shape(header): ndim = header['naxis'] return tuple(header.get(f'NAXIS{i:d}') for i in range(1, ndim + 1)) def custom_slice_to_str(slc): if slc.step is None: return f'{slc.start:d}:{slc.stop:d}' else: return f'{sl...
import logging from django.core.exceptions import ObjectDoesNotExist from astakos.im.models import Project from astakos.im.quotas import get_project_quota from synnefo.util import units from synnefo_admin.admin.exceptions import AdminHttp404 from synnefo_admin.admin.utils import is_resource_useful def get_actual_owner(...
''' VMware Inventory Script ======================= Retrieve information about virtual machines from a vCenter server or standalone ESX host. When `group_by=false` (in the INI file), host systems are also returned in addition to VMs. This script will attempt to read configuration from an INI file with the same base fi...
import os import logging from datetime import datetime from superdesk.io.file_ingest_service import FileIngestService from superdesk.utc import utc from superdesk.utils import get_sorted_files, FileSortAttributes from superdesk.errors import ParserError, ProviderError from superdesk.io.iptc7901 import Iptc7901FileParse...
import sys from PyQt5.QtCore import QCoreApplication from PyQt5.QtDBus import QDBusConnection, QDBusInterface def method1(): sys.stdout.write("Method 1:\n") reply = QDBusConnection.sessionBus().interface().registeredServiceNames() if not reply.isValid(): sys.stdout.write("Error: %s\n" % reply.error(...
import espressomd from espressomd import code_info from espressomd import thermostat from espressomd import analyze from espressomd import integrate from espressomd import interactions from espressomd import electrostatics import sys import numpy as np import cPickle as pickle import os print(code_info.features()) np.r...
import unittest class TestArticle(unittest.TestCase): pass