content
stringlengths
4
20k
"""Script to populate datastore with system test data.""" from __future__ import print_function import os import six from gcloud import datastore from gcloud.environment_vars import TESTS_PROJECT FETCH_MAX = 20 ALL_KINDS = ( 'Character', 'Company', 'Kind', 'Person', 'Post', ) TRANSACTION_MAX_G...
from pyramid.view import view_config from dace.processinstance.core import DEFAULTMAPPING_ACTIONS_VIEWS from pontus.default_behavior import Cancel from pontus.form import FormView from pontus.view import BasicView from pontus.view_operation import MultipleView from lac.content.processes.brief_management.behaviors im...
import sys """ """ """ a dictionary """ def wordCountList(filename): word_count = {} input_file = open(filename, 'r') for line in input_file: words = line.split() for word in words: word = word.lower() if not word in word_count: word_count[word] = 1 else: word_c...
import glob import pickle from shutil import copy from tqdm import tqdm class DataHelper: """ helpers to transform and move data around add more as needed. """ def copy_specific_training_data_to_new_folder(self, source_folder_path, destination_folder_path, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os.path class LogAnalyzer(): """ Parses and summarizes nginx logfiles """ def __init__(self, content, topcount=5): """ Initializing """ self.summary = { "requests": {}, "ips": {}, "useragents": {} ...
import gzip import logging import zlib try: from cStringIO import StringIO except ImportError: from StringIO import StringIO # pylint: disable-msg=W0404 from .exceptions import HTTPError log = logging.getLogger(__name__) def decode_gzip(data): gzipper = gzip.GzipFile(fileobj=StringIO(data)) retu...
""" Point of entry to the main module of the program. @author: Alvaro Navarro @organization: Grupo de Sistemas y Comunicaciones, Universidad Rey Juan Carlos @copyright: Universidad Rey Juan Carlos (Madrid, Spain) @license: GNU GPL version 2 or any later version @contact: <EMAIL> """ import sys impo...
from . import test_brew from .common import add_doc class TestBrewKojiraExpired(test_brew.BrewBase): expected_state = 'open' expected_subti = 'tag rhos-16.0-rhel-8-trunk-image-build was expired for 30 seconds' expected_link = 'https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=22335794' msg = ...
import dna.components as com from dna.states import state from dna.model import DnaModel class MyModel(DnaModel): def init(self): ''' Define all components and their nodes in their natural order Model takes care of node creation ''' ### Main loop ### self.addCompon...
"""Tests for the Fingerprint flow.""" import os from grr.lib import aff4 from grr.lib import rdfvalue from grr.lib import test_lib from grr.lib.aff4_objects import aff4_grr class TestFingerprintFlow(test_lib.FlowTestsBaseclass): """Test the FetchAllFiles flow.""" def testFingerprintPresence(self): path =...
import threading import time from pyVim import connect from pyVmomi import vim import instance LOCK = threading.Lock() class VMWInstance(instance.Instance): """Class to handle VM instance management.""" def __init__(self, name, test_config): self.host = test_config.get('test-host') self.us...
"""Drag-and-drop support for Tkinter. This is very preliminary. I currently only support dnd *within* one application, between different windows (or within the same window). I an trying to make this as generic as possible -- not dependent on the use of a particular widget or icon type, etc. I also hope that this wi...
# -*- coding: utf-8 -*- import regexUtils import re import urllib import urlparse def findJS(data): idName = '(?:f*id|ch)' jsName = '([^\"\']+?\.js[^\"\']*?)' regex = "(?:java)?scr(?:'\+')?ipt.*?" + idName + "\s*=\s*[\"']([^\"']+)[\"'][^<]*</scr(?:'\+')?ipt\s*>[^<]*<scr(?:'\+')?ipt[^<]*src=[\"']" + jsNa...
import logging from rekall import addrspace from rekall import obj # Import and register all the plugins. from rekall import plugins # pylint: disable=unused-import from rekall import session from rekall import testlib class ProfileTest(testlib.RekallBaseUnitTestCase): """Test the profile implementation.""" ...
#!/usr/bin/env python import nfc import nfc.snep import base64 import hashlib from ecdsa import VerifyingKey, NIST256p, SigningKey class DefaultSnepServer(nfc.snep.SnepServer): def __init__(self, llc): nfc.snep.SnepServer.__init__(self, llc, "urn:nfc:sn:snep") def put(self, ndef_message): prin...
''' :mod: Utils Module that collects utility functions. ''' from __future__ import absolute_import from __future__ import division from __future__ import print_function __RCSID__ = '$Id$' import fnmatch from DIRAC import gConfig, S_OK from DIRAC.Core.Utilities import List from DIRAC.ConfigurationSystem.Client.Help...
from __future__ import unicode_literals import errno import os import sys import tempfile from argparse import ArgumentParser from io import BytesIO from flask import Flask, request, abort, send_file, url_for, render_template from linebot import ( LineBotApi, WebhookHandler ) from linebot.exceptions import ( ...
""" Glance Catalog Search Server """ import os import sys import eventlet from glance.common import utils # Monkey patch socket, time, select, threads eventlet.patcher.monkey_patch(socket=True, time=True, select=True, thread=True, os=True) # If ../glance/__init__.py exists, add ../ to...
from bkr.server.model import session, SystemPool from bkr.inttest import data_setup from bkr.inttest.client import ClientError, run_client, ClientTestCase from sqlalchemy.orm.exc import NoResultFound class DeleteSystemPool(ClientTestCase): def test_delete_pool(self): with session.begin(): pool_...
import os import sys import unittest sys.path.append(os.getcwd()) from models.tape import Tape class TapeTest(unittest.TestCase): def test_left_right_move(self): test_tape = Tape(['1', '0', '1'], '1', ['0']) result_tape = Tape(['1', '0', '1'], '1', ['0']) result_tape.move_head_left() ...
from __future__ import unicode_literals from django.test.client import RequestFactory from .base import AllAccessTestCase from allaccess.context_processors import available_providers class AvailableProvidersTestCase(AllAccessTestCase): "Processor to add available Providers to the context." def setUp(self):...
import unittest from espressopp import pmi from espressopp.esutil import Collectives as collectives import mpi4py.MPI as MPI class TestCollectives(unittest.TestCase): def testLocate(self): for owner in range(MPI.COMM_WORLD.size - 1): if pmi.isController: res = collectives.locate...
# -*- coding: utf-8 -*- """ This is a Numeric/numpy free port of the method: Scientific.Geometry.Transformation.Rotation.axisAndAngle(self) From Konrad Hinsen ScientificPython http://dirac.cnrs-orleans.fr/plone/software/scientificpython """ __author__ = "Pierre Legrand (pierre legrand \at synchrotron-soleil fr)" __da...
# encoding: utf-8 """Pickle related utilities. Perhaps this should be called 'can'.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import copy import logging import sys from types import FunctionType try: import cPickle as pickle except ImportError: im...
# -*- coding: utf-8 -*- """ Contains classes to handle images related things # Requires PIL or pillow """ from hyde.plugin import CLTransformer, Plugin import glob import os import re from fswrap import File from hyde.exceptions import HydeException class PILPlugin(Plugin): def __init__(self, site): ...
from requestbuilder import Arg from euca2ools.commands.ec2 import EC2Request class DeleteDhcpOptions(EC2Request): DESCRIPTION = 'Delete a VPC DHCP option set' ARGS = [Arg('DhcpOptionsId', metavar='DHCPOPTS', help='ID of the DHCP option set to delete (required)')]
#!/usr/bin/env python import sched import time import unittest from test import support class TestCase(unittest.TestCase): def test_enter(self): l = [] fun = lambda x: l.append(x) scheduler = sched.scheduler(time.time, time.sleep) for x in [0.5, 0.4, 0.3, 0.2, 0.1]: z...
{ 'name': 'SaaS Utils', 'version': '11.0.1.0.1', 'author': 'OpenJAF, Nicolas JEUDY', 'license': 'LGPL-3', "support": "<EMAIL>", 'website': 'http://www.openjaf.com', 'category': 'Base', 'depends': ['base'], 'installable': True }
# Django settings for cigar_example project. from os.path import dirname, abspath, join DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ) MANAGERS = ADMINS DJANGO_ROOT = dirname(dirname(abspath(__file__))) def root(*x): return abspath(join(abspath(DJANGO_ROOT), *x)) DATABASES = { 'default': { 'ENG...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_iso8601, float_or_none, ExtractorError, int_or_none, ) class NineCNineMediaIE(InfoExtractor): IE_NAME = '9c9media' _GEO_COUNTRIES = ['CA'] _VALID_URL = r'9c9media:(?P<destination_co...
from malwareconfig import crypto from malwareconfig.common import Decoder from malwareconfig.common import string_printable class Bozok(Decoder): decoder_name = "Bozok" decoder__version = 1 decoder_author = "@kevthehermit" decoder_description = "Bozok Decoder" def __init__(self): self.con...
import os import numpy import commutemate.utils as utils from commutemate.roi import PointOfInterest, RegionOfInterest class Metrics(object): def __init__(self, ROIs, workspace_folder): self.ROIs = ROIs self.workspace_folder = workspace_folder self.POIs = {} self.metrics = {} ...
import logging try: from ctypes import cdll except: cdll = None from tuxemon.rumble.tools import * # Set up logging for the rumble manager. logger = logging.getLogger(__name__) class RumbleManager: def __init__(self): """The Rumble Manager automatically selects an available rumble backen...
import os from distill.sessions import UnencryptedLocalSessionStorage try: import testtools as unittest except ImportError: import unittest import json from distill.decorators import before, after from distill.exceptions import HTTPNotFound, HTTPBadRequest, HTTPErrorResponse, HTTPInternalServerError from disti...
import select import errno import time import socket import select import inspect import json import zlib import threading try: import ssl except ImportError: ssl = None try: from cherrypy import wsgiserver as cheery_wsgiserver except ImportError: cheery_wsgiserver = None try: from OpenSSL import S...
import sqlite3 as lite import csv con = lite.connect('smartly.db') with con: cur = con.cursor() cur.execute("DROP TABLE IF EXISTS ad_statistics") cur.execute("DROP TABLE IF EXISTS ad_actions") cur.execute("CREATE TABLE IF NOT EXISTS ad_statistics(ad_id INTEGER, date TEXT, impressions INTEGER, clicks INTEGER, spen...
'''[one line description of the module] [this is a multiline description of what the module does.] Before you Begin ================ Make sure that the configuration files are properly set, as mentioned in the Specifcations section. Also, [add any other housekeeping that needs to be done before starting the modul...
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2017 Rapptz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to u...
#!/usr/bin/env python import argparse import socket import threading import signal import time from threading import Thread questions = [ "Does god exist?", "Why do we have to learn about git?", "Do you like coffee?", "Do you like chocolate", "How was your first day at altran?", "What's the an...
"""Creates application specific meta-installers. Run this script with the directory that contains the build files, GoogleupdateSetup_<lang>.exe and pass it the file that contains the application information to be stamped inside the binary. """ import codecs import os import sys import re import urllib class Bundle:...
import logging import os import sys import threading from flask import Flask, Response from flask_compress import Compress from history.statebuffer import BufferCollection, BufferUpdater compress = Compress() state_buffer = None log = logging.getLogger(__name__) add_headers_cb = None try: import dcos_auth_pyt...
""" Tests for Trial's interaction with the Python warning system. """ from __future__ import division, absolute_import import sys, warnings from unittest import TestResult from twisted.python.compat import NativeStringIO as StringIO from twisted.python.filepath import FilePath from twisted.trial.unittest import Syn...
# vim: set ff=unix expandtab ts=4 sw=4: import numpy as np from sympy import latex from .FieldsPerTimeStep import FieldsPerTimeStep from matplotlib import cm import matplotlib.pyplot as plt class TsMassFieldsPerTimeStep(FieldsPerTimeStep): @property def max_number_of_Ts_entries(self): return(max([v.num...
# Written 17/1/14 by dh4gan # Code reads in log files from multiple EBMs in the same simulation, and plots (meanT - mean(meanT))/mean(mean(T)) import matplotlib.pyplot as plt import numpy as np import io_oberon.io_EBM import filefinder.localfiles as ff # Open log files and read contents inputfiles = ff.find_sorted_l...
# coding: utf-8 import re import os import sys import json import socket import datetime import subprocess import logbook logbook.set_datetime_format('local') logger = logbook.Logger('sbackup2') def get_task_files(path): abs_path = os.path.abspath(path) items = os.listdir(abs_path) re_conf = re.compile...
#!/usr/bin/env python import unittest import os import tarfile import zipfile import tempfile import shutil from sos.archive import TarFileArchive, ZipFileArchive # PYCOMPAT import six class ZipFileArchiveTest(unittest.TestCase): def setUp(self): self.zf = ZipFileArchive('test') def tearDown(self)...
from django.utils import six class FileProxyMixin(object): """ A mixin class used to forward file methods to an underlaying file object. The internal file object has to be called "file":: class FileProxy(FileProxyMixin): def __init__(self, file): self.file = file ...
# -*- coding: utf-8 -*- import re from django.conf import settings from django.template import TemplateDoesNotExist from django.template.loaders import app_directories from django.template.loaders import filesystem from django_jinja.base import env import jinja2 if hasattr(settings, "DEFAULT_JINJA2_TE...
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='ton', version='0.0....
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from atomic_reactor.plugin import PreBuildPlugin from atomic_reactor.plugins.pre_reactor_config import get_openshift_session from atomic_reac...
"""Config File Handler""" import os try: import configparser except ImportError: import ConfigParser as configparser # pylint: disable=invalid-name _config = configparser.SafeConfigParser() _config.read([ 'config/bogo_probe.cfg', os.path.join(os.path.expanduser('~'), '.bogo_probe.cfg')]) # funcs not c...
from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import get_link_to_form from frappe.model.document import Document class StudentLeaveApplication(Document): def validate(self): self.validate_duplicate() def validate_duplicate(self): data = frappe.db.sql(""" select nam...
import tempfile import memcache import commands import hashlib import random import urllib import time import sys import os FFMPEG_PATH = '/web/content/shared/bin/ffmpeg-2.1-bin/ffmpeg-2.1.sh' FFPROBE_PATH = '/web/content/shared/bin/ffmpeg-2.1-bin/ffprobe-2.1.sh' TS_PREPARER_PATH = 'node %s' % os.path.join(os.path.dir...
from .tests_setup import BaseTest class AuthTestCase(BaseTest): def Setup(self): pass def test_user_registers_succesfully(self): """ Test that a user can register successfully """ test_user = {'username': 'test_user', 'password': 'password', ...
""" ================= Lorentzian Fitter ================= """ from __future__ import print_function import numpy from numpy.ma import median from numpy import pi from ...mpfit import mpfit from . import fitter from six.moves import xrange class LorentzianFitter(fitter.SimpleFitter): def __init__(): self.n...
import os, getopt, sys import subprocess import shutil #change this to the full path to your ThinkUp installation. E.g., # "/home/username/yourpathto/ThinkUp" or # "C:/yourpathto/ThinkUp" TODOTXTOUCH_HOME = '/Users/gina/Documents/data/code/todo.txt-android' excludedir = ["/assets", "/.git", "/bin", "/extras", "/ge...
import argparse import os parser = argparse.ArgumentParser() parser.add_argument('--panda3d-dir', default='C:/Panda3D-1.9.0', help='The path to the Panda3D build to use for this distribution.') parser.add_argument('--main-module', default='infinite.base.ClientStartDist', help='...
from django.core.cache import cache import weblate class Check(object): ''' Basic class for checks. ''' check_id = '' name = '' description = '' target = False source = False ignore_untranslated = True default_disabled = False severity = 'info' def __init__(self): ...
# -*- coding: utf-8 -*- import pytest import requests import responses import copy import datetime import re from economicpy.jira import Jira from unittest import TestCase CONFIG = [ ('username', 'sample_username'), ('password', 'sample_password'), ('api_url', 'http://jira.example.com/'), ] class TestJir...
from os import path import gi gi.require_version('GLib', '2.0') from gi.repository import GLib from eos_data_distribution.names import SUBSCRIPTIONS_SOMA from eos_data_distribution.store import simple_store import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) if __name__ == '_...
from article_metrics.utils import lmap from .logic import generic_ga_filter def query_processor_frame_1(ptype, frame): adhoc = lmap(lambda path: "ga:pagePath==%s" % path, [ "/from-ancient-dna-to-decay-an-interview-with-jessica-metcalf", "/food-for-thought-an-interview-with-ana-domingos", "...
# -*- coding: utf-8 -*- # pylint: disable=no-member """Tests for the teams API at the HTTP request level.""" import itertools from contextlib import contextmanager from datetime import datetime import ddt import pytz from mock import Mock from opaque_keys.edx.keys import CourseKey from django_comment_common.signals i...
from gi.repository import Gtk from lollypop.define import Lp from lollypop.toolbar_playback import ToolbarPlayback from lollypop.toolbar_infos import ToolbarInfos from lollypop.toolbar_title import ToolbarTitle from lollypop.toolbar_end import ToolbarEnd class Toolbar(Gtk.HeaderBar): """ Lollypop toolbar...
from .base_test import BaseTestCase from .util import rand_str, rand_email from userkit import error class TestLogs(BaseTestCase): def test_custom_audit_log(self): # create a test user email = rand_email() user = self.uk.users.create_user(email=email, password=rand_str(14)) # crea...
"""empty message Revision ID: 0007 add event_dates Revises: 0006 add alternate_names speaker Create Date: 2018-03-12 22:34:17.341718 """ # revision identifiers, used by Alembic. revision = '0007 add event_dates' down_revision = '0006 add alternate_names speaker' from alembic import op import sqlalchemy as sa from s...
""" Copyright (c) 2016 Keith Sterling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute,...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Simple utility to calculate different types of hashes from given files/data """ from __future__ import print_function, unicode_literals import argparse import fileinput import hashlib import os import sys import zlib try: from io import StringIO except ImportErr...
""" Conv Int8 functional and performance testing""" import sys import logging import numpy as np import tvm from tvm import te from tvm import topi logging.basicConfig(stream=sys.stdout, level=logging.INFO) LOGGER = logging.getLogger("test_conv_int8_intel") LOGGER.disabled = False # All the WORKLOADS from Resnet exce...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ PAM User Authentication ======================== This enables users to authenticate in PAM with their Pentaho user account The primary use of this is so Pentaho users can be the same as RStudio Server users The /etc/pam.d/rstudio config file should look like: auth re...
import re from handlers.base import handlers, MessageHandler class HelpHandler(MessageHandler): TRIGGERS = ['help'] HELP = 'help for the given command; default all commands' _RESPONSES = None def handle_message(self, event, query): if self._RESPONSES is None: self._init_responses() parts = [...
""" Commands to query CKan data """ import json import logging import os import sqlite3 from ckan_api_client.syncing import SynchronizationClient from .base import CkanCommandBase class ImportDirectory(CkanCommandBase): """ Import data from a directory. Data should be organized like this:: sour...
""" @author: Andrew Case @license: GNU General Public License 2.0 @contact: <EMAIL> @organization: """ import volatility.obj as obj import volatility.plugins.linux.common as linux_common import volatility.plugins.linux.pslist as linux_pslist class linux_lsof(linux_pslist.linux_pslist): """Lists o...
# -*- encoding: utf-8 -*- from django.db import models from django.utils.translation import ugettext_lazy as _ from aaee_front.apps.locations.models import Location from aaee_front.lib.roa_utils import DjangoROAModel class EventOrganiser(DjangoROAModel): api_base_name = 'events/organisers' id = models.Intege...
import numpy as np class awg_channel_carrier: def __init__(self, parent, frequency):#, mixer): """ """ self.awg = parent.awg self.channel = parent.channel self.frequency = frequency self.status = 1 self.parent = parent self.parent.carriers.append(self) self.waveform = None def set_frequency(self, ...
""" This file creates catalyst-EDW specific tables """ import sqlite3 from healthcareai.common.healthcareai_error import HealthcareAIError def drop_table(db_name, table_name): """ Given a sqlite db filename, drops a given table if it exists. """ db = sqlite3.connect(db_name) cursor = db.cursor() que...
import traceback from django.shortcuts import render from allauth.exceptions import ImmediateHttpResponse from allauth.socialaccount import providers from allauth.socialaccount.adapter import DefaultSocialAccountAdapter from pootle.middleware.errorpages import log_exception from .utils import get_user_by_email from...
#coding=utf-8 ''' https://fisherzachary.github.io/public/r-output.html ''' import math from boundings import * from shapes import * class ShapeDescriptor(): def __init__(self, poly): self._poly = poly self.BG = BoundingGeometry(self._poly.points) def Area(self): return self._poly.area()...
from django.contrib.auth import get_user_model from django.urls import reverse from rest_framework import status from rest_framework.test import APITestCase from rest_framework.test import APIClient from rest_framework.test import APIRequestFactory from rest_framework.test import force_authenticate import base64 impor...
import argparse import numpy as np import random import torch import torch.nn.functional as F from PIL import Image from progan_modules import Generator, Discriminator from torch import nn, optim from torch.autograd import Variable, grad from torch.utils.data import DataLoader from torchvision import datasets, transfor...
{ "name": "Wizard to validate multiple moves", "version": "1.0", "depends": ["base", "account", "account_constraints"], "author": "Camptocamp", 'license': 'AGPL-3', "description": """ Re-defining a base wizard (validate all moves in a period for a journal), but extending it to multiple periods a...
""" Defines data types and models required specifically for Ipv6 Flow Specification support. """ import logging from ryu.lib.packet.bgp import FlowSpecIPv6NLRI from ryu.lib.packet.bgp import RF_IPv6_FLOWSPEC from ryu.services.protocols.bgp.info_base.base import Path from ryu.services.protocols.bgp.info_base.base i...
# coding: utf-8 # # Talks markdown generator for academicpages # # Takes a TSV of talks with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_is_...
import unittest, responses, requests, json, mock from urlparse import parse_qsl, parse_qs from kong_plugin import KongPlugin, ModuleHelper, main from ansible.module_utils.basic import * mock_kong_admin_url = "http://192.168.99.100:8001" class KongPluginTestCase(unittest.TestCase): def setUp(self): self.api = Ko...
from . import defn_standard, dialog_standard from . import defn_csv, dialog_csv from . import defn_fits, dialog_fits from . import defn_twod, dialog_twod from . import defn_nd, dialog_nd from . import defn_hdf5, dialog_hdf5 from . import defn_plugin, dialog_plugin
#!/usr/bin/env python3 import sys import re import math import platform import xml.etree.ElementTree as ET ################################################################################ # Config # #################################################...
import base64,hashlib,os,random,re,requests,shutil,string,sys,urllib,urllib2,json,urlresolver import xbmc,xbmcaddon,xbmcgui,xbmcplugin,xbmcvfs from addon.common.addon import Addon from addon.common.net import Net from resources import control from resources import cloudflare addon_id = 'script.module.wolfpack' selfA...
class BootstraperBase (object): def __init__(self, config): self.config = config def start(self): raise NotImplemented("'start' must be implemented by subclasess")
# -*- coding: utf-8 -*- import unittest import tests.common from core.localisation import _ import json class dropTests(tests.common.common): # Quantity tests def test_invalid_quantity_text(self): inv = self.getInventory() self.rpg.setAction([_('DROP_COMMAND'), 'ten', 'Heavy breastplate', 'chest', 1]) outpu...
from functools import partial import os.path import shutil import time from rez.config import config from rez.exceptions import PackageCopyError from rez.package_repository import package_repository_manager from rez.packages import Variant from rez.serialise import FileFormat from rez.utils import with_noop from rez.u...
import unittest from asq.queryables import Queryable from asq.test.test_queryable import infinite, TracingGenerator class TestSelectWithIndex(unittest.TestCase): def test_select_with_index(self): a = [27, 74, 18, 48, 57, 97] b = Queryable(a).select_with_index().to_list() c = [(0, 27), (1, ...
import json5_generator def sort_keyword_properties_by_canonical_order( css_properties, css_value_keywords_file, json5_file_parameters): """Sort all keyword CSS properties by the order of the keyword in css_value_keywords.json5 Args: css_properties: css_properties excluding extra fields...
import numpy as np from scipy.stats import binned_statistic from scipy.fft import fft, ifft from scipy.optimize import brent from astropy.table import Table from astropy.modeling.models import Lorentz1D from stingray import Lightcurve, Crossspectrum from stingray.utils import standard_error, find_nearest from stingra...
from Src.BioAnalyzer.Analysis.GenePrioritization.Steps.DifferentialAnalysis.Analyzers.DnaMethylationSampleDifferentialAnalyzer import \ DnaMethylationSampleDifferentialAnalyzer from Src.BioAnalyzer.Analysis.GenePrioritization.Steps.DifferentialAnalysis.Analyzers.MessengerRnaSampleDifferentialAnalyzer import \ M...
from PyQt5.QtCore import * from xml.etree import ElementTree as etree import os __author__ = "C. Wilhelm" ___license___ = "GPL v3" class ElementTreeModel(QAbstractItemModel): """ Model for ElementTree Data Structures inspired by: https://pypi.python.org/pypi/EuroPython2006_PyQt4_Examples/ also read: http://qt-p...
#!/usr/bin/python2.7 import argparse import os from VERSION import version def extant_file(x): """ 'Type' for argparse - checks that file exists but does not open. """ if not os.path.exists(x): raise argparse.ArgumentError("{0} does not exist".format(x)) return x def __main__(): pa...
import mock from openerp.exceptions import ValidationError from openerp.tests.common import TransactionCase @mock.patch( 'openerp.addons.auth_totp.wizards.res_users_authenticator_create.pyotp' ) class TestResUsersAuthenticatorCreate(TransactionCase): def setUp(self): super(TestResUsersAuthenticatorCr...
from Products.CMFCore.utils import getToolByName from tn.plonemailing import behaviors from tn.plonemailing import interfaces from zope.app.testing import placelesssetup import datetime import stubydoo import plone.app.controlpanel.mail import unittest import zope.annotation import zope.interface import zope.intid imp...
from spack import * class Bamutil(MakefilePackage): """bamUtil is a repository that contains several programs that perform operations on SAM/BAM files. All of these programs are built into a single executable, bam. """ homepage = "http://genome.sph.umich.edu/wiki/BamUtil" url = "ht...
#!/usr/bin/env python import sys import parsimonious import grammar class StraceVisitor(parsimonious.NodeVisitor): def visit_argument(self, node, visited_children): return visited_children[0] def visit_entry(self, node, (prefix, entry, suffix)): return entry def visit_dict_argument(self, ...
""" General EasyBuild support for installing the Enthought Python Distribution @author: Jens Timmerman """ import os from easybuild.tools.filetools import run_cmd from easybuild.easyblocks.generic.binary import Binary class EB_EPD(Binary): """Easyblock implementing the build step for EPD, this is just runni...