source
stringlengths
3
86
python
stringlengths
75
1.04M
vecEnv.py
from multiprocessing import Process, Pipe import numpy as np import os import gym from ffai import FFAIEnv from torch.autograd import Variable import torch.optim as optim from ffai.ai.layers import * import torch import torch.nn as nn import torch.nn.functional as F import matplotlib.pyplot as plt import sys import ffa...
perimeterPig.py
#!/usr/bin/env python # POC: perimeterPig.py # Bluetooth & Wifi) learner & listener # Build Db of 'friends' # Log or alert exceptions #Author: scp #import random #always, always import random... #https://scapy.readthedocs.io/en/latest/layers/bluetooth.html# #sudo lsusb |grep Bluetooth && hcitool dev from scapy.all impo...
pyserial.py
from . import py U,T,N,F=py.importUTNF() import serial gencoding = ENCODING = U.get(__name__+'.gencoding','utf-8') devs=U.get(__name__+'.devs',{}) g=U.get(__name__+'.g') if g: devs[g.port.upper()]=g def list_all_com_ports(): from serial.tools import list_ports r={} for cp in list_ports.comports(): ...
gevent_mysql_pool_util.py
""" original https://github.com/surfly/gevent/blob/master/examples/psycopg2_pool.py """ import gevent from gevent import monkey monkey.patch_all() from gevent.queue import Queue from _mysql_exceptions import OperationalError import pymysql import contextlib import sys import threading import os class DatabaseConnec...
utils.py
import glob import hashlib import logging import os import shutil import subprocess from functools import wraps from tempfile import gettempdir from threading import Thread import requests from timeout_decorator import timeout from utils.constants import Constant from utils.format import Format logger = logging.getL...
common_service.py
"""TcEx Framework Service Common module""" # standard library import json import threading import time import traceback import uuid from datetime import datetime from typing import Callable, Optional, Union from .mqtt_message_broker import MqttMessageBroker class CommonService: """TcEx Framework Service Common m...
demo.py
"""Usage: # For testing. $ python -m pytest tests/demo.py # Python-side benchmarks are launched as a standalone script. $ python tests/demo.py """ import multiprocessing import time import uuid import numpy as np import redis import common from common import * ack_client = AckClient() master_client = MasterClient(...
runscript.py
from threading import Thread from time import sleep from src.models import Utilities as Utils from src.controllers import ApplicationController as App from src.views import Logger from src.models import Emails import pid import os, pwd import traceback is_active = True def start(timer, user): timer.start() ...
test_service.py
from unittest import TestCase import threading import os import shutil import json import time import requests import random from mock import Mock from samcli.local.apigw.service import Route, Service from tests.functional.function_code import nodejs_lambda, API_GATEWAY_ECHO_EVENT, API_GATEWAY_BAD_PROXY_RESPONSE, API...
mqtt_helpers.py
# -*- coding: utf-8 -*- from six import iterkeys import os import time from threading import Thread, RLock, Event, current_thread import logging import traceback from abc import ABCMeta, abstractmethod import paho.mqtt.client as mqtt # pip install paho-mqtt import ssl import uuid from utils import path_helpers f...
seed.py
# Copyright Tim Churchard 2020 from collections import namedtuple from hashlib import sha256, pbkdf2_hmac from time import monotonic, sleep from threading import Thread, Event from mnemonic import Mnemonic from .const import DEF_ITS_SALT, DEF_ITS_PBKDF2, MIN_LEN_PASSWORD, MIN_ITS_PBKDF2, MIN_ITS_SALT, DEF_VERBOSE_TI...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from electrum.bitcoin import TYPE_ADDRESS from electrum.storage import WalletStorage from electrum.wallet import Wallet, InternalAddressCorruption from electrum.paymentrequest import ...
super_debug.py
# This file is part of Ansible # # Ansible 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 option) any later version. # # Ansible is distributed in the hope that ...
python_pg1.py
# %% # to test impots import sys from typing import List, NewType, Any for path in sys.path: print(path) # %% def __path_bn_layer_for_functional_eval(self, module, input): for attr_str in dir(module): target_attr = getattr(module, attr_str) print(target_attr) if type(target_attr) == ...
train.py
#!/usr/bin/env python """ Main training workflow """ from __future__ import division import argparse import glob import os import random import signal import time import torch from pytorch_pretrained_bert import BertConfig import distributed from models import data_loader, model_builder from models.data_loader i...
labels.py
import hashlib import requests import threading import json import sys import traceback import base64 from electrum_cadex.plugin import BasePlugin, hook from electrum_cadex.crypto import aes_encrypt_with_iv, aes_decrypt_with_iv from electrum_cadex.i18n import _ class LabelsPlugin(BasePlugin): d...
pipulator_proxy.py
# synthesize all 3 fragments into one monolith app. # # first, send a UDP broadcast, and locate a fallout game. # then spawn a background thread that listens on udp 28000, and replies to app hails as another game # when someone connects to me, reach out to the located game, and mitm both sides of the connection, wh...
startup.py
import sys import subprocess import threading import time import logging import shlex from midisw.envdefs import * import midisw.profile logging.basicConfig(level=LOGGING_LEVEL) _PORT_OBSERVE_INTERVAL=1 _PORT_LIST_CMD = {} _PORT_LIST_CMD["jack"] = "jack_lsp -t | sed 's/\\t//g' | awk 'NR%2 == 1{ lastline=$0 } NR%2=...
pulse.py
# =============================================================================== # Copyright 2011 Jake Ross # # 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...
bluetooth_raspi.py
# Copyright 2019 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """This module implements the PeripheralKit instance for a bluez peripheral on Raspberry Pi. """ from __future__ import print_function import dbus im...
server.py
""" Backend server """ import logging import subprocess import threading from pathlib import Path from typing import Optional logger = logging.getLogger(__name__) # enable/disable logging of subprocess output SUBPROCESS_LOGGING = True class BackendServer: """ Class for a backend's server process """ ...
traincontroller.py
""" Training a linear controller on latent + recurrent state with CMAES. This is a bit complex. num_workers slave threads are launched to process a queue filled with parameters to be evaluated. """ import argparse import sys from os.path import join, exists from os import mkdir, unlink, listdir, getpid from time impor...
templates.py
""" Handles (deferred) loading of odML templates """ import os import tempfile import threading try: import urllib.request as urllib2 from urllib.error import URLError from urllib.parse import urljoin except ImportError: import urllib2 from urllib2 import URLError from urlparse import urljoin ...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence from electrum.storage import WalletStorage, StorageReadWriteError from electrum.wallet_db import WalletDB from el...
handlers.py
from threading import Thread from time import sleep user_input = [None, None] def auth_handler(): """ При двухфакторной аутентификации вызывается эта функция. :return: key, remember_device """ num = user_input[0] input_thread = Thread(target=get_auth_code, args=(user_input,)) input_thread...
ms_utils.py
import os import operator import itertools import gzip import numpy as np from scipy import stats import cPickle as pickle import math import multiprocessing ''' Colorblind safe colors from Bang Wong, Nature Methods 8. 441 (2011) ''' black = (0,0,0) orange = (230/255.0,159/255.0,0) skyBlue = (86/255.0,180/255.0,233/255...
test_context.py
# Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. import copy import gc import os import sys import time from queue import Queue from threading import Event, Thread from unittest import mock from pytest import mark import zmq from zmq.tests import PYPY, BaseZMQTestCase, Gree...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
_tcp_proxy.py
# Copyright 2019 the gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
runQosClient.py
# Copyright (C) <2019> Intel Corporation # # SPDX-License-Identifier: Apache-2.0 import os import json import logging import time from multiprocessing import Process, Queue import argparse import sys import shutil import setproctitle import subprocess import threading import copy import collections class QosStartPara...
core_5034_test.py
#coding:utf-8 # # id: bugs.core_5034 # title: At least 5 seconds delay on disconnect could happen if disconnect happens close after Event Manager initialization # decription: # This test uses Python multiprocessing package in order to spawn multiple processes with trivial job: attach/d...
runner.py
import argparse import colors import docker import json import logging import numpy import os import psutil import threading import time import traceback from ann_benchmarks.algorithms.definitions import Definition, instantiate_algorithm from ann_benchmarks.datasets import get_dataset, DATASETS from ann_be...
ripsnort.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import os import sys import shutil import logging import Queue import threading import disc_drive import disc_name import disc_track import apppath dirname = os.path.dirname(os.path.realpath( __file__ )) sys.path.append( os.path.join(dirname,"ripper") ) imp...
test_change_notify.py
# -*- coding: utf-8 -*- # Copyright: (c) 2019, Jordan Borean (@jborean93) <jborean93@gmail.com> # MIT License (see LICENSE or https://opensource.org/licenses/MIT) import pytest import threading import uuid from smbprotocol.connection import ( Connection, ) from smbprotocol.exceptions import ( InvalidParamete...
_coreg_gui.py
"""Traits-based GUI for head-MRI coregistration""" # Authors: Christian Brodbeck <christianbrodbeck@nyu.edu> # # License: BSD (3-clause) import os from ..externals.six.moves import queue import re from threading import Thread import warnings import numpy as np from scipy.spatial.distance import cdist # allow import...
iver_rf_ac_new.py
""" Read com ports RF and AC""" import datetime import socket import threading import tkinter as tk from queue import Queue import matplotlib.pyplot as plt import rasterio import serial from matplotlib import animation from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk from rasterio....
parallel_backend.py
""" This module contains utils for parallel batch calculation. Main class is :py:class:`BatchManager` which is used to manage parallel calculation Main workflow is to add work with :py:meth:`BatchManager.add_work` and consume results (:py:meth:`BatchManager.get_result`) until :py:attr:`BatchManager.has_work` is evalua...
labels.py
import hashlib import requests import threading import json import sys import traceback import base64 import electrum_zaap from electrum_zaap.plugins import BasePlugin, hook from electrum_zaap.i18n import _ class LabelsPlugin(BasePlugin): def __init__(self, parent, config, name): BasePlugin.__init__(...
image.py
# Copyright (c) Niall Asher 2022 import datetime import re from base64 import urlsafe_b64decode from math import gcd from types import SimpleNamespace from base64 import b64encode import PIL from PIL import Image, ImageOps from pony.orm import commit, db_session, select from socialserver.util.config import config fro...
wxglade_out.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- # # generated by wxGlade 0.9.6 on Sat Sep 26 08:32:20 2020 # # imports # sys import os import sys import math # gui import wx from wx.lib import sized_controls # utils import time import datetime import threading import fileinput #import psutil import shutil import tempfi...
cluster_log_manager.py
import multiprocessing from types import TracebackType from typing import Any, Callable, Optional class ClusterLogManager: def __init__(self, logs_func: Callable[..., Any]) -> None: self._logs_process: Optional[multiprocessing.Process] = None self.logs_func = logs_func def __enter__(self) -> ...
utils.py
from __future__ import annotations import asyncio import contextvars import functools import importlib import inspect import json import logging import multiprocessing import os import pkgutil import re import socket import sys import tempfile import threading import warnings import weakref import xml.etree.ElementTre...
testSharedMemWriter.py
import numpy as np import sysv_ipc as ipc import time from subprocess import call from threading import Thread import cv2 from picamera.array import PiRGBArray from picamera import PiCamera def startDisplay(): call(["./OGLESSimpleImageWithIPC"]) th1 = Thread(target=startDisplay) th1.start() time.sleep(1) key = ipc...
executorwebdriver.py
import json import os import socket import threading import traceback import urlparse import uuid from .base import (CallbackHandler, RefTestExecutor, RefTestImplementation, TestharnessExecutor, extra_timeout, strip_server) ...
gso.py
from pgso.evaluate import error, evaluate, update_velocity, update_position from multiprocessing import Manager, Process, Lock from pgso.init_particles import create_n_particles from sklearn.utils import shuffle from tqdm import tqdm from numba import jit import numpy as np import copy def sample_data(X_train, y_trai...
DeviceManager.py
import threading from Device import Device class DeviceManager: def __init__(self): self.devices = [] def register_device(self, device: Device): self.devices.append(device) def start_devices(self): threads = list() for device in self.devices: thread = threadi...
e2e.py
""" This is an end to end release test automation script used to kick off periodic release tests, running on Anyscale. The tool leverages app configs and compute templates. Calling this script will run a single release test. Example: python e2e.py --test-config ~/ray/release/xgboost_tests/xgboost_tests.yaml --test-...
data_source_implements.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...
japplr.py
from ziprecruiter import ZipRecruiter from monster import Monster from tqdm import trange, tqdm import schedule, time, traceback import threading SITES = { 'ziprecruiter' : ZipRecruiter ,'monster' : Monster } class Japplr(): __api_throttle_secs = 3 def __init__( self, accounts={}, searches=[], **global_filters...
wait_rabbitmq.py
import sys import json import time import pika import queue import pickle import logging from threading import Thread from concurrent.futures import ThreadPoolExecutor, wait logger = logging.getLogger(__name__) logging.getLogger('pika').setLevel(logging.WARNING) ALL_COMPLETED = 1 ANY_COMPLETED = 2 ALWAYS = 3 def wa...
studio.py
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # # 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 us...
sampler.py
# (C) Datadog, Inc. 2018 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) # flake8: noqa """ A lightweight Python WMI module wrapper built on top of `pywin32` and `win32com` extensions. **Specifications** * Based on top of the `pywin32` and `win32com` third party extensions only * Co...
DataCollection.py
''' Created on 21 Feb 2017 @author: jkiesele ''' #from tensorflow.contrib.labeled_tensor import batch #from builtins import list from __future__ import print_function import os from Weighter import Weighter from TrainData import TrainData, fileTimeOut #for convenience import logging from pdb import set_trace import co...
popen.py
import os import sys import time import atexit import select import socket import signal import logging from six import string_types from threading import RLock, Thread, Condition from subprocess import PIPE, STDOUT from .scheduler import ProcScheduler, CONFIG, _TYPE_SIGNAL logger = logging.getLogger(__name__) PIPE_BU...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' from __future__ import absolute_import # Import python libs from __future__ import print_function import copy import errno import fnmatch import hashlib import logging import multiprocessing import os import re import salt import signal import sys import thr...
step_6_user_topic_modelling.py
# -*- coding: utf-8 -*- """ Created on Sat Aug 21 12:49:26 2021 @author: roman """ from flask import Flask import os import threading import atexit import logging # path for debugging #pth = 'E:\\gh2021\\raw_data\\eedd150a524d388e5f8bd8bfbd81770b34197a8e57f41fa987507ee3ee5f2e8d\\2021-08-21-11-05-16.wav' threshold =...
main.py
import traceback from selenium import webdriver import time from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.action_chains import ActionChains import random import requests import json from fake_useragent import UserAgent from selenium.webdriver.common.by import By from selenium.webdriver...
player.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ 对mplayer及其他播放器(TODO)的控制 player = MPlayer() 方法: player.start(url) player.pause() player.quit() player.loop() player.set_volume(50) player.time_pos player.is_alive queue自定义get_song方法, 从中取出url, 进行播放(暂时, 以后可以抽象) player.start_queue(que...
controller.py
#!/usr/bin/env python """A controller """ import json import logging import os import time import httplib import sys import requests from kubernetes import client, config from kubernetes.client.rest import ApiException import crd from multiprocessing import Process import paho.mqtt.client as mqtt GROUP = "kubeless....
monitor.py
import os,threading, time from threading import Semaphore,Thread #seccion Critica: variable global que sera utilizada por #todos los Hilos de mi proceso principal semaforo = threading.Semaphore() #un solo hilo puede entrar a zona critica """ Todo el bloque siguiente representa a los comandos soportados por el monito...
point_cloud_websocket.py
import tornado, tornado.websocket import threading import numpy as np import time class EchoWebSocket(tornado.websocket.WebSocketHandler): t = time.clock() def open(self): print("WebSocket opened") self.send_data() def on_message(self, message): print message # self.write_m...
commander.py
import random import time from multiprocessing import Process from threading import Thread from typing import Union from executors.conditions import conditions from executors.controls import pc_sleep from executors.logger import logger from executors.offline import offline_communicator from executors.others import tim...
DevlprClient.py
import asyncio import threading import queue import logging from time import sleep from typing import Optional from pydevlpr_protocol import unwrap_packet, wrap_packet, PacketType, DaemonSocket from .typing import Callback, CallbackList class DevlprClient: ADDRESS = ('localhost', 8765) def __init__(self) -> N...
control_latest.py
#!/usr/bin/env python3 """ Caveat when attempting to run the examples in non-gps environments: `drone.offboard.stop()` will return a `COMMAND_DENIED` result because it requires a mode switch to HOLD, something that is currently not supported in a non-gps environment. """ import asyncio from math import sqrt from mav...
services.py
import datetime import sys import random import time from base64 import b64decode from ripper import context, common, statistic, arg_parser from ripper.attacks import * from ripper.constants import * from ripper.common import get_current_ip, format_dt, ns2s from ripper.health_check import fetch_host_statuses from ripp...
machine_shipment.py
#!/usr/bin/env pybricks-micropython import time from threading import Thread import ujson import urequests from pybricks.ev3devices import Motor, ColorSensor, UltrasonicSensor from pybricks.parameters import Port, Stop, Direction from pybricks.tools import wait # Initialize the motors belt_motor = Motor(Port.D, Direc...
learn_socket4_server_mulit_thread.py
import socket import threading import socketserver class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler): def handle(self): data = str(self.request.recv(1024), 'ascii') response = bytes("{} = {}".format(data, eval(data)), 'ascii') self.request.sendall(response) class Threaded...
chatcommunicate.py
# coding=utf-8 from chatexchange import events from chatexchange.browser import LoginError from chatexchange.messages import Message from chatexchange_extension import Client import collections import itertools import os import os.path import pickle import queue import regex import requests import sys import threading ...
pebble.py
# Copyright 2021 Canonical 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 in writing, s...
base_test.py
import pyactiveresource from shopify.base import ShopifyConnection import shopify from test.test_helper import TestCase from pyactiveresource.activeresource import ActiveResource from mock import patch import threading class BaseTest(TestCase): @classmethod def setUpClass(self): shopify.ApiVersion.d...
u2f.py
""" Copyright 2018-present SYNETIS. 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, s...
miner.py
## mine information from wiki pages ## # import from pyquery import PyQuery as pq import urllib.request as urllib2 import html.parser from math import log import re import queue from threading import Thread, Lock # constants wiki_base = "http://en.wikipedia.org" wiki = wiki_base + "/wiki/Category:V...
full_duplex.py
import threading import time class Duplex(object): """ Duplex Agent The full duplex agent runs in the background. This is responsible for maintaining `alive` (running) state when the main thread is running. This also allows duplex communication (lots of delay though) with the server without using `se...
VehicleMain.py
from multiprocessing import Process from .Service.MqttS import * from .Service.PlaystationS import * from .Hexapod.hexapod import Hexapod domoticzTopic = "domoticz/in" msgValueDriving = "Value" class TubberCar: subscribeTB = "home/vehicle/tubbercar" def __init__(self): print("Making TubberCar ready,...
test_state.py
# -*- coding: utf-8 -*- ''' Tests for the state runner ''' # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals import errno import logging import os import shutil import signal import tempfile import time import textwrap import threading from salt.ext.six.moves import queue #...
remote_test.py
### Copyright 2014, MTA SZTAKI, www.sztaki.hu ### ### 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 applicab...
core.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """PY4WEB - a web framework for rapid development of efficient database driven web applications""" # Standard modules import asyncio import cgitb import code import copy import datetime import enum import functools import http.client import http.cookies import importlib.ma...
models.py
from cassiopeia import riotapi from cassiopeia.type.api.exception import APIError import requests from py_gg import InvalidAPIKeyError import py_gg import threading class ChampionPickGenerator(object): """This class collects all API data needed to generate the list of best champs""" def __init__(self, summone...
testunit.py
''' Run a unit test ''' import sys import os import copy import pandas as pd from pprint import pformat import numpy as np import multiprocessing as mp from port import PortHandler from vectorgenerator import TestVectorGenerator from simulation import RunVector from linearregression import LinearRegressionSM from t...
service.py
""" Base types for all anchore engine services """ import copy import connexion import enum from flask import g import json import os from pathlib import Path import yaml import time import threading import traceback from anchore_engine.configuration import localconfig from anchore_engine.subsys import logger, metr...
datasets.py
import glob import math import os import random import shutil import time from pathlib import Path from threading import Thread import cv2 import numpy as np import torch from PIL import Image, ExifTags from torch.utils.data import Dataset from tqdm import tqdm from utils.utils import xyxy2xywh, xywh2...
test9.py
import zmq from threading import Thread import time def server_init(port=6666): context = zmq.Context() socket = context.socket(zmq.PAIR) socket.bind("tcp://127.0.0.1:%s" % port) print('Server init ' + str(port)) return socket def client_init(port=6666): context = zmq.Context() socket = co...
manager.py
# -*- coding: utf-8 -*- """ conpaas.services.taskfarm.manager.manager ========================================= ConPaaS TaskFarm manager. :copyright: (C) 2010-2013 by Contrail Consortium. """ from threading import Thread from conpaas.core.expose import expose from conpaas.core.manager import BaseMa...
test_streams.py
"""Tests for streams.py.""" import gc import os import queue import pickle import socket import sys import threading import unittest from unittest import mock from test import support try: import ssl except ImportError: ssl = None import asyncio from test.test_asyncio import utils as test_utils def tearDown...
server.py
#!/usr/bin/python # Author Trevon Williams # Homework 1 import threading import datetime import socket import sys import os class Server: def __init__(self): self.threads = {} # Uses running directory for web contents self.ROOT_DIR = os.path.dirname(os.path.realpath(__file__)) ...
traincontroller.py
""" Training a linear controller on latent + recurrent state with CMAES. This is a bit complex. num_workers slave threads are launched to process a queue filled with parameters to be evaluated. """ import argparse import sys from os.path import join, exists from os import mkdir, unlink, listdir, getpid from time impor...
status_website.py
#!/usr/bin/env python3 # # Website import os import logging import yaml import multiprocessing as mp import threading from queue import Empty import socket from textwrap import dedent from astropy.time import Time from darc.definitions import CONFIG_FILE, MASTER, WORKERS from darc import util from darc.control import...
devilVision.py
#!/usr/bin/env python3 import json import time import sys from threading import Thread from cscore import CameraServer, VideoSource from networktables import NetworkTablesInstance import cv2 import numpy as np from networktables import NetworkTables import math import datetime class FPS: def __init__(self): self....
reinstall.py
from core.config import Settings from core.providers.aws.install import Install from core import constants as K from core.terraform import PyTerraform from threading import Thread from datetime import datetime import os import sys class ReInstall(Install): """ AWS provider for destroy command Attributes:...
AMQP_client.py
# -*- coding: utf-8 -*- #=============================================================================== # Author : James Chapman # License : BSD # Date : 4 August 2015 # Description : AMQP client #=============================================================================== import threading import p...
vehicle.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jun 25 10:44:24 2017 @author: wroscoe """ import time from threading import Thread from .memory import Memory from prettytable import PrettyTable class PartProfiler: def __init__(self): self.records = {} def profile_part(self, p): ...
Navigator_rs.py
#encoding=utf-8 ''' project overview: Subscribe: 1.slam pose(global/local pose) * 2.octomap_server/global map 3.local pointcloud/local octomap 4.target input(semantic target/visual pose target/gps target) Publish: 1.Mavros(amo) Command 2.Navigator status Algorithms: 1.D* 2.state transfer ...
AWSBucketDump.py
#!/usr/bin/env python # AWSBucketDump is a tool to quickly enumerate AWS S3 buckets to look for loot. # It's similar to a subdomain bruteforcer but is made specifically to S3 # buckets and also has some extra features that allow you to grep for # delicous files as well as download interesting files if you're not # afr...
core.py
# -*- 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 agreed to in writing, software ...
oauth.py
# Copyright 2022 The Sigstore Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
donkey_sim.py
""" file: donkey_sim.py author: Tawn Kramer date: 2018-08-31 """ import asyncore import base64 import math import time from io import BytesIO from threading import Thread import numpy as np from PIL import Image from donkey_gym.core.fps import FPSTimer from donkey_gym.core.tcp_server import IMesgHandl...
progress.py
#!/usr/bin/python # -*- coding:utf-8 -*- # Copyright 2019 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 r...
ppo_v3.py
import numpy as np import pydart2 as pydart from DartFootDeep.sh_v3.dart_env_v3 import HpDartEnv from itertools import count import time import os from multiprocessing import Process, Pipe, Manager, Lock from threading import Timer import copy import torch from torch import optim from DartFootDeep.sh_v3.TorchNN imp...
ParallelAlgoTest.py
########################################################################## # # Copyright (c) 2018, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
__init__.py
"""Helper operations and classes for general model building. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals import collections import pickle import os import time import warnings import numpy as np import pandas as pd import tensorflow as tf import tem...