content
stringlengths
5
1.05M
import pprint import os import json import uuid import glob betweenEvents=20*90 states={} debug=True packName="chaos" def addState(functionName,states,index,totalCount): functionName=functionName.replace(".mcfunction","") states[functionName]={} states["default"]["transitions"].append({functionName:"math.di...
#import the necessary packages import imutils import cv2 def preprocess(image, width, height): #grab the dimensions of the image (h, w) = image.shape[:2] #if the width is longer than the height, reshape along width if w>h: image= imutils.resize(image, width=width) else: image =...
from datetime import timedelta def add_gigasecond(birth_date): return birth_date + timedelta(seconds = 10**9)
#!/usr/bin/env python # -*- coding: utf-8 -*- # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: © 2021 Massachusetts Institute of Technology. # SPDX-FileCopyrightText: © 2021 Lee McCuller <mcculler@mit.edu> # NOTICE: authors should document their contributions in concisely in NOTICE # with details inline ...
# type: ignore """ Greynir: Natural language processing for Icelandic Copyright (C) 2021 Miðeind ehf. This software is licensed under the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files ...
from bs4 import BeautifulSoup import requests import lxml def getLinks(url): """ Receive a URL and return a BeautifulSoup object """ headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36"} try: htm...
from rich.console import Console from rich import box from rich.table import Table rconsole = Console() rtable = Table(box=box.ROUNDED)
class Vehiculo(object): """docstring for Vehiculo""" def __init__(self, **args): self._color = args.get('color') self._modelo = args.get('modelo') self._marca = args.get('marca') def set_color(self, color): self._color = color def get_color(self): return self._color def set_modelo(self, modelo): s...
from __future__ import absolute_import, print_function, unicode_literals if __name__ == "__main__": from .cli import cli cli.wormhole() else: # raise ImportError('this module should not be imported') pass
# Author: Aniruddha Gokhale # Created: Fall 2019 # Modified: Spring 2021 # # Purpose: demonstrate subscriber for a topic receiving complex data type # # Here our topic comprises a sequence number, a timestamp, and a data buffer # of several uint32 numbers (whose value is not relevant to us) # import the needed pa...
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import os import sys from setuptools import setup name = 'faker-e164' package = 'faker_e164' description = """Faker Provider to generate phone numbers in E164 format.""" url = 'https://github.com/crowdcomms/faker-e164' author = 'Adam Jacquier-Parr' author_email ...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse_urlparse, compat_urlparse, ) from ..utils import ( determine_ext, extract_attributes, int_or_none, js_to_json, mimetype2ext, orderedSet, pa...
#!/bin/env python # Copyright 2016 Simón Oroño # # 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...
######## # Copyright (c) 2016 GigaSpaces Technologies Ltd. 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...
# -*- coding: utf-8 -*- import subprocess print('$ nslookup') p = subprocess.Popen(['nslookup'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) output, err = p.communicate(b'set q=mx\npython.org\nexit\n') # 通过communicate()方法输入 print(output.decode('utf-8')) print('Exit code:', p.returnco...
""" File Name: __init__.py Project: dl-project-template File Description: PyTorch dataset and related functions and classes """
from allauth.account.adapter import DefaultAccountAdapter from django.conf import settings class AccountAdapter(DefaultAccountAdapter): def send_mail(self, template_prefix, email, context): if settings.DEBUG: pass else: from skatelife.settings.SendCloud import API_KEY, AP...
""" PynamoDB Library ^^^^^^^^^^^^^^^^ A simple abstraction over DynamoDB """ __author__ = 'Nic Wanavit' __license__ = 'MIT' __version__ = '0.0.4'
""" Module for line shapes in SqE modeling. """ import json import numpy as np from types import MethodType from math import isclose from inspect import getfullargspec from .utils.lineshape_functions import lorentzian, lorentzian_cdf, fqe_c, fqe_I from .utils.util import bose_factor ##################################...
# encoding:utf-8 import sys import base64 import urllib.request import urllib.parse ''' 菜品识别 ''' request_url = "https://aip.baidubce.com/rest/2.0/image-classify/v2/dish" # 二进制方式打开图片文件 f = open(sys.argv[1], 'rb') img = base64.b64encode(f.read()) params = {"image": img, "top_num": 5} params = urllib.parse.urlencode(pa...
import sleekxmpp as sleekxmpp class SendMsgBot(sleekxmpp.ClientXMPP): def __init__(self, jid, password, recipient, message): sleekxmpp.ClientXMPP.__init__(self, jid, password) # The message we wish to send, and the JID that # will receive it. self.recipient = recipient sel...
import pytest from pytest_voluptuous import Partial, S from flm_base.plugin import FunctionLifecycleManagerBasePlugin from manobase.messaging import AsyncioBrokerConnection as Connection from manobase.messaging import Message from manobase.messaging.util import async_endpoint DEPLOY_TOPIC_NORTH = FunctionLifecycleMan...
test_inbound_payload = {} test_inbound_payload['text'] = """This is a message. Sent with Unibox """ test_inbound_payload['charsets'] = '{"to":"UTF-8","html":"utf-8","subject":"UTF-8","from":"UTF-8","text":"utf-8"}' test_inbound_payload['subject'] = 'test' test_inbound_payload['to'] = '<to@example.com>' test_inboun...
import requests requests.post('https://textbelt.com/text', { 'phone': 'text#redacted', 'message': 'Hello world', 'key': 'textbelt', }) # only really sending # very limited windows support
import csv, sys, urllib, urllib2, json, re import traceback import time POSTCODE_FILE = 'postcode_all.csv' DISTRICT_FILE = 'district.csv' district_map = dict() district_ok = dict() with open(DISTRICT_FILE, "rb") as district_file: reader = csv.reader(district_file) header = reader.next() for row in reader:...
# Copyright 2020 The SODA 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 by applicable law or agreed to in writin...
import matplotlib.colors as pcolor import numpy as np import pandas import pandas as pd import pymap3d as pm import tensorflow as tf from matplotlib import pyplot as plt from sklearn.preprocessing import MinMaxScaler plt.style.use('dark_background') font = {'family': 'Arial', 'weight': 'normal', 'size': 10} plt.rc('fo...
import sys import os # allow the example to be run without installing the package, from this repository's root directory sys.path.append(os.path.abspath(os.path.join('.'))) """ Chatroom Example This example is made to be run from 2 separate python shells: python examples/hello_world.py """ from peerpy import Peer, pr...
#!/usr/bin/env python3 from PyQt5.QtCore import * from PyQt5.QtWidgets import * import sys class Window(QWidget): def __init__(self): super(Window, self).__init__() layout = QGridLayout() self.setLayout(layout) time = QTime() time.setHMS(13, 15, 40) timeedit = QT...
# Define here the models for your scraped items # # See documentation in: # https://docs.scrapy.org/en/latest/topics/items.html import scrapy class CoiProjectItem(scrapy.Item): # define the fields for your item here like: # name = scrapy.Field() fileName = scrapy.Field() content = scrapy.Field() ...
#!/usr/bin/env python """ Sockets in promiscuous mode """ # It works also for WindDump.exe, on Windows. import os import re import sys import time import socket import binascii import struct import lib_uris import lib_util import lib_common from lib_properties import pc ############################################...
# @Author: Ivan # @LastEdit: 2020/9/23 import threading import cv2 # install from keras.models import load_model from keras import backend as K import numpy as np # install from PIL import Image, ImageDraw, ImageFont # install import wx # install from predict import predict_class_name_and_confidence from predict im...
# -*- coding: utf-8 -*- # Copyright 2017 Kakao, Recommendation Team # # 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 a...
import numpy as np from gustavgrad import Tensor from gustavgrad.function import sigmoid, tanh class TestActivation: def test_sigmoid(self) -> None: t1 = Tensor(np.zeros(shape=(3, 3, 3)), requires_grad=True) t2 = sigmoid(t1) assert t2.shape == (3, 3, 3) np.testing.assert_allclose...
import time import rpyc from rpyc.utils.server import ThreadedServer import calculator class MyService(rpyc.Service): def on_connect(self, conn): # code that runs when a connection is created # (to init the service, if needed) pass def on_disconnect(self, conn): # code that ru...
#!/usr/bin/env vpython # Copyright 2021 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Wrapper for running Telemetry benchmarks on Fuchsia devices.""" from __future__ import print_function import os import sys import...
import aspose.slides as slides import aspose.pydrawing as drawing def charts_entities_formatting(): #ExStart:ChartEntities # The path to the documents directory. dataDir = "./examples/data/" outDir = "./examples/out/" # Instantiating presentation# Instantiating presentation with slides.Presen...
from array import array import sys import tarfile import os import json from jira import JIRA from jira import Issue from jira import JIRAError APPLICATION_TOKEN = '' JIRA_HOSTNAME = 'https://jira.atlassian.com' DEFAULT_OUTPUT_DIRECTORY = 'H:/Work/Python/temp' class BugReport: def __init__(self): self.pro...
import datetime import pytz import re def hour_to_24(hour, meridian): """ Converts a 12-hour representation to a 24-hour representation. e.g. 12, "AM" => 0 6, "AM" => 6 12, "PM" => 12 3, "PM" => 15 11, "PM" => 23 """ # first, if it's 12 whatever, subtract ...
# Generated by Django 3.1.8 on 2021-06-18 10:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('employees', '0001_initial'), ] operations = [ migrations.RenameField( model_name='employee', old_name='sick_leave_co...
from .typeannotation import TypeAnnotation class ClassType(TypeAnnotation): def __init__(self, location: [int], className: str): super().__init__(location, "ClassType") self.className = className def visit(self, visitor): return visitor.ClassType(self) def toJSON(self, dump_loca...
#!/usr/bin/env python # -*- coding: utf-8 -*- # author: Olivier Noguès import re import json class ListBase(object): @property def val(self): """ Property to get the jquery value of the HTML objec in a python HTML object """ return '$(this).text()'
#!/usr/bin/python from mininet.cli import CLI from mininet.link import TCLink from mininet.log import setLogLevel, info from mininet.net import Mininet from mininet.node import Host from mininet.node import OVSKernelSwitch from mininet.node import RemoteController def simpleNetwork(): net = Mininet( topo=None, ...
from .Provider.DefaultFileProvider import DefaultFileProvider from .Provider import Provider
#!/usr/bin/env python3 # # BSD 3-Clause License # # This file is part of the RootBA project. # https://github.com/NikolausDemmel/rootba # # Copyright (c) 2021, Nikolaus Demmel. # All rights reserved. # from operation_counts import * # here, import data! num_iter_cg = 100 dim_poses = 9 dim_landmarks = 3 dim_res = 2 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # future proof py2 vs py3 from __future__ import absolute_import from __future__ import division from __future__ import print_function import unittest from derpy import option class TestOption(unittest.TestCase): def test_bsm_euro_call(self): opt = option.O...
import logging from http import HTTPStatus from flask import request from lighthouse.constants.error_messages import ( ERROR_ADD_COG_BARCODES, ERROR_PLATES_CREATE, ERROR_UNEXPECTED_PLATES_CREATE, ERROR_UPDATE_MLWH_WITH_COG_UK_IDS, ) from lighthouse.constants.fields import FIELD_PLATE_BARCODE from ligh...
# Code Sample from the tutorial at https://learncodeshare.net/2015/07/02/update-crud-using-cx_oracle/ # section titled "Resetting the data" # The following resets the data for use with the update section # For both tables: # Table data is removed. # The identity column is set to start with the id after the star...
from sklearn.linear_model import LogisticRegression from sklearn.naive_bayes import MultinomialNB from sklearn.tree import DecisionTreeClassifier from sklearn.neighbors import KNeighborsClassifier from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import AdaBoostClassifier from sklearn.ensemble i...
#! /bin/env python # # PDR data tools. # import argparse # pylint: disable=superfluous-parens # pylint: disable=broad-except import datetime import logging import math import os import sys from werkzeug.exceptions import NotFound from rdr_service.cloud_utils.gcp_cloud_tasks import GCPCloudTask from rdr_service.dao.b...
v = [0,0,0,0,0,0,0,0,0,0] c = 0 while(c<10): v[c] = str(input("Digite um nome: ")) c+=1 c = 0 while(c != -1): c = int(input("Digite um número entre 0 e 9: ")) if (c<10 and c>-1): print(v[c]) print(f"Aqui estão todos os nomes {v}")
""" Package for the pyapp application. """ from .__version__ import __version__ from .__main__ import main
import numpy as np import pickle import argparse import os from pathlib import Path import StimSet from SAILnet import SAILmods import fitlearners parser = argparse.ArgumentParser() parser.add_argument('--learner', default='SAILnet', type=str) parser.add_argument('-g', '--gain', default=2, type=float) parser.add_argum...
#!/usr/bin/env python # -*- coding: utf-8 -*- import pymongo from collections import defaultdict from dateutil.parser import parse def extract_whole_sale_volumn(): mongo_client = pymongo.MongoClient() db_test_01 = mongo_client.db_test_01 sale_volumns_dict = defaultdict(int) for doc in db_test_01...
import pytest from streamlit_server_state.server_state import ServerState def test_forbidden_key(): state = ServerState() with pytest.raises(KeyError): state["__items__"] = 42 with pytest.raises(KeyError): state["__items__"] with pytest.raises(KeyError): del state["__items_...
import datetime import json import re def load_sources_config(filename): """Loads a JSON file containing the configuration of the available sources. :param filename: the filename of the JSON file. :type filename: str. """ if type(filename) == file: # Already an open file retur...
from gi import pygtkcompat pygtkcompat.enable() pygtkcompat.enable_gtk(version='3.0') import gtk import cgi import odml.format as format from . import commands from .TreeView import TreeView COL_KEY = 0 COL_VALUE = 1 class AttributeView(TreeView): """ A key-value ListStore based TreeView showing propert...
''' AWS SES - http://boto.readthedocs.org/en/latest/ref/ses.html ''' from django.core.mail.message import EmailMultiAlternatives from django.core.urlresolvers import reverse from django.contrib.sites.models import Site import json from datetime import datetime from enum import Enum import boto.ses import requests fro...
import datetime from dc18.dates import meals, nights def parse_date(date): return datetime.date(*(int(part) for part in date.split('-'))) def meal_choices(orga=False): for meal, date in meals(orga=orga): date = date.isoformat() yield ('{}_{}'.format(meal, date), '{} {}'.forma...
from __future__ import annotations from typing import Optional from pydantic import BaseModel class ResponceHandler(BaseModel): send_to_chat_id: str message: Optional[str] keyboard_code: Optional[str] = None error: Optional[str] = None is_matches_found: bool = False class Config: ...
import tensorflow as tf from dnn.models.conv.blocks import ChongTayDecoder def test_forward_default(): model = ChongTayDecoder() x = tf.random.normal((1, 10, 26, 26, 64)) out = model(x) assert tf.TensorShape(out.shape) == tf.TensorShape((1, 10, 227, 227, 1))
#!/usr/bin/env python # # Copyright 2012-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your opt...
import os import uuid import json import tempfile import time from pathlib import Path from unittest import TestCase import boto3 class PackageIntegBase(TestCase): @classmethod def setUpClass(cls): cls.region_name = os.environ.get("AWS_DEFAULT_REGION") cls.bucket_name = str(uuid.uuid4()) ...
__author__ = 'Jeffrey Seifried' __description__ = 'Scraping tools for getting me a damn Nintendo Switch' __email__ = 'jeffrey.seifried@gmail.com' __program__ = 'switch' __url__ = 'http://github.com/jeffseif/{}'.format(__program__) __version__ = '1.0.0' __year__ = '2017' HEADERS = { 'Accept': '*/*', 'Accept-En...
MASTER = ("127.0.0.1", 8000) WORKERS = [ ("127.0.0.1", 8001), ("127.0.0.1", 8002), ("127.0.0.1", 8003), ("127.0.0.1", 8004), ] CHUNK_SIZE = 256 * 1024 # master checks if a file processing timeout in worker WORKER_PROCESSING_TIMEOUT_SECONDS = 4 # workers wait for file processing file timeout from mast...
import tkinter as tk from PIL import Image, ImageTk, ImageEnhance from datetime import datetime import os import sys import platform class MainWindow(): def __init__(self, main, result, image_path, image_folders, n): self.main = main self.result = result self.mainFrame = tk.Frame(self.mai...
"""Payments background is actually NOT async, because it is safer to use blocking IO with fastapi-utils. Every task is executed in a threadpool. (so it is much safer to use def instead async def) Otherwise, it is a nuclear way to code like this, there are no exceptions thrown from threadpool. To be reworked in the fu...
import datetime from typing import Dict, List def date_func(x: str, _: Dict) -> bool: """Tests if the string is a valid date""" # Timestamp must be between 4713-01-01 BC and 5874897-12-31. Not implemented because it seems unnecessary if x == "": return True try: datetime.date...
import os import glob import time from exceptions import RuntimeError from common import shortcuts base_dir = '/sys/bus/w1/devices/' #device_folder = glob.glob(os.path.join(base_dir, '28*'))[0] #device_file = os.path.join(device_folder, 'w1_slave') def getSensorIDs(): folders = glob.glob(os.path.join(base_dir, '...
from ctypes import * import pythoncom import pyHook import win32clipboard import os import shutil from time import gmtime, strftime #Keylogger Vars user32 = windll.user32 kernel32 = windll.kernel32 psapi = windll.psapi current_window = None #Filewrite Vars filename_directory = "logs" filename_base = "x" filenam...
# standard library from dataclasses import dataclass from typing import Tuple # third-party packages from typing_extensions import Literal # submodules from xarray_dataclasses.datamodel import DataModel from xarray_dataclasses.typing import Attr, Coord, Coordof, Data, Dataof, Name # type hints X = Literal["x"] Y ...
from OxygenRM.internals.QueryBuilder import QueryBuilder from OxygenRM.internals.ModelContainer import ModelContainer import OxygenRM as O class RelationQueryBuilder(QueryBuilder): def __init__(self, target_model, parting_model, self_name, other_name): super().__init__(target_model.table_name, target_m...
import json import urllib3 import isi_sdk_8_0 as isi_sdk import test_constants urllib3.disable_warnings() def main(): # configure username and password configuration = isi_sdk.Configuration() configuration.username = test_constants.USERNAME configuration.password = test_constants.PASSWORD confi...
from .general_utils import * from .visualize import * __author__ = 'bebi103 Group 31' __version__ = '0.0.1'
i = int(input()) for j in range(i): print(i-j)
# Generated by Django 3.1.3 on 2021-06-23 22:31 from django.conf import settings import django.contrib.gis.db.models.fields from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import simple_history.models class Migration(migrations.Migration): dependencies = [ ...
"""***************************************************************************** * Copyright (C) 2019 Microchip Technology Inc. and its subsidiaries. * * Subject to your compliance with these terms, you may use Microchip software * and any derivatives exclusively with Microchip products. It is your * responsibility to ...
from flask import request from flask_restful import Resource from flask_jwt_extended import get_jwt_identity from helpers import Arguments, jwt_refresh_required import config class ApiKeysResource(Resource): @jwt_refresh_required def get(self): return { "google_maps" : config.maps_token, ...
#!/usr/bin/python3 # studyManager.py # # Allows users to preform basic study management for the indicated configuration # (i.e., project database) import os import sys import argparse import yaml import psycopg2 sys.path.append(os.path.join(os.path.dirname(__file__), "include")) import include.database as database fr...
import argparse parser = argparse.ArgumentParser() parser.add_argument('--class_id', type=int, choices=range(1000)) args = parser.parse_args() import numpy as np import tensorflow_hub from tqdm import tqdm from utils.data import get_sorted_filepaths, load_image_tensorflow_hub from utils.paths import path_objdet, path_...
""" Django views classes which are used to handle business domain of the pets application. """ # Class base view mixins that verify current authenticated user from django.contrib.auth.mixins import LoginRequiredMixin from django.db.models import Q # filter using operators '&' or '|' from django.shortcuts import render...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyWxpython(PythonPackage): """Cross platform GUI toolkit for Python.""" homepage = "h...
from .base import BaseMethod from .features_extractor import ( CsvFormat, ArffFormat, NullFormatter ) from parallel import wait_futures import librosa import numpy from concurrent.futures import ThreadPoolExecutor from typing import Any from collections import Counter import logging def _parse_mfcc(dat...
import sys import utils import MEN import numpy as np '''Parameter input''' if len(sys.argv) < 5 or sys.argv[1] not in ("bnc","wiki"): print("\nUSAGE: python3 projection.py bnc|wiki [num-kc] [size-proj] [percent-hash]\n\ - num-kc: the number of Kenyon cells\n\ - size-proj: how many projection neurons are ...
import urllib.request from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.desired_capabilities import Desired...
# Copyright (c) 2020-2022, NVIDIA 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/LICENSE-2.0 # # Unless required by applicable law or agre...
from .gen_spmotif import gen_dataset
# -*- coding: utf-8 -*- """ Created on Mon Oct 19 12:58:07 2015 @author: mariapanteli """ import librosa import scipy.signal import numpy class MFCCs: def __init__(self): self.y = None self.sr = None self.melspec = None self.melsr = None self.win1 = None self.hop1 =...
#!/usr/bin/env python3 # dnsmadeeasy hook for letsencrypt.sh # http://www.dnsmadeeasy.com/integration/pdf/API-Docv2.pdf from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from builtins import str from future import stan...
# Definition for an interval. # class Interval(object): # def __init__(self, s=0, e=0): # self.start = s # self.end = e class Solution(object): def merge(self, intervals): """ :type intervals: List[Interval] :rtype: List[Interval] """ if not intervals: ...
__author__ = 'shukkkur' ''' https://codeforces.com/problemset/problem/469/A ''' n = int(input()) vals = list(range(1,n+1)) p = list(map(int, input().split())) q = list(map(int, input().split())) pq = p + q for i in range(1,n+1): if i in pq: vals.pop(vals.index(i)) print('I beco...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mainwindow.ui' # # Created by: PyQt5 UI code generator 5.12.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): Main...
class Consts: url = 'http://example.com/'
""" Contains Uploaders, a class to hold a S3Uploader and an ECRUploader """ from enum import Enum from typing import Union from samcli.lib.package.ecr_uploader import ECRUploader from samcli.lib.package.s3_uploader import S3Uploader class Destination(Enum): S3 = "s3" # pylint: disable=invalid-name ECR = "e...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ THOR detects differential peaks in multiple ChIP-seq profiles between two distinct biological conditions. Copyright (C) 2014-2016 Manuel Allhof (allhoff@aices.rwth-aachen.de) This program is free software: you can redistribute it and/or modify it under the terms of th...
from pymongo import MongoClient import json import sys NUMBERS_OF_LINES = ((3,6), (5,9), (7,12)) try: client = MongoClient(host= ['localhost:27017'], serverSelectionTimeoutMS = 2000) client.server_info() db = client.ast except: print('mongo isn\'t currently running...please start it first') sys.ex...
import sqlite3, configuration from json import loads, dumps from time import time from uuid import uuid4 class DB: def __init__(self, **kwargs): self.dbname = kwargs["db"].split("/")[-1].split(".")[0] self.session = sqlite3.connect(kwargs["db"], check_same_thr...
import mock import json from DefenseLab.ServiceManager import ServiceInfo from DefenseLab.ServiceWorkers import serviceCallback def test_serviceCallback(fake_ch, fake_method): fakeInfo = { 'serviceName': 'fakeName', 'imageName': 'fakeImage', 'volumeLocation': 'fakeVolume', 'service...
from typing import List, Dict, Optional from fidesops.schemas.base_class import BaseSchema from enum import Enum class OneTrustSubtaskStatus(Enum): """Onetrust subtask status""" COMPLETED = "COMPLETED" FAILED = "FAILED" IN_PROGRESS = "IN_PROGRESS" REJECTED = "REJECTED" class OneTrustSubtask(Ba...
import wave import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as ticker import math from flask import Flask from flask import request import json def get_max(i, lst): while i < len(lst) and lst[i - 1] < lst[i]: i += 1 if i == len(lst): return lst[i - 1] return lst...