content
stringlengths
4
20k
# [h] rename anchors in selected glyphs # imports from mojo.roboFont import CurrentFont from vanilla import * from hTools2 import hDialog from hTools2.modules.anchors import rename_anchor from hTools2.modules.fontutils import get_glyphs from hTools2.modules.messages import no_glyph_selected, no_font_open # objects ...
from sqlalchemy import func from sqlalchemy.orm import exc from neutron.common import exceptions as q_exc import neutron.db.api as db from neutron.db import models_v2 from neutron.db import securitygroups_db as sg_db from neutron.extensions import securitygroup as ext_sg from neutron import manager from neutron.openst...
''' Created on 26 May 2015 @author: will ''' from src.Action import * from src.ManageProcess import * from src.TimeoutCalculator import * from src.configuration.configLoader import * import logging from src.TransmissionStatus import * from src.ActiveLogin import * class Engine(object): ''' classdocs ''' ...
""" This module contains the main logic of the translation engine. """ import collections import json import jsonschema import logging import requests from heat2arm.config import CONF from heat2arm.context import Context from heat2arm.parser.parsing import parse_template from heat2arm.translators import autoscali...
from __future__ import print_function import getpass import inspect import os import sys import textwrap import prettytable import six from six import moves from solumclient.openstack.common.apiclient import exceptions from solumclient.openstack.common.gettextutils import _ from solumclient.openstack.common import s...
from yum_metadata_diff.package import Package from yum_metadata_diff.metadata import Metadata class FilelistsPackage(Package): DIFF_ATTR = ('checksum', 'files', 'dirs', 'ghosts') def __init__(self): Package.__init__(self) #self.arch = "" #-\ #self.name = "" #--\ #...
#!/usr/bin/env python # -*- coding: utf8 -*- """ Copyright (c) 2011 Tyler Kenendy <<EMAIL>> 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 ri...
import pickle import re import string import sys # Terms are caches across invocations in this file, allowing # inter-file cross references. terms_filename = '.terms' # Terms are recognized for these classes of the XHTML <span> element. terms_classes = [ 'Term', 'Class', 'API' ] # The same class nam...
from django.conf.urls.defaults import patterns, url from django.conf import settings urlpatterns = patterns('django_facebook.views', url(r'^connect/$', 'connect', name='facebook_connect'), url(r'^disconnect/$', 'disconnect', name='facebook_...
import server from atlas import Operation, Entity, Oplist from world.utils import Ticks class Fire(server.Thing): """fire to burn things up""" tick_interval = 30 def __init__(self, cpp): Ticks.init_ticks(self, self.tick_interval) if self.location.parent: print('initial burn'...
""" Algorithm Tests uses mocked unit testing ComPAIR backend """ import concurrencytest import json import random import math import unittest import os import unicodecsv as csv from scipy.stats import spearmanr, pearsonr, kendalltau import numpy from enum import Enum from data.fixtures.test_data import Compar...
import random from pymongo import MongoClient class MarkovMongo(object): ''' Markov Chain implementation in python with storage in MongoDB.''' def __init__(self, uri=None, dbname='testdb', coll='testcoll', order=2): connection = MongoClient(uri) db = connection[dbname] self.collect...
import uuid from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.db import models from django_countries.fields import CountryField from django.conf import settings def validate_agreed_to_license_terms(value): if value is not True: raise ValidationErr...
import gtk from morso.helpers import get_builder import gettext from gettext import gettext as _ gettext.textdomain('morso') class AboutMorsoDialog(gtk.AboutDialog): __gtype_name__ = "AboutMorsoDialog" def __new__(cls): """Special static method that's automatically called by Python when con...
""" hightemp.txtは,日本の最高気温の記録を「都道府県」「地点」「℃」「日」のタブ区切り形式で 格納したファイルである.以下の処理を行うプログラムを作成し,hightemp.txtを入力ファイルとして 実行せよ.さらに,同様の処理をUNIXコマンドでも実行し,プログラムの実行結果を確認せよ. 16. ファイルをN分割する 自然数Nをコマンドライン引数などの手段で受け取り,入力のファイルを行単位でN分割せよ. 同様の処理をsplitコマンドで実現せよ. """ # -*- coding: utf-8 -*- import sys import codecs argvs = sys.argv ...
# -*- coding: utf-8 -*- """ equip.utils.structures ~~~~~~~~~~~~~~~~~~~~~~ Different useful data structures. :copyright: (c) 2014 by Romain Gaucher (@rgaucher) :license: Apache 2, see LICENSE for more details. """ from bisect import bisect_left, bisect_right from itertools import izip class intervalmap(o...
from ....const import LOCALE as glocale _ = glocale.translation.gettext try: set() except NameError: from sets import Set as set #------------------------------------------------------------------------- # # Gprime modules # #------------------------------------------------------------------------- from .. impo...
import json from django.db import models from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from media_explorer.models import Element, Gallery from media_explorer.forms import MediaFormField, RichTextFormField from django.db.models import signals, FileField from ...
# -*- coding: utf-8 -*- """ Classes to mimic structured objects defined with the help of the cool library @attr.s """ from attr import ( s as ClassOfAttributes, ib as attribute ) ######################## # All attributes we use for a Flask Response ######################## @ClassOfAttributes class ResponseE...
"""Classes for generic sequence alignment. Contains classes to deal with generic sequence alignment stuff not specific to a particular program or format. """ from __future__ import print_function from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from Bio import Alphabet class Alignment(object): """Rep...
import argparse import BaseHTTPServer import urlparse import json HOST_NAME = 'besiegempms.herokuapp.com' #parsed.get(key)[0] everywhere except Players! class Serverp(object): name = str ipPort = str maxPlayers = int connectedPlayers = int players = [] def __init__(self, name, ipPort, maxPla...
from ....const import LOCALE as glocale _ = glocale.translation.gettext #------------------------------------------------------------------------- # # Gprime modules # #------------------------------------------------------------------------- from .. import Rule #------------------------------------------------------...
import json import urllib import string import django urls = ( '/', 'index' '/vanity/(.*)', 'vanity' '/steamid/\d+', 'steamid' ); API_KEY = '81DA969CDBE56A7C87825BC21C9C1339'; INVALID_STEAM_ID = 4294967295 + 76561197960265728; INVALID_ACCOUNT_ID = 4294967295; def AccountToSteamID(accountID): return int(acco...
__author__ = 'jonathan' from lib.rome.core.expression.expression import * class Selection: def __init__(self, model, attributes, is_function=False, function=None, is_hidden=False): self._model = model self._attributes = attributes self._function = function self._is_function = is_fu...
import z3 from z3 import is_true, is_false from examples import * import time import mcnet.components as components import random import sys """Check time as increase in nodes""" def ResetZ3 (): z3._main_ctx = None z3.main_ctx() z3.set_param('auto_config', False) z3.set_param('smt.mbqi', True) z3.se...
from flask_sqlalchemy import SQLAlchemy from sqlalchemy.sql import text # Create a class that will give us an object that we can use to connect to a database class MySQLConnection(object): def __init__(self, app, db): config = { 'host': 'localhost', 'database': db, # we got d...
import os from ciscosparkbot import SparkBot import cico_meraki import cico_spark_call import cico_combined import cico_common import cico_umbrella import cico_a4e import sys # Retrieve required details from environment variables bot_email = os.getenv("SPARK_BOT_EMAIL") spark_token = os.getenv("SPARK_BOT_TOKEN") bot_u...
from django.contrib.auth import authenticate, login, logout from OctaHomeCore.views import * from OctaHomeCore.models import * class handleLoginView(viewRequestHandler): loginToken = '' def handleRequest(self): if self.Request.user.is_authenticated(): return super(handleLoginView, self).handleRequest() ...
# -*- coding: utf-8 -*- class Limit: max_x = 0 max_y = 0 min_x = 0 min_y = 0 def __init__(self): pass class HorseRoad: road = [] shortest_road = [] limit = Limit() limit.max_x = 0 limit.max_y = 0 limit.min_x = 0 limit.min_y = 0 def __init__(self): ...
from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt, today, getdate, cint from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_checks_for_pl_and_bs_accounts def post_depreciation_entries(date=None): # Return if automatic booking of asse...
# Django settings for birdsong project. # # Running in Production or Development mode. # import socket if socket.gethostname() == 'django.venus.orchive.net': DEBUG = False else: DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', '<EMAIL>'), ) MANAGERS = ADMINS # # Locally # if (DEBUG == Tru...
from .database import session from sqlalchemy import Column, Unicode, ForeignKey, DateTime, Integer, func from sqlalchemy.orm import relationship from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() Base.query = session.query_property() class SafePhrase(Base): __tablename__ = 'safe_ph...
from math import tanh from pysqlite2 import dbapi2 as sqlite def dtanh(y): return 1.0-y*y class searchnet: def __init__(self,dbname): self.con=sqlite.connect(dbname) def __del__(self): self.con.close() def maketables(self): self.con.execute('create table hiddennode(...
""" intervaltree: A mutable, self-balancing interval tree for Python 2 and 3. Queries may be by point, by range overlap, or by range envelopment. Test module: IntervalTree, Copying Copyright 2013-2018 Chaim Leib Halbert Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except ...
#!/usr/bin/env python import argparse import json import logging import multiprocessing import re import time import requests from datetime import datetime from bs4 import BeautifulSoup from elasticsearch import Elasticsearch from enrich_modules.enrich_to_cik import TO_CIK class OMX_SCRAPER: def __init__(self, ...
from __future__ import print_function import os from gearbox.command import Command from paste.deploy import appconfig class SetupAppCommand(Command): def get_description(self): return "Setup an application, given a config file" def get_parser(self, prog_name): parser = super(SetupAppCommand...
import datetime import pickle import os from functools import total_ordering from bzoing.playme import Playme import time import threading import subprocess from xdg.BaseDirectory import save_data_path share_dir = save_data_path("bzoing") @total_ordering class Task(): """Defines tasks, their representation and ...
import argparse from datetime import datetime from unittest.mock import MagicMock, mock_open, patch from awsume.awsumepy.lib import autoawsume @patch.object(autoawsume, 'aws_files_lib') @patch.object(autoawsume, 'profile_lib') def test_create_autoawsume_profile(profile: MagicMock, aws_files: MagicMock): now = dat...
# -*- coding: utf-8 -*- from __future__ import division, absolute_import, print_function, unicode_literals import __main__ import os.path import re import functools from setuptools.command.test import ScanningLoader class RegexpPrefixLoader(ScanningLoader): testMethodPattern = 'test_|it_' def getTestCaseNam...
from __future__ import unicode_literals from __future__ import absolute_import # TODO: handle <action> import os import re import codecs import shutil import datetime from os.path import join, dirname, relpath from bs4 import BeautifulSoup from bs4.element import Tag, Comment, NavigableString from chatlogsync impor...
import io import numpy as np from numpy.testing import assert_array_almost_equal from PIL import Image, TiffTags import pytest from matplotlib import ( collections, path, pyplot as plt, transforms as mtransforms, rcParams) from matplotlib.image import imread from matplotlib.figure import Figure from matplotlib.t...
from __future__ import (absolute_import, division, print_function, unicode_literals) import json from datetime import datetime from django.conf import settings as geonode_settings from django.contrib.auth.models import Group from django.contrib.gis.db import models from django.urls import reve...
import flask import webob.dec from oslo_config import cfg import oslo_messaging as messaging from oslo_log import log as logging from oslo_middleware import base from oslo_middleware import request_id from oslo_serialization import jsonutils as json from oslo_utils import strutils from designate import exceptions from...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Output Components for deegree server storage (www.deegree.org). # # # NB deegree also supports WFS-T! # from stetl.postgis import PostGIS from stetl.output import Output from stetl.util import Util, etree from stetl.packet import FORMAT import os log = Util.get_log('de...
import mock from hpOneView.connection import connection from hpOneView.resources.resource import ResourceClient from hpOneView.resources.servers.id_pools_vsn_ranges import IdPoolsVsnRanges import unittest class TestIdPoolsRangesVsn(unittest.TestCase): def setUp(self): self.host = '127.0.0.1' sel...
import numpy as np import os import time import argparse import smtplib from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText from email.MIMEBase import MIMEBase from email import encoders import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from datetime import datetime, ...
from CIM14.IEC61970.Meas.Measurement import Measurement class Discrete(Measurement): """Discrete represents a discrete Measurement, i.e. a Measurement reprsenting discrete values, e.g. a Breaker position. """ def __init__(self, normalValue=0, minValue=0, maxValue=0, Command=None, DiscreteValues=None, Valu...
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 2 of the License, or (at your option) any la...
from openerp.osv import fields, osv class sale_journal_invoice_type(osv.osv): _name = 'sale_journal.invoice.type' _description = 'Invoice Types' _columns = { 'name': fields.char('Invoice Type', required=True), 'active': fields.boolean('Active', help="If the active field is set to False, it ...
import discord from discord.ext import commands import aiohttp import re import logging log = logging.getLogger('red.steam') class Steam: """Steam and SteamSpy related commands""" def __init__(self, bot): self.bot = bot @commands.command(pass_context=True, name='sales', aliases=['owners']) ...
from PyQt4 import QtGui from PyQt4 import QtCore class MerchantGUI(QtGui.QWidget): def __init__(self, controller, parent=None): QtGui.QWidget.__init__(self, parent) self.controller = controller self.init_ui() def init_ui(self): self.status = QtGui.QLabel() self.status.s...
''' This sample will create a new alias queue. MQWeb runs on localhost and is listening on port 8081. ''' import json import httplib import socket import argparse parser = argparse.ArgumentParser( description='MQWeb - Python sample - Create alias queue', epilog="For more information: http://www.mqweb.org" ) parser...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
#!/usr/bin/python # This program logs a Raspberry Pi's CPU temperature to a Thingspeak Channel # To use, get a Thingspeak.com account, set up a channel, and capture the Channel Key at https://thingspeak.com/docs/tutorials/ # Then paste your channel ID in the code for the value of "key" below. # Then run as sudo python...
# coding: utf-8 import random def rondo(a, b): return random.randrange(a, b) class Animal: def __init__(self): self.dog_run = rondo(0, 8000) # metrov self.dog_golos = rondo(0, 3000) # golos sabaki self.dog_blohi = rondo(0, 100) # sobachi vshi self.cow_moloko = rondo(...
# coding=utf-8 import os import unittest import mock import pytest from conans.client.source import _run_cache_scm, _run_local_scm from conans.client.tools.scm import Git from conans.model.scm import SCM from conans.test.utils.test_files import temp_folder from conans.test.utils.mocks import TestBufferConanOutput fr...
#!/usr/bin/env python #-*- coding: utf-8 -*- ''' # This file is part of Matching Pursuit Python program (python-MP). # # python-MP 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 ...
"""Ensure we can parse events sent to us from the segment.io webhook integration""" from datetime import datetime import json from ddt import ddt, data, unpack from mock import sentinel from django.contrib.auth.models import User from django.test.client import RequestFactory from django.test.utils import override_se...
# -*- coding: utf-8 -*- """Main function for pRF finding.""" # Part of py_pRF_mapping library # Copyright (C) 2016 Ingo Marquardt # # 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 versi...
""" Count adjacent orfs in the blast output files. """ import os import sys import argparse from roblib import bcolors def count_adjacent_orfs(sample, fastafile, blastfile, adjacentout, nohitsout, searchtype): """ Count hits where two adjacent orfs match to the same protein """ sys.stderr.write(f"...
from __future__ import division, print_function, unicode_literals # This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # testinfo = "s, t 1.25, s, t 3, s, t 5, s, q" tags = "CocosNode, transform_anchor" import ...
from __future__ import unicode_literals from collections import OrderedDict, defaultdict from datetime import timedelta from itertools import takewhile from flask import render_template, request from pytz import timezone from indico.modules.events.layout import layout_settings from indico.util.date_time import iterd...
import sys try: from django.conf import settings from django.test.utils import get_runner settings.configure( DEBUG=True, USE_TZ=True, DATABASES={ "default": { "ENGINE": "django.db.backends.sqlite3", } }, ROOT_URLCONF="zdm_api...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui_fiscal_parametrizacaosintegra.ui' # # by: pyside-uic 0.2.15 running on PySide 1.2.2 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui from PySide.QtGui import QMessageBox from pydaruma.pydarum...
from gettext import gettext #------------------------------------------------------------------------------ def _(message, *args, **kw): if args or kw: return gettext(message).format(*args, **kw) return gettext(message) #------------------------------------------------------------------------------ # end of $...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import inspect import re from collections import OrderedDict from docutils.core import publish_parts from six import string_types from six.moves import range from pa...
""" Support for controlling GPIO pins of a Raspberry Pi. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/rpi_gpio/ """ # pylint: disable=import-error import logging from homeassistant.const import ( EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP...
from setuptools import setup, find_packages setup( name = 'my_workflow', version = '0.0.1', description = 'sample workflow extension for OpenStack Dashboard', author = 'Thai Tran', author_email = '<EMAIL>', classifiers = [ 'Environment :: OpenStack', 'Framework :: Django', ...
""" The MIT License (MIT) Copyright (c) 2014 NTHUOJ team 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, ...
''' Copyright 2014 Mikel Azkolain This file is part of script.sysinforeporter. script.sysinforeporter 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 late...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = r''' --- module: win_eventlog_entry version_added: "2.4" short_description: Write entries to Windows event logs description: - Write log entries to a given eve...
from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """ Test file created by XlsxWriter against a file created by Excel. """ def setUp(self): self.maxDiff = None filename = 'format13.xlsx' ...
from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * from test_framework.comptool import TestManager, TestInstance, RejectResult from test_framework.mininode import * from test_framework.blocktools import * import logging import copy import time ''' In this test we conne...
#!/usr/bin/env python # File created on 14 Jun 2013 from __future__ import division from reportlab.graphics.barcode import code128 from reportlab.lib.units import mm from reportlab.pdfgen import canvas def get_x_y_coordinates(columns, rows, x_start, y_start): x = 51.6 y = -28.42 for column in range(colum...
''' // Copyright 2008 Google Inc. // // 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 agre...
"""task_remainder URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cl...
""" Django settings for django_110 project. Generated by 'django-admin startproject' using Django 1.10. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import o...
import logging from django import forms from django.conf import settings from django.contrib import admin from django.contrib.admin import SimpleListFilter from django.core.mail import send_mail, EmailMessage from django.utils.translation import ugettext as _ from suit_redactor.widgets import RedactorWidget from impo...
# -*- encoding: utf-8 -*- from datetime import datetime TYPE_STRING = 'str' TYPE_BOOLEAN = 'bool' TYPE_INTEGER = 'int' TYPE_NUMBER = 'num' TYPE_DATE = 'date' TYPE_TIME = 'dtm' OPENERP_DATA_TYPES = [(TYPE_STRING, 'String'), (TYPE_BOOLEAN, 'Boolean'), (TYPE_INTEGER, 'Integer...
from a10sdk.common.A10BaseClass import A10BaseClass class NeighborPrefixLists(A10BaseClass): """This class does not support CRUD Operations please use parent. :param nbr_prefix_list_direction: {"enum": ["in", "out"], "type": "string", "description": "'in': in; 'out': out; ", "format": "enum"} :param...
import random class ThreeDoors(object): __CAR = 'Car' __GOAT_A = 'Goat A' __GOAT_B = 'Goat B' __CHOICE = [0, 1, 2] __SWITCH = [True, False] def __init__(self): self.__doors = [ThreeDoors.__CAR, ThreeDoors.__GOAT_A, ThreeDoors.__GOAT_B] random.shuffle(self.__doors) ...
from testtools import matchers from tempest.api.compute import base from tempest.common.utils import data_utils from tempest import config from tempest import test CONF = config.CONF class VolumesGetTestJSON(base.BaseV2ComputeTest): @classmethod def resource_setup(cls): super(VolumesGetTestJSON, c...
from weblab.translator.translators import StoresEverythingExceptForFilesTranslator import test.unit.configuration as configuration_module import unittest import voodoo.configuration as ConfigurationManager class StoresEverythingExceptForFilesTranslatorTestCase(unittest.TestCase): def setUp(self): self._c...
from libmich.core.element import Element, Str, Int, Bit, Layer, \ RawLayer, Block, show, log, ERR, WNG, DBG # GSM link frame format, as described in TS 44.006 # 44006, section 6.2 & 6.3, address field LAPLPD_dict = { 0 : 'GSM', 1 : 'SMSCB', } SAPI_dict = { 0 : 'CC/MM/RR', 3 : 'SMS', ...
"""StandardAlgorithms.py is a file which implements the simplistic algorithms required to be used in order to meet the project requirements. As these will not be as efficient or clean as the inbuilt Python methods, it is my intention to remove these after the completion of the project.""" def linearSearch(items, key):...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from tests import TestCase from i8c.compiler import I8CError, loggers from i8c.compiler.driver import CommandLine class TestCommandLineProcessor(TestCase): """Tests ...
import logging import flask_login # Need to expose these downstream # pylint: disable=unused-import from flask_login import (current_user, logout_user, login_required) # pylint: enable=unused-import from flask import url_for, redirect, request from flask_oauthlib.cl...
""" fumbbl setup module. """ from setuptools import setup, find_packages from codecs import open from os import path import re here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.md'), encoding='utf-8') as f: readme = f.read() version_file_path = path.join(path.dirname(__fil...
"""Support for Efergy sensors.""" import logging import requests import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import ( CONF_CURRENCY, CONF_MONITORED_VARIABLES, CONF_TYPE, ENERGY_KILO_WATT_HOUR, POWER_WATT, ) import home...
import os path = os.path import unittest from unittest import TestCase import random from random import randrange random.seed(2) import myhdl from myhdl import * from .util import setupCosimulation from myhdl import ConversionError from myhdl.conversion._misc import _error ACTIVE_LOW, INACTIVE_HIGH = 0, 1 def inc...
from django.conf import settings from django.http import HttpResponse from django.utils.decorators import decorator_from_middleware from django_websocket.middleware import WebSocketMiddleware __all__ = ('accept_websocket', 'require_websocket') WEBSOCKET_MIDDLEWARE_INSTALLED = 'django_websocket.middleware.WebSocketMi...
import datetime import django_tables2 as tables import six from django.contrib import messages from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse import karaage.common as util from karaage.common.decorators import admin_required, login_r...
# -*- coding: utf-8 -*- from shiva.converter import Converter from shiva.resources.upload import UploadHandler from shiva.media import MimeType DEBUG = True SQLALCHEMY_DATABASE_URI = 'sqlite:///shiva.db' ACCEPTED_FORMATS = ( 'mp3', ) MIMETYPES = ( MimeType(type='audio', subtype='mp3', extension='mp3', ...
import pygame, sys, math, time, os import getopt, traceback, tempfile from . import game, font, save_menu, resource, menu, events from . import config, sound, alien_invasion, quakes, mail, version, compatibility from .primitives import * from .game_types import * from .game_random import PlaybackEOF def Main(data_d...
from store import KeyValueStoreBase from JumpScale import j import pymongo from pymongo import MongoClient import ujson as json import time def chunks(l, n): for i in xrange(0, len(l), n): yield l[i:i+n] class MongoDBKeyValueStore(KeyValueStoreBase): osis = dict() def __init__(self,namespace=...
import re _TWO_LINES_REGEXP = re.compile('\n\s\n') _SPACE_REGEXP = re.compile('\s*') def parse(pxe_entry): res = {} for section in _TWO_LINES_REGEXP.split(pxe_entry): title = None for line in section.split('\n'): line = line.strip() try: key, value = lin...
import kfp.dsl as dsl @dsl.pipeline( name="VolumeOp Sequential", description="The third example of the design doc." ) def volumeop_sequential(): vop = dsl.VolumeOp( name="mypvc", resource_name="newpvc", size="10Gi", modes=dsl.VOLUME_MODE_RWM ) step1 = dsl.Container...
#!/usr/bin/python """Script to implement a multi channel pulse counter that posts to the mini-monitor MQTT broker. This script should be started by a supervisor capable of restarting the script if an error occurs. """ import time import sys import argparse import input_change import mqtt_poster # GPIO Pins (BCM numbe...
import os from lxml import etree from django.conf import settings from ConfigParser import SafeConfigParser from owslib.iso import MD_Metadata from pycsw import server from geonode.catalogue.backends.generic import CatalogueBackend as GenericCatalogueBackend from geonode.catalogue.backends.generic import METADATA_FORMA...
import asyncio from typing import cast import httpcore import httpx from httpcore._async.base import ( AsyncByteStream, AsyncHTTPTransport, ConnectionState, NewConnectionRequired, ) from httpcore._async.connection import AsyncHTTPConnection from httpcore._async.connection_pool import ResponseByteStre...