source
stringlengths
3
86
python
stringlengths
75
1.04M
interaction.py
# coding: utf-8 # Originally from # https://github.com/PPartisan/THE_LONG_DARK # Simply adapted to LINUX by Bernardo Alves Furtado import threading import time import psutil from pylab import rcParams from pynput.keyboard import Key, Controller import mapping rcParams['figure.figsize'] = 12, 9.5 def is_tld_runn...
RMTRMS.py
import sqlite3 from sqlite3 import Error as sqliteError import bottle import threading import triad_openvr from openvr import OpenVRError class SteamVRNotFoundError(Exception): """ Raised when SteamVR is not installed""" pass class Tracker: def __init__(self, vr=None, db=None, trackerID=None, serial=No...
recipe-580721.py
# Author: Miguel Martinez Lopez # # This code require rpyc. # You can install rpyc typing: # pip install rpyc # # Run this code and in an another interactive interpreter write this: # >>> import rpyc # ... c = rpyc.classic.connect("localhost") # >>> c.execute("from Tkinter import Label; label=Label(app, text='a lab...
StrainTensor.py
#! /usr/bin/python #-*- coding: utf-8 -*- from __future__ import print_function import sys import os import time from datetime import datetime from copy import deepcopy from math import degrees, radians, floor, ceil import numpy from scipy.spatial import Delaunay import argparse from pystrain.strain import * from pyst...
agent_test.py
"""This file is provided as a starting template for writing your own unit tests to run and debug your minimax and alphabeta agents locally. The test cases used by the project assistant are not public. """ import random import unittest import timeit import sys import isolation import game_agent from collections im...
monitor.py
# curio/monitor.py # # Debugging monitor for curio. To enable the monitor, create a kernel # and then attach a monitor to it, like this: # # k = Kernel() # mon = Monitor(k) # k.run(mon.start()) # # If using the run() function, you can do this: # # run(coro, with_monitor=True) # # run() also looks for the CU...
Callbacks_Refactored.py
''' Created on Aug 22, 2015 @author: Burkhard ''' #====================== # imports #====================== import tkinter as tk from time import sleep from threading import Thread from pytz import all_timezones, timezone from datetime import datetime class Callbacks(): def __init__(self, oop): ...
httpexpect.py
# Copyright (c) 2019 Vitaliy Zakaznikov # # 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 i...
listener.py
import asyncio import threading import signal import traceback from gd.level import Level from gd.logging import get_logger from gd.typing import Client, Comment, FriendRequest, Iterable, List, Message, Optional, Union from gd.utils import tasks from gd.utils.async_utils import shutdown_loop, gather from gd.utils.dec...
util.py
# Electrum - lightweight Bitcoin client # Copyright (C) 2011 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights t...
test_kafka.py
# Copyright 2018 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 applic...
test_io.py
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnewlines - ...
server.py
from pathlib import Path from zipfile import ZipFile from util import unfuck_pythonw import sys import os import logging import bottle import json import gevent import gevent.queue import gevent.pywsgi import gevent.threadpool import multiprocessing from geventwebsocket import WebSocketError import gevent...
mbase.py
""" mbase module This module contains the base model class from which all of the other models inherit from. """ from __future__ import print_function import abc import sys import os import shutil import threading import warnings import queue as Queue from datetime import datetime from shutil import which from su...
callbacks.py
# -*- coding: utf8 -*- ### # Copyright (c) 2002-2005, Jeremiah Fincher # Copyright (c) 2014, James McCoy # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must...
multiprocess.py
import time import multiprocessing from multiprocessing import Process, Queue, Manager CPU_NUM = multiprocessing.cpu_count() class Task(): def __init__(self, i): self.num = i def work(self, i): while True: time.sleep(2) print('working: ', i) def start(self): ...
IndexFiles.py
#!/usr/bin/env python INDEX_DIR = "IndexFiles.index" import sys, os, lucene, threading, time, re from datetime import datetime from java.io import File from org.apache.lucene.analysis.miscellaneous import LimitTokenCountAnalyzer from org.apache.lucene.analysis.standard import StandardAnalyzer from org.apache.lucene....
MineSweeperServer.py
import socket import threading import time import random import operator Players=[] stop = False timer = 1 playerNum = 0 score = 0 playerScores = {} echo_queue = [] minecoord = [] neighborCoord = [] status = '' neighbor = [] checkcoord = [] NeighborMines = [] up_right, up_left, up, left, right, down...
drainratetests.py
from threading import Thread import unittest import time from TestInput import TestInputSingleton import logger import datetime from membase.api.rest_client import RestConnection, RestHelper from membase.helper.bucket_helper import BucketOperationHelper from membase.helper.rebalance_helper import RebalanceHelper from m...
vdtui.py
#!/usr/bin/env python3 # # Copyright 2017 Saul Pwanson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, m...
kurisu_functions.py
#!/usr/bin/python3 from functions.exchange_rate import keywords_start as exchange_start from functions.exchange_rate import keywords_response as exchange_res from functions.exchange_rate import dialog as exchange_dialog from functions.sound import keywords_start as sound_start from functions.sound import keywords_res...
multiclient.py
# ---------------------------------------------------------------------- # Copyright (c) 2011-2016 Raytheon BBN Technologies # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without restriction, including...
tool.py
#!/usr/bin/env python ## # 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 #...
__init__.py
############################################################################### # DO NOT MODIFY THIS FILE # ############################################################################### import inspect import logging import sys import textwrap import time from coll...
gpu_ctl.py
#!/usr/bin/env python3 import os import sys import time import re import syslog import argparse import subprocess as sb from threading import Thread import pynvml as nv from gpuctl import logger from gpuctl import PciDev, GpuAMD, GpuNV from gpuctl import FileVarMixn as fv from gpuctl import ShellCmdMixin as sc __all...
xmpp.py
import ctypes import importlib import multiprocessing import queue import time import twilio.base.values import twilio.rest import slixmpp import vbx import vbx.util class XMPPComponent: class SlixmppComponent(slixmpp.ComponentXMPP): def __init__(self, jid, secret, server, port, target, twilio_queue, t...
p_bfgs.py
# This code is part of Qiskit. # # (C) Copyright IBM 2018, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
spawn.py
# Copyright 2019 DeepMind Technologies Ltd. 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 appl...
dothat_driver.py
#!/usr/bin/env python """ Display-o-Tron hat driver using threading to drive the lights and text on different update frequencies. Text data from InterfaceData.py. Adapted from the example code at https://github.com/pimoroni/dot3k This version incorporates python threading to run both the lights update loop and the ...
Jira-Lens.py
import sys import progressbar import json import requests import socket import threading import os import time from urllib.parse import urlparse from config import * import argparse def clean_url(url): while url.endswith("/"): url=url[0:-1] return url def det...
utils_test.py
# Copyright 2016 Google 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 writing, ...
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. # -----------------------------------...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
__main__.py
from threading import Thread import sched, time from .config import get_config from .util import error from .fetcher import fetch_attachements from .uploader import upload from .ocr import ocr_attachments s = sched.scheduler(time.time, time.sleep) def main(): try: conf = get_config() print("Config...
test_selenium.py
import re import time import threading import unittest from selenium import webdriver from app import create_app, db from app.models import Role, User, Post class SeleniuTestCase(unittest.TestCase): client = None @classmethod def setUpClass(cls): #launch Firefox try: cls.client = webdriver.Chrome() except...
emvirtual.py
#!/usr/bin/python import json import logging import sys import time from subsystems.emgps import emGps from subsystems.emimu import emImu from subsystems.emsensors import emSensors from subsystems.emtelemetry import emTelemetry from random_words import LoremIpsum from threading import Thread class emVirtual(object)...
shared_array_test.py
import multiprocessing as mp import numpy as np import ctypes def work(pid): if pid==5: s_array[0] = 5 array[0] = 5 # rawarray to nparray via np.asarray def raw2np(raw): class Empty: pass array = Empty() array.__array_interface__ = { 'data': (raw._wrapper.get_address(), False...
settings_20210906111953.py
""" Django settings for First_Wish project. Generated by 'django-admin startproject' using Django 3.2. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from pathli...
dispatch.py
import threading import Queue import traceback def request_results(func, args=(), kwargs={}): # prepare request results = Queue.Queue() func_args = (args, kwargs) instruct = func, func_args, results # ask the thread worker = threading.Thread(target=_compute_results_, args=instruct) worker...
main.py
import curses import queue import string import subprocess import threading import time from datetime import datetime state = {} threads = [] result_pipeline = queue.Queue() instr_pipeline = queue.Queue() def execute_zowe_workload(): """ This function is carried out in a separate thread as the zowe calls ta...
test_docxmlrpc.py
from xmlrpc.server import DocXMLRPCServer import http.client import sys import threading import unittest def make_request_and_skipIf(condition, reason): # If we skip the test, we have to make a request because # the server created in setUp blocks expecting one to come in. if not condition: return l...
test_examples.py
# The MIT License (MIT) # # Copyright (c) 2014-2017 Susam Pal # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, mo...
background_client.py
import argparse import base64 import concurrent.futures import json from multiprocessing import Process import numpy as np import os import queue import random import requests import socket import struct from threading import Thread import time from clipper_admin.docker.common import * img_data = [] ip_addr = None q ...
client.py
import socket import threading import util import main host, port = '127.0.0.1', 10000 global players players = None global owned_player owned_player = None global sock sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((host, port)) def mainloop(): while True: data = sock.recv(1024)...
thread_01.py
import threading def first_fun(age): while True: print('I am first child.', age) pass return def second_fun(age): while True: print('I am second child.', age) pass return if __name__== "__main__": first = threading.Thread(target=first_fun , args = (5,)) second = threadin...
run_pinc.py
from serial_host import packet_definitions as pkt from serial_host import cold_start, read, write from kinematics import corexy_inverse, corexy_transform, z0, z1, z2, center_home from marker_tracking import get_laser_displacement, run_tracking_loop, get_error, end_tracking_loop, enable_fiducial_sensing, enable_laser_se...
__init__.py
##################################################################### # # # /__init__.py # # # # Copyright 2013, Monash University ...
handler.py
# Copyright (C) 2015 Swift Navigation Inc. # Contact: https://support.swiftnav.com # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights reserved. # # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, # ...
ftrack_api_explorer.py
import os import requests import time import traceback import uuid from collections import defaultdict from functools import wraps from getpass import getuser from threading import Thread import ftrack_api from Qt import QtCore, QtGui, QtWidgets from vfxwindow import VFXWindow _ID_REMAP = {} def remapID(entityID):...
consumer.py
import datetime import logging import os import signal import sys import threading import time from multiprocessing import Event as ProcessEvent from multiprocessing import Process try: import gevent from gevent import Greenlet from gevent.event import Event as GreenEvent except ImportError: Greenlet ...
thirdparallel_powermeismatrix_general.py
### aqui será mostrado como faremos o programa que trata de construir matrizes de uma forma geral, dada as geometrias de empilhamento que foram estudadas!!! # -*- coding: utf-8 -*- import numpy import threading import math import multiprocessing from numpy import matrix,sqrt from multiprocessing.pool import ThreadPo...
test_concurrent_query.py
import os import sys import threading from RLTest import Env from redisgraph import Graph, Node, Edge from redis import ResponseError from base import FlowTestsBase GRAPH_ID = "G" # Graph identifier. CLIENT_COUNT = 16 # Number of concurrent connections. graphs = None ...
tempobj.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2017 Alibaba Group Holding Ltd. # # 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-...
jsview_3d.py
from __future__ import absolute_import, division, print_function from libtbx.math_utils import roundoff import traceback from cctbx.miller import display2 as display from cctbx.array_family import flex from cctbx import miller from scitbx import graphics_utils from scitbx import matrix import scitbx.math from libtbx.u...
network_analyzer.py
from scapy.all import * import matplotlib.pyplot as plt from binascii import hexlify from threading import Thread from datetime import datetime import time class Network_Analyzer: def __init__(self, time, segment_len): self.time = time self.segment_len = segment_len self.bws = [] s...
capture.py
# coding: utf-8 """ Capture and manipulate traffic off the network. This module provides a Sniffer class and a few "modules" which can be assembled to form attack tools. These classes are based on Scapy and provide a convenient way to interact with and compose tools from it's functionality. The advanced functions suc...
multithread.py
from threading import Thread from time import sleep from cyberpass import login import cStringIO,StringIO, re import urllib2, os, urllib import os import pycurl import time def jo(): thread1.join() thread2.join() thread3.join() thread4.join() thread5.join() thread6.join() def download(ip,url,filename,ranges,ra...
myhome.py
# coding: utf-8 import uvicorn import os, subprocess, shlex, asyncio, json from dotenv import load_dotenv from src.aquestalk_util import romajiToKana import threading from fastapi import FastAPI from starlette.requests import Request import requests from pydantic import BaseModel from fastapi.encoders import jsonable_...
roomba.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Python 2.7/Python 3.5/3.6 (thanks to pschmitt for adding Python 3 compatibility) Program to connect to Roomba 980 vacuum cleaner, dcode json, and forward to mqtt server Nick Waterton 24th April 2017: V 1.0: Initial Release Nick Waterton 4th July 2017 V 1.1.1: Fixed...
FindGameBasicInfo.py
# -*- coding: utf-8 -*- import cv2 from cv2 import cv import numpy as np from matplotlib import pyplot as plt from Tools import * import win32gui from PIL import ImageGrab from PIL import Image import win32con,win32api import pythoncom, pyHook import time from DD import DD import threading import multiprocessing from ...
test_app.py
import json import random import threading import tornado.websocket import tornado.gen from tornado.testing import AsyncHTTPTestCase from tornado.httpclient import HTTPError from tornado.options import options from tests.sshserver import run_ssh_server, banner from tests.utils import encode_multipart_formdata, read_fi...
__init__.py
from __future__ import annotations import collections from datetime import datetime from decimal import Decimal from functools import wraps import operator import os import re import string from typing import ( TYPE_CHECKING, Callable, ContextManager, Counter, Iterable, ) import warnings import nu...
threaded_crawler.py
import time import threading import urllib.parse from downloader import Downloader from mongo_queue import MongoQueue SLEEP_TIME = 1 USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36' def threaded_crawler(seed_url, delay=5, cache=...
workdlg.py
from logging import getLogger import os import queue import signal import subprocess import threading import time import tkinter as tk from tkinter import ttk, messagebox from typing import Optional from thonny import tktextext from thonny.languages import tr from thonny.misc_utils import running_on_windows from thonn...
compare.py
import argparse import re import cld2full as cld from collections import OrderedDict import xml.etree.cElementTree as cet import time import nltk html_entities = eval(open("html-entities.lst", "r").read()) def read_document(f, documents): doc = "" url = "" while True: line = f.readline() i...
udp_shotgun.py
""" mbed SDK Copyright (c) 2011-2013 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...
test_sys.py
# -*- coding: iso-8859-1 -*- import unittest, test.test_support import sys, cStringIO, os import struct try: import _llvm except ImportError: WITH_LLVM = False else: WITH_LLVM = True del _llvm class SysModuleTest(unittest.TestCase): def test_original_displayhook(self): import __builtin__ ...
keyboardRunCar.py
import time import RPi.GPIO as GPIO import sys from pynput import keyboard import csv ##from termios import tcflush, TCIOFLUSH, TCIFLUSH from multiprocessing import Process from datetime import datetime GPIO.cleanup() Forward = 17 Backward = 27 Left = 23 Right = 24 sleeptime = 0.25 speed = 0.5 mode=GPIO.getmode() G...
MovieInfo.py
#coding: utf-8 import threading from startThreads import ThreadMain from Config import maxThread from Downloader import DownloadMoviesInfo def moviesInfo(URLS): threads = [] # 多线程,爬取电影信息 while threads or URLS: for thread in threads: if not thread.is_alive(): ...
tool.py
#!/usr/bin/env python3 # -*- mode: python -*- # -*- 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 ...
molly.py
from queue import Queue from threading import Thread, Event import click import os import time import sys import socket from .utils import is_ip_v4 from .constants import FIRST_1000_PORTS, ALL_PORTS, TOP_20_PORTS, VERSION class Molly(): def __init__(self, target, mode, workers): self.hostname = target ...
game.py
from random import * import common as var import blocks as bs from graphics import * import threading from sound import * def movePlayer(win, key, player, speed): if key == 'Left' and player.getAnchor().getX() > 50: player.move(-speed, 0) if key == 'Right' and player.getAnchor().getX() < 550: p...
web_monitor.py
""" Monitor files and kill mod_wsgi processes if any files change Details here -- http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode#Restarting_Daemon_Processes Added the ability to track directories """ import os import sys import time import signal import threading import atexit import Queue _interval = 1....
monitor.py
# coding:utf-8 # 2018.3.5 from PyQt4.QtGui import * from PyQt4.QtCore import * from pojo import POJO import os import utils import cv2 import socket import numpy as np from configuration import ConfigInjection from threading import Event, Thread import time from caculate_handler import CaculateHandler try: _fromUt...
time.py
#!/usr/bin/env python3 import redis import time import os import argparse import threading from flask_socketio import SocketIO from flask import Flask, render_template, session, request, \ copy_current_request_context args = None r = None th = None app = Flask(__name__) @app.route('/') def index(): host = ...
context-passphrase-callback.py
# Copyright (C) Jean-Paul Calderone # See LICENSE for details. # # Stress tester for thread-related bugs in global_passphrase_callback in # src/ssl/context.c. In 0.7 and earlier, this will somewhat reliably # segfault or abort after a few dozen to a few thousand iterations on an SMP # machine (generally not on a UP ma...
autoTyperGUI.py
#!/bin/python3 import tkinter as tk import tkinter.scrolledtext as scrolledtext from tkinter import messagebox import webbrowser import time import multiprocessing import sys def typing(delay, interval, data): delay = int(delay) time.sleep(delay) import pyautogui pyautogui.FAILSAFE = False pyautogui.write(data,...
synchronization_between_processes.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' # SOURCE: https://docs.python.org/3.6/library/multiprocessing.html#synchronization-between-processes from multiprocessing import Process, Lock import time def f(lock, i): with lock: print('hello world', i) time.sleep(1) ...
startDask.py
import os import argparse import time from dask.distributed import Client import sys, uuid import threading import subprocess import socket import mlflow from notebook.notebookapp import list_running_servers def flush(proc, proc_log): while True: proc_out = proc.stdout.readline() if proc_out == "...
server copy.py
from threading import Thread import serial import time import collections import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib import colors import struct import copy import pandas as pd import numpy as np from scipy import interpolate import mido class serialPlot: def __init_...
PC_Miner.py
#!/usr/bin/env python3 """ Duino-Coin Official PC Miner 3.1 © MIT licensed https://duinocoin.com https://github.com/revoxhere/duino-coin Duino-Coin Team & Community 2019-2022 """ from threading import Semaphore from time import time, sleep, strptime, ctime from hashlib import sha1 from socket import socket ...
test_scan_testdata.py
import unittest import subprocess import os import tempfile import http.server import ssl import threading TESTDATA_REPO = "https://github.com/hannob/snallygaster-testdata" TESTDATA = {"backup_archive": "[backup_archive] https://localhost:4443/backup.zip", "git_dir": "[git_dir] https://localhost:4443/.git...
serialization.py
# Copyright 2020 Huawei Technologies Co., Ltd # # 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...
video.py
#!/usr/bin/env python import cv2 import numpy as np import time from threading import Thread from queue import Queue from datetime import datetime from motion import Detector def putIterationsPerSec(frame, iterations_per_sec): """ Add iterations per second text to lower-left corner of a frame. """ cv2...
mavros_offboard_posctl.py
#!/usr/bin/env python import rospy import math import numpy as np from geometry_msgs.msg import PoseStamped from mavros_msgs.msg import PositionTarget from mavros_function import MavrosFunction from pymavlink import mavutil from std_msgs.msg import Header from threading import Thread class MavrosOffboardPosctl(MavrosF...
random_search.py
""" Random Search implementation """ from hops import util from hops import hdfs as hopshdfs from hops import tensorboard from hops import devices import pydoop.hdfs import threading import six import datetime import os import random run_id = 0 def _launch(sc, map_fun, args_dict, samples, direction='max', local_lo...
inference_interface.py
import logging import multiprocessing as mp import signal import struct import threading from threading import Thread from time import sleep from typing import List, Tuple from .inference_pipeline import InferenceServer # from utils.utils import register_logger logger = logging.getLogger(__name__) # register_logger(...
utils.py
import os import os.path import io import tempfile import json as js import re from itertools import tee from functools import wraps import functools as ft import threading from urllib.parse import urlparse as parse_url from urllib.parse import parse_qs import numpy as np import keyword import uuid from .bitmap impor...
run_cli.py
import multiprocessing from time import sleep from datetime import datetime, time from logging import INFO from vnpy.event import EventEngine from vnpy.trader.setting import SETTINGS from vnpy.trader.engine import MainEngine from vnpy.gateway.ctp import CtpGateway from vnpy.gateway.xtp import XtpGateway from vnpy.app...
ScientoPyGui.py
# !/usr/bin/python3 # The MIT License (MIT) # Copyright (c) 2018 - Universidad del Cauca, Juan Ruiz-Rosero # # 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 wi...
test_cp.py
# -*- coding: utf-8 -*- # Copyright 2013 Google 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 require...
infochan.py
# -*- coding: utf-8 -*- # # Robonomics information channels support node. # from robonomics_lighthouse.msg import Ask, Bid, Result from binascii import hexlify, unhexlify from .pubsub import publish, subscribe from urllib.parse import urlparse from threading import Thread import rospy def bid2dict(b): return { 'm...
mapdl_grpc.py
"""gRPC specific class and methods for the MAPDL gRPC client """ import re from warnings import warn import shutil import threading import weakref import io import time import os import socket from functools import wraps import tempfile import subprocess import grpc import numpy as np from tqdm import tqdm from grpc....
processing_job.py
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
hassio_oauth.py
"""Run small webservice for oath.""" import json import sys from pathlib import Path import threading import time import cherrypy from requests_oauthlib import OAuth2Session from google.oauth2.credentials import Credentials HEADERS = str(""" <link rel="icon" href="/static/favicon.ico?v=1"> <link href="/static/css...
msg_uart_reader.py
#!/usr/bin/env python3 import argparse import serial import time import redis import logging import traceback import threading import queue import sys,os sys.path.append(os.path.abspath(os.path.dirname(__file__))+"/lib") # import message_object from message_object import MessageObject def redis_connection_open(host...
twitter.py
# MIT License # # Copyright (c) 2019 Philip Woldhek # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merg...
slave.py
#! /usr/bin/env python from __future__ import division from __future__ import print_function import os import sys import time import traceback from builtins import object from builtins import range from builtins import str from past.utils import old_div from qs.rpcclient import ServerProxy def short_err_msg(): ...
test_ftplib.py
"""Test script for ftplib module.""" # Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS # environment import ftplib import asyncore import asynchat import socket import StringIO import errno import os try: import ssl except ImportError: ssl = None from unittest import TestCase ...
mainwindow.py
"""The Qt MainWindow for the QtConsole This is a tabbed pseudo-terminal of IPython sessions, with a menu bar for common actions. Authors: * Evan Patterson * Min RK * Erik Tollerud * Fernando Perez * Bussonnier Matthias * Thomas Kluyver * Paul Ivanov """ #------------------------------------------------------------...