source
stringlengths
3
86
python
stringlengths
75
1.04M
multiprocess_template.py
#!/usr/bin/env python3 # -*- coding:utf-8 -*- """ Python MultiProcessing - Watch a Process and restart it When fails """ from multiprocessing import Process from time import sleep import sys, os import datetime def task_1(): print('{}: Sleep 5 seconds, Parent PID: {}, PID: {}'.format(sys._getframe().f_code.co_nam...
parallel_envs.py
# coding=utf-8 # Copyright 2018 The TF-Agents 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...
installwizard.py
from functools import partial import threading import os from kivy.app import App from kivy.clock import Clock from kivy.lang import Builder from kivy.properties import ObjectProperty, StringProperty, OptionProperty from kivy.core.window import Window from kivy.uix.button import Button from kivy.utils import platform...
exemplo_02.py
from collections import deque from threading import Thread from time import sleep def contador(name, stop): cont = 1 while cont <= stop: yield name, cont cont += 1 sleep(.1) def contador_regressivo(name, start): while start >= 1: yield name, start start -= 1 ...
main.py
''' (*)~--------------------------------------------------------------------------- Pupil - eye tracking platform Copyright (C) 2012-2018 Pupil Labs Distributed under the terms of the GNU Lesser General Public License (LGPL v3.0). See COPYING and COPYING.LESSER for license details. ------------------------------------...
exercise20_sock_lock.py
""" --- Exercise statement: N°20 - Lock/RLock (multiprocessing) Escriba un servidor tcp que atienda un puerto pasado por argumento (-p en getopt), y reciba los siguientes comandos: ABRIR, CERRAR, AGREGAR, y LEER, por parte de los clientes. Si el cliente envía un comando ABRIR, el servidor deberá solicitarle un nombr...
tesseract_controller.py
import threading import time from functools import partial from logging import getLogger from pathlib import Path from kivymd.toast import toast from kivymd.uix.button import MDFlatButton from kivymd.uix.dialog import MDDialog from kivymd.uix.filemanager import MDFileManager from kivymd.uix.menu import MDDropdownMenu ...
signalling.py
import socket from threading import Thread import sqlite3 conn = sqlite3.connect('user.db',check_same_thread=False) c = conn.cursor() ADDRESS = ('127.0.1.1', 5535) # addr for binding g_socket_server = None # listening socket g_conn_pool = {} # dict storing connections encode_type = 'utf-8' MSG_SIZE = 1024 def i...
can.py
#!/usr/bin/env python3 import threading import Queue import uspp.uspp as serial import message_dispatcher as dispatcher # ------------------------------------------------------------------------------ class CanException(Exception): pass # ----------------------------------------------------------------------------...
dummygatekeeper.py
""" Copyright (c) 2015 SONATA-NFV and Paderborn University 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 ap...
get_data.py
from . import api, models, errors import time import json import sqlite3 import os from threading import Thread def on_new_thread(f): def task_qwq(*args, **kwargs): t = Thread(target=f, args=args, kwargs=kwargs) t.start() return task_qwq class DDAccount: def __init__(self, uid, sessdata, ...
renderQuery1.py
from mitmproxy import http from mitmproxy.utils import strutils from threading import Thread import re, json, sys, threading, time, signal, os sys.path.append('../') from connect import sendDataToFire # A common dictionary for storing data on firebase data = { "google" : [], "youtube" : [], "web" : [] } ...
app.py
# encoding: utf-8 ''' A REST API for Salt =================== .. versionadded:: 2014.7.0 .. py:currentmodule:: salt.netapi.rest_cherrypy.app :depends: - CherryPy Python module :optdepends: - ws4py Python module for websockets support. :configuration: All authentication is done through Salt's :ref:`external auth...
arduino_proto.py
import asyncio import threading import serial import time import ctypes ARDUINO_BAUD_RATE = 115200 # time until setup times out in seconds SETUP_TIMEOUT = 15 # time until read times out in seconds SERIAL_TIMEOUT = 0.5 # time to sleep for main thread in milliseconds INTERNAL_UPDATE_RATE_MS = 50 # Prototype data log...
maintenance.py
# Copyright 2019 Red Hat, Inc. # 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...
senz_handler.py
import socket import threading import tkMessageBox import datetime from pyblake2 import blake2b from db.db_handler import db_handler from minner_algo_handler.minning_algo import minning_algo from utils.senz_parser import * from utils.crypto_utils import * from config.config import * logger = logging.getLogger(__name...
utils.py
import argparse import errno import os import platform from pylru import lrudecorator import re import subprocess import sys import threading import time class FullPaths(argparse.Action): """Expand user- and relative-paths""" def __call__(self, parser, namespace, values, option_string=None): setattr(namespace...
exportvm_on_source.py
#!/usr/local/bin/python3.7 # # DISCLAIMER: This script is not supported by Nutanix. Please contact # Sandeep Cariapa (lastname@gmail.com) if you have any questions. # NOTE: # 1. You need a Python library called "requests" which is available from # the url: http://docs.python-requests.org/en/latest/user/install/#install...
proxy.py
import sys import socket import re from threading import Thread from socketserver import ThreadingTCPServer, StreamRequestHandler from struct import unpack RE_CONNECT = re.compile(r'CONNECT') RE_CONTENT_LENGTH = re.compile(r'Content-Length: ') RE_TRANSFER_ENCODING = re.compile(r'Transfer-Encoding: ') RE_PROXY_CONNECT...
baseball-streaming.py
import PySimpleGUI as sg import subprocess import threading import sys import os HEAT_GAMES_2022 = { '2022-04-30 Elitserien Sundsvall @ Sundbyberg Game #1': {'game_id': '91830', 'series_id': '2022-elitserien-baseboll'}, '2022-04-30 Elitserien Sundsvall @ Sundbyberg Game #2': {'game_id': '91831', 'series_id': '...
opponent_adapter.py
from threading import Thread from time import time, sleep from collections import deque import socket DELAY_INTERVAL = 1 class OpponentAdapter: def __init__(self, connection, username) -> None: self.connection = connection self.delays = deque([0, 0, 0]) self.is_connected = True se...
realsense_detector.py
from itertools import count from threading import Thread import pyrealsense2 as rs from queue import Queue import cv2 import numpy as np import torch import torch.multiprocessing as mp from alphapose.utils.presets import SimpleTransform class RealsenseDetectionLoader(): def __init__(self, input_source, detecto...
main_interface.py
from hardware import camera, robot, turntable from calibration import calibration_axyb, calibration_camera, calibration_functions from threading import Thread import configparser class main_interface(object): def __init__(self, path, config): self.cam_thread = None self.robot_thread = None ...
test_streaming_pull_manager.py
# Copyright 2018, Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
tweet.py
#!/usr/bin/env python3 import logging import os import sys import threading from time import sleep from datetime import datetime import sentry_sdk import tweepy from pytz import timezone from sentry_sdk.integrations.redis import RedisIntegration from sentry_sdk.integrations.tornado import TornadoIntegration from comm...
service_server.py
#!/usr/bin/env python3 # Importing the libraries import rospy import roslib from harmoni_common_lib.constants import State, ActionType from harmoni_common_lib.action_server import HarmoniActionServer import threading class HarmoniServiceServer(HarmoniActionServer, object): """ The service server is responsib...
OutputStreamer.py
import io import os import time import atexit import datetime import threading from queue import Queue, Empty import Utils import Model from GetResults import ResetVersionRAM from WebServer import WsRefresh q = None streamer = None terminateMessage = '<<<terminate>>>' def formatTimeHHMMSS( secs ): return Utils.for...
nums_xgb.py
import logging import time import uuid from threading import Thread from typing import Dict import numpy as np import xgboost as xgb import nums.numpy as nps from nums.core.application_manager import instance as _instance from nums.core.array.application import ArrayApplication from nums.core.array.blockarray import ...
app.py
from threading import Thread from molten import App, Route, Settings, SettingsComponent, schema, HTTP_204, Response from molten_mail import MailComponent, Mail, Message from molten_mail.templates import MailTemplates, MailTemplatesComponent # Replace with your own SMTP parameters settings = Settings( { "MA...
client1.py
import socket import datetime import threading import pytz import time from lib.MyUtils import TimeBuilder, ClientIncrementBuilder, get_time_server_delay def get_time_from_server(): while True: socket_instance.send("get_time".encode()) result = socket_instance.recv(1024) datetime_updated =...
test_util_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...
zfimager.py
#!/usr/bin/env python3 # -*- coding: utf8 -*- # Copyright 2018-2019 Daisuke Sato # # 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 ...
dmc.py
import os import threading import time import timeit import pprint from collections import deque import numpy as np import torch from torch import multiprocessing as mp from torch import nn from .file_writer import FileWriter from .models import Model from .utils import get_batch, log, create_env, create_buffers, cre...
app.py
import os import re import math import sys import shutil import json import traceback import PIL.Image as PilImage import threading import tkinter as tk from tkinter import messagebox from tkinter import ttk from tkinter import filedialog from constants import * from config import ModelConfig, OUTPUT_SHAPE1_MAP, NETWOR...
optimize_alarm2_vs_alarm1_hierachical.py
import EncoderFactory from DatasetManager import DatasetManager import pandas as pd import numpy as np from sklearn.metrics import roc_auc_score from sklearn.pipeline import FeatureUnion import time import os import sys from sys import argv import pickle import csv from conf_constant_costfunctions import get_consta...
caching.py
""" CherryPy implements a simple caching system as a pluggable Tool. This tool tries to be an (in-process) HTTP/1.1-compliant cache. It's not quite there yet, but it's probably good enough for most sites. In general, GET responses are cached (along with selecting headers) and, if another request arrives for the same r...
server_vigenere.py
#!/usr/bin/env python3 # """Server for multithreaded (asynchronous) chat application.""" # import required modules from socket import AF_INET, socket, SOCK_STREAM import socket from threading import Thread import threading import sys import errno # Objects used for vigenere cipher my_key = 'TURING' LETTERS = 'ABCDEF...
backbone.py
from threading import Thread import serial import time import dataBaseClass as db class serialRead: def __init__(self, serialBaud = 9600, serialPort = "COM5"): #Strings self.noDataAvailable = "No Data Available" #Neded variables self.dbConnection = db.sqlLiteDataBase() self...
pyeventbus3.py
from pyeventbus3.pyeventbus3 import * from pyeventbus3.Singleton import * import _thread import threading import time, sys from queue import Queue from threading import Thread from multiprocessing.dummy import Pool as ThreadPool import multiprocessing import gevent, os exitFlag = 0 default_conf = {'max_threads':10} @...
thermald.py
#!/usr/bin/env python3 import datetime import os import queue import threading import time from collections import OrderedDict, namedtuple from pathlib import Path from typing import Dict, Optional, Tuple import psutil from smbus2 import SMBus import cereal.messaging as messaging from cereal import log from common.di...
gui_controllable_talknet.py
import sys import os import base64 from typing import Text import torch import numpy as np import tensorflow as tf import crepe import scipy from scipy.io import wavfile import psola import io import nemo from nemo.collections.asr.models import EncDecCTCModel from nemo.collections.tts.models import TalkNetSpectModel fr...
test_ros_timer.py
# Copyright 2021 Open Source Robotics Foundation, 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...
capstoneSpeechRecognitionTest5.py
# You need to install pyaudio to run this example # pip install pyaudio # When using a microphone, the AudioSource `input` parameter would be # initialised as a queue. The pyaudio stream would be continuosly adding # recordings to the queue, and the websocket client would be sending the # recordings to the speech to t...
parallel.py
import threading from furry.data.data import Batch, Data class ParallelLoadedData(Data): def load(self): self.loader = threading.Thread(target=self.load_data, args=self.__loader_args) self._start() self.__preload__(*self.__preload_args[0], *self.__preload_args[1]) self.loader.start(...
Peer.py
'Author : Shantanu Srivastava' import socket import fcntl import struct import threading import os import ast import time from Tkinter import Tk, BOTH, Listbox, StringVar, END, Label, Entry from ttk import Frame, Button, Style import tkFileDialog import tkMessageBox import pickle import sys import Queue def get_ip_...
deploy_operations.py
''' deploy operations for setup zstack database. @author: Youyk ''' import zstackwoodpecker.test_util as test_util import apibinding.api_actions as api_actions import account_operations import resource_operations as res_ops import zstacklib.utils.sizeunit as sizeunit import zstacklib.utils.jsonobject as ...
tasks.py
# Copyright 2019 Red Hat, Inc. # 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 a...
manage_athenad.py
#!/usr/bin/env python3 import time from multiprocessing import Process from common.params import Params from selfdrive.manager.process import launcher from selfdrive.swaglog import cloudlog from selfdrive.version import get_version, is_dirty ATHENA_MGR_PID_PARAM = "AthenadPid" def main(): params = Params() don...
test_util.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
socksserver.py
#!/usr/bin/env python # SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved. # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # SOCKS proxy server/client # # Author: # Alberto Soli...
electronic_control_unit.py
import logging import can from can import Listener import time import threading import queue from .controller_application import ControllerApplication from .parameter_group_number import ParameterGroupNumber from .j1939_21 import J1939_21 from .j1939_22 import J1939_22 logger = logging.getLogger(__name__) class Elec...
object_detection.py
import cv2 as cv import argparse import numpy as np import sys import time from threading import Thread if sys.version_info[0] == 2: import Queue as queue else: import queue from common import * from tf_text_graph_common import readTextMessage from tf_text_graph_ssd import createSSDGraph from tf_text_graph_fas...
loader.py
import itertools import threading import time import sys from program import settings from program.models.model import Word, Place, FirstName, LastName, Suffix # Optionally: we could use the python csv library here but it's not necessary or required. def load_words(): words = [] def load(): positi...
runAuction.py
""" Copyright 2018, Abbas Ehsanfar, Stevens Institute of Technology 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...
gen_invoke_data.py
# Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. # # WSO2 Inc. licenses this file to you 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/LICE...
AuditLogCollector.py
# Standard libs import os import json import logging import datetime import argparse import dateutil.parser from collections import deque import threading # Internal libs import GraylogInterface import ApiConnection class AuditLogCollector(ApiConnection.ApiConnection): def __init__(self, output_path, content_typ...
main.py
#! /usr/bin/env python import importlib import os import logging import tempfile import signal import shutil import time import sys import threading import json import optparse import email import subprocess from future.builtins import bytes import yaml import requests import coloredlogs import alexapi.config import...
testclient.py
import asyncio import http import io import json import queue import threading import types import typing from urllib.parse import unquote, urljoin, urlsplit import requests from starlette.types import ASGIApp, Message, Scope from starlette.websockets import WebSocketDisconnect # Annotations for `Session.request()` ...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Avian client # Copyright (C) 2012 thomasv@gitorious # # 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...
gui.py
#coding: utf-8 # Copyright 2015 Sindre Ilebekk Johansen and Andreas Sløgedal Løvland # 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 # Unles...
miner.py
import time import hashlib import sys import json import requests import os import secrets import string import base64 from flask import Flask, request from multiprocessing import Process, Queue import ecdsa import secrets import string import logging import simpleCoin.user as user from simpleCoin.Block import Block,bu...
threads_test.py
import sys sys.path.append("../../common") from env_indigo import * def outPrint(s, pid, output): # output = None if output == None: print(s) else: old_out = output[pid] output[pid] = "{0}\n{1}".format(old_out, s) def insertProc(db, pid, input_smi, output=None): ...
mimic_tts.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...
woolnote.py
# qpy:webapp:Woolnote # qpy:fullscreen # qpy://127.0.0.1:8088/woolnote?woolauth=please_change_me # University of Illinois/NCSA Open Source License # Copyright (c) 2018, Jakub Svoboda. # TODO: docstring for the file """TODO docstring""" from woolnote import systemencoding import argparse from http.server import HTTP...
test_basic.py
# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections from concurrent.futures import ThreadPoolExecutor import json import logging import os import random import re import setproctitle import shutil import six import socket impor...
util.py
# -*- coding: utf-8 -*- # # 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 "L...
_time.py
# Copyright 2017 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
datasets.py
# Dataset utils and dataloaders import glob import logging import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path from threading import Thread import cv2 import numpy as np import torch from PIL import Image, Exif...
scheduler.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ | This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) Background processes made simple --------------------------------- """ USAGE = """ ## Example For an...
transcription.py
from pathlib import Path from elpis.wrappers.input.resample import resample from elpis.wrappers.objects.command import run from elpis.wrappers.objects.fsobject import FSObject import shutil import threading import subprocess from typing import Callable class Transcription(FSObject): _config_file = "transcription....
sudos.py
#!/usr/bin/env python #version: 2.5.5.2-beta #built-in libs import collections import threading import argparse import curses import socket import random import json import time import ssl import sys import os #python version check if sys.version_info.major != 3: print("[-] Please run this program with Python3") ...
TCP-IP.py
import socket, threading, time s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('www.sina.com.cn', 80)) s.send(b'GET / HTTP/1.1\r\nHosts: www.sina.com\r\nConnection: close\r\n\r\n') buffer = [] while True: d= s.recv(1024) if d: buffer.append(d) else: break date = b''.joi...
ansiTerm.py
#!/usr/bin/env python3 import os, sys import time from select import select import os import re import tty, termios import atexit import queue import threading import fcntl def _log(ss): with open("/tmp/ansi.log", "at") as fp: fp.write(ss+"\n") class Getch(): ''' 이거 쓰면 계속 input은 이걸 통해서 받아...
functional_tests.py
#!/usr/bin/env python """ This script cannot be run directly, because it needs to have test/functional/test_toolbox.py in sys.argv in order to run functional tests on repository tools after installation. The install_and_test_tool_shed_repositories.sh will execute this script with the appropriate parameters. """ import ...
text_client.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...
multiprocessing-Process.py
#!/usr/bin/python # -*- coding: utf-8 -*- from multiprocessing import Process import os def f(name): print 'process id : ', os.getpid() print 'process name : ', name if __name__ == '__main__': p = Process(target=f, args=('Process1', )) p.start() p.join()
collimator.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ .. module:: collimator :platform: Unix :synopsis: the top-level submodule of T_System that contains the classes related to collimator of T_System's Target Locking System. .. moduleauthor:: Cem Baybars GÜÇLÜ <cem.baybars@gmail.com> """ import threading from math ...
server.py
from math import floor from world import World import Queue import SocketServer import datetime import random import re import requests import sqlite3 import sys import threading import time import traceback from quad_tree import Chunk, Node, QuadTree DEFAULT_HOST = '0.0.0.0' DEFAULT_PORT = 4080 DB_PATH = 'craft.db' ...
vfs_test.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- """Tests for API client and VFS-related API calls.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import io import threading import time import zipfile from absl import app from grr_response_proto.api ...
threadstest.py
import multiprocessing import socket from time import sleep def envir(q): airspeed = 0 alt = 0 print(multiprocessing.Process.name) while True: airspeed += 2 alt += 1 q.put([airspeed, alt]) def try_con(ip, port, time=0, tries=5): for i in range(1, tries + 1): try: ...
Chess_v1.py
import multiprocessing import threading import pygame from pygame.locals import * import os import os.path import random import time from tkinter import Tk import math from copy import deepcopy import numpy from Engine import Engine as engine class Board(): def __init__(self): self.da...
Comm.py
############################################################################### ############################################################################### ## ## PyHART - Master ## ############################################################################### #################################################...
node.py
#!/usr/bin/python # Nama file : node.py # Anggota : # 1. Geraldi Dzakwan (13514065) # 2. Ade Yusuf Rahardian (13514079) # 3. Muhammad Reza Ramadhan (13514107) """IMPLEMENTASI RAFT - NODE.""" import json import socket import sys import random import os.path import requests from ast import literal_eval from thr...
GyroBalancer.py
"""Module for a robot that stands on two wheels and uses a gyro sensor. The robot (eg. BALANC3R) will to keep its balance and move in response to the remote control. This code was adapted from Laurens Valk's script at https://github.com/laurensvalk/segway. """ # The MIT License (MIT) # # Copyright (c) 2016 Laurens Va...
WorkPool.py
#!/usr/bin/python # -*- coding:utf-8 -*- import Queue import threading import time import traceback import random from time import sleep from blessings import Terminal from progressive.bar import Bar from progressive.tree import ProgressTree, Value, BarDescriptor __DEFAULT_NUM__=5 class WorkPool: def __init__...
xark.py
#!/usr/bin/python """ XO Agil Recolector Kaibil - XARK Recolector de informacion interno de la XO. Actualmentle solo recolecta: * Numero de serie (Serial Number) * UUID (Universally Unique IDentifier) * Actividades Instaladas (Installed activities) * Diaro (Journal Activity) """ import os import re i...
outros.py
import os from multiprocessing import Process def rodaprograma(arg): os.execlp('python', 'python3', 'filho.py', str(arg)) if __name__ == '__main__': for i in range(5): Process(target=rodaprograma, args=(i,)).start() print('Saiu de pai')
binary_sensor.py
"""Support to use flic buttons as a binary sensor.""" import logging import threading from pyflic import ( FlicClient, ButtonConnectionChannel, ClickType, ConnectionStatus, ScanWizard, ScanWizardResult, ) import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeas...
vector_upload_endpoint.py
def main(mongo_address): from flask import request, current_app vector_post, inst_status, viz_name, viz_id = load_vector_data(request.data, mongo_address) if inst_status == 'processing': return clust_vector_background(mongo_address, viz_id, vector_post, viz_name) else: return make_error_json(curr...
dataloader.py
import os import sys import time import random from multiprocessing import Process, Queue import scipy.io as sio import numpy as np sys.path.append("..") from . import transforms,statistics,augmenter from util import dsp,util from util import array_operation as arr def del_labels(signals,labels,dels): del_index...
test_rlogger.py
import sys sys.path.append('.') import multiprocessing from rlogger import RLogger def run(): print('ok') RLogger.log('test') if __name__ == '__main__': multiprocessing.set_start_method('spawn') RLogger.init('./test.log') p1 = multiprocessing.Process(target=run) p2 = multiprocessing.Process...
sac.py
import os import torch import elf import numpy as np import wandb from elf.segmentation.features import compute_rag from torch.nn import functional as F from torch.optim.lr_scheduler import ReduceLROnPlateau from torch.utils.data import DataLoader from collections import namedtuple import matplotlib.pyplot as plt from ...
sensor.py
#!/usr/bin/env python """ Copyright (c) 2014-2021 Maltrail developers (https://github.com/stamparm/maltrail/) See the file 'LICENSE' for copying permission """ from __future__ import print_function # Requires: Python >= 2.6 import sys sys.dont_write_bytecode = True import cProfile import inspect import math impor...
runner.py
""" Entry point of the server. """ import contextlib import threading, time, os import logging import uvicorn from uvicorn import Config import server.MQTT_callbacks as MQTT_callbacks import server.fastapi_engine as fastapi_engine import server.recipes_broadcast as recipes_broadcast import common.mqtt_connection ...
SelectAngle_Serial.py
# encoding=utf-8 import socket # 引入套接字 import threading # 引入并行 import pymysql import struct import serial import matplotlib.pyplot as plt import datetime import math import sys,os sys.path.append(r'D:\OneDrive\Python_project\Github\AntiUAV_Python\Python') # from DBInfo import * plt.ion() # 开启一个画图的窗口 ax1 = [] # 定义...
test_obstacle_run_move.py
#!/usr/bin/env python3 import threading, queue import time import os import shutil import numpy as np import math import rospy import tensorflow as tf from test_obstacle_sac import SAC from test_obstacle_env import Test from arm_control.arm_task import ArmTask from manipulator_h_base_module_msgs.msg import P2PPose MA...
main.py
from quixstreaming import QuixStreamingClient from quixstreaming.app import App from functions import Functions from datetime import datetime import os import threading # Quix injects credentials automatically to the client. # Alternatively, you can always pass an SDK token manually as an argument. client = QuixStream...
commander.py
import utils as utils import os import json import fnmatch import csv import datetime as datetime import urllib.parse import threading import subprocess import sys import time from flask import Flask from pdf_audit import PDFAudit as PDF from selenium import webdriver from shutil import copyfile from axe_selenium_pytho...
main.py
from json.decoder import JSONDecodeError import time import os from multiprocessing import Process from multiprocessing import Pool import random import re if os.name == 'posix': try: import simplejson as json except: os.system('pip install simplejson') import simplejson as json if os.name == 'nt': import jso...
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...