source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
ping_tests.py | import asyncio
import win32com.client
import time
wmi = win32com.client.GetObject(r"winmgmts:\\.\root\cimv2") # Windows wmi service
""" Ping StatusCode_ReturnValues
0='Success'
11001='Buffer Too Small'
11002='Destination Net Unreachable'
11003='Destination Host Unreachable'
11004='Destination Protocol Unreachable'... |
yb_backup.py | #!/usr/bin/env python
#
# Copyright 2022 YugaByte, Inc. and Contributors
#
# Licensed under the Polyform Free Trial License 1.0.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://github.com/YugaByte/yugabyte-db/blob/master/licenses... |
ServerDriver.py | #!/usr/bin/env python3
# Package imports
import logging
import threading
# Local imports
from controllers.ReceiverController import ReceiverServer
from controllers.SenderController import SenderServer
async def Servers():
format = "%(asctime)s: %(message)s"
logging.basicConfig(format=format, level=logging.I... |
server.py | from flask import Flask, render_template, request, jsonify
from flask_cors import CORS, cross_origin
from multiprocessing import Process
from configuration import Config
import json
import boto3
import time
import paramiko
import os
app = Flask(__name__)
CORS(app)
#Paraminko ssh information
dirname = os.path.dirname(... |
intersubs_ui.py | #! /usr/bin/env python
# v. 2.7
# Interactive subtitles for `mpv` for language learners.
import os
import subprocess
import sys
import random
import re
import time
import threading
import platform
from json import loads
import numpy
from PyQt5.QtCore import Qt, QThread, QObject, pyqtSignal, pyqtSlot, QSize
from PyQt5... |
iotcore.py | # Copyright 2021 Amazon.com.
# SPDX-License-Identifier: MIT
from threading import Thread
from typing import Callable
import awsiot.greengrasscoreipc.client as client
from awsiot.greengrasscoreipc import connect
from awsiot.greengrasscoreipc.model import (
QOS,
PublishToIoTCoreRequest,
SubscribeToIoTCoreReq... |
minion.py | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import print_function
import copy
import errno
import fnmatch
import hashlib
import logging
import multiprocessing
import os
import re
import salt
import signal
import sys
import threading
import time
import traceback
impo... |
test_forward.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... |
manage.py | from multiprocessing import Process, Pipe, Queue
import tcp_recv
import process
import time
import threading
def main():
queue1 = Queue()
queue2 = Queue()
queues = [queue1, queue2]
thread = threading.Thread(target=tcp_recv.OpenRecv, args=(queues,))
p1 = Process(target=process.func, args=("proc1", q... |
test_weakref.py | import gc
import sys
import unittest
import collections
import weakref
import operator
import contextlib
import copy
import threading
import time
import random
from test import support
from test.support import script_helper
# Used in ReferencesTestCase.test_ref_created_during_del() .
ref_from_del = None
# Used by Fi... |
train.py | """Initial experiments with the lenet network to check the trends of the time with k, batch and parallelism"""
import argparse
import time
from multiprocessing import Process
from typing import Tuple
from common.experiment import *
from common.metrics import start_api
from common.utils import *
output_folder = './te... |
store.py | import json
import logging
import os
import threading
import time
import uuid as uuid_builder
from copy import deepcopy
from os import mkdir, path, unlink
from threading import Lock
from changedetectionio.notification import (
default_notification_body,
default_notification_format,
default_notification_tit... |
test_decimal.py | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz (aahz at pobox.com)
# and Tim Peters
"""
These are the test cases for the Decim... |
utils.py | import multiprocessing
from multiprocessing.queues import Queue as BaseQueue
class Queue(BaseQueue):
"""
Multiprocessing queue that has a stable qsize value, and supports these methods for OSX.
Also taken from https://github.com/vterron/lemon/commit/9ca6b4b1212228dbd4f69b88aaf88b12952d7d6f
"""
de... |
labels.py | import hashlib
import requests
import threading
import json
import sys
import traceback
import aes
import base64
import uwallet
from uwallet.plugins import BasePlugin, hook
from uwallet.i18n import _
class LabelsPlugin(BasePlugin):
def __init__(self, parent, config, name):
BasePlugin.__init__(self, p... |
cnn_util_test.py | # coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# 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 applicab... |
call_methylation.py | #!/usr/bin/env python
"""Takes alignments from signalAlign and calls methylation status"""
from __future__ import print_function, division
import sys
sys.path.append("../")
from argparse import ArgumentParser
from alignmentAnalysisLib import CallMethylation
from signalAlignLib import parse_substitution_file, degenerate... |
base.py | from __future__ import annotations
import logging
import threading
import typing
from concurrent.futures import Future
from bioimageio.core.prediction_pipeline import PredictionPipeline
from tiktorch.configkeys import TRAINING, VALIDATION
from tiktorch.server.session import types
from tiktorch.server.session.backend... |
util.py | # -*- coding: utf-8 -*-
#
# 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 "L... |
parallel.py | import sys
import socket
import struct
import time
import threading
class server_msi( object ):
def __recv( self, sckt ):
msg = sckt.recv( self.slen )
try:
cmd = msg[0:1]
who = int( msg[1:4] )
dst = int( msg[4:7] )
siz = int( msg[7:17] )
... |
cat.py | import os
import json
import pandas
import spacy
from time import sleep
from functools import partial
from multiprocessing import Process, Manager, Queue, Pool, Array
from medcat.cdb import CDB
from medcat.spacy_cat import SpacyCat
from medcat.preprocessing.tokenizers import spacy_split_all
from medcat.utils.spelling i... |
packetQueue.py | import time,threading
from queue import Queue
from mirage.libs.utils import exitMirage
class StoppableThread(threading.Thread):
'''
This class is just a simplistic implementation of a stoppable thread.
The target parameter allows to provide a specific function to run continuously in background.
If the stop method ... |
vec_env.py | import redis
import time
import subprocess
from multiprocessing import Process, Pipe
def start_redis():
print('Starting Redis')
subprocess.Popen(['redis-server', '--save', '\"\"', '--appendonly', 'no'])
time.sleep(1)
def start_openie(install_path):
print('Starting OpenIE from', install_path)
subp... |
process.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import tempfile
import subprocess
import tensorflow as tf
import numpy as np
import tfimage as im
import threading
import time
import multiprocessing
edge_pool = None
parser = argp... |
test_integration_using_router.py | import json
import time
from http import HTTPStatus
from threading import Thread
from typing import Union, List
from unittest import TestCase
from uuid import uuid4
import requests
from requests.auth import HTTPBasicAuth
from openbrokerapi import api, errors
from openbrokerapi.catalog import ServicePlan
from openbrok... |
web_service_4.py | import cv2
from PIL import Image
import argparse
from pathlib import Path
from multiprocessing import Process, Pipe,Value,Array
import torch
from config import get_config
from mtcnn import MTCNN
from Learner import face_learner
from utils import load_facebank, draw_box_name, prepare_facebank
#########################... |
system.test.py | # Copyright 2019 Canonical, 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 in writin... |
cathread_tests.py | """This script tests using EPICS CA and Python threads together
Based on code from Friedrich Schotte, NIH
modified by Matt Newville 19-Apr-2010
modified MN, 22-April-2011 (1 year later!)
to support new context-switching modes
"""
import time
import epics
import sys
from threading import Thread
from epics... |
main.py | import os
import threading
import pandas as pd
from datetime import datetime
from pm4py.algo.analysis.woflan import algorithm as woflan
from pm4py.algo.evaluation.generalization import evaluator as generalization_evaluator
from pm4py.algo.evaluation.precision import evaluator as precision_evaluator
from pm4py.algo.eva... |
restarter.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Reload python flask server by function / API endpoint
# References:
# https://docs.python.org/3/library/multiprocessing.html
# http://stackoverflow.com/questions/27723287/reload-python-flask-server-by-function
import os
import sys
import time
import subprocess
from flask... |
exportservice.py | #!/usr/bin/env python2
'''A library and a command line tool to interact with the LOCKSS daemon export
service via its Web Services API.'''
__copyright__ = '''\
Copyright (c) 2000-2019 Board of Trustees of Leland Stanford Jr. University,
all rights reserved.
'''
__license__ = '''\
Permission is hereby granted, free o... |
redis_used_memory.py | import redis
from multiprocessing import Process
import psutil
import time
import matplotlib.pyplot as plt
import csv
write_process=[]
DICT={}
CPU_PERCENT_LIST=[]
MEMORY_PERCENT_LIST=[]
def draw_picture(colunm):
plt.plot(range(total_users),colunm,label="memory_percent",linewidth=3,color='r')
#plt.plot(range(total_... |
helpers.py | from django.conf import settings
from mapproxy.seed.seeder import seed
from mapproxy.seed.config import SeedingConfiguration, SeedConfigurationError, ConfigurationError
from mapproxy.seed.spec import validate_seed_conf
from mapproxy.config.loader import ProxyConfiguration
from mapproxy.config.spec import validate_mappr... |
decorators.py | from threading import Thread
"""Used for async mail calls"""
def async(f):
def wrapper(*args, **kwargs):
thr = Thread(target=f, args=args, kwargs=kwargs)
thr.start()
return wrapper |
internal_api.py | import os
from flask import Flask, request, jsonify
from modules.geocode_module import reverse_geocode
from modules.db_module import district_db, location_db
from modules.clustering_algo import clustering
from ml_model.trash_detection import scan_and_call
from time import sleep
from multiprocessing import Process
ddb ... |
model.py | from functools import wraps
from threading import Thread
import polka
def threaded(func):
@wraps(func)
def async_func(*args, **kwargs):
thread = Thread(target=func, args=args, kwargs=kwargs)
thread.start()
return thread
return async_func
class Model:
"""Access to the Polka ... |
TCPServer.py | #!/bin/python2
import socket
import threading
bind_ip = "0.0.0.0"
bind_port = 9999
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((bind_ip, bind_port))
server.listen(5)
print "[*] Listening on %s:%d" % (bind_ip, bind_port)
#client handling thread
def handle_client(client_so... |
asyn.py | import asyncio
import asyncio.events
import functools
import inspect
import os
import re
import sys
import threading
from contextlib import contextmanager
from glob import has_magic
from .callbacks import _DEFAULT_CALLBACK
from .exceptions import FSTimeoutError
from .spec import AbstractFileSystem
from .utils import i... |
Ui.py | # -*- coding: utf-8 -*-
import os
import re
from cefpython3 import cefpython as cef
import base64
import platform
import sys
import threading
import subprocess
import queue
import re
import pickle
from .Version import getFullVersion
from .Client import Client as _C
from .Parser import Parser as _P
from . import Defs ... |
GrabImage.py | # -- coding: utf-8 --
import sys
import threading
import msvcrt
from ctypes import *
sys.path.append("../MvImport")
from MvCameraControl_class import *
g_bExit = False
# 为线程定义一个函数
def work_thread(cam=0, pData=0, nDataSize=0):
stFrameInfo = MV_FRAME_OUT_INFO_EX()
memset(byref(stFrameInfo), 0, sizeof(stFrameI... |
run-spec-test.py | #!/usr/bin/env python3
# Author: Volodymyr Shymanskyy
# Usage:
# ./run-spec-test.py
# ./run-spec-test.py ./core/i32.json
# ./run-spec-test.py ./core/float_exprs.json --line 2070
# ./run-spec-test.py ./proposals/tail-call/*.json
# ./run-spec-test.py --exec ../build-custom/wasm3
# ./run-spec-test.py --engine... |
pyshell.py | #! /usr/bin/env python3
import sys
if __name__ == "__main__":
sys.modules['idlelib.pyshell'] = sys.modules['__main__']
try:
from tkinter import *
except ImportError:
print("** IDLE can't import Tkinter.\n"
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
raise SystemExit(... |
test_collection.py | import pdb
import pytest
import logging
import itertools
from time import sleep
from multiprocessing import Process
from milvus import IndexType, MetricType
from utils import *
dim = 128
drop_collection_interval_time = 3
index_file_size = 10
vectors = gen_vectors(100, dim)
class TestCollection:
"""
********... |
my_git.py | import git
import os, re, io
from git import Git, Repo
from threading import Thread
from PyQt5.QtCore import pyqtSignal, QObject
class PipeIO(io.BytesIO):
def __init__(self, updater_cb):
io.BytesIO.__init__(self)
self.updater_cb = updater_cb
def write(self, b):
buf = io.BytesIO.getbuffer(self).tobytes()
pro... |
execute.py | #!/usr/bin/env python
import sys
import time
import socket
from bandwidth_monitor import BandwidthMonitor
from tcpclient import TCPClient
import tcpserver
import threading
from udpclient import UDPClient
from udpserver import Server
from config_helper import read_config_map, update_key_value
import plotly.plotly as py... |
comm.py | from __future__ import division, print_function
import sys
from sys import version_info
from time import sleep
from threading import Thread, Event
from getports import Serial,ports
if version_info[0] == 3:
# Python 3
def tobytes(x):
return x.encode('latin1')
def asbyte(x):
return bytes([x... |
wsdump.py | #!/home/topicos/Apps/FacebookBot/facebook-echobot/bin/python2
import argparse
import code
import six
import sys
import threading
import time
import websocket
from six.moves.urllib.parse import urlparse
try:
import readline
except:
pass
def get_encoding():
encoding = getattr(sys.stdin, "encoding", "")
... |
test_credentials.py | # Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
dataengine-service_configure.py | #!/usr/bin/python3
# *****************************************************************************
#
# 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 ... |
orchestrator.py | # Copyright 2016, 2017 Matteo Franchin
#
# 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 ... |
byhand.py | import datetime
import json
import traceback
import os
import platform
import logging.config
from threading import Thread, Event
from slavem import Reporter
import time
import arrow
import logging.config
from wash import Washer
from aggregatebar import AggregateBar
from contracter import Contracter
from hiscontract im... |
workerpool.py | import os
import sys
import signal
import subprocess
import multiprocessing
from openquake.baselib import zeromq as z, general, parallel
try:
from setproctitle import setproctitle
except ImportError:
def setproctitle(title):
"Do nothing"
def streamer(host, task_in_port, task_out_port):
"""
A s... |
ircclient.py | # -*- coding: utf-8 -*-
"""Starts an IRC client."""
import sys
import threading
from . import exceptions
from . import ircsocket
LINESEP = "\r\n"
"""IRC likes a \r\n, though most accept a \n."""
def connect_to_irc(host, port, vlog):
"""Connect to an IRC server.
Args:
host
The host t... |
_kubeless.py | #!/usr/bin/env python
import importlib
import io
import os
import queue
import sys
import bottle
import prometheus_client as prom
# The reason this file has an underscore prefix in its name is to avoid a
# name collision with the user-defined module.
current_mod = os.path.basename(__file__).split('.')[0]
if os.gete... |
inception_v1.py | # 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 agreed to in writing, ... |
lockfile.py |
"""
lockfile.py - Platform-independent advisory file locks.
Requires Python 2.5 unless you apply 2.4.diff
Locking is done on a per-thread basis instead of a per-process basis.
Usage:
>>> lock = FileLock(_testfile())
>>> try:
... lock.acquire()
... except AlreadyLocked:
... print _testfile(), 'is locked alre... |
__init__.py | # -*- coding: utf-8 -*-
"""The initialization file for the Pywikibot framework."""
#
# (C) Pywikibot team, 2008-2017
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__release__ = '3.0-dev'
__version__ = '$Id: e4000cc8b1ddcd00ae795cdeca1a4c903d8a321e $'
__u... |
Hiwin_RT605_ArmCommand_Socket_20190628090913.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_v2 as TCP
import HiwinRA605_socket_Taskcmd_v2 as Taskcmd
import numpy as np
from std_msgs.msg import String
from ROS_Socket.s... |
dicts.py | #!/usr/bin/env python2.5
"""
#############################################################################
##
## file : dicts.py
##
## description : see below
##
## project : Tango Control System
##
## $Author: Sergi Rubio Manrique, srubio@cells.es $
##
## $Revision: 2008 $
##
## copyleft : ALBA Synchrotro... |
Experiment.py | # -*- coding: utf-8 -*-
# !/usr/bin/env python
from tkinter import *
import random
import time
from time import gmtime, strftime
import zmq
import json
import queue
import threading
import pandas as pd
import numpy as np
import math
import matlab.engine
from calibrate import Calibrate
class Ball:
def __init__(s... |
Blinker.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import json
import time as _time
import socket
import threading
from Blinker.BlinkerConfig import *
from Blinker.BlinkerDebug import *
from BlinkerUtility.BlinkerUtility import *
# from BlinkerAdapters.BlinkerBLE import *
# from BlinkerAdapters.Blink... |
ch08_listing_source.py | # coding: utf-8
import BaseHTTPServer
import cgi
import functools
import json
import math
import random
import socket
import SocketServer
import time
import threading
import unittest
import uuid
import urlparse
import redis
def acquire_lock_with_timeout(
conn, lockname, acquire_timeout=10, lock_timeout=10):
... |
train.py | """
Learning Deep Generative Models of Graphs
Paper: https://arxiv.org/pdf/1803.03324.pdf
"""
import datetime
import time
import torch
import torch.distributed as dist
from dgl import model_zoo
from torch.optim import Adam
from torch.utils.data import DataLoader
from utils import MoleculeDataset, Printer, set_random_s... |
measurementcontroller.py | import datetime
import glob
import logging
import shutil
import threading
import time
from enum import Enum
import os
from flask import json
from flask_restful import fields
from flask_restful import marshal
from core.interface import EnumField, DATETIME_FORMAT
MEASUREMENT_TIMES_CLASH = "Measurement times clash"
ta... |
multithreading.py | import threading
# since multiple arguments may be passed every item in args is a list
def multi_threading(func, arguments, n=10):
for i in range(0, len(arguments), n):
thread_objects = []
for j in range(i, min(len(arguments), n + i)):
thread = threading.Thread(target=func, args=arg... |
cleanup.py | import tempfile
import argparse
import logging
import datetime
import threading
import os
import re
from botocore.exceptions import ClientError
from ocs_ci.framework import config
from ocs_ci.ocs.constants import (
CLEANUP_YAML,
TEMPLATE_CLEANUP_DIR,
AWS_CLOUDFORMATION_TAG,
)
from ocs_ci.ocs.exceptions i... |
userInterface.py | from Tkinter import *
import ttk
import tkMessageBox
import pcapReader
import plotLanNetwork
import communicationDetailsFetch
import reportGen
import time
import threading
import Queue
from PIL import Image,ImageTk
import os
class pcapXrayGui:
def __init__(self, base):
# Base Frame Configuration
se... |
util.py | import os
import re
import sys
import time
import json
import requests
from datetime import datetime
from subprocess import run, PIPE, DEVNULL
from multiprocessing import Process
from urllib.parse import quote
from config import (
IS_TTY,
OUTPUT_PERMISSIONS,
REPO_DIR,
SOURCES_DIR,
OUTPUT_DIR,
... |
parallel.py | from __future__ import absolute_import
from __future__ import unicode_literals
import logging
import operator
import sys
from threading import Thread
from docker.errors import APIError
from six.moves import _thread as thread
from six.moves.queue import Empty
from six.moves.queue import Queue
from compose.cli.signals... |
log_consumer.py | """Log consumers are responsible for fetching chia logs
and propagating them to subscribers for further handling.
This abstraction should provide an easy ability to switch between
local file reader and fetching logs from a remote machine.
The latter has not been implemented yet. Feel free to add it.
"""
# std
import ... |
app.py | # encoding: utf-8
'''
A REST API for Salt
===================
.. versionadded:: 2014.7.0
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends: - CherryPy Python module
:optdepends: - ws4py Python module for websockets support.
:configuration: All authentication is done through Salt's :ref:`external auth... |
test_http.py | import contextlib
import asyncio
import os
import pytest
from http.server import BaseHTTPRequestHandler, HTTPServer
import sys
import threading
import fsspec
requests = pytest.importorskip("requests")
port = 9898
data = b"\n".join([b"some test data"] * 1000)
realfile = "http://localhost:%i/index/realfile" % port
index... |
online.py | from ...objects import dp, MySignalEvent, DB
from ... import utils
from threading import Thread, Timer
import time
from vkapi import VkApi
import typing
import logging
logger = logging.getLogger(__name__)
online_thread: Thread = None
stop_thread = False
def set_online(v):
global stop_thread
... |
mplog.py | # Adapted from https://gist.github.com/schlamar/7003737
from __future__ import unicode_literals
import contextlib
import multiprocessing
import logging
import threading
def daemon(log_queue):
while True:
try:
record_data = log_queue.get()
if record_data is None:
b... |
test_exchange.py | import helper
import logging
import pika
import pytest
import threading
import time
LOG = logging.getLogger()
message_received = threading.Condition()
def declare_exchange_and_queue(conn, exchange, exchange_type, queue):
channel = conn.channel(channel_number=1)
channel.exchange_declare(exchange=exchange,
... |
multiprocessing_daemon_join.py | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
"""Daemon vs. non-daemon processes.
"""
#end_pymotw_header
import multiprocessing
import time
import sys
def daemon():
name = multiprocessing.current_process().name
print 'Starting:', name
time.sleep(2)
... |
communication.py | # BSD-3-Clause License
#
# Copyright 2017 Orange
#
# 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 list of conditions and the followi... |
main.py | import websockets.exceptions
from fastapi import FastAPI, WebSocket, WebSocketDisconnect
from .redis_manager import RedisManager
from .user_instance import UserInstance
from .message_executors import UserMsgExecutor, ServerMsgExecutor
from .consts import WAITING_CHANNEL
from queue import Queue
from . import auth
import... |
gdbclientutils.py | import os
import os.path
import subprocess
import threading
import socket
import lldb
from lldbsuite.support import seven
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbtest_config
def checksum(message):
"""
Calculate the GDB server protocol checksum of the message.
The GDB server p... |
utilities.py | """
Utility functions
"""
from __future__ import absolute_import
import glob
import socket
import os
import logging
import uuid
import datetime
import shlex
import re
import sys
import threading
import time
from subprocess import Popen, PIPE, STDOUT
import yaml
try:
from yaml import CDumper as Dumper
except Import... |
client.py | # Copyright 2017 D-Wave Systems 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 wri... |
LidarTestPlot.py | import threading
import PyLidar3
import matplotlib.pyplot as plt
import math
import time
def draw():
global is_plot
while is_plot:
plt.figure(1)
plt.cla()
plt.ylim(-9000,9000)
plt.xlim(-9000,9000)
plt.scatter(x,y,c='r',s=8)
plt.pause(0.001)
plt.close("all... |
device.py | from time import sleep
from flask import Flask, Response, jsonify, render_template, request
from actuator import Actuator
from sensor import Sensor
import json
import pika
from enum import Enum
from threading import Thread
import os
def start_all():
if (type == DeviceType.BOTH):
sensor.start()
act... |
pipeclient.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Automate Audacity via mod-script-pipe.
Pipe Client may be used as a command-line script to send commands to
Audacity via the mod-script-pipe interface, or loaded as a module.
Requires Python 2.7 or later. Python 3 strongly recommended.
======================
Command ... |
build.py | import itertools
import multiprocessing
import os
import re
import shutil
import sys
import time
from glob import glob
from multiprocessing import Pool
from subprocess import PIPE, Popen, check_call
from pp.components import component_factory
from pp.config import CONFIG, logging
from pp.doe import load_does
def run... |
test.py | import argparse
import json
import os
from pathlib import Path
from threading import Thread
import numpy as np
import torch
import yaml
from tqdm import tqdm
from models.experimental import attempt_load
from utils.datasets import create_dataloader
from utils.general import (
coco80_to_coco91_class,
check_data... |
data_util.py | '''
this file is modified from keras implemention of data process multi-threading,
see https://github.com/fchollet/keras/blob/master/keras/utils/data_utils.py
'''
import time
import numpy as np
import threading
import multiprocessing
try:
import queue
except ImportError:
import Queue as queue
class GeneratorE... |
socket_client.py | ### RPGOnline
### A Synergy Studios Project
import socket
from packet import Packet
from threading import Thread
from datetime import datetime
class SocketClient:
"""The socket client which provides a base
for sending and loading data."""
def __init__(self, host, port):
... |
test_profile.py | import pytest
import sys
import time
from tlz import first
import threading
from distributed.compatibility import WINDOWS
from distributed import metrics
from distributed.profile import (
process,
merge,
create,
call_stack,
identifier,
watch,
llprocess,
ll_get_stack,
plot_data,
)
... |
convert_tfrecords.py | # Copyright 2018 Changan Wang
# 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 wri... |
threads_init.py | import threading
import time
num_threads = 4
def thread_message(message):
global num_threads
num_threads -= 1
print('Message from thread %s\n' %message)
while num_threads > 0:
print("I am the %s thread" %num_threads)
threading.Thread(target=thread_message("I am the %s thread" %num_threads)).start()
... |
sync_config.py | import importlib
import os
import sys
import time
import datetime
import threading
import json
from xosconfig import Config
config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/lbaas_config.yaml')
Config.init(config_file, 'synchronizer-config-schema.yaml')
sys.path.insert(0, "/opt/xos")
impor... |
pyGBFsummon.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
# chara[R/SR/SSR... |
client_length_mt_fixed_char.py | #!/usr/bin/python
import getopt
import socket
import sys
import datetime
import threading
MAX_LENGTH = 4096
#HOST = '1.1.2.20'
#HOST = '1.1.1.1'
#HOST = '172.16.0.14'
def length_test(hostIPAddr, threadId):
HOST = hostIPAddr
PORT = 5001
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
import unittest.mock
from test import support
import socket
import select
import time
import datetime
import gc
import os
import errno
import pprint
import urllib.request
import threading
import traceback
import asyncore
import weakref
import platform
i... |
handlers.py | # Copyright 2001-2016 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
engine.py | # Copyright 2013: Mirantis 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 b... |
mybot.py | # -*- coding: utf-8 -*-
import telegram
import os
import sys
from threading import Thread
import logging
from functools import wraps
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, ConversationHandler, CallbackQueryHandler
from app.utils.loadini import read_config
from app.utils.monthly impo... |
main.py | import os
import requests
import json
import copy
import kivy
from random import randint
from kivy.uix.button import Button
from kivy.uix.popup import Popup
from kivy.uix.boxlayout import BoxLayout
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.textinp... |
img_downloader.py | #! python3
'''
Sample script for downloading all images from website
Pixel2008 All Rights Reserved ®
'''
from typing import List
import sys, requests, bs4, traceback, os, shutil
import multiprocessing, json, smtplib, threading
def get_url() -> str:
def_url = "http://www.google.pl"
def_url = "http://dru.pl"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.