source
stringlengths
3
86
python
stringlengths
75
1.04M
camera_pi.py
import time import io import threading import picamera class Camera(object): thread = None # background thread that reads frames from camera frame = None # current frame is stored here by background thread last_access = 0 # time of last client access to the camera def initialize(self): if ...
app_wu1109.py
from datetime import datetime from flask import Flask, request, render_template, session, redirect, Response, flash from datetime import timedelta import cv2 # import argparse from utils import * import mediapipe as mp from body_part_angle import BodyPartAngle from exercise import TypeOfExercise from sounds.so...
wheelchair.py
#NAME: wheelchair.py #DATE: 05/08/2019 #AUTH: Ryan McCartney #DESC: A python class for moving an entity in real-time via and http API #COPY: Copyright 2019, All Rights Reserved, Ryan McCartney import threading import time import json import requests import random from requests import Session #define threading wrapper...
dbt_integration_test.py
# # MIT License # # Copyright (c) 2020 Airbyte # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, pu...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs import logging import getpass import multiprocessing import fnmatch import copy import os import hashlib import re import threading import time import traceback import sys import signal from random import randint # Import third party lib...
daemon.py
import logging import os import signal import socketserver import sys import threading from concurrent import futures from logging.handlers import RotatingFileHandler from pathlib import Path from queue import Queue from typing import TYPE_CHECKING, Any, NoReturn, Optional, Set, cast import requests from bs4 import Be...
start_mission.py
#!/usr/bin/env python # Python script to start a crazyflie mission. # # The script expects the name of the file as a parameter. It is also possible # to specify the frequency of the thread publishing the position of the # 'ghost', that is the simulation of the expected trajectory. # # Precisely the script will: # ...
test_docxmlrpc.py
from DocXMLRPCServer import DocXMLRPCServer import httplib import sys from test import test_support threading = test_support.import_module('threading') import time import socket import unittest PORT = None def make_request_and_skipIf(condition, reason): # If we skip the test, we have to make a request because the...
app.py
# -*- coding: utf-8 -*- import asyncio, sys, os, json, threading, time from os.path import abspath, dirname, join from threading import Timer from paramiko import SSHClient from sshtunnel import SSHTunnelForwarder from .AboutDialog import Ui_AboutDialog from .MainWindow import Ui_MainWindow from .ConnectDialog import...
wrap_function_multiprocess.py
# STDLIB import sys from typing import Any # EXT import multiprocess # type: ignore # OWN try: from .wrap_helper import WrapHelper, raise_exception except ImportError: # pragma: no cover # Import for local DocTest from wrap_helper import WrapHelper, raise_exception # type: ignore # pragma: no cover c...
modellist_controller.py
from functools import partial from kivy.properties import StringProperty from kivy.clock import Clock from kivymd.uix.list import OneLineListItem, OneLineAvatarIconListItem, TwoLineAvatarIconListItem, MDList, IconRightWidget from kivymd.uix.dialog import MDDialog from kivymd.uix.textfield import MDTextField from kivym...
test_variable.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Author : YongJie-Xie @Contact : fsswxyj@qq.com @DateTime : 0000-00-00 00:00 @Description : 多线程同步变量类的测试类 @FileName : test_variable.py @License : MIT License @ProjectName : Py3Scripts @Software : PyCharm @Version : 1.0 """ import time from threa...
hyper-rsync.py
#!/usr/bin/env python from subprocess import call import sys from threading import Thread from Queue import Queue import subprocess import os queue = Queue() num = 9 #number of worker threads def stream(i,q,dest = "/tmp/sync_dir_B/"): """Spawns stream for each file""" while True: fullpath = q...
managers.py
# # Module providing the `SyncManager` class for dealing # with shared objects # # multiprocessing/managers.py # https://github.com/lotapp/cpython3/blob/master/Lib/multiprocessing/managers.py # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = ['BaseManager', 'SyncManager...
cpuinfo.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (c) 2014-2021 Matthew Brennan Jones <matthew.brennan.jones@gmail.com> # Py-cpuinfo gets CPU info with pure Python 2 & 3 # It uses the MIT License # It is hosted at: https://github.com/workhorsy/py-cpuinfo # # Permission is hereby granted, free of charge, to any...
recipe-475217.py
from os.path import basename from Queue import Queue from random import random, seed from sys import argv, exit from threading import Thread from time import sleep ################################################################################ class Widget: pass class Stack: def __init__(self): self...
rest_generic_adapter.py
# -*- coding: utf-8 -*- """Module for starting an adapters that read data from REST APIs.""" # Copyright (c) TUT Tampere University of Technology 2015-2018. # This software has been developed in Procem-project funded by Business Finland. # This code is licensed under the MIT license. # See the LICENSE.txt in the proje...
IntegrationTests.py
from __future__ import absolute_import import multiprocessing import os import platform import threading import time import unittest import percy import flask import requests from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.desired_capabilities import ...
graph.py
#!/usr/bin/env python3.7 import logging import random import os import threading import uuid from urllib.parse import quote import falcon import hug import hug.types import plotly.graph_objs as go import plotly.plotly as py import requests import requests_html from cachetools import func IMDB_URL = 'https://www.imdb...
lastlayerbayesian.py
# wiseodd/last_layer_laplace import matplotlib matplotlib.use("Agg") from torch.distributions.multivariate_normal import MultivariateNormal import seaborn as sns sns.set_style('white') from torch.utils.data import TensorDataset from main import * from utils import exact_hessian plt = matplotlib.pyplot plt.rcParams...
multivariate_images_tools.py
############################################################################## # Some functions useful for treatments on multivariate images # Authored by Ammar Mian, 09/11/2018 # e-mail: ammar.mian@centralesupelec.fr ############################################################################## # Copyright 2018 @Centr...
engine.py
""" Event-driven framework of vn.py framework. vn.py框架的事件驱动框架。 """ ############################################## # 1.事件的注册和取消,使用者可以根据自己的需求来设置引擎需要关心那些事件 # 2.事件对于的处理方法的挂钩。显然,一个事件可以由多个方法来处理,也可以一个方法处理多个事件。 # 3.不断监听事件的发生与否,如果发生就进行相应的处理,也就是调用设置好的函数。 from collections import defaultdict from queue import Empty, Queue from thr...
client_handler.py
######################################################################################################################## # Class: Computer Networks # Date: 02/03/2020 # Lab3: Server support for multiple clients # Goal: Learning Networking in Python with TCP sockets # Student Name: Rohan Rawat # Student ID: 917018484 # ...
run_once.py
#!/usr/bin/env python # From: https://gist.github.com/nfarrar/884c72ec107a00606a86 import random from datetime import datetime from common_once import * from multiprocessing import Process from time import sleep from acs import flood_acs from login import flood_login from antivirus import flood_antivirus if __name...
watcher.py
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
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...
test_cuda.py
# Owner(s): ["module: cuda"] from itertools import repeat, chain, product from typing import NamedTuple import collections import contextlib import ctypes import gc import io import pickle import queue import sys import tempfile import threading import unittest import torch import torch.cuda import torch.cuda.comm as...
test_multiprocessing.py
# Owner(s): ["module: multiprocessing"] import contextlib import gc import os import sys import time import unittest import copy from sys import platform import torch import torch.cuda import torch.multiprocessing as mp import torch.utils.hooks from torch.nn import Parameter from torch.testing._internal.common_utils ...
views.py
# -*- coding: utf-8 -*- # # 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 #...
Run.py
'''This code is a part of the 3D Scanner project''' '''Developed by team SAAS''' '''Ekalavya 2017''' '''IIT Bombay''' #The necessary packages are imported import Main #local package import threading #local package th1=threading.Thread(target=Main.Main()) #Main() defined inside Main.py is called inside a thread th1....
test_thd_distributed.py
from __future__ import absolute_import, division, print_function, unicode_literals import copy import fcntl import multiprocessing import os import sys import time import unittest from contextlib import contextmanager from functools import reduce, wraps import tempfile import torch import torch.cuda import torch.distr...
device.py
# Copyright 2018 Jetperch LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
test_pastebin_plugin.py
import logging import re import socket import threading import time import tkinter import traceback from http.client import RemoteDisconnected import pytest import requests from pygments.lexers import PythonLexer, TextLexer, get_lexer_by_name from porcupine import get_main_window, utils from porcupine.plugins.pastebi...
__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals, division, print_function, absolute_import import random import os import json import testdata from unittest import TestSuite from endpoints.compat import * from endpoints.client import WebClient, WebsocketClient from .. import TestCase as BaseTestCase ...
try_threading.py
""" A basic example of how to use threading to generate images. This gives only a small improvement and I'm still trying to figure out why. """ import queue import threading from mandelpy import create_image, Settings, power from PIL import ImageFilter images_folder = r"..\images\increasing_powers5" video_file = r".....
hand_detector_utils.py
#Victor Dibia, HandTrack: A Library For Prototyping Real-time Hand TrackingInterfaces using Convolutional Neural Networks, #https://github.com/victordibia/handtracking #Apache Licence. Copyright (c) 2017 Victor Dibia. # Utilities for object detector. import numpy as np import sys import tensorflow as tf import os f...
gamestate.py
import discord import random import time import names import re import math import asyncio from statemachine import StateMachine, State from threading import Thread from mafia.misc.utils import Misc, Timers, Alignment class DelayedOperation(Thread): TIME_MESSAGE_BEFORE_END = 10 MSG_TEMPLATE = "*{}: {} second...
system_test.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...
gdal2tiles.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # ****************************************************************************** # $Id$ # # Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/) # Support: BRGM (http://www.brgm.fr) # Purpose: Convert a raster into TMS (Tile Map Service) tiles in a di...
__init__.py
# Copyright (c) 2021 Boris Posavec # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distr...
trader.py
# -*- coding: UTF-8 -*- # **********************************************************************************# # File: Trader. # **********************************************************************************# from utils.decorator import singleton from . configs import * uwsgi_tag = False try: from uwsgideco...
runners.py
# -*- coding: utf-8 -*- import locale import os import re from signal import SIGINT, SIGTERM import struct from subprocess import Popen, PIPE import sys import threading import time # Import some platform-specific things at top level so they can be mocked for # tests. try: import pty except ImportError: pty =...
trezor.py
import traceback import sys from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum.bip32 import deserialize_xpub, convert_bip32_path_to_list_of_uint32 as parse_path from electrum import constants from electrum.i18n impo...
monitor_test.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import multiprocessing import os import pytest import subprocess import time import ray from ray.test.test_utils import run_and_get_output def _test_cleanup_on_driver_exit(num_redis_shards): stdout = ru...
test_sampling.py
from functools import partial import threading import pickle import pytest import numpy as np from numpy.testing import assert_allclose, assert_equal, suppress_warnings from numpy.lib import NumpyVersion from scipy.stats import ( TransformedDensityRejection, DiscreteAliasUrn, NumericalInversePolynomial ) fr...
threds.py
from threading import Thread import time a = 0 # global variable def thread1(threadname): global a for k in range(100): print("{} {}".format(threadname, a)) time.sleep(0.1) if k == 5: a += 100 def thread2(threadname): global a for k in range(50): a += 1 ...
tests.py
import base64 import threading from typing import Callable from typing import Dict from typing import Optional from unittest.mock import patch import warnings from django.conf import settings from django.contrib.auth import get_user_model from django.test import Client from django.test import override_settings from dj...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
opcua_py.py
# -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END """OPC UA South Plugin using the FreeOPCUA Python OPC UA Library""" import copy import os import logging import time import asyncio import uuid import json from threading import Thread from foglamp.common import logger from ...
test.py
import cv2 import numpy as np import threading def test(): while 1: img1=cv2.imread('captured car1.jpg') print("{}".format(img1.shape)) print("{}".format(img1)) cv2.imshow('asd',img1) cv2.waitKey(1) t1 = threading.Thread(target=test) t1.start()
NormalFattree.py
# Copyright (C) 2016 Huang MaChi at Chongqing University # of Posts and Telecommunications, China. # Copyright (C) 2016 Li Cheng at Beijing University of Posts # and Telecommunications. www.muzixing.com # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance ...
foo.py
# Python 3.3.3 and 2.7.6 # python fo.py from threading import Thread # Potentially useful thing: # In Python you "import" a global variable, instead of "export"ing it when you declare it # (This is probably an effort to make you feel bad about typing the word "global") i = 0 def incrementingFunction(): glob...
background_caching_job.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 us...
wsdump.py
#!/Users/Reiki/.pyenv/versions/3.6.1/bin/python import argparse import code import sys import threading import time import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding(): encoding = getattr(sys.stdin, "encoding", "") ...
Network.py
import argparse import socket import threading from time import sleep import random import RDT ## Provides an abstraction for the network layer class NetworkLayer: #configuration parameters prob_pkt_loss = 0 prob_byte_corr = 0 prob_pkt_reorder = 0 #class variables sock = None conn = ...
TFLite_detection_webcam.bak.py
######## Webcam Object Detection Using Tensorflow-trained Classifier ######### # # Author: Evan Juras # Date: 10/27/19 # Description: # This program uses a TensorFlow Lite model to perform object detection on a live webcam # feed. It draws boxes and scores around the objects of interest in each frame from the ...
bot.py
""" Simple notify-by-schedule telegram bot - coding: utf-8 - Author: shchuko Email: yaroshchuk2000@gmail.com Website: github.com/shchuko """ import time import schedule import datetime import random import os import threading from datetime import timedelta from datetime import date from calendar import monthrange ...
bprofile.py
##################################################################### # # # profile.py # # # # Copyright 2014, Chris Billington ...
__init__.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Implements context management so that nested/scoped contexts and threaded contexts work properly and as expected. """ import collections import logging import string import threading from ..timeout import Timeout class _defaultdict(dict): """ Dictionary whic...
mp.py
import logging import multiprocessing import select import unittest try: from collections.abc import Sequence except ImportError: from collections import Sequence import os import sys import six import multiprocessing.connection as connection from nose2 import events, loader, result, runner, session, util l...
fantome_opera_serveur.py
from random import shuffle,randrange from time import sleep from threading import Thread import dummy0, dummy1 latence = 0.01 permanents, deux, avant, apres = {'rose'}, {'rouge','gris','bleu'}, {'violet','marron'}, {'noir','blanc'} couleurs = avant | permanents | apres | deux passages = [{1,4},{0,2},{1,3},{2,7},{0,5,8...
u2p2_before_scandevices.py
import sys import time import spidev import threading is_on_raspberry_pi = False with open('/etc/os-release') as os_version_file: is_on_raspberry_pi = 'raspbian' in os_version_file.read().lower() spi = None if is_on_raspberry_pi: spi = spidev.SpiDev(0, 0) # rasp print("I'm on Raspberry Pi!") else: spi...
MainFrame.py
import threading import tkinter.ttk as ttk from tkinter.constants import END, N, S, E, W, NORMAL, DISABLED, RIGHT, CENTER, SEL, INSERT, HORIZONTAL from tkinter import Text import pyttsx3 from pyttsx3 import engine import re class MainFrame(ttk.Frame): def __init__(self, **kw): ttk.Frame.__init__(self, **kw...
api.py
# ================================================================= # imports # ================================================================= import threading import time import json import yaml import numpy as np import serial import math import sys from serial.tools import list_ports from subprocess i...
crawl.py
import json import os import sys from http.server import HTTPServer, SimpleHTTPRequestHandler from multiprocessing import Process from django.core.management.base import BaseCommand from django.utils.translation import gettext_lazy as _ from default.extract_sphinx import process class Command(BaseCommand): help...
windows.py
from ...third_party import WebsocketServer # type: ignore from .configurations import ConfigManager from .configurations import WindowConfigManager from .diagnostics import ensure_diagnostics_panel from .logging import debug from .logging import exception_log from .message_request_handler import MessageRequestHandler ...
render.py
import multiprocessing as mp import os from .elements.frame import Frame from selenium import webdriver from selenium.webdriver.chrome.options import Options class Renderer: count = -1 def __init__(self, timeline, preview=True, clearall=False): self.timeline = timeline self.width = 640 if pre...
multidownloadXkcd.py
#!python3 # multidownloadXkcd.py - Downloads XKCD comics using multiple threads import requests, os, bs4, threading os.makedirs('xkcd', exist_ok=True) # Store comics in ./xkcd def downloadXkcd(startComic, endComic): for urlNumber in range(startComic, endComic): # Download the page print('Download...
tb_device_mqtt.py
# Copyright 2020. ThingsBoard # # 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 ...
1mtc_north.py
from __future__ import print_function from pyfrac.utils import pyfraclogger from pyfrac.control import keyboard from pyfrac.acquire import capture import multiprocessing import atexit import json import pika import time import os logger = pyfraclogger.pyfraclogger(tofile=True) RPC_QUEUE_NAME = "1mtcNorth_ir_queue" RPC...
optimization.py
import hashlib import json import six from copy import copy from datetime import datetime from itertools import product from logging import getLogger from threading import Thread, Event from time import time from typing import List, Set, Union, Any, Sequence, Optional, Mapping, Callable from .job import TrainsJob from...
robotiq2f140_real.py
import socket import struct import threading import time from subprocess import check_output import numpy as np import rospy from airobot.ee_tool.ee import EndEffectorTool from airobot.utils.common import clamp, print_red from airobot.utils.urscript_util import Robotiq2F140URScript from control_msgs.msg import Gripper...
echo_server.py
import socket import threading import time def tcplink(sock, addr): print('Accept new connection from %s:%s...' % addr) sock.send(b'Welcome!') while True: data = sock.recv(1024) time.sleep(1) if not data or data.decode('utf-8') == 'exit': break sock.send(('Hello,...
PakeMail_sandbox.py
from io import StringIO from email.mime.base import MIMEBase from email.message import Message import base64 import mimetypes import os from spake2 import SPAKE2_A from spake2 import SPAKE2_B from spake2.parameters.i1024 import Params1024 from spake2.parameters.i2048 import Params2048 from spake2.parameters.i3072 impor...
abstracteventwrapper.py
import json import threading __author__ = 'Daniel Puschmann' import abc import os from virtualisation.misc.jsonobject import JSONObject from messagebus.rabbitmq import RabbitMQ from virtualisation.misc.threads import QueueThread from virtualisation.annotation.genericannotation import GenericAnnotation from virtualisa...
mainprocess.py
import logging import multiprocessing import os import signal import sysv_ipc from shmdemo.common import configure_logging from shmdemo.serviceprocess import indexer from shmdemo.workerprocess import worker SHM_KEY = None SHM_SIZE = 1024 * 1024 * 16 def main(): configure_logging() logger = logging.getLog...
mqtt_receivers.py
import threading import os import sys from Utilities.functions import mqtt_receiving cryptos = ['BTC', 'LTC', 'ETH', 'XRP'] output_file_path = os.path.join(os.getcwd(), 'Data', 'Output', 'Prices') threads = list() for crypto in cryptos: thread = threading.Thread(target=mqtt_receiving, args=(crypto, output_file_p...
utils.py
import os import sys import time import datetime import json import copy import threading import multiprocessing import queue import socket import importlib import traceback import signal import gc from pandacommon.pandalogger import logger_utils from pandaserver.config import panda_config, daemon_config # list of s...
plugin.py
import base64 import re import threading from binascii import hexlify, unhexlify from functools import partial from electrum.bitcoin import (bc_address_to_hash_160, xpub_from_pubkey, public_key_to_p2pkh, EncodeBase58Check, TYPE_ADDRESS, TYPE_SCRIPT, ...
test_sender.py
from __future__ import print_function import os import pytest import six from six.moves import queue import threading import time import shutil import sys import wandb from wandb.util import mkdir_exists_ok # TODO: consolidate dynamic imports PY3 = sys.version_info.major == 3 and sys.version_info.minor >= 6 if PY3:...
GUI.py
#!/usr/bin/python # -*- coding: UTF-8 -*- # File name : client.py # Description : client # Website : www.adeept.com # E-mail : support@adeept.com # Author : William # Date : 2018/08/22 # import cv2 import zmq import base64 import numpy as np from socket import * import sys impor...
protocol_arduinosimulator.py
"""Provides a simple simulator for telemetry_board.ino or camera_board.ino. We use the pragma "no cover" in several places that happen to never be reached or that would only be reached if the code was called directly, i.e. not in the way it is intended to be used. """ import copy import datetime import queue import r...
thread_monitor.py
import sys try: import queue except ImportError: import Queue as queue class ThreadMonitor(object): """Helper class for catching exceptions generated in threads. http://blog.eugeneoden.com/2008/05/12/testing-threads-with-pytest/ Usage: mon = ThreadMonitor() th = threading.Thread...
config_asav.py
#!/usr/bin/env python3 # scripts/config_asav.py # # Import/Export script for vIOS. # # @author Andrea Dainese <andrea.dainese@gmail.com> # @copyright 2014-2016 Andrea Dainese # @license BSD-3-Clause https://github.com/dainok/unetlab/blob/master/LICENSE # @link http://www.unetlab.com/ # @version 20160719 import getopt...
mqtt_client.py
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ MQTT client utility: Tries to hide Paho client details to ease MQTT usage. Reconnects to the MQTT server automatically. This module depends on the paho-mqtt package (ex-mosquitto), provided by the Eclipse Foundation: see http://www.eclipse.org/paho :author: Th...
colorlabels.py
import getpass import itertools import os import platform import sys import threading import time # Deal with Python 2 & 3 compatibility problem. PY2 = sys.version_info[0] < 3 _input = raw_input if PY2 else input _main_thread = threading.current_thread() # TTY detection and configuration. COLORLABELS_TTY = os.getenv...
custom_paramiko_expect.py
# # Paramiko Expect # # Written by Fotis Gimian # http://github.com/fgimian # # This library works with a Paramiko SSH channel to provide native SSH # expect-like handling for servers. The library may be used to interact # with commands like 'configure' or Cisco IOS devices or with interactive # Unix scripts or comman...
uvcal.py
# -*- mode: python; coding: utf-8 -*- # Copyright (c) 2018 Radio Astronomy Software Group # Licensed under the 2-clause BSD License """Primary container for radio interferometer calibration solutions.""" import copy import numpy as np import threading import warnings from ..uvbase import UVBase from .. import paramet...
asyn.py
import asyncio import functools import inspect import re import os import sys import threading from .utils import other_paths, is_exception from .spec import AbstractFileSystem # this global variable holds whether this thread is running async or not thread_state = threading.local() private = re.compile("_[^_]") def...
NamecheapDdnsService.py
import requests import threading import time from core.Service import Service from topics.ipchangenotification.IpChangeNotification import IpChangeNotification from topics.notification.Notification import Notification from topics.notification.NotificationLevel import NotificationLevel class NamecheapDdnsService(Ser...
wiki_title_to_freebase_mapping.py
""" Map Wikipedia title to Freebase mid. Also obtain its labels and redirect links. """ import sys import pickle from multiprocessing import Process, Manager import SPARQLWrapper from url_conversion_helper import freebase_encode_article __author__ = "Abhishek, Sanya B. Taneja, and Garima Malik" __maintainer__ = "Abhis...
verbal-memory.py
import sys import time from cv2 import cv2 import numpy as np import mss from itertools import islice from pynput.mouse import Button, Controller import pytesseract import threading import keyboard pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe" flag2 = True flag4 = False mouse ...
trained.py
#/usr/bin/python # -*- coding: utf-8 -*- import io import numpy as np import argparse import cv2 from cv2 import * import picamera import threading from threading import Thread import os from os import listdir from os.path import isfile, join, isdir import sys import math import time import imutils from imutils.video...
__init__.py
#!/usr/bin/python3 # -*- coding: UTF-8 -*- from __future__ import absolute_import # Operates on sound fragments consisting of signed integer samples 8, 16 # or 32 bits wide, stored in Python strings. import audioop from contextlib import contextmanager from ctypes import CFUNCTYPE, c_char_p, c_int, cdll from threadin...
AUTO (another copy).py
''' NOTES Goal: Make nn take the second-best from the previous prediction. Result: THIS ALSO SEEMS TO BE A BUST. KEEPS GETTING STUCK IN THESE LOOPS OF (predict; ctrl-z), ETC. ''' # import car import cv2 import numpy as np import os # import serial import socket import threading import time from imutils.object_detect...
test_callbacks.py
import os import multiprocessing import numpy as np import pytest from numpy.testing import assert_allclose from csv import reader from csv import Sniffer import shutil from collections import defaultdict from keras import optimizers from keras import initializers from keras import callbacks from keras.models import S...
run_fed_neural_double_dice.py
# Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
test_uploader.py
import os import time import threading import unittest import logging import json from selfdrive.swaglog import cloudlog import selfdrive.loggerd.uploader as uploader from common.xattr import getxattr from selfdrive.loggerd.tests.loggerd_tests_common import UploaderTestCase class TestLogHandler(logging.Handler): ...
search_by_db.py
from fake_useragent import UserAgent import requests from time import sleep import datetime from model import WeiboInfo, WeiboTask, engine from sqlalchemy.orm import sessionmaker from pyquery import PyQuery as pq import random Session = sessionmaker(bind=engine) session = Session() ua = UserAgent(verify_ssl=False) ...
main.py
try: from dotenv import load_dotenv load_dotenv() except: pass from db import * from twitch import * from tt import * from utils import * import sys import time import schedule import threading def main(): # Variável que controla se o houve # modificações no dados do streame...