source
stringlengths
3
86
python
stringlengths
75
1.04M
process_demo.py
# -*- coding: utf-8 -*- import multiprocessing import time """ Process 创建进程的类:Process([group [, target [, name [, args [, kwargs]]]]]),target表示调用对象,args表示调用对象的位置参数元组。kwargs表示调用对象的字典。name为别名。group实质上不使用。 方法:is_alive()、join([timeout])、run()、start()、terminate()。其中,Process以start()启动某个进程。 属性:authkey、daemon(要通过start()设置...
control_test.py
#!/usr/bin/env python # encoding: utf-8 """ control.py Created by Thomas Mangin on 2015-01-01. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ import time import socket import tempfile import unittest from multiprocessing import Process from exabgp.reactor.api.control import Control from exabgp.conf...
uart_provider.py
import os import re import sys import time import json import binascii import math # import asyncio import datetime import threading import struct from azure.storage.blob import BlockBlobService from ...framework.utils import helper from ...framework.utils import resource from ..base import OpenDeviceBase from ..config...
train.py
from dataloader import EvalDataset, TrainDataset, NewBidirectionalOneShotIterator from dataloader import get_dataset import argparse import os import logging import time backend = os.environ.get('DGLBACKEND', 'pytorch') if backend.lower() == 'mxnet': import multiprocessing as mp from train_mxnet import load_m...
stream.py
"""Manipulate MorphoCut streams and show diagnostic information.""" import itertools import pprint from queue import Queue from threading import Thread from typing import Callable, Collection, Iterable, Optional, Tuple, Union from morphocut.stream_estimator import StreamEstimator import tqdm from deprecated.sphinx im...
kb_Bowtie2Server.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, Inva...
other_socket.py
import socket import select import threading sock = None evsock = None doRead = False remote = False def connect(inp = None): global sock, evsock host = 'localhost' port = 8080 if remote: host = "192.168.1.3" #ESP32 IP in local network port = 80 if inp is None: sock = soc...
fast_crawl_foud_detail.py
import json import logging import os import re import threading import time from queue import Queue import js2py import pandas import pandas as pd import requests from bs4 import BeautifulSoup # 互斥锁实例化 lock = threading.Lock() database = dict() with open('../data/parsed_fund_detail.json', 'r') as f: database = js...
dag_processing.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 #...
program_polview.py
import sys import os import asyncio from program_polview.worker import Worker from web.rest.base import Connection from widgets.login import LoginWidget from config import Config from PyQt5 import QtCore, QtWidgets from threading import Thread import subprocess as sp import json class UnixProtocolR(asyncio.Protocol):...
gui.py
""" GUI for grabbing data and plotting / analysis using MQ instruments. """ # Import interface code for MQ instruments import mqlab.optical_spectrum_analysers as mq_osa import mqlab.oscilloscopes as mq_osc import mqlab.electrical_spectrum_analysers as mq_esa import mqlab.monochromators as mq_monochromator import ...
timer.py
import collections import time import datetime import threading class Timer(object): def __init__(self, action, args=(), kwargs={}, postaction=None, interval=1): self.action = action self.args = args self.kwargs = kwargs self.interval = interval self.results = collections.de...
core.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 #...
processes.py
""" process.py Created by Thomas Mangin on 2011-05-02. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ import os import errno import time import subprocess import select import fcntl from exabgp.util.errstr import errstr from exabgp.reactor.network.error...
monobeast.py
# Copyright (c) Facebook, Inc. and its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
tests.py
import threading import time from django.db import OperationalError, connection, transaction from django.test import TestCase, TransactionTestCase from . import get_next_value class SingleConnectionTestsMixin(object): def test_defaults(self): self.assertEqual(get_next_value(), 1) self.assertEqu...
test_class_dependency.py
from functools import partial from threading import Event, Thread from unittest.case import TestCase from unittest.mock import Mock import acetone class TestClassDependency(TestCase): def setUp(self): self._container = acetone.AcetoneContainer() class DummyObject(object): dependency ...
splunk_http_event_collector.py
# -*- coding: utf-8 -*- # (c) Copyright IBM Corp. 2010, 2019. All Rights Reserved. # pragma pylint: disable=unused-argument, no-self-use, line-too-long """splunk_http_event_collector.py Splunk HTTP event submission class Remember: Friends don't let friends send in non Common Information Model data: http://docs...
stream_layered_image.py
""" This script generates a Docker image from a set of store paths. Uses Docker Image Specification v1.2 as reference [1]. It expects a JSON file with the following properties and writes the image as an uncompressed tarball to stdout: * "architecture", "config", "os", "created", "repo_tag" correspond to the fields ...
test_pool.py
# Copyright 2013 Red Hat, 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 agr...
vislive.py
#!/usr/bin/env python3 import os import sys import subprocess import signal import math import time import numpy as np import visdom import logging import webbrowser from visdom.server import download_scripts, main from multiprocessing import Process from terminaltables import SingleTable def kill_child_processes(sig...
planning_controller.py
# Copyright (C) 2018-2019 DLR # # All rights reserved. This program and the accompanying materials are made # available under the terms of the 3-Clause BSD License which accompanies this # distribution, and is available at # https://opensource.org/licenses/BSD-3-Clause # # Contributors: # Christoph Suerig <christoph.su...
run_sleepers.py
""" In ZERO mode, this takes 5 seconds to run. This is because we spin up all threads (14) concurrently locally. In LOCAL mode, this takes 10 seconds to run. This is because we delegate all work to the microservices - and they respond to the work synchronously. This sounds worse, but is actually desired - the sleeps ...
test.py
import json import random import re import string import threading import time from multiprocessing.dummy import Pool import pytest from helpers.client import QueryRuntimeException from helpers.cluster import ClickHouseCluster cluster = ClickHouseCluster(__file__) node1 = cluster.add_instance('node1', ...
scan.py
#!/usr/bin/env python3 import monocle.sanitized as conf from asyncio import gather, set_event_loop_policy, Task, wait_for, TimeoutError try: if conf.UVLOOP: from uvloop import EventLoopPolicy set_event_loop_policy(EventLoopPolicy()) except ImportError: pass from multiprocessing.managers impor...
test_speech_to_text_v1.py
from __future__ import print_function from unittest import TestCase import os from watson_developer_cloud.websocket import RecognizeCallback, AudioSource import watson_developer_cloud import pytest import threading @pytest.mark.skipif( os.getenv('VCAP_SERVICES') is None, reason='requires VCAP_SERVICES') class Test...
Thead_demo3.py
#!/usr/bin/env python # -*- coding:utf-8 -*- ''' 自己模仿线程创建一个线程类 线程start的时候使用的run方法,我们也创建一个 ''' from threading import Thread import time class MyThread(Thread): #继承系统的线程类 def run(self): #time.sleep(10) print '我是线程!' Thread.run(self) #调用父类的run方法 def Bar(): print '...
main.py
from frameExtractLib import * from frcnn.frcnnLib import * from cnn.cnnLib import * from tracker.hybridTrack2 import * from options import* import cv2 import threading from Queue import Queue import time import numpy as np from optparse import OptionParser import time from progressbar import ProgressBar as pb import o...
manager.py
from dataclasses import dataclass import logging import threading import time import traceback from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Set, Tuple from concurrent.futures.thread import ThreadPoolExecutor from blspy import G1Element from chiapos import DiskProver from ects.conse...
main.py
# -*- coding: utf-8 -*- import config from repositories import harvest_repo from repositories import question_repo from repositories import render_repo from repositories import func_repo import os import sys import ctypes import time import cv2 import numpy as np from threading import Thread from mss import mss from p...
Hiwin_RT605_ArmCommand_Socket_20190627194221.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...
select_ticket_info.py
# -*- coding=utf-8 -*- import datetime import random import os import socket import sys import threading import time import TickerConfig import wrapcache from agency.cdn_utils import CDNProxy from config import urlConf, configCommon from config.TicketEnmu import ticket from config.configCommon import seat_conf_2, seat_...
client.py
import socket import os import threading import random import time PORT = 5050 FORMAT = "utf-8" DISCONNECT_MESSAGE = "!DISCONNECT" # SERVER = input("Please enter server IP: ") SERVER = "10.18.0.2" ADDR = (SERVER, PORT) client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect(ADDR) connected = True ...
ipDiscoverySender.py
#!/usr/bin/env python ################################################################################## #Copyright (c) 2016, Intel 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:...
batcher.py
#Most of this file is copied form https://github.com/abisee/pointer-generator/blob/master/batcher.py import queue import time from random import shuffle from threading import Thread import numpy as np import tensorflow as tf from data_util import config,data import random random.seed(1234) class Example(object):...
__init__.py
import websocket import json import hashlib import random import threading import hmac import logging import base64 from time import sleep from types import SimpleNamespace _LOGGER = logging.getLogger(__name__) class LoadMode(): """Wrapper Class to represent the Load Mode of the Wattpilot""" DEFAULT=3 EC...
magma_crash_recovery.py
''' Created on Dec 12, 2019 @author: riteshagarwal ''' import copy import threading from Cb_constants.CBServer import CbServer from couchbase_helper.documentgenerator import doc_generator import json as Json from magma_base import MagmaBaseTest from remote.remote_util import RemoteMachineShellConnection from sdk_cli...
view_tester.py
# Copyright 2017-2021 TensorHub, 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 writ...
test_tracer.py
""" tests for Tracer and utilities. """ import contextlib import multiprocessing from os import getpid import sys import warnings from unittest.case import SkipTest import mock import pytest import ddtrace from ddtrace.ext import system from ddtrace.context import Context from .base import BaseTracerTestCase from ....
base.py
# -*- coding: utf-8 -*- ''' napalm-logs base ''' from __future__ import absolute_import # Import std lib import os import re import imp import sys import time import yaml import logging import threading from multiprocessing import Process # Import third party libs # crypto import nacl.utils import nacl.secret import ...
test_class_lora.receiver.py
import PyLora import time import requests from Crypto.Cipher import AES import sys import collections import os from threading import Thread, Lock from subprocess import Popen, PIPE from signal import SIGINT, signal class rf_rat(): def __init__ (self, freq, bandwidth, key, iv): PyLora.init() ...
pcrender.py
from __future__ import print_function import numpy as np import ctypes as ct import os import cv2 import sys import torch import argparse import time import gibson.core.render.utils as utils import transforms3d import json import zmq from gibson import assets from torchvision import datasets, transforms from torch.au...
batoonet2.py
from batoosprites import * from batoo import * from pygame import * import batoomaps import socket import threading from random import random, randint import sys, os HOST = '143.248.2.116' PORT = 50000 DATA_SIZE = 128 class Batoo(object): display_size = ( 900, 720 ) size = ( 11, 11 ) scr...
sendmail.py
# -*- coding: UTF-8 -*- import traceback from multiprocessing import Process import email from email import encoders from email.header import Header from email.mime.text import MIMEText from email.utils import parseaddr, formataddr import smtplib from django.conf import settings import logging logger = logging.getLog...
event_engine.py
# encoding: UTF-8 # 系统模块 from Queue import Queue, Empty from threading import Thread from collections import defaultdict # 第三方模块 from PyQt4.QtCore import QTimer from numba import jit # 自己开发的模块 # from eventType import * from algotrade.const import EventType ###########################################################...
session_test.py
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
savenload.py
""" utilities that involve file searching and operations (i.e. save/load) """ from typing import Union, List, Tuple import sys import logging import contextlib import contextvars import tempfile from pathlib import Path import shutil import os # accumulate writes to group for renaming _MOVE_SET = contextvars.ContextV...
test_util.py
# Copyright 2015 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...
heartbeat_client.py
import logging import os import threading import time import requests import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) class HeartbeatClient(object): def __init__(self, stop, ep, cert, key, interval=2): self.ep = ep self.stop_event = stop self.ssl_cert = ...
application.py
# 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 required by applica...
test_basic.py
# -*- coding: utf-8 -*- """ tests.basic ~~~~~~~~~~~~~~~~~~~~~ The basic functionality. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest import re import uuid import time import flask import pickle from datetime import datetime from threading ...
command_output.py
#!/usr/bin/python2.4 # Copyright 2009 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Command output builder for SCons.""" import os import signal import subprocess import sys import threading import time import ...
smiler.py
import os import subprocess import re import shutil import threading import signal import logging import time from smiler.config import config from smiler.granularity import Granularity from smiler.instrumenting import manifest_instrumenter from smiler.libs.libs import Libs from smiler.instrumenting.apkil.smalitree im...
driver_util.py
"""Scripts for drivers of Galaxy functional tests.""" import fcntl import logging import os import random import shutil import signal import socket import string import struct import subprocess import sys import tempfile import threading import time import nose.config import nose.core import nose.loader import nose.p...
test_basic.py
# -*- coding: utf-8 -*- """ tests.basic ~~~~~~~~~~~~~~~~~~~~~ The basic functionality. :copyright: 2010 Pallets :license: BSD-3-Clause """ import re import sys import time import uuid from datetime import datetime from threading import Thread import pytest import werkzeug.serving from werkzeug.ex...
helpers.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @Author: José Sánchez-Gallego (gallegoj@uw.edu) # @Date: 2018-09-14 # @Filename: helpers.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) from __future__ import annotations import asyncio import concurrent.futures import enum import warnin...
multi_encoder.py
from picamera2.encoders.encoder import * import threading import queue from concurrent.futures import ThreadPoolExecutor class MultiEncoder(Encoder): """This is a base class for a multi-threaded software encoder. Derive your encoder from this class and add an encode_func method. For an example, see JpegEncode...
executor_service.py
# Lint as: python3 # Copyright 2019, The TensorFlow Federated 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 ...
main_fd.py
import os import numpy as np import tensorflow as tf import fa_detect.input_data import fa_detect.model from PIL import Image import matplotlib.pyplot as plt from skimage import io import time import fa_detect.get_image.get_faces import fa_detect.perclos_final import threading import fa_detect.get_image.g...
balance_server.py
# Copyright (c) 2020 PaddlePaddle 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 appli...
utils.py
from __future__ import print_function import collections import colorsys import inspect import json import math import os import pickle import platform import signal import numpy as np import pybullet as p import random import sys import time import datetime import shutil import cProfile import pstats from collection...
base.py
# coding: utf-8 from __future__ import annotations import gc from abc import ABCMeta, abstractmethod from collections.abc import Sequence, Iterable from functools import lru_cache, cached_property, wraps from pathlib import Path from more_itertools import flatten from pycld2 import detect as detect_language, error as ...
test_pantsd_integration.py
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import datetime import itertools import os import re import signal import threading import time import unittest from textwrap import dedent import pytest from pants.testutil.pants_run_in...
main.py
"""Real time plotting of Microphone level using kivy """ from kivy.lang import Builder from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.garden.graph import MeshLinePlot from kivy.clock import Clock from threading import Thread import audioop import pyaudio def get_microphone_level(): ""...
rabbitmq_transport.py
# -*- coding: utf-8 -*- from Queue import Queue import pika import ssl from threading import Thread import time from beaver.transports.base_transport import BaseTransport from beaver.transports.exception import TransportException class RabbitmqTransport(BaseTransport): def __init__(self, beaver_config, logger=N...
attach_server.py
# Python Tools for Visual Studio # Copyright(c) Microsoft 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 # # THI...
test_ptds.py
import multiprocessing as mp import logging import traceback from numba.cuda.testing import unittest, CUDATestCase from numba.cuda.testing import (skip_on_cudasim, skip_with_cuda_python, skip_under_cuda_memcheck) def child_test(): from numba import cuda, int32, void from numba....
engine.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright(c) 2015 Nippon Telegraph and Telephone Corporation # # 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/lic...
dask.py
# pylint: disable=too-many-arguments, too-many-locals, no-name-in-module # pylint: disable=missing-class-docstring, invalid-name # pylint: disable=too-many-lines, fixme # pylint: disable=too-few-public-methods # pylint: disable=import-error """ Dask extensions for distributed training ----------------------------------...
processing.py
import os import gc import numpy as np import pandas as pd from operator import attrgetter from multiprocessing import Process, Pool from scipy.ndimage import map_coordinates from scipy.ndimage.filters import median_filter from scipy.ndimage.morphology import binary_dilation, binary_closing, binary_fill_holes, binary_o...
safe_shell_exec.py
# Copyright 2019 Uber Technologies, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
server.py
from __future__ import print_function import sys import threading as th import multiprocessing as mp import logging import logging.handlers from socket import socket, AF_INET, SOCK_DGRAM from select import select if sys.version_info.major >= 3: import queue import pickle else: import Queue as queue im...
thermald.py
#!/usr/bin/env python3 import datetime import os import queue import threading import time from collections import OrderedDict, namedtuple from pathlib import Path from typing import Dict, Optional, Tuple import psutil from smbus2 import SMBus import cereal.messaging as messaging from cereal import log from common.di...
freetests.py
#!/usr/bin/env python3 # coding: utf-8 # Copyright 2013 Abram Hindle # # 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 ...
couponApi.py
# -*- coding:utf-8 -*- ''' Created on 2017. 4. 21. @author: sanghyun ''' from datetime import datetime import json from mhlib import isnumeric import os import sys import threading import time import zipfile from flask import Blueprint, request from flask.globals import session, current_app import xlsxwriter from r...
emails.py
from threading import Thread from flask import url_for, current_app from flask_mail import Message from ablog.extensions import mail def _send_async_mail(app, message): with app.app_context(): mail.send(message) def send_mail(subject, to, html): app = current_app._get_current_object() message ...
pyhtmlgui.py
import logging import os, json, sys import threading import jinja2 import bottle import bottle_websocket import uuid import time import shutil import traceback from gevent import pywsgi from geventwebsocket.handler import WebSocketHandler from geventwebsocket.logging import create_logger from .lib import Browser from ...
example.py
from argparse import ArgumentParser, FileType from json import loads, dumps from tkinter import Menu import threading, time, requests import os from tkgui.utils import startFile, Backend, thunkifySync from tkgui.utils import guiCodegen as c Backend.TTk.use() from tkgui.ui import TkGUI, TkWin, nop, Timeout, callThre...
run_end_to_end_test.py
#!/usr/bin/env python3 # # end to end tests of fetch-ledger # # This is achieved by using available fetch APIs to spin up a network locally # and test it can handle certain conditions (such as single or multiple # node failure) import argparse import codecs import datetime import glob import importlib import os impor...
run_TCP_depth.py
import argparse import logging import time import pyrealsense2 as rs import cv2 import numpy as np from estimator import TfPoseEstimator from networks import get_graph_path, model_wh import common #==================== from socket import socket, AF_INET, SOCK_STREAM import threading import time from tkinter import *...
fridge_bot.py
import logging import threading import telegram from telegram.ext import Updater from FridgeBot.Bot.callbacks import Callbacks from FridgeBot.Bot.globals import BotWrapper from FridgeBot.Bot.task_executor import execute_forever BOT_TOKEN = "1484702411:AAHvOA7AI1_L8ZBHkPLGkfbbpHHeipnVnEw" logging.basicConfig(format=...
tests.py
from __future__ import unicode_literals import time import traceback from datetime import date, datetime, timedelta from threading import Thread from django.core.exceptions import FieldError from django.db import DatabaseError, IntegrityError, connection from django.test import ( SimpleTestCase, TestCase, Transac...
nonpar.py
import argparse import os import time import data_generator from rpy2.robjects.packages import importr import rpy2.robjects as robjects from threading import Thread R = robjects.r import rpy2.robjects.numpy2ri rpy2.robjects.numpy2ri.activate() import numpy as np parser = argparse.ArgumentParser(description='Descrip...
zdata.py
#!/usr/bin/env python3 import sys import ujson as json import json as json_orig import traceback import re import argparse import os.path import operator import requests from threading import Thread from queue import Queue from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib...
mqtt-data-logger.py
#!/usr/bin/env python3 #If Running in Windows use top line and edit according to your python #location and version. If running on Linux delete the top line. ###demo code provided by Steve Cope at www.steves-internet-guide.com ##email steve@steves-internet-guide.com ###Free to use for any purpose """ This will log messa...
client.py
import socket import numpy as np import time from multiprocessing import Process, Queue from threading import Lock from queue import Empty import pyqtgraph as pg from PyQt5.QtWidgets import QApplication, QMainWindow, QGridLayout, QWidget, QLabel from PyQt5.QtCore import QThread, pyqtSignal, QObject from dependencies....
main.py
''' Disclaimer: I normally use "f" tags instead of .format(), but apparently .format() is faster so im using it for this. Also I know some naming conventions are wrong for this, it just looks better w/ this project idk why. P.S: I'm using tuples for the threading as it's not mutable. ''' import os, sys, threading, time...
essentials.py
# -*- coding: utf-8 -*- import asyncio import re import math import random from multiprocessing import Array, Process from chatbot import util, api, bot class Plugin(bot.BotPlugin): def __init__(self, oldme, bot_): super().__init__(oldme, bot_) self.register_command("clear", self._clear, argc=0) ...
yangCatalogApi.py
# Copyright The IETF Trust 2019, All Rights Reserved # Copyright 2018 Cisco and its affiliates # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
server.py
"""RPC server implementation. Note ---- Server is TCP based with the following protocol: - Initial handshake to the peer - [RPC_MAGIC, keysize(int32), key-bytes] - The key is in format - {server|client}:device-type[:random-key] [-timeout=timeout] """ # pylint: disable=invalid-name from __future__ import absolute...
Discord account generator.py
Ir para o conteúdo Pesquise ou pule para ... Solicitação de pull s questões Mercado Explorar @KeyloggerHub AnoitecerGT / Discord-Account-Generator 4 5322 Código questões 10 Solicitações de pull 1 Ações Projetos Wiki Segurança Conhecimentos Discord-Account-Generator/ discordgenerator.py / @notmoaiad notmoaiad Correç...
test_logging.py
from __future__ import division from .common import * import logging import threading import av.logging import av.utils def do_log(message): av.logging.log(av.logging.INFO, 'test', message) class TestLogging(TestCase): def test_adapt_level(self): self.assertEqual( av.logging.adapt_le...
broadcaster.py
import Queue import threading import logging import requests import re import time import datetime import base64 from status import Status class HTTPBasicThenDigestAuth(requests.auth.HTTPDigestAuth): """Try HTTPBasicAuth, then HTTPDigestAuth.""" def __init__(self): super(HTTPBas...
local.py
import os import subprocess import shutil io = __import__("io") import threading try: import pty except ImportError: pty = None from spur.tempdir import create_temporary_dir from spur.files import FileOperations import spur.results from .io import IoHandler from .errors import NoSuchCommandError class Local...
callbacks_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...
tpu_estimator.py
# 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 required by applica...
util.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # 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 the Software without restriction, # including without...
multi_theadedpy.py
import multiprocessing, time, os try: def fun1(): for i in range(1,10): print("Function 1: ",i,end='') time.sleep(1) def fun2(): for i in range(1, 10): print("Function 2: ", i, end='') time.sleep(1) def fun3(): for i in range(1, 10)...
store.py
import threading import time class database: DATA = {} DATABASES = [{} for x in range(16)] TTL = {} LOCK = threading.Lock() CONFIG = {"databases": "16"} @staticmethod def select(db_index): if database.LOCK.acquire(): database.DATA = database.DATABASES[int(db_index)] ...