source
stringlengths
3
86
python
stringlengths
75
1.04M
autosubmit.py
#!/usr/bin/env python from marmoset import Marmoset from getpass import getpass import os import glob import sys import threading import fileinput # monkey-patch SSL because verification fails on 2.7.9 if sys.hexversion == 34015728: import ssl if hasattr(ssl, '_create_unverified_context'): # noinspec...
tpu_estimator.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...
run_background_processes_no_daemons.py
import multiprocessing import time def foo(): name = multiprocessing.current_process().name print ("Starting %s \n" %name) if name == 'background_process': for i in range(0,5): print('---> %d \n' %i) time.sleep(1) else: for i in range(5,10): print('---> %...
client.py
import threading import socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) port = 9099 server = '127.0.0.1', 9099 sock.connect(server) self_name = input('Enter your nickname: ') sock.send(self_name.encode('utf-8')) def get_mes(): while True: get_message = (sock.recv(1024)).decode('utf-8') ...
test_poplib.py
"""Test script for poplib module.""" # Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL # a real test suite import poplib import asyncore import asynchat import socket import os import time import errno from unittest import TestCase, skipUnless from test import test_support from t...
test_cluster_connection_pool.py
# -*- coding: utf-8 -*- # python std lib import os import re import time from threading import Thread # rediscluster imports from rediscluster.connection import ( ClusterConnectionPool, ClusterReadOnlyConnectionPool, ClusterConnection, UnixDomainSocketConnection) from rediscluster.exceptions import RedisClust...
emails.py
from threading import Thread from flask_mail import Message from app import app from app import mail def send_async_email(application, msg): with application.app_context(): try: mail.send(msg) except ConnectionRefusedError: raise Exception("The mail server is not working")...
taskGraph.py
from collections import OrderedDict import networkx as nx import yaml from .node import Node from ._node_flow import OUTPUT_ID, OUTPUT_TYPE from .task import Task from .taskSpecSchema import TaskSpecSchema from .portsSpecSchema import NodePorts, ConfSchema import warnings import copy __all__ = ['TaskGraph', 'OutputCo...
views.py
import os import json import pika import threading import mimetypes from IPython import embed from .helper import job_accept_cb from .models import Job, Node, Result from interface.settings import ARCHIVE_DIR from django.contrib.auth.models import User from django.shortcuts import render, redirect from django.views.gen...
multiprocessing_daemon_join.py
import multiprocessing import time import sys def daemon(): print 'Starting:', multiprocessing.current_process().name time.sleep(2) print 'Exiting :', multiprocessing.current_process().name def non_daemon(): print 'Starting:', multiprocessing.current_process().name print 'Exiting :', multiprocessi...
motor_stream_test.py
import socketserver import socket import cv2 import numpy as np import math import os import sys class ObjectDetection(object): def __init__(self): self.red_light = False self.green_light = False self.yellow_light = False def detect(self, cascade_classifier, gray_image, image): ...
coroutine_broadcats_dispatch_threads_fixed.py
import time from collections import namedtuple from datetime import datetime from queue import Queue from threading import Thread import numpy as np from module4 import coroutine def run_target(queue, target, state_queue): while True: item = queue.get() if item is GeneratorExit: targ...
bank_account_test.py
import sys import threading import time import unittest from bank_account import BankAccount class BankAccountTests(unittest.TestCase): def setUp(self): self.account = BankAccount() def test_newly_opened_account_has_zero_balance(self): self.account.open() self.assertEqual(self.accou...
udp_channel.py
from queue import Queue, Empty from .channel import Channel import socket from threading import Thread class UDPChannel(Channel): """ This is a specific implementation of a channel, using the UDP protocol. It can be used like that or be seen as an example class for further channel implementations using di...
recorder_cam_imu.py
import cv2 import os import pandas as pd import numpy as np # import the opencv library import cv2 import threading import msgpack as mp import msgpack_numpy as mpn from datetime import datetime import pickle class recorder(): def __init__(self): self.a = None self.vid = cv2....
test_threading_local.py
# this is http://svn.python.org/view/python/trunk/Lib/test/test_threading_local.py?view=markup&pathrev=78336 # although we do have test_patched_local.py, it does not have all the tests that this file has from gevent import monkey; monkey.patch_all() import unittest from doctest import DocTestSuite try: from test im...
project.py
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
httpclient_test.py
#!/usr/bin/env python # pylint: skip-file from __future__ import absolute_import, division, print_function import base64 import binascii from contextlib import closing import copy import functools import sys import threading import datetime from io import BytesIO from salt.ext.tornado.escape import utf8, native_str ...
mitm.py
#!/usr/bin/env python3 import socket import argparse import threading import signal import json import requests import sys import time import traceback from queue import Queue from contextlib import contextmanager CLIENT2SERVER = 1 SERVER2CLIENT = 2 running = True def log(m): print(m, file=sys.stderr) def mit...
jetson_denoiser_server.py
# Library import torch import numpy as np import time import socket import threading from denoiser.demucs import DemucsStreamer from denoiser.utils import deserialize_model # from denoiser.VAD import denoiser_VAD from npsocket import SocketNumpyArray inport = 9999 outport = 8080 # Define Server Socket (receiver) ser...
speedcontroller.py
#!/usr/bin/python3 import multiprocessing as mp import time import RPi.GPIO as GPIO import numpy as np from software.module.servo import Servo # todo # convert rpm control to speed control # convert speed output to control pwm_pin instead class SpeedControl: def __init__(self, tacho_pin, sample_interval=0....
douyin.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...
installwizard.py
# Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import os import sys import threading import traceback from typing import Tuple, List, Callable, NamedTuple, Optional from PyQt5.QtCore i...
camera.py
import threading import cv2 import torch from video_stream.settings import BASE_DIR model = torch.hub.load(f'{BASE_DIR}/yolov5', 'custom', path=f'{BASE_DIR}/model_yolo/best.pt', source='local') # YOLOv5 model loading model.conf = 0.40 # set minimum confid...
filestream.py
""" Note: The very same implementation can be found in stream.py. Until 5 Dec 2020, this was separate, but due to several reasons (such as video lag in the threads, this is now merged into stream.py) """ # # _____ ______ _____ # # / ____/ /\ | ____ | __ \ # # | | / \ | |__ ...
_v5__sub_chatting.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # COPYRIGHT (C) 2014-2020 Mitsuo KONDOU. # This software is released under the MIT License. # https://github.com/konsan1101 # Thank you for keeping the rules. import sys import os import time import datetime import codecs import glob import queue impo...
main_diagram.py
import time from threading import Thread from state_machine_py.multiple_state_machine import MultipleStateMachine from tests.two_machines_catchball.auto_gen.data.const import INIT, MACHINE_A, MACHINE_B from tests.two_machines_catchball.machine_a.context import Context as ContextA from tests.two_machines_catchball.machi...
tasker.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- # # Part of the Reusables package. # # Copyright (c) 2014-2017 - Chris Griffith - MIT License try: import queue as queue except ImportError: import Queue as queue import multiprocessing as mp import uuid import time import logging import datetime from reusables.sha...
device.py
from library import config, ini, lang, log, performance, periphery, queue from asyncio import get_event_loop from threading import Thread, Event from PyQt5.QtCore import QObject, pyqtSignal from PyQt5.QtWidgets import QTreeWidgetItem # noinspection PyPep8Naming class Signal(QObject): """ PyQt signals for correct...
queues.py
import copy import multiprocessing import re import requests import setproctitle import time from shakenfist.config import config from shakenfist.daemons import daemon from shakenfist import db from shakenfist import exceptions from shakenfist.images import Image from shakenfist import logutil from shakenfist import n...
logic.py
import threading import time import sys from gi.repository import GObject import btcwidget.currency import btcwidget.exchanges import btcwidget.alarmmessage from btcwidget.config import config, get_market_id class UpdateThread(threading.Thread): def __init__(self, main_win): threading.Thread.__init__(sel...
server.py
# -*- coding: utf-8 -*- """ DNS server framework - intended to simplify creation of custom resolvers. Comprises the following components: DNSServer - socketserver wrapper (in most cases you should just need to pass this an appropriate resolver instance an...
run_nvmf.py
#!/usr/bin/env python3 import os import re import sys import json import zipfile import threading import subprocess import itertools import time import uuid from collections import OrderedDict import paramiko import pandas as pd import rpc import rpc.client from common import * class Server: def __init__(self,...
webcam_demo.py
# Copyright (c) OpenMMLab. All rights reserved. import argparse import time from collections import deque from queue import Queue from threading import Event, Lock, Thread import cv2 import numpy as np from mmpose.apis import (get_track_id, inference_top_down_pose_model, init_pose_model, vis_...
players.py
# ============================================================================= # Federal University of Rio Grande do Sul (UFRGS) # Connectionist Artificial Intelligence Laboratory (LIAC) # Renato de Pontes Pereira - rppereira@inf.ufrgs.br # ============================================================================= ...
deviceShadow.py
# /* # * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. 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. # * A copy of the License is located at # * # * http://aws.amazon.com/apache2.0 # * # * or i...
studio.py
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # # 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 us...
__init__.py
import json import select import socket import threading import time from platypush.backend import Backend from platypush.utils import set_thread_name from platypush.message.event.music.snapcast import ClientVolumeChangeEvent, \ GroupMuteChangeEvent, ClientConnectedEvent, ClientDisconnectedEvent, \ ClientLaten...
hdfs_utils.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...
gmpydl.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # Copyright (c) 2015 Steve Newbury import argparse import datetime import os import shelve import sys import threading import unicodedata from gmusicapi import Musicmanager program_dir = os.path.expanduser("~/.gmpydl") dl_store_file = os.path.join(program_dir, ".gmpydl_...
coqtop.py
# -*- coding: utf8 -*- # Author: Wolf Honore """Coqtop interface with functions to send commands and parse responses.""" import datetime import logging import signal import subprocess import threading import time from concurrent import futures from queue import Empty, Queue from tempfile import NamedTemporaryFile from...
worker.py
import collections.abc try: import dill as pickle except ImportError: import pickle import multiprocessing as mp import signal import traceback import _thread from datetime import datetime from functools import partial from threading import Thread from typing import Any, Callable, List, Optional, Tuple, Union, ...
test_krakenforwarder.py
import time from multiprocessing import Process from krakenforwarder.forwarder import KrakenForwarder from krakenforwarder.listener import listen from krakenforwarder.util import * def test_krakenforwarder(): cfg_forwarders = [ { F_PULL_PERIOD: 5, # in seconds F_ASSET_PAIR: 'XXBT...
serverbase.py
import logging import os import glob import signal import shutil import threading from subprocess32 import Popen,PIPE,STDOUT,TimeoutExpired from ..connection import Connection from ..setup.server import get_open_port class BaseServer(object): def __init__(self,name,zoohost,folder,logger,hostname,port=None,minspac...
ant.py
# Ant # # Copyright (c) 2012, Gustav Tiger <gustav@tiger.name> # # 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, m...
payload_test.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)` tests.unit.payload_test ~~~~~~~~~~~~~~~~~~~~~~~ ''' # Import Salt libs from __future__ import absolute_import import time import errno import threading # Import Salt Testing libs from salttesting import skipIf, TestCase...
networkBuff-rw.py
import sys, os, time, syslog import socket, select, sys import threading, zmq import subprocess from collections import deque # Global Variables psocket=None ssocket=None s=None NETWORK_THRESHOLD_MAX=2048 IsConnected=False; data=deque([]) bufferqlen=0 MAXBUFFLEN=0 def check_ip(ip_addr): oct = ip_addr.split('.',3)...
vestafinder.py
import requests from Queue import Queue import threading import argparse import re requests.packages.urllib3.disable_warnings() inputFile = "" outputFile= "" thread = "" def banner(): print "" print "" print "Haci Burtay" print "Twitter : @haciburtay" print "www.burtay.org" print "admin@burta...
test_multiprocessing.py
'''测试multiprocessing模块 made by Ian in 2017-10-8 14:34:53 from:https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/001431927781401bb47ccf187b24c3b955157bb12c5882d000 ''' ''' from multiprocessing import Process import os # 子进程要执行的代码 def run_proc(name): print('Run child pro...
test_triggers.py
# (C) Copyright 1996- ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as an intergovernment...
test_pdb.py
# A test suite for pdb; not very comprehensive at the moment. import doctest import os import pdb import sys import types import unittest import subprocess import textwrap from contextlib import ExitStack from io import StringIO from test import support # This little helper class is essential for testin...
hpc.py
import os import sys from .argparse_hopt import HyperOptArgumentParser from subprocess import call import datetime import traceback import re from shutil import copyfile import threading import time def exit(): time.sleep(1) os._exit(1) class AbstractCluster(object): RUN_CMD = 'sbatch' def __init__...
__init__.py
import json from typing import List, Dict from lppinstru.discovery import Discovery, c_int, trigsrcAnalogOut1 import time, datetime import zmq, math import sys, traceback import functools import numpy as np import pandas as pds import peakutils import signal,atexit from threading import Thread from juice_scm_gse.analys...
hambonemilker-Windows.py
import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.chrome.options import Options import getpass import multiprocessing import random import logging logging.basicConfig(filename='logfile.log',lev...
__init__.py
""" homeassistant.util ~~~~~~~~~~~~~~~~~~ Helper methods for various modules. """ import collections from itertools import chain import threading import queue from datetime import datetime import re import enum import socket import random import string from functools import wraps from types import MappingProxyType fr...
test_node.py
import os import sys import logging import requests import time import traceback import random import pytest import ray import threading from datetime import datetime, timedelta from ray.cluster_utils import Cluster from ray.dashboard.modules.node.node_consts import ( LOG_PRUNE_THREASHOLD, MAX_LOGS_TO_CACHE, ) ...
canvas.py
# Following: https://gist.github.com/nikhilkumarsingh/85501ee2c3d8c0cfa9d1a27be5781f06 from tkinter import * from tkinter.colorchooser import askcolor import matlab.engine from threading import Thread # EEG readings pre-game and set-up eng = matlab.engine.start_matlab() eng.addpath(r'C:\Users\hp\Dropbox\Individual P...
test_local.py
# -*- coding: utf-8 -*- """ tests.local ~~~~~~~~~~~~~~~~~~~~~~~~ Local and local proxy tests. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest import time import copy from threading import Thread from werkzeug import local def test_basic_lo...
engine.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # author = i@cdxy.me # project = https://github.com/Xyntax/POC-T import sys from lib.core.data import th, conf, logger try: from gevent import monkey monkey.patch_all() import gevent # TODO use monkey patch in module/*.py except ImportError, e: logger.err...
util.py
import asyncio import io import logging import os import random import re import socket import subprocess import tarfile import threading import time from contextlib import contextmanager from functools import partial as p from io import BytesIO from typing import Any, Dict, List, TypeVar, cast import docker import ne...
run_erdos_renyi.py
import uclasm from timeit import default_timer from time import sleep from matplotlib import pyplot as plt import numpy as np import scipy as sp from scipy.sparse import csr_matrix from multiprocessing import Process, Queue, cpu_count np.random.seed(0) timeout = 10000 def process_fn(tmplt, world, result_queue=None,...
test_client.py
import time import multiprocessing import pytest from flask import Flask, request, jsonify from livy.client import LivyClient from livy.models import Session, SessionKind, Statement, StatementKind MOCK_SESSION_JSON = {'mock': 'session'} MOCK_SESSION_ID = 5 MOCK_STATEMENT_JSON = {'mock': 'statement'} MOCK_STATEMENT_...
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 - ...
mtsleepC.py
# -*- coding: utf-8 -*- """ Created on 2021/9/4 0004 @author: xing yan """ import threading from time import sleep, ctime loops = [4, 2] def loop(nloop, nsec): print('start loop', nloop, 'at: ', ctime()) sleep(nsec) print('loop', nloop, 'done at: ', ctime()) def main(): print('starting at:', ctime...
WikiExtractor.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # ============================================================================= # Version: 2.39 (September 29, 2015) # Author: Giuseppe Attardi (attardi@di.unipi.it), University of Pisa # # Contributors: # Antonio Fuschetto (fuschett@aol.com) # Leonardo Souza (lsouza@amt...
generate_rir_trainingdata_multiprocess.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Example for computing the RIR between several sources and receivers in GPU. @author: yhfu@npu-aslp.org pyrirgen: https://github.com/phecda-xu/RIR-Generator """ import numpy as np import soundfile as sf import math import pyrirgen import argparse import os ...
33.multiprocessing_terminate.py
import multiprocessing import time def slow_worker(): print('Starting worker') time.sleep(0.1) print('Finished worker') if __name__ == '__main__': p = multiprocessing.Process(target=slow_worker) print('BEFORE:', p, p.is_alive()) p.start() print('DURING:', p, p.is_alive()) p.termina...
writerow.py
import time import requests import multiprocessing as mlp from mytime import mytime def url(precision='ns'): return 'http://localhost:7076/write?db=test&precision='+precision def send(m, precision, number, init_time): t = init_time.t_p(precision) for i in range(number): d = m + ' fd=0 ' + str(t+...
tools.py
from .logger import logging logger = logging.getLogger(__name__) def shell(args, **kwargs): """ Replacement for subprocess.run on platforms without python3.5 :param args: Command and parameters in a list :return: A tuple with (command output, return code) """ import subprocess output, re...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018 The Talkcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test talkcoind shutdown.""" from test_framework.test_framework import TalkcoinTestFramework from test_fram...
test_debug.py
import importlib import inspect import os import re import sys import tempfile import threading from io import StringIO from pathlib import Path from unittest import mock from django.core import mail from django.core.files.uploadedfile import SimpleUploadedFile from django.db import DatabaseError, connection from djan...
emu.py
#!/usr/bin/env python3 from xml.etree import ElementTree from xml.etree.ElementTree import Element, tostring as xml_tostring, indent as xml_indent, fromstring as xml_fromstring, ParseError import api_classes import argparse from io import StringIO, BytesIO import re,json,sys,os, subprocess,io,copy,threading,platform,ti...
vector_clock_optimized.py
from multiprocessing import Process, Pipe import os import threading import time import numpy as np process_number = 3 event_number = 3 def sending_events_thread(pid, event_queue, start, pipe_list_local, process_id, event_list, time_stamp, sending_indicator): print("P%s:PID%s " % (str(process_id), str(pid))) ...
mission.py
#!/usr/bin/env python3 # encoding: utf-8 # # Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. # # This file is part of ewm-cloud-robotics # (see https://github.com/SAP/ewm-cloud-robotics). # # This file is licensed under the Apache Software License, v. 2 except as noted # otherwise in the LIC...
test_lib.py
#!/usr/bin/env python """A library for tests.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import datetime import doctest import email import functools import itertools import logging import os import shutil import threading import time import unitt...
boring4.py
#!/usr/bin/env python # -*- coding:utf-8 -*- import tkinter as tk import random import threading import time # # from:https://mp.weixin.qq.com/s/R9Z0LR9htZcgl7vVvY1sdQ # 这个程序就动感多了,会随机出现弹窗。 # 运行效果如下图所示,非常带劲,可以任意修改。 def boom(): window = tk.Tk() width = window.winfo_screenwidth() height = window.winfo_screen...
main.py
import threading from datetime import datetime from selenium import webdriver from selenium.webdriver.common.keys import Keys from webdriver_manager.chrome import ChromeDriverManager def iterate(max_iterations, search_term, boosted_site): iterations = 1 driver = webdriver.Chrome(ChromeDriverManager().install(...
shell.py
""" Scrapy Shell See documentation in docs/topics/shell.rst """ from threading import Thread from scrapy.command import ScrapyCommand from scrapy.shell import Shell from scrapy import log class Command(ScrapyCommand): requires_project = False default_settings = {'KEEP_ALIVE': True, 'LOGSTATS_INTERVAL': 0} ...
history.py
#------------------------------------------------------------------------- # # Batch Apps Blender Addon # # Copyright (c) Microsoft Corporation. All rights reserved. # # MIT License # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (t...
c5.py
""" 多线程 threading """ import threading, time from threading import Thread def loop(): print('thread %s is running' % threading.current_thread().name) n = 0 while n < 5: n += 1 print('thread %s >>> %s' % (threading.current_thread().name, n)) time.sleep(1) print('thread %s done.' ...
interceptor.py
#! /usr/bin/python3 import scapy.all as scapy import os import subprocess import netifaces import requests import netfilterqueue import threading import sys import time import argparse from termcolor import colored from bs4 import BeautifulSoup def has_root(): return os.geteuid() == 0 def get_arguments(): par...
dag_processing.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...
CntlrWinMain.py
''' Created on Oct 3, 2010 This module is Arelle's controller in windowing interactive UI mode @author: Mark V Systems Limited (c) Copyright 2010 Mark V Systems Limited, All rights reserved. ''' from arelle import PythonUtil # define 2.x or 3.x string types import os, sys, subprocess, pickle, time, locale, re from tk...
server.py
import math import os import queue import sys import tempfile import threading import time import uuid from collections import namedtuple from concurrent.futures import ThreadPoolExecutor from threading import Event as ThreadingEventType import grpc from dagster import check, seven from dagster.core.code_pointer impor...
app.py
import os from concurrent import futures import time import streamlit as st from random import randint import logging import requests import settings.settings as settings from data import csv_to_df, excel_to_df from utils.common import set_page_container_style set_page_container_style( max_width = 1100, max_...
analyzer-executor.py
import base64 import hashlib import inspect import json import os import random import sys import traceback from concurrent.futures import ThreadPoolExecutor from multiprocessing import Process, Pipe from multiprocessing.connection import Connection from multiprocessing.pool import ThreadPool from typing import Any, Op...
13_edf_wound_wait_NS.py
from functools import reduce from sys import * import numpy as np import random as r import ping_code as pc import socket import struct import subprocess as sp from threading import Thread import paramiko import ast import time import os import getpass as gp import data hosts = {} # {hostname: ip} multicast_group = '...
tracker.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 u...
tcp_proxy.py
# sudo ./proxy.py 127.0.0.1 21 ftp.target.ca 21 True import sys import socket import threading def server_loop(local_host, local_port, remote_host, remote_port, receive_first): server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: server.bind((local_host, local_port)) except: pr...
example_test.py
from __future__ import print_function from __future__ import unicode_literals import re import os import socket import select import hashlib import base64 import queue import random import string from threading import Thread, Event import ttfw_idf def get_my_ip(): s = socket.socket(socket.AF_INET, socket.SOCK_DGR...
main.py
"""Ulauncher extension main class""" import logging import json import threading import websocket from ulauncher.api.client.Extension import Extension from ulauncher.api.client.EventListener import EventListener from ulauncher.api.shared.event import KeywordQueryEvent, ItemEnterEvent from ulauncher.api.shared.item.Ex...
validate.py
#!/usr/bin/env python3 import argparse import os, atexit import textwrap import time import tempfile import threading, subprocess import barrier, finishedSignal import signal import random import time from enum import Enum from collections import defaultdict, OrderedDict BARRIER_IP = 'localhost' BARRIER_PORT = 10...
geoipmap.py
#!/usr/bin/env python # vim: set ft=python fenc=utf8 fo=tcqrj1n: # GEOIPMAP :: World map plotting of locations associated to IPs # Copyright (C) 2019, J. A. Corbal <jacorbal@gmail.com> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following condi...
Main.py
from modules.TodoList import TodoList from modules.TodoListChecker import checker import threading import time # This is a sample intended application of the to-do cli if __name__ == "__main__": t = TodoList() # This will be done via interactive CLI (WIP) t.add_todo('Hello', 1.5) t.add_todo('Hello1', ...
screen_grab_video_input_stream.py
import logging from queue import Empty, Queue from threading import Thread import numpy as np from mss import mss from .video_input_stream import VideoInputStream class ScreenGrabVideoInputStream(VideoInputStream): def __init__(self, monitor_idx=1, is_live=True, buffer_size=128): self._sct = mss() ...
serial_test.py
import serial import threading import time import binascii ser = serial.Serial('/dev/ttyUSB0') print(ser.name) def recv(name): while 1: print('recving====') print(binascii.hexlify(ser.read(1))) def send(name): while 1: wrote = ser.write(binascii.unhexlify('f0ff100001f7')) print(wrote) time....
chat.py
import curses import zmq import threading context = zmq.Context() sender = context.socket(zmq.PUB) receiver = context.socket(zmq.SUB) sender.connect('tcp://localhost:5556') receiver.connect('tcp://localhost:5557') receiver.setsockopt(zmq.SUBSCRIBE, b"") #poller = zmq.Poller() #poller.register(receiver, zmq.POLLIN) ...
r.py
#PHUSUI TEAM DELETE #Ki4 from linepy import * from akad.ttypes import Message from akad.ttypes import ContentType as Type from akad.ttypes import ChatRoomAnnouncementContents from akad.ttypes import ChatRoomAnnouncement from multiprocessing import Pool, Process from datetime import datetime from time import sleep from...
runner.py
#!/usr/bin/env python3 # Copyright 2010 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. """This is the Emscripten test runner. To run ...
mt_gui.py
from kivy.app import App from kivy.lang import Builder from kivy.metrics import dp from kivy.uix.image import Image from kivy.uix.widget import Widget from kivy.uix.boxlayout import BoxLayout from kivy.uix.screenmanager import Screen from kivy.uix.gridlayout import GridLayout from kivymd.bottomsheet import MDListBottom...