source
stringlengths
3
86
python
stringlengths
75
1.04M
webui.py
#!/usr/bin/env python """ A Web UI for RED, the Resource Expert Droid. """ import locale import os import sys from urllib.parse import urlsplit from redbot import __version__ from redbot.resource.robot_fetch import RobotFetcher from redbot.formatter import html from redbot.webui import RedWebUi, except_handler_fact...
upload.py
# Copyright European Organization for Nuclear Research (CERN) # # 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 # # Authors: # - Muhammad Aditya Hilmy...
Hiwin_RT605_Socket_v3_20190628112809.py
#!/usr/bin/env python3 # license removed for brevity import rospy import os import socket ##多執行序 import threading import time import sys import matplotlib as plot import HiwinRA605_socket_TCPcmd_v3 as TCP import HiwinRA605_socket_Taskcmd_v3 as Taskcmd import numpy as np from std_msgs.msg import String from ROS_Socket.s...
start_pyro4bot_BB.py
import os import random import sched import signal import subprocess import sys import threading from threading import * import time import Pyro4 import Pyro4.naming as nm from termcolor import colored import pprint import simplejson as json import ast sys.path.append("../node/libs") import utils import myjson DEBUGGE...
web.py
from aiohttp import web, streamer import aiohttp import socketserver import socket import asyncio import websockets import threading import logging from .keys import Keys _LOGGER = logging.getLogger(__name__) class WebServer(): def __init__(self, panel): self._panel = panel self._msg_queue = asy...
create_nfg_spike.py
import json import multiprocessing import queue import sqlite3 import threading import time import warnings from pathlib import Path import click import dask import dask.dataframe as dd import pandas as pd import tqdm from dask.distributed import Client from numba import jit from sqlalchemy import create_engine from J...
accumulators.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...
wallet_multiwallet.py
#!/usr/bin/env python3 # Copyright (c) 2017-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test multiwallet. Verify that a bitcoind node can load multiple wallet files """ from threading import...
mqtt.py
# Copyright 2021 Nokia # Licensed under the BSD 3-Clause Clear License. # SPDX-License-Identifier: BSD-3-Clear import paho.mqtt.client as mqtt import a10.structures.identity import a10.asvr.db.configuration import threading import time def on_disconnect(client, userdata, rc): logging.info("disconnecting reason ...
test_threading.py
import os import threading import uuid import pytest from ddtrace.internal import nogevent from ddtrace.profiling import recorder from ddtrace.profiling.collector import threading as collector_threading from . import test_collector TESTING_GEVENT = os.getenv("DD_PROFILE_TEST_GEVENT", False) def test_repr(): ...
ModuleTracker.py
#!/usr/bin/env python import tkinter as tk from tkinter import * from tkinter import filedialog from tkinter import messagebox import threading from threading import Thread from time import sleep import configparser from RMTRMS import * import os import webbrowser import sys import socket from sys import exit sys.path...
index.py
import os import sys import requests import threading import validators import tkinter as tk from time import sleep from tkinter import ttk from bs4 import BeautifulSoup # initialize dir if(not os.path.exists("./imgout")): os.makedirs("./imgout") # tkinter window gui = tk.Tk() gui.titl...
download_data_demo1.py
import sys from time import sleep from datetime import datetime, time from logging import INFO from howtrader.event import EventEngine from howtrader.trader.setting import SETTINGS from howtrader.trader.engine import MainEngine from howtrader.gateway.binances import BinancesGateway from howtrader.gateway.binance impo...
server.py
from six.moves import BaseHTTPServer import errno import os import socket from six.moves.socketserver import ThreadingMixIn import ssl import sys import threading import time import traceback from six import binary_type, text_type import uuid from collections import OrderedDict from six.moves.queue import Queue from ...
main.py
import tflite_runtime.interpreter as tflite import logging, pcap, inspect from common.data import * from flask import Flask, request, jsonify from threading import Thread from collections import deque from socket import socket, AF_PACKET, SOCK_RAW, SOL_IP app = Flask(__name__) log = logging.getLogger('werkzeug') log....
networkedbot.py
#!/usr/bin/env python3 from ircbot import IRCBot from threading import Thread from concurrent import futures from time import sleep import uuid import re """ IRC Bot able to sync with other peers and to know them. Then it can be extended to support stuff like coordinated searches and so on """ class Botsync: start...
read-id.py
# -*- coding: utf-8 -*- import nfc import threading import time import sys frag = 'False' def read(tag): tag = str(tag) #変数tsgを文字列型に変換 id_check = ('ID=' in tag) #対応カードかどうか確認 if id_check == True: #対応カードなら実行 idm = tag.find('ID=') #idのインデックスを検...
test_mainwindow.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright © Spyder Project Contributors # # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) # ----------------------------------------------------------------------------- """ Te...
programs.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """Running programs utilities.""" from __future__ import print_function # Standard library imports from ast import literal_eval from distutils.version i...
raspibrew.py
# # Copyright (c) 2012-2015 Stephen P. Smith # # 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...
post_rec_particles.py
""" Script for post-processing already reconstructed particles Input: - STAR file with next columns: '_rlnMicrographName': tomogram that will be used for reconstruction '_rlnImageName': tomograms used for picking '_rlnCtfImage': (optional) CTF model subvolume ...
Viav021.py
import numpy as np import pandas as pd from scipy.sparse import csr_matrix, csgraph import scipy import igraph as ig import leidenalg import time import hnswlib import matplotlib.pyplot as plt import matplotlib import math import multiprocessing from scipy.sparse.csgraph import minimum_spanning_tree from scipy import s...
framereader.py
import os import glob import json import time import struct import tempfile import threading import xml.etree.ElementTree as ET import numpy as np import Queue as queue import subprocess32 as subprocess import cPickle as pickle from cStringIO import StringIO from aenum import Enum from lru import LRU from functools imp...
sixteens_full.py
#!/usr/bin/env python3 from olctools.accessoryFunctions.accessoryFunctions import MetadataObject, GenObject, make_path, write_to_logfile, \ run_subprocess from genemethods.sipprCommon.objectprep import Objectprep from genemethods.sipprCommon.sippingmethods import Sippr from Bio.Blast.Applications import NcbiblastnC...
actor_worker.py
import random import signal import time from collections import OrderedDict from queue import Empty, Full import numpy as np import psutil import torch from gym.spaces import Discrete, Tuple from torch.multiprocessing import Process as TorchProcess from sample_factory.algorithms.appo.appo_utils import TaskType, make_...
multithreading_in_python-2.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ multithreading_in_python-2.py Consider the python program given below in which we print thread name and corresponding process for each task: Multithreading in Python | Set 1 https://www.geeksforgeeks.org/multithreading-python-set-1/ """ # Python program to illust...
test_other.py
# coding=utf-8 import multiprocessing, os, pipes, re, shutil, subprocess, sys import glob import tools.shared from tools.shared import * from runner import RunnerCore, path_from_root, get_zlib_library, get_bullet_library import tools.line_endings # Runs an emcc task (used from another process in test test_emcc_multip...
main.py
import sys import signal import threading import json from datetime import datetime, timedelta import tornado.ioloop import tornado.web import tornado.locale import tornado.httpserver from settings import site_settings from api.api import alert_messages, unique_alert_messages, websocket_connections from log_puller.pu...
insanity.py
# Insanity for JiB410_ """ Critical POC: * Log in * Start timer * Prepare DEATH CAM 1 scene - Set five separate render delays each to 5ms - Wait for responses from OBS * Check timer. Is it <50ms? send_request("SetSourceFilterSettings", {sourceName: "DEATH CAM", filterName: "Render Delay", filterSettings: {delay_ms:...
SublimeLinter.py
from functools import partial import os import re import sys import time import threading import sublime import sublime_plugin from sublimelinter.loader import Loader from sublimelinter.modules.base_linter import INPUT_METHOD_FILE LINTERS = {} # mapping of language name to linter module QUEUE = {} # views ...
cache.py
import atexit import enum import glob import logging import os import pickle import re import sqlite3 import threading import time from abc import abstractmethod, ABC from typing import Any, Callable, Iterator, List, Optional, TypeVar from .hash import pickleHash from .pickle import loadPickle, dumpPickle log = loggi...
_executor.py
__all__ = "ExecutorMixin" import asyncio import concurrent.futures import threading import typing class ExecutorMixin: def __init__(self): self._default_executor = None self._executor_shutdown_called = False def close(self) -> None: self._executor_shutdown_called = True execu...
distributor.py
""" Classes for multiprocess job running. """ import os import logging from queue import Empty import multiprocess as mp from tqdm import tqdm import psutil class Distributor: """ Distributor of jobs between workers. """ def __init__(self, workers, gpu, worker_class=None, timeout=5, trials=3): """ ...
proc.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
conn.py
#!/usr/bin/env python3.7 """ Thin wrapper around ssh. This script *should* allow ease of access to remote provisioned servers, either as full dotted names or shorter aliases. Ultimately, the names are defined within *infrastructure_provisioning.out.yml* and specifically within the *infrastructure_provisioning.out* di...
listener.py
# noinspection PyUnresolvedReferences import future import socket from http.server import BaseHTTPRequestHandler, HTTPServer from threading import Thread from .logsList import logs_list from .persistentFlags import persistent_flags class ListenerHandler(BaseHTTPRequestHandler): def do_POST(self): try: ...
test_executor.py
# Copyright 2011 OpenStack Foundation. # All Rights Reserved. # Copyright 2013 eNovance # # 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/LIC...
ConductorWorker.py
# # Copyright 2017 Netflix, 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...
test_recipes.py
"Test diskcache.recipes." import diskcache as dc import mock import pytest import shutil import threading import time @pytest.fixture def cache(): with dc.Cache() as cache: yield cache shutil.rmtree(cache.directory, ignore_errors=True) def test_averager(cache): nums = dc.Averager(cache, 'nums')...
trezor.py
import traceback import sys from typing import NamedTuple, Any from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path from electrum import const...
fetcher.py
""" Fetches stuff from the Alexa List based on Selenium Micah Sherr <msherr@cs.georgetown.edu> """ import traceback import smtplib from email.message import EmailMessage from datetime import datetime import re from pyvirtualdisplay import Display from timeit import default_timer as timer import multiprocessing_loggin...
yolo_detector.py
import numpy as np import cv2 as cv import util import threading import time from os.path import abspath import detect_it_all_bot import logging class YOLODetector(): def __init__(self, configuration, weights, classes, cap: util.BufferlessVideoCa...
flow.py
# coding=utf-8 import datetime import functools import json import logging import sys import threading from copy import copy from types import MethodType from django.conf import settings as project_settings from django.contrib.auth import get_user_model from django.core.exceptions import ( ImproperlyConfigured, ...
future_object_test.py
# Copyright (c) 2018 PaddlePaddle 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 app...
orchestrator.py
from flask import Flask, request import requests from time import sleep import os import json from threading import Thread, Lock BASE_URL = '/api/v1/' MIGRATIONS_FOLDER = os.path.abspath('db_migrations') open_ports = [] curr_port_index = 0 requests_count = 0 port_lock = Lock() requests_count_lock = Lock() app = Flask...
server.py
import socket import json import threading import sys import argparse import os from datetime import datetime from message import Message from streaming import createMsg, streamData from Crypto.Cipher import PKCS1_OAEP # RSA based cipher using Optimal Asymmetric Encryption Padding from Crypto.PublicKey import RSA # t...
iap_tunnel_websocket.py
# -*- coding: utf-8 -*- # # Copyright 2018 Google LLC. 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 requir...
test_shared_mem.py
import networkx as nx import scipy.sparse as ssp import dgl import dgl.contrib as contrib from dgl.graph_index import create_graph_index from dgl.utils import toindex import backend as F import dgl.function as fn import pickle import io import unittest from test_utils import parametrize_idtype import multiprocessing as...
tester.py
#!/usr/bin/python # # tester.py # # This source file is part of the FoundationDB open source project # # Copyright 2013-2018 Apple Inc. and the FoundationDB project 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 ob...
TestLooperClient.py
import json import socket import time import uuid import logging import traceback import ssl import threading import test_looper.core.socket_util as socket_util import test_looper.server.TestLooperServer as TestLooperServer import test_looper.core.algebraic_to_json as algebraic_to_json import base64 import Queue class...
resolve.py
#!/usr/bin/python3.5 # I don't believe in license. # You can do whatever you want with this program. import os import sys import socket import argparse from colored import fg, bg, attr from threading import Thread from queue import Queue from multiprocessing.dummy import Pool def banner(): print(""" ...
RepeatedTimer.py
import time from threading import Event, Thread class RepeatedTimer: """Repeat `function` every `interval` seconds.""" def __init__(self, interval, function, *args, **kwargs): self.interval = interval self.function = function self.args = args self.kwargs = kwargs self....
good2.py
# Voids hacka scanna # nano /usr/include/bits/typesizes.h -> change 1024 to 99999 # ulimit -n 99999 # python scan.py 1000 <start-range> <end-range> import threading, paramiko, random, socket, time, sys server_ip = "198.167.136.178" blacklisted = ["127.0","10.0","192.168"] passwords = ["admin:1234"] ...
test_logging.py
import multiprocessing as mp import ymmsl from libmuscle.logging import LogLevel, LogMessage, Timestamp from libmuscle.manager.manager import Manager from libmuscle.mmp_client import MMPClient def do_logging_test(caplog): ymmsl_text = ( 'ymmsl_version: v0.1\n' 'model:\n' ' n...
update_from_github.py
import os import sys import urllib2 import time import subprocess import threading import re import zipfile import shutil import ssl current_path = os.path.dirname(os.path.abspath(__file__)) root_path = os.path.abspath( os.path.join(current_path, os.pardir)) python_path = os.path.join(root_path, 'python27', '1.0') no...
receive_direct_method.py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import os...
test_base.py
from threading import Thread import gc from hallo.function_dispatcher import FunctionDispatcher from hallo.hallo import Hallo import unittest from hallo.test.server_mock import ServerMock import time class TestBase(unittest.TestCase): def setUp(self): # Create a Hallo self.hallo = Hallo() ...
client.py
# -*- coding=utf-8 -*- import base64 import hashlib import logging import socket import json import platform import time try: import ssl except ImportError: ssl = None from multiprocessing import Process, Manager, Queue, pool from threading import RLock, Thread try: # python3.6 from http import HTTPS...
Tracker.py
import re from Proxy import Proxy from threading import Thread class Tracker: def __init__(self, upload_rate=10000, download_rate=10000, port=10086): self.proxy = Proxy(upload_rate, download_rate, port) print("Tracker bind to", self.proxy.port) self.files = {} # {"fid":[('("127.0...
installwizard.py
import os import sys import threading import traceback from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from electrum_dash.wallet import Wallet from electrum_dash.storage import WalletStorage from electrum_dash.util import UserCancelled, InvalidPassword from electrum_dash.base_wizar...
egen_testing.py
#%% # generate 1 new model ''' uses the loop2geomodeller function from m2l_export.py def loop2geomodeller(test_data_path,tmp_path,output_path,dtm_file,bbox,save_faults,compute_etc,workflow) test_data_path = path to the data import to the model [orientations; contacts; all_sorts (?) - dunno what this is ...
main.py
from trade_client import * from store_order import * from load_config import * from new_listings_scraper import * from collections import defaultdict from datetime import datetime, time import time import threading import json import os.path # loads local configuration config = load_config('config.yml') # load nec...
lisp-etr.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 ...
utils.py
# -*- coding: utf-8 -*- """ flask_testing.utils ~~~~~~~~~~~~~~~~~~~ Flask unittest integration. :copyright: (c) 2010 by Dan Jacob. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, with_statement import gc import time try: import unittest2 as unittest e...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest import unittest.mock from test import support from test.support import socket_helper import socket import select import time import datetime import gc import os import errno import pprint import urllib.request import threading import traceback import as...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING from electrum.util import bfh, bh2u, UserCancelled, UserFacingException from electrum.bip32 import BIP32Node from electrum import constants from electrum.i18n import...
mixins.py
""" Tk2 Wraps around all the major widgets """ # Imports import sys if sys.version.startswith("2"): import Tkinter as tk import Tkdnd as dnd import Queue else: import tkinter as tk import tkinter.dnd as dnd import queue as Queue import ttk import threading import traceback from . import fil...
main.py
import logging from logging.handlers import RotatingFileHandler from multiprocessing import Process import meter import offlinemeter import virtualmeter def main(): """main""" # create logger logger = logging.getLogger('myems-normalization') # specifies the lowest-severity log message a logger will ha...
mic.py
# Copyright 2017 Mycroft AI 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 writin...
test_connection_asr9k.py
# ============================================================================= # # Copyright (c) 2016, Cisco Systems # All rights reserved. # # # Author: Klaudiusz Staniek # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met...
pytest_native_ota.py
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Unlicense OR CC0-1.0 import http.server import multiprocessing import os import random import socket import ssl import struct import subprocess from typing import Callable, Tuple import pexpect import pytest from pytest_embed...
wifiConnection.py
""" Holds all the data and commands needed to fly a Bebop drone. Author: Amy McGovern, dramymcgovern@gmail.com """ from zeroconf import ServiceBrowser, Zeroconf from datetime import datetime import time import socket import ipaddress import json from pyparrot.utils.colorPrint import color_print import struct import t...
vehicle.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jun 25 10:44:24 2017 @author: wroscoe """ import time import numpy as np import logging from threading import Thread from .memory import Memory from prettytable import PrettyTable import traceback logger = logging.getLogger(__name__) class PartProfi...
variable_scope_test.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...
common.py
# Copyright 2021 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from enum import Enum from functools import wraps from pathlib import...
audio.py
# Copyright 2004-2018 Tom Rothamel <pytom@bishoujo.us> # # 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, m...
__init__.py
""" Enable ptvsd debugger to attach to HA. Attach ptvsd debugger by default to port 5678. """ import logging from threading import Thread from asyncio import Event import voluptuous as vol from homeassistant.const import ( CONF_HOST, CONF_PORT) import homeassistant.helpers.config_validation as cv from homeassis...
threadlock.py
# coding:utf-8 """ 没写完 Lock 是一个简单的变量, 需要传 此外 还有 RLock , 这是一个有个数的Lock, 可以使用多次 """ from __future__ import print_function import threading def job1(): global A, lock lock.acquire() for i in range(10): A += 1 print("job1" , A) lock.release() def job2(): global A, lock lock.acquir...
kademlia.py
from .contact import Contact from .bucketlist import BucketList from .storage import StorageManager # TODO: implement the SorageManager from threading import Thread, Lock from engine.utils.logger import setup_logger, debug, error, info from rpyc import Service,discover,connect from rpyc.utils.factory import DiscoveryE...
parameterviewer.py
""" Contains code for viewing Parameters in a gui window """ import time import threading import logging import numpy as np import sys from typing import Sequence, Any, Optional import multiprocessing as mp from functools import partial from qtpy import QtWidgets from qtpy.QtCore import Signal, Slot, QSize import pyqt...
subprocess.py
""" Some light wrappers around Python's multiprocessing, to deal with cleanly starting child processes. """ import multiprocessing import os import platform import sys import time spawn = multiprocessing.get_context("spawn") def get_subprocess(config, target, sockets): """ Called in the parent process, to in...
utility_nodes.py
# Copyright 2022 Andreas Steck (steck.andi@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 a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
run.py
import json import logging import random import sys import deterministic_network import member_replicated import client from statemachine import sequence_generator import BaseHTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler class TimeLogger(logging.Logger): def makeRecord(self, name, lvl, fn, lno,...
yupost_transaction_receipt_origin_contract_address.py
#!/usr/bin/env python3 from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_framework.script import * from test_framework.mininode import * from test_framework.address import * import threading def waitforlogs(node, contract_address): logs = node.cli.waitforlo...
mturk_manager.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging import math import os import pickle import threading import time import uuid import errno import requests...
utils.py
#!/usr/bin/env python # Lint as: python3 """This file contains various utility classes used by GRR.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import errno import functools import getpass import io import os im...
plugin.py
import base64 import re import threading from binascii import hexlify, unhexlify from functools import partial from electrum_seci.bitcoin import (bc_address_to_hash_160, xpub_from_pubkey, public_key_to_p2pkh, EncodeBase58Check, TYPE_ADDRESS, TYPE_SCRIPT, ...
01_basic_thread.py
import time import logging import threading def thread_func(name): logging.info(f"Thread {name} starting...") time.sleep(2) logging.info(f"Thread {name} finishing...") if __name__ == "__main__": format = "%(asctime)s: %(message)s" logging.basicConfig(format=format, level=...
application.py
import tkinter import matplotlib.pyplot as plt import cvlib as cv from cvlib.object_detection import draw_bbox from motorisedcameratracking import * import sys import time import multiprocessing import queue import threading import cv2 from PIL import Image, ImageTk def startTrackingA(): target=targetEntry.g...
advancedclipboard.py
#! /usr/bin/python3 # DISCLAIMER # # ADVANCED CLIPBOARD IS A MULTI-PLATFORM SOFTWARE DEVELOPED BY DAVID # COSBY, A 15 YEAR OLD KID WHO HAS NO IDEA WHAT HE IS DOING. # THE FOLLOWING CODE HAS SEVERAL EXAMPLES OF BAD PRACTICE, AND HURTS # TO LOOK AT. # BY DOWNLOADING THIS APPLICATION, YOU UNDERSTAND TH...
server2.py
import socket from _thread import * import threading import sys import errno # print_lock = threading.Lock() def threaded(c, addr): while True: data = c.recv(1024) decodedData = data.decode() # print(data) if data: print("Data received: {}".format(decodedData)) ...
engine.py
import os import math import time import torch import datetime import threading import numpy as np from ..lib import utils from ..lib.options import Options from ..lib.logger import Logger class Engine(object): """Contains training and evaluation procedures """ def __init__(self): self.hooks = {} ...
instance.py
from threading import Thread from typing import Dict, Any from cement import Handler from synapser.core.data.api import RepairRequest, CoverageRequest from synapser.core.database import Instance from synapser.core.interfaces import HandlersInterface class InstanceHandler(HandlersInterface, Handler): class Meta:...
manager_test.py
# $Filename$ # $Authors$ # Last Changed: $Date$ $Committer$ $Revision-Id$ # # Copyright (c) 2003-2011, German Aerospace Center (DLR) # All rights reserved. # # #Redistribution and use in source and binary forms, with or without #modification, are permitted provided that the following conditions are #met: # ...
wsdump.py
#!C:\Users\iamkh\PycharmProjects\stocksdashboard\venv\Scripts\python.exe """ websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as publishe...
record-video copy.py
import time, cv2 from threading import Thread from djitellopy import Tello tello = Tello() tello.connect() keepRecording = True tello.streamon() tello.send_command_with_return('downvision 1') frame_read = tello.get_frame_read() # video = cv2.VideoCapture("udp://@0.0.0.0:11111?overrunnonfatal=1&fifo_size=278877") def...
cfsat.py
#!/usr/bin/env python """ LICENSE: 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 ...
__main__.py
import argparse import os import time import psutil import robot from multiprocessing import Process, Value, Lock from robot.running.builder import TestSuiteBuilder from .tasksdb import TasksDB class DistRoboRunner(object): def __init__(self, args, robotArgs): self.args = args self.robo...
master.py
import os import multiprocessing as mp import psutil # Test: both should result in 8 print(os.environ["NUMBER_OF_PROCESSORS"]) print(mp.cpu_count()) def spawn(): procs = list() n_cpus = psutil.cpu_count() for cpu in range(n_cpus): affinity = [cpu] d= {'affinity': affinity} p = mp....
PC_Miner.py
#!/usr/bin/env python3 ########################################## # Duino-Coin Python PC Miner (v2.49) # https://github.com/revoxhere/duino-coin # Distributed under MIT license # © Duino-Coin Community 2019-2021 ########################################## # Import libraries import sys from configparser import C...