source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
objective.py | # Copyright (c) 2016, the GPyOpt Authors
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import time
import numpy as np
from ...util.general import spawn
from ...util.general import get_d_moments
import GPy
import GPyOpt
import sys
class Objective(object):
"""
General class to handle the objective... |
newMain.py | import os
import queue
from threading import Thread
import sys
sys.path.append('/network/lustre/iss01/apps/lang/anaconda/3/5.1.0/lib/python3.6/site-packages')
l = [i for i in range(1000)]
baseFolder='one/'
files=[f for f in os.listdir(baseFolder) if not f.startswith('.')]
# models=5
gpus=4
q = queue.Queue()
# q.queu... |
console.py | import serial
import time
import re
import threading
import sys
class console():
def connect_serial(self,console_num,baud_rate):
time.sleep(3)
self.thread_exit_tag = 0
self.reference_checksum = ""
self.checksum = ""
self.ser = serial.Serial(int(consol... |
runDataRecording.py | # encoding: UTF-8
from __future__ import print_function
import sys
try:
reload(sys) # Python 2
sys.setdefaultencoding('utf8')
except NameError:
pass # Python 3
import multiprocessing
from time import sleep
from datetime import datetime, time
from cyvn.trader.vtEvent import EVENT_LOG, EVENT_REC... |
test_failure.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
import pytest
import sys
import tempfile
import threading
import time
import numpy as np
import redis
import ray
import ray.ray_constants as ray_constants
from ray.tests.cluster_utils im... |
threading_semaphore.py | from time import sleep
import threading
# Number of parallel threads
lock = threading.Semaphore(2)
# https://stackoverflow.com/a/38671899
def parse(url):
"""
Change to your logic, I just use sleep to mock http request.
"""
print('getting info', url)
sleep(2)
# After we done, subtract 1 fro... |
gap.py | # -*- coding: utf-8 -*-
r"""
Interface to GAP
Sage provides an interface to the GAP system. This system provides
extensive group theory, combinatorics, etc.
The GAP interface will only work if GAP is installed on your
computer; this should be the case, since GAP is included with Sage.
The interface offers three piece... |
run.py | import sys
import os
import threading
import time
import logging
from flask import Flask, request, redirect, url_for, render_template, flash
from flask_login import LoginManager, login_user, logout_user, current_user, login_required
from router.models import User, query_user
from flask_script import Manager, Se... |
util.py | import unittest
from multiprocessing import Process
from logrec.dataprep.util import merge_dicts_, AtomicInteger
class UtilTest(unittest.TestCase):
def test_merge_dicts(self):
dict1 = {"a": 3, "b": 4}
dict2 = {"b": 5, "c": 6}
merge_dicts_(dict1, dict2)
expected = {"a": 3, "b": 9... |
autograder.py |
import multiprocessing
# import student's functions
from solution import *
from sokoban import sokoban_goal_state
#Select what to test
test_time_astar = True
test_time_gbfs = True
test_manhattan = True
test_fval_function = True
test_anytime_gbfs = True
test_alternate = True
test_anytime_weighted_astar = True
if tes... |
__main__.py | from __future__ import division, unicode_literals, print_function, absolute_import # Ease the transition to Python 3
# stdlib imports
import os
import sys
import socket
import Queue
import logging
import threading
import signal
import subprocess
import time
import traceback
import pprint
import ast
# Turn on our er... |
write_images.py | import logging
import multiprocessing as mp
import os
import time
#from Queue import Empty as EmptyException
from queue import Empty as EmptyException
logger = logging.getLogger(__name__)
import numpy as np
from skywinder.camera.image_processing.blosc_file import write_image_blosc
from skywinder.camera.pycamera.dty... |
bot.py | #!/usr/bin/env python3
#
# Copyright (c) 2013-2016 Molly White
#
# 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, mod... |
handpose_local_app.py | #-*-coding:utf-8-*-
'''
DpCas-Light
|||| ||||| |||| || |||||||
|| || || || || || |||| || ||
|| || || || || || || || ||
|| || || || || ||====|| ||||||
|| || ||||| || || ||======|| ||
|| || || |... |
vpp_papi.py | #!/usr/bin/env python
#
# Copyright (c) 2016 Cisco and/or its affiliates.
# 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... |
roaster.py | import pyfirmata, os, time, threading, os.path, sys
from roasts.models import Roast, RoastSnapshot
THERMO_ENV_DATA = 0x0A
THERMO_BEAN_DATA = 0x0B
def debug(str):
print str
class Roaster:
"""
RoasterBoard is an Arduino firmata client communicating with the hardware roaster itself.
"""
def __init_... |
multiproc.py | # -*- coding: utf-8 -*-
# @Time : 5/15/2018 11:45 AM
# @Author : sunyonghai
# @File : multiproc.py
# @Software: ZJ_AI
from multiprocessing import Process, Pool, cpu_count
import multiprocessing
# write process:
def write(q,data):
# while True:
# pass
q.put(data)
# read process:
def read(q):
... |
devices.py | from __future__ import absolute_import
import logging
logger = logging.getLogger(__name__)
import os
import sys
import time
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
from topology.sniffer.sniffer import parse_packet
import threading
import pcapy
def timeout_dispach(func... |
eater.py | import json
import logging
import os
import threading
import time
from datetime import datetime
from sql_db import DBSession, get_twitter_message, init_db
from transfer_api import get_transfer
from tweater import TwEater, TwOrder
# from pymongo import MongoClient
logging.basicConfig(level=logging.DEBUG)
_log_ = log... |
notifier.py | #!/usr/bin/python3 -OO
# Copyright 2007-2020 The SABnzbd-Team <team@sabnzbd.org>
#
# 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 late... |
runningscriptHYQ3.py | import gym
import gym_robo
#from hyq_task6 import HyQTask6
from multiprocessing import Process
'''robot_kwargs = {
'use_gui': False,
'rtf' : 0, #1 10 7.0 before 5k rendering off.
'control_mode': "Absolute"
}# 'state_noise_mu': 0, 'state_noise_sigma': 0.075 'random_init_pos': False,
task_kwargs = {... |
dcrdata.py | """
Copyright (c) 2019, Brian Stafford
See LICENSE for details
pyDcrDdta
DcrdataClient.endpointList() for available enpoints.
"""
import urllib.request as urlrequest
from urllib.parse import urlparse, urlencode
import time
import calendar
import unittest
import threading
import ssl
import sys
import select
import ate... |
_generic.py | # -*- coding: utf-8 -*-
from threading import Thread, Lock
import traceback
import functools
try:
from queue import Queue
except ImportError:
from Queue import Queue
class GenericListener(object):
lock = Lock()
def __init__(self):
self.handlers = []
self.listening = False
self... |
servers.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import subprocess
import sys
import threading
import time
import debugp... |
Agent.py | import glob
import importlib
import json
import logging
import signal
import sys
import threading
import wsgiref.simple_server
from multiprocessing import Queue
from time import sleep
import psutil
import os
import requests
from WarnoConfig import config, utility
from flask import Flask, render_template, redirect, url... |
TFCluster.py | # Copyright 2017 Yahoo Inc.
# Licensed under the terms of the Apache 2.0 license.
# Please see LICENSE file in the project root for terms.
"""
This module provides a high-level API to manage the TensorFlowOnSpark cluster.
There are three main phases of operation:
1. **Reservation/Startup** - reserves a port for the T... |
tf_util.py | import joblib
import numpy as np
import tensorflow as tf # pylint: ignore-module
import copy
import os
import functools
import collections
import multiprocessing
def switch(condition, then_expression, else_expression):
"""Switches between two operations depending on a scalar value (int or bool).
Note that bot... |
main.py | # coding=utf-8
import fcoin
from conf import config
api = fcoin.authorize(config.key, config.secret)
print api.accounts_balance
from fcoin.WebsocketClient import WebsocketClient
bids = []
asks = []
class HandleWebsocket(WebsocketClient):
def handle(self, msg):
print "#############################"
... |
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,
... |
subproc_vec_env.py | import multiprocessing
from collections import OrderedDict
from typing import Sequence
import gym
import numpy as np
from stable_baselines.common.vec_env.base_vec_env import VecEnv, CloudpickleWrapper
def _worker(remote, parent_remote, env_fn_wrapper):
parent_remote.close()
env = env_fn_wrapper.var()
wh... |
arbitrager.py | from collections import namedtuple
import mysql.connector
from scripts.trading_information import taker_fee
from scripts.file_reader import read_sql_information
from arbitrage.trader import Trader
import json
import threading
import operator
from scripts.initialize_exchange import initialize_exchanges
clas... |
prof_collection.py |
from __future__ import absolute_import
import sharppy.sharptab.profile as profile
import sharppy.sharptab.interp as interp
from utils.frozenutils import Process, Queue
import platform
import numpy as np
def doCopy(target_type, prof, idx, pipe):
pipe.put((target_type.copy(prof), idx))
class ProfCollection(ob... |
test_remote.py | # Copyright 2018 Iguazio
#
# 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, softwa... |
test_supervisor.py | import multiprocessing
import os
import signal
import sys
import time
from flaky import flaky
from psutil import Process
from pytest import mark
from setproctitle import setproctitle
from sure import expect
from simpleflow.process import Supervisor, reset_signal_handlers
from tests.utils import IntegrationTestCase
... |
test_c10d_nccl.py | import copy
import math
import os
import random
import signal
import sys
import tempfile
import threading
import time
from contextlib import contextmanager
from datetime import timedelta
from itertools import product
from unittest import mock
import torch
import torch.distributed as c10d
if not c10d.is_available():
... |
waffle.py | #!/usr/bin/env python3
# ===----------------- waffle.py - Core file of the waffle project ------------===//
#
# This source file is part of the waffle open source project
#
# Copyright (c) 2021 KittyBorgX and the waffle project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https:/... |
app.py | import requests,schedule,sqlite3,json
from operator import itemgetter
from flask import Flask,render_template,session,request,redirect,url_for,flash
import os
import multiprocessing
import time
app = Flask(__name__)
cursor = sqlite3.connect('ranklist.db',check_same_thread=False)
cursor2 = sqlite3.connect('ranklist.d... |
control_by_gpio.py | #!/usr/bin/python3
# -*- coding:utf-8 -*-
# Project: http://cloudedbats.org
# Copyright (c) 2016-2018 Arnold Andreasson
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
import time
import logging
import threading
# Check if GPIO is available.
gpio_available = True
try: import RPi.GPIO a... |
HiwinRA605_socket_ros_20190619135647.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... |
__init__.py | # =============================================================================
# System imports
import asyncio
import configparser
import logging
import os
import json
import threading
import time
import websockets
# =============================================================================
# Logger setup
logger =... |
interaction_console.py | import threading
import archr
from PySide2.QtWidgets import QMainWindow, QMessageBox, QVBoxLayout, QHBoxLayout, QPushButton
from PySide2.QtCore import Qt
from qtterm import TerminalWidget
from angrmanagement.plugins import BasePlugin
from angrmanagement.ui.views import BaseView
from angrmanagement.ui.views.interactio... |
light_reaper.py | # Copyright 2016-2018 CERN for the benefit of the ATLAS collaboration.
#
# 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... |
index.py | from __future__ import print_function
from flask import Flask
import threading
import os
#import fcntl
import time
import random
import sys
import kafka_send
import service_credentials
import get_customer
PORT = int(os.getenv("PORT"))
CF_INSTANCE_INDEX = os.getenv('CF_INSTANCE_INDEX')
app = Flask(__name__)
try:
... |
tests.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import errno
import os
import shutil
import sys
import tempfile
import threading
import time
import unittest
import warnings
from datetime import datetime, timedelta
from django.core.cache import cache
from django.core.exceptions import SuspiciousFileOpe... |
gmm_tmat.py | # -*- coding: utf-8 -*-
""""
This module contains tools for Gaussian mixture modeling (GMM)
__author__ = 'Omid Sadjadi, Timothee Kheyrkhah'
__email__ = 'omid.sadjadi@nist.gov'
Modification and GPU-implementation by TrungNT
"""
import os
import pickle
import random
import threading
import time
from collections import Ma... |
test_http.py | # -*- encoding: utf-8 -*-
import collections
import email.parser
import platform
import socket
import threading
import time
import pytest
import ddtrace
from ddtrace import compat
from ddtrace.profiling import exporter
from ddtrace.profiling.exporter import http
from ddtrace.vendor import six
from ddtrace.vendor.six.... |
formats.py | from __future__ import print_function, division, absolute_import
import errno
import os
import stat
import struct
import subprocess
import sys
import shutil
import tarfile
import tempfile
import threading
import time
import zipfile
import zlib
from contextlib import closing
from functools import partial
from io impor... |
server.py | import asyncio
import base64
import http
import os
import sys
import zlib
from queue import Queue
from threading import Thread
from time import sleep
import cv2
import mss
import numpy
import pyautogui
import websockets
from . import constant
pyautogui.FAILSAFE = False
WIDTH, HEIGHT = pyautogui.size()
AUTHORIZATIO... |
global_lib.py | import rollbar
import pprint
import yaml
import os, os.path
import sys
import time
import signal
from shutil import copy
from distutils.sysconfig import get_python_lib
from tabulate import tabulate
from pg_chameleon import pg_engine, mysql_source, pgsql_source
import logging
from logging.handlers import TimedRotatingF... |
serverAudio.py | from socket import socket, AF_INET, SOCK_STREAM
from threading import Thread
HOST = input("Enter Host IP\n")
PORT = 4000
BufferSize = 4096
addresses = {}
def Connections():
while True:
try:
client, addr = server.accept()
print("{} is connected!!".format(addr))
addresse... |
demo_storyboard.py | # Copyright (c) 2018, CNRS-LAAS
# 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 must retain the above copyright notice, this
# list of conditions and the f... |
__init__.py | # -*- coding: utf-8 -*-
'''
napalm-logs utilities
'''
from __future__ import absolute_import
from __future__ import unicode_literals
# Import pythond stdlib
import re
import ssl
import copy
import time
import socket
import logging
import threading
import collections
from pydoc import locate
from datetime import dateti... |
test_api.py | import threading
from django.test import Client
from rest_framework import status, HTTP_HEADER_ENCODING
from rest_framework.reverse import reverse as api_reverse
import base64
import json
from datetime import datetime, timedelta
from mock import patch
from rest_framework.test import APITransactionTestCase
from cabot... |
test_subprocess.py | import unittest
from unittest import mock
from test import support
from test.support import import_helper
from test.support import os_helper
from test.support import warnings_helper
import subprocess
import sys
import signal
import io
import itertools
import os
import errno
import tempfile
import time
import traceback
... |
start_pipelined.py | """
Copyright (c) 2018-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
import logging
import threa... |
BellfortSequenceParser.py | # Bellfort Sequence Parser
## Modules
import numpy as np
import pandas as pd
import tkinter as tk
from tkinter import ttk
import tkinter.font as tkf
from tkinter import messagebox
from tkinter import filedialog
import threading
import time
import os
import shutil
## Helper Functions
### Reverse Complement
def rever... |
server.py | import socket
import threading
HOST = "127.0.0.1"
PORT = 9090
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:
... |
main.py | import threading
import time
import argparse
import yaml
import can
from canstruct import pycanstruct
import urwid
from siren_station import SirenStation
from siren_sprinkler import SirenSprinkler
from schedule import Schedule
from app_context import AppContext
MY_ADDR = 0
class SprinklerWalker(urwid.ListWalker):
... |
PdfReader.py | import tf_idf as terms, extract
import kivy,pprint,os,re
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.widget import Widget
from kivy.uix.textinput import TextInput
from kivy.uix.button import Button
from kivy.uix.label import Label
from k... |
graphman.py | #! python3
# -*- coding: utf-8 -*-
"""Graph manager
Author: Kazuya O'moto <komoto@jeol.co.jp>
"""
from __future__ import division, print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from collections import OrderedDict
from functools import partial
from functools import wraps
... |
email.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals, absolute_import
from flask import render_template, current_app
from flask_mail import Message
from threading import Thread
from .extensions import mail_engine
def __send_async_email(cur_app, msg):
with cur_app.... |
notifier.py | import logging
from threading import Thread
from time import sleep
from apprise import Apprise, AppriseAsset
from sqlalchemy.exc import OperationalError
from monitor.notifications import (FoundProofNotification, LostPlotsNotification, LostSyncNotification,
PaymentNotification, Summa... |
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... |
queue_runner.py | import tensorflow as tf
import numpy as np
import time
import multiprocessing as mp
import threading
#import Queue
class CustomRunner(object):
"""
This class manages the the background threads needed to fill
a queue full of data.
# Need to call the following code block after in... |
strategy.py | from abc import ABC
from os import getpid
from types import FunctionType, MethodType
from typing import List, Dict, Callable, Iterable as IterableType, Optional, Union, Tuple, cast
from functools import wraps, partial as PartialFunction
from collections.abc import Iterable
from multipledispatch import dispatch
from thr... |
HOG.py | import logging
from numpy.core.umath import arctan2, cos, sin
from skimage import color
from IAlgorithm import IAlgorithm
from Blob import Blob
import numpy as np
from scipy import sqrt
from scipy.constants import pi
from scipy.ndimage import uniform_filter
import cv2
__author__ = 'simon'
import multiprocessing
def ... |
multiprocess_iterator.py | from __future__ import division
import datetime
import multiprocessing
from multiprocessing import sharedctypes # type: ignore
import signal
import sys
import threading
import warnings
import numpy
import six
from chainer.dataset import iterator
from chainer.iterators._statemachine import (IteratorState,
... |
test_callbacks.py | import pytest
from pybind11_tests import callbacks as m
from threading import Thread
def test_callbacks():
from functools import partial
def func1():
return "func1"
def func2(a, b, c, d):
return "func2", a, b, c, d
def func3(a):
return "func3({})".format(a)
... |
Spec.py | import glob
import os
import sys
from collections import defaultdict
from functools import partial as curry
from . import (
biblio,
boilerplate,
caniuse,
conditional,
config,
constants,
datablocks,
dfns,
extensions,
fingerprinting,
h,
headings,
highlight,
idl,
... |
task_functions.py | from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import logging
import os
from multiprocessing import Process, Queue, Event, Lock
from ..core.task import Task
def task_executor_fn(task : Task):
task.run()
def task_executor_gpu_fn(task : Task, gpu_id :... |
signal_test.py | # -*- coding: utf-8 -*-
# @author: edgardeng
# @date: 2021-03-18
# @file: 信号量
import time
from multiprocessing import Process, Queue
from threading import Thread
class Counter(object):
def __init__(self, val):
self.current = val
def next(self):
self.current += 1
return self.curr... |
udp_client_arduino.py | import re
import socket
import time
from threading import Thread
from arduino import controll
SERVER_UDP_IP = "138.128.210.114"
SERVER_UDP_PORT = 6666
print "UDP target IP:", SERVER_UDP_IP
print "UDP target port:", SERVER_UDP_PORT
client_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
def connect():
... |
connection.py | import random
import sys
import time
import paramiko
import scp
import redis
# async def aredis_exec(conn, *cm, prt=0):
# try:
# r = await conn.execute_command(*cm)
# if prt != 0:
# print(r)
# except redis.exceptions.ResponseError as e:
# print(repr(e))
def redis_exec(conn... |
gstreamer.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
input.py | import logging
from multiprocessing import Manager, Process
from threading import Condition
import pygame
from time import sleep
_manager = Manager()
_mapping = _manager.dict()
# event_queue = _manager.Queue()
_initialized = False
_joysticks = list()
log = logging.getLogger(__name__)
def un_intialize():
"""Cur... |
datasets.py | # YOLOv5 dataset utils and dataloaders
import glob
import hashlib
import json
import logging
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import ThreadPool, Pool
from pathlib import Path
from threading import Thread
import cv2
import numpy as... |
installwizard.py | # Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
import os
import sys
import threading
import traceback
from typing import Tuple, List, Callable, NamedTuple, Optional
from PyQt5.QtCore i... |
GUI.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
try:
import Tkinter as tk
except ImportError:
import tkinter as tk
try:
import ttk
py3 = False
except ImportError:
import tkinter.ttk as ttk
py3 = True
try:
import check_log_gui #Importing GUI to Show Data of log.txt in GUI W... |
TimerClientApp.pyw | from threading import Thread
import time
import socket
import tkinter as tk
import tkinter.font as tkFont
import os
import json
import clipboard
import global_hotkeys
class DragableWindow:
def __init__(self):
self.bind("<Button 1>", self.click)
self.bind("<B1-Motion>", self.drag)
self.hasB... |
worker.py | """입력받은 task를 별도의 thread에서 차례대로 수행하는 일꾼 역할의 Worker 클래스"""
import queue
import threading
from .log_manager import LogManager
class Worker:
"""
입력받은 task를 별도의 thread에서 차례대로 수행하는 일꾼
task가 추가되면 차례대로 task를 수행하며, task가 모두 수행되면 새로운 task가 추가 될때까지 대기한다.
task는 dictionary이며 runnable에는 실행 가능한 객체를 담고 있어야 하며, runn... |
holder_stakeholder.py | from fastapi import APIRouter, Response, status
from fastapi.responses import JSONResponse
import requests, json, sys, os, time, threading, copy
from loguru import logger
from bson import ObjectId
#from app.authentication import authentication
from app.db import mongo_setup_provider
from app.bootstrap.key import hold... |
ex_start_stop2.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 2 15:34:52 2017
@author: robert
"""
from scapy.all import IP,sendrecv, ICMP, utils, STP, Ether, Dot3, Dot1Q, ARP, IPv6, TCP
import mono
import MySQLdb
import threading
import sys
import mono_config as mc
#TODO do a test program
db = MySQLdb.con... |
plot.py | from matplotlib.pyplot import hist, plot, text
import torch
import os
import numpy as np
from torch.utils.tensorboard.writer import SummaryWriter
from ..utils import U
from typing import Dict, Tuple, List, Optional, Callable, Union
import threading
import atexit
from torch.multiprocessing import Process, Queue, Event
f... |
core.py | from __future__ import annotations
from Cryptodome import Random
from Cryptodome.Cipher import AES
from Cryptodome.Hash import HMAC, SHA1
from Cryptodome.Protocol.KDF import PBKDF2
from Cryptodome.PublicKey import RSA
from Cryptodome.Signature import PKCS1_v1_5
from librespot import util, Version
from librespot.audio i... |
tools.py | from lltk.imports import *
import six,shutil
from yapmap import *
HOME=expanduser("~")
LLTK_ROOT = LIT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
if not 'lltk.py' in os.listdir(LLTK_ROOT):
LLTK_ROOT = LIT_ROOT = os.path.join(LLTK_ROOT,'lltk')
if not 'lltk.py' in os.listdir(LLTK_ROOT... |
app_device.py | # -*- coding: utf-8 -*-
from io import BytesIO
from ssl import SSLSocket
import os
import csv
import threading
import argparse
import operator
import ftplib
from datetime import datetime
from ftplib import FTP
import socket
import struct
from datetime import timedelta
import urllib
from time import strptime
import glo... |
system_mode.py | # -*- coding: utf-8 -*-
u"""System Mode for SecureTea.
Project:
╔═╗┌─┐┌─┐┬ ┬┬─┐┌─┐╔╦╗┌─┐┌─┐
╚═╗├┤ │ │ │├┬┘├┤ ║ ├┤ ├─┤
╚═╝└─┘└─┘└─┘┴└─└─┘ ╩ └─┘┴ ┴
Author: Abhishek Sharma <abhishek_official@hotmail.com> , Jul 30 2019
Version: 1.5.1
Module: SecureTea
"""
# Import all the modules necessary for... |
detector_utils.py | # Utilities for object detector.
import numpy as np
import sys
import tensorflow as tf
import os
from threading import Thread
import cv2
from utils import label_map_util
detection_graph = tf.Graph()
sys.path.append("..")
# score threshold for showing bounding boxes.
_score_thresh = 0.27
MODEL_NAME = 'hand_inference... |
renderer.py | """
Renders the command line on the console.
(Redraws parts of the input line that were changed.)
"""
from __future__ import unicode_literals
from prompt_toolkit.eventloop import Future, From, ensure_future, get_event_loop
from prompt_toolkit.filters import to_filter
from prompt_toolkit.formatted_text import to_format... |
display_ili9341_encoder.py | #!/usr/bin/env python3
# *****************************************
# PiFire Display Interface Library
# *****************************************
#
# Description: This library supports using
# the ILI9341 display with 240Wx320H resolution.
# This module utilizes Luma.LCD to interface
# this display.
#
# Dependanc... |
actions.py | import docker
import docker.errors
import logging
import json
import os
import socket
import uuid
import threading
from apscheduler.schedulers.background import BackgroundScheduler
LOG = logging.getLogger(__name__)
sched = BackgroundScheduler()
class DockerActions(object):
def __init__(self):
self.docke... |
task.py | import logging
log = logging.getLogger(__name__)
import re
import time
# For determining hostname
import socket
# Event
from event import Event
# Subprocess & threads, for SubprocessTask
import os
import shlex
import signal
import traceback
import threading
import subprocess
# Multiprocessing, for PythonTask
impor... |
TempMonitor.py | import time
import glob
import atexit
# Once we get a DB set up, we'll activate this
# import mysql.connector # To save data locally in the event we can't post or need to recover/reset data
import logging
import requests
import json
import threading
import datetime
import RPi.GPIO as GPIO
# from socketIO_client import... |
sniffer.py | #! /usr/bin/env python3
import argparse
import threading
import logging
from scapy.all import sniff, Ether, IP
from database.database import create_tables, Entity, create_session, drop_tables
from queue import Queue
packet_queue = Queue()
def on_packet(p):
if Ether not in p or IP not in p:
return
pa... |
myvlctest.py | #!/usr/bin/python
"""
The very first line should be the above line of code for the program to run
No blank line allowed on Line-1
"""
'''
The code is hardcoded for the network (The IP addresses are hardcoded)
the network is shown below
if n=2,
h1- -h2
s1 ----- s2
if n=4,
... |
bobcat1.0.py | import sys
import socket
import getopt
import threading
import subprocess
listen = False
command = False
upload = False
execute = ""
target = ""
upload_destination = ""
port = 0
def usage():
print("Bobcat Net Tool")
print()
print("Usage: bhpnet.py -t target_host -p port")
print("... |
main.py | from flask import *
from pytube import YouTube
import dld
import random
import sched, time
from threading import Thread
import time
import glob
import os
files = glob.glob('downloads/*.mp4', recursive=True)
def deleteThread(files):
while True:
files = glob.glob('downloads/*.mp4', recursive=True)
for f in file... |
kerberos.py | # pylint: disable=C0111,R0903
"""See what the current state of my kerberos ticket is.
Requires the following executable:
* klist
Parameters:
kerberos.frequency How often to check (in seconds)
"""
import re
import time
import threading
import bumblebee.input
import bumblebee.output
import bumblebee.eng... |
drink_water.py |
# this is a program that reminds you to drink water, no kidney stones garanteed
import os
from tkinter import *
import vact
import threading, gtts, os
from playsound import playsound
import requests, random
import shutil
chimc=os.listdir()
if("drink_icon.png" not in chimc):
kholi = "https://www.pngi... |
executors.py | import multiprocessing
import os
import signal
import subprocess
import sys
import threading
import warnings
from concurrent.futures import ThreadPoolExecutor
from concurrent.futures import TimeoutError as FutureTimeout
from functools import wraps
from typing import TYPE_CHECKING, Any, Callable, List, Union
import pre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.