source
stringlengths
3
86
python
stringlengths
75
1.04M
mySubproc_vec_env.py
import multiprocessing from collections import OrderedDict from typing import Sequence import gym import numpy as np from stable_baselines.common.vec_env.base_vec_env import VecEnv, CloudpickleWrapper def _worker(remote, parent_remote, env_fn_wrapper): parent_remote.close() env = env_fn_wrapper.var() wh...
tunnel.py
# ------------------------------------------------------------- # tunnel.py: Python SAM Tunnel classes # ------------------------------------------------------------- """Exchange data between I2P and regular TCP sockets.""" import time, threading, sys import i2p import i2p.socket import i2p.select from i2p.pylib im...
sherlock.py
import os import time import threading import independent class Sherlock(): # Initialization function def __init__(this, search_path='', max_threads=1024, exclude=[], match_case=False, search_file_names=True, search_file_contents=True, verbose=False): this.unique_id = this._get_unique_id() t...
process.py
# coding: utf-8 """QuantLab command handler""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function import atexit import logging import os import re import signal import sys import threading import time import weakref from tornado ...
fault_tolerance_test.py
# Lint as: python3 # Copyright 2020 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 requ...
downloader.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import logging import re import random import socket import subprocess import sys from threading import Thread import time from spycis import extractors from spycis.utils import Queue, urlparse class Downloader(object): def _...
plugin.py
#!/usr/bin/env python3 # # Electron Cash - a lightweight Bitcoin Cash client # CashFusion - an advanced coin anonymizer # # Copyright (C) 2020 Mark B. Lundeberg # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to d...
subscription.py
import threading import uuid import copy import time import socket import traceback import http.client from http.server import HTTPServer import queue import urllib from lxml import etree as etree_ from sdc11073.pysoap.soapenvelope import Soap12Envelope, ReceivedSoap12Envelope, WsAddress, WsSubscribe, \ SoapRespons...
OccupancyAlert.py
#! /usr/local/bin/python2.7 # -*- coding: utf-8 -*- # #This software was developed by employees of the National Institute of #Standards and Technology (NIST), and others. #This software has been contributed to the public domain. #Pursuant to title 15 Untied States Code Section 105, works of NIST #employees are not subj...
WbeMain.py
######################################################################## # # @File: WbeMain.py # # @Author: İbrahim Alan # Onur Güzel # # @Mail: ibrahimalan996@gmail.com # onurguzel4@gmail.com # # @Description: The aim of this project is to design and # ...
unit_tests.py
#! /bin/python import time import multiprocessing import unittest import os import sys import signal import logging import pynisher import psutil try: import sklearn is_sklearn_available = True except ImportError: print("Scikit Learn was not found!") is_sklearn_available = False all_tests=1 logger = multiproce...
ServiceWorker.py
# Coyright 2017-2019 Nativepython 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 ...
PythonThreading.py
#!/user/bin/python3 #^.^ coding=utf-8 ^.^# from HelloWorld import cute_split_line # 1. threading # 2. lock # 3. ThreadLocal #*************** threading ***************# import threading from threading import Thread from time import sleep ''' def loop(): print("thread %s is running..."%threading.current_thread()....
timeit3.py
import threading import time def add(n): result = 0 for i in range(1, n): result += i print(result) if __name__ == '__main__': start = time.time() tlist = [] for i in range(2): t = threading.Thread(target=add, args=(50000001,)) tlist.append(t) # 将线程加入列表 t.star...
server.py
import logging import sys import socketserver logging.basicConfig(level=logging.DEBUG, format='%(name)s: %(message)s', ) class EchoRequestHandler(socketserver.BaseRequestHandler): def __init__(self, request, client_address, server): self.logger = logging.getLog...
util.py
""" Test utility functions """ import logging import pickle import struct import threading import time import unittest import socketserver import socket import os import json import configparser from contextlib import closing from biokbase.narrative.common import util from biokbase.workspace.client import Workspace fro...
test_cuda.py
# Owner(s): ["module: cuda"] from itertools import repeat, chain, product from typing import NamedTuple import collections import contextlib import ctypes import gc import io import os import pickle import queue import sys import tempfile import threading import unittest import torch import torch.cuda import torch.cu...
axpGUI.py
#!/usr/bin/python3 # -*- coding: UTF-8 -*- from tkinter import * import threading import os import sys import serial import time from serial.serialutil import Timeout glo_req_set_addr = -1 glo_req_set_data = -1 root = Tk() frame1 = Frame(root) frame2 = Frame(root) frame2_1 = Frame(frame2) frame2_2 = Frame(frame2)...
exchange_rate.py
from datetime import datetime import inspect import requests import sys import os import json from threading import Thread import time import csv import decimal from decimal import Decimal from .bitcoin import COIN from .i18n import _ from .util import PrintError, ThreadJob, make_dir # See https://en.wikipedia.org/w...
arduinoSerialReceiveV5.py
#Raspberry Pi Code for Agricultural Remote Sensing #Github Pull Check #Rquired Libraries import serial import time from struct import Struct import threading import sqlite3 import Queue from sqlite3 import Error import requests #Display import socket ############################################...
test_sys.py
from test import support from test.support.script_helper import assert_python_ok, assert_python_failure import builtins import codecs import gc import locale import operator import os import struct import subprocess import sys import sysconfig import test.support import textwrap import unittest import warnings # coun...
tools.py
from pytermfx.constants import * from pytermfx import Terminal, NamedColor from threading import Thread import sys import time class TerminalApp: """A class for managing a terminal app that asynchronously accepts input. The client must call start() after constructing the TerminalApp. The client may pass a...
Main.py
import pygame as p import Engine, SmartMoveFinder from multiprocessing import Process, Queue BOARD_WIDTH = BOARD_HEIGHT = 512 MOVE_LOG_PANEL_WIDTH = 300 MOVE_LOG_PANEL_HEIGHT = BOARD_HEIGHT DIMENSION = 8 SQ_SIZE = BOARD_HEIGHT // DIMENSION MAX_FPS = 15 IMAGES = {} def loadImages(): pieces = ["wp", "wR", "wN", "wB...
availability.py
import time import threading import sys import traceback from datetime import datetime, timedelta from .metric import Metric from metrics.availability import * from elasticsearch.exceptions import ConnectionError class Availability(Metric): def __init__(self, conf_path='conf/conf.json'): super().__init__(...
serial_terminal.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys, os import serial import threading import time import signal import builtins def print(*args): builtins.print(*args, sep=' ', end='', file=None, flush=True) exit_terminal = False def exit_sig_handler(sig, frame): print('Got signal to exit') glob...
multi-processing.py
import time from multiprocessing import Process square_result=[] def calc_square(numbers): global square_result for n in numbers: time.sleep(0.4) print('square ' + str(n*n)) square_result.append(n*n) print('inside process result ' + str(square_result)) def calc_cube(numbers): ...
CameraReceiverProcess.py
# Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, ...
mavproxy_param.py
#!/usr/bin/env python '''param command handling''' import time, os, fnmatch from pymavlink import mavutil, mavparm from MAVProxy.modules.lib import mp_util from MAVProxy.modules.lib import mp_module class ParamState: '''this class is separated to make it possible to use the parameter functions on a second...
test_subprocess.py
import unittest from unittest import mock from test import support import subprocess import sys import platform import signal import io import itertools import os import errno import tempfile import time import selectors import sysconfig import select import shutil import threading import gc import textwrap from test.s...
ClientDaemons.py
import ClientImporting import ClientImportOptions import ClientImportSeeds import ClientPaths import ClientThreading import HydrusConstants as HC import HydrusData import HydrusExceptions import HydrusGlobals as HG import HydrusNATPunch import HydrusPaths import HydrusSerialisable import HydrusThreading import ClientCo...
mobZpro.py
''' ┏━━━━━━━━━━━━━━━━━ ┣ 𐀀 HΞLLTΞRHΞΛD ᴄᴏʀᴘ. ┣ ©2020 ᴍᴏ-ʙᴀɴᴢᴜ ┗━━━━━━━━━━━━━━━━━ ''' from linepy import * from liff.ttypes import LiffChatContext, LiffContext, LiffSquareChatContext, LiffNoneContext, LiffViewRequest from thrift import transport, protocol, server from akad.ttypes import * from akad.ttypes import Messa...
monitor_sender.py
from threading import Thread import socket import pickle UDP_IP = "192.168.1.23" UDP_PORT = 5005 class Monitor(): def __init__(self, sensors): self.sensors = sensors self.action = None self.autonomous_mode = None self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ...
dns_oa.py
# # 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...
lisp.py
# ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # 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...
tests.py
from datetime import timedelta from doctest import DocTestSuite import pickle from threading import Thread import unittest from freezegun import freeze_time from django.contrib.auth import get_user_model from django.contrib.auth.models import AnonymousUser from django.db import IntegrityError, connection from django....
dataset.py
# ======================================================================== # Copyright 2020 Emory University # # 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/lice...
test_http.py
import pytest from http.server import BaseHTTPRequestHandler, HTTPServer import threading import pickle import fsspec requests = pytest.importorskip("requests") port = 9898 data = b"\n".join([b"some test data"] * 1000) realfile = "http://localhost:%i/index/realfile" % port index = b'<a href="%s">Link</a>' % realfile.e...
exporter.py
import argparse import json import http.server import logging import sys import threading import datetime import time import prometheus_client import rtl_433_exporter def log(): return logging.getLogger(__name__) def main(): parser = argparse.ArgumentParser("rtl_433 prometheus exporter") parser.add_a...
halo_notebook.py
from __future__ import absolute_import, print_function, unicode_literals import sys import threading import cursor from halo import Halo from halo._utils import (colored_frame, decode_utf_8_text) class HaloNotebook(Halo): def __init__(self, text='', color='cyan', text_color=None, spinner=None, placement='left'...
spawn.py
""" 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...
Episode 10 - Shared state in Threads.py
# shared state in thread import time import random from threading import Thread counter = 0 """ adding time.sleep(random.random()) after each statement is called 'Fizzing', using this, we'll get an erraneous values """ def increment_counter(): global counter time.sleep(random.random()) counter += 1 ...
main_frame.py
# -*- coding: utf-8 -*- # @Author: FrozenString # @Date: 2020-08-27 17:51:33 # @Last Modified by: FrozenString # @Last Modified time: 2020-09-07 12:28:50 import os from threading import Thread import json import shutil import wx from design_frame import MyFrameMain from perdownload import PerDownlo...
fusetree.py
import fusell from fusell import fuse_file_info from fuse import FuseOSError from typing import Dict, Iterable, Tuple, Optional, Any import logging import errno import time import asyncio import os import ctypes import threading import time from .util import LoggingFuseOperations from .types import * from .core impor...
coap2.py
#!/usr/bin/python3 import os, socket, struct, asyncio, time, json import parameters, utils from Subscription import Subscription from Message import Message from pprint import pprint from multiprocessing import Process, Pipe class Coap2(): def __init__(self, domainame=None, port=None): #self.domainame ...
pool2.py
""" --------------------------------------------------------------------------- pool2.py 09/2018 Kirk Evans, GIS Analyst\Programmer, TetraTech EC @ USDA Forest Service R5/Remote Sensing Lab 3237 Peacekeeper Way, Suite 201 McClellan, CA 95652 kdevans@fs.fed.us script to: DoPool and supportin...
test_c10d_nccl.py
# Owner(s): ["oncall: distributed"] import copy import math import os import random import signal import sys import tempfile import threading import time from contextlib import contextmanager from datetime import timedelta from itertools import product from unittest import mock import torch import torch.distributed a...
SysResMon.py
import os import subprocess import sys import threading import time sys.path.insert(0, "../../../util/python") import Cons import Util import Conf # Note: Redirecting output to memory file system may have a lower overhead. Not # a big deal though. class Mon: mon_interval = 0.1 def __init__(self, test_name): s...
bot.py
import asyncio import logging import threading from os import getenv from aiogram import Bot, Dispatcher, types from aiogram.utils import executor from aiogram.dispatcher import FSMContext from aiogram.contrib.fsm_storage.memory import MemoryStorage from aiogram.dispatcher.filters.state import State, StatesGroup from ...
flask_embed.py
from flask import Flask, render_template from bokeh.embed import server_document from bokeh.layouts import column from bokeh.models import ColumnDataSource, Slider from bokeh.plotting import figure from bokeh.server.server import Server from bokeh.themes import Theme from bokeh.sampledata.sea_surface_temperature impo...
__init__.py
import os import threading import queue VERSION = '0.0.0' def _forward_stream_to_queue(stream, queue_): for line in iter(stream.readline, b''): queue_.put(line) def _forward_queue_to_stream(queue_, stream): for line in iter(queue_.get, b''): stream.write(line) def _forward_p2q(read_fd, qu...
dispynode.py
#!/usr/bin/python """ dispynode: Execute computations on behalf of dispy clients; see accompanying 'dispy' for more details. """ import os import sys import time import stat import socket import multiprocessing import threading import subprocess import traceback import marshal import tempfile import shutil import glo...
Load_followers.py
import requests import threading import math import json class Api_services: def githubApi(self,username): info=f"https://api.github.com/users/{username}" return info def githuburlApi(self,username,page,per_page): url = f"https://api.github.com/users/{username}/followers?page={pag...
DPPO.2.py
#!/usr/bin/env python3 """ A simple version of OpenAI's Proximal Policy Optimization (PPO). [http://adsabs.harvard.edu/abs/2017arXiv170706347S] Distributing workers in parallel to collect data, then stop worker's roll-out and train PPO on collected data. Restart workers once PPO is updated. The global PPO updating r...
runner.py
#!/usr/bin/env python2 # This Python file uses the following encoding: utf-8 ''' Simple test runner These tests can be run in parallel using nose, for example nosetests --processes=4 -v -s tests/runner.py will use 4 processes. To install nose do something like |pip install nose| or |sudo apt-get install python-no...
atrace_agent.py
# Copyright 2015 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. import optparse import platform import re import sys import threading import zlib import py_utils from devil.android import device_utils from devil.android...
test_io.py
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnewlines - ...
launcher.py
import logging import os import signal import subprocess import threading import shlex from esrally import config, time, exceptions, client from esrally.mechanic import telemetry, cluster from esrally.utils import console, process, jvm logger = logging.getLogger("rally.launcher") def wait_for_rest_layer(es, max_att...
threading_demo_01.py
import threading from threading import Thread import time ''' Python 3.X threading 模块演示 Demo threading 的 Thread 类基本使用方式(继承重写 run 方法及直接传递方法) ''' class NormalThread(Thread): ''' 重写类比 Java 的 Runnable 中 run 方法方式 ''' def __init__(self, name=None): Thread.__init__(self, name=name) self.count...
sound_stream_manager.py
#!/usr/bin/python3 # -*- coding:utf-8 -*- # Project: http://cloudedbats.org # Copyright (c) 2017-2018 Arnold Andreasson # License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit). import time import queue import threading class SoundStreamManager(object): """ Manager class for sound processin...
test_socketutils.py
# -*- coding: utf-8 -*- import sys import time import errno import socket import threading from boltons.socketutils import (BufferedSocket, NetstringSocket, ConnectionClosed, NetstringMessageTooLong, ...
rabbitmq.py
#!/usr/bin/env python3 #author markpurcell@ie.ibm.com """RabbitMQ helper class. /* * 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 th...
producerconsumer.py
import Queue import random import threading import time q = Queue.Queue() # Console colors RED = '\x1b[31m' RESET = '\x1b[0m' def producer(num_simulations=10): for simulation in range(num_simulations): simulation += 1 print '%sPRODUCER%s: Starting simulation #%d' \ % (RED, RESET, si...
server_fixtures.py
import socket from multiprocessing import Process from time import sleep import pytest import uvicorn from .app import app from .app_two import app_two from .utils import ClientSession, get_sleep_time @pytest.fixture(scope="module") def server_host(): return "127.0.0.1" @pytest.fixture(scope="module") def ser...
ib_gateway.py
""" IB Symbol Rules SPY-USD-STK SMART EUR-USD-CASH IDEALPRO XAUUSD-USD-CMDTY SMART ES-202002-USD-FUT GLOBEX SI-202006-1000-USD-FUT NYMEX ES-2020006-C-2430-50-USD-FOP GLOBEX """ from copy import copy from datetime import datetime from queue import Empty from threading import Thread, Condition from typing impor...
compare_num_layer_haar_multiprocessing_adam.py
import qiskit import numpy as np import sys import multiprocessing sys.path.insert(1, '../') import qtm.base, qtm.constant, qtm.nqubit, qtm.fubini_study, qtm.encoding def run_haar(num_layers, num_qubits): psi = 2*np.random.rand(2**num_qubits)-1 # Haar thetas = np.ones(num_qubits*num_layers*5) psi =...
linkcheck.py
""" sphinx.builders.linkcheck ~~~~~~~~~~~~~~~~~~~~~~~~~ The CheckExternalLinksBuilder class. :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import json import queue import re import socket import threading from html.parser import HTMLP...
template.py
#!/usr/bin/python # # Copyright 2019 Fortinet 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 applicab...
test_generator_mt19937.py
import sys import hashlib import pytest import numpy as np from numpy.linalg import LinAlgError from numpy.testing import ( assert_, assert_raises, assert_equal, assert_allclose, assert_warns, assert_no_warnings, assert_array_equal, assert_array_almost_equal, suppress_warnings) from numpy.random import G...
msgqueue.py
from lib.models import Session, MessageQueue import core.settings as settings import threading import socket import time import os import traceback import logging log = logging.getLogger(__name__) def _multiThreadWorker(worker, queue): while not queue.empty(): args = queue.get() try: worker(*args) except Exc...
proc_normal.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from multiprocessing import Process, active_children, current_process import os import time def run(delay, **kwargs): cp = current_process() print(f'Process {cp.name} started, Priority: {kwargs["priority"]}') time.sleep(delay) print(f'{cp.name} PID: {cp.p...
_interface.py
import discord from threading import Thread import time import asyncio import sys client = discord.Client() class Pipe: def __init__(self): self._in = [] self._out = [] def put(self, value): self._in.append(value) def get(self): out = self._out[:] se...
tensorflow_serving_client_workload.py
"""Tensorflow Serving client workload. Performs image classification requests against a Tensorflow Model Server. Inspired by https://github.com/tensorflow/serving/blob/master/tensorflow_serving/example/resnet_client_grpc.py This client-side load generator does the following: * launches a specified number of worker ...
bot.py
# coding=utf-8 # Copyright 2008, Sean B. Palmer, inamidst.com # Copyright © 2012, Elad Alfassa <elad@fedoraproject.org> # Copyright 2012-2015, Elsie Powell, http://embolalia.com # Copyright 2019, Florian Strzelecki <florian.strzelecki@gmail.com> # # Licensed under the Eiffel Forum License 2. from __future__ import abs...
tests.py
# # 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...
record.py
# vim: set et sw=4 sts=4 fileencoding=utf-8: # # Raspberry Pi Sense HAT Emulator library for the Raspberry Pi # Copyright (c) 2016 Raspberry Pi Foundation <info@raspberrypi.org> # # This package is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published b...
coach.py
# # Copyright (c) 2017 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/LICENSE-2.0 # # Unless required by applicable law or agreed to...
alice.py
from ast import Try import subprocess import threading import time import requests import json import sys import logging from flask import Flask, request def print_menu(): ## Your menu design here print(30 * "-" , "MENU ALICE" , 30 * "-") print("1. Create sidetree-cardano did:ada") print("2. Resolve ...
test_util.py
# 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...
GitCrawler_U.py
#!/usr/bin/jython # -*- coding: utf-8 -*- from subprocess import call # , Popen import requests from os import makedirs, removedirs, walk, remove, listdir, stat, rename from os.path import isdir, join, getmtime, abspath from pymysql import connect from time import strftime, gmtime def many(cur): while True: ...
base_worker.py
import base64 import json import random import time from threading import Thread from bitcoin import base58 from ..lib import utils from ..services.broadcast_known_workers import BroadcastKnownWorkersService from ..services.whoami import WhoamiService class GridWorker(): def __init__(self, node_type, email=None...
VideoGet.py
from threading import Thread import cv2 class VideoGet: """ Class that continuously gets frames from a VideoCapture object with a dedicated thread. """ def __init__(self, src=0): self.stream = cv2.VideoCapture(src) (self.grabbed, self.frame) = self.stream.read() self.stoppe...
base.py
from .. import command, bar, configurable, drawer import gobject import logging import threading LEFT = object() CENTER = object() class _Widget(command.CommandObject, configurable.Configurable): """ If width is set to the special value bar.STRETCH, the bar itself will set the width to the maxim...
batcher.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # Modifications Copyright 2017 Abigail See # # 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...
test_cli_script.py
# Copyright 2015 Oliver Cope # # 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 writing, ...
GUI.pyw
#!/usr/bin/python3 import dearpygui.dearpygui as ui import serial.tools.list_ports import json import threading import time from enum import Enum from img102_UART import * baudrate_list = ('500000', '1000000', '2000000', '4000000') dithering_list = ('None', 'Floyd-Steinberg', 'Atkinson', 'Burkes', 'Sierra', 'Two-Row S...
utils.py
# # Copyright (c) 2017 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/LICENSE-2.0 # # Unless required by applicable law or agreed to...
agent.py
from _winreg import * from win32file import CopyFile import requests import os import dropbox import time import threading import cmd import platform import psutil import json import base64 import ctypes import subprocess import uuid import sys apiKey = "CHANGE API KEY" # Create a dropbox object dbx = dropbox.Dropb...
conn.py
""" Copyright 2021-2021 The jdh99 Authors. All rights reserved. 连接父路由 Authors: jdh99 <jdh821@163.com> """ import tziot.config as config import tziot.param as param import tziot.fpipe as fpipe import tziot.standardlayer as standardlayer import knocky as knock import utzpy as utz import lagan import threading import ti...
test.py
# vim: sw=4:ts=4:et __all__ = [ 'EV_TEST_DATE', 'EV_ROOT_ANALYSIS_TOOL', 'EV_ROOT_ANALYSIS_TOOL_INSTANCE', 'EV_ROOT_ANALYSIS_ALERT_TYPE', 'EV_ROOT_ANALYSIS_DESCRIPTION', 'EV_ROOT_ANALYSIS_EVENT_TIME', 'EV_ROOT_ANALYSIS_NAME', 'EV_ROOT_ANALYSIS_UUID', 'create_root_analysis', 'ACE...
__main__.py
"""isort:skip_file""" # first, logging level lower and force audio framework import os os.environ["KCFG_KIVY_LOG_LEVEL"] = os.environ.get("KCFG_KIVY_LOG_LEVEL", "warning") if "KIVY_AUDIO" not in os.environ: os.environ["KIVY_AUDIO"] = "sdl2" # some backends hard crash / this seems to be most stable import kivy k...
detect.py
import logging import os import traceback import cv2 import time import argparse from numpy.lib.type_check import _imag_dispatcher import torch import warnings import numpy as np import base64 import requests from threading import Timer, Thread import yaml import math from redis import StrictRedis from qiniu import Aut...
face_entry.py
import cv2 import dlib import os import sys from scipy import misc import time from multiprocessing import Process, Queue from random import random import time import glob import facenet.src.align.detect_face as detect_face import numpy as np #tasks_queue = JoinableQueue() results_queue = Queue() convert_queue = Queu...
halo_notebook.py
from __future__ import absolute_import, print_function, unicode_literals import sys import threading import pdm._vendor.halo.cursor as cursor from pdm._vendor.halo import Halo from pdm._vendor.halo._utils import colored_frame, decode_utf_8_text class HaloNotebook(Halo): def __init__( self, text...
map_dataset_op_test.py
# Copyright 2017 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...
main.py
import cv2 import mediapipe as mp import winsound import server import threading def play_sound(): audio_file = "max.wav" winsound.PlaySound(audio_file, winsound.SND_FILENAME) cap = cv2.VideoCapture("walk.mp4") mpDraw = mp.solutions.drawing_utils mpPose = mp.solutions.pose pose = mpPose.Pose(Fa...
__init__.py
# -*- coding: utf-8 -*- """ :copyright: Copyright 2016-2021 Sphinx Confluence Builder Contributors (AUTHORS) :license: BSD-2-Clause (LICENSE) """ from bs4 import BeautifulSoup from contextlib import contextmanager from copy import deepcopy from pkg_resources import parse_version from sphinx.__init__ import __version__...
psoc.py
import struct import time import logging import threading import serial import sys import os from serial.tools.list_ports import comports as list_ports class DeviceRemoved(Exception): pass class NotProvisioned(Exception): pass class AlreadyProvisioned(Exception): pass class Psoc(object): """Gene...
client.py
import socket import socketserver import struct from src.client.name_generator import generate_username from src.packet import Packet, read_packet from src.packet_type import PacketType from src.client.search_result import SearchResult from pathlib import Path from typing import Optional import threading from functool...
Binance Detect Moonings.py
""" Disclaimer All investment strategies and investments involve risk of loss. Nothing contained in this program, scripts, code or repositoy should be construed as investment advice.Any reference to an investment's past or potential performance is not, and should not be construed as, a recommendation or as a guarantee...
agaricus_lr_avg_grad.py
import argparse import os import sys import torch import torch.distributed as dist import torch.optim as optim from math import ceil from torch.multiprocessing import Process sys.path.append("../") from archived.ec2.trainer import Trainer from archived.ec2 import partition_agaricus from archived.pyto...