code
stringlengths
1
199k
import sys sys.exit(int(sys.argv[1]))
import copy import importlib import json import logging import os from trellio.services import TCPService, HTTPService from ..utils.log_handlers import BufferingSMTPHandler logger = logging.getLogger(__name__) GLOBAL_CONFIG = { "RONIN": False, "HOST_NAME": "", "ADMIN_EMAILS": [], "SERVICE_NAME": "", ...
import sys from .cli import main if __name__ == '__main__': sys.exit(main())
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/food/crafted/shared_dish_wastril_bread.iff" result.attribute_template_id = 5 result.stfName("food_name","wastril_bread") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
import collections import itertools import Levenshtein_search from .index import Index from .core import Enumerator class LevenshteinIndex(Index): def __init__(self): self.index_key = Levenshtein_search.populate_wordset(-1, []) self._doc_to_id = Enumerator(start=1) self.docs = [] def ind...
import os, sys import urllib import ParsePy import csv API_KEY = "AIzaSyBS-HaMAHhazScAOwdTOaclJEGBNptWFss" def fetch_data(street_name, direction): print "Fetching data for " + street_name query = ParsePy.ParseQuery("Node") query = query.limit(10000).eq("streetName", street_name).eq("direction", direction) ...
from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Clip...
import sys if sys.version_info < (3, 7): from ._yside import YsideValidator from ._ygap import YgapValidator from ._yaxes import YaxesValidator from ._xside import XsideValidator from ._xgap import XgapValidator from ._xaxes import XaxesValidator from ._subplots import SubplotsValidator ...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Transmitter.user' db.add_column(u'machine_transmitter', 'user', ...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ship/components/weapon_capacitor/shared_weapon_capacitor_test.iff" result.attribute_template_id = 8 result.stfName("weapon_capacitor_test","base") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### retu...
NSEEDS=512 MAX_SEEDS_PER_ASN=2 MIN_BLOCKS = 337600 SUSPICIOUS_HOSTS = set([ "130.211.129.106", "178.63.107.226", "83.81.130.26", "88.198.17.7", "148.251.238.178", "176.9.46.6", "54.173.72.127", "54.174.10.182", "54.183.64.54", "54.194.231.211", "54.66.214.167", "54.66.220.137", "54.67.33.14", "54.77.251...
""" Virtualbox driver installation """ try: from hardware.hardware import Hardware except ImportError: from hardware import Hardware import os CLASS_NAME = "Virtualbox" CLASS_ID = "0x03" VENDOR_ID = "0x80ee" DEVICES = ['0xbeef'] class Virtualbox(Hardware): def __init__(self): Hardware.__init__(self,...
from __future__ import print_function import redis import json from traceback import format_exc from multiprocessing import Pool from collections import Counter from inspect import getsource from textwrap import dedent from time import time def pool_init(fun_name, fun_src, label): exec(fun_src) exec("globals()['f'] =...
from .agilent8257D import Agilent8257D from .agilent8722ES import Agilent8722ES from .agilentE4408B import AgilentE4408B from .agilentE4980 import AgilentE4980 from .agilent34410A import Agilent34410A
from django.conf import settings MESSAGES_PER_PAGE = getattr(settings,'ROSETTA_MESSAGES_PER_PAGE',10) ENABLE_TRANSLATION_SUGGESTIONS = getattr(settings,'ROSETTA_ENABLE_TRANSLATION_SUGGESTIONS',True) MAIN_LANGUAGE = getattr(settings,'ROSETTA_MAIN_LANGUAGE', None) MESSAGES_SOURCE_LANGUAGE_CODE = getattr(settings,'ROSETTA...
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test how we handle a no-results test specified on the command line. """ import TestRuntest pythonstring = TestRuntest.pythonstring test = TestRuntest.TestRuntest() test.subdir('test') test.write_no_result_test(['test', 'no_result.py']) expect_stdout = ""...
from snovault import ( CONNECTION, upgrade_step, ) @upgrade_step('trimming_quality_metric', '3', '4') def trimming_quality_metric_3_4(value, system): return @upgrade_step('trimming_quality_metric', '4', '5') def trimming_quality_metric_4_5(value, system): # http://redmine.encodedcc.org/issues/2491 i...
import gzip import os from calendar import timegm from datetime import datetime from glob import glob from shutil import which import click import frappe from frappe import _, conf from frappe.utils import get_file_size, get_url, now, now_datetime, cint from frappe.utils.password import get_encryption_key verbose = Fal...
HEIGHT = 60 WIDTH = 40 EXTENT_RANGE = 2 SLIDE = EXTENT_RANGE * 2 DATASET_FOLDER = "data/" PICKLE_DATASET = "pickle_data/" DATA_NAME = "data" TRAINED_MODELS = "trained_models/" RANDOM_IDX = "random_idx" MODEL = "model" FRONT = "../all_data/front/" BACK = "../all_data/back/" SEGMAP = "../all_data/segmap/"
"""Module providing an image scaling factory.""" from Products.ZCatalog.interfaces import ICatalogBrain from plone import api from plone.app.contentlisting.interfaces import IContentListingObject from plone.scale import scale as image_scale from zope.component import getMultiAdapter from zope.globalrequest import getRe...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/mission/quest_item/shared_indintra_imbru_yerevan_q2_needed.iff" result.attribute_template_id = -1 result.stfName("loot_rori_n","indintra_imbru_q2_needed") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS ##...
from __future__ import absolute_import import logging import operator import os import tempfile import shutil import warnings try: import wheel except ImportError: wheel = None from pip.req import RequirementSet from pip.basecommand import RequirementCommand from pip.locations import virtualenv_no_global, distu...
import numpy as np import os from topoflow.utils import BMI_base from topoflow.utils import cfg_files as cfg from topoflow.utils import model_input from topoflow.utils import model_output class evap_component( BMI_base.BMI_component): #------------------------------------------------------------------- def set_...
""" Output single markdown doc from multimarkdown with internal links and includes. """ import sys import re def println(*s): sys.stdout.write("".join(s)) def main(): filenames = sys.argv[1:] if len(sys.argv) > 1 else ["-"] for fname in filenames: f = sys.stdin if fname == "-" else open(fname, "r") ...
import asyncio import json import sys import warnings from collections import namedtuple from . import hdrs from ._ws_impl import (CLOSED_MESSAGE, CLOSING_MESSAGE, WebSocketError, WSMessage, WSMsgType, do_handshake) from .errors import ClientDisconnectedError, HttpProcessingError from .helpers im...
""" MoinMoin - "sitemap" action Generate a URL list of all your pages (using google's sitemap XML format). @copyright: 2006-2008 MoinMoin:ThomasWaldmann @license: GNU GPL, see COPYING for details. """ import time from MoinMoin import wikiutil datetime_fmt = "%Y-%m-%dT%H:%M:%S+00:00" def now(): retur...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/deed/city_deed/shared_garden_tatooine_sml_01_deed.iff" result.attribute_template_id = 2 result.stfName("deed","garden_tatooine_sml_01_deed") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return res...
def test_extra_param(as_admin): label = 'extra_param' r = as_admin.post('/projects', json={ 'group': 'unknown', 'label': label, 'public': False, 'extra_param': 'some_value' }) assert r.status_code == 400 r = as_admin.get('/projects') assert r.ok assert not any...
import sys import time import logging def log(filename, message, verbose): """write message to log file and shell.""" if verbose: print(message) if filename: output = open(filename, 'a') output.write(message + '\n') output.close() def err(filename, message, verbose): log(...
from random import choice from pygame.mixer import * from pygame.mixer import Sound as Mixer_sound pre_init(44100,-16, 2, 2048) init() set_num_channels(50) from pyaudiogame import event_queue from pyaudiogame import position playing_sounds = [] position.set_listener(0,0,90) def get_listener(): return position.get_list...
import copy from math import ceil from flask import jsonify, request from loguru import logger from sqlalchemy.orm.exc import NoResultFound from flexget.api import APIResource, api from flexget.api.app import ( BadRequest, Conflict, NotFoundError, base_message_schema, etag, pagination_headers, ...
"""Coverage plugin for pytest.""" def pytest_addoption(parser): """Add options to control coverage.""" group = parser.getgroup('coverage reporting with distributed testing support') group.addoption('--cov', action='append', default=[], metavar='path', dest='cov_source', ...
while True: message = raw_input("Enter something:") if message == "quit": break else: print "Length of the string is", len(message) print "Done"
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_durgur_pyne.iff" result.attribute_template_id = 9 result.stfName("npc_name","zabrak_base_male") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ship/components/shield_generator/shared_shd_koensayr_improved_deflector_m1.iff" result.attribute_template_id = 8 result.stfName("space/space_item","shd_koensayr_improved_deflector_m1_n") #### BEGIN MODIFICATIONS #...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ship/attachment/weapon/shared_xwing_weapon2_neg_s02_0.iff" result.attribute_template_id = 8 result.stfName("item_n","ship_attachment") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/wearables/necklace/shared_necklace_s04.iff" result.attribute_template_id = 11 result.stfName("wearables_name","necklace_s04") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/hair/human/shared_hair_human_male_s15.iff" result.attribute_template_id = -1 result.stfName("hair_name","hair") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
import dedupe import dedupe.training as training import unittest class TrainingTest(unittest.TestCase): def setUp(self): field_definition = [{'field': 'name', 'type': 'String'}] self.data_model = dedupe.Dedupe(field_definition).data_model self.training_pairs = { 'match': [({"name...
from swgpy.object import * def create(kernel): result = Building() result.template = "object/building/player/city/shared_garden_dantooine_med_01.iff" result.attribute_template_id = -1 result.stfName("building_name","garden") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
from .model_relational import *
import logging import pusherclient from bitex.api.WSS.base import WSSAPI log = logging.getLogger(__name__) class BitstampWSS(WSSAPI): """ Creates a BitstampWSS Object, which automatically describes to all available endpoints of the Bitstamp Websocket API. By Default, data is printed to stdout. If you'd...
"""Provide access to Python's configuration information. """ import sys import os from os.path import pardir, realpath _INSTALL_SCHEMES = { 'posix_prefix': { 'stdlib': '{base}/lib/python{py_version_short}', 'platstdlib': '{platbase}/lib/python{py_version_short}', 'purelib': '{base}/lib/pytho...
""" Thread-safe in-memory cache backend. Forked from Django. """ import time import warnings import threading from contextlib import contextmanager try: import cPickle as pickle except ImportError: import pickle DEFAULT_TIMEOUT = object() MAX_KEY_LENGTH = 128 _caches = {} _expire_info = {} _locks = {} class RWL...
""" @file coap.py """ import os import sys import subprocess from oeqa.oetest import oeRuntimeTest from oeqa.utils.decorators import tag def inst_cp_module_coap(): ''' Check command "sudo" is exist, install node module coap to host ''' sudo_status = subprocess.Popen('sudo', stdout=subprocess.PIPE, stder...
from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError from msrestazure.azure_operation import AzureOperationPoller import uuid from .. import models class ResourceGroupsOperations(object): """ResourceGroupsOperations operations. :param client: Client for service reque...
"""Test for possible quest conditions.""" import datetime from django.test import TransactionTestCase from django.contrib.auth.models import User from apps.managers.challenge_mgr import challenge_mgr from apps.managers.player_mgr.predicates import badge_awarded, has_points, \ posted_to_wall from apps.managers.team_...
from __future__ import unicode_literals,print_function import six import subprocess import sys import re import h5py import time import numpy as np from vmc_postproc import load def vmc_exec(**kwargs): """ arguments: - nprocs (default 4)` - hosts (default localhost) - slurmqueue (default False) ...
import sys from enum import IntFlag from _pydevd_frame_eval.vendored import bytecode as _bytecode class CompilerFlags(IntFlag): """Possible values of the co_flags attribute of Code object. Note: We do not rely on inspect values here as some of them are missing and furthermore would be version dependent. ...
def partition(li, start, end): li_len = end - start + 1 if li_len < 2: raise ValueError("list which lenght is less then 2 do not need to partition") #使用最后一个元素作为分割点 key = li[end] middle_index = start for x in xrange(start, end): if li[x] < key: li[middle_index], li[x] ...
print('My name is') for i in range(5): print('Jimmy Five Times (' + str(i) + ')')
from runtest import TestBase class TestCase(TestBase): def __init__(self): TestBase.__init__(self, 'unroll', """ [ 72208] | main() { 0.252 us [ 72208] | big(); 1.802 us [ 72208] | } /* main */ """) def prerun(self, timeout): if not TestBase.check_arch_full_dynamic_support(sel...
DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'avocadoserver.sqlite', # The following settings are not used with sqlite3: 'USER': '', ...
from Crypto.PublicKey import RSA from Crypto import Random from Crypto.Cipher import AES, DES from hashlib import md5 from struct import unpack def decode_public_key(bytes): """Decodes a public RSA key in ASN.1 format as defined by x.509""" return RSA.importKey(bytes) def encode_public_key(key): """Encodes ...
from distutils.core import setup, Extension import sys sys.path.append("src") import passfd module1 = Extension('_passfd', sources = ['src/passfd.c']) setup( name = 'python-passfd', version = '0.2', description = 'Python functions to pass file descriptors across ' + 'UNIX doma...
""" WWW: http://4suite.com/4DOM e-mail: support@4suite.com Copyright (c) 2000 Fourthought Inc, USA. All Rights Reserved. See http://4suite.com/COPYRIGHT for license and copyright information """ from CharacterData import CharacterData from xml.dom import Node from xml.dom import IndexSizeErr class Text(Char...
__version__ = "0.1"
import locale import logging import os import platform import sys import time import traceback log = logging.getLogger(__name__) class ShellBootstrap(object): """Bootstraps the Stoq application, it's responsible for: - Setting up log files - Checking dependencies - Setting up libraries (gobject, gtk, ki...
"""Create communities tables. Revision ID: fb99eeaec4ac Revises: ec77f5a034d1 Create Date: 2017-04-25 17:45:13.538252 """ import uuid from alembic import op import sqlalchemy as sa from sqlalchemy.sql import expression from sqlalchemy.types import TIMESTAMP from sqlalchemy_utils.types import UUIDType revision = 'fb99ee...
import socket, ssl def server(): bindsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) bindsocket.bind(('127.0.0.1', 10000)) bindsocket.listen(5) print "Listening" tls_serv = ssl.wrap_socket(bindsocket, server_side=True, keyfile='./my.key', certfile="./my.crt", ssl_version=ssl.PROTOCOL_TLSv...
''' Plugin for ResolveURL Copyright (C) 2018 gujal 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 program is distributed i...
''' Pluggable modules for Asterisk CDR tests Copyright (C) 2013, Digium, Inc. Matt Jordan <mjordan@digium.com> This program is free software, distributed under the terms of the GNU General Public License Version 2. ''' import sys import logging import time sys.path.append("lib/python") from cdr import CDRModule from cd...
""" Authorization module that allow users listed in /etc/cobbler/users.conf to be permitted to access resources, with the further restriction that cobbler objects can be edited to only allow certain users/groups to access those specific objects. Copyright 2008-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaa...
import logging log = logging.getLogger("Thug") def text_property(readonly = False): def getter(self): return str(self.tag.string) if self.tag.string else "" def setter(self, text): self.tag.string = text if self.tagName.lower() in ('script', ): if log.ThugOpts.code_logging: ...
import os import enum BASE_DIR = os.path.abspath( os.path.join( os.path.dirname(__file__), '../..' ) ) DEBUG = True TEMPLATE_DEBUG = True TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [ os.path.join(BASE_DIR, 'templates'), ...
""" SendKeys.py - Sends one or more keystroke or keystroke combinations to the active window. Copyright (C) 2003 Ollie Rutherfurd <oliver@rutherfurd.net> Python License Version 0.3 (2003-06-14) $Id$ """ import sys import time from _sendkeys import char2keycode, key_up, key_down, toggle_numlock __all__ = ['KeySequenceEr...
""" EasyBuild support for building and installing LAPACK, 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) """ import glob im...
import os, xml.dom.minidom, re, sys def handleTemplate(templ) : rect = templ.getElementsByTagName("Label-rectangle") if len(rect) <= 0 : return rect = rect[0] layout = rect.getElementsByTagName("Layout")[0] brand = templ.getAttribute("brand") part = templ.getAttribute("part") description = t...
import os import logging from vdsm.config import config import storage_exception as se from task import Task, Job, TaskCleanType from threadPool import ThreadPool class TaskManager: log = logging.getLogger('TaskManager') def __init__(self, tpSize=config.getfloat('irs', 'thread_pool_size'), ...
import getpass import pytest from conftest import assert_complete @pytest.mark.bashcomp( pre_cmds=( # Fake root command to get all users/groups completed at least for now "root_command=sudo", ) ) class TestChown: @pytest.mark.xfail( getpass.getuser() != "root", reason="Only root can ...
from opus_core.configurations.dataset_pool_configuration import DatasetPoolConfiguration from opus_core.indicator_framework.core.indicator_factory import IndicatorFactory from opus_core.indicator_framework.core.source_data import SourceData from opus_core.indicator_framework.image_types.dataset_table import DatasetTabl...
def ms2smp(ms, sample_rate): """Milliseconds to samples converter. Simple converter in order to compute the number of samples for a given time frame in milliseconds and the sampling rate. Args: ms (int): Number of milliseconds. sample_rate (int): Sampling rate in Hertz. Re...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'network'} DOCUMENTATION = """ --- module: checkpoint_access_layer_facts short_description: Get access lay...
from __future__ import print_function import cdrom, mpd, DiscID, CDDB from configobj import ConfigObj, ConfigObjError from basepaths import config_folder,mcd_config_filename from ConfigParser import RawConfigParser import os import fileinput import sys config = RawConfigParser() config_path=os.path.join(config_folder, ...
from django.test import TestCase from geonode.base.models import ResourceBase class ThumbnailTests(TestCase): def setUp(self): self.rb = ResourceBase.objects.create() def tearDown(self): t = self.rb.thumbnail if t: t.delete() def test_initial_behavior(self): self....
from django.shortcuts import render from django.conf import settings from django.template.defaulttags import register from django.http import HttpResponseRedirect, HttpResponse from django.utils.html import escape from StaticAnalyzer.models import StaticAnalyzerAndroid from DynamicAnalyzer.pyWebProxy.pywebproxy import ...
''' Created on Jun 2, 2011 @author: mkiyer ''' import logging import collections import os from chimerascan import pysam from chimerascan.bx.cluster import ClusterTree from chimerascan.lib import config from chimerascan.lib.base import LibraryTypes from chimerascan.lib.sam import parse_pe_reads, pair_reads, copy_read, ...
type = "passive" def handler(fit, ship, context): fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Torpedoes"), "thermalDamage", ship.getModifiedItemAttr("shipBonusMB"), skill="Minmatar Battleship")
from hyperspy.models.edsmodel import EDSModel class EDSSEMModel(EDSModel): """Build and fit a model to EDS data acquired in the SEM. Parameters ---------- spectrum : EDSSEMSpectrum auto_add_lines : bool If True, automatically add Gaussians for all X-rays generated in the energy range...
class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: # @param head, a list node # @return a tree node def sortedListToBST(self, head): ...
import pytest from PyQt5.QtCore import QUrl pytest.importorskip('PyQt5.QtWebEngineCore') from PyQt5.QtWebEngineCore import QWebEngineCookieStore from PyQt5.QtWebEngineWidgets import QWebEngineProfile from qutebrowser.browser.webengine import cookies from qutebrowser.utils import urlmatch @pytest.fixture def filter_requ...
""" pySSN is available under the GNU licence providing you cite the developpers names: Ch. Morisset (Instituto de Astronomia, Universidad Nacional Autonoma de Mexico) D. Pequignot (Meudon Observatory, France) """ __all__ = [] from .version import __version__ from .utils.Config import _Config config = _Config() ...
"""Core control stuff for Coverage.""" import os, socket from annotate import AnnotateReporter from codeunit import code_unit_factory from collector import Collector from data import CoverageData from files import FileLocator from html import HtmlReporter from misc import format_lines, CoverageException from summary im...
from __future__ import (absolute_import, division, print_function) from six.moves import (filter, input, map, range, zip) # noqa import iris.tests as tests import operator import math import numpy as np import numpy.ma as ma import iris import iris.analysis.maths import iris.coords import iris.exceptions import iris.t...
from django.conf.urls import patterns, include, url from django.contrib import admin from clatoolkit import views from clatoolkit.urls import router urlpatterns = patterns('', url(r'^$', views.userlogin, name='userlogin'), url(r'^clatoolkit/', include('clatoolkit.urls')), url(r'^api/', include(router.urls))...
default_app_config = 'auth_extra.apps.AuthExtraConfig'
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible import __version__ from ansible.errors import AnsibleError from distutils.version import LooseVersion from operator import ge, gt try: from __main__ import display except ImportError: from ansible.utils.display ...
"""Get a list of road weather stations and save as a shapefile. Copyright (C) 2018 Tero Niemi, Aalto University School of Engineering This file is part of FetchFMIOpen. FetchFMIOpen is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ...
from __future__ import unicode_literals import sickrage from sickrage.core.websession import WebSession def getShowImage(url): if url is None: return None sickrage.app.log.debug("Fetching image from " + url) try: return WebSession().get(url).content except Exception: sickrage.app...
import re from os.path import join from os.path import dirname from os.path import isfile from os.path import abspath from .common import NotifyType class AppriseAsset(object): """ Provides a supplimentary class that can be used to provide extra information and details that can be used by Apprise such as pr...
""" Job Base Class This class provides generic job definition functionality suitable for any VO. Helper functions are documented with example usage for the DIRAC API. An example script (for a simple executable) would be:: from DIRAC.Interfaces.API.Dirac import Dirac from DIRAC.Interfaces.API.Job ...
import numpy as np import hyperspy.misc.rgb_tools as rt class TestRGBTools: def setup_method(self, method): self.data_c = np.ones((2, 2, 3), dtype=np.uint8, order='C') self.data_f = np.ones((2, 2, 3), dtype=np.uint8, order='F') mask = [[[0, 1, 1], [1, 0, 1]], [[1, 1, 0], [0, 0, 1]]] ...
import re from ..libs.pyparsing import Regex class TextFactory (object): @staticmethod def make (parser): return TextToken().getToken() class TextToken (object): """ Токен для обычного текста """ def getToken (self): textRegex = "[\w]+" token = Regex (textRegex, re.UNICOD...
''' ============================================== Backend plugin for RA using Dogtag (e.g. CMS) ============================================== Overview of interacting with CMS: --------------------------------- CMS stands for "Certificate Management System". It has been released under a variety of names, the open sour...
""" Python Markdown =============== Python Markdown converts Markdown to HTML and can be used as a library or called from the command line. import markdown html = markdown.markdown(your_text_string) See <http://packages.python.org/Markdown/> for more information and instructions on how to extend the functionali...
""" Example URLConf for a contact form. Because the ``contact_form`` view takes configurable arguments, it's recommended that you manually place it somewhere in your URL configuration with the arguments you want. If you just prefer the default, however, you can hang this URLConf somewhere in your URL hierarchy (for bes...
import psutil import sys p = psutil.Process(int(sys.argv[1])) times = p.get_cpu_times() print(times) print(str((times.user + times.system)/60)) perc = p.get_cpu_percent(interval=1) print(perc)
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2, 7): pytestmark = pytest.mark.skip("F5 Ansible modules require Python >= 2.7") from ansible.module_utils.basic import AnsibleModule from ansible_collections...
import re import urlparse from ..internal.SimpleHoster import SimpleHoster class FastshareCz(SimpleHoster): __name__ = "FastshareCz" __type__ = "hoster" __version__ = "0.43" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?fastshare\.cz/\d+/.+' __config__ = [("activated", "bool", "Activ...
../../../../../../../../share/pyshared/papyon/service/AddressBook/scenario/contacts/disallow_contact.py