source
stringlengths
3
86
python
stringlengths
75
1.04M
engine.py
"""""" import sys from threading import Thread from queue import Queue, Empty from copy import copy from vnpy.event import Event, EventEngine from vnpy.trader.engine import BaseEngine, MainEngine from vnpy.trader.constant import Exchange from vnpy.trader.object import ( SubscribeRequest, TickData, BarData...
coref_model.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import operator import random import math import json import threading import numpy as np import tensorflow as tf import tensorflow_hub as hub import h5py import util #import coref_ops # depends on c...
configuration.py
import copy import multiprocessing as mp import os import re import shutil import stat import time from io import StringIO from ipaddress import ip_network as str2ip from typing import Dict from typing import List from typing import NoReturn from typing import Optional from typing import Text from typing import TextIO ...
test_processbus.py
import threading import time import pytest from magicbus.base import Bus, ChannelFailures from magicbus.process import ProcessBus msg = 'Listener %d on channel %s: %s.' class TestPublishSubscribe(object): def get_listener(self, channel, index): def listener(*args): self.responses.append(m...
foo.py
# Python 3.3.3 and 2.7.6 # python fo.py from threading import Thread # 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") i = 0 def incrementingFunction(): glob...
socket.py
import asyncio import time import websocket import threading import contextlib import json from sys import _getframe as getframe class SocketHandler: def __init__(self, client, socket_trace = False, debug = True): websocket.enableTrace(True) self.socket_url = "wss://ws1.narvii.com" self.cl...
safe_threading.py
""" This thread module provides several useful safe thread tools. The reason this module was created was to easily create and manage threads that run continuously, allowing concurrency. The basic thread can be used like a normal python thread and gives methods stop and close. The basic thread also allows the thread to...
common_utils.py
r"""Importing this file must **not** initialize CUDA context. test_distributed relies on this assumption to properly run. This means that when this is imported no CUDA calls shall be made, including torch.cuda.device_count(), etc. torch.testing._internal.common_cuda.py can freely initialize CUDA context when imported....
service_virtual_account.py
#!/usr/bin/env python3 # Imports from telegram.ext import ( Updater, CommandHandler, CallbackContext, Filters) from telegram import ChatAction import os, sys, threading, logging import pytz from functools import wraps from datetime import datetime import sql_adapter_virtual_account as...
setup.py
from os import path, mkdir from sys import stdout from threading import Thread from subprocess import Popen, run, PIPE, STDOUT from time import time, sleep from datetime import datetime from cached import Cached from utils import concat, bash_pipe, bash_lines, write_file from ui import status_bar, fmt_seconds, bin_uni...
views.py
from bnlp3 import clean as bnlp_clean from bnlp3 import getLocationsAndDatesFromEnglishText, getLocationsFromEnglishText from bs4 import BeautifulSoup from collections import Counter import csv from date_extractor import extract_date from datetime import datetime from docx import Document from django.conf import settin...
cluster_view.py
# cluster_view.py # # MIT License # # Copyright (c) 2020 Alvaro Saurin <alvaro.saurin@gmail.com> # # 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 limit...
driver.py
#!/usr/bin/env python import roslib; roslib.load_manifest('ur_driver') import time, sys, threading, math import copy import datetime import socket, select import struct import traceback, code import optparse import SocketServer from BeautifulSoup import BeautifulSoup import rospy import actionlib from sensor_msgs.msg ...
my_app.py
import os import sys from threading import Thread from functools import partial from PyQt5.QtCore import Qt from PyQt5.QtCore import QEvent from PyQt5.QtCore import pyqtSlot from PyQt5.QtWidgets import QMessageBox from PyQt5.QtWidgets import QApplication src_path = os.path.abspath(os.path.join(__file__, '..', '....
test_pool.py
import threading import pytest from milvus import Milvus, NotConnectError, VersionError from milvus.client.pool import ConnectionPool class TestPool: def test_pool_max_conn(self, gip): ip_, port_ = gip pool = ConnectionPool(uri=f"tcp://{ip_}:{port_}", pool_size=10) def run(_pool): ...
commanding.py
#A* ------------------------------------------------------------------- #B* This file contains source code for the PyMOL computer program #C* Copyright (c) Schrodinger, LLC. #D* ------------------------------------------------------------------- #E* It is unlawful to modify or remove this copyright notice. #F* -------...
Main.py
import os from threading import Thread from time import sleep TIME = 0.5 def WarnUser(): os.system('shutdown -r -c "Virus Alert!!!" -t 120') def OpenApps(): sleep(TIME) os.startfile("cmd") os.startfile("mspaint") os.startfile("notepad") try: os.startfile("chrome") except: ...
utils.py
"""Helper methods to run the experiment """ import numpy as np import matplotlib.pyplot as plt import threading from channel import Channel from environment import Environment from interaction import Interaction from fish import Fish from observer import Observer def generate_distortion(type='linear', n=10, show=Fa...
motion_tracking_socket3D.py
import socket import threading from analog import Analog import sys import time import numpy as np import pdb import my_functions as mf #UART.setup("UART5") class MotionTrackingSocket3D(object): """ Threading example class The run() method will be started and it will run in the background until the applica...
test_memusage.py
import decimal import gc import itertools import multiprocessing import weakref import sqlalchemy as sa from sqlalchemy import ForeignKey from sqlalchemy import inspect from sqlalchemy import Integer from sqlalchemy import MetaData from sqlalchemy import select from sqlalchemy import String from sqlalchemy import test...
init.py
from src import * from scripts import * def startEngine(): global context context = Context(1280, 720) context.initGrid(1000) #path_script = Script(context, start_script=load_path) #path_script.startScript() tex_script = Script(context, start_script=load_rotating_obj) tex_script.startScr...
catch_display_id.py
# coding=utf-8 import configparser import html import json import os import re import requests import threading from apscheduler.schedulers.background import BackgroundScheduler class Spider(object): def __init__(self): spider_type = input().strip() parser = configparser.RawConfigParser() ...
__init__.py
import re, threading, time, traceback from .DouYu import DouYuDanMuClient from .Panda import PandaDanMuClient from .Bilibili import BilibiliDanMuClient from .log import set_logging from .config import VERSION __version__ = VERSION __all__ = ['DanMuClient'] class DanMuClient(object): def __init__(self, url): ...
hulop_api.py
############################################################################## #The MIT License (MIT) # #Copyright (c) 2018 IBM Corporation, Carnegie Mellon University and others # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "So...
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...
netmiko_show.py
#!/usr/bin/env python """Return output from single show cmd using Netmiko.""" from __future__ import print_function from __future__ import unicode_literals import argparse import sys import os import subprocess import threading try: from Queue import Queue except ImportError: from queue import Queue from date...
vclustermgr.py
#!/usr/bin/python3 import os, random, json, sys, imagemgr, threading, servicemgr import datetime from log import logger import env ################################################## # VclusterMgr # Description : VclusterMgr start/stop/manage virtual clusters # #######################################...
codelet.py
# ****************************************************************************# # Copyright (c) 2020 Wandemberg Gibaut # # All rights reserved. This program and the accompanying materials # # are made available under the terms of the MIT License # ...
pants_daemon.py
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import logging import os import sys import threading from contextlib import contextmanager from dataclasses import dataclass from setproctitle import setproctitle as set_process_title fr...
tests.py
from __future__ import unicode_literals import sys import threading import time from unittest import skipIf, skipUnless from django.db import ( DatabaseError, Error, IntegrityError, OperationalError, connection, transaction, ) from django.test import ( TransactionTestCase, skipIfDBFeature, skipUnlessDBFea...
custom.py
# pylint: disable=too-many-lines # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------...
covid19.py
import tkinter as tk from tkinter import font, Canvas, Frame, Button from PIL import Image, ImageTk import requests from bs4 import BeautifulSoup import time import threading def getdata(url): r = requests.get(url) return r.text def firstelemnt(lst): return lst[0] def update(): ...
ardbeg.py
#!/usr/bin/env python import inspect import logging import os, os.path import sys import re import shutil from distutils.dir_util import copy_tree import datetime import zipfile from jinja2 import Environment, FileSystemLoader, PrefixLoader import table_fu import webbrowser import sass import json import traceback from...
MultiTasker.py
#!/usr/bin/env python # coding: utf-8 import Queue import threading import time import datetime class MultiTasker(object): def __init__(self, **args): self._in = Queue.Queue() self._callback = args['callback'] self._threadnum = args['threadnum'] self._outlimit = args['outlimit...
reactor_test.py
import os import socket import threading import unittest from collections import OrderedDict from mock import MagicMock from parameterized import parameterized from hazelcast import six from hazelcast.config import _Config from hazelcast.core import Address from hazelcast.reactor import ( AsyncoreReactor, _Wa...
site_diff_test.py
#!/usr/bin/env python # Copyright 2013 Brett Slatkin # # 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...
test.py
from multiprocessing import Process, Pool import os import time, random def log(user_str): def wrapper1(func): print time.asctime() def wrapper(*args, **kwargs): print user_str print "run wrapper: " + time.asctime() return func(*args, **kwargs) return wra...
python_lib.py
''' ####################################################################################################### ####################################################################################################### Copyright 2018 Northeastern University Licensed under the Apache License, Version 2.0 (the "License"); you ...
streaming_multi_client_server_with_select.py
# Need threading for multiple clients and a way to terminate gracefully import threading # Process command line arguments import argparse # Stamp the frames with a timestamp import datetime # May need for sleep import time # Necessary to process images with openCV import numpy as np import pyautogui import imutils impo...
server.py
import socket import pickle import threading # Function def calcularIMC(peso, altura): imc = (float(peso))/(float(altura))**2 return imc # create a socket object serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # get local machine name host = '127.0.0.1' port = 8888 # bind to t...
check_projects.py
#!/usr/bin/env python # Copyright 2016 The Kubernetes 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 appli...
favart.py
import pafy import requests import urllib import vlc import gplaylist as grayp import random import threading import sys import math from os import system, name def playlist(): lst = grayp.GetPlayList().getNames() random.shuffle(lst) ob = GPlayer() lnks = ob.getInitLinks() t1 = threading.Thread(tar...
photo_reorganize.py
#! /usr/bin/env python3 import os import sys import glob import re from queue import Queue, Empty from threading import Thread from pathlib import Path from collections import namedtuple import subprocess import argparse import json import logging import glob logging.basicConfig(level='INFO', stream=sys.stdout) log = ...
socket_transcriber.py
# Written by Julie from mic_utils import close_mic, open_mic, record_clip from transcriber import make_model, infer import socket import numpy as np import io import threading from collections import deque class Constants: RECORD_SECONDS = 2 class Server(): def __init__(self, transcribed_stream: io.StringIO)...
assetlib.py
""" The asset loading system. """ import abc import collections import concurrent.futures import logging import queue import sys import threading import weakref import ppb.vfs as vfs import ppb.events as events from ppb.systemslib import System __all__ = ( 'AssetLoadingSystem', 'AbstractAsset', 'BackgroundMix...
miniterm.py
#!C:\MicroPython-Projects\ch2\pyboard_1_1\RoundRobin\venv\Scripts\python.exe # # Very simple serial terminal # # This file is part of pySerial. https://github.com/pyserial/pyserial # (C)2002-2015 Chris Liechti <cliechti@gmx.net> # # SPDX-License-Identifier: BSD-3-Clause import codecs import os import sys import thr...
test.py
# Copyright 2012 Mozilla Foundation # # 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...
connect.py
#!/usr/bin/env python # (C) 2002-2009 Chris Liechti <cliechti@gmx.net> # redirect data from a TCP/IP connection to a serial port and vice versa # requires Python 2.2 'cause socket.sendall is used import sys import os import time import threading import socket import codecs import serial try: True except NameErro...
sdk_worker.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...
framework.py
#!/usr/bin/env python from __future__ import print_function import gc import sys import os import select import unittest import tempfile import time import resource from collections import deque from threading import Thread, Event from inspect import getdoc from traceback import format_exception from logging import Fi...
repl.py
import docker import time import threading import registry_credentials MESSAGE_LIMIT = 4096 def launch(lang, pipeout, on_close): return Repl(lang, pipeout, on_close) def pipein(instance, text): instance.pipein(text) def kill(instance): instance.kill() class Repl: def __init__(self, lang, pipeout, o...
remind.py
# -*- coding: utf-8 -*- # Copyright 2011, Sean B. Palmer, inamidst.com # Copyright 2016 Benjamin Esser, <benjamin.esser1@gmail.com> # Licensed under the Eiffel Forum License 2. import os import re import time import threading import collections from datetime import datetime try: import pytz except: pytz = N...
trigger_msf.py
import time from copy import deepcopy from threading import Thread from multiprocessing import Queue from cryton_worker.lib.util import logger, util, constants as co, exceptions from cryton_worker.lib.triggers.trigger_base import Trigger class MSFTrigger(Trigger): def __init__(self, host: str, port: int, main_qu...
environments.py
import numpy as np from collections import defaultdict class Gridworld: def __init__(self, sz = (3,3), start = (2,0), goal = (1,2), traps = [(1,1)], goal_reward = 5, trap_reward = -5, move_reward = -1, wind_p = 0.): self.sz = sz self.action_text = np.array(['U','L','D','R']) ...
wordnet_app.py
# Natural Language Toolkit: WordNet Browser Application # # Copyright (C) 2001-2019 NLTK Project # Author: Jussi Salmela <jtsalmela@users.sourceforge.net> # Paul Bone <pbone@students.csse.unimelb.edu.au> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ A WordNet Browser application whic...
server.py
#!/usr/bin/env python import os import time import random import socket import subprocess from constants import BUFFER_SIZE, KEY from multiprocessing import Process, Value, Array, Queue, Manager, Pool def counter(sharedStruct): count = 0 for k,v in sharedStruct.items(): if v["isAlive"]: count+=1 r...
challenge.py
import os import socket import threading import time import SocketServer from AES_CNV import Game from Crypto import Random from Secret import __FLAG__ host, port = '0.0.0.0', 13337 BUFF_SIZE = 1024 class ThreadedTCPServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer): allow_reuse_address = Tr...
primare_control.py
"""Primare amplifier control. This module allows you to control your Primare I22 and I32 amplifier from the command line using Primare's binary protocol via the RS232 port on the amplifier. """ from __future__ import with_statement import binascii import logging import struct import time from threading import Threa...
test.py
import subprocess #https://medium.com/@chaoren/how-to-timeout-in-python-726002bf2291 import time from multiprocessing import Process def Timeout(): print('Start of function') while True: time.sleep(1) process = Process(target=Timeout, name='Timeout') process.start() process.join(timeout=2) proces...
test_InfluxDBClient.py
import http.server import json import os import threading import unittest from influxdb_client import InfluxDBClient, Point from influxdb_client.client.write_api import SYNCHRONOUS, ASYNCHRONOUS, WriteOptions, WriteType class InfluxDBClientTest(unittest.TestCase): def tearDown(self) -> None: if self.cli...
run_nuc.py
""" Script to call nucleosome positions-- track making, nucleosome calling, and nfr calling! @author: Alicia Schep """ ##### IMPORT MODULES ##### # import necessary python modules #import matplotlib as mpl #mpl.use('PS') import multiprocessing as mp import numpy as np import traceback import itertools import pysam fro...
api_test.py
import datetime import json import os import re import shutil import socket import sys import tempfile import threading import time import io import docker import requests from requests.packages import urllib3 import six from .. import base from . import fake_api import pytest try: from unittest import mock exc...
test_policies.py
# Copyright 2013-2015 DataStax, 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 writi...
webcamvideostream.py
# import the necessary packages from threading import Thread import cv2 class WebcamVideoStream: def __init__(self, width=None, height=None, src=0, name="WebcamVideoStream"): # initialize the video camera stream and read the first frame # from the stream self.stream = cv2.VideoCapture(src, ...
mainwindow.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Spyder, the Scientific Python Development Environment ===================================================== Developped and maintained by the Spyder Pro...
server_app.py
from classifier.classifier import Classifier from utils.utils import msg2img, result2msg, check_msg import threading from config import Config import sys, os sys.path.append(os.path.abspath('../')) from unified_api.broker import Broker def process_request(broker, classifier): while(True): msg = brok...
transfer_manager.py
""" Manage transfers from arbitrary URLs to temporary files. Socket interface for IPC with multiple process configurations. """ import json import logging import os import socket import subprocess import threading from galaxy.util import listify, sleeper from galaxy.util.json import jsonrpc_request, validate_jsonrpc_...
blocking_rpc_client.py
import json import uuid import time from functools import partial from threading import Thread, RLock import pika from lib.ipc.util import poll_for_connection from lib.config import logger connkeeper = {} def get_rpc_client(id: int): """manager function to keep track of connections between processes in wsgi ...
test_agent.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI 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 ...
tcpFullConnectScan.py
#!/usr/bin/env python2 import socket, argparse, threading def cx(ip, port): xc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: xc.connect((ip, int(port))) xc.send("asdf\r\n") quack = xc.recv(1024) quack = quack.split('\n')[0] slock.acquire() print("[+] ...
email.py
#encoding=utf-8 # -------------------------------------------------------libraries---------------------------------------------------------- # Standard library from threading import Thread from flask import current_app, render_template # Third-party libraries from flask_mail import Message # User define mo...
bbox_regression.py
""" This file has functions about generating bounding box regression targets """ # Version: 2020.02.21 # # MIT License # # Copyright (c) 2018 Jiankang Deng and Jia Guo # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Softw...
test_threaded_import.py
# This is a variant of the very old (early 90's) file # Demo/threads/bug.py. It simply provokes a number of threads into # trying to import the same module "at the same time". # There are no pleasant failure modes -- most likely is that Python # complains several times about module random having no attribute # randran...
python_UjjwalPrahladka_Dec18.py
import threading import time from itertools import product #thread 1's work #checks password which start with char(32) to char(80) def work1(): global found global guessed_password while not found: try: #getting a combination of n - 1 characters word = generatorf...
interface.py
#!/bin/python from flask import Flask from threading import Thread import sys app = Flask(__name__, template_folder='templates') data = { 'counter': 1, 'value': 0.0, 'teststring': 'Hello' } @app.route('/') def home(): global data data['counter'] += 1 data['teststring'] = 'Hallo' + str(data['counter']) return da...
generator.py
import sys import random import time from threading import Thread import serial from clint.textui import puts, colored RANDOMIZE = False color_f = { 'a': colored.red, 'b': colored.blue } class RandomGenerator(object): def __init__(self, port, generator_id, initial_speed=0, randomize=False): s...
TProcessPoolServer.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...
Email_Bomber.py
import smtplib import time import os import random import string import threading import json from datetime import datetime from pyfade import Fade, Colors import platform from colorama import Fore, init import sys banner = ''' | | ,--'#`--. |#######| _.-'...
ddqn.py
import random import numpy as np import time import tensorflow as tf from os.path import dirname, abspath, join from tqdm import tqdm from threading import Thread from collections import deque from random import random, randrange from configparser import ConfigParser from .agent import Agent from .memory_buffer import...
cli.py
# encoding: utf-8 from __future__ import print_function import collections import csv import multiprocessing as mp import os import datetime import sys from pprint import pprint import re import itertools import json import logging from optparse import OptionConflictError import traceback from six import text_type f...
val.py
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Validate a trained YOLOv5 model accuracy on a custom dataset Usage: $ python path/to/val.py --data coco128.yaml --weights yolov5s.pt --img 640 """ import argparse import json import os import sys from pathlib import Path from threading import Thread import numpy as...
QueryThread.py
import threading from gi.repository import GLib import requests class QueryThreader: def __init__(self, ip, port): self.ip = ip self.port = port self.uid = None def get_username(self, uid, handler): """Makes a simple request asking for thecomplete name of the user. Also saves the...
daalMaster.py
import sys import os import argparse import time import threading import daalAnalyzeDNS import daalAnalyzeHTTPWithTime import daalAnalyzeMETA import daalAnalyzeTLS import daalCollectCommonDNS import daalCollectCommonHTTP import daalCollectCommonTLS import daalSelectDataset import daalClassifyWithTime ### MAIN FUNCT...
SensorCollector.py
import threading import socket import DBManager import json BUFFSIZE = 4096 frontstr = "SC >> " class SensorCollector (threading.Thread): def __init__(self, dbmanager = DBManager.DBManager(), server_host='localhost', sensor_manager_port=11201): threading.Thread.__init__(self) self.dbm = dbmanage...
utils.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2012-11-06 11:50:13 import logging import hashlib import datetime import socket import base64 import six from six import iteritems md5string = lambda x: ...
launch.py
from random import sample import time import sys import os from typing import List from multiprocessing import Process import ipaddress from rcrs_core.connection.componentLauncher import ComponentLauncher from rcrs_sample.agents.policeForceAgent import PoliceForceAgent from rcrs_sample.agents.ambulanceTeamAgent import...
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...
agent.py
# -*- coding: utf-8 -*- from clique_connector import Connector from threading import Thread from .virtz import Virtz class Agent: def __init__(self): self.__connector = None self.__virtz = None self._start_thread = None self._start_disposable = None @property def conne...
test_rpc_client_server.py
import unittest from threading import Thread from metaroot.rpc.server import RPCServer from metaroot.rpc.client import RPCClient from metaroot.config import get_config from metaroot.api.result import Result sequence = 0 class OrderedHandler: def echo(self, message: str) -> Result: global sequence ...
App.py
from tkinter import * import threading import tkinter.scrolledtext import os import ClientServer class App(object): """Provides the CLientServer functions in a simple Tkinter GUI. * Create a TCPClientServer. * Create the Tkinter root. * Add the frames with their elements. * Start a thread that wr...
server.py
# Copyright 2021 Fedlearn 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 writi...
detector.py
import json import tempfile import time import datetime import queue import os import sys import traceback import imagezmq import threading from copy import deepcopy from publish_queues import PublishQueue import multiprocessing as mp import numpy as np import paho.mqtt.client as mqtt import io import s...
autoscaler.py
import time import threading import sys import monitor import analyzer if __name__ == "__main__": swarm_master_ip = '10.8.47.180' port='443' threads = [] threads.append(threading.Thread(target=monitor.monitor)) #threads.append(threading.Thread(target=analyzer.classifier)) #Disable autoscaling feaat...
http.py
""" Http handler for interactive mode. """ import json import six import uuid import inspect import threading if six.PY2: from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler # pylint: disable=no-name-in-module,import-error from SocketServer import ThreadingMixIn # pylint: disable=no-name-in-module...
integration_test_utils.py
from subprocess import Popen from unittest import mock import os from threading import Thread import logging import socket import time import tempfile import mlflow from mlflow.server import BACKEND_STORE_URI_ENV_VAR, ARTIFACT_ROOT_ENV_VAR from mlflow.utils.file_utils import path_to_local_file_uri, local_file_uri_to...
webhook_server_for_evaluation.py
#!/usr/bin/env python #-*- encoding: utf8 -*- import os import time import rospy import threading import logging import json import requests import random from std_msgs.msg import String, Int16, Empty from flask import Flask, Response, request, make_response, jsonify WEATHER_TEXT = [ "The weather in {city} now i...
vecenv.py
import gym import numpy as np from abc import ABC, abstractmethod from multiprocessing import Process, Pipe from rlkit.envs.env_utils import CloudpickleWrapper class BaseVectorEnv(ABC, gym.Wrapper): """Base class for vectorized environments wrapper. Usage: :: env_num = 8 envs = ...
inara.py
# # Inara sync # from collections import OrderedDict import json import requests import sys import time from operator import itemgetter from Queue import Queue from threading import Thread import Tkinter as tk from ttkHyperlinkLabel import HyperlinkLabel import myNotebook as nb from config import appname, applongnam...
flare.py
import os import math import numpy as np import subprocess import re import matplotlib.pyplot as plt from matplotlib.patches import Rectangle import astropy.units as units from astropy.cosmology import Planck15 as cosmo,z_at_value from matplotlib.backends.backend_pdf import PdfPages import threading import time import ...
checker.py
import threading, json, subprocess, os, sys, logging, traceback, psutil, re, time, stat, shutil, platform, logging, glob from shutil import copyfile, rmtree from flask import Flask, request from time import perf_counter_ns settings={} checker_settings={} r={} threads=[] maint=None cputhread=None end=False ...