content
stringlengths
4
20k
""" Generic EasyBuild support for installing Intel tools, implemented as an easyblock @author: Stijn De Weirdt (Ghent University) @author: Dries Verdegem (Ghent University) @author: Kenneth Hoste (Ghent University) @author: Pieter De Baets (Ghent University) @author: Jens Timmerman (Ghent University) @author: Ward Poe...
# vim: set fileencoding=utf-8 : """OpScripts utilities library """ # Standard Library from __future__ import absolute_import, division, print_function import logging import os import pwd import random import re import select import subprocess import sys import tempfile import traceback LOG = logging.getLogger(__nam...
import string from dvbobjects.MPEG.Section import Section from dvbobjects.utils import * ###################################################################### class conditional_access_section(Section): table_id = 0x01 section_max_size = 1024 def pack_section_body(self): # pack ca_descr...
from __future__ import (absolute_import, division, print_function, with_statement) from functools import wraps import time from greplin import scales from greplin.scales.meter import MeterStat from tornado.concurrent import Future from supercell.requesthandler import RequestHandler def lat...
from tempest.lib.common.utils import data_utils from tempest import test from neutron.tests.tempest.api import base_routers as base class RoutersTestDVR(base.BaseRouterTest): @classmethod @test.requires_ext(extension="router", service="network") @test.requires_ext(extension="dvr", service="network") ...
import sys import os try: import sphinx_rtd_theme html_theme = 'sphinx_rtd_theme' html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] except ImportError: html_theme = 'default' # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path he...
import re import xml.etree.ElementTree as ElementTree def find_in_file(xml_path, x_paths, ignore_namespaces=True): """ :type xml_path: str :type x_paths: list :type ignore_namespaces: bool :rtype: dict """ tree = ElementTree.parse(xml_path) root = tree.getroot() return find_in_tree...
"""A local tf.Dataset wrapper for LDIF.""" import os import glob import sys import time import tensorflow as tf # LDIF is an internal package, should be imported last. # pylint: disable=g-bad-import-order from ldif.datasets import process_element from ldif.inference import example from ldif.util.file_util import log...
from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credential...
"""Keccak family of cryptographic hash algorithms. `Keccak`_ is the winning algorithm of the SHA-3 competition organized by NIST. What eventually became SHA-3 is a variant incompatible to Keccak, even though the security principles and margins remain the same. If you are interested in writing SHA-3 compliant code, yo...
import matriarch from bottle import route, run, static_file, view, request, redirect, auth_basic import os import json def check(user, password): return user == "admin" and password == "admin" import argparse parser = argparse.ArgumentParser("Run a web frontend for Matriarch") parser.add_argument('--port', met...
import Gaffer import GafferImage Gaffer.Metadata.registerNode( GafferImage.ImageSampler, "description", """ Samples image colour at a specified pixel location. """, plugs = { "image" : [ "description", """ The image to be sampled. """, ], "channels" : [ "description", """ The n...
"""A utility for generating Windows Server passwords. The requirements for the passwords are outlined in http://technet.microsoft.com/en-us/library/cc786468(v=ws.10).aspx. """ import random import string _LENGTH = 12 _CHARACTER_CLASSES = [ string.ascii_uppercase, string.ascii_lowercase, string.digits, ...
# GetAppStats # import requests import os import datetime, time import mysql.connector as mysql from biokbase.narrative_method_store.client import NarrativeMethodStore import biokbase.narrative.clients as clients import datetime from installed_clients.execution_engine2Client import execution_engine2 requests.packages...
try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup def find_packages(exclude=None): """ Just stub this. If you're packaging EMDS, you need setuptools. If you're installing, not so much. """ return required = [ '...
import xml from datetime import datetime import xml.dom.minidom import time import numpy import arrow import exifread from scipy import interpolate __author__ = 'andriy.batutin' """ 1. build function from KML file. x -time, y - location 2. create interpolation alg to search by time the coordinate 3. get wiki descript...
#!/usr/bin/env python """Classes to encapsulate the idea of a dataset in machine learning, including file access. This file contains the ARFF class for people who have arff installed. """ # This software is distributed under BSD 3-clause license (see LICENSE file). # # Authors: Soeren Sonnenburg try: impo...
import asyncio import logging import uvloop from asyncexec.workers.flow_builder import Flow logger = logging.getLogger(__name__) class AsyncExecutor(object): def __init__(self, configurations): self.channel_configurations = {} self.flows = [] if 'rabbitmq' in configurations: ...
from collections import OrderedDict from binascii import hexlify, unhexlify from calendar import timegm from datetime import datetime import json import struct import time from pistonbase.account import PublicKey from .signedtransactions import Signed_Transaction as GrapheneSigned_Transaction # Import all operations ...
import resource import numpy as np import sklearn.svm from HPOlibConfigSpace.configuration_space import ConfigurationSpace from HPOlibConfigSpace.conditions import EqualsCondition, InCondition from HPOlibConfigSpace.hyperparameters import UniformFloatHyperparameter, \ UniformIntegerHyperparameter, CategoricalHype...
from openerp import models, fields, api, _ class ProductPricelistItem(models.Model): _inherit = 'product.pricelist.item' def _price_field_get_ext(self): result = self._price_field_get() result.append((-3, _('Fixed Price'))) return result base_ext = fields.Selection(selection='_p...
# coding=utf-8 import copy from mycodo.inputs.base_input import AbstractInput from mycodo.inputs.sensorutils import calculate_dewpoint from mycodo.inputs.sensorutils import calculate_vapor_pressure_deficit # Measurements measurements_dict = { 0: { 'measurement': 'temperature', 'unit': 'C' }, ...
"""Helper functions for the SIA integration.""" from __future__ import annotations from datetime import timedelta from typing import Any from pysiaalarm import SIAEvent from homeassistant.const import DEVICE_CLASS_TIMESTAMP from .const import ( EVENT_ACCOUNT, EVENT_CODE, EVENT_ID, EVENT_MESSAGE, ...
import sys import os import gzip import paddle.v2 as paddle import reader from network_conf import fc_net, convolution_net from utils import logger, load_dict, load_reverse_dict def infer(topology, data_dir, model_path, word_dict_path, label_dict_path, batch_size): def _infer_a_batch(inferer, test_bat...
# this characters need escaping . ^ $ * + ? { } [ ] \ | ( ) import collections import re import bslint.constants as const Regex = collections.namedtuple('Token', ['regex', 'lexer_type', 'parser_type', 'indentation']) REGEX_LIST = [ [r"\n", const.NEW_LINE, const.NEW_LINE, const.NO_INDENTATION], [r"\s", None, N...
#!/usr/bin/python import atexit import pyaudio import wave import audioop import re import urllib import urllib2 import time, datetime import ConfigParser import pprint import sys, os, inspect from collections import deque from subprocess import * cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.p...
"""A SSL/TLS secured version of the built-in XMLRPC server and proxy. Requires python-2.6 or later to provide the ssl module. """ import os import re import sys import xmlrpclib from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler from SocketServer import ThreadingMixIn # Expose extra ssl cons...
"""A simple MNIST classifier which is used to demostrate the tensorflow based AI pipeline from training, test, monitoring and serving. It could be used as an example to run in Kuberentes environment The codes are written based on MNINST examples from https://github.com/tensorflow/tensorflow/tree/master/tensorflow/e...
from eve.tests import TestBase from eve.tests.utils import DummyEvent from eve.tests.test_settings import MONGO_DBNAME from eve import ETAG from bson import ObjectId from eve.methods.delete import deleteitem_internal class TestDelete(TestBase): def setUp(self): super(TestDelete, self).setUp() # E...
from __future__ import absolute_import from __future__ import division from __future__ import print_function """Tests for common.config_lib.""" import tensorflow as tf from common import config_lib # brain coder class ConfigLibTest(tf.test.TestCase): def testConfig(self): config = config_lib.Config(hello='...
class DisjointSets: def __init__(self, size): self.size = size self.p = [i for i in range(size)] self.rank = [0] * size self.set_size = [1] * size for i in range(size): self.p[i] = i def find_set(self, i): if self.p[i] == i: return i ...
from collections import namedtuple import unicodedata import re from . import replies, exceptions Prefix = namedtuple('prefix', 'nick user host') prefix_pattern = re.compile( r'^(?P<nick>[^!@]+)' r'(?:!(?P<user>[^@]+))?' r'(?:@(?P<host>[^@]+))?$' ) # Taken from: http://www.fileformat.info/info/unicode/ca...
# -*- coding: utf-8 -*- ''' Exodus Add-on 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 your option) any later version. This progra...
import unittest from ..lock import lock, unlock, LockError, PidLock, PidLockError from tempfile import mktemp from os import unlink, getpid from os.path import exists from multiprocessing import Process, Pipe #pylint: disable=no-name-in-module from contextlib import contextmanager class LockTimeoutError(IOError): ...
from modules import * from .use_aircrack import * #Create our 'mdk' class class mdkObj(object): def __init__(self,colors): self.colors = colors self.mdkSource = "~/.airscriptNG/mdk/*/src/mdk4" self.lanListLocation = "scripts/ssid_lists/lan_list.txt" self.beaconListLocation = "scripts...
##### EVENT HANDLING ########################################################### # set fullscreen mode def SetFullscreen(fs, do_init=True): global Fullscreen if FakeFullscreen: return # this doesn't work in fake-fullscreen mode if do_init: if fs == Fullscreen: return if no...
{ 'name': 'Report wizard for customer to analytic analysis and timesheet', 'version': '0.0.1', 'category': 'Report', 'description': """ Add customer information for filter analytic account lines """, 'author': 'Micronaet s.r.l.', 'website': 'http://www.micronaet.it', 'depend...
from msrest.serialization import Model class CheckTrafficManagerRelativeDnsNameAvailabilityParameters(Model): """Parameters supplied to check Traffic Manager name operation. :param name: Gets or sets the name of the resource. :type name: str :param type: Gets or sets the type of the resource. :ty...
# -*- coding: utf-8 -*- import numpy as np from allel.util import asarray_ndim def get_scaler(scaler, copy, ploidy): # normalise strings to lower case if isinstance(scaler, str): scaler = scaler.lower() if scaler == 'patterson': return PattersonScaler(copy=copy, ploidy=ploidy) elif s...
# -*- coding: utf-8 -*- """ Contains utility functions and classes for Runners. """ from __future__ import absolute_import from bisect import bisect # NOT-NEEDED: import codecs import glob import os.path import re import sys from six import string_types from behave import parser from behave.model_core import FileLoca...
from odoo import api, models from odoo.addons.queue_job.job import job class AccountInvoice(models.Model): _inherit = 'account.invoice' @api.multi @job def modify_open_invoice(self, vals): """ Job for changing an open invoice with new values. It will put it back in draft, modi...
"""Forms used for Bulk import of data""" from django import forms from django.utils import six from nav.bulkparse import BulkParseError, CommentStripper from nav.bulkimport import BulkImportError class BulkImportForm(forms.Form): """Generic bulk import form""" bulk_file = forms.FileField(label="Upload a bul...
import datetime from django.conf import settings from django.contrib.auth.hashers import make_password import karaage.institutes.models import karaage.machines.models import karaage.people.models import karaage.projects.models from karaage.projects.utils import add_user_to_project try: import factory from f...
""" Copyright 2013 Google Inc. All Rights Reserved. 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/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
""" This tests the -j command line option, and the num_jobs SConscript settable option. """ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os.path import TestSCons _python_ = TestSCons._python_ try: import threading except ImportError: # if threads are not supported, then # there ...
import unittest from sr.tree.tree import Tree from sr.tree.tree import Node from sr.tree.tree import NodeType from sr.tree.parser import TreeParser class NodeTests(unittest.TestCase): def setUp(self): self.left_node = Node(NodeType.CONSTANT, value=1.0) self.left_node_2 = Node(NodeType.CONSTANT, v...
#-*- coding:utf-8 -*- """ This file is part of openexp. openexp 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 your option) any later version. openexp is distributed in ...
"""$Id: validtest.py 511 2006-03-07 05:19:10Z rubys $""" __author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>" __version__ = "$Revision: 511 $" __date__ = "$Date: 2006-03-07 18:19:10 +1300 (Tue, 07 Mar 2006) $" __copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim" __li...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import datetime class Migration(migrations.Migration): dependencies = [ ('auth', '0006_require_contenttypes_0002'), migrations.swappable_dependency(settings.A...
from __future__ import absolute_import from sentry.api.serializers import Serializer, register, serialize from sentry.auth import access from sentry.models import ( Organization, OrganizationAccessRequest, OrganizationMember, OrganizationMemberType, Team, TeamStatus ) @register(Organization) class Organizati...
from .build_file import BuildFile DOC_TYPE_ROSDOC = 'rosdoc_lite' DOC_TYPE_MANIFEST = 'released_manifest' DOC_TYPE_MAKE = 'make_target' DOC_TYPES = [DOC_TYPE_ROSDOC, DOC_TYPE_MANIFEST, DOC_TYPE_MAKE] class DocBuildFile(BuildFile): _type = 'doc-build' def __init__(self, name, data): assert 'type' in...
"""A decision forest toy example. Trains and evaluates a decision forest classifier on a 2-D point cloud. """ import argparse import datetime import os import re import sys import numpy as np from PIL import Image, ImageDraw from tensorflow.python.platform import app sys.path.insert(0, os.path.join(os.path.dirname(...
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the 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 ...
from gi.repository import GObject from gi.repository import Gtk from gi.repository import Gdk from sugar3.graphics import style from sugar3.graphics.xocolor import XoColor from jarabe.view.pulsingicon import PulsingIcon class NotificationIcon(Gtk.EventBox): __gtype_name__ = 'SugarNotificationIcon' __gprope...
import drake class SDK(drake.Configuration): """Configuration for the Air SDK.""" def __init__(self, prefix = None): """Find and create a configuration for the Air SDK. prefix -- Where to find the Air SDK, should contain bin/adl. """ # Compute the search path. if prefix is None: test =...
"""Treadmill metrics collector. Collects Treadmill metrics and sends them to Graphite. """ import glob import logging import os import time import click from treadmill import appenv from treadmill import exc from treadmill import fs from treadmill import rrdutils from treadmill.metrics import rrd #: Metric collect...
# -*- coding: utf-8 -*- import scrapy import csv import os from adzan.items import AdzanItem class JadwaltodaySpider(scrapy.Spider): name = "jadwaltoday" allowed_domains = ["http://jadwalsholat.pkpu.or.id/"] cities = {} def __init__(self, city_id=83, *args, **kwargs): supe...
import logging import numpy as np import pytest import nengo from nengo.utils.functions import piecewise from nengo.utils.numpy import filtfilt from nengo.utils.testing import Plotter, allclose logger = logging.getLogger(__name__) def test_args(nl): N = 10 d1, d2 = 3, 2 with nengo.Network(label='test_...
from .main import ITunes def start(): return ITunes() config = [{ 'name': 'itunes', 'groups': [ { 'tab': 'automation', 'list': 'automation_providers', 'name': 'itunes_automation', 'label': 'iTunes', 'description': 'From any <a href="http...
from typing import Any, Dict, TYPE_CHECKING from . import VersionUpgrade33to34 if TYPE_CHECKING: from UM.Application import Application upgrade = VersionUpgrade33to34.VersionUpgrade33to34() def getMetaData() -> Dict[str, Any]: return { "version_upgrade": { # From ...
import os import setuptools import subprocess from pkg2pypm.info import NAME_SHORT, DESCR, VER_MAJOR, VER_MINOR ## Get version from VCS. VER_BUILD = 0 try: ## If this file exist, package is installed from pypi and this file is ## executed with 'egg_info' command-line argument. with open( 'PKG-INFO...
""" CartoDB Spatial Analysis Python Library See: https://github.com/CartoDB/crankshaft """ from setuptools import setup, find_packages setup( name='crankshaft', version='0.3.0', description='CartoDB Spatial Analysis Python Library', url='https://github.com/CartoDB/crankshaft', author='Data Ser...
''' Copyright 2011-2015 ramusus 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/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software di...
import numpy as np from random import sample ''' split data into train (70%), test (15%) and valid(15%) return tuple( (trainX, trainY), (testX,testY), (validX,validY) ) ''' def split_dataset(x, y, ratio = [0.7, 0.15, 0.15] ): # number of examples data_len = len(x) lens = [ int(data_len*item) for item...
""" Module of helper functions for ccresponse distributed property calculations. Defines functions for interacting with the database created by the run_XXX driver function. Properties that are able to use this module should be added to the registered_props dictionary. """ from __future__ import absolute_import from _...
""" ## @file stats.py defines functions and data structures related to statistical analysis. """ import random import numpy dtype = GetNTAReal() def pickByDistribution(distribution, r=None): """ Pick a value according to the provided distribution. @param distribution -- Probability distribution. Need not be n...
# -*- coding: utf-8 -*- import os from .base_settings import PROJECT_PATH gettext = lambda s: s # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. # On Unix systems, a valu...
from __future__ import unicode_literals from contextlib import contextmanager from math import isnan, isinf from hy._compat import PY3, str_type, bytes_type, long_type, string_types from fractions import Fraction from clint.textui import colored PRETTY = True @contextmanager def pretty(pretty=True): """ Con...
#!/usr/bin/env python """ file system operations # from lib.fs import which """ from __future__ import (absolute_import, division, print_function, unicode_literals) import os import stat import sys def which(program): """ Equivalent of the which command in Python. source: http...
from scap.model.ocil_2_0.VariableType import VariableType import logging logger = logging.getLogger(__name__) class LocalVariableType(VariableType): MODEL_MAP = { 'elements': [ {'tag_name': 'set', 'class': 'SetType', 'min': 0, 'max': 1}, ], 'attributes': { 'question_...
import itertools from typing import Any, Dict, Sequence, Tuple, TYPE_CHECKING from cirq import ops, value from cirq.contrib.acquaintance.permutation import SwapPermutationGate, PermutationGate if TYPE_CHECKING: import cirq @value.value_equality class CircularShiftGate(PermutationGate): """Performs a cyclica...
# -*- coding: utf-8 -*- from __future__ import absolute_import from . import base class SubChannel: """ Wrapper for a pubsub subscription object that allows for easy closing of subscriptions. """ def __init__(self, sub): self.__sub = sub def read_message(self): return next(self.__sub) def __iter__(self)...
from __future__ import unicode_literals import webnotes from webnotes.utils import cint, cstr, default_fields, flt from webnotes.model import default_fields from webnotes.model.doc import Document, addchild, make_autoname from webnotes.model.bean import getlist from webnotes import msgprint from webnotes.model.doctype...
__author__ = "ohenry" __date__ = "2016-01-09 09:19" __version__ = "1.0" __all__ = ['InterpolationLinear'] import egads.core.egads_core as egads_core import egads.core.metadata as egads_metadata import numpy as np class InterpolationLinear(egads_core.EgadsAlgorithm): """ FILE interpolation_linear.p...
import logging from rakshaclient.v1 import client as rakshaclient from django.conf import settings from horizon import exceptions from openstack_dashboard.api.base import url_for, APIDictWrapper LOG = logging.getLogger(__name__) FOLDER_DELIMITER = "/" def backupjob_api(request): insecure = getattr(settings,...
import glob import os import sys import ah_bootstrap from setuptools import setup #A dirty hack to get around some early import/configurations ambiguities if sys.version_info[0] >= 3: import builtins else: import __builtin__ as builtins builtins._ASTROPY_SETUP_ = True from astropy_helpers.setup_helpers impor...
# -*- coding: UTF-8 -*- ''' furk scraper for Exodus forks. Nov 9 2018 - Checked Updated and refactored by someone. Originally created by others. ''' import requests, json, sys from resources.lib.modules import source_utils, cleantitle, control class source: def __init__(self): self.priori...
source("../../shared/qtcreator.py") qmlEditor = ":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget" outline = ":Qt Creator_QmlJSEditor::Internal::QmlJSOutlineTreeView" treebase = "keyinteraction.Resources.keyinteraction\\.qrc./keyinteraction.focus." def main(): sourceExample = os.path.join(Qt5Path.examplesPath(Targe...
""" Topologies tests """ # TODO: move to swat example from nose.plugins.skip import SkipTest from minicps.sdns import OF_MISC from minicps.utils import TEMP_DIR from mininet.net import Mininet from mininet.link import TCLink from mininet.cli import CLI from mininet.node import RemoteController @SkipTest def test...
import pyibex from pyibex import IntervalVector, Interval, LargestFirst from vibes import vibes # from pyibex.thickset import * from collections import deque from operator import itemgetter import math # import os import struct from functools import reduce # from parameters import siviaParams, drawAxis siviaParams = {...
import numpy import sys from distutils.core import setup from distutils.core import Command from distutils.extension import Extension from Cython.Distutils import build_ext from Cython.Build import cythonize # Make sure I have the right Python version. if sys.version_info[:2] < (2, 6): print(("fdasrsf requires Pyt...
from commands import Command, register_command from TestReferences import TestReferences from Timer import Timer from Config import Config import os import tempfile class CreateRefs(Command): name = 'create-refs' usage_args = '[ options ... ] tests ' description = 'Create references for tests' def __...
# -*- coding: utf-8 -*- """ This file is part of Robobackup. Copyright 2015 Siegfried Schoefer Robobackup 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 your option) any ...
import os import itertools import tempfile from autotest.client.shared import error, utils_cgroup class DeviceRate(object): """ Test cgroup blkio sub system. Use it to control file write/read rate. 1. Clear all cgroups and init modules and parent cgroup. 2. Create a sub cgroup. 3. Set proper...
""" Black-box tests of the DjangoUserStateClient against the semantics defined in edx_user_state_client. """ from collections import defaultdict from django.db import connections from edx_user_state_client.tests import UserStateClientTestBase from lms.djangoapps.courseware.tests.factories import UserFactory from l...
from argparse import ArgumentParser import os import logging import io import tempfile import shutil from . import _ from . import common from . import metadata config = None options = None def proper_format(app): s = io.StringIO() # TODO: currently reading entire file again, should reuse first # read i...
from common import * def transport_headers(): """Returns a dictionary, containing transport (http) headers to use for the request""" return {} def soap_action(): """Returns the SOAPAction value to pass to the transport or None if no SOAPAction needs to be specified""" return "http://www.msn....
import binascii import netaddr from oslo_log import log as logging from oslo_utils import excutils import six from neutron.agent.l3 import dvr_fip_ns from neutron.agent.l3 import dvr_router_base from neutron.agent.linux import ip_lib from neutron.common import constants as l3_constants from neutron.common import exce...
# -*- coding: utf-8 -*- """ Created on 08.06.2018 @author: fboers """ import os,os.path,logging import numpy as np import matplotlib.pyplot as pl from matplotlib.backends.backend_pdf import PdfPages import mne from jumeg.base.jumeg_base import JuMEG_Base_IO logger = logging.getLogger('jumeg') __version__="2019.05...
""" Module with useful functions for getting system information @author: Jens Timmerman (Ghent University) @auther: Ward Poelmans (Ghent University) """ import fcntl import grp # @UnresolvedImport import os import platform import pwd import re import struct import sys import termios from socket import gethostname fro...
import sys sys.path.append('/home3/redwards/bioinformatics/phage_host') sys.path.append('/home3/redwards/bioinformatics/Modules') from phage import Phage import re import os import taxon ''' Code to add all the phage hosts taxonomic heirarchy to the phage host files''' wanted = ['species', 'genus', 'family', 'order',...
# -*- coding: utf-8 -*- from PyQt4 import QtGui, QtCore import model from model import session from views import requisition_template class RequisitionWidget(QtGui.QWidget): def __init__(self): super(RequisitionWidget, self).__init__() self.ui = requisition_template.Ui_Form() self.ui.set...
"""Example to solve 3D aqueous foam pipe flow using rheological Herschel-Bulkley power law for bulk and wall shear stress dependent slip velocity law for wall layer """ import numpy as np import foam_controlwrapper from simphony.core.cuba import CUBA from simphony.api import CUDS, Simulation from simphony.cuds.meta i...
# -*- coding: utf-8 -*- import maxminddb import dns.resolver import ipaddress # TODO: Move to config files GEODB_PATH = 'config/dbs/geolite2/GeoLite2-City.mmdb' AWS_COUNTRY_INDEX_PATH = 'config/dbs/awsmap/countries.index' AWS_USA_INDEX_PATH = 'config/dbs/awsmap/usa.index' DEFAULT_ZONE = 'us-east-1' class DataCenterL...
""" Run BSubtilis Network Inference with TFA BBSR. """ import numpy as np import os import sys from inferelator_ng.workflow import WorkflowBase import inferelator_ng.design_response_translation as design_response_translation from inferelator_ng.tfa import TFA from inferelator_ng.results_processor import ResultsProcess...
import random import math import sympy from sympy import latex, fraction, Symbol, Rational localid =11181500100000 letter=["a","b","c","d"] n=[0,0,0,0,0,0] m=[0,0,0,0,0] f = open("111815001.tex","w") #opens file with name of "test.txt" for x in range(0, 1000): localid = localid +1 writewrong=["\correctchoice{...
""" Error/exception classes that do not fit naturally anywhere else. """ from duplicity import log class DuplicityError(Exception): pass class UserError(DuplicityError): """ Subclasses use this in their inheritance hierarchy to signal that the error is a user generated one, and that it is therefore...
import os import pprint from apiclient import errors from auth import get_service from auth import get_auth_code from apiclient.http import MediaFileUpload from drive_util import * from pymongo import MongoClient ### Api access for drive # Note that this api will only be responsible for managing the files that # are ...
"""itemlisttest -- Test ItemList""" import gc import itertools import random import string import weakref from miro import app from miro import models from miro import util from miro.frontends.widgets import itemlist from miro.frontends.widgets import itemsort from miro.test import mock, testobjects from miro.test.fr...
import numpy as np import pandas as pd from matplotlib import pyplot as plt from GridCal.Engine.Devices.editable_device import EditableDevice, GCProp from GridCal.Engine.Devices.enumerations import DeviceType, GeneratorTechnologyType def make_default_q_curve(Snom, Qmin, Qmax, n=3): """ Compute the generator c...