source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
nvr.py | import logging
from queue import Empty, Queue
from threading import Thread
from typing import List
import cv2
from const import LOG_LEVELS
from lib.camera import FFMPEGCamera
from lib.helpers import (
Filter,
draw_contours,
draw_mask,
draw_objects,
draw_zones,
report_labels,
send_to_post_p... |
build_remote.py | #!/usr/bin/env python3
import argparse
import glob
import datetime
from multiprocessing import Pool, Process, Manager, Event
import re
import subprocess
import sys
from os.path import join, realpath, dirname, basename, exists
CERTBOT_DIR = dirname(dirname(dirname(realpath(__file__))))
PLUGINS = [basename(path) for pa... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Baricoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test baricoind shutdown."""
from test_framework.test_framework import BaricoinTestFramework
from test... |
simple_gui.py | import PySimpleGUI as sg
from serial import Serial
from threading import Thread
com=('COM1','COM2','COM3','COM4','COM5','COM6','COM7','COM8','COM9','COM10')
baud_rate=('115200','9600','38400')
Stop_bit=('1','1.5','2')
data_bit=('8','7','6','5')
verify=('无','奇校验','偶校验')
layout1 = [[sg.Text('COM口:'),sg.InputCombo... |
thread_buffer.py | # Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... |
miniterm.py | #!C:\MicroPythonProjects\ch2\pyboard_d\asyncio\venv\Scripts\python.exe
#
# Very simple serial terminal
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C)2002-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import codecs
import os
import sys
import threading... |
ttime2d.py | """
Calculate travel-times of seismic waves in 2D.
* :func:`~fatiando.seismic.ttime2d.straight`: Calculate the travel-time of a
straight ray through a mesh of square cells
----
"""
from __future__ import absolute_import, division
from future.builtins import range
import multiprocessing
import math
import numpy
tr... |
noplotv2.py | import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import time
import matplotlib.animation as animation
import math
from threading import Thread
#-------custom---------------
from angleEngine import vector ,angle
_CONNECTION = [
[0, 1], [1, 2], [2, 3], [0, 4], [4, 5]... |
microtvm_api_server.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... |
base.py | # Copyright (c) 2008-2010 Aldo Cortesi
# Copyright (c) 2011 Florian Mounier
# Copyright (c) 2011 Kenji_Takahashi
# Copyright (c) 2011 Paul Colomiets
# Copyright (c) 2012 roger
# Copyright (c) 2012 Craig Barnes
# Copyright (c) 2012-2015 Tycho Andersen
# Copyright (c) 2013 dequis
# Copyright (c) 2013 David R. Andersen
# ... |
crazyflie_env.py | import os
from collections import OrderedDict
import numpy as np
from PIL import Image
from io import BytesIO
from gcg.envs.env import Env
from gcg.envs.env_spec import EnvSpec
from gcg.envs.spaces.box import Box
from gcg.envs.spaces.discrete import Discrete
from gcg.data.logger import logger
import matplotlib.pyplot a... |
WeaveDeviceMgr.py | #
# Copyright (c) 2013-2017 Nest Labs, 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
#
# ... |
tests_commands.py | from includes import *
from tests_llapi import with_test_module
'''
python -m RLTest --test tests_commands.py --module path/to/redisai.so
'''
'''
Here we test that we return the right error messages when AI.MODELSTORE command is invalid (for all backends).
Additional tests for storing a model for TF backend (in which... |
emails.py | # -*- coding: utf-8 -*-
# from threading import Thread
#
# from flask import url_for, current_app
# from flask_mail import Message
#
# from demo.extensions import mail
import os
import smtplib
import email
import mimetypes
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.m... |
tester.py | import torch
from torch.autograd import Variable
import sys
import time
from datetime import datetime
import numpy as np
import scipy as sp
import scipy.linalg as linalg
import torch.multiprocessing
import matplotlib.pyplot as plt
def test_speed_inverse_gesv(ndim=10):
A = torch.randn(ndim, ndim)
A = A.mm(A.t(... |
crucible.py | import logging
try:
from Queue import Empty
except:
from queue import Empty
from redis import StrictRedis
# import time
from time import time, sleep
from threading import Thread
# @modified 20190522 - Task #3034: Reduce multiprocessing Manager list usage
# Use Redis sets in place of Manager().list to reduce mem... |
interface.py | import os
import queue
import asyncio
import functools
import threading
import traceback
import concurrent.futures
import multiprocessing as mp
from typing import Union, Any, IO, Coroutine, Callable, Awaitable
class Batch:
def __init__(self):
self.__trigger = False
self.__callbacks = set()
def... |
mix.py | #!usr/bin/env python3
# -*- coding:utf-8 -*-
# @time : 2021/2/19 9:38
# @author : Xujun Zhang
import os
import time
import asyncio
from tqdm import tqdm
from functools import partial
from my_utils import Smiles
from multiprocessing import Pool, Process
async def write_file(content, dst_file):
with open(dst_file, ... |
test.py | # vim: sw=4:ts=4:et
import hashlib
import logging
import os, os.path
import threading
import time
import tarfile
from subprocess import Popen, PIPE
from unittest import TestCase
import saq
from api.test import APIBasicTestCase
from saq.analysis import RootAnalysis
from saq.brocess import query_brocess_by_fqdn
from s... |
HiwinRA605_socket_ros_20190604111706.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... |
run_experiments_3qos.py | #!/usr/bin/python
import subprocess
import threading
import multiprocessing
import os
conf_str_all_to_allN = '''init_cwnd: 2
max_cwnd: 30
retx_timeout: 450
queue_size: 524288
propagation_delay: 0.0000002
bandwidth: 100000000000.0
host_type: 1
queue_type: {5}
flow_type: 6
num_flow: {0}
num_hosts: {4}
flow_trace: ./CDF... |
facade-chopper-dornier.py | """
Interface between the Dornier chopper simulation and the ESS interface
of a chopper system.
"""
import re
import threading
import time
import twisted
from twisted.internet import reactor
from twisted.internet.protocol import Protocol, connectionDone
from twisted.internet.endpoints import TCP4ClientEndpoint, connec... |
test_api.py | """
mbed SDK
Copyright (c) 2011-2014 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... |
async_rl.py |
import time
import multiprocessing as mp
import psutil
import torch
from collections import deque
import math
import numpy as np
from rlpyt.runners.base import BaseRunner
from rlpyt.utils.quick_args import save__init__args
from rlpyt.utils.logging import logger
from rlpyt.utils.collections import AttrDict
from rlpyt.... |
fetcher.py | import logging
import requests
import sys
import threading
import time
sys.path.append("..") #TODO figure out wtf is wrong with python imports
from code_base.types import Packet, proto_dict, Policy, Zone, Subnet
from code_base.const import Const
class Fetcher:
'''
This Fetcher starts a daemon that fet... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
helpers.py | # Copyright (c) 2017 Intel 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 to i... |
exploit.py | import json
import queue
import threading
import time
from datetime import datetime
import traceback
import pytz
from commonbaby.helpers.helper_str import substring
from commonbaby.httpaccess.httpaccess import HttpAccess
from datacontract.automateddataset import EAutoType
from idownclient.automated.autopluginbase imp... |
base_test.py | # -*- coding: utf-8 -*-
import contextlib
import copy
import datetime
import json
import threading
import elasticsearch
import mock
import pytest
from elasticsearch.exceptions import ConnectionError
from elasticsearch.exceptions import ElasticsearchException
from elastalert.enhancements import BaseEnhancement
from el... |
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... |
extract.py | import logging
import requests
import threading
from bs4 import BeautifulSoup
from urllib.parse import urljoin
from src.fetch import fetch_metadata_from_soup, fetch_urls_from_page
logging.basicConfig(filename='app.log', filemode='w', format='%(name)s - %(levelname)s - %(message)s')
base_url = 'https://readcomiconlin... |
tb_grpc_server.py | from queue import SimpleQueue
from threading import RLock, Thread
from time import sleep
import thingsboard_gateway.gateway.proto.messages_pb2_grpc as messages_pb2_grpc
from thingsboard_gateway.gateway.proto.messages_pb2 import *
class TBGRPCServer(messages_pb2_grpc.TBGatewayProtoServiceServicer):
def __init__(s... |
test_time_summary.py | import multiprocessing as mp
import subprocess
import sys
import time
import pytest
from pytorch_pfn_extras.profiler import TimeSummary, time_summary
def test_report():
summary = TimeSummary()
with summary.report("foo"):
pass
summary.synchronize()
with summary.summary() as s:
assert ... |
flask_serve.py | import datetime
import os
import random
import re
import math
import multiprocessing
import subprocess
import sqlite3
import time
import gzip
import gmpy2
from flask import Flask, Response, g, render_template, request
from flask_wtf import FlaskForm
from wtforms import SelectField, StringField, SubmitField, TextAreaFi... |
test_renderers.py | import json
import sys
import base64
import threading
import time
import pytest
import requests
import numpy as np
import plotly.graph_objs as go
import plotly.io as pio
from plotly.offline import get_plotlyjs
if sys.version_info >= (3, 3):
import unittest.mock as mock
from unittest.mock import MagicMock
els... |
_msvccompiler.py | """distutils._msvccompiler
Contains MSVCCompiler, an implementation of the abstract CCompiler class
for Microsoft Visual Studio 2015.
The module is compatible with VS 2015 and later. You can find legacy support
for older versions in distutils.msvc9compiler and distutils.msvccompiler.
"""
# Written by Perry ... |
scripts.py | # -*- coding: utf-8 -*-
'''
This module contains the function calls to execute command line scripts
'''
from __future__ import absolute_import
# Import python libs
from __future__ import print_function
import os
import sys
import traceback
import logging
import threading
import time
from random import randint
# Impo... |
supervised_popen.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code mus... |
util.py | # coding: utf-8
from __future__ import print_function
from .__init__ import EP, PY2, WINDOWS, COLORS, INTERP
import traceback
import threading
import struct
import time
import sys
import os
import platform
import itertools
print_mutex = threading.Lock()
if PY2:
import __builtin__ as builtins
else:
import bui... |
cpu_stats.py | #!/usr/bin/env python3
''' Author: Nikita Yadav
This script will calculate the cpu and memory utilization by the system during runtime the output of which is a graph on html page also the second tab of html gives the system logs
steps to run script:
1- On mate terminal type – python3 (file_name) -t (your duration in... |
helper.py | import asyncio
import functools
import json
import math
import os
import random
import re
import sys
import threading
import time
import uuid
import warnings
from argparse import ArgumentParser, Namespace
from datetime import datetime
from itertools import islice
from types import SimpleNamespace
from typing import (
... |
labels.py | import hashlib
import requests
import threading
import json
import sys
import traceback
import base64
from electroncash.bitcoin import aes_decrypt_with_iv, aes_encrypt_with_iv
from electroncash.plugins import BasePlugin, hook
from electroncash.i18n import _
class LabelsPlugin(BasePlugin):
def __init__(self, pa... |
MotifFinderMEMEServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
joomla_joomanage.py | import os
from lxml import html as lh
from queue import Queue
from urllib.parse import urlparse
from threading import Thread
import requests
import threading
from requests import get
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning... |
server.py | from config_loader import config
import json
from object_detection import ObjectDetection
import threading
from bottle import route, run, template, response, request
from uuid import uuid4
from event_emmiter import event_emmiter
from bottle import static_file
from os import path
from util import *
from logger import *
... |
simulation_headless.py | #!/usr/bin/env python3
import threading
import rclpy
from wolfgang_pybullet_sim.ros_interface import ROSInterface
from wolfgang_pybullet_sim.simulation import Simulation
from rclpy.node import Node
if __name__ == "__main__":
rclpy.init(args=None)
simulation = Simulation(False)
node = Node('pybullet_sim')
... |
Game.py | from SimCamera import *
from Board import *
from Dice import *
from PlayState import *
from Character import *
from Building import *
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
import threading
import numpy as np
import time
from PIL import Image
class GameManager():
"""게임을 관리하는 클... |
dockerTest.py | # Copyright (C) 2015-2021 Regents of the University of California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
portable_runner.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... |
router.py | import asyncio
from json import dumps
from os.path import dirname
from threading import Thread
import websockets
from flask import Flask, jsonify, request, render_template, Response
from api.bangumi.timeline import Timeline
from api.config import GLOBAL_CONFIG
from api.core.cachedb import AnimeDB, DanmakuDB, IPTVDB
f... |
test_util.py | # Copyright 2015 The TensorFlow 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 applica... |
server.py | import socket
import threading
host = '127.0.0.1'
port = 7777
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((host, port))
server.listen()
clients = []
nicknames = []
def broadcast(message):
for client in clients:
client.send(message)
def handle(client):
while True:
... |
cell_logger.py | import time, psutil, gc, tracemalloc, threading, weakref, datetime, sys, random
import logging
from collections import namedtuple
from IPython import get_ipython
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.ERROR)
#logger.setLevel(logging.DEBUG)
def b2mb(x): return int(x/2**20)
... |
lfadsqueue.py | # Goals
# -----
#
# What we want is to launch and monitor multiple shell scripts simultaneously.
# We have a list of tasks. Each task has a certain amount of memory that it needs in GPU memory.
#
# Launch tensorboard with all runs queued.
#
# At the start, we loop through the queue and determine if the next task can ru... |
tracking.py | import os
import threading
import schedule
import time
from datetime import datetime
from datetime import timedelta
from threading import Timer
from subprocess import call
import multiprocessing
#import other codes
import canvas
import googleClassroom
#---startConferenceCheckerOnOtherProcess---
def thread_second():
... |
lint_check.py | import sys
import subprocess
import xml.dom
import xml.dom.minidom
import re
import os
import os.path
from optparse import OptionParser
from collections import namedtuple
from . import monitor
from . import webserver
import json
import urllib.parse
import threading
ReportMessageLine = namedtuple('ReportMessageLine', ... |
Infrared_socket.py | #
# Created on Sat Oct 09 2021
# Author: Owen Yip
# Mail: me@owenyip.com
#
import os,sys
pwd = os.path.abspath(os.path.abspath(__file__))
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(father_path)
import numpy as np
import time
import threading
import zmq
import json
from S... |
launcher.py | from importlib import import_module
from multiprocessing import Process
from typing import List
from argparse import ArgumentParser
import settings
parser = ArgumentParser()
parser.add_argument("-c", "--config", dest="config", default="default",
help="which launch configuration to load")
parser.ad... |
train_tcn_depth_labels.py | import os
import argparse
import torch
import numpy as np
import pickle
import sys
sys.path.append('./utils')
from torch import optim
from torch import nn
from torch import multiprocessing
from torch.optim import lr_scheduler
from torch.autograd import Variable
from torch.utils.data import DataLoader, ConcatDataset
fr... |
bot.py | import os
import logging
import time
import threading
import asyncio
import unicodedata
from decouple import config
import discord
from discord.utils import get
from django.urls import reverse
TOKEN = config("DISCORD_TOKEN", default="")
TIMEOUT_SECS = 10
CSUA_GUILD_ID = 368282532757897217
HOSER_ROLE_ID = 3682855581... |
dataset_generator.py | from __future__ import division, absolute_import, print_function
import argparse
import glob
import multiprocessing
import os
import shutil
import time
import numpy as np
from stable_baselines import PPO2
from stable_baselines.common.vec_env import DummyVecEnv, VecNormalize
from stable_baselines.common.policies impor... |
local_server.py | import os
from http import server
import io
import json
import socketserver
import subprocess
import sys
import urllib.parse
import webbrowser
import threading
from http import HTTPStatus
import execution
import ok_interface
import log
from documentation import search
from execution_parser import strip_comments
from f... |
data_utils.py | # Copyright 2018 The TensorFlow 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 applica... |
TFLite_detection_webcam.py | # Import packages
import os
import argparse
import cv2
import numpy as np
import sys
import time
from threading import Thread
import importlib.util
# Define VideoStream class to handle streaming of video from webcam in separate processing thread
# Source - Adrian Rosebrock, PyImageSearch: https://www.pyimagesearch.com... |
brute.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import smtplib
import threading
from optparse import *
import time
try :
from proxylist import ProxyList
except:
print("pip3 install proxylist ")
try :
from mechanize import Browser
except:
print("pip3 install mechanize")
from os import *
import s... |
PARITY220.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
from os import system, name
import itertools
import threading
import time
import sys
import datetime
from base64 import b64decode,b64encode
from datetime import date
expirydate = datetime.date(2022, 3, 18)
#expirydate = datetime.date(2021, 8, 30)
today=date.today()
green="\03... |
future_mode_get_set_attribute_3_test.py | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
ReadsAlignmentUtilsServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
slave.py | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
AlgorithmSelectionEngine.py | import socket
import threading
import pymysql
import json
from SamplingAccuracyEvaluation import SamplingAccuracyEvaluation as SAE
from PeriodicClassification import CNN as DL
from kafka import KafkaConsumer as KC
from collections import OrderedDict
print(' _______ ___ _______ _______ ______ ___ _______ ... |
agent.py | # Kapacitor UDF Agent implementation in Python
#
# Requires protobuf v3
# pip install protobuf==3.0.0b2
import sys
from . import udf_pb2
from threading import Lock, Thread
# from Queue import Queue
# import io
import traceback
import socket
import os
import logging
logger = logging.getLogger()
# The Agent calls t... |
wechat_robot.py | # coding=utf8
from flask import Flask
from flask import render_template, send_file
# from flask_restful import Resource, Api
from pywx import WXBot
import time
import threading
import json
import requests
import urllib
bot = WXBot(verbose=True)
wechat_thread = None
# helper functions
def tulingReply(text, id=None):
... |
firewall.py | """
DONE: Block connections based on port
TODO: Check incoming ips rep
DONE: Syn flood attack protection
DONE: Dos protection
DONE: Log every suspicious packet to a pcap file
"""
import pydivert
from util.pydivertwriter import PydivertWriter
import threading
from time import sleep
import ipaddress
import requests
por... |
test_basic.py | # -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2021, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is... |
executor.py | from .service import db, Graph, Vertex, Edge, Pipeline, Track, transactional,getlogger
from .model import STATE_WATTING, STATE_FAILED, STATE_SUCCEED, STATE_PENDING, STATE_RUNNING, STATE_FINISH
import logging
import simplejson
import re
from concurrent.futures import ThreadPoolExecutor, as_completed
logger = getlogger(... |
util.py | from io import StringIO
import traceback
import sys
import functools
import json
import os
import asyncio
import time
import threading
import platform
from aiohttp import ClientSession, __version__
# this lib works for CPython 3.7+
if platform.python_implementation() == "PyPy" or sys.version_info.minor < 7:
impor... |
conftest.py | import http.server
import socketserver
import threading
import pytest
@pytest.fixture(scope="module")
def server():
class Server(http.server.ThreadingHTTPServer):
def __init__(self):
super().__init__(("0.0.0.0", 8000), socketserver.BaseRequestHandler)
def __enter__(self):
... |
ip_source.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import time
import os
import threading
import struct
import utils
random.seed(time.time()* 1000000)
class IpSimpleSource(object):
def __init__(self, ips=[]):
self.ips = ips
def set_ips(self, ips):
self.ips = ips
def get_ip(sel... |
test_index_remote.py | import os
import time
import multiprocessing as mp
from pathlib import Path
import pytest
import numpy as np
from jina.flow import Flow
from jina.helper import random_port
from jina.peapods.pods.gateway import GatewayPod
from jina.enums import FlowOptimizeLevel
from jina.parser import set_gateway_parser
from jina.exe... |
test_program_for_Phidgets1xRelayREL2001_ReubenPython2and3Class.py | # -*- coding: utf-8 -*-
'''
Reuben Brewer, Ph.D.
reuben.brewer@gmail.com,
www.reubotics.com
Apache 2 License
Software Revision D, 03/13/2022
Verified working on: Python 2.7, 3.8 for Windows 8.1, 10 64-bit and Raspberry Pi Buster (no Mac testing yet).
'''
__author__ = 'reuben.brewer'
from Phidgets1xR... |
Chap10_Example10.17.py | from threading import Thread
daemonchk = False
def disp():
if daemonchk:
print('Display function only if it is daemon thread')
else:
print("Non-daemon thread")
threadobj = Thread(target = disp)
print("Before setting thread as daemon: ", threadobj.isDaemon())
threadobj.setDaemon(True)
if threado... |
__main__.py | import time
import cv2
from cv2 import imshow
import numpy as np
from . import config
from . import util
from . preview import PizzaPreview
cfg = config.load_config()
preview = PizzaPreview()
DEBUGGING = False
PREVIEW = False
AUTOMATIC = True
def main():
print("Starting Pizzatron3001 bot with the following ... |
msg.py | from utlis.rank import setrank ,isrank ,remrank ,setsudos ,remsudos ,setsudo,IDrank,GPranks
from utlis.send import send_msg, BYusers, sendM,Glang,GetLink
from handlers.delete import delete
from utlis.tg import Bot, Ckuser
from handlers.ranks import ranks
from handlers.locks import locks
from handlers.gpcmd import... |
loader.py | # Copyright (c) 2017-present, Facebook, 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... |
schedule.py | import asyncio
import time
from multiprocessing import Process
import aiohttp
from proxypool.db import RedisClient
from proxypool.error import ResourceDepletionError
from proxypool.getter import FreeProxyGetter
from proxypool.setting import *
class ValidityTester(object):
test_api = TEST_API
def __init__(s... |
device.py | from abc import ABCMeta, abstractmethod
from threading import Thread, current_thread
import logging
import time
class Device(metaclass=ABCMeta):
"""
The Device abstract base class. Do not inherit from this class immediately,
instead use one of the subclasses (InputDevice and OutputDevice),
that furthe... |
CombSort.py | from Algorithims import Algorithms
import time
import threading
class CombSort(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.delay... |
main.py | import os
import sys
import core
import json
import time
import topgg
import disnake
import asyncio
import variables
import threading
initialize_time = time.time()
first_run = False
server_roles = {}
server_channels = {}
if not os.path.exists("images"):
os.mkdir("images")
def update_objects():
time.sleep(30)
... |
AltAnalyze.py | ###AltAnalyze
#Copyright 2005-2008 J. David Gladstone Institutes, San Francisco California
#Author Nathan Salomonis - nsalomonis@gmail.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 Softwar... |
finnhub_ws_conn.py | import logging
import asyncio
import threading
import websockets
import json
from datetime import datetime
import signal
import sys
import time
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler())
class FinnhubWSConn(object):
def __init__(self):
... |
demo.py | """
Example script using PyOpenPose.
"""
import os
import time
import cv2
import math
import numpy as np
import ctypes
import pyglet
from pyglet.gl import *
import pywavefront
import threading
#OPENPOSE_ROOT = os.environ["OPENPOSE_ROOT"]
OPENPOSE_ROOT = "/home/jxgu/github/CamControl_3D_Objects/openpose"
import sys
sys.... |
CustomCloud.py | # CustomCloud.py - Hologram Python SDK Custom Cloud interface
#
# Author: Hologram <support@hologram.io>
#
# Copyright 2016 - Hologram (Konekt, Inc.)
#
#
# LICENSE: Distributed under the terms of the MIT License
from collections import deque
import socket
import sys
import threading
import time
from Hologram.Cloud imp... |
runner.py | import copy
import pprint
import threading
import time
from typing import Dict, Any, List
import ray
from malib import settings
from malib.utils import logger
from malib.utils.logger import get_logger, Log
from malib.utils.configs.formatter import DefaultConfigFormatter
def update_configs(update_dict, ori_dict=None... |
main.py | # /*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Pub... |
__init__.py | import inspect
import json
import os
from ctypes.util import find_library
from ctypes import *
from functools import wraps
from queue import Queue
from threading import Thread
from bot.custom import errors
from . import td_api
threads: list = list()
def run_async(func):
@wraps(func)
def async_func(*ar, **k... |
test_io.py | """Unit tests for the io module."""
# Tests of io are scattered over the test suite:
# * test_bufio - tests file buffering
# * test_memoryio - tests BytesIO and StringIO
# * test_fileio - tests FileIO
# * test_file - tests the file interface
# * test_io - tests everything else in the io module
# * test_univnewlines - ... |
query.py | import json
import time
import logging
from logging.config import dictConfig
from threading import Thread
import redis
import requests
from pymongo import MongoClient
from config import LOG_CONFIG
logging.config.dictConfig(LOG_CONFIG)
logger = logging.getLogger('info_log')
def get_task():
# return '130172021... |
githubcloner.py | #!/usr/bin/env python3
# coding=utf-8
# *******************************************************************
# *** GithubCloner ***
# * Description:
# A script that clones public Github repositories
# of users and organizations automatically.
# * Version:
# v0.3
# * Homepage:
# https://github.com/mazen160/Github... |
evaluation.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from queue import Queue
import time
import os
import sys
from threading import Thread, stack_size as set_thread_stack_size
from typing import Tuple
from mathics_scanner import TranslateError
from mathics import settings
from mathics.core.element import KeyComparable... |
python3-48.py | #Queues and Futures
#Getting values from a thread
#This is a problem for future me
"""
Queues is like leaving a message
A Future is used for synchronizing program execution
in some concurrent programming languages. They describe an
object that acts as a proxy for a result that is initially unknown,
usually because... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.