source
stringlengths
3
86
python
stringlengths
75
1.04M
util.py
"""Test utilities.""" from importlib import reload as reload_module import io import logging from multiprocessing import Event from multiprocessing import Process import shutil import sys import tempfile import unittest import warnings from cryptography.hazmat.backends import default_backend from cryptography.hazmat.p...
PyShell.py
#! /usr/bin/env python from __future__ import print_function import os import os.path import sys import string import getopt import re import socket import time import threading import io import linecache from code import InteractiveInterpreter from platform import python_version, system try: from Tkinter import...
_utils.py
import platform import sys import os import queue import socket import threading import subprocess from typing import IO, Optional, Union from adbutils.constant import DEFAULT_ADB_PATH def check_file(fileName: str): """check file in path""" return os.path.isfile(f'{fileName}') def get_std_encoding(stream): ...
console.py
from __future__ import absolute_import, division, print_function import asyncio import copy import json import logging import os import random import string import threading from code import InteractiveConsole from collections import OrderedDict from decimal import Decimal from os.path import exists, join import eth_...
task4_client3.py
import socket from threading import Thread def send_message(): while True: s.send(input().encode('utf-8')) def receive_message(): while True: data = s.recv(1024) print(data.decode('utf-8')) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('127.0.0.1'...
mtTkinter.py
'''Thread-safe version of Tkinter. Copyright (c) 2009, Allen B. Taylor This module is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This pro...
util.py
import http.client as httplib import json from urllib.parse import urlparse import threading import logging import sys import math import time import datetime import base64 import codecs import struct import time formatter = logging.Formatter('%(levelname)s : %(asctime)s : %(message)s') handler = logging.StreamHandler...
worker.py
import argparse import multiprocessing import os import random import socket import struct import time from threading import Thread import torch import common stop = False def tight_loop(): while True: for i in range(1000000): x = i * i def tight_loop_torch(): num_mats = 10 mat_di...
tasks.py
import socket import subprocess import threading from asgiref.sync import async_to_sync from celery import shared_task from channels.layers import get_channel_layer from django.db import connection from django_celery_beat.models import CrontabSchedule, PeriodicTask from wol.commands import shutdown, wake from wol.mod...
PortScanner.py
#!usr/bin/python import threading from queue import Queue import time import sys import socket from datetime import datetime from colorama import init, Fore # some colors init() GREEN = Fore.GREEN RESET = Fore.RESET GRAY = Fore.LIGHTBLACK_EX RED = Fore.RED WHITE = Fore.WHITE YELLOW = Fore.YELLOW print(f"{GRAY} - -- -...
uiautomation.py
# coding=utf-8 __author__ = 'lxn3032' import os import requests import time import warnings import threading import atexit from airtest.core.api import connect_device, device as current_device from airtest.core.android.ime import YosemiteIme from hrpc.client import RpcClient from hrpc.transport.http import HttpTran...
queue_pipe.py
from multiprocessing import Pipe,Process import os import time import random def send_proc(pipe,content): pass def recv_proc(pipe): pass if __name__ == '__main__': print("Parent process is %s started." % (os.getpid(),)) pipe = Pipe() send_process = Process(target = send_proc, args=())
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...
alternate_server.py
import argparse from socket import AF_INET, socket, SOCK_STREAM from threading import Thread def accept_incoming_connections(): """Sets up handling for incoming clients.""" while True: client, client_address = SERVER.accept() print("%s:%s has connected." % client_address) addresses[cli...
_kit2fiff_gui.py
"""Mayavi/traits GUI for converting data from KIT systems""" # Authors: Christian Brodbeck <christianbrodbeck@nyu.edu> # # License: BSD (3-clause) import os from ..externals.six.moves import queue from threading import Thread import numpy as np from scipy.linalg import inv # allow import without traits try: fro...
main.py
from flask import Flask, request, send_from_directory from flask_restful import Api, Resource, reqparse, abort import os from werkzeug.utils import secure_filename import PIL.Image from multiprocessing import Process app = Flask(__name__) api = Api(app) app.config['MAX_CONTENT_LENGTH'] = 16 * 1000 * 1000 #16 MB m...
multi_tcp_server.py
#!/usr/bin/env python3 import sys, os runpath = os.path.dirname(os.path.realpath(__file__)) sys.path.append(os.path.join(runpath,'..')) approot = os.path.abspath(os.path.join(runpath, os.pardir)) import lib.tcp_server as server import lib.events as event import lib.shm as shm from threading import Thread import lib.job...
chat.py
# -*- coding:utf-8 -*- import abc import socket import threading from LiveChat.dao.server_dao import ServerDao __auth__ = "daigd" class BaseServer(metaclass=abc.ABCMeta): @abc.abstractmethod def bind(self): pass @abc.abstractmethod def accept(self): pass server_dao = ServerDao() ...
NALSM_PARALLEL_SAVE.py
import NALSM_GEN_SUPPORT as sup import multiprocessing as mp class multi_process: def __init__(self,num_processes,save_path): self.dataPath = save_path # Define IPC managers manager1 = mp.Manager() # Define lists (queue) for tasks and computation results s...
serve.py
# Copyright (c) 2020 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 appli...
flask_helper.py
from flask import Flask, request from flask_cors import CORS from jinja2 import Environment, PackageLoader from IPython.display import display, HTML from .environment_detector import build_environment import socket import threading import atexit try: from gevent.pywsgi import WSGIServer except ModuleNotFoundError...
system_test.py
import tempfile, os, os.path, subprocess, md5, time, sys, random, threading import ringogw home_dir = tempfile.mkdtemp("", "ringotest-") + '/' node_id = 0 conn = None os.environ['RINGOHOST'] = 'RINGODBG' os.environ['RESYNC_INTERVAL'] = '10000' os.environ['CHECK_EXT_INTERVAL'] = '10000' os.environ['DOMAIN_CHUNK_MAX'] ...
ecmwf_mesoscale_fetcher.py
#!/usr/bin/env python from multiprocessing import Process from multiprocessing.managers import SyncManager import signal try: from gribapi import * GRIBAPI = True except ImportError: from eccodes import * GRIBAPI = False import logging import argparse import sys try: import yaml except ImportError:...
train_random.py
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
schedule.py
import time from multiprocessing import Process import asyncio import aiohttp try: from aiohttp.error import ProxyConnectionError,ServerDisconnectedError,ClientResponseError,ClientConnectorError except: from aiohttp import ClientProxyConnectionError as ProxyConnectionError,ServerDisconnectedError,ClientResponse...
player_sandboxed.py
import threading from threading import Timer from player_abstract import AbstractPlayer import random import socket import server def _stream_logs(container, stdout, stderr, line_action): for line in container.logs(stdout=stdout, stderr=stderr, stream=True): line_action(line) class Sandboxe...
Hiwin_RT605_Socket_v3_20190628111231.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...
controller.py
import re import re import time import traceback from threading import Thread from typing import List, Set, Type, Tuple, Dict from bauh.api.abstract.controller import SoftwareManager, SearchResult, ApplicationContext, UpgradeRequirements, \ UpgradeRequirement from bauh.api.abstract.disk import DiskCacheLoader from...
SoundTheAlarm.py
import smtplib import sys from PyQt5.QtWidgets import QApplication, QWidget, \ QPushButton, QDesktopWidget, QLabel, QVBoxLayout from PyQt5.QtGui import QIcon from playsound import playsound from threading import Thread from PyQt5.QtCore import QDateTime, Qt class WarningBox(QWidget): """Defining the ...
exampleApp3.py
import time import threading from pyhtmlgui import PyHtmlGui, PyHtmlView, Observable class App(Observable): pass class AppView(PyHtmlView): TEMPLATE_STR = ''' i am a item that is updated by a thread in the python frontend object<br> {{ this.value }}<br> <button onclick='pyhtmlgui.call...
process.py
# -*- coding: utf-8 -*- from __future__ import absolute_import # Import python libs import logging import os import time import sys import multiprocessing import signal # Import salt libs import salt.utils import six log = logging.getLogger(__name__) HAS_PSUTIL = False try: import psutil HAS_PSUTIL = True ...
__init__.py
from __future__ import print_function import argparse import io import itertools import json import os import random import re import shlex import string import sys import traceback import warnings from collections import OrderedDict from fnmatch import fnmatchcase from subprocess import list2cmdline from threading im...
helpers.py
"""Supporting functions for polydata and grid objects.""" import collections.abc import ctypes import enum import logging import signal import sys import warnings from threading import Thread import threading import traceback import numpy as np import scooby import vtk import vtk.util.numpy_support as nps import pyv...
tests.py
from __future__ import unicode_literals from datetime import datetime, timedelta import threading import warnings from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.db import connections, DEFAULT_DB_ALIAS from django.db import DatabaseError from django.db.models.fields import F...
ydlhandler.py
import os from queue import Queue from threading import Thread import subprocess import io import importlib import json from time import sleep from datetime import datetime import sys from subprocess import Popen, PIPE, STDOUT from ydl_server.logdb import JobsDB, Job, Actions, JobType def reload_youtube_dl(): fo...
build.py
## @file # build a platform or a module # # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR> # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ...
panoptes.py
""" panoptes: Service to synchronise storage. """ import json import logging import os import requests import traceback import time try: from queue import Queue except ImportError: import Queue from threading import Thread try: from urlparse import urljoin, urlparse except: from urllib.parse impo...
test_server.py
from multiprocessing import Process import os import signal from time import sleep import pytest import requests import proxypool.proxy_server as proxy_server from proxypool.config import HOST, PORT, SSL_ON, CA_CRT @pytest.fixture def api(db): db.put_list(['127.0.0.1:80', '127.0.0.1:443', '127.0.0.1:1080']) ...
SleepableThreadManager.py
import threading from SleepableThread import SleepableThread from TestFunctions import NumberSequences class SleepableThreadManager: threads = {str: SleepableThread} thread = None functions = NumberSequences() function_mappings = {} def __init__(self): self.thread = threading.Thread(targ...
tasks.py
# coding=utf-8 import asyncio import threading class Tasks: loop = asyncio.new_event_loop() @classmethod def _run(cls): asyncio.set_event_loop(cls.loop) try: cls.loop.run_forever() finally: cls.loop.close() @classmethod def do(cls, func, *args, **...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The UFO Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test UFOd shutdown.""" from test_framework.test_framework import UFOTestFramework from test_framework.util...
groups.py
import math import time from abc import ABC, abstractmethod from threading import Thread from typing import Set, Callable, Dict, Optional, List, Tuple, Iterable from uuid import uuid4 from django.core.paginator import Paginator from socksync.errors import SockSyncErrors _SockSyncSocket = 'SockSyncSocket' class Gro...
utils.py
from datetime import datetime from flask_mail import Message from flask import request, render_template, current_app from agil import mail from threading import Thread import string def addMonth(): import datetime return datetime.datetime.strptime(currentDate(), "%Y-%m-%d") + datetime.timedelta(days=30) def...
test_statistics.py
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
face2rec2.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...
main.py
""" This file is distributed as part of the Modpack Installer Project. The source code may be available at https://github.com/MrKelpy/Modpack-Installer If a license applies for this project, the former can be found in every distribution, as a "LICENSE" file at top level. """ # Built-in Imports import threading import...
future_test.py
# Copyright 2020 The TensorStore Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
test_contextvars.py
from __future__ import print_function import gc import sys from functools import partial from unittest import skipUnless from unittest import skipIf from greenlet import greenlet from greenlet import getcurrent from . import TestCase try: from contextvars import Context from contextvars import ContextVar ...
ua_client.py
""" Low level binary client """ import logging import socket from threading import Thread, Lock from concurrent.futures import Future from functools import partial from opcua import ua from opcua.common import utils from opcua.ua.uaerrors import UaError, BadTimeout, BadNoSubscription, BadSessionClosed class UASocke...
sensors.py
#!/usr/bin/python #encoding:=utf-8 import time, fcntl, glob, sys, threading # 参考: http://blog.livedoor.jp/tmako123-programming/archives/41536599.html # http://qiita.com/wwacky/items/98d8be2844fa1b778323 class Sensor: def __init__(self): pass def _readline(self,f): if isinstance(f,basestring) : ...
pycp.py
""" Description: -----------------------| pycp.py |----------------------- | | | A file of the Python Color Picker tool. | | | | Creator: Tobdu 399 ...
display.py
# -*- coding=utf-8 -*- # name: nan chen # date: 2021/7/4 19:56 import threading import cv2 from PyQt5.QtWidgets import QFileDialog from PyQt5.QtGui import QPixmap, QImage import numpy as np from PyQt5 import QtWidgets, QtGui import face_identify from retinaface import Retinaface class Display: def __init__(self...
test_wrapper.py
from __future__ import division, absolute_import, print_function __copyright__ = "Copyright (C) 2009 Andreas Kloeckner" __license__ = """ 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 r...
speedtest.py
r""" Perform a bandwidth test with speedtest-cli. Use middle-click to start the speed test. Configuration parameters: button_share: mouse button to share an URL (default None) format: display format for this module *(default "speedtest[\?if=elapsed&color=elapsed_time " "{elapsed_time}s][ [\?c...
CompileDep.py
#encoding=utf-8 import Queue import os import pickle from threading import Thread import utils from GenMakefile import GenMakefile from ParseComake import ComakeParser class CompileDep: def __init__(self): self.work_num = 1 #self.root = os.getenv("COMAKEPATH") self.stack = None s...
test_api.py
""" mbed SDK Copyright (c) 2011-2014 ARM Limited 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 wr...
__init__.py
import bisect import collections import inspect import io import json import queue import threading import time import logging import traceback from typing import Union from . import exception __version__ = '2.1.0' def flavor(msg): """ Return flavor of message or event. A message's flavor may be one of...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
test.py
# -*- coding: utf-8 -*- import redis import unittest from hotels import hotels import random import time from RLTest import Env from includes import * from common import * # this tests is not longer relevant # def testAdd(env): # if env.is_cluster(): # raise unittest.SkipTest() # r = env # env.as...
parallel.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Sep 12 00:23:36 2018 @author: yuluo """ import multiprocessing as mp import os import random import subprocess from deprecated.ProcessABC import ProcessABC class ParallelProcess(ProcessABC): def __init__(self, content): self.content = co...
BeamProfile_window.py
"""Beam Profile Display window Author: Friedrich Schotte, Feb 26, 2016 - Sep 28, 2017 """ import wx from profile import xy_projections,FWHM,CFWHM,xvals,yvals from logging import debug,info,warn,error __version__ = "1.1.2" # optional arguments class BeamProfile(wx.Panel): """Beam Profile Display window""" name...
server.py
""" Flask server for CO2meter (c) Vladimir Filimonov, 2018 E-mail: vladimir.a.filimonov@gmail.com Redacted by Pol Smith, 2019 @trenerok """ import optparse import logging import threading import time import glob import os import socket import datetime as dt import telebot from telebot import types impo...
trainer_utils.py
# coding=utf-8 # Copyright 2020-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
main.py
import json import os from argparse import ArgumentParser from data import get_data from google.cloud import storage as st from inference import load_registered_model KEYS = ['pid', 'study', 'mlflow_id', 'last_sync', 'last_sync_update'] def validate_json(s): data = json.loads(s) # Same lengths. if len(d...
PythonCommandBase.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from abc import ABCMeta, abstractclassmethod from time import sleep import threading import cv2 from .Keys import KeyPress, Button, Hat, Direction, Stick from . import CommandBase # the class For notifying stop signal is sent from Main window class StopThread(Exception):...
socket.py
#!/usr/bin/env python3 # Part of PieCoin educational project by SweetPalma, 2017. All rights reserved. from threading import Thread import socket import struct # Local modules: from nanocoin.config import (NANOCOIN_ENCODING, NANOCOIN_RANGE) # Nanocoin message structure: # NANOCOINXXXXYYYYMMMMMMMMMMMMMMM... # # NAN...
test_run_tracker.py
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import http.server import json import threading from urllib.parse import parse_qs from pants.auth.cookies import Cookies from pants.goal.run_tracker import RunTracker from pants.testutil....
opc_server.py
import socket from time import sleep import threading import selectors import numpy as np class OPCMessage: """ Class for handling OPC messages (http://openpixelcontrol.org/). Suppports multiple connections by using selectors. Based on https://realpython.com/python-sockets/ """ def __init__(...
server.py
import subprocess import threading from time import sleep from os import system #open new process opening bedrock_server.exe process = subprocess.Popen('bedrock_server.exe', stdin=subprocess.PIPE, stdout=subprocess.PIPE) #allows for input from the console def InputLoop(): while True: inp = inpu...
ex2.py
# Python 3.3.3 # python3 helloworld_python.py from threading import Thread, Lock # Potentially useful thing: # In Python you "import" a global variable, instead of "export"ing it when you declare it # (This is probably an effort to make you feel bad about typing the word "global") num = 0 def threadIncNum(lock)...
hostperf.py
# -*- coding: UTF-8 -*- ''' Copyright (c) 2015 Scouter Project. 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...
sac_v2_multithread.py
''' Soft Actor-Critic version 2 using target Q instead of V net: 2 Q net, 2 target Q net, 1 policy net add alpha loss compared with version 1 paper: https://arxiv.org/pdf/1812.05905.pdf ''' import math import random import gym import numpy as np import torch import torch.nn as nn import torch.optim as optim import ...
webserver.py
# Copyright (c) 2012 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 BaseHTTPServer import os import threading class Responder(object): """Sends a HTTP response. Used with TestWebServer.""" def __init__(self,...
test_threading.py
""" Tests for the threading module. """ import test.support from test.support import (verbose, import_module, cpython_only, requires_type_collecting) from test.support.script_helper import assert_python_ok, assert_python_failure import random import sys import _thread import threading import...
test_capi.py
# Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. from collections import OrderedDict import os import pickle import random import re import subprocess import sys import textwrap import threading import time import unitt...
simple_test_server.py
"""Local Server to return RSS feed data for unit testing""" import http.server import socketserver import threading PORT = 8081 TEST_RSS = b"""<?xml version="1.0" encoding="utf-8"?> <rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"> <channel> <title>test feed</title> <link>http://example....
client.py
# # A Python client API for Edbot Studio. # # Copyright (c) Robots in Schools Ltd. All rights reserved. # import json import time import threading from pydash.objects import merge, unset from ws4py.client.threadedclient import WebSocketClient class EdbotStudioClient(WebSocketClient): Category = { "REQUEST": 1, ...
synchronized_lights.py
#!/usr/bin/env python # # Licensed under the BSD license. See full license in LICENSE file. # http://www.lightshowpi.com/ # # Author: Todd Giles (todd@lightshowpi.com) # Author: Chris Usey (chris.usey@gmail.com) # Author: Ryan Jennings # Author: Paul Dunn (dunnsept@gmail.com) # Author: Tom Enos (tomslick.ca@gmail.com)...
threaded.py
# vim:fileencoding=utf-8:noet from __future__ import absolute_import from powerline.lib.monotonic import monotonic from threading import Thread, Lock, Event class MultiRunnedThread(object): daemon = True def __init__(self): self.thread = None def is_alive(self): return self.thread and self.thread.is_alive...
streaming.py
#21datalabplugin from abc import ABC, abstractmethod import utils from utils import Profiling from system import __functioncontrolfolder import dates import numpy import numpy as np import copy import time from model import getRandomId import threading class Interface(ABC): @abstractmethod def flush(self,da...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
BasicHttpAgent.py
# pip3 install requests Flask from IOAgent import IOAgent from abc import ABC from http.server import HTTPServer, BaseHTTPRequestHandler from http.client import HTTPSConnection, HTTPConnection from base64 import b64encode import sseclient import requests import threading import platform import subprocess import pp...
run_system.py
from multiprocessing import Pool, Process from settings import * import os from byte_code_feature_extraction import byte_extraction from asm_code_feature_extraction import asm_extraction from classification_system import classification def byte_code_worker(datasets): byte_pool = Pool(2) byte_pool.map(byte_ex...
fun_multiprocessing.py
# Topic: Multiprocessing with module 'multiprocessing' and 'concurrent.futures' # # Author: Xuhua Huang # Last updated: Jun 29, 2021 # Created on: Jun 29, 2021 import time import multiprocessing import concurrent.futures """ Function that does not ask for arguments """ def fn_no_args(void): print('[fn_no_args(vo...
client-socket-ver2.py
#Nicholas Tahan, November 11, 2020 #Client Version Two: #This program will connect to a server already running. It will create a new thread to listen for feeback from the server. #The client will also accept input while receiving feedback from the server #Multiple instances of this client can connect to the server #The...
android_hooks.py
# -*- coding: utf-8 -*- # An android event hook via getevent. # Only ABS_MT_POSITION_X(Y) events are handled. # # Basic input: TouchDown(D), TouchUp(U), TouchMove(M) # Basic timeouts: TouchPressTimeout(P), TouchFollowTimeout(F), TouchMoveStopTimeout(S) # guestures are defined as follows: # Tap/Touch/Click: DM?...
timeline_window.py
#!/usr/bin/env python # System modules import sys,os import random import unittest import threading, time import colorsys import math import bisect import cairo, pangocairo import gtk, gtk.glade # TREX modules from TREX.core.db_core import DbCore,Timeline from TREX.core.assembly import Assembly,Entity,Rule,Token,Sl...
filestatemanager.py
# Copyright 2016 Twitter. 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 agree...
HiwinRA605_socket_ros_20190625104951.py
#!/usr/bin/env python3 # license removed for brevity #接收策略端命令 用Socket傳輸至控制端電腦 import socket ##多執行序 import threading import time ## import sys import os import numpy as np import rospy import matplotlib as plot from std_msgs.msg import String from ROS_Socket.srv import * from ROS_Socket.msg import * import HiwinRA605_s...
tapper.py
from multiprocessing.queues import Queue import sys from threading import Thread import uuid import time from mc_bin_client import MemcachedClient import memcacheConstants from memcached.helper.data_helper import MemcachedClientHelper from resourceparser import ServerInfo from membase.api.tap import TapConnection cl...
serving.py
from threading import Thread def thread_run_simple(app,args=(),debug=False): """Lightly Modified Version of run_simple. Used by serving.run_in_thread() Args: app (Union[function, ABC]): Executed automatically args (tuple, optional): Args passed in app(). Defaults to (). debug...
producer.py
import logging import threading import time import json import random import pandas as pd import os from pykafka import KafkaClient from config.configurator import Configurator from src.spark.context import AppSparkContext class Producer(threading.Thread): def __init__(self, configurator: Configurator, sc: AppS...
uploader.py
#!/usr/bin/env python import os import re import time import stat import json import random import ctypes import inspect import requests import traceback import threading import subprocess from collections import Counter from selfdrive.swaglog import cloudlog from selfdrive.loggerd.config import ROOT from common.para...
wsdump.py
#!C:\Users\VmAdm\PycharmProjects\ledmatrix\venv\Scripts\python.exe import argparse import code import sys import threading import time import ssl import gzip import zlib import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding()...
util.py
"""Utility functions. """ import traceback from queue import Queue import os import re import sys import base64 import time import platform import logging import threading import subprocess import serial import serial.tools.list_ports import pkg_resources from meshtastic.supported_device import supported_devices """S...
autosave.py
#!/usr/bin/python3.9 # Copyright (c) 2021 MobileCoin Inc. # Copyright (c) 2021 The Forest Team import asyncio import logging import os import time from pathlib import Path from subprocess import PIPE, Popen from typing import Any import aioprocessing from aiohttp import web from forest import fuse, mem, utils _memf...
utils.py
#!/usr/bin/env python """ General Utilities (part of web.py) """ from __future__ import print_function import datetime import os import re import subprocess import sys import threading import time import traceback from threading import local as threadlocal from .py3helpers import ( PY2, imap, is_iter, ...
test.py
import json import os.path as p import random import subprocess import threading import logging import time from random import randrange import pika import pytest from google.protobuf.internal.encoder import _VarintBytes from helpers.client import QueryRuntimeException from helpers.cluster import ClickHouseCluster fro...
logging_test.py
import sys sys.path.append('..') import unittest import threading import socket import logging logging.basicConfig(level=logging.DEBUG) from interfaces import get_log_interface, tflogging from entities import Server, Pug from tornado import ioloop class RconConnection(object): def __init__(self, *args): ...
play.py
import chess from .types import * from .player import Player from .game import Game, LocalGame, RemoteGame, MultiprocessingLocalGame from .history import GameHistory import multiprocessing as mp def play_local_game(white_player: Player, black_player: Player, game: LocalGame = None, seconds_per_pl...