source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
network.py | # Copyright 2019 Uber Technologies, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
progressbar.py | # -*- coding: utf-8 -*-
import sys
import time
import threading
from functools import wraps
def progressbar(function=None, char='.', pause=0.2, bar_len=60):
"""
This function is a decorator for a progess bar.
Use it as follows:
.. python code:
@progressbar
def any_function()
... |
travis_run.py | #!/usr/bin/env python
import sys
import time
import threading
import subprocess
# This script executes a long-running command while outputing "still running ..." periodically
# to notify Travis build system that the program has not hanged
PING_INTERVAL=15
def monitor(stop):
wait_time = 0
while True: ... |
test_win32pipe.py | import unittest
import time
import threading
from pywin32_testutil import str2bytes # py3k-friendly helper
import win32pipe
import win32file
import win32event
import pywintypes
import winerror
import win32con
class PipeTests(unittest.TestCase):
pipename = "\\\\.\\pipe\\python_test_pipe"
def ... |
generator.py | import calendar
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from dateutil.tz import gettz
from hashlib import sha512
from operator import attrgetter
from os.path import exists, join
from re import sub
from threading import Thread
from PIL import Image, ImageDraw, ImageFont
... |
test_dag_serialization.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... |
utils.py | import os
import sys
import glob
import time
import threading
import pretty_midi
import beyond.Reaper
from copy import deepcopy
from rearender.autogui import click_window
def traverse_dir(
root_dir,
extension=('mid', 'MID', 'midi'),
amount=None,
str_=None,
is_pure=False,
... |
client.py | import argparse
import configparser
import threading
import json
import datetime
import time
import logging
import os
from that_automation_tool.communication import Communication
DEBUGGING = True
# The callback for when a PUBLISH message is received from the server.
def on_message(client, userdata, msg):
try:
... |
server.py | #!/usr/bin/env python
"""
A dummy web server used to test the LendingClub API requests
"""
"""
The MIT License (MIT)
Copyright (c) 2013 Jeremy Gillick
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 Sof... |
streaming_multi_client_server_with_asyncio.py | # Need threading for multiple clients and a way to terminate gracefully
import threading
# Process command line arguments
import argparse
# Stamp the frames with a timestamp
import datetime
# May need for sleep
import time
# Necessary to process images with openCV
import numpy as np
import pyautogui
import imutils
impo... |
SocialFish.py | #-*- coding: utf-8 -*-
# SOCIALFISH
# by: UNDEADSEC
#
###########################
from time import sleep
from sys import stdout, exit
from os import system, path
import multiprocessing
from urllib import urlopen
from platform import architecture
from wget import download
RED, WHITE, CYAN, GREEN, END = '\033[... |
util.py | from django import db
import itertools
import pytest
from contextlib import contextmanager
from demo.models import (
AutoIncConcurrentModel, ConcreteModel, CustomSaveModel, InheritedModel, ProxyModel,
SimpleConcurrentModel, TriggerConcurrentModel
)
from functools import partial, update_wrapper
from itertools i... |
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... |
UART.py | # Copyright (c) 2017, Nordic Semiconductor ASA
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this ... |
client.py | from __future__ import print_function, division
__version__ = '0.0.1'
import datetime as dt
import logging
import os.path
from threading import Thread, RLock
from zeep.client import Client, CachingClient, Settings
from zeep.wsse.username import UsernameToken
import zeep.helpers
from onvif.exceptions import ONVIFError... |
connection_test.py | import demistomock as demisto
from Active_Directory_Query import main
import socket
import ssl
from threading import Thread
import time
BASE_TEST_PARAMS = {
'server_ip': '127.0.0.1',
'secure_connection': 'None',
'page_size': '500',
'credentials': {'identifier': 'bad', 'password': 'bad'}
}
RETURN_ERROR... |
formulaProfiler.py | '''
Save DTS is an example of a plug-in to GUI menu that will profile formula execution.
(c) Copyright 2012 Mark V Systems Limited, All rights reserved.
'''
import os
from tkinter import simpledialog, messagebox
def profileFormulaMenuEntender(cntlr, menu):
# Extend menu with an item for the profile formula plugin... |
supervisor.py | import multiprocessing
import os
import signal
import time
import sys
import setproctitle
import psutil
from dagger.logger import logger
HANDLED_SIGNALS = (
signal.SIGINT,
signal.SIGTERM,
)
__all__ = ("Supervisor",)
class Supervisor:
def __init__(self, target, args=(), kwargs=None, name=None, worker_m... |
kv_storage.py | #!/bin/python3
import time
import threading
import random
def check(pool, times=20, maxCount=5):
while len(pool.expire) >= times:
count = 0
for k in random.sample(list(pool.expire), times):
if not pool.get(k):
count += 1
if count < maxCount:
break
... |
jobworker.py | import logging
import pickle
import threading
import ray
import ray.streaming._streaming as _streaming
from ray.streaming.config import Config
from ray.function_manager import FunctionDescriptor
from ray.streaming.communication import DataInput, DataOutput
logger = logging.getLogger(__name__)
@ray.remote
class JobW... |
gui.py | # -*- coding:utf-8 -*-
# 用户:HYL
# 日期:2021年11月17日
import time
from tkinter import Tk, Button
import threading
import uiautomator2 as u2
print('欢迎使用烟雨江湖脚本,本脚本禁止商用。')
print("初始位置在泰山马车处,需要有马车票,使用前请先检查是否有马车票")
class MainWindow(Tk):
"""继承Tk,实例化窗口"""
def __init__(self):
super().__init__()... |
hcar_v.py | #! /usr/bin/env python
from __future__ import print_function
import argparse
import os
import cv2
import cv2.cv as cv
import time
import Queue
import thread
from threading import Thread
from skvideo.io import VideoWriter
import mxnet as mx
import numpy as np
from rcnn.config import config
from rcnn.symbol import get_vg... |
Proyecto1_CentrodeLlamadas.py | #@author: Carlos Mendoza
#Problema Centro de llamadas telefonicas HELP
#Se considera que un promedio de 10 telefonos en uso por hora
#Por lo cual son hay disponibilidad de 10 telefonos
#Uso de las bibliotecas Threading para el manejo de los hilos, random para el uso del azar
#y time para el uso del tiempo
from thread... |
test_config_cli.py | import time
from multiprocessing import Process
import pytest
from click.testing import CliRunner
from panoptes.utils.config.cli import config_server_cli
@pytest.fixture(scope='module')
def runner():
return CliRunner()
@pytest.fixture(scope='module')
def cli_config_port():
return 12345
@pytest.mark.skip(... |
test_buffer_client.py | # Copyright 2019 Open Source Robotics Foundation, Inc.
# 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 lis... |
threespace_api.py | #!/usr/bin/env python2.7
from __future__ import print_function
""" This module is an API module for ThreeSpace devices.
The ThreeSpace API module is a collection of classes, functions, structures,
and static variables use exclusivly for ThreeSpace devices. This module can
be used with a system running... |
simple_hdlc.py | #!/usr/bin/python
# coding: utf8
__version__ = '0.3'
import logging
import struct
import time
import six
import binascii
from threading import Thread
from PyCRC.CRCCCITT import CRCCCITT
logger = logging.getLogger(__name__)
ESCAPE_CHAR = 0x7d
END_CHAR = 0x7e
ESCAPE_MASK = 0x20
MAX_FRAME_LENGTH = 1024
def bin_to... |
threads5.py | import numpy as np
from threading import Thread, Event
import face
from time import sleep, time
import os
from scipy.io import wavfile
from scipy.ndimage.filters import maximum_filter1d,gaussian_filter
import matplotlib.pyplot as plt
from nltk.tokenize import sent_tokenize
import string
#download nltk punkt in order to... |
data_utils.py | """Utilities for file download and caching."""
from __future__ import absolute_import
from __future__ import print_function
import hashlib
import multiprocessing
import multiprocessing.managers
import os
import random
import shutil
import sys
import tarfile
import threading
import time
import zipfile
from abc import a... |
logic.py | import sspm
import sys
import os
import subprocess
import tkinter as tk
from functools import partial
from threading import Thread
def toggleControlsBasedOnState(model, controls, commands):
currentState = model.currentState.get()
if currentState == "installing":
controls.chkShowMoreOptions.pack_forget... |
RegionMatching.py | from PIL import Image, ImageTk
from numbers import Number
try:
import Tkinter as tk
import tkMessageBox as tkmb
except ImportError:
import tkinter as tk
import tkinter.messagebox as tkmb
import multiprocessing
import subprocess
import pyperclip
import tempfile
import platform
import numpy
import time
im... |
threadbased.py | import logging
import queue
import threading
from functools import wraps
from .base import Session
from ..exceptions import SessionNotFoundException, SessionClosedException, SessionException
from ..utils import random_str, LimitedSizeQueue, isgeneratorfunction, iscoroutinefunction, \
get_function_name
logger = lo... |
main.py | import threading
import socket
import random
import time
import sys
import os
class DOS: # Initialise the class
def main(self): # Main function contains the main code
try: # Check the arguments given with the command
self.target = str(sys.argv[1])
self.threads = int(sys.argv[2])
... |
pymon.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""PyMon
Author: -zYMTOM'
"""
import re
import requests
from bs4 import BeautifulSoup
import time
import threading
class pastebinLinks():
def __init__():
r = requests.post("http://pastebin.com/archive")
var = BeautifulSoup(r.text.encode('utf-8')).find("div", {"id": "c... |
pysmash.py | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 21 17:15:00 2020
@Author: Zhi-Jiang Yang, Dong-Sheng Cao
@Institution: CBDD Group, Xiangya School of Pharmaceutical Science, CSU, China
@Homepage: http://www.scbdd.com
@Mail: yzjkid9@gmail.com; oriental-cds@163.com
@Blog: https://blog.iamkotori.com
♥I love Princess Zelda... |
motion_recognizer.py | from collections import deque
import enum
import time
import os
import numpy as np
from skspatial.objects import Line
from skspatial.objects import Points
class MotionLineDetector:
MAX_POINT = 60
def __init__(self):
self.past_points = deque([])
self.last_time = None
def get_next_line(se... |
main.py | """The main module handling the simulation"""
import copy
import datetime
import logging
import os
import pickle
import queue
import random
import sys
import threading
import warnings
from functools import lru_cache
from pprint import pformat # TODO set some defaults for width/etc with partial?
import networkx as nx
... |
algo_four.py | from functools import reduce
from sys import *
import numpy as np
import random as r
import socket
import struct
import subprocess as sp
import threading
from threading import Thread
import ast
import time
import datetime as dt
import os
import psutil
from netifaces import interfaces, ifaddresses, AF_INET
import paho.m... |
controller.py | import json
import os
import re
import shutil
import subprocess
import time
from pathlib import Path
from threading import Thread
from typing import List, Set, Type
import requests
from bauh.api.abstract.controller import SearchResult, SoftwareManager, ApplicationContext
from bauh.api.abstract.disk import DiskCacheLo... |
LeetSpeak.py | import random,copy,operator
from multiprocessing import Process,Pipe
from Dictionary import Dictionary
from Spelling import Spelling
#from GutenBooks import GutenBooks
#thread info: http://jessenoller.com/2009/02/01/python-threads-and-the-global-interpreter-lock/
#def synchronized():
# the_lock = Lock()
# def f... |
ur5_driver.py | #!/usr/bin/python3
#This file also contains functionalities to control the gripper. This builds upon python-urx.
import logging
import multiprocessing as mp
import signal
import socket
import time
from copy import copy, deepcopy
import numpy as np
from klampt.math import vectorops
from scipy import signal as scipysig... |
directed.py | import logging
from server import Server
import numpy as np
from threading import Thread
class DirectedServer(Server):
"""Federated learning server that uses profiles to direct during selection."""
# Run federated learning
def run(self):
# Perform profiling on all clients
self.profiling()... |
main.py | """
MIT License
Copyright (C) 2021 ROCKY4546
https://github.com/rocky4546
This file is part of Cabernet
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 lim... |
test_distributed_sampling.py | import dgl
import unittest
import os
from dgl.data import CitationGraphDataset
from dgl.data import WN18Dataset
from dgl.distributed import sample_neighbors, sample_etype_neighbors
from dgl.distributed import partition_graph, load_partition, load_partition_book
import sys
import multiprocessing as mp
import numpy as np... |
2.py | # -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, wikipedia, tempfile
from bs4 import BeautifulSoup
from urllib import urlopen
fr... |
executor.py | from concurrent.futures import Future
import typeguard
import logging
import threading
import queue
import datetime
import pickle
from multiprocessing import Queue
from typing import Dict # noqa F401 (used in type annotation)
from typing import List, Optional, Tuple, Union
import math
from parsl.serialize import pack... |
ircthread.py | #!/usr/bin/env python
# Copyright(C) 2011-2016 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, m... |
debug_events_writer_test.py | # Copyright 2019 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... |
__init__.py | import json
import sys
import socket
import threading
import time
from select import select
import sys
is_py2 = sys.version[0] == '2'
def main():
"""
Starts socket connection, sending and receiving threads
"""
msg_socket = socket.socket()
args = sys.argv
msg_socket.connect(('127.0.0.1', int(ar... |
flaskwebgui.py | from http.server import BaseHTTPRequestHandler, HTTPServer
import os, time, signal
import sys, subprocess as sps
import logging
import tempfile
from threading import Thread
from datetime import datetime
temp_dir = tempfile.TemporaryDirectory()
keepalive_file = os.path.join(temp_dir.name, 'bo.txt')
server... |
common.py | # Copyright 2021 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
from enum import Enum
from functools import wraps
from pathlib import... |
Thread.py | import concurrent.futures
import time
start = time.perf_counter()
def do_something(seconds):
print(f'Sleeping {seconds} second(s)...')
time.sleep(seconds)
return f'Done Sleeping...{seconds}'
with concurrent.futures.ThreadPoolExecutor() as executor:
secs = [5, 4, 3, 2, 1]
results =... |
hero9-take-photo-webcam.py | import sys
import time
from goprocam import GoProCamera, constants
import threading
def take_photo(interface):
gopro = GoProCamera.GoPro(ip_address=GoProCamera.GoPro.getWebcamIP(
interface), camera=constants.gpcontrol, webcam_device=interface)
while True:
gopro.take_photo()
time.sleep(... |
video-processor.py | import ffmpeg, sys, numpy, traceback, time, os, platform, threading, subprocess
from subprocess import call
#from rich import print
#pip install ffmpeg-python
def OS_info():
global width; width = os.get_terminal_size().columns
terminal = os.environ.get('TERM')
#width_len = len(width)
cwd = os.getcwd()... |
bayesLib.py |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 22 23:38:35 2017
para UNLP
calibracion con incerteza:
1- calibracion intrinseca chessboard con ocv
2- tomo como condicion inicial y optimizo una funcion error custom
3- saco el hessiano en el optimo
4- sacar asi la covarianza de los parametros opt... |
ecu.py | #! /usr/bin/env python
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) Nils Weiss <nils@we155.de>
# This program is published under a GPLv2 license
# scapy.contrib.description = Helper class for tracking Ecu states (Ecu)
# scapy.contrib.status = loads
impo... |
command.py | import logging
import math
import sys
import itertools
import re
import time
import os
import click
import click_log
import tqdm
import ssw
import pysam
import multiprocessing as mp
import gzip
from construct import *
from ..utils import bam_utils
from ..utils.bam_utils import SegmentInfo
from ..utils.model import... |
test_client.py | from __future__ import annotations
import asyncio
import functools
import gc
import inspect
import logging
import os
import pickle
import random
import subprocess
import sys
import threading
import traceback
import types
import warnings
import weakref
import zipfile
from collections import deque
from collections.abc i... |
4_can_loopback.py | import os
import time
import random
import threading
from panda import Panda
from collections import defaultdict
from nose.tools import assert_equal, assert_less, assert_greater
from .helpers import panda_jungle, start_heartbeat_thread, reset_pandas, time_many_sends, test_all_pandas, test_all_gen2_pandas, clear_can_buf... |
single_script.py | # Python standard library modules
import copy
import os
import logging
import threading
import time
import queue
from collections import deque
import warnings
import itertools
from functools import partial
# Third party libraries
import numpy as np
from tqdm import tqdm
try:
import matplotlib
import matplotlib... |
exchange_rate.py | from datetime import datetime
import inspect
import requests
import sys
import os
import json
from threading import Thread
import time
import csv
import decimal
from decimal import Decimal
from .bitcoin import COIN
from .i18n import _
from .util import PrintError, ThreadJob, make_dir
# See https://en.wikipedia.org/w... |
member-receiver-mock-prio.py | __author__ = 'marco'
import argparse
import pickle
from multiprocessing.connection import Listener, Client
import os
import signal
import Queue
from threading import Thread
import sys
np = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
if np not in sys.path:
sys.path.append(np)
import util.log
import... |
session_test.py | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
process_replay.py | #!/usr/bin/env python3
import importlib
import os
import sys
import threading
import time
import signal
from collections import namedtuple
import capnp
from tqdm import tqdm
import cereal.messaging as messaging
from cereal import car, log
from cereal.services import service_list
from common.params import Params
from ... |
test_ftplib.py | """Test script for ftplib module."""
# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
# environment
import ftplib
import asyncore
import asynchat
import socket
import io
import errno
import os
import time
try:
import ssl
except ImportError:
ssl = None
from unittest import TestCase, skipUnless
... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
docsim.py | """
Semantic document similarity using Gensim
@author: 4oh4
28/03/2020
This class is based on the Gensim Soft Cosine Tutorial notebook:
https://github.com/RaRe-Technologies/gensim/blob/develop/docs/notebooks/soft_cosine_tutorial.ipynb
"""
import logging
from re import sub
import threading
from multiprocessing impor... |
metrics.py | import logging
import sys
import functools
import threading
import statsd
LOG = logging.getLogger(__name__)
def threaded(fn):
def wrapper(*args, **kwargs):
thread = threading.Thread(target=fn, args=args, kwargs=kwargs)
thread.start()
return thread
return wrapper
class Metrics():
def __init... |
pyGBFexchara.py | # 批量下载GBF剧情任务编外半身立绘
from queue import Queue
import os
import time
import threading
import urllib.request
import urllib.error
import datetime
import sys
sys.path.append(".")
import pyDownload as download
dirname = os.getcwd()
print_lock = threading.Lock()
data_q = Queue()
SAVELINK = False
DEBUG = False
prefix1 = "ht... |
test_smtplib.py | import asyncore
import base64
import email.mime.text
from email.message import EmailMessage
from email.base64mime import body_encode as encode_base64
import email.utils
import hashlib
import hmac
import socket
import smtpd
import smtplib
import io
import re
import sys
import time
import select
import errno
import textw... |
train.py | # -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... |
hovercraft_controler.py | # -*- coding: utf-8 -*-
import Tkinter
import bluetooth
#import tkMessageBox
import threading
import time
import sys
# ZMIENNE GLOBALNE
KOD_STERUJACY = "6000012011" # 60 000 120 1 1
# serwo silnik_tyl silnik_dol kierunek_tyl kierunek_dol
WallWarning = "0"
ZAMEK = threading.Lock()
SwitchOff = True
# -----------------... |
test_plugin.py | # Copyright (c) 2017 UFCG-LSD.
#
# 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,... |
aws.py | import boto3
from .common import Common
from botocore import config as botoconf
from botocore import exceptions
from multiprocessing import Process, Pipe
class AWSSubprocessWrapper:
def __init__(self, client):
self.client = client
def __getattr__(self, attr):
if hasattr(self.client, attr):
a = getat... |
gridappsd_integration.py | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2020, Battelle Memorial Institute.
#
# 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... |
test_autograd.py | import gc
import io
import math
import os
import random
import sys
import tempfile
import threading
import time
import unittest
import uuid
import warnings
from copy import deepcopy
from collections import OrderedDict
from itertools import product, permutations
from operator import mul
from functools import reduce, par... |
receiver.py | import socket
import struct
from dbus import DBusException
import collections
from threading import Thread
from time import sleep
DEFAULT_HOST = '0.0.0.0'
DEFAULT_PORT = 1666
DEFAULT_MULICAST = '224.0.0.160'
DEFAULT_BIG_TOLERANCE = 3 # amount of deviation above which a large sync should be performed
DEFAULT_TOLERANCE... |
dev_stream_everything_and_unicorn_fy.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: dev_stream_everything_and_unicorn_fy.py
#
# Part of ‘UnicornFy’
# Project website: https://www.lucit.tech/unicorn-fy.html
# Github: https://github.com/LUCIT-Systems-and-Development/unicorn-fy
# Documentation: https://unicorn-fy.docs.lucit.tech/
# PyPI: https://py... |
manager.py | # -*- coding: utf-8 -*-
#
# profiler2: a Wi-Fi client capability analyzer
# Copyright 2020 Josh Schmelzle
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyr... |
join_queue.py | import queue
import threading
import time
def do_work(item):
print(f'{threading.current_thread()} removed {item} from the queue')
def worker(queue):
time.sleep(1)
while not queue.empty():
item = queue.get()
if item is None:
print('item is none')
break
do_w... |
scheduler_job.py | # pylint: disable=no-name-in-module
#
# 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, Versio... |
async_processor.py | # An async command processor
from dlgutils import *
import win32gui, win32api, win32con, commctrl
import win32process
import time
import processors
verbose = 0
IDC_START = 1100
IDC_PROGRESS = 1101
IDC_PROGRESS_TEXT = 1102
MYWM_SETSTATUS = win32con.WM_USER+11
MYWM_SETWARNING = win32con.WM_USER+12
MYWM_SETERROR = win... |
poll_nodes_in_container.py | #!/usr/bin/env nxshell
import threading
import org.netxms.client.TextOutputListener
from Queue import Queue
from threading import Thread
class ProgressCallback(org.netxms.client.TextOutputListener):
def messageReceived(self, text):
print(self.tag + ": " + text.strip())
pass
def onError(self):... |
snmp.py | # (C) Datadog, Inc. 2010-2019
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import fnmatch
import ipaddress
import json
import os
import threading
import time
from collections import defaultdict
import pysnmp.proto.rfc1902 as snmp_type
import yaml
from pyasn1.codec.ber import decoder
from... |
test_gcs_ha_e2e.py | import pytest
import sys
import threading
from time import sleep
from pytest_docker_tools import container, fetch, network
from pytest_docker_tools import wrappers
from http.client import HTTPConnection
class Container(wrappers.Container):
def ready(self):
self._container.reload()
if self.status ... |
app.py | #
# This file is:
# Copyright (C) 2018 Calin Culianu <calin.culianu@gmail.com>
#
# MIT License
#
import os
from electroncash_gui.ios_native.monkeypatches import MonkeyPatches
from electroncash.util import set_verbosity
from electroncash_gui.ios_native import ElectrumGui
from electroncash_gui.ios_native.utils import... |
utils.py | # Copyright 2015-2017 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
A3C_continuous_action.py | """
Asynchronous Advantage Actor Critic (A3C) with continuous action space, Reinforcement Learning.
The Pendulum example.
View more on my tutorial page: https://morvanzhou.github.io/tutorials/
Using:
tensorflow 1.8.0
gym 0.10.5
"""
import multiprocessing
import threading
import tensorflow as tf
import numpy as np
i... |
okex.py | # Import Built-Ins
import logging
import json
import threading
import time
# Import Third-Party
from websocket import create_connection, WebSocketTimeoutException,WebSocketConnectionClosedException
import requests
# Import Homebrew
from bitex.api.WSS.base import WSSAPI
from datetime import datetime
# Init Logging Faci... |
musescore.py | from selenium.webdriver.common.keys import Keys
from selenium import webdriver
from bs4 import BeautifulSoup
from cairosvg.surface import PDFSurface
from cairosvg.parser import Tree
from cairosvg import svg2pdf
from typing import Union, Optional
from io import BytesIO
from tqdm import tqdm
# import proxyscrape
impor... |
web.py | import logging
import threading
from datetime import datetime
import flask
import flask_socketio
from apscheduler.jobstores.base import JobLookupError
from apscheduler.triggers.cron import CronTrigger
from apscheduler.triggers.interval import IntervalTrigger
from flask import Response
from apschedulerui.watcher impor... |
test_randomstate.py | import hashlib
import pickle
import sys
import warnings
import numpy as np
import pytest
from numpy.testing import (
assert_, assert_raises, assert_equal, assert_warns,
assert_no_warnings, assert_array_equal, assert_array_almost_equal,
suppress_warnings
)
from numpy.random... |
aco.py | #!/usr/bin/env python3
#-*-coding:utf-8-*-
# 蚁群算法TSP
import numpy as np
import matplotlib.pyplot as plt
from copy import deepcopy as dcp
from collections import deque
import random as rd
import profile
import multiprocessing as mtp
fig_num = 0
class Ant:
"""
蚂蚁类: 可以设置初始点,循环重置,路径计算
"""
def __init... |
async_dataloader.py | import collections.abc as container_abcs
import re
from queue import Queue
from threading import Thread
from typing import Any, Optional, Union
import torch
from torch._six import string_classes
from torch.utils.data import DataLoader, Dataset
class AsynchronousLoader(object):
"""
Class for asynchronously lo... |
GoldBagDetectorGUI.py | """
Gintaras Grebliunas
combinacijus@gmail.com
This script draws bounding box around gold bag and calculates
center position of the box
NOTE: Before use update DIR_MODEL and DIR_CONFIG
"""
from imageai.Detection.Custom import CustomObjectDetection
import cv2, time
import queue
import... |
__init__.py | import contextlib
import datetime
import errno
import inspect
import multiprocessing
import os
import re
import signal
import subprocess
import sys
import tempfile
import threading
from collections import namedtuple
from enum import Enum
from warnings import warn
import six
import yaml
from six.moves import configpars... |
ssh_helper.py | """ssh helper for starting remote dask scheduler"""
from __future__ import print_function, division, absolute_import
import os
import socket
import sys
import time
import traceback
try:
from queue import Queue
except ImportError: # Python 2.7 fix
from Queue import Queue
import logging
from threading import ... |
parallelism.py | from multiprocessing import Queue, Process
from multiprocessing.pool import ThreadPool
import threading
import traceback
import os
import math
from .j_log import log
import gc
import time
N_CORE = (os.cpu_count() * 3 // 4)
def parallel_exec(f, seq, static_args=None, n_process=None, cb=None):
if static_args is N... |
api.py | """
A small RPC API server for scheduling ingestion of upstream data and
Elasticsearch indexing tasks.
"""
import json
import logging
import sys
import time
import uuid
from multiprocessing import Process, Value
from urllib.parse import urlparse
import falcon
import ingestion_server.indexer as indexer
from ingestion... |
worker_handlers.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.