source
stringlengths
3
86
python
stringlengths
75
1.04M
learn.py
# # Unity ML-Agents Toolkit import logging from multiprocessing import Process, Queue import os import glob import shutil import numpy as np import yaml from docopt import docopt from typing import Any, Callable, Dict, Optional from mlagents.trainers.trainer_controller import TrainerController from mlagents.trainer...
gdbclientutils.py
import ctypes import errno import io import threading import socket import traceback from lldbsuite.support import seven def checksum(message): """ Calculate the GDB server protocol checksum of the message. The GDB server protocol uses a simple modulo 256 sum. """ check = 0 for c in message: ...
gui_pyqtgraph.py
# -*- coding: utf-8 -*- ''' GUI for quicktracer ''' from pyqtgraph.Qt import QtGui, QtCore import pyqtgraph as pg import sys import os import threading import json import traceback import importlib.util from displays import default_display_classes ANIMATION_UPDATE_INTERVAL = 10 # ms # Globals key_to_display = {} ...
python_pg.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) == ...
recognize_listener.py
# coding: utf-8 # Copyright 2018 IBM 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...
HiwinRA605_socket_ros_test_20190625190025.py
#!/usr/bin/env python3 # license removed for brevity #ๆŽฅๆ”ถ็ญ–็•ฅ็ซฏๅ‘ฝไปค ็”จSocketๅ‚ณ่ผธ่‡ณๆŽงๅˆถ็ซฏ้›ป่…ฆ import socket ##ๅคšๅŸท่กŒๅบ import threading import time ## import sys import os import numpy as np import rospy import matplotlib as plot from std_msgs.msg import String from ROS_Socket.srv import * from ROS_Socket.msg import * import HiwinRA605_s...
blockimgdiff.py
# Copyright (C) 2014 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 required by applicable law ...
session.py
import logging import sys import time from threading import Thread from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from sqlalchemy_utils import database_exists from app.core import settings from app.db import Base from app.utils.decorators import use_callbacks log = logging.getLogger(__n...
distributed.py
""" Pytorch Distributed utils This piece of code was heavily inspired by the equivalent of Fairseq-py https://github.com/pytorch/fairseq """ import os import signal import math import pickle import torch.distributed from onmt.utils.misc import set_random_seed from onmt.utils.logging import init_logger, logger...
particle02.py
# demonstration of a particle cloud (non-interacting) # similar to particle01.py except that each new state is retained in # memory and used to assemble a movie with the number of states # provided below from random import random from pymol import cmd from time import sleep particle_count = 1000 box_size = 500.0 ...
base.py
# Copyright 2021 iiPython # Modules import os import time from threading import Thread from datetime import datetime from .utils import Utils from .console import Console from .core.emoji.core import em from .struct.status import codes from .struct.client import Client from .core.socket import Socket, SocketWrapper ...
webserver.py
''' โ–„โ–€โ–„โ–€โ–„โ–€โ–„โ–€โ–„โ–€โ–„โ–€โ–„โ–€โ–„ โ–„โ–€โ–„โ–€โ–„โ–€โ–„โ–€โ–„โ–€โ–„โ–€โ–„โ–€โ–„ โ–„โ–€โ–„โ–€โ–„โ–€โ–„โ–€โ–„โ–€โ–„โ–€โ–„โ–€โ–„ ZUMBY NSR CC [...] ''' from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "I'm online" def run(): app.run(host='0.0.0.0',port=xxxx) def keep_alive(): t = Thread(target=run) t.start()
scanner.py
import ipaddress import os import socket import struct import sys import threading import time SUBNET = '192.168.1.0/24' MESSAGE = 'PYTHONRULES!!!' class IP: def __init__(self, buff=None): header = struct.unpack('<BBHHHBBH4s4s', buff) self.ver = header[0] >> 4 self.ihl = header[0] & 0xF ...
checkHeader.py
import openpyxl import requests import threading import json import os def request_header(v, failed_links): result = requests.head(str(v["avatar"])) if result.status_code != 200: failed_links[v["name"]] = str(v["avatar"]) def test_header(sheet, failed_links): values = sheet["่ง’่‰ฒ"].to_dict(orient="r...
worker.py
import argparse import copy import os import sys import os.path import glob import json import random import shutil import subprocess import tempfile import traceback import logging import uuid import socket from time import sleep, gmtime, strftime import datetime import threading from flask import Flask import arch...
slurm.py
""" DMLC submission script, SLURM version """ # pylint: disable=invalid-name from __future__ import absolute_import import subprocess, logging from threading import Thread from . import tracker def get_mpi_env(envs): """get the slurm command for setting the environment """ cmd = '' for k, v in envs.it...
test_streaming_pull_manager.py
# Copyright 2018, 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,...
crlf.py
#!/usr/bin/python3.5 # I don't believe in license. # You can do whatever you want with this program. import os import sys import re import time import copy import random import argparse import requests import urllib.parse from functools import partial from threading import Thread from queue import Queue from multipro...
module.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...
hrv.py
#!/usr/bin/env python # vim: ts=4 sw=4 et """ =========== HRV Monitor =========== The following script checks the high-rate-veto for each PMT. """ # Author: Tamas Gal <tgal@km3net.de> # License: MIT from datetime import datetime import io from collections import defaultdict import threading import time import km3pip...
mails.py
from threading import Thread from flask import current_app, render_template from flask_mail import Message from ablog.extensions import mail def _send_async_mail(app, message): with app.app_context(): mail.send(message) def send_mail(to, subject, template, **kwargs): message = Message(current_app....
_link_layer.py
# Copyright (c) 2020 UAVCAN Consortium # This software is distributed under the terms of the MIT License. # Author: Pavel Kirienko <pavel@uavcan.org> from __future__ import annotations import sys import time import typing import ctypes import socket import logging import threading import dataclasses import pyuavcan fr...
receive_audio.py
from root import * import pyaudio import time import redis # Audio info CHUNK = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 16000 SILENCE = chr(0)*CHUNK*2 # Buffers and locks audio_buffer = b"" audio_buffer_lock = threading.Lock() # Connection info parallel_connections = 10 def new_connection(ip): s = s...
ShellSort.py
from Algorithims import Algorithms import time import threading class ShellSort(Algorithms): def __init__(self, data, delay): Algorithms.__init__(self) self.data = data self.delay = delay sorting_thread = threading.Thread(target=self.sort, args=(self.data, self.drawData, self.dela...
ServiceManager.py
import threading import importlib from core.Service import Service class ServiceManager: def __init__(self, core, config): self.core = core self.services = {} self.readConfigFile(config) def readConfigFile(self, config): for sectionName in config.sections(): inde...
opencti_connector_helper.py
import base64 import datetime import json import logging import os import ssl import sys import threading import time import uuid from typing import Callable, Dict, List, Optional, Union import pika from pika.exceptions import NackError, UnroutableError from sseclient import SSEClient from pycti.api.opencti_api_clien...
tunnel.py
""" tunnel.py will tunnel a TCP connection to the service (typically a shell) with ID equal to SERVICE_UUID over a WebSocket connection to a Determined master at MASTER_ADDR. """ import argparse import io import os import socket import ssl import sys import threading from typing import Optional import lomond from de...
test_threaded.py
import os import sys import signal import threading from multiprocessing.pool import ThreadPool from time import time, sleep import pytest import dask from dask.compatibility import PY2 from dask.threaded import get from dask.utils_test import inc, add def test_get(): dsk = {'x': 1, 'y': 2, 'z': (inc, 'x'), 'w'...
base.py
""" Progress bar implementation on top of prompt_toolkit. :: with ProgressBar(...) as pb: for item in pb(data): ... """ import datetime import functools import os import signal import threading import traceback from asyncio import get_event_loop, new_event_loop, set_event_loop from typing impo...
server.py
import time import board import neopixel import threading from flask import Flask # Choose an open pin connected to the Data In of the NeoPixel strip, i.e. board.D18 # NeoPixels must be connected to D10, D12, D18 or D21 to work. pixel_pin = board.D21 # The number of NeoPixels num_pixels = 137 # The order of the pix...
pygments_style.py
"""Display a "Syntax Colors" menu.""" from __future__ import annotations import threading import tkinter from pygments import styles, token from porcupine import get_main_window, get_tab_manager, menubar, settings, utils def get_colors(style_name: str) -> tuple[str, str]: style = styles.get_style_by_name(style...
module2.py
#------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: Rajesh # # Created: 24-12-2019 # Copyright: (c) Rajesh 2019 # Licence: <your licence> #------------------------------------------------------------------------------- import os i...
deyaml.py
"""The Walking Thread""" import os import threading, queue from pathlib import Path import yaml import string kolejka_folder = queue.Queue() CODE_PATH = "/home/kris/workshops/tools/copypaster/dirtynotes/folders/maps" DECKS = "decks" YAML_FILES = ( '.yaml', '.yml', ) CLICK_COUNT = "click_count" INFO = "info"...
firewall.py
#!/usr/bin/env python3 import netfilterqueue import scapy.all as scapy from scapy.layers import http import argparse from threading import * from time import * import re connected_clients = [] blocked_websites = [] file_name = re.sub("\s\d\d:\d\d:\d\d", "", asctime()) log_file = open(os.path.abspath(os.getcwd())+"/L...
algo_one.py
from functools import reduce from sys import * import numpy as np import random as r import socket import struct import subprocess as sp import threading from threading import Thread import ast import time import datetime as dt import os import psutil from netifaces import interfaces, ifaddresses, AF_INET import paho.m...
Semaphore.py
import logging import threading import time import random LOG_FORMAT = '%(asctime)s %(threadName)-17s %(levelname)-8s %(message)s' logging.basicConfig(level=logging.INFO, format=LOG_FORMAT) semaphore = threading.Semaphore(0) item = 0 def consumer(): logging.info('Consumer is waiting') semaphore.acquire() ...
runner.py
#!/usr/bin/env python3 # Copyright 2010 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """This is the Emscripten test runner. To run ...
multi_echo_server.py
#!/usr/bin/env python3 import socket import time from multiprocessing import Process HOST = "" PORT = 8001 BUFFER_SIZE = 1024 def main(): with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind((HOST, PORT)) s.listen(2) ...
remote_runner.py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import io import sys from threading import Thread import paramiko class RemoteRunner: def __init__(self, ipaddress=None, username=None, password=None, command=None, verbose=True, logfile=None, timeout=None, ...
main_test_gpu.py
from multiprocessing import Process import wikipedia import spacy import time import sys import os #By Anton Rakos #If the user has declared that a given node has a #GPU with the appropriate drivers and tool kits install then they may run a test bench using the spaCy NLP tool kit. spacy.prefer_gpu() nlp = spacy.load('...
background.py
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
manager.py
from cloudbutton.multiprocessing import Process, Manager def f(d, l): d[1] = '1' d['2'] = 2 d[0.25] = None l.reverse() if __name__ == '__main__': with Manager() as manager: d = manager.dict() l = manager.list(range(10)) p = Process(target=f, args=(d, l)) p.start(...
exp_utils.py
#!/usr/bin/env python # Copyright 2018 Division of Medical Image Computing, German Cancer Research Center (DKFZ). # # 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...
client.py
# -*- coding: utf-8 -*- # author: inspurer(ๆœˆๅฐๆฐด้•ฟ) # pc_type lenovo # create_date: 2018/12/15 # file_name: client.py # description: ๆœˆๅฐๆฐด้•ฟ๏ผŒ็ƒญ่ก€ๆœชๅ‡‰ from socket import * from threading import Thread import wx import os from tkinter import filedialog import tkinter import json import wx.lib....
baseplugin.py
import threading import queue import time import numpy as np from implotwidget import ImplotWidget # Photon data. Using fixed size numpy arrays right now. class PhotonData(object): def __init__(self, chunksize = 244): # x, y, and pulse height self.x = np.zeros(chunksize, dtype = np.uint16) ...
word2vec_optimized.py
# Copyright 2015 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 applicable law or a...
rubash.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Hint: https://stackoverflow.com/questions/19880190/interactive-input-output-using-python # and https://stackoverflow.com/questions/31833897/python-read-from-subprocess-stdout-and-stderr-separately-while-preserving-order # MS-DOS interactive cmd.exe: https://stackoverflow.co...
winpty.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
tests.py
import time from contextlib import suppress from datetime import datetime from logging.handlers import RotatingFileHandler from threading import Thread import prequests import logging from prequests import content_has logging.basicConfig(level=logging.DEBUG, format='%(asctime)s.%(msecs)03d|%(leve...
proxy-scraper.py
####### ########## ####### ####### ''' Date: August 2016 Script downloads the best HTTP proxies from free proxy websites Saves a txt file with 1 proxy per line This list can easily be used with other bots/programs ''' ####### ####### ####### ########## import time import datetime import urllib, urllib2 impo...
frame_based_flow.py
# Copyright (c) 2017, 2018 Jae-jun Kang # See the file LICENSE for details. import sys import time from threading import Lock, Thread from x2py.event import Event from x2py.event_queue import EventQueue from x2py.flow import Flow from x2py.util.atomic import AtomicInt from x2py.util.trace import Trace class Time(obj...
test_websocket_provider.py
import asyncio from concurrent.futures import ( TimeoutError, ) import pytest from threading import ( Thread, ) import websockets from tests.utils import ( wait_for_ws, ) from web3 import Web3 from web3.exceptions import ( ValidationError, ) from web3.providers.websocket import ( ...
custom_loop.py
import asyncio import logging # Logging setup import threading import time from concurrent.futures import ThreadPoolExecutor class AsyncioLoggingFilter(logging.Filter): def filter(self, record): task = asyncio.Task.current_task() record.task = f'[task {id(task)}]' if task else '[NOLOOP ...
cyber_launch.py
#!/usr/bin/env python3 # **************************************************************************** # Copyright 2018 The Apollo 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 o...
test_closing.py
from fixtures import * # noqa: F401,F403 from lightning import RpcError from utils import only_one, sync_blockheight, wait_for, DEVELOPER, TIMEOUT, VALGRIND, SLOW_MACHINE import queue import pytest import re import threading import unittest @unittest.skipIf(not DEVELOPER, "Too slow without --dev-bitcoind-poll") de...
parallel_io.py
#!/usr/bin/python """ (C) Copyright 2020-2022 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent """ import threading import subprocess #nosec import time from getpass import getuser import general_utils from ClusterShell.NodeSet import NodeSet from exception_utils import CommandFailure from fio_tes...
spinner.py
# From: https://stackoverflow.com/a/39504463 # License: Creative Commons Attribution-Share Alike # Copyright: Victor Moyseenko import sys import time import threading class Spinner: busy = False delay = 0.1 @staticmethod def spinning_cursor(): while 1: for cursor in "|/-\\": ...
bazelci.py
#!/usr/bin/env python3 # # Copyright 2018 The Bazel 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 ...
utils.py
import json import requests def run_async(func): """Function decorator intended to make "func" run in a separate thread (asynchronously). :param func: the function to run asynchronously :return: the created Thread object that the function is running in. """ from threading import Thread f...
humidity.py
#! /usr/bin/python3 import logging import multiprocessing from concurrent.futures.thread import ThreadPoolExecutor from multiprocessing import Process import statsd import Adafruit_DHT import time import boto3 import sys import subprocess import os from timeit import default_timer as timer from threading import Thread ...
non_block_client.py
import websocket import threading from time import sleep def on_message(ws, message): print(message) def on_close(ws): print("closed") if __name__ == "__main__": websocket.enableTrace(True) ws = websocket.WebSocketApp("ws://localhost:9001", on_message = on_message, on_close = on_close) wst = thre...
test_run_and_rebot.py
import unittest import time import glob import sys import threading import tempfile import signal import logging from os.path import abspath, dirname, join, exists, curdir from os import chdir from robot import run, rebot from robot.model import SuiteVisitor from robot.running import namespace from robot.utils import ...
ui.py
import tkinter as tki from tkinter import Toplevel, Scale import threading import datetime import os import time import platform class TelloUI(object): """ Wrapper class to enable the GUI. """ def __init__(self, tello): """ Initializes all the element of the GUI, supported by Tkinter ...
make.py
import os import glob import time import shutil import bpy import json import stat from bpy.props import * import subprocess import threading import webbrowser import arm.utils import arm.write_data as write_data import arm.make_logic as make_logic import arm.make_renderpath as make_renderpath import arm.make_world as ...
file_stream.py
import base64 import binascii import collections import itertools import logging import os import sys import random import requests import threading import time import wandb from wandb import util from wandb import env import six from six.moves import queue from ..lib import file_stream_utils logger = logging.getL...
PandaBox.py
from .Detector import Detector, TriggeredDetector, BurstDetector from ..environment import env import time import numpy as np import socket from threading import Thread import select SOCK_RECV = 4096 RECV_DELAY = 1e-4 class PandaBox(Detector, TriggeredDetector, BurstDetector): """ Basic class for treating a...
manager.py
#!/usr/bin/env python3 import datetime import importlib import os import sys import fcntl import errno import signal import shutil import subprocess import textwrap import time import traceback from common.op_params import opParams from multiprocessing import Process from typing import Dict from common.basedir import...
bot.py
import telebot import subprocess import json import os from threading import Thread , Lock from queue import Queue, Empty process = None q = None t = None cwd = os.path.dirname(os.path.realpath(__file__)) config_path = os.path.join(cwd,'config.json') with open(config_path) as configFile: config = json.load(co...
main.py
import configparser import sys from operator import itemgetter from PyQt5 import QtWidgets from PyQt5.QtWidgets import * from PyQt5.QtCore import Qt, QTimer from PyQt5.QtGui import QIcon import requests import quotation_func import exchange_func import config import time import datetime import schedule import random i...
lm_upload.py
# -*- coding: utf-8 -*- import os import threading from lm.lm_api import LMApi class LMUpload(object): def __init__(self, files, log_path): self.files = files self.log_path = log_path self.api = LMApi() def set_upload(self, task_image_path): threads = [] for file in s...
test_utils.py
"""Utilities shared by tests.""" import collections import contextlib import io import logging import os import re import socket import socketserver import sys import tempfile import threading import time import unittest import weakref from unittest import mock from http.server import HTTPServer from wsgiref.simple_...
app.py
import asyncio from threading import Thread import sys, os, time from sensor_program import coap_server from gateway_program.client import gateway_client from gateway_program.broker import mqtt_broker from user_interface_program.client import mqtt_client from user_interface_program.front_end import flask_server def m...
server.py
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # region header '''Provides server and request handler classes.''' # # python3.5 # # pass from __future__ import absolute_import, division, print_function, \ unicode_literals # # ''' For conventions see "boostnode/__init__.py" on \ https://github.com/thai...
actions.py
import netmiko from getpass import getpass from netmiko import file_transfer from netmiko.ssh_exception import NetMikoTimeoutException from netmiko.ssh_exception import NetMikoAuthenticationException from netmiko import SCPConn import string from threading import Thread import pathlib from common import common from thr...
resh.py
#!/usr/bin/python3 import os import socket import sys import termios import threading import tty import time def setTTY(): fd = sys.stdin.fileno() oldSet = termios.tcgetattr(fd) # os.system('stty raw -echo') tty.setraw(0) return fd, oldSet def resetTTY(fd, oldSet): termios.tcsetattr(fd, termios.TCSADRAIN, old...
test_logging.py
# Copyright 2001-2017 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
captive_portal.py
#!/usr/bin/python3 import http.server import subprocess import cgi import os import sys import datetime import binascii import re import threading import ssl import urllib import json import html import socket import time import sqlite3 import hashlib ''' Configuration -----------------------------------''' # Serv...
udpplus.py
from socket import * from time import ctime, sleep import random import threading class UDPPlus: def __init__(self, port): # ๅ…จๅฑ€ๅ‚ๆ•ฐ้…็ฝฎ self.encoding = "utf-8" # ไฝฟ็”จ็š„็ผ–็ ๆ–นๅผ self.broadcastPort = port # ๅนฟๆ’ญ็ซฏๅฃ self.broadcastHost = self.get_addr() # ๅนฟๆ’ญIP # ๅˆ›ๅปบๅนฟๆ’ญๆŽฅๆ”ถๅ™จ self.recvSo...
test_mainwindow.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright ยฉ Spyder Project Contributors # # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) # ----------------------------------------------------------------------------- """ Te...
_asyncio.py
import asyncio import concurrent.futures import math import socket import sys from collections import OrderedDict, deque from concurrent.futures import Future from dataclasses import dataclass from functools import wraps from inspect import isgenerator from socket import AddressFamily, SocketKind, SocketType from threa...
test_producer.py
import os import json import pytest import requests_mock import time import threading from producer import Producer from kafka import KafkaConsumer default_config = [ {"url": "https://developers.italia.it", "regexp": "data"}, {"url": "https://oruga.io"}, {"url": "https://buefy.org", "regexp": "Vue"}, ] ...
main.py
import json import base64 import logging from threading import Lock from datetime import datetime, timedelta import boto3 import requests from botocore.exceptions import ClientError from flask import Flask, abort, jsonify, request from flask_cors import CORS from flask_marshmallow import Marshmallow from blackfynn imp...
Hiwin_RT605_Socket_v3_20190628113341.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_v3 as TCP import HiwinRA605_socket_Taskcmd_v3 as Taskcmd import numpy as np from std_msgs.msg import String from ROS_Socket.s...
app.py
from flask import Flask, abort, request, render_template, json, jsonify app = Flask(__name__) app.static_folder = 'static' @app.before_request def limit_remote_addr(): if request.remote_addr != '127.0.0.1': abort(403) # Forbidden @app.route('/') def hello(): return render_template('index.html') @ap...
fly_test.py
from time import sleep from tello import Tello import threading def _telloA(): tello = Tello('192.168.50.201',8889) tello.send_command('command') sleep(1) tello.send_command('speed 80') sleep(1) tello.send_command('battery?') sleep(1) tello.send_command('takeoff') sleep(2) tello...
base.py
import base64 import hashlib from six.moves.http_client import HTTPConnection import io import json import os import threading import traceback import socket import sys from six.moves.urllib.parse import urljoin, urlsplit, urlunsplit from abc import ABCMeta, abstractmethod from ..testrunner import Stop from .protocol ...
ib_broker.py
# Copyright 2016-present CERN โ€“ European Organization for Nuclear Research # # 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...
hacklib.py
'''The MIT License (MIT) Copyright (c) 2016 Leon Li (leon@apolyse.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, m...
common.py
# Copyright 2021 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from enum import Enum from functools import wraps from pathlib import...
Server.py
from socket import * from threading import * clients = set() nicknames = [] def clientThread(clientSocket, clientAddress,nickname): while True: try: message = clientSocket.recv(1024).decode("utf-8") # print(clientAddress[0] + ":" + str(clientAddress[1]) +" says: "+ mess...
scene_handler.py
from beatmap_reader import * #from hand_tracking import * import pyglet import time from pyglet.gl import * import cv2 import numpy as np from PIL import Image import mediapipe as mp import threading mp_drawing = mp.solutions.drawing_utils mp_drawing_styles = mp.solutions.drawing_styles mp_hands = mp.solutions.hands ...
Management.py
# MIT License # Copyright (c) 2019 Fernando Perez import numpy as np import time import cv2 try: from PIL import Image except ModuleNotFoundError as e: pass try: # It is usefull if you want to detect scene changes import imagehash except ModuleNotFoundError as e: pass try: # It is usefull if ...
build_qt.py
import subprocess as sp import multiprocessing as mp import os import time import tarfile import argparse import threading import platform import shutil import hashlib import blobfile as bf from .common import run, GCS_BUCKET BUILD_VERSION = 11 def cache_folder(name, dirpath, options, build_fn): if os.path.exi...
kaldi_io.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2014-2016 Brno University of Technology (author: Karel Vesely) # Licensed under the Apache License, Version 2.0 (the "License") import numpy as np import sys, os, re, gzip, struct ################################################# # Adding kaldi tools to shel...
coords_cohort_1_source_builder.py
#!/usr/bin/env python """ ------------- Copyright (c) 2015. Genome Research Ltd. Author: Deciphering Development Disorders Project Team. 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....
threaded_busy.py
# Copyright 2016 Uber Technologies, 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 ...
Tracking.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # "Tracking Bugs" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/Tracking.html # Last change: 2022-01-17 14:10:37+01:00 # # Copyright (c) 2021 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University...
consumer_api.py
from __future__ import print_function import asapo_consumer import json import sys import time from threading import Thread thread_res = 0 def exit_on_noerr(name): print(name) sys.exit(1) def assert_metaname(meta, compare, name): print("asserting meta for " + name) if meta['name'] != compare: ...
Client.py
# coding: utf-8 ######################################################################### # ็ฝ‘็ซ™: <a href="http://www.crazyit.org">็–ฏ็‹‚Java่”็›Ÿ</a> # # author yeeku.H.lee kongyeeku@163.com # # # # version...
clouderamanager.py
import os import time import threading # import subprocess import socket # import re # Ansible <v2 has a security vulnerability and v2 has a different API # Disabling Cloudera manager as don't believe it's used by anyone any more. # from ansible.runner import Runner # from ansible.inventory import Inventory from cm_a...