source
stringlengths
3
86
python
stringlengths
75
1.04M
teleop_pr2.py
#!/usr/bin/env python from __future__ import print_function import select import sys import termios import tty from pb_planning.pybullet_tools.pr2_utils import PR2_GROUPS, DRAKE_PR2_URDF from pb_planning.pybullet_tools import add_data_path, connect, enable_gravity, load_model, \ joints_from_names, load_pybullet, \ ...
tts.py
import os from threading import Thread music_level = 30 class TTS(): def __init__(self, frontend, config): self.frontend = frontend def speak_text(self, text): t = Thread(target=self.speak_text_thread, args=(text,)) t.start() def speak_text_thread(self, text): os.system...
mapd.py
#!/usr/bin/env python # Add phonelibs openblas to LD_LIBRARY_PATH if import fails from common.basedir import BASEDIR try: from scipy import spatial except ImportError as e: import os import sys openblas_path = os.path.join(BASEDIR, "phonelibs/openblas/") os.environ['LD_LIBRARY_PATH'] += ':' + openblas_path...
LauncherCommand.py
from command import * import threading import re from enum import Enum, auto # TODO: move CMDCode to another file and import it here class CMDCode(Enum): EXT = auto() FIND_MATCH = auto() CANCEL = auto() ACCEPT = auto() DECLINE = auto() SAVE = auto() AL_BANS = auto() EN_BANS = auto() ...
bilibili3.py
import requests import re import json import os import click import threading import shutil import subprocess import time import math sep = os.sep # 需要依赖ffmpeg # 有些资源会限速╭(╯^╰)╮ # 想下载大会员番剧或1080P+请填入大会员cookie到headers class Bilibili: def __init__(self, ss, sessData='', savePath: str = 'download', func=None): ...
test_api.py
# !/usr/bin/env python # coding=utf-8 import json import threading import time import pymongo import requests from app import * from nose.tools import with_setup def setup_func(): connection = pymongo.Connection("localhost", 27017) db = connection.sillynews db.user.insert({"username": "testUsername", ...
example_8_parallel.py
import sys sys.path.insert(0, "/home/treason/PycharmProjects/ParaMol_git_master") import simtk.unit as unit import multiprocessing as mp # ParaMol imports from ParaMol.System.system import * # ParaMol Tasks imports from ParaMol.HMC.hmc_sampler import * from ParaMol.Utils.settings import * # ------------------------...
biobot_web.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- import argparse import base64 from bson import ObjectId import datetime from flask import Flask, Markup, Response, abort, escape, flash, redirect, \ render_template, request, url_for from flask_login import LoginManager, UserMixin, current_user, login_requir...
process.py
# ============================================================================ # FILE: process.py # AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com> # License: MIT license # ============================================================================ import subprocess from threading import Thread from queue impor...
lockfile.py
""" lockfile.py - Platform-independent advisory file locks. Requires Python 2.5 unless you apply 2.4.diff Locking is done on a per-thread basis instead of a per-process basis. Usage: >>> lock = FileLock(_testfile()) >>> try: ... lock.acquire() ... except AlreadyLocked: ... print _testfile(), 'is locked alre...
managers.py
# # Module providing manager classes for dealing # with shared objects # # multiprocessing/managers.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ] # # Imports # import sys import threading import signal imp...
test_wasyncore.py
from awaitress import wasyncore as asyncore from awaitress import compat import contextlib import functools import gc import unittest import select import os import socket import sys import time import errno import re import struct import threading import warnings from io import BytesIO TIMEOUT = 3 HAS_UNIX_SOCKETS =...
task.py
import logging import pickle import threading import time import typing from abc import ABC, abstractmethod from typing import Optional from ray.streaming.collector import OutputCollector from ray.streaming.config import Config from ray.streaming.context import RuntimeContextImpl from ray.streaming.generated import re...
node_finder.py
import threading, time, socket class node_finder: ''' init function @param self @param config varaible with config @return None ''' def __init__(self, config): self.config = config self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) # Enable port reusage so we will b...
controller.py
import logging import os import signal import yaml import time from flask import Flask, jsonify, request from gevent.pywsgi import WSGIServer from triggerflow.service import storage from triggerflow.service.worker import Worker from triggerflow import eventsources import threading app = Flask(__name__) app.debug = Fal...
worker_test.py
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
del_server_nbu.py
import logging import os import os.path import platform import subprocess import threading from math import ceil from optparse import OptionParser from sys import exit, stdout is_win = True if platform.system() == 'Windows' else False bin_admin_path = r'C:\Program Files\Veritas\NetBackup\bin\admincmd' if is_win else r...
profiler.py
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
util.py
"""Utilities for working with mulled abstractions outside the mulled package.""" from __future__ import print_function import collections import hashlib import logging import re import sys import tarfile import threading from io import BytesIO import packaging.version import requests log = logging.getLogger(__name__...
arm_interface_helper.py
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2013, SRI International # 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 ...
test_sys.py
import builtins import codecs import gc import locale import operator import os import struct import subprocess import sys import sysconfig import test.support from test import support from test.support import os_helper from test.support.script_helper import assert_python_ok, assert_python_failure from test.support imp...
main.py
from threading import Thread from ircbot import Bot from play_game import Game from queue import MyQ from locals import * from gui import Gui def main(): """ Creates a queue that keeps track of commands to be entered into the game. Creates three more objects and spins up a thread for each: 1 - The IR...
MAIN.py
#!/usr/bin/python3 import signal import threading from time import sleep import redis from features.binaryclock import BinaryClock from features.mona import Mona from features.snow import Snow from field import Field from highscorelist import * from painter import RGB_Field_Painter, Led_Matrix_Painter from features....
lisp.py
# ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # 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...
get_user_brand_member.py
""" 获取已经入会的 venderID --- user_shop_venderId.txt """ import os import sys import requests import re import threading # 这里填写遍历的 cookie COOKIE = "" or "pt_key=" + sys.argv[1] + ";pt_pin=" + sys.argv[2] THREAD = 8 def get_file_path(file_name=""): """ 获取文件绝对路径, 防止在某些情况下报错 :param file_name: 文件名 :return: ...
test_generator_mt19937.py
from distutils.version import LooseVersion import hashlib import sys import warnings import numpy as np from numpy.linalg import LinAlgError from numpy.testing import ( assert_, assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal, assert_no_warnings, assert_raises, ...
__init__.py
"""The initialization file for the Pywikibot framework.""" # # (C) Pywikibot team, 2008-2021 # # Distributed under the terms of the MIT license. # import atexit import datetime import inspect import math import re import threading import time from contextlib import suppress from decimal import Decimal fr...
socket_server_window.py
""" @Time : 2020/1/21 15:13 @Author : weijiang @Site : @File : socket_server_window.py @Software: PyCharm """ import sys from threading import Thread from view.socker_server_window import Ui_Form from PyQt5.QtWidgets import QWidget, QApplication from util.common_util import read_qss, SUPER_DIR, hint_dialog,...
s3.py
import os import sys from cStringIO import StringIO from collections import namedtuple from zsync import Sync, Pipeable, Receivable from zsync.uploader import Uploader from zsync.downloader import Downloader from zsync.snapshot import Snapshot from multiprocessing import Process, Pipe class S3(Sync): """ Sends...
dispatch.py
#!/usr/bin/env python3 """ This runs multiple copies of train.py in parallel, for each worker """ import sys from contextlib import contextmanager import multiprocessing config = dict( seed=42, task="ImageNet", model_name="ResNet_EvoNorm18", data_split_method="dirichlet", non_iid_alpha=1.0, n...
punisher.py
import scapy.all as scapy import argparse import multiprocessing import threading import time CLIENTS = {} SENT_PACKETS = 0 SEMAPHORE = 1 DOWN = threading.Event() def scan_mac(mac, net): mac = to_dict(mac) arp_request = scapy.Ether(dst='ff:ff:ff:ff:ff:ff') / scapy.ARP(op='who-has', pdst=net) ans, unans =...
__init__.py
import time import threading import unittest import re import sublime LAST_COMMIT_TIMESTAMP = '2014-11-28 20:54:15' LAST_COMMIT_VERSION = re.sub(r'[ :\-]', '.', LAST_COMMIT_TIMESTAMP) CLIENT_ID = '' CLIENT_SECRET = '' class StringQueue(): def __init__(self): self.lock = threading.Lock() self.q...
sh.py
#=============================================================================== # Copyright (C) 2011-2012 by Andrew Moffat # # 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 restrict...
failure_test.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import os import pytest import sys import tempfile import threading import time import numpy as np import redis import ray import ray.ray_constants as ray_constants from ray.utils import _random_s...
test_unix.py
#!/usr/bin/python # -- Content-Encoding: UTF-8 -- """ Tests the server & client in Unix socket mode (when available) :license: Apache License 2.0 """ # JSON-RPC library from jsonrpclib import ServerProxy from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer # Standard library import os import random import ...
run_test.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import multiprocessing as mp import os import shutil import subprocess import tempfile imp...
buffering.py
import multiprocessing as mp import Queue import threading def buffered_gen_mp(source_gen, buffer_size=2): """ Generator that runs a slow source generator in a separate process. buffer_size: the maximal number of items to pre-generate (length of the buffer) """ if buffer_size < 2: raise Ru...
train.py
# Copyright (c) 2017 Sony Corporation. 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 applicabl...
widget.py
# -*- coding: utf-8 -*- """ | This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) GUI widget and services start function -------------------------------------- """ from __future__ import print_function i...
TaskRuntime_async.py
import thread import threading import time import task import json import logging import pika import traceback import AsyncConsumer import Queue class Timer(object): def __init__(self, verbose=False): self.verbose = verbose def __enter__(self): self.start = time.time() return s...
C2Server.py
#!/usr/bin/env python3 import os, sys, datetime, time, base64, logging, signal, re, ssl, traceback, threading from urllib.request import urlopen, Request from urllib.error import HTTPError, URLError from Implant import Implant from Tasks import newTask from Core import decrypt, encrypt, default_response, decrypt_bytes...
ChatRoom1.0Client.py
#!/usr/bin/env python # -.- coding: utf-8 -.-y import socket import os import time import threading import Queue import sys import argparse from multiprocessing import Process print """\33[91m ═════════════════════════════════════════════════════════ ███████ ██████ ███████ █ ...
testMonkey.py
# Copyright (c) 2017 Mimer Information Technology # 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, merge, ...
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 io import errno import os import time try: import ssl except ImportError: ssl = None from unittest import TestCase from test im...
supporter.py
# MIT License # Copyright (c) 2017 GiveMeAllYourCats # 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, mer...
penguin.py
# TODO: Internet connectivity speed benchmark # TODO: Docs import ast import os import shutil import threading import time from PIL import Image from selenium.webdriver import Chrome from selenium.webdriver.chrome.options import Options COMPRESSED_COLOR_SPACE = 262144 # 64 ** 3 STATIC_RESOURCE_PATH = 'static' # TO...
screen.py
import os import tkinter as tk import time from threading import Thread from config import config class Screen: def __init__(self, initial_picture="init.gif"): """ init the class and shows the window default image configurable """ self.imgPath = os.path.join(config.PICTUREPATH, in...
StateUtils.py
# Copyright 2020 The KNIX 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 agree...
Binance Detect Moonings.py
# use for environment variables import os # use if needed to pass args to external modules import sys # used to create threads & dynamic loading of modules import threading import importlib # used for directory handling import glob # Needed for colorful console output Install with: python3 -m pip install colorama (...
accounts_view.py
import csv from functools import partial import json import os import threading import time from typing import List, Optional, Sequence import weakref from PyQt5.QtCore import QEvent, QItemSelectionModel, QModelIndex, pyqtSignal, QSize, Qt from PyQt5.QtGui import QPainter, QPaintEvent from PyQt5.QtWidgets import (QLab...
test_aea.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 ...
RRollerServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, Inva...
sns_client.py
import httplib import json import sys from Queue import Queue from threading import Thread class SNSClient(object): def __init__(self, api_url, api_key): if api_url is None: self.enabled = False else: self.enabled = True self.api_url = api_url self...
server.py
# code to simulate the supplier # each supplier sends the fix, ttl and start time to the middle server import socket from time import sleep from threading import Thread from random import * from jpype import * # connect to a java jdk to get the time in nano seconds # Can't use python functions as java has ...
PolarCode.py
#!/usr/bin/env python """ An object that encapsulates all of the parameters required to define a polar code. This object must be given to the following classes: `AWGN`, `Construct`, `Decode`, `Encode`, `GUI`, `Shorten`. """ import numpy as np from polarcodes.utils import * from polarcodes.Construct import Co...
shutit_util.py
#!/usr/bin/env pythen """ShutIt utility functions. """ # The MIT License (MIT) # # Copyright (C) 2014 OpenBet Limited # # 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,...
rconwhitelist.py
import sys, os, sched, logging, threading, time, json import lib.rconprotocol from lib.rconprotocol import Player class RconWhitelist(object): Interval = 30 # interval how often the whitelist.json should be saved (default: every 30 seconds) def __init__(self, rcon, configFile, GUI=False): self.config...
test_client_functional_oldstyle.py
"""HTTP client functional tests.""" import asyncio import binascii import cgi import contextlib import email.parser import gc import http.server import io import json import logging import os import os.path import re import ssl import sys import threading import traceback import unittest import urllib.parse from http....
wsdump.py
#!/Users/marius/Documents/EFREI/S7/Robotique/TP2/pyApp/venv/bin/python3 """ wsdump.py websocket - WebSocket client library for Python Copyright 2021 engn33r 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 Li...
test_geocontext.py
import pytest import unittest import mock import multiprocessing import concurrent.futures import copy import warnings from descarteslabs.scenes import geocontext import shapely.geometry class SimpleContext(geocontext.GeoContext): __slots__ = ("foo", "_bar") def __init__(self, foo=None, bar=None): s...
fdu.py
#!/usr/bin/env python import datetime import json import pathlib import platform import pprint import sys import time import traceback from multiprocessing import Process import click import requests import six import yaml import freenom_dns_updater from freenom_dns_updater.get_my_ip import * is_windows = any(platfo...
_boosting.py
""" Boosting as described by David et al. (2007). Versions -------- 7: Accept segmented data, respect segmentation (don't concatenate data) Profiling --------- ds = datasets._get_continuous() y = ds['y'] x1 = ds['x1'] x2 = ds['x2'] %prun -s cumulative res = boosting(y, x1, 0, 1) """ import inspect from itertools i...
bruter.py
# Date: 05/05/2018 # Author: Pure-L0G1C # Description: Bruter from .spyder import Spyder from .scraper import Queue from .session import Session from time import time, sleep from threading import Thread, Lock from os import system, remove, path from platform import system as platform from .const import m...
mainWindow.py
import os import queue as Queue import threading from datetime import datetime import numpy as np import cv2 from PyQt5.QtCore import Qt from PyQt5.QtCore import pyqtSignal, pyqtSlot from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QShortcut, QStackedWidget, QMessageBox, QWidget, QVBoxLayout, QHBoxLayout...
taskqueue_stub.py
#!/usr/bin/env python # # Copyright 2007 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 o...
ZIPFileRaider.py
# encoding: utf-8 from burp import IBurpExtender from burp import IHttpListener from burp import ITab from burp import IContextMenuFactory from burp import IParameter from StringIO import StringIO from zipfile import ZipFile from shutil import rmtree, make_archive, copytree, copy from java.awt import GridLayout, Compon...
Deployer.py
import sys import subprocess import threading import time import uuid import os.path from datetime import datetime from random import randint from UniqueConfiguration import UniqueConfiguration from CommonConfiguration import CommonConfiguration from printer import console_out, console_out_exception class Deployer: ...
gg.py
# -*- coding: utf-8 -*- ''' © 2018SelfBot ProtectV2.2 ''' from important import * # Setup Argparse parser = argparse.ArgumentParser(description='© 2018SelfBot ProtectV2.2') parser.add_argument('-t', '--token', type=str, metavar='', required=False, help='Token | Example : Exxxx') parser.add_argument('-e', '--email', typ...
analyzer.py
import logging from Queue import Empty from redis import StrictRedis from time import time, sleep from threading import Thread from collections import defaultdict from multiprocessing import Process, Manager, Queue from msgpack import Unpacker, unpackb, packb from os import path, kill, getpid, system from math import c...
main.py
import SocketServer import socket import threading import cv2 import numpy as np import wx from wx.lib.pubsub import pub import about class VideoStreamHandler(SocketServer.StreamRequestHandler): """docstring for ShowCapture""" def handle(self): stream_bytes = ' ' # stream video frames one ...
lpad_run.py
# coding: utf-8 from __future__ import unicode_literals import six """ A runnable script for managing a FireWorks database (a command-line interface to launchpad.py) """ from argparse import ArgumentParser, ArgumentTypeError import copy import os import shutil import re import time import ast import json import dat...
eventsSSL.py
import base64 import datetime import socket import select import ssl import sys from threading import Thread import xml from xml.dom import minidom from PyISY.Events import strings POLL_TIME = 5 class SSLEventStream(object): def __init__(self, parent, lost_fun=None): #super(EventStream, self).__init__(so...
dataset.py
# Copyright 2020 - 2021 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 wri...
helpers.py
# -*- coding: utf-8 -*- """ :copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. tests.support.helpers ~~~~~~~~~~~~~~~~~~~~~ Test support helpers """ # pylint: disable=repr-flag-used-in-string,wrong-import-order ...
tracker.py
import os import numpy as np import math import cv2 import onnxruntime import time import queue import threading import copy from retinaface import RetinaFaceDetector from remedian import remedian def resolve(name): f = os.path.join(os.path.dirname(__file__), name) return f def clamp_to_im(pt, w, h): x = ...
mixins.py
# -*- coding: utf-8 -*- ''' :codeauthor: Pedro Algarvio (pedro@algarvio.me) ============= Class Mix-Ins ============= Some reusable class Mixins ''' # pylint: disable=repr-flag-used-in-string # Import python libs from __future__ import absolute_import, print_function import os import sys import t...
wpforce.py
import re import sys import time import socket import urllib2 import argparse import threading from urlparse import urljoin __author__ = 'n00py' # These variables must be shared by all threads dynamically correct_pairs = {} total = 0 def has_colours(stream): if not hasattr(stream, "isatty"): return False ...
job_monitor.py
# -*- coding: utf-8 -*- # # This file is part of REANA. # Copyright (C) 2019, 2020, 2021, 2022 CERN. # # REANA is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Job monitoring wrapper.""" import logging import threading import time i...
http.py
''' This file contains classes and functions that implement the PyPXE HTTP service ''' import socket import struct import os import threading import logging from pypxe import helpers class HTTPD: ''' This class implements a HTTP Server, limited to GET and HEAD, from RFC2616, RFC7230. ''' ...
server.py
# -*- coding: utf-8 -*- """ Flask app for the graphical user interface. """ from __future__ import print_function, division, unicode_literals import threading import socket import time import sys import os from base64 import urlsafe_b64encode try: from http.client import HTTPConnection except ImportError: ...
subproc_vec_env.py
import multiprocessing as mp import numpy as np from .vec_env import VecEnv, CloudpickleWrapper, clear_mpi_env_vars def worker(remote, parent_remote, env_fn_wrappers): def step_env(env, action): ob, reward, done, info = env.step(action) if done: ob = env.reset() return ob, rew...
plot_emg2.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import rospy from ros_myo.msg import EmgArray import matplotlib.pyplot as plt import threading as th from copy import deepcopy class EmgSubscriber(): def __init__(self): n_ch = 8 self.RP = realtime_plot(n_ch) self.subscriber ...
number_field.py
# ---------------------------------------------------------------------------- # GS Widget Kit Copyright 2021 by Noah Rahm and contributors # # 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 # #...
modbus_server.py
#!/usr/bin/env python # modbus_server.py # Copyright (C) 2017 Niryo # All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your optio...
TaskSmach.py
import roslib; roslib.load_manifest('task_manager_lib') from task_manager_lib.TaskClient import * import smach import smach_ros import signal import sys class MissionFailed(smach.State): def __init__(self): smach.State.__init__(self, outcomes=['MISSION_FAILED']) class MissionCompleted(sma...
Stevedore.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ IBM Containerized Forecasting Workflow DESCRIPTION WPS and WRF workflow for weather simulation. AUTHOR Timothy Lynar <timlynar@au1.ibm.com>, IBM Research, Melbourne, Australia Frank Suits <frankst@au1.ibm.com>, IBM Research, Melbourne, Australia; Dublin,...
weather.py
# -*- coding: utf-8 -*- ''' See Installation directory for installation dependencies https://docs.getchip.com/chip.html#how-you-see-gpio https://bbs.nextthing.co/t/reading-dht11-dht22-am2302-sensors/2383/78 ''' from bottle import Bottle, route, run, static_file, response from threading import Thread import subproc...
queue.py
# # Copyright (C) 2010-2017 Vinay Sajip. See LICENSE.txt for details. # """ This module contains classes which help you work with queues. A typical application is when you want to log from performance-critical threads, but where the handlers you want to use are slow (for example, :class:`~logging.handlers.SMTPHandler`)...
views.py
from django.shortcuts import render from django.views.decorators import gzip from django.http import StreamingHttpResponse import cv2 import numpy as np import threading import tensorflow as tf @gzip.gzip_page def Home(request): return render(request, 'index.html') class VideoCamera(object): def __init__(sel...
16.8.1.py
#!/usr/bin/env python # encoding: UTF-8 """Exercise answer 16.8.1 for chapter 16.""" __author__ = 'Ibuki Suika' from Tkinter import * from ttk import * from socket import * from select import select from threading import Thread from time import ctime class App(Frame): def __init__(self, master=None): ...
install_mikeros_tools_and_press_enter.py
# https://stackoverflow.com/a/23468236 # NOTE: THIS SCRIPT SHOULD ONLY BE USED IN APPVEYOR # Using it anywhere else is just pointless # This script simulates keypresses to bypass Mikero's stupid unskippable popup window # (the one about the 1024 characters limit) # If you're Mikero and you're reading this, then I'm so...
MultiProcessDaemon.py
import multiprocessing import time import sys def daemon(): p = multiprocessing.current_process() print('Starting:',p.name, p.pid) sys.stdout.flush() time.sleep(2) print('Exiting:', p.name, p.pid) sys.stdout.flush() return def non_daemon(): p = multiprocessing.current_process() prin...
test_http.py
import asyncio import contextlib import logging import socket import threading import time import pytest from tests.response import Response from uvicorn import Server from uvicorn.config import Config from uvicorn.main import ServerState from uvicorn.protocols.http.h11_impl import H11Protocol try: from uvicorn....
indiclient.py
#!/home/bernard/acenv/bin/python3 import os, threading, sys, hashlib, uuid, pathlib from indi_mr import mqtttoredis, mqtt_server, redis_server, tools from indiredis import make_wsgi_app from skipole import WSGIApplication, FailPage, GoTo, ValidateError, ServerError, use_submit_list, skis from waitress import serve...
start_tool.py
import logging import threading import time from OpenGL.GL import * from gui.constants import StatisticLink from gui.ui_window import OptionGui from opengl_helper.screenshot import create_screenshot from processing.network_processing import NetworkProcessor from utility.file import FileHandler from utility.log_handli...
test_dispatcher.py
import errno import multiprocessing import os import platform import shutil import subprocess import sys import threading import warnings import inspect import pickle import weakref from itertools import chain from io import StringIO import numpy as np from numba import jit, generated_jit, typeof from numba.core impo...
p2p_server.py
import json import random from .base_server import BaseServer from .p2p_connection import P2PConnection import socket, threading import queue import logging from common.constants import MSG_TYPE, HEARTBEAT logger = logging.getLogger("sys." + __name__.split(".")[-1]) class P2PComponent(BaseServer): def __init__(...
run_op_emitter.py
from oplog import Oplog from multiprocessing import Process def run(): op_emitter = Oplog() Process(target=op_emitter.start).start() if __name__ == "__main__": run()
KBParallelServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
ffmpeg_rtmp_transfer.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Time : 2020/6/3 10:06 上午 # @File : rtmp_video_pusher.py # @author : Bai # @Software: PyCharm import os import time from multiprocessing import Process PULL_ADDR = 'rtmp://localhost:1935/live/1234' PUSH_ADDR = 'rtmp://10.10.14.120:1935/stream/1234' TMP_FILE_FOLDE...