source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
audio_datasets_tutorial.py | # -*- coding: utf-8 -*-
"""
Audio Datasets
==============
``torchaudio`` provides easy access to common, publicly accessible
datasets. Please refer to the official documentation for the list of
available datasets.
"""
# When running this tutorial in Google Colab, install the required packages
# with the following.
# ... |
stream.py | # -*- coding: utf-8 -*-
from __future__ import division, print_function
from __future__ import absolute_import, unicode_literals
from ..compat import socketserver
from ..compat import SimpleHTTPServer
from ..base import cv2
import time
import socket
import re
import threading
__all__ = [
'JpegStreamHandler', 'J... |
server.py | #from socket import AF_INET,SOCK_STREAM,socket
from socket import *
from threading import Thread
import sys
def accept_incoming_connections():
"""Sets up handling for incoming clients."""
while True:
client, client_address = SERVER.accept()
print("%s:%s has connected." % client_a... |
ethpool.py | # -*- coding: utf-8 -*-
import os
import logging
import time
import requests
import json
import sys
import signal
import sqlite3
from flask import Flask, render_template, url_for, request
from threading import Thread, Lock
import Queue
from ethjsonrpc import EthJsonRpc
methods = [
'eth_hashrate',
'eth_accounts',
'et... |
crashreporter.py | #
# This file is:
# Copyright (C) 2018 Calin Culianu <calin.culianu@gmail.com>
#
# MIT License
from . import utils
from . import gui
from electroncash.i18n import _
from .uikit_bindings import *
from .custom_objc import *
import json, traceback, requests, sys
from electroncash import PACKAGE_VERSION
issue_templ... |
start.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
l7 = ["CFB", "BYPASS", "GET", "POST", "OVH", "STRESS", "OSTRESS", "DYN", "SLOW", "HEAD", "HIT", "NULL", "COOKIE", "BRUST", "PPS", "EVEN", "GSB", "DGB", "AVB"]
l4 = ["TCP", "UDP", "SYN", "VSE", "MEM", "NTP"]
l3 = ["POD", "ICMP"]
to = ["CFIP", "DNS", "PING", "CHECK", "DSTAT... |
test__issue600.py | # Make sure that libev child watchers, implicitly installed through the use
# of subprocess, do not cause waitpid() to fail to poll for processes.
# NOTE: This was only reproducible under python 2.
from __future__ import print_function
import gevent
from gevent import monkey
monkey.patch_all()
import sys
from multipro... |
publisher.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time
import zmq
import math
import itertools
from multiprocessing import Process
def Publisher(number_of_messages):
pool_size = 2
running_tasks = []
running_tasks.append(Process(target=PusherWorker, args=(number_of_messages,)))
running_tasks.append(Proce... |
gateway.py | # pragma: no cover
import asyncio
import base64
import hashlib
import logging
import threading
from typing import List, Optional
import rclpy
import rclpy.executors
import rclpy.node
from builtin_interfaces.msg import Time as RosTime
from fastapi import HTTPException
from rclpy.subscription import Subscription
from r... |
filemanager.py | # Copyright (c) 2019 Ivanov Yuri
#
# For suggestions and questions:
# <kivydevelopment@gmail.com>
#
# This file is distributed under the terms of the same license,
# as the Kivy framework.
"""
File Manager
============
A simple manager for selecting directories and files.
Example
-------
from kivy.app import App
fr... |
tipbot.py | """
Developed by @vsnation(t.me/vsnation)
Email: vsnation.v@gmail.com
If you'll need the support use the contacts ^(above)!
"""
import json
import logging
import threading
import traceback
import random
import pyqrcode
import schedule
import re
from PIL import Image, ImageFont, ImageDraw
import matplotlib.p... |
fn_api_runner.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
test_steering.py | # Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers
# 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, ... |
zipCracker.py | import os
import sys
import zipfile
import threading
def helper():
'''Print Help Message to user.'''
print '[!] This is help message. Provide the application with the following parameters:'
print '[+] Please follow the order provided (zip file then wordlist)'
print '\t[-] %s file.zip wordlist.txt' % sys.argv[0]
d... |
__init__.py | import inspect
import json
import os.path
import re
from datetime import datetime
from multiprocessing import SimpleQueue
from threading import Thread
from typing import Any
from typing import Mapping
from bcc import BPF
from jinja2 import Environment
from jinja2 import FileSystemLoader
from pidtree_bcc.plugins impor... |
drakefly.py | from cflib.crazyflie.log import LogConfig
from crazyflie_logger import CrazyflieLogger
import cflib
from cflib import crazyflie
from cflib import crtp
from threading import Thread
import time
# setup logging as it is a massive hassle
CrazyflieLogger.set_logging()
class DrakeFly(crazyflie.Crazyflie):
DEFAULT_... |
ImportData.py | # =============================================================================
# Modified by Daniel Long from:
# USGS/EROS Inventory Service Example
# Description: Download Landsat Collection 2 files
# Usage: python download_sample.py -u username -p password -f filetype
# optional argument f refers to file... |
vio_visu.py | """
Simple VIO result visualizer Python. Reads outputs from the
Spectacular AI OAK-D plugin and plots them in real time.
Plug in the OAK-D to an USB3 port using an USB3 cable before running.
Can also visualize pre-recorded results from a JSONL file or from a pipe.
The device does not have to be attached in this case. ... |
debugger_offline_server.py | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... |
forged_packet.py | # -*- coding: utf-8 -*-
from PyQt5 import QtCore, QtGui, QtWidgets
from scapy.sendrecv import sr, sr1, srloop
import scapy
from scapy.layers.inet import *
import sys
import threading
"""获取控制台内容"""
class EmittingStream(QtCore.QObject):
textWritten = QtCore.pyqtSignal(str) # 定义一个发送str的信号
def write(self, text... |
threadingutils.py | # -*- coding: utf-8 -*-
import logging
from threading import Thread, current_thread
def start_thread(target, name, exception_event, *args, **kwargs):
"""
Starts a thread passed as argument and catches exceptions that happens during execution
:param target: Method to be executed in the thread
:param na... |
gntp-cli.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Do not remove this line - it seems to fix the following error on the UCLCS cluster:
# ImportError: dlopen: cannot load any more object with static TLS
import nmslib
import os
import sys
import json
import pdb
import argparse
import pickle
from memory_profiler import m... |
test_multiprocess.py | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/gaogaotiantian/viztracer/blob/master/NOTICE.txt
import os
import sys
import multiprocessing
import platform
from .cmdline_tmpl import CmdlineTmpl
file_parent = \
"""
import subprocess
subprocess.run(["py... |
Stream.py | from SimpleCV.base import *
_jpegstreamers = {}
class JpegStreamHandler(SimpleHTTPRequestHandler):
"""
The JpegStreamHandler handles requests to the threaded HTTP server.
Once initialized, any request to this port will receive a multipart/replace
jpeg.
"""
def do_GET(self):
global... |
conftest.py | from typing import List
import logging
import os
import dummyserial
import pytest
from serial import SerialBase
import socketserver
from socket import timeout
import threading
from unittest.mock import patch
logging.basicConfig(level=logging.DEBUG)
def pytest_generate_tests(metafunc):
if "param" in metafunc.fixt... |
xs_classify.py | #!/usr/bin/env python
# Copyright 2019 Xilinx 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 ... |
alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "Hey I am Alive."
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
'''
This code, in summary, makes a website that just says "Hey I am Alive."
However... |
test_ibmq_job.py | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
__init__.py | import json
import subprocess
import threading
import pkg_resources
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from uvicorn import Config, Server
from daemon.excepts import Runtime400Exception, daemon_runtime_exception_handler
from jina import __version__
from jina.logging import J... |
test_io.py | """Unit tests for the io module."""
# Tests of io are scattered over the test suite:
# * test_bufio - tests file buffering
# * test_memoryio - tests BytesIO and StringIO
# * test_fileio - tests FileIO
# * test_file - tests the file interface
# * test_io - tests everything else in the io module
# * test_univnewlines - ... |
periodic_update.py | """
Periodically update bundled versions.
"""
from __future__ import absolute_import, unicode_literals
import json
import logging
import os
import ssl
import subprocess
import sys
from datetime import datetime, timedelta
from itertools import groupby
from shutil import copy2
from textwrap import dedent
from threading... |
exec.py | # Copyright (c) Mike Jarvis and other collaborators
# See https://github.com/rmjarvis/MockMPI/LICENSE for license information.
import numpy as np
import multiprocessing as mp
from .comm import MockComm
# We use this subclass to help with exception
# handling, as described here:
# https://stackoverflow.com/a/33599967/... |
sample_client.py | import logging
import threading
import time
import ezclib
log = logging.getLogger(__name__)
def main():
room_name = raw_input('Enter room name: ')
if room_name:
nick = raw_input('Enter Nick: (optional)')
client = ezclib.EzcapechatRTMPProtocol(room_name, nick)
t = threading.Thread(t... |
server.py | import liblo
import random
import logging
import threading
from . import globals
from .exceptions import SuperColliderConnectionError
logger = logging.getLogger(__name__)
class Server(object):
def __init__(self, hostname="127.0.0.1", port=57110):
"""
Create a new Server object, which is a local re... |
wdt.py | from threading import Thread, Event
from datetime import datetime, timezone
from time import sleep
import logging
logger = logging.getLogger("watchdog_timer")
class WDT:
def __init__(self, callback, check_interval_sec: float = 0.01, trigger_delta_sec: float = 1, identifier=None):
self.check_interval_sec... |
helpers.py | # -*- coding: utf-8 -*-
'''
:copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
tests.support.helpers
~~~~~~~~~~~~~~~~~~~~~
Test support helpers
'''
# pylint: disable=repr-flag-used-in-string,wrong-import-order
... |
dicom.py | # -*- coding: utf-8 -*-
"""
There are two types of AEs:
* SCP (Service Class Provider) which can be thought of as a server
* SCU (Service Class User) as a client.
CHANGELOG
=========
0.1.2 / 2022-03-28
------------------
- change debug messages
0.1.1 / 2021-04-27
------------------
- enables dicom calls via pynet... |
webkit2png.py | #! -*- coding: utf-8 -*-
import sys
import os
import time
from multiprocessing import Process
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication
from PyQt5 import QtCore, QtGui, QtWidgets, QtWebEngineWidgets
class PageShotter(QtWebEngineWidgets.QWebEngineView):
def __init__(self, url, outfile,... |
infolog.py | import atexit
import json
from datetime import datetime
from threading import Thread
from urllib.request import Request, urlopen
_format = "%Y-%m-%d %H:%M:%S.%f"
_file = None
_run_name = None
_slack_url = None
def init(filename, run_name, slack_url=None):
global _file, _run_name, _slack_url
_close_lo... |
test_pv_scale_ocs_create_delete_pvcs.py | """
PV Create/Delete & Memory Leak Test: Test the PVC limit with 3 worker nodes
with & without any IO create and delete the PVCs and check for memory leak
TO DO: This Test needs to be executed in Scaled setup,
Adding node scale is yet to be supported.
"""
import logging
import pytest
import random
import time
import th... |
launch.py | ############################################################################
# #
# Copyright (c) 2017 eBay Inc. #
# Modifications copyright (c) 2018-2021 Carl Drougge #
# Modificati... |
__init__.py | from __future__ import annotations
import collections
from datetime import datetime
from decimal import Decimal
from functools import wraps
import operator
import os
import re
import string
from typing import (
TYPE_CHECKING,
Callable,
ContextManager,
Counter,
Iterable,
)
import warnings
import nu... |
tcp_http.py | import socket
# import threading
""" threading module is to speed up our server"""
class web_server_tcpHttp:
def __init__(self, host_ip, port) -> None:
""" We need to get the host-ip for our tcp server and port number."""
self.host_ip = host_ip
self.port = port
def main(self):
... |
test_memusage.py | import decimal
import gc
import itertools
import multiprocessing
import weakref
import sqlalchemy as sa
from sqlalchemy import ForeignKey
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import test... |
pg_simulate_user_action.py | from my_pg_connection import pg_return_dsn
import time
import random
import argparse
import threading
import logging
import psycopg2
import string
parser = argparse.ArgumentParser()
parser.add_argument('-t', '--time', dest='time_to_run', type=int, default=300, help='how long should we run this test')
parser.add_argu... |
gbxml_stats.py | import glob
from functools import reduce
import os
import sys
sys.path.append(".")
import pandas as pd
from driver import Driver
import requests
import threading
import time
add = lambda x,y: x+y
get = lambda uri: requests.get(uri).json()
if len(sys.argv) < 2:
print("Usage: python evaluation/gbxml_stats.py <file_... |
main.py | #!/usr/bin/env python3
import csv
import sys
import time
import threading
import socketserver
import http.server
import re
import json
from weakest_link.util import dollars, format_time, debug
from weakest_link.questions import Questions
from weakest_link.final_round import FinalRound
from weakest_link.round import W... |
hai_ext_temp_local.py | import HEAT_HAI as heat
from datamanager import DataManager
from counterdown import CounterDown
import threading
from logger import InfoLogger, DataLogger, AdcsLogger
from time import sleep
import sys
import RPi.GPIO as GPIO
import json
import Paths as paths
import Pins as pins
class Master:
__instance = None
... |
recorder.py | import logging
import pathlib
import re
import threading
from datetime import datetime, timedelta, time
from typing import Union
import urllib3
from rprecorder import cuesheet
log = logging.getLogger(__name__)
def _parse_meta(metastr:str):
for item in re.split(r"(?<=');(?=\w+=)", metastr):
match = re.... |
main.py | #! /usr/bin/env python
import importlib
import os
import logging
import tempfile
import signal
import shutil
import time
import sys
import threading
import json
import optparse
import email
import subprocess
import hashlib
import yaml
import requests
import coloredlogs
import alexapi.config
import alexapi.tunein as ... |
email.py | from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from app.extentions import mail
# 异步发送邮件任务
def async_send_mail(app, msg):
# 邮件发送必须在程序上下文
# 新的线程中没有上下文,因此需要手动创建
with app.app_context():
mail.send(msg)
# 封装函数发送邮件
def send_mail(subject, to,... |
wireguard_tray.py | #!/usr/bin/python
# coding: utf8
import os
import gi
import commands
import subprocess
import signal
import sys
import fcntl
import time
gi.require_version('Gtk', '3.0')
gi.require_version('AppIndicator3', '0.1')
gi.require_version('Notify', '0.7')
gi.require_version('GdkPixbuf', '2.0')
from gi.repository import Gtk a... |
smart_explainer.py | """
Smart explainer module
"""
import logging
import copy
import tempfile
import shutil
import numpy as np
import pandas as pd
from shapash.webapp.smart_app import SmartApp
from shapash.utils.io import save_pickle
from shapash.utils.io import load_pickle
from shapash.utils.transform import inverse_transform, apply_post... |
console.py | # Tetris made out of turtle. Only used turtle for the graphics and used playsound for background music.
import blocks as bk
import random as r
import turtle as t
import threading as th
from playsound import playsound
# settings
fps = 60
grid = 32
creator = t.Turtle()
draw = t.Turtle()
screen = t.Screen()
frame_hold... |
duet_test.py | # stdlib
from multiprocessing import set_start_method
import socket
import time
from typing import Callable
from typing import List
from typing import Tuple
# third party
import pytest
# syft relative
from .duet_scenarios_tests import register_duet_scenarios
from .process_test import SyftTestProcess
set_start_method... |
sdca_ops_test.py | # Copyright 2016 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... |
plotting_daemons.py | # -*- coding: utf-8 -*-
"""
© Michael Widrich, Markus Hofmarcher, 2017
Handling of worker subprocesses and threads for plotting
"""
from multiprocess import Pool
def stop_plotting_daemon(plotting_queue, plotting_proc):
"""End plotting daemon process properly"""
# tell process to finish
plotting_queue.p... |
_UIAHandler.py | #_UIAHandler.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2011-2019 NV Access Limited, Joseph Lee, Babbage B.V.
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
from ctypes import *
from ctypes.wintypes import *
import comtypes.client
from comtyp... |
Hiwin_RT605_ArmCommand_Socket_20190627181927.py | #!/usr/bin/env python3
# license removed for brevity
import rospy
import os
import socket
##多執行序
import threading
import time
import sys
import matplotlib as plot
import HiwinRA605_socket_TCPcmd as TCP
import HiwinRA605_socket_Taskcmd as Taskcmd
import numpy as np
from std_msgs.msg import String
from ROS_Socket.srv imp... |
core_engine.py |
# Import Update Engines
from iemlav.lib.antivirus.update.update_hash import UpdateHash
from iemlav.lib.antivirus.update.update_yara import UpdateYara
# Import Core Engines
from iemlav.lib.antivirus.scanner.scanner_engine import ScannerEngine
from iemlav.lib.antivirus.monitor.monitor_engine import MonitorEngine
# Imp... |
commander.py | from globals import Globals
import utils as utils
import os
import json
import fnmatch
import csv
import datetime as datetime
import urllib.parse
import threading
import subprocess
from multiprocessing import Pool, TimeoutError
import time
import logging
from io import BytesIO
from pdf_audit import PDFAudit as PDFA
f... |
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.utils import _random_s... |
rpyc_pycryptoki.py | #!/usr/bin/env python -u
"""
RPYC-based daemon that allows for remote execution
of pycryptoki commands.
Start via ``./rpyc_pycryptoki.py -i <ip> -p <port>``
or ``python rpyc_pycryptoki.py -i <ip> -p <port>``
All methods starting are useable via ``rpyc_conn.root.<method>``
All methods ending with ``_ex`` will automat... |
test_interrupt.py | # Copyright 2013 MemSQL, 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 writing... |
main.py | # Licensed under the Unlicense (http://unlicense.org)
# Made by horriblecoders.com
# Chat Program
import socket
import threading
# Config
MODE = "SERVER" # Modes can either be SERVER or CLIENT
HOST = "" # Symbolic name meaning all available interfaces
PORT = 1337 # Arbitrary non-priv... |
__init__.py | """
fs.expose.dokan
===============
Expose an FS object to the native filesystem via Dokan.
This module provides the necessary interfaces to mount an FS object into
the local filesystem using Dokan on win32::
http://dokan-dev.github.io/
For simple usage, the function 'mount' takes an FS object
and new device mo... |
multiprocessing_queue.py | #!/usr/bin/env python
#
# Brief description:
# This sample simulates a pipeline of two worker pools take tasks from the queue and produce results concurrently.
# This is a process-level concurrency sample program.
#
# How it works:
# The input of the tasks will go into the input queue (aka input_que). Workers from pool... |
one_reboot_runner.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from vmchecker.generic_runner import Runner
from threading import Thread
import time
import sys
class OneRebootRunner(Runner):
def _wait_for_power_off(self):
while self.vm.hasStopped() != True:
time.sleep(1)
def testSubmission(self... |
BrowserEditor.py | ##########################################################################
#
# Copyright (c) 2012-2014, Image Engine Design 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:
#
# * Redi... |
test_core.py | from datetime import timedelta
from functools import partial
import itertools
import json
import operator
from operator import add
import os
from time import time, sleep
import sys
import pytest
from tornado import gen
from tornado.queues import Queue
from tornado.ioloop import IOLoop
import streamz as sz
from stre... |
PyShell.py | #! /usr/bin/env python
import os
import os.path
import sys
import string
import getopt
import re
import socket
import time
import threading
import traceback
import types
import macosxSupport
import linecache
from code import InteractiveInterpreter
try:
from Tkinter import *
except ImportError:
print>>sys.__s... |
QATdx_adv.py | # coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
#
# 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 th... |
gpu_imagenet_bench.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
v1.2.1.py | from random_user_agent.user_agent import UserAgent
import threading
import random
import logging
import socket
import socks
import time
import sys
import ssl
logging.basicConfig(
format="[%(asctime)s] %(message)s",
datefmt="%H:%m:%S",
level=logging.INFO
)
active_threads = 0
max_threads = 777
hrs = 0
bps = 0
usera... |
download_daydata.py | import os
import sys
import time
import sqlite3
import zipfile
import pythoncom
import pandas as pd
from PyQt5 import QtWidgets
from PyQt5.QAxContainer import QAxWidget
from multiprocessing import Process, Queue, Lock
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from login.manuallogin im... |
test_morris_api.py | # I'm going to test through an actual web call, so there is no actuall
# importation of the morris_api file. Instead, we will rely on Requests.
# You need to have Bottle already running on Port 8080 and answering on
# localhost for these tests to run.
# The set up fixture below starts up the Bottle server on port 80... |
copyutil.py | # cython: profile=True
# 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
# "... |
Filetransfer.py | ##########################################################
# This RNS example demonstrates a simple filetransfer #
# server and client program. The server will serve a #
# directory of files, and the clients can list and #
# download files from the server. #
#########################... |
pika.py | import json
import logging
import os
import time
import typing
from collections import deque
from threading import Thread
from typing import Callable, Deque, Dict, Optional, Text, Union
from rasa.constants import (
DEFAULT_LOG_LEVEL_LIBRARIES,
ENV_LOG_LEVEL_LIBRARIES,
DOCS_URL_EVENT_BROKERS,
)
from rasa.co... |
ssh.py | import inspect
import logging
import os
import re
import shutil
import string
import sys
import tarfile
import tempfile
import threading
import time
import types
from .. import term
from ..context import context
from ..log import Logger
from ..timeout import Timeout
from ..util import hashes
from ..util import misc
fr... |
train_and_eval_runner.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
multiprocess.py | #!/usr/bin/env python
#-*- coding:utf-8 -*-
from multiprocessing import Process
import random
import time
# # 创建进程,方式1
# def piao(name):
# print("%s is piaoing" %name)
# time.sleep(random.randint(1,3))
# print("%s has piaoed" %name)
#
# postfile1.txt = Process(target=piao, args=("adler",), name="<adler_pi... |
parallelize.py | import itertools
import os
import multiprocessing as mp
import threading
import queue
from ..helpers import ResourceMatcher
from .. import PackageWrapper, ResourceWrapper
def init_mp(num_processors, row_func, q_in, q_internal):
q_out = mp.Queue()
processes = [mp.Process(target=work, args=(q_in, q_out, row_fu... |
wii_status_characteristic.py | from bikevr_sensor_controller.common.user_descriptor import UserDescriptor
from bikevr_sensor_controller.common.format_descriptor import FormatDescriptor
from bikevr_sensor_controller.common.tools import bit_bool, to_bool
from bluezero import peripheral
from threading import Thread
from time import sleep
NAME = 'Wiimo... |
__init__.py | import warnings
from threading import Thread, Timer, Condition
import numpy
import importlib
from enum import Enum
from .block import Block, BlockType
# alternative perf_counter
import sys
from time import perf_counter
class ControllerWarning(Warning):
pass
class ControllerException(Exception):
pass
# stat... |
engine.py | # !/usr/bin/env python
# -*- coding: utf-8 -*-
import multiprocessing
import time
import random
import csv
import json
import string
from datetime import datetime
from database.db import create_connection, __logs_by_scan_id
from database.models import HostsLog, Report
import os
from flask import Flask
from flask impor... |
conftest.py | import pytest
import time
from context import HGECtx, HGECtxError, EvtsWebhookServer, HGECtxGQLServer, GQLWsClient, PytestConf
import threading
import random
from datetime import datetime
import sys
import os
def pytest_addoption(parser):
parser.addoption(
"--hge-urls",
metavar="HGE_URLS",
... |
n0t3b00k.py | import socket
import threading
import hashlib
import os
import json
#### Service tenets
# A service SHOULD NOT be a simple wrapper for a key-value database, and SHOULD expose more complex functionality => This is an example service, so it does not satisfy this tenet.
# Rewriting a service with the same feature set SHO... |
vision.py | """
Image Data Processing
Copyright 2018(c), Andrew Ferlitsch
"""
version = '0.9.4'
import os
import sys
import io
import threading
import time
import copy
import random
import requests
import imutils
import gc
# Import numpy for the high performance in-memory matrix/array storage and operations.
import numpy as np
... |
orchestrator.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import copy
import errno
import logging
import time
import traceback
import multiprocessing
from multiprocessing import Lock, RLock, Condition, Event, Queue
from multiprocessing.process import current_process
from threading import Thread
from typ... |
transaction.py | #!/usr/bin/env python3
#
# Electrum ABC - lightweight eCash client
# Copyright (C) 2020 The Electrum ABC developers
# Copyright (C) 2011 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 t... |
manager.py | #!/usr/bin/env python3
import os
import time
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import datetime
import textwrap
from typing import Dict, List
from selfdrive.swaglog import cloudlog, add_logentries_handler
from common.basedir import BASEDIR, PARAMS
from common.android im... |
ui_utils.py | # -*- coding: utf-8 -*-
from logging import getLogger
import os
import platform
import re
import subprocess
import sys
import textwrap
import threading
import time
import tkinter as tk
import tkinter.font
import traceback
from tkinter import filedialog, messagebox, ttk
from typing import Callable, List, Optional, Tuple... |
workers.py | import time
import random
from multiprocessing import Process, Queue, current_process
#
# Function run by worker processes
#
def worker(input_, output):
for func, args in iter(input_.get, 'STOP'):
result = calculate(func, args)
output.put(result)
#
# Function used to calculate result
#
def ca... |
rc-connect.py | import argparse
import multiprocessing
from reconchess import load_player
from reconchess import play_remote_game
parser = argparse.ArgumentParser()
parser.add_argument('server', help='url to the server')
parser.add_argument('auth_file', help='path to the file that contains auth information')
parser.add_argument('bot_... |
basic02.py | """
web服务器返回灵活页面,根据制定的路径打开指定的页面
"""
import socket, threading, multiprocessing,gevent
import re
import time
# dynamic包中存放的是框架之类的东西,注意更新import的路径
import dynamic.mini_framework
from gevent import monkey
monkey.patch_all()
class WSGIServer(object):
def __init__(self):
self.server_socket = socket.socket... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "I'm alive"
def run():
app.run(host='0.0.0.0', port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
|
test_utility.py | import threading
import pytest
from base.client_base import TestcaseBase
from base.utility_wrapper import ApiUtilityWrapper
from utils.util_log import test_log as log
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
prefix = "utility"
defau... |
Fight_utils.py | # For Youtube Download.
import io
from pytube import YouTube
from IPython.display import HTML
from base64 import b64encode
import os
import cv2
import time
import copy
import glob
import torch
import argparse
import statistics
import threading
import torchvision
import numpy as np
import pandas as pd
import torch.nn... |
cassettes.py | import base64
import re
import sys
import threading
from queue import Queue
from typing import Any, Dict, Generator, Iterator, List, Optional, cast
import attr
import click
import requests
from requests.cookies import RequestsCookieJar
from requests.structures import CaseInsensitiveDict
from .. import constants
from ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.