text
stringlengths
1
927k
import os import sys import pyexr import numpy as np from PIL import Image import re def exec(): filepaths = [] savepaths = [] images = [] maxvalues = [] # Prep variable filelist = os.listdir("output") for file in filelist: if file.endswith(".exr"): filepath = os...
#!/usr/bin/env python3 # # Este arquivo é parte do programa multi_agenda # # Esta obra está licenciada com uma # Licença Creative Commons Atribuição 4.0 Internacional. # (CC BY 4.0 Internacional) # # Para ver uma cópia da licença, visite # https://creativecommons.org/licenses/by/4.0/legalcode # # WELLINGTON SAMPAI...
# # module tank.core.cloud_settings # from enum import Enum import yaml import jsonschema from tank.core.exc import TankConfigError class CloudProvider(Enum): DIGITAL_OCEAN = 'digitalocean' GOOGLE_CLOUD_ENGINE = 'gce' def __repr__(self): return '<%s.%s>' % (self.__class__.__name__, self.name...
# pylint: disable=too-many-locals,too-many-statements,too-many-lines import random from collections import namedtuple from copy import deepcopy from itertools import cycle import pytest from raiden.constants import EMPTY_MERKLE_ROOT, UINT64_MAX from raiden.messages import Unlock from raiden.settings import DEFAULT_NU...
import sys from pyspark.sql import DataFrame, SparkSession from etl.constants import Constants from etl.jobs.util.cleaner import init_cap_and_trim_all from etl.jobs.util.dataframe_functions import transform_to_fk from etl.jobs.util.id_assigner import add_id def main(argv): """ Creates a parquet file with pa...
# -*- coding: utf-8 -*- """Router with RabbitMQ topic exchange""" import asyncio import logging import asynqp from urllib.parse import urlparse # RABBITMQ_HOST = 'localhost' # RABBITMQ_PORT = 5672 # RABBITMQ_USERNAME = 'guest' # RABBITMQ_PASSWORD = 'guest' # RABBITMQ_VIRTUAL_HOST = '/' # EXCHANGE = 'sam.router' # QU...
import plotly class Plotter: def __init__(self): pass def plot_metrics(self): pass
import sys from types import MappingProxyType, DynamicClassAttribute __all__ = [ 'EnumMeta', 'Enum', 'IntEnum', 'Flag', 'IntFlag', 'auto', 'unique', ] def _is_descriptor(obj): """Returns True if obj is a descriptor, False otherwise.""" return ( hasattr(obj, '__get...
#! /usr/bin/env python import argparse import os import numpy as np import json from voc import parse_voc_annotation from yolo import create_yolov3_model, dummy_loss from generator import BatchGenerator from utils.utils import normalize, evaluate, makedirs from tensorflow.keras.callbacks import EarlyStopping, ReduceLR...
from typing import Text from rasa.core.featurizers.tracker_featurizers import TrackerFeaturizer from rasa.core.featurizers.single_state_featurizer import SingleStateFeaturizer from rasa.shared.core.domain import Domain import numpy as np from rasa.shared.nlu.constants import ACTION_TEXT, ACTION_NAME, ENTITIES, TEXT, IN...
import serial import traceback import time import decode class UART: def __init__(self): # シリアル通信設定  # ボーレートはラズパイのデフォルト値:115200に設定 try: self.uartport = serial.Serial( port="/dev/ttyS0", baudrate=115200, bytesize=serial.EIGHTBITS,...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
import os import json import pytest import shutil # Getting absolute paths, names and regexes TEST_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = os.path.dirname(TEST_DIR) SERVICE_CONFIG_NAME = "service_manifest.yml" SERVICE_CONFIG_PATH = os.path.join(ROOT_DIR, SERVICE_CONFIG_NAME) TEMP_SERVICE_CONFIG_PAT...
import datetime from cachetools import TTLCache, cached from flask import current_app from server.models.dtos.mapping_dto import TaskDTOs from server.models.dtos.project_dto import ( ProjectDTO, ProjectSummary, ProjectStatsDTO, ProjectUserStatsDTO, ProjectContribsDTO, ProjectContribDTO, Proj...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
#-****************************************************************************** # # Copyright (c) 2012, # Sony Pictures Imageworks Inc. and # Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # ...
from .base_page import BasePage from .locators import BasketPageLocators class BasketPage(BasePage): def should_be_empty(self): self.no_items_in_basket() self.message_no_items_is_present() def no_items_in_basket(self): assert self.is_not_element_present(*BasketPageLocators.BASKET_FOR...
import filecmp import os from contextlib import redirect_stdout from io import StringIO from typing import Optional from tests.utils.filters import ldcontext_metadata_filter def make_and_clear_directory(dirbase: str) -> None: """ Make dirbase if necessary and then clear generated files """ import shutil ...
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/globocom/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com from os.path import abspath, join, dirname from pyvows import Vows,...
N = int(input()) stairs = list(map(int, input().split())) def pay_stair(prices, counts): step_back = 0 two_steps_back = 0 for i in range(counts): costs = min(step_back, two_steps_back) + prices[i] two_steps_back = step_back step_back = costs return costs print(pay_stair(stai...
""" Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agr...
from core import co_definitions from mks import mks_uart_connector class HardwareLayer(co_definitions.ILayer): def __init__(self): co_definitions.ILayer.__init__(self) self.HW = mks_uart_connector.Connector() self.Locker = None self.AsyncListeners = [] self.HW.AdaptorDisconnectedEvent = self.AdaptorDis...
# NEEDS FIXING # -*- coding: utf-8 -*- ''' fantastic Add-on This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later versio...
from django.urls import path from . import views urlpatterns = [ path('new_news', views.get_new_newsfeed, name='get_new_newsfeed'), path('best_news', views.get_best_newsfeed, name='get_best_newsfeed'), ] # , name='get_new_newsfeed' # , name='get_best_newsfeed'
import sys import numpy as np import numpy.random as npr import cv2 from fcn.config import cfg from utils.blob import im_list_to_blob, pad_im, chromatic_transform from utils.se3 import * import scipy.io from normals import gpu_normals def get_minibatch(roidb, voxelizer): """Given a roidb, construct a minibatch sam...
# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# project # import libraries import cv2 import numpy as np import argparse import time # Import YOLO weights net = cv2.dnn.readNet("yolov3.weights", "yolov3.cfg" ) classes = [] with open("coco.names", 'r') as f: classes = [line.strip() for line in f.readlines()] layer_names = net.getLayerNames() outer...
from robot_control import Robot from game_interfaces.msg import PlayerCommand class NullController(Robot): def __init__(self): pass def get_action(self, my_pos_efcs, ball_pos_efcs, team_positions_wcs=None, opponents_positions_wcs=None): l_rpm = 0 r_rpm = 0 action = 0 r...
import json from importlib import import_module import pandas as pd from pandas.errors import EmptyDataError import numpy as np import pickle import shutil import time from pathlib import Path from collections import defaultdict class CsvValue: def __init__(self, path): self.path = path try: ...
import unittest import time import os from datetime import datetime, timedelta from unittest.mock import patch from spaceone.core.unittest.result import print_data from spaceone.core.unittest.runner import RichTestRunner from spaceone.core import config from spaceone.core.transaction import Transaction from spaceone.co...
import factory from wagtailtrans import models class LanguageFactory(factory.DjangoModelFactory): code = 'en-gb' position = 0 is_default = True live = True class Meta: model = models.Language django_get_or_create = ['code']
# (C) Datadog, Inc. 2018 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import os import sys from stackstate_checks.dev import EnvVars, run_command from stackstate_checks.dev.utils import chdir, remove_path from stackstate_checks.dev._env import TESTING_PLUGIN, E2E_PREFIX HERE = os....
import os from segmentation.cityscape_reader import CityscapesDemoDataset import tensorflow as tf import argparse import numpy as np import cv2 from segmentation.labels import cityscapes_mask_colors from segmentation.model import DeeplabV3 parser = argparse.ArgumentParser(description="Cityscapes") parser.add_argument...
# Lint as: python3 # Copyright 2018, The TensorFlow Federated Authors. # # 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 ...
from pprint import pprint import numpy as np from keras.models import Model from keras.layers import Activation, Dense, Input, Masking, TimeDistributed if __name__ == "__main__": inp = Input(shape=(3, 6)) mask = Masking(mask_value=0.1)(inp) out = TimeDistributed(Dense(1, activation="linear"))(mask) ...
"""Command line functions for segmenting audio files""" from __future__ import annotations import os from typing import TYPE_CHECKING, List, Optional from montreal_forced_aligner.exceptions import ArgumentError from montreal_forced_aligner.segmenter import Segmenter if TYPE_CHECKING: from argparse import Namespa...
"""Create genome index for BWA aligner.""" import shutil from pathlib import Path from plumbum import TEE from resolwe.process import Cmd, DataField, DirField, FileField, Process, StringField class BWAIndex(Process): """Create BWA genome index.""" slug = "bwa-index" process_type = "data:index:bwa" ...
import connexion import six from swagger_server.models.inline_response200 import InlineResponse200 # noqa: E501 from swagger_server.models.inline_response2001 import InlineResponse2001 # noqa: E501 from swagger_server.models.inline_response2002 import InlineResponse2002 # noqa: E501 from swagger_server.models.model...
# # MIT License # # Copyright (c) 2018 WillQ # # 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, publ...
import re from .tag import normalize class BadExpression(Exception): def __init__(self, txt): Exception.__init__(self, txt) def _negate(txt, negated): return "NOT " + txt if negated else txt class BinaryExpr(): def __init__(self, lhs=None, operator=None): self.negated = False ...
from flask import Flask, render_template app = Flask(__name__, static_url_path="/static") navigation = [ ("Home", "/"), ("CV", "/cv"), ("Projects", "/projects"), ]; def page(name: str): with open(f"pages/{name}.html") as f: content = f.read() kwargs = { "content": conte...
# @Author: charles # @Date: 2020-03-06T13:54:13-05:00 # @Last modified by: charles # @Last modified time: 2020-04-21T08:48:50-04:00 # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www...
from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from rest_framework import viewsets from rest_framework.authentication import TokenAuthentication from rest_framework import filters from rest_framework.authtoken.views import ObtainAuthToken from res...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ config functions """ import codecs from configparser import ConfigParser from os.path import dirname, join, abspath, exists from ast import literal_eval import numpy as np import abc from pathlib import Path def configread( config_fn, encoding="utf-8", cf...
import face_recognition def compare_faces(original_face, captured_face): same_person = False original_face_encoding = get_image_encoding(original_face) captured_face_encoding = get_image_encoding(captured_face) if len(captured_face_encoding) > 0 and len(original_face_encoding) > 0: ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import sys import tempfile from observations.r.phosphor import phosphor def test_phosphor(): """Test module phosphor.py by downloading phosphor.csv and testing shape of extracted data h...
# Copyright (c) 2013-2015, Intel Performance Learning Solutions Ltd, Intel Corporation. # # 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/LICENS...
#!/usr/bin/env python """ Siamese networks ================ """ import random import numpy as np import matplotlib.pyplot as plt from matplotlib import offsetbox import deeppy as dp # Fetch MNIST data dataset = dp.dataset.MNIST() x_train, y_train, x_test, y_test = dataset.data(flat=True, dp_dtypes=True) # Normaliz...
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hackforthesea.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
# Copyright 2021 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
""" WSGI config for mmee project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS...
#!/usr/bin/env python from __future__ import print_function import argparse from distutils import file_util import os import json import platform import shutil import subprocess import sys import errno if platform.system() == 'Darwin': shared_lib_ext = '.dylib' else: shared_lib_ext = '.so' macos_deployment_t...
""" Import as: import oms as oms """ from oms.oms_db import * # pylint: disable=unused-import # NOQA from oms.order_processor import * # pylint: disable=unused-import # NOQA from oms.portfolio import * # pylint: disable=unused-import # NOQA from oms.portfolio_example import * # pylint: disable=unused-import # NOQ...
# # flp - Module to load fl forms from fd files # # Jack Jansen, December 1991 # import os import sys import FL SPLITLINE = '--------------------' FORMLINE = '=============== FORM ===============' ENDLINE = '==============================' class error(Exception): pass ############################################...
from abc import ABC, abstractmethod class AbstractGame(ABC): """ Inherit this class for muzero to play """ @abstractmethod def __init__(self, seed=None): pass @abstractmethod def step(self, action): """ Apply action to the game. Args: ...
# coding: utf8 def get_luts(): import os from clinica.utils.exceptions import ClinicaException try: # For aparc+aseg.mgz file: default = os.path.join(os.environ['FREESURFER_HOME'], 'FreeSurferColorLUT.txt') # For aparc.a2009s+aseg.mgz file: ...
import aiohttp from server.core.common import LoggingMixin _JOB_FULL_PATH = '%(job_base_path)s/job/%(job_name)s/job/%(branch)s' _JOB_INFO = '%(job_full_path)s/api/json?depth=0' # BUILD_INFO = '%(job_full_path)s/%(number)d/api/json' _LAST_SUCCESS_BUILD_INFO = '%(job_full_path)s/lastSuccessfulBuild/api/json' _BUILD_JOB ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import tensorflow as tf from DataGenRandomT import DataGenRandomT from DataGenClass import DataGen3, DataGenMulti, DataGen3reduce import numpy as np def _bytes_feature(value): return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value])) def _int64_feature(va...
# -*- coding: utf-8 -*- # Copyright © 2017 Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can # be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause from __future__ import print_function as _ from __future__ import division as _ from...
# coding: utf-8 # 定义全局空间的foo函数 def foo(): print("全局空间的foo方法") # 全局空间的bar变量 bar = 20 class Bird: # 定义Bird空间的foo函数 def foo(self): print("Bird空间的foo方法") # 定义Bird空间的bar变量 bar = 200 # 调用全局空间的函数和变量 foo() print(bar) # 调用Bird空间的函数和变量 Bird.foo() print(Bird.bar)
"""Utility functions shared across tasks.""" import numpy as np import matplotlib as mpl # For headless environments mpl.use('Agg') # NOQA import matplotlib.pyplot as plt import matplotlib.patches as mpatches from rastervision.common.utils import plot_img_row def predict_x(x, model): batch_x = np.expand_dims(x, ...
import time import numpy as np import matplotlib import torch as t import visdom matplotlib.use('Agg') from matplotlib import pyplot as plot VOC_BBOX_LABEL_NAMES = ( 'fly', 'bike', 'bird', 'boat', 'pin', 'bus', 'c', 'cat', 'chair', 'cow', 'table', 'dog', 'horse', ...
''' Provides a mock SMTP server implementation, MockSMTPServer. Sample usage: ---- # create the server -- will start automatically import smtpmock mock_server = smtpmock.MockSMTPServer("localhost", 25025) #send a test message import smtplib client = smtplib.SMTP("localhost", 25025) fromaddr = "test.sender@mydomain.co...
# Imports from 3rd party libraries import dash import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output # Imports from this application from app import app, server from pages import index, predictions, insights, process ...
from setuptools import setup setup( name = 'messagebird', packages = ['messagebird'], version = '1.2.0', description = "MessageBird's REST API", author = 'MessageBird', author_email = 'support@messagebird.com', url = 'https://gith...
##=============================================== ## Jiadong Mai (20557203) ## CS 116 Winter 2018 ## Assignment 01, Question 1 ##=============================================== import math import check ## QUESTION 1 ## how_many_phone(phone_length, distance) return the minimum natural number ## of cell phones ...
# -*- encoding: utf-8 -*- """ @File : pageos.py @Time : 2020/2/28 7:49 下午 @Author : zhengjiani @Email : 936089353@qq.com @Software: PyCharm """ from flask import jsonify, Blueprint, Response, request from . import api from ..code import ResponseCode from ..response import ResMsg from ..util import route @rout...
from tool.runners.python import SubmissionPy from collections import Counter class CocoSubmission(SubmissionPy): def run(self, s): """ :param s: input in string format :return: solution flag """ # Your code goes here groups = s.split("\n\n") sum = 0 ...
''' Class for reading from Brainware DAM files DAM files are binary files for holding raw data. They are broken up into sequence of Segments, each containing a single raw trace and parameters. The DAM file does NOT contain a sampling rate, nor can it be reliably calculated from any of the parameters. You can calcul...
"""Unit tests for the bytes and bytearray types. XXX This is a mess. Common tests should be unified with string_tests.py (and the latter should be modernized). """ import array import os import re import sys import copy import functools import pickle import tempfile import unittest import test.support import test.s...
from miscellaneous import Misc from Vector import Vector import Constants import math # pylint: skip-file class CollisionHandler : def collisionResolution(self,V_incident, N):# Vecteur incident a lobstacle et normale de lobstacle pscal = (V_incident.dx*N.dx + V_incident.dy*N.dy) if Misc.isBetween(...
from collections import deque from dataclasses import dataclass from enum import Enum, auto from typing import Callable, Iterable, List import numpy as np import pandas as pd from .handlers.base_handler import BaseHandler, BaseNode, TreeFileHandler from .util import match_regex_list, str_comparison @dataclass class...
from setuptools import setup from mxtheme import __version__ setup( name = 'mxtheme', version = __version__, author = 'Mu Li', author_email= '', url="https://github.com/mli/mx-theme", description='A Sphinx theme based on Material Design, adapted from sphinx_materialdesign_theme', packages =...
import os import sys import time import random import string import argparse import torch import torch.backends.cudnn as cudnn import torch.nn.init as init import torch.optim as optim import torch.utils.data import numpy as np from utils import CTCLabelConverter, CTCLabelConverterForBaiduWarpctc, AttnLabelConverter, ...
# -*- coding: utf-8 -*- # # Copyright 2017-2021 - Swiss Data Science Center (SDSC) # A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and # Eidgenössische Technische Hochschule Zürich (ETHZ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in c...
__author__ = 'ZFTurbo: https://kaggle.com/zfturbo' import datetime import pandas as pd import numpy as np from sklearn.cross_validation import train_test_split import xgboost as xgb import random import zipfile import time import shutil from sklearn.metrics import log_loss random.seed(2016) def run_xgb(train, test, ...
from passlib.context import CryptContext pwd_context = CryptContext(schemes=["bcrypt"], deprecated = "auto") def hash(password: str): return pwd_context.hash(password) def verify(plain_password, hashed_password): return pwd_context.verify(plain_password, hashed_password)
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import sys, os from pathlib import Path import qlib import fire import pandas as pd import ruamel.yaml as yaml from qlib.config import C from qlib.model.trainer import task_train def get_path_list(path): if isinstance(path, str): ...
# This script joins two text files. # Use: python join.py infile1 infile2 key_pos field_separator > outfile # key_pos is the key position (1 origin) in infile1. # A record of infile2 may be joined after each record of infile1, # if the first item of the record (infile2) matches the key item. # field...
from PyQt5.QtCore import QDateTime, Qt, QTimer, pyqtSignal, QObject from PyQt5.QtWidgets import (QDialog, QApplication, QLabel, QCheckBox, QHBoxLayout, QVBoxLayout, QPushButton, QLineEdit, QSpinBox, QFormLayout, QGridLayout, QStyleFactory) import os import sys im...
__author__ = 'Fang.Xu' newsrefresh='/api/v1.0/news/refresh' newsloadmore='/api/v1.0/news/loadmore/<string:nid>' updatesrefresh='/api/v1.0/updates/refresh' updatesloadmore='/api/v1.0/updates/loadmore/<string:nid>' newsdetail='/api/v1.0/newsdetail/<string:date>/<string:nid>' strategyrefresh='/api/v1.0/strategy/refresh/<...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- coding: utf-8 -*- # Configuration file for generating sources for the format documentation from the YAML specification files import os # -- Input options for the specification files to be used ----------------------- # Directory where the YAML files for the namespace to be documented are located spec_input_spe...
''' Copyright (c) 2018 Uber Technologies, 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 agreed to in writ...
from PyQt5.QtWidgets import * import sys,pickle import os from PyQt5 import uic, QtWidgets ,QtCore, QtGui from PyQt5 import QtWidgets, uic from PyQt5.QtCore import QDir, Qt, QSortFilterProxyModel from PyQt5.QtWidgets import QDialog ,QApplication, QFileDialog, QWidget, QTextEdit, QLabel from PyQt5.uic import loadUi fro...
import re import PyQt5.QtCore as qC import PyQt5.QtGui as qG import PyQt5.QtWidgets as qW from oguilem.configuration import conf from oguilem.configuration.utils import BuildingBlockHelper, ConnectedValue from oguilem.resources import globopt from oguilem.ui.widgets import InactiveDelegate, SmartLineEdit class OGUI...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Basic stripped-down demo for running the CNMF source extraction algorithm with CaImAn and evaluation the components. The analysis can be run either in the whole FOV or in patches. For a complete pipeline (including motion correction) check demo_pipeline.py Data courtes...
#!/bin/env python import unittest from unittest.mock import Mock from pyats.topology import Device from genie.metaparser.util.exceptions import SchemaEmptyParserError,\ SchemaMissingKeyError from genie.libs.parser.iosxe.show_fdb import ShowMacAddressTable, \ ...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
# Video - https://youtu.be/t7j64JYma6o def iban_formatter(iban): result = [] counter = 1 for character in iban: if character == ' ': continue result.append(character) if counter == 4: result.append(' ') counter = 0 counter += 1 r...
#!/usr/bin/env python # -*- coding: utf-8 -*- from argparse import ArgumentParser from urllib import request from bs4 import BeautifulSoup from xml.etree import ElementTree from re import search import os import humanfriendly def is_url_or_file(item): ret = "file" if search("http[s]", item): ret = "u...
import base64 import hashlib import json import logging import os import shutil import tempfile from collections import defaultdict from threading import Lock from uuid import uuid4 from bottle import response, static_file from weavelib.exceptions import BadArguments from weavelib.rpc import RPCClient, find_rpc from ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from pushTasks.celery import app import logging import struct import redis import json import requests import sys sys.path.append('../') from util.common import install_logger from util import Http2APNsClient from pushserver_config ...
"""Certbot main entry point.""" # pylint: disable=too-many-lines from __future__ import print_function import functools import logging.handlers import sys import configobj import josepy as jose import zope.component from acme import errors as acme_errors from acme.magic_typing import Union, Iterable, Optional, List,...
import sys from functools import partial import pluginmanager import six import plugin from utilities.GeneralUtilities import warning, error, executable_exists class PluginManager(object): """ Frontend for pluginmanager https://github.com/benhoff/pluginmanager Also handles plugin.PluginComposed ...
#!/usr/bin/env python2.7 # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Li...
__author__ = 'tsungyi' import numpy as np import datetime import time from collections import defaultdict import mask as maskUtils import copy class COCOeval: # Interface for evaluating detection on the Microsoft COCO dataset. # # The usage for CocoEval is as follows: # cocoGt=..., cocoDt=... ...
from flask import render_template,redirect,url_for,flash,request from app.models import User from .forms import SignUpForm, LoginForm, validate_email from .. import db from . import auth from flask_login import login_user,logout_user,login_required from ..email import mail_message from wtforms import ValidationError ...
import os import tarfile import email import re import nltk import urlextract import numpy as np import scipy.io as sio from sklearn.base import BaseEstimator, TransformerMixin from nltk.stem import PorterStemmer from html import unescape from email import parser from email.policy import default from six.moves import u...
from adapters.base_adapter import Adapter from devices.switch.selector_switch import SelectorSwitch class GiraLightLink(Adapter): def __init__(self, devices): super().__init__(devices) self.switch = SelectorSwitch(devices, 'switch', 'action') self.switch.add_level('Off', 'off') se...