source
stringlengths
3
86
python
stringlengths
75
1.04M
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...
run_bot.py
from twitch_irc_bot import TwitchIRCBot from configparser import ConfigParser from twitch_api_bot import TwitchAPIBot from threading import Thread import os import time def main(): config = ConfigParser() # Try to find the config file, if it does not exist, create one. if not os.path.exists(os.path.join...
client.py
import socket import threading def send_message(): try: while True: msg = input() sock.send(bytes(name + ": " + msg, 'utf-8')) if msg == 'bye': sock.close() break except Exception: pass finally: print('End chatting...
app.py
import os import functools import threading import tkinter as tk import tkinter.ttk as ttk from tkinter import filedialog from logging import getLogger from typing import Optional from othello_rl.othello.agent import Agent, PlayerAgent, QLearningAgent, RandomAgent, MinMaxAgent from othello_rl.othello.features import Fe...
utils.py
import traceback from threading import Thread from os import path, makedirs import numbers from deeputil import Dummy DUMMY = Dummy() def log_exception(self, __fn__): ''' Logging traceback in keeprunning methods ''' self.log.exception('error_during_run_Continuing', fn=__fn__.__name__, ...
video.py
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input from tensorflow.keras.models import load_model import numpy as np import cv2 import matplotlib.pyplot as plt import os import threading import maskgame as mg import mask_img as mi from multiprocessing import Process, Pipe global try_game try_game ...
core.py
#!/usr/bin/env python3 """ URLs of note https://www.showroom-live.com/room/is_live?room_id=61879 {"ok": 0} == not live {"ok": 1} == live (may be other keys) !!!! As of 2017-10-23, this url no longer works. ~~~ https://www.showroom-live.com/room/get_live_data?room_id=61747 https://www.showroom-live.com/event/akb48_so...
platform_utils.py
# -*- coding:utf-8 -*- # # Copyright (C) 2016 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
run_it.py
# -*- coding: utf-8 -*- # @Time : 2021/3/6 # @Author : Lart Pang # @GitHub : https://github.com/lartpang import argparse import os.path import subprocess import time from enum import Enum from multiprocessing import Process import pynvml pynvml.nvmlInit() class STATUS(Enum): NORMAL = 0 GPU_BUSY = 1 ...
executor.py
"""HighThroughputExecutor builds on the Swift/T EMEWS architecture to use MPI for fast task distribution """ from concurrent.futures import Future import logging import threading import queue import pickle import os from multiprocessing import Process, Queue from ipyparallel.serialize import pack_apply_message # ,un...
database.py
from functools import wraps import glob import os import sys import threading import uuid try: from redis import Redis from redis.client import pairs_to_dict from redis.client import zset_score_pairs from redis.exceptions import ConnectionError from redis.exceptions import TimeoutError except Impor...
listener.py
# -*- coding: utf-8 -*- import socket import threading import os.path as osp from contextlib import closing from xml.etree import ElementTree try: from http.server import HTTPServer, BaseHTTPRequestHandler except ImportError: # Python 2.x fallback from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandl...
allstar.py
import matplotlib.pyplot as plt import numpy as np from esutil import htm import astropy from astropy.table import Table, Column, vstack from astropy.io import fits, ascii from apogee.utils import bitmask, apselect,gaia, apload from apogee.apred import apstar from apogee.aspcap import aspcap, teff, logg, cal, err, elem...
bundle_manager.py
import copy from collections import defaultdict import datetime import logging import os import random import re import sys import threading import time import traceback from codalab.objects.permission import check_bundles_have_read_permission from codalab.common import NotFoundError, PermissionError from codalab.lib ...
ros_py_plugin_provider.py
# Copyright (c) 2011, Dirk Thomas, TU Darmstadt # 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 retain the above copyright # notice, this list of ...
server2.py
import tornado.websocket import tornado.ioloop import tornado.web import cv2 import numpy as np import time import ctypes import threading import multiprocessing import random import sys from PyQt5 import QtWidgets from PyQt5.QtCore import QThread, pyqtSignal from PyQt5.QtGui import QImage, QPixmap from PyQt5.uic impor...
load_html.py
import webview import threading """ This example demonstrates how to load HTML in a web view window """ def load_html(): webview.load_html('<h1>This is dynamically loaded HTML</h1>') if __name__ == '__main__': t = threading.Thread(target=load_html) t.start() webview.create_window('Load HTML Exampl...
crawl_yt8m_from_csv.py
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in # linear algebra import numpy as np # data processing, CSV file I/O (e.g. pd.read_csv...
vaults.py
import logging import os import re import threading import time from collections import Counter from typing import List from brownie import ZERO_ADDRESS, Contract, chain from eth_utils import encode_hex, event_abi_to_log_topic from joblib import Parallel, delayed from semantic_version.base import Version from yearn im...
dirtree.py
import os, os.path import sys import time import threading import wx from fsmonitor import FSMonitor, FSEvent import fileutil from async import async_call, coroutine, queued_coroutine, managed, Future, CoroutineQueue, CoroutineManager from dialogs import dialogs from dirtree_constants import * from dirtree_filter impo...
DiscordBot.py
import discord from strats.longshort import LongShort from strats.indicatorstrat import IndicatorStrat import threading import asyncio from chartgen.imgGenerator import imgGenerator from discordapi.BotFunctions import BotFunctions,Pipe,create_pipe from discordapi.BotCommands import parse import inspect def is_str(word...
bot.py
import logging import requests import os from telegram.ext import Updater, CommandHandler, MessageHandler, Filters import multiprocessing import asyncio import time import lo # create python file from pyrogram import Client # Enable logging logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s...
bot.py
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext, JobQueue import telegram import logging import time import multiprocessing # token to bot token = 'TOKEN' # id do chat da pessoa que vai receber a mensagem chat_id = 'CHAT' # mensagem a ser enviada msg = "ALERTA!! DESCONHECIDO...
trainer.py
# Lint as: python3 # 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 ...
tasks.py
import tempfile import traceback from collections import OrderedDict from contextlib import contextmanager from pyquery import PyQuery from http.client import CannotSendRequest from urllib.error import URLError import os import os.path import threading import time from datetime import timedelta import urllib.parse im...
dev_test_dex.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: dev_test_dex.py # # Part of ‘UNICORN Binance WebSocket API’ # Project website: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api # Documentation: https://lucit-systems-and-development.github.io/unicorn-binance-websocket-api # PyPI: ht...
auto.py
import multiprocessing from selenium import webdriver from server.simpleWebServer import runserver def rs(): runserver() if __name__ == "__main__": paipu = input("paipu:") p = multiprocessing.Process(target=rs) p.start() options = webdriver.ChromeOptions() options.add_argument("user-data-d...
inject_prog.py
#! /usr/bin/env python3 import os import sys import shutil import yaml import subprocess import time from threading import Thread try: from Queue import Queue, Empty except ImportError: from queue import Queue, Empty # python 3.x ON_POSIX = 'posix' in sys.builtin_module_names instrument_script = "" profile_scrip...
6_multithreaded.py
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import time import threading import torch from polymetis import RobotInterface from utils import check_episode_log def connect_and_send_pol...
test_pdb.py
# A test suite for pdb; not very comprehensive at the moment. import doctest import pdb import sys import types import unittest import subprocess import textwrap from test import support # This little helper class is essential for testing pdb under doctest. from test.test_doctest import _FakeInput class PdbTestInpu...
bodypix_gl_imx.py
# Copyright 2019 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, ...
scheduler.py
import time import threading import automationhat class Scheduler(object): def __init__(self): self.child_thread = None self.started = True self.test = None self.was_started = False self.loop_count = 0 # Events will be used for synchronization self.test_adde...
sampling_provider.py
from collections import deque import threading import randomgen import numpy as np from biased_boundary_attack.utils.sampling.perlin import create_perlin_noise, calc_fade class SamplingProvider: """ Multi-threaded util that runs in the background and precalculates noise samples. To be used in with statement!...
reconnectingwebsocket.py
# # ⚠ Warning # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT # LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN # NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIA...
y_cable_helper.py
""" y_cable_helper.py helper utlities configuring y_cable for xcvrd daemon """ import datetime import os import re import threading import time from importlib import import_module from sonic_py_common import daemon_base, logger from sonic_py_common import multi_asic from sonic_y_cable import y_cable_vendor_m...
reset_job_test.py
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
miditransform-gui.pyw
#!/usr/bin/env python #Encoding: utf-8 #======================================================================================== # title : miditransform-gui.pyw # description : Graphical interface for miditransform.py # author : CMRM. # usage : Open midi file and apply transformation. ...
demoapiclient.py
# Copyright 2020 Alejandro Suazo # # 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...
main.py
#!/bin/env python """ The MIT License Copyright (c) 2010 The Chicago Tribune & Contributors 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 ...
thread_expm_2.py
import logging import threading def get_logger(): logger = logging.getLogger("threading_example") logger.setLevel(logging.DEBUG) fh = logging.FileHandler("threading.log") fmt = '%(asctime)s - %(threadName)s - %(levelname)s - %(message)s' formatter = logging.Formatter(fmt) fh.setForma...
peak_picker.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Project: Azimuthal integration # https://github.com/silx-kit/pyFAI # # Copyright (C) 2012-2021 European Synchrotron Radiation Facility, Grenoble, France # # Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu) # # Permission is hereby gr...
__init__.py
""" ██╗ ██╗ ██████╗ ██╗ ███████╗ ███████╗ ██████╗ ██████╗ ███╗ ███╗███████╗ ██║ ██║██╔═══██╗██║ ██╔════╝ ██╔════╝██╔═══██╗██╔══██╗████╗ ████║██╔════╝ ██║ █╗ ██║██║ ██║██║ █████╗ █████╗ ██║ ██║██████╔╝██╔████╔██║███████╗ ██║███╗██║██║ ██║██║ ██╔══╝ ██╔══╝ ██║ ██║██╔══██...
UbidotsBackingStore.py
# !/usr/bin/python3 # UbidotsBackingStore.py """ Safe version of the UbidotsBackingStore that can cope with unexpected errors and access that takes too long. Final backing store used by the Solar project. Backing store using ubidots so it can be monitored and controlled remotely and also generate nice graphs an...
sql_isolation_testcase.py
""" Copyright (c) 2004-Present Pivotal Software, Inc. This program and the accompanying materials are made available under the terms of the 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....
portex_btn.py
#!/usr/bin/env python3 import RPi.GPIO as GPIO import time from datetime import datetime import os from random import randint import threading import signal import argparse from portex_exec import execCMD # # Command line argument parser = argparse.ArgumentParser( description='PORTEX Panel Program for Panel Butto...
server.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ 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 agre...
ControlOdometryDriver.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- """ @File : ControlDriver.py @Contact : liumingshanneo@163.com @Modify Time @Author @Version ------------ ------- -------- 2019/10/16 21:46 msliu 1.0 @Description ------------ 这是一个包含odoemtry和control的数字伺服器控制器 接受一个线速度v和角速度w,旋转半径r 根据线速度和角速度,...
main_raspi_version.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import tinify import datetime import re from azure.cognitiveservices.vision.computervision import ComputerVisionAPI from msrest.authentication import CognitiveServicesCred...
readdataCPTAC.py
import os,subprocess,psutil,re,shutil,sys,csv,datetime,time from os import listdir import urllib,urllib2 import unicodedata import xmltodict from xml.dom import minidom from xml.parsers.expat import ExpatError import labkey import html2text from bs4 import BeautifulSoup from Bio import SeqIO from urlparse import unquo...
Hiwin_RT605_ArmCommand_Socket_20190627185258.py
#!/usr/bin/env python3 # license removed for brevity import rospy import os import socket ##多執行序 import threading import time import sys import matplotlib as plot import HiwinRA605_socket_TCPcmd as TCP import HiwinRA605_socket_Taskcmd as Taskcmd import numpy as np from std_msgs.msg import String from ROS_Socket.srv imp...
xbtop.py
#!/usr/bin/python3 # # SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2022 Xilinx, Inc # # Note: Only standard and local packages are permitted in this script. # Python Standard Packages import argparse import threading import time import json from enum import IntEnum from shutil import get_terminal_size # ...
instance.py
import atexit import time import logging import os import socket import io import sys import threading import paramiko from .resources import resources # The ARN of an IAM policy that allows full access to S3. S3_FULL_ACCESS_ARN = "arn:aws:iam::aws:policy/AmazonS3FullAccess" # The URL to GET from within an instance...
web_server.py
from asyncio import sleep from os import path from discord.ext import commands from flask import Flask, abort, redirect, render_template, request, send_from_directory from config import gitLogRoute, webServerHost, webServerPort from src.utils import funcs, github_embeds from src.utils.base_cog import BaseCog from src...
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 - ...
monitor.py
import os WM_PROJECT_USER_DIR=os.environ['WM_PROJECT_USER_DIR'] import sys sys.path.append(f"{WM_PROJECT_USER_DIR}/utilities") import signal import multiprocessing as mp import time from residual_monitor import read_residuals,plot_multiple_residuals,quit log="run.log" pressure_name="p_rgh" nCorrectors=1 interval=2 ...
tasks.py
import os import threading from invoke import run, task, util @task(name='deploy-docs') def deploy_docs(): """ Based on https://gist.github.com/domenic/ec8b0fc8ab45f39403dd """ run('rm -rf ./site/') build_docs() with util.cd('./site/'): run('git init') run('echo ".*pyc" > .git...
test_tcp_client.py
#!/usr/bin/env python import errno import socket import SocketServer import sys import threading import unittest from thor import loop from thor.tcp import TcpClient test_host = "127.0.0.1" test_port = 9002 class LittleRequestHandler(SocketServer.BaseRequestHandler): def handle(self): # Echo the back to...
test_comms.py
from functools import partial import os import sys import threading import warnings import pytest from tornado import gen, ioloop, locks, queues from tornado.concurrent import Future from distributed.metrics import time from distributed.utils import get_ip, get_ipv6 from distributed.utils_test import ( gen_test,...
train.py
#!/usr/bin/env python """Train models.""" import os import signal import torch import onmt.opts as opts import onmt.utils.distributed from onmt.utils.misc import set_random_seed from onmt.utils.logging import init_logger, logger from onmt.train_single import main as single_main from onmt.utils.parse import ArgumentPa...
FileSystemUpdatePrompter.py
from threading import Thread import logging import os from time import sleep logger = logging.getLogger('EDScoutCore') class FileSystemUpdatePrompter: def __init__(self, path_to_query): self.path_to_query = path_to_query t = Thread(target=self.file_check) t.daemon = True ...
payment_service.py
# Copyright © 2019 Province of British Columbia # # 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 agr...
parallelminibatch.py
""" Utility to load minibatches in parallel with simple exemple class to usage date : 2016-10-20 """ __author__ = "Mathieu Garon" __version__ = "0.0.1" import time import numpy as np from PIL import Image import abc from multiprocessing import Process, Queue, cpu_count, JoinableQueue class ParallelMini...
dataset.py
# Copyright (c) MONAI Consortium # 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, so...
processor_core.py
import multiprocessing as mp from queue import Queue from multiprocessing.managers import BaseManager import logging from share.commands import Commands from queue import Empty import schedule from libs.engine_threading import run_video_processing from libs.area_threading import run_area_processing from libs.utils.noti...
main.py
import threading import Xlib from Xlib.display import Display from Xlib import X, XK from Xlib.protocol import event from normal import normal_mode class Manager(): def __init__(self, inkscape_id): self.id = inkscape_id self.disp = Display() self.screen = self.disp.screen() self.ro...
EventLoopTest.py
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2012, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided ...
interface_rpc.py
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Wflscoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests some generic aspects of the RPC interface.""" import os from test_framework.authproxy import JS...
test_threads.py
import logging import threading import time def thread_function(name): logging.info("Thread %s: starting", name) time.sleep(2) logging.info("Thread %s: finishing", name) if __name__ == "__main__": format = "%(asctime)s: %(message)s" logging.basicConfig(format=format, level=logging.INFO, ...
service.py
# Copyright (c) 2010-2013 OpenStack, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
action-app_template.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from snipsTools import SnipsConfigParser from hermes_python.hermes import Hermes from hermes_python.ontology import * import io import urllib2 import json import schedule from threading import Thread import time import math from datetime import datetime, timedelta import ...
app.py
# Copyright 2014 OpenStack Foundation # Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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/LICENS...
detection_input.py
from __future__ import division from __future__ import print_function import cv2 import numpy as np import mxnet as mx from queue import Queue from threading import Thread from operator_py.cython.bbox import bbox_overlaps_cython from operator_py.bbox_transform import nonlinear_transform as bbox_transform class Dete...
artifacts.py
import json import mimetypes import os import pickle from six.moves.urllib.parse import quote from copy import deepcopy from datetime import datetime from multiprocessing import RLock, Event from multiprocessing.pool import ThreadPool from tempfile import mkdtemp, mkstemp from threading import Thread from time import t...
communication.py
import bpy import time import flask import ptvsd import random import requests import threading from functools import partial from . utils import run_in_main_thread from . environment import blender_path, scripts_folder EDITOR_ADDRESS = None OWN_SERVER_PORT = None PTVSD_PORT = None def setup(address, path_mappings): ...
app.py
import time import atexit import os.path import socket import ctypes import requests import subprocess import traceback import webbrowser from diskcache import Cache from multiprocessing import Process from runner import add_cert, override_hosts, restore_hosts, get_hosts_origin_ips from server import run_se...
utilities.py
import logging import sys import time import traceback from functools import wraps from threading import Thread log = logging.getLogger(__name__) log.setLevel('DEBUG') # python 2/3 string compatability if sys.version[0] == '2': from past.builtins import basestring else: basestring = str def build_command(o...
python_pce.py
#!/usr/bin/env python # -*- coding:utf-8 -*- import threading import linkstate_socksrv import segmentlist_socksrv import argparse def main(is_underpce): '''simple PCE for FRRouting''' # Receive linkstate thread_ls = threading.Thread(target=linkstate_socksrv.lsocket, args=(is_underpce, )) # Receive s...
EMD_Test_all_combinations.py
import pyhht from pyhht.emd import EMD from pyhht.visualization import plot_imfs import numpy as np import math import pandas from pyhht.utils import extr from pyhht.utils import get_envelops import matplotlib.pyplot as plt from pyhht.utils import inst_freq import wfdb import os import sys import glob import config imp...
mainWin.py
import tkinter as tk from tkinter import * import tkinter.messagebox from tkinter.filedialog import * import seg import os from subprocess import Popen, PIPE import threading global key def run(): global key key = 0 root = tk.Tk() root.title('监控视频的前景目标提取') root.geometry('350x200') var = tk.Str...
RunManager.py
import runStatus import logSetup import logging import gc import time import os import multiprocessing import signal import logging import logSetup import cProfile import traceback import threading import sys import queue # from pympler.tracker import SummaryTracker, summary, muppy # import tracemalloc import sqlal...
executor.py
from __future__ import print_function, division, absolute_import from collections import defaultdict, Iterator, Iterable from concurrent.futures._base import DoneAndNotDoneFutures, CancelledError import copy from datetime import timedelta from functools import partial import logging import os import sys from time impo...
replay_actions.py
#!/usr/bin/python # Copyright 2017 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 required by ...
stop_resume_traj.py
#!/usr/bin/python3 # Adding the common python files to path from os import wait import random import sys from rospkg import RosPack sys.path.insert(1, RosPack().get_path('cobot-control') + "/scripts/common/") from ur5control import UR5Control from actionlib_msgs.msg import GoalID import signal import copy # ROS impo...
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.uix.togglebutton impo...
server.py
import http.server import socketserver import os from threading import Thread PORT = os.environ.get("PORT") or 8000 PORT = int(PORT) Handler = http.server.SimpleHTTPRequestHandler httpd = socketserver.TCPServer(("", PORT), Handler) print("serving at port", PORT) def start_server(): httpd.serve_forever() t = Thr...
filters.py
# Copyright 2014-2016 PUNCH Cyber Analytics Group # # 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...
test_capture.py
import contextlib import io import os import subprocess import sys import textwrap from io import UnsupportedOperation from typing import BinaryIO from typing import cast from typing import Generator from typing import TextIO import pytest from _pytest import capture from _pytest.capture import _get_multicapture from ...
watchdog_component.py
import time import threading from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler class Watcher: def __init__(self, path, callback): self.observer = Observer() self.DIRECTORY_TO_WATCH = path self.callback = callback def run(self): event_ha...
client.py
import socket import random from threading import Thread from datetime import datetime from colorama import Fore, init, Back # init colors init() # set the available colors colors = [Fore.BLUE, Fore.CYAN, Fore.GREEN, Fore.LIGHTBLACK_EX, Fore.LIGHTBLUE_EX, Fore.LIGHTCYAN_EX, Fore.LIGHTGREEN_EX, Fore.LIGHTMAG...
process.py
import threading __all__ = ['Buffer', 'ProcessSequence'] from collections import OrderedDict from ..utils.decorators import synchronized class Buffer: def __init__(self, data, size: int, stride=None, take_index=False): self._size = size self._total_taked = 0 self._data = iter(data) ...
yb_backup.py
#!/usr/bin/env python # # Copyright 2022 YugaByte, Inc. and Contributors # # Licensed under the Polyform Free Trial License 1.0.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://github.com/YugaByte/yugabyte-db/blob/master/licenses...
CmdAnalysis.py
import multiprocessing from multiprocessing import Process import time import threading import os import NN_Train import EmailTool import Global def nn(params,nameparams): train, test = NN_Train.GetDate() print(params) print(nameparams) msg = ('%s\n') % str(params) msg += ('%s\n') % str(nameparams...
LR4.py
""" This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recog...
exp_monitor.py
from monitor import monitor_qlen from subprocess import Popen, PIPE from time import sleep, time from multiprocessing import Process from argparse import ArgumentParser import sys import os parser = ArgumentParser(description="CWND/Queue Monitor") parser.add_argument( "--exp", "-e", dest="exp", actio...
threaded_webcam.py
from threading import Thread import cv2 class WebcamVideoStream: def __init__(self, src=1): # initialize the video camera stream and read the first frame # from the stream self.stream = cv2.VideoCapture(src) (self.grabbed, self.frame) = self.stream.read() # initialize the ...
locators.py
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import gzip from io import BytesIO import json import logging import os import posixpath import re try: import threading except Imp...
mWave.py
#! /usr/bin/env python3 HelpString = ''' invocation: mWave.py <csvfile> <ctrfile> format of csvfile: first line must be: time,sig1,sig2,sig3,..... then all lines are numbers separated by comas first number in every line is time value. rest of the line are just values. the...
mc_completer.py
#!/usr/bin/env python3 import os import re import sys import readline from time import sleep from pathlib import Path from subprocess import PIPE, Popen from threading import Thread class ProcessWrapper: class Completer(object): """ A class to generate a completer function for passing to readline...
penguindrum.py
import http.server import logging import os import threading import typing from typing import Optional import msgpack from PIL.Image import Image import auto_derby from auto_derby.constants import RuningStyle from auto_derby.scenes import PaddockScene from auto_derby.single_mode import event from plugins.penguindrum_...
wsClientLoop.py
import asyncio import websockets import json import time import threading import airsim import math class WebSocketClient: isContinuousLoop = True p = None async def printit(self, websocket): while True: try: if WebSocketClient.isContinuousLoop: rpc...