code
stringlengths
1
199k
registrationClosed = True season = 2016 entry_cost = 300 perfect_bonus = 500 perfect_awards = [] mailserver_host = mailserver_port = mailserver_username = mailserver_password = mysql_hostname = mysql_dbname = mysql_username = mysql_password =
c.confirm_quit = ['multiple-tabs', 'downloads'] c.editor.command = ['st', '-e', 'vim', '{}'] c.statusbar.hide = True c.tabs.show = 'multiple' c.url.default_page = 'https://www.youtube.com/' c.url.start_pages = ['https://www.youtube.com/'] config.bind('xb', 'config-cycle statusbar.hide') config.bind('xt', 'config-cycle ...
import re from pyquery import PyQuery from novel import serial, utils, config BASE_URL = 'http://www.lwxs.com/shu/{}/{}/' INTRO_URL = 'http://www.lwxs.com/info-{}.html' class Lwxs(serial.SerialNovel): def __init__(self, tid): super().__init__(utils.base_to_url(BASE_URL, tid), '.zhangjieTXT', ...
from django.test import TestCase from django.test.utils import tag from edc_metadata.models import CrfMetadata, RequisitionMetadata from edc_sync.models import OutgoingTransaction, IncomingTransaction from edc_visit_schedule.site_visit_schedules import site_visit_schedules from household.models.household import Househo...
from __future__ import print_function import abc import math import itertools import os import re import shutil import sys import time import traceback import pexpect import fnmatch import operator from MAVProxy.modules.lib import mp_util from pymavlink import mavwp, mavutil, DFReader from pysim import util, vehicleinf...
"""Form Directives Tests $Id: test_directives.py 67630 2006-04-27 00:54:03Z jim $ """ import os import unittest from cStringIO import StringIO from zope import component from zope.component.interfaces import ComponentLookupError from zope.configuration.xmlconfig import xmlconfig, XMLConfig from zope.traversing.interfac...
"""Unittest for Earthquake Report.""" import os import io import shutil import unittest from jinja2.environment import Template from safe.common.utilities import safe_dir from safe.definitions.constants import ANALYSIS_SUCCESS from safe.definitions.reports.components import ( standard_impact_report_metadata_html, ...
import re, nltk from nltk.corpus import stopwords from nltk.tokenize import word_tokenize stop_words = stopwords.words("english") list_stop_words = ["et","also","far","thus","sea","whereas","any","other"] list_tag7 = [['NNP', 'NN', 'NN', '.', 'NN', 'NNP', 'CD']] list_tag6 = [['NNP', 'NNP', 'NN', 'NN', '.', 'NNP']] list...
import os.path from flask import Flask, redirect, url_for from flask_admin import Admin from flask_login import (current_user, UserMixin, LoginManager, login_user, logout_user) from flask_admin.contrib.sqla import ModelView from flask_admin.contrib.fileadmin import FileAdmin from flask_admin.ba...
import sys import urllib, urllib2 import xbmc import xbmcgui import XbmcHelpers common = XbmcHelpers from videohosts import tools URL = "http://kodik.top" PARTS = ("/films/", "/serials/") HEADERS = { "Origin": "http://kodik.top", "Host": "kodik.top", "Referer": "{0}", "User-Agent": "Mozilla/5.0 (Window...
""" example_a.py by Ted Morin contains example code for model a from 10.1161/STROKEAHA.113.004506 2014 Intracranial Hemorrhage Among Patients With Atrial Fibrillation Anticoagulated With Warfarin or Rivaroxaban """ from model_a import model toscore = [ [66, 74, 322, 3.8, 1, 0, 0, 0, 0, 1], [85, 82, 205, 4.4, 0,...
from __future__ import unicode_literals, division from .common import InfoExtractor from ..utils import int_or_none class CrackleIE(InfoExtractor): _VALID_URL = r'(?:crackle:|https?://(?:(?:www|m)\.)?crackle\.com/(?:playlist/\d+/|(?:[^/]+/)+))(?P<id>\d+)' _TEST = { 'url': 'http://www.crackle.com/comedia...
""" tests for InProcessComputingElement module """ import os import shutil import pytest from DIRAC.Resources.Computing.test.Test_PoolComputingElement import jobScript, _stopJob from DIRAC.WorkloadManagementSystem.Utilities.Utils import createJobWrapper from DIRAC.Resources.Computing.InProcessComputingElement import In...
__author__ = 'Marcelo Ferreira da Costa Gomes' import pandas as pd import matplotlib.pyplot as plt import seaborn as sns df = pd.read_csv('data/data/clean_data_epiweek-weekly-incidence_w_situation_sragnofever.csv') dfs = df[['UF', 'epiyear', 'epiweek', 'dado', 'escala', ...
from imperialism_remake.server.models.workforce import Workforce class TurnPlanned: def __init__(self, nation): self._workforces = {} self._nation = nation def add_workforce(self, workforce: Workforce) -> None: self._workforces[workforce.get_id()] = workforce def remove_workforce(sel...
from ansiblereport.utils import * from ansiblereport.model import * class OutputModule: ''' A simple plugin that displays report information to STDOUT. Per requirements, it implements: name Attribute with the name of the plugin do_report Method that will take a list of events and report ...
""" CFG for the a^n b^n language. """ import pyactr as actr cfg = actr.ACTRModel() actr.chunktype("countOrder", "first, second") actr.chunktype("countFrom", ("start", "end", "count", "terminal")) dm = cfg.decmem dm.add(actr.chunkstring(string=""" isa countOrder first 1 second 2 """)) dm.a...
''' The top level of this package contains some basic types used throughout PyVision. Subpackages some of the more advanced functionality of the PyVision library. These include: * Image Processing * Detection * Machine Learning * Optimization/Search * Face Recognition * Analysis Typically, all...
""" Interact with CSV files in GTFS feeds. """ import collections import csv import io import operator import sys import typing import zipfile CSV_Row = typing.Dict[str, str] CSV_Restrictions = typing.Dict[str, typing.Collection[str]] class FilteredCSV: FILE_SIZE_THRESHOLD: int = 1 << 20 FILE_SIZE_PREFIXES: typ...
from nose.tools import * from os import environ as env from skelpy.skelpy import SkelPy from skelpy.arg_parser import ArgParser import tempfile import shutil import os from time import sleep from mock import MagicMock, patch, Mock class Test_SkelPy(object): def setup(self): self.old_pwd = env['PWD'] self.temp_dir ...
import logging import os import re from braces.views import LoginRequiredMixin from django.conf import settings from django.core.cache import cache from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse from django.db.models import Q from django.http import Http404 from django....
def init(): from . import mainWindow, workspace, helper from devparrot.core import session session.window = mainWindow.MainWindow() session.set_globalContainer(session.window.get_globalContainer()) session.set_workspace(workspace.Workspace()) session.bindings.bind(session.window) session.hel...
import os import re import subprocess import sys import tempfile import urlparse from wptrunner.update.sync import LoadManifest from wptrunner.update.tree import get_unique_name from wptrunner.update.base import Step, StepRunner, exit_clean, exit_unclean from .tree import Commit, GitTree, Patch import github from .gith...
{ "log": [ # Note stderr is the only module affected by command line options -v -q { "module": "stderr", "levels": ["info", "error", "alert"] }, { "module": "file", "file": "logs/debug.txt", "mode": "w", "...
import os from urllib.parse import parse_qsl, urlparse from django.core.cache import caches from mock import Mock, patch from bedrock.firefox.firefox_details import FirefoxAndroid, FirefoxDesktop, FirefoxIOS from bedrock.mozorg.tests import TestCase TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), "test_data") P...
"""Example of qdarkstyle use for Python and Qt applications. This module a main window with every item that could be created with Qt Design (common ones) in the basic states (enabled/disabled), and (checked/unchecked) for those who has this attribute. Requirements: - Python 2 or Python 3 - QtPy - PyQt5 or P...
import copy import re from datetime import datetime from os import listdir, remove from os.path import exists, join from subprocess import CalledProcessError from unittest.mock import patch import f90nml import numpy as np import pandas as pd import pytest from openscm_units import unit_registry from pymagicc import MA...
""" Countries list for the countries app. """ COUNTRIES_CHOICES = ( ('AFG', "Afghanistan"), ('ALB', "Albania"), ('DZA', "Algeria"), ('ASM', "American Samoa"), ('AND', "Andorra"), ('AGO', "Angola"), ('AIA', "Anguilla"), ('ATA', "Antarctica"), ('ATG', "Antigua and Barbuda"), ('ARG'...
import re import uuid from math import * import time import re import requests from types import SimpleNamespace import unicodedata from pprint import pformat as pf import json from base.data_set import create_dataset from base.trait import create_trait from base.webqtlConfig import PUBMEDLINK_URL from wqflask import p...
from . import select_work_acceptance_wizard from . import work_accepted_date_wizard
from sys import version_info try: from hashlib import md5 except ImportError: from md5 import md5 if version_info[0:2] > (2, 2): from unicodedata import normalize else: normalize = None from urlparse import urlparse, urljoin, urldefrag from rdflib.Identifier import Identifier from rdflib.compat import r...
from osv import osv from osv import fields import time class oehealth_authorization(osv.Model): _name = 'oehealth.authorization' _description = "Health Authorization" def _compute_create_uid(self, cr, uid, ids, field_name, arg, context={}): result = {} for r in self.browse(cr, uid, ids, cont...
from openerp.osv import osv, fields from openerp.tools.translate import _ class CommissionRule(osv.Model): """Commission Rule""" _name = 'sale.commission.rule' _description = __doc__ def _check_post_expiration_days(self, cr, uid, ids, context=None): for rule in self.browse(cr, uid, ids, context=...
from __future__ import unicode_literals import uuid import django.db.models.deletion from django.db import migrations, models from reference.migrations.utils.uuid import set_uuid_field class Migration(migrations.Migration): replaces = [('reference', '0001_initial'), ('reference', '0002_auto_20160414_1720'), ...
from openerp import models, api, _ class payment_order(models.Model): _inherit = "payment.order" @api.multi def action_open(self): """ Logs a note in invoices when imported in payment order """ for order in self: order_type = order._get_order_type() if order_type: ...
""" Models for Student Identity Verification This is where we put any models relating to establishing the real-life identity of a student over a period of time. Right now, the only models are the abstract `PhotoVerification`, and its one concrete implementation `SoftwareSecurePhotoVerification`. The hope is to keep as ...
import pytz from odoo import _, api, fields, models from odoo.addons.mail.models.mail_template import format_tz from odoo.exceptions import AccessError, UserError, ValidationError from odoo.tools.translate import html_translate from dateutil.relativedelta import relativedelta class EventType(models.Model): _name = ...
import rq from flask import g from mock import Mock, patch from naverwebtoonfeeds.ext import get_queue from naverwebtoonfeeds.feeds.worker import run_worker class Worker(rq.Worker): def fork_and_perform_job(self, job): self.perform_job(job) @patch('naverwebtoonfeeds.feeds.worker.Crawler') def test_run_worke...
"""Power parameters. Each possible value of a Node's power_type field can be associated with specific 'power parameters' wich will be used when powering up or down the node in question. These 'power parameters' will be stored as a JSON object in the Node's power parameter field. Even if we want to allow arbitrary po...
from setuptools import setup, find_packages # Always prefer setuptools over distutils from codecs import open # To use a consistent encoding from os import path from setuptools.command.install import install class post_install(install): def run(self): from arches.setup import install as arches_install ...
from __future__ import unicode_literals import webnotes import webnotes.defaults import json from webnotes import msgprint, _ from webnotes.utils import cstr, flt, cint from stock.stock_ledger import update_entries_after from controllers.stock_controller import StockController from stock.utils import update_bin class D...
from httplib import BadStatusLine, IncompleteRead, InvalidURL from StringIO import StringIO from g2o_params import * import urlparse import hashlib import urllib2 import base64 import socket import shutil import hmac import time import gzip def parseHttpHeaders(headers): result = {} for header in headers: header = ...
""" Student Views """ import datetime import logging import uuid import json import warnings from collections import defaultdict from urlparse import urljoin, urlsplit, parse_qs, urlunsplit from django.views.generic import TemplateView from pytz import UTC from requests import HTTPError from ipware.ip import get_ip imp...
"""Django admin interface for the shopping cart models. """ from __future__ import absolute_import from django.contrib import admin from shoppingcart.models import ( Coupon, CourseRegistrationCodeInvoiceItem, DonationConfiguration, Invoice, InvoiceTransaction, PaidCourseRegistrationAnnotation ) ...
from opencog.type_constructors import * from opencog_b.python.blending.chooser.chooser_finder import ChooserFinder from opencog_b.python.blending.connector.connector_finder import ConnectorFinder from opencog_b.python.blending.decider.decider_finder import DeciderFinder from opencog_b.python.blending.maker.maker_finder...
from marshmallow.validate import * # NOQA from marshmallow.validate import Validator, ValidationError class NotEmpty(Validator): def __call__(self, value): if len(value) == 0: raise ValidationError("Must not be empty.") class EmptyOr(Validator): def __init__(self, other_validator): ...
""" Add headsign in trip_update Revision ID: 2fd9b0178f6a Revises: 51d98b3b8e58 Create Date: 2019-04-18 11:26:09.789277 """ revision = "2fd9b0178f6a" down_revision = "51d98b3b8e58" from alembic import op import sqlalchemy as sa def upgrade(): op.add_column("trip_update", sa.Column("headsign", sa.Text(), nullable=Tr...
{ "name": "Image URLs from HTML field", "summary": "Extract images found in any HTML field", "version": "12.0.1.0.0", "category": "Tools", "website": "https://github.com/OCA/server-tools", "author": "Tecnativa, " "Onestein, " "Odoo Community Association (OCA)", "l...
""" Slightly customized python-social-auth backend for SAML 2.0 support """ from __future__ import absolute_import import logging from copy import deepcopy import requests from django.contrib.sites.models import Site from django.http import Http404 from django.utils.functional import cached_property from django_countri...
import os EXECUTE_SUCCESS = os.EX_OK EXECUTE_FAILURE = 1 EXECUTE_ERROR = os.EX_SOFTWARE EXECUTE_SYSTEM_FAILURE = os.EX_TEMPFAIL EXECUTE_SERVICE_UNAVAILABLE = os.EX_UNAVAILABLE UNKNOWN_ERROR = 1
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ovp_core', '0008_availability'), ] operations = [ migrations.AddField( model_name='lead', name='date', field=models.D...
""" Tests for ExtraFieldsTransformer. """ from django.test import override_settings from openedx.core.djangoapps.content.block_structure.factory import BlockStructureFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import SampleCourseFactory from .....
""" Your task is to check the "productionStartYear" of the DBPedia autos datafile for valid values. The following things should be done: - check if the field "productionStartYear" contains a year - check if the year is in range 1886-2014 - convert the value of the field to be just a year (not full datetime) - the rest ...
''' This file will need a list of objects.. FIXME elaborate ''' class TCXWriter(object): xml = '''<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <TrainingCenterDatabase xmlns="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocatio...
from setuptools import setup, find_packages # Always prefer setuptools over distutils from codecs import open # To use a consistent encoding from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name=...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('exams', '0041_merge_20170901_0933'),...
from openerp import fields, models class SaleOrder(models.Model): _inherit = 'sale.order' def _count_configured_products(self): for item in self: value = self.env['sale.order.configured.product'].search_count([ ('sale_order_id', '=', item.id) ]) item.p...
import erppeek import ConfigParser import sys cfg_file = "odoo.cfg" # same directory config = ConfigParser.ConfigParser() config.read(cfg_file) server = config.get('odoo', 'server') port = eval(config.get('odoo', 'port')) database = config.get('odoo', 'database') user = config.get('odoo', 'user') password = config.get(...
import sys import time import testutil as tu import subprocess as sp from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.chrome.options import Options def connectTest(driver): tu.goClusters(driver) return tu.clust...
""" This application is meant to substitute the profiles in Pinax, so that the profiles hold more information related to the game, such as scores, and karma. """ from django.db import models from django.db.models.signals import post_save from django.contrib.auth.models import User from django.utils.translation import u...
from . import utils from . import ticketbai from . import models
from __future__ import unicode_literals test_ignore = ["Leave Block List"] import frappe test_records = frappe.get_test_records('Department')
"""SearchIndex Model As Cassandra doesn't provide LIKE style queries we are constrained to only having direct matches and manually checking across each specific field. This isn't ideal. Until such a time as we have a better solution to searching, this model provides a simple index (and very, very simple retrieval algo...
from . import test_product_pricelist_print
import gi gi.require_version("Gtk", "3.0") # noqa: E402 from gi.repository import Gtk import json from django.utils.translation import gettext as _ from pharmaship.core.utils import log, query_count_all from pharmaship.inventory import models from pharmaship.inventory import forms from pharmaship.inventory.parsers.fir...
import re from django.core.urlresolvers import reverse from ublogging.api import Plugin class Recover(Plugin): def sidebar(self, context): if not context.get('viewing_user', '') and not context['perms'].user.is_authenticated(): return '<a href="'+reverse('contrib.recoverpw.views.index')+'">Passw...
import json from django.utils import timezone from django.views.generic.edit import CreateView from django.http import HttpResponseRedirect, HttpResponse from .models import Account, Adjustment from .forms import AdjustmentForm class AdjustmentView(CreateView): form_class = AdjustmentForm model = Account de...
from django.conf import settings from django.db.models import Count, ExpressionWrapper, F, FloatField, Sum from django.db.models.functions import Cast from django.utils.decorators import method_decorator from django.views.decorators.cache import cache_page from django_filters.rest_framework import DjangoFilterBackend f...
from flask import Blueprint from zou.app.utils.api import configure_api_from_blueprint from .resources import EventsResource, LoginLogsResource routes = [ ("/data/events/last", EventsResource), ("/data/events/login-logs/last", LoginLogsResource), ] blueprint = Blueprint("events", "events") api = configure_api_f...
"""Run gettext consistency checks on messages in the database. Incoming translations are always run through gettext to check for errors, mainly with conversion specifiers in format strings. But under certain circumstances (e.g. bug 317578) it's possible to have messages in the database that would fail that check in th...
"""Methods required to customize the mimetypes library.""" __metaclass__ = type __all__ = [ 'customizeMimetypes', ] import mimetypes def customizeMimetypes(): """Initialize and extend the standard mimetypes library for our needs. This method is to be called before any requests are processed to ensure ...
from datetime import datetime from odoo import api, exceptions, fields, models, _ from dateutil.relativedelta import relativedelta from odoo.tools import DEFAULT_SERVER_DATE_FORMAT import logging NUMBER_OF_UNUSED_MONTHS_BEFORE_EXPIRY = 36 logger = logging.getLogger(__name__) class AccountBankingMandate(models.Model): ...
__author__ = "AstroPrint Product Team <product@astroprint.com>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' import logging from .base import GstBasePipeline from .bins.v4l2_video_src import UsbVideoSrcBin from .bins.vp8_video_enc import VP8VideoEncBin class GstVp8Pipeline(Gst...
__metaclass__ = type from zope.component import getUtility from lp.app.interfaces.launchpad import ILaunchpadCelebrities from lp.testing import TestCaseWithFactory from lp.testing.layers import ZopelessDatabaseLayer from lp.translations.tests.helpers import ( make_translationmessage, summarize_current_translati...
import connection import manager import log as Log import share_stats import time import json import copy import proxy class Control(object): poolmap = { "pool": "stratum.nicehash.com", "port": 3333, "user": None, "pass": "x", "backup": "us.clevermining.com", "backup_...
import config as cfg class Event(object): ''' Class generating taking care of the common event properties... ''' def __init__(self,polished_event): self.data = polished_event self.duration = 0 def get_observed_event_row(self): ''' Returns an array corresponding to...
from django.utils.translation import ugettext_lazy as _ ANON_PERMISSIONS = [ ('view_project', _('View project')), ('view_milestones', _('View milestones')), ('view_epics', _('View epic')), ('view_us', _('View user stories')), ('view_tasks', _('View tasks')), ('view_issues', _('View issues')), ...
from milecastles import Story, Box, ThroughPage storyName = __name__.split(".")[-1] story = Story( uid=storyName, startNodeUid="landing", startSack = { "money": 100, } ) with story: northBox = Box( uid="north", label="Box I", description="the Northern Quarter") eastBox = Box( u...
"""ASGI""" import os from channels.asgi import get_channel_layer os.environ.setdefault("DJANGO_SETTINGS_MODULE", "teroftpd.settings") channel_layer = get_channel_layer()
""" Tests of the Capa XModule """ import datetime import json import os import random import textwrap import unittest from unittest.mock import DEFAULT, Mock, patch import pytest import ddt import requests import webob from django.utils.encoding import smart_text from edx_user_state_client.interface import XBlockUserSt...
import odoo.addons.decimal_precision as dp from odoo import models, fields, api, exceptions, _ class AccountTreasuryForecastTemplate(models.Model): _inherit = 'account.treasury.forecast.template' receivable_line_ids = fields.One2many('account.treasury.forecast.line.template', 'treasury_template_id', ...
from openerp import fields, models, api class BusinessRequirement(models.Model): _inherit = "business.requirement" issue_ids = fields.One2many( comodel_name="project.issue", inverse_name="business_requirement_id", string="Related issues", help="Issues related to this BR, click to...
from flask_babelex import gettext from wtforms.validators import ValidationError from crontab import CronTab, CronItem from models import Participant def is_number(form, field): if field.data and not field.data.isdigit(): raise ValidationError(gettext('Must be a number!')) def is_participant_uniq(form, fiel...
import logging from openid import oidutil oidutil.log = logging.debug DEFAULT_API_PASSWORD = 'test' DEFAULT_USER_PASSWORD = 'test1Test'
from openerp.osv import fields, osv class clv_medicament_mng(osv.osv): _inherit = 'clv_medicament_mng' _columns = { 'state': fields.selection([('new','New'), ('revised','Revised'), ('waiting','Waiting'), ...
from __future__ import unicode_literals from django.db import migrations LEVELS = [ { 'label': 'Developing Capacity', 'value': 1, 'caption': '1' }, { 'label': 'Developing/Basic', 'value': 1.5, 'caption': '+/-' }, { 'label': 'Basic Capacity', ...
import bonehead from bonehead.ui import Page from PyQt4 import QtCore, QtGui, QtWebKit, QtNetwork import threading class FrontDoorPlugin(bonehead.Plugin): def newPage(self, name, args, ui): return FrontDoorPage(args['sensor-id'], ui) class FrontDoorPage(Page): def __init__(self, sensorID, ui): s...
import os import subprocess import sys import time import testinfra class GithubImageTask(object): def __init__(self, name, image, config): self.name = name self.image = image self.config = config self.sink = None def description(self): return self.name def start_publ...
"""A parser for SGML, using the derived class as a static DTD.""" from __future__ import print_function import markupbase import re __all__ = ["SGMLParser", "SGMLParseError"] interesting = re.compile('[&<]') incomplete = re.compile('&([a-zA-Z][a-zA-Z0-9]*|#[0-9]*)?|' '<([a-zA-Z][^<>]*|' ...
__id__ = "$Id$" __version__ = "$Revision$" __date__ = "$Date$" __copyright__ = "Copyright (c) 2016 Igalia, S.L." __license__ = "LGPL" from orca import speech_generator class SpeechGenerator(speech_generator.SpeechGenerator): def __init__(self, script): super().__init__(script) def _gener...
import random from unittest import TestCase from unittest.mock import Mock, patch import dbus from blivet.dbus.action import DBusAction from blivet.dbus.blivet import DBusBlivet from blivet.dbus.device import DBusDevice from blivet.dbus.format import DBusFormat from blivet.dbus.object import DBusObject from blivet.dbus...
import ipfblock import ioport import ipf.ipfblock.processing from property import Property from ipf.ipftype.ipfimage1ctype import IPFImage1cType from ipf.ipftype.ipfinttype import IPFIntType from ipf.ipftype.ipfthresholdtype import IPFThresholdType from ipf.ipfblock.threshold import Threshold class ThresholdOtsu(Thresh...
import ocl import camvtk import time import vtk def filter_path(path,tol): f = ocl.LineCLFilter() f.setTolerance(tol) for p in path: p2 = ocl.CLPoint(p.x,p.y,p.z) f.addCLPoint(p2) f.run() return f.getCLPoints() def adaptive_path_drop_cutter(s, cutter, path): apdc = ocl.AdaptiveP...
import os from setuptools import setup if __name__ == '__main__': summary = "Python module that will, in a single line, fetch an http/https url and return a string or dictionary (JSON)" try: dirName = os.path.dirname(__file__) if dirName and os.getcwd() != dirName: os.chdir(dirName) ...
import sys try: from collections import OrderedDict except ImportError: # python 2.6 or earlier, use backport from ordereddict import OrderedDict from datetime import datetime from lsm import (size_bytes_2_size_human, LsmError, ErrorNumber, System, Pool, Disk, Volume, AccessGroup, ...
from spack import * class PyJupyterlab(PythonPackage): """JupyterLab is the next-generation web-based user interface for Project Jupyter.""" homepage = "https://jupyterlab.readthedocs.io/" url = "https://pypi.io/packages/source/j/jupyterlab/jupyterlab-2.1.0.tar.gz" version('2.1.0', sha256='8...
import argparse import json import sys import os from typing import Dict, Any from pySMART import Device from pySMART.utils import get_object_properties from .smartctlfile import SmartctlFile def update_device(folder, device_name, interface_name=None): sf = SmartctlFile(folder) json_dict = {"name": device_name}...
from Skype4Py import skype # @UnusedImport # noqa from Skype4Py.enums import cmsReceived, chatTypeDialog from mock import patch, call, MagicMock, ANY import bender_skype @patch('Skype4Py.skype.Skype', autospec=True) def test_bender_skype(mock_Skype): chat_message = MagicMock() on_message_received = MagicMock()...
import sys sys.path.extend(['.', '..', '../..']) import mupif as mp import logging log = logging.getLogger() from model1 import Model1 from model2 import Model2 class Example11(mp.workflow.Workflow): def __init__(self, metadata={}): """ Construct the workflow. As the workflow is non-stationary, we a...
r""" BPE module file for the dstauffman code. It defines the code necessary for doing batch parameter estimation analysis, and is arbitrary enough to be called with many different modules. Notes ----- loosely on prior experience at Lockheed Martin using the GOLF/BPE code with GARSE, but all the numeric algorit...