source
stringlengths
3
86
python
stringlengths
75
1.04M
rdd.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...
network_monitor_4.1beta.py
# -*- coding: utf-8 -*- from PyQt5.QtWidgets import * # PyQt5 from PyQt5.QtCore import QThread, pyqtSignal, Qt # 多线程,以及多线程之间传递信号 from PyQt5.QtChart import QChartView, QChart, QBarSet, QHorizontalBarSeries, QBarCategoryAxis from network_monitor_no_gui import * from ui_Main_Window import * # ui 文件导出的窗体界面 import multi...
defs.py
"""Strong typed schema definition.""" import http.server import json import random import re import socket import socketserver import string from base64 import b64encode from enum import Enum from pathlib import Path from threading import Thread from time import time from typing import Any, Dict, List, Optional, Set, U...
mtsleepC.py
#!/usr/bin/venv python3 import threading from time import sleep, ctime loops = [4, 2] def loop(nloop, nsec): print('start loop', nloop, 'at:', ctime()) sleep(nsec) print('loop', nloop, 'done at:', ctime()) def main(): print('starting at:', ctime()) threads = [] nloops = range(len(loops)) ...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
data_creation_game2.py
#!/usr/bin/env python3 """Main script for gaze direction inference from webcam feed.""" import argparse import os import queue import threading import time import coloredlogs import cv2 as cv import numpy as np import tensorflow as tf import tensorflow.compat.v1 as tf import pyautogui import random tf.disable_v2_behav...
network.py
import Queue from os import system from scapy.all import * from threading import Thread from PyQt5.QtCore import ( QThread, QObject, QProcess, pyqtSlot, pyqtSignal, pyqtSlot, ) from datetime import datetime # This file is part of the wifipumpkin3 Open Source Project. # wifipumpkin3 is licensed ...
helpers.py
""" Helpers and wrappers for common RPyC tasks """ import time import threading from rpyc.lib.colls import WeakValueDict from rpyc.lib.compat import callable from rpyc.core.consts import HANDLE_BUFFITER, HANDLE_CALL from rpyc.core.netref import syncreq, asyncreq def buffiter(obj, chunk = 10, max_chunk = 1000, factor ...
diode_rest.py
#!flask/bin/python import dace import dace.serialize import dace.frontend.octave.parse as octave_frontend import dace.frontend.python.parser as python_frontend from diode.optgraph.DaceState import DaceState from dace.transformation.optimizer import SDFGOptimizer import inspect from flask import Flask, Response, reques...
test_basic_4.py
# coding: utf-8 import logging import sys import time import subprocess import numpy as np import pytest import ray.cluster_utils from ray._private.gcs_pubsub import gcs_pubsub_enabled, GcsFunctionKeySubscriber from ray._private.test_utils import wait_for_condition from ray.autoscaler._private.constants import RAY_PR...
supplemental.py
"""Generates additional figures and videos. Usage: python -m src.analysis.supplemental COMMAND """ import functools import os import shutil from multiprocessing import Process from pathlib import Path import fire import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from loguru import logger...
test_general.py
""" Collection of tests for unified general functions """ # global import os import math import time import einops import pytest import threading import numpy as np from numbers import Number from collections.abc import Sequence import torch.multiprocessing as multiprocessing # local import ivy import ivy.functional....
crawl.py
from talon.voice import Context, Key, Rep, Str, press ctx = Context('crawl', bundle='com.apple.Terminal', func=lambda app, win: 'crawl' in win.title) import time import threading import string from .std import alpha_alt # alpha = {k: k for k in string.lowercase} alpha = {} alpha.update(dict(zip(alpha_alt, string.asci...
test_futures.py
import threading import time import torch from torch.futures import Future from torch.testing._internal.common_utils import TestCase, TemporaryFileName def add_one(fut): return fut.wait() + 1 class TestFuture(TestCase): def test_wait(self): f = Future() f.set_result(torch.ones(2, 2)) ...
test_autograd.py
import gc import sys import io import math import random import tempfile import time import threading import unittest import warnings from copy import deepcopy from collections import OrderedDict from itertools import product, permutations from operator import mul from functools import reduce, partial import torch fro...
login_stimulation_window.py
import time import numpy as np from threading import Thread import os from datetime import datetime from PyQt5 import QtWidgets, uic from PyQt5.QtCore import QTimer from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import QDesktopWidget import nas.src.config as config from nas.src.eeg_recorder import EEGRecorder fro...
test.py
import json import os.path as p import random import socket import threading import time import logging import io import string import avro.schema import avro.io import avro.datafile from confluent_kafka.avro.cached_schema_registry_client import CachedSchemaRegistryClient from confluent_kafka.avro.serializer.message_s...
docserver.py
from __future__ import print_function import flask import os import threading import time import webbrowser from tornado.wsgi import WSGIContainer from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop _basedir = os.path.join("..", os.path.dirname(__file__)) app = flask.Flask(__name__, static_p...
tree-height.py
# python3 import sys, threading sys.setrecursionlimit(10**7) # max depth of recursion threading.stack_size(2**27) # new thread will get stack of such size class TreeHeight: def read(self): self.n = int(sys.stdin.readline()) self.parent = list(map(int, sys.stdin.readline().spli...
tests.py
# -*- coding: utf-8 -*- # Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. from __future__ import unicode_literals import copy import os import re import shutil import tempfile import threading import time import unittest import warnings from django.conf import settings ...
test_browser.py
# coding=utf-8 # Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from __future__ import print_function import argparse ...
service.py
# Copyright (c) 2010-2013 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
nn_test.py
# Copyright 2020 The Flax 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 applicable law or agreed to in wri...
main_helpers.py
# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import print_function import argparse import contextlib import datetime import hashlib import json import logging import logging.handlers im...
udp_receiver.py
import flask import numpy as np import os import requests import sys from cv2 import cv2 as cv from socket import AF_INET, SOCK_DGRAM, INADDR_ANY, IPPROTO_IP, IP_ADD_MEMBERSHIP, SOL_SOCKET, SO_REUSEADDR, socket, inet_aton, error as socket_error import struct from threading import Thread import imagehash from PIL import...
test_functools.py
import abc import builtins import collections import collections.abc import copy from itertools import permutations import pickle from random import choice import sys from test import support import threading import time import typing import unittest import unittest.mock import os import weakref import gc from weakref ...
stick.py
# vim: set et sw=4 sts=4 fileencoding=utf-8: # # Alternative API for the Sense HAT # Copyright (c) 2016-2018 Dave Jones <dave@waveform.org.uk> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of...
helpers.py
"""Supporting functions for polydata and grid objects.""" import collections.abc import enum import logging import os import signal import sys import threading from threading import Thread import traceback from typing import Optional import warnings import numpy as np import pyvista from pyvista import _vtk from pyv...
settings.py
import platform import subprocess import os import sys import locale import time from PySide2 import QtGui import psutil from PySide2.QtGui import * from PySide2.QtCore import * from PySide2.QtWidgets import * import globals from languages import * from tools import * from tools import _ from FramelessWindow impor...
session_test.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...
protractor.py
# -*- coding: utf-8 -*- import os import sys from multiprocessing import Process from optparse import make_option import subprocess from django.core.management import call_command from django.core.management.base import BaseCommand from django.db import connection from django.test.runner import setup_databases cla...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
installwizard.py
# -*- mode: python3 -*- import os import sys import threading import traceback from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from electroncash import Wallet, WalletStorage from electroncash.util import UserCancelled, InvalidPassword, finalization_print_error from electroncash.base...
test_utils_test.py
import asyncio import pathlib import socket import threading from contextlib import contextmanager from time import sleep import pytest from tornado import gen from distributed import Client, Nanny, Scheduler, Worker, config, default_client from distributed.core import rpc from distributed.metrics import time from di...
futuros.py
import time import multiprocessing print("Number of cpu : ", multiprocessing.cpu_count()) from multiprocessing import Process def proceso(fruta): while True: print("hola ", fruta) time.sleep(2) def proceso2(fruta): while True: print("hola ", fruta) time.sleep(1) def main...
linux_adapter.py
import array import fcntl import socket import struct import threading from bleson.core.hci.constants import * from bleson.core.hci.type_converters import AdvertisingDataConverters, parse_hci_event_packet, hex_string from bleson.core.types import Device, BDAddress from bleson.interfaces.adapter import Adapter from ble...
preprocess.py
""" Preprocess image data for Dogs vs. Cats competition https://www.kaggle.com/gauss256 DESCRIPTION Most solutions for this competition will need to deal with the fact that the training and test images are of varying sizes and aspect ratios, and were taken under a variety of lighting conditions. It is typical in case...
main_helpers.py
# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import print_function import argparse import contextlib import datetime import hashlib import json import logging import logging.handlers im...
pjit_test.py
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
word2vec.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Author: Shiva Manne <manneshiva@gmail.com> # Copyright (C) 2018 RaRe Technologies s.r.o. # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """This module implements the word2vec family of algorithms, using highly optimized C routines, data stre...
camera.py
#!/usr/bin/env python3 #!/usr/bin/python3.8 # OpenCV 4.2, Raspberry pi 3/3b/4b - test on macOS import cv2 from threading import Thread, Lock import time #internal from app.camera.frame import Frame from app.utils.settings import get_config from app.dto.record import FrameDTO, ConfigDTO from app.camera.process_frame imp...
locked_ops_threads.py
import time import threading class SomeClass(object): def __init__(self,c): self.c=c self.lock = threading.Lock() def inc(self): self.lock.acquire() try: new = self.c+1 # if the thread is interrupted by another inc() call its result is wrong ...
lazy.py
import copy import functools import importlib import importlib.machinery import importlib.util import inspect import logging import os import pathlib import re import sys import tempfile import threading import time import traceback import types from collections.abc import MutableMapping from zipimport import zipimport...
worker.py
#!/usr/bin/env python3 # Copyright 2004-present Facebook. All Rights Reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. """Consumption side of render message queue. Provides the interface for performing computations based on mes...
arpoisoner.py
#!/usr/bin/env python2.7 # coding=UTF-8 # Copyright (c) 2016-2018 Angelo Moura # # This file is part of the program pythem # # pythem is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # ...
converter.py
#!/usr/bin/env python3.7 import argparse from collections import defaultdict from dataclasses import dataclass from enum import Enum, auto from functools import total_ordering from glob import glob import math import os from os.path import splitext as splitx import re import shutil import sys import threading import ti...
main.py
import importlib import os from functools import partial from multiprocessing import Process, Queue from flask import Flask, request app = Flask("serverfull") workers = {} def load_bees_module_names(): exclude = set(["__pycache__"]) bee_modules = filter( os.path.isdir, [ os.path.join("./...
txt_ext.py
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.converter import HTMLConverter from pdfminer.layout import LAParams from pdfminer.pdfpage import PDFPage from io import BytesIO def countRotated(text): """Counts the number of ocurrences of '\w\n' in text. Args: text...
data.py
import cv2 import glob import os import multiprocessing import time import numpy as np from utils.generate_priors import generate_priors from utils.assign_boxes import assign_boxes from utils.augment import augment class Data: def __init__(self, image_dir, label_dir, num_classes, input_size, shapes, assignment_th...
test_queue.py
# coding=utf-8 import os import pickle import random import shutil import sys import tempfile import unittest from collections import namedtuple from nose2.tools import params from threading import Thread import persistqueue.serializers.json import persistqueue.serializers.msgpack import persistqueue.serializers.pick...
NetCam.py
################################################################################ ## Classe NetCam ## Gere un flux camera caméra à travers un réseau ## Author : J. Coupez ## Date : 10/10/2020 ## Version : 0.1 ################################################################################ import time f...
api.py
from __future__ import print_function import hug from hug_middleware_cors import CORSMiddleware import waitress from threading import Thread import json from dragonfire.omniscient import Engine from dragonfire.conversational import DeepConversation from dragonfire.learn import Learner from dragonfire.config import Conf...
Main.py
__author__ = '01' __author__ += "Binary" __author__ += "ZeroOne" __author__ += "Hooman" from scapy.layers.inet import * from scapy.all import * import threading import time import sys import os conf.route.resync() conf.verb = 0 def PacketAnalyze(Pck) : if((Pck.haslayer(IP)) and ((Pck.getlayer(IP).src == Target1...
test_impl_rabbit.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 agre...
transports.py
from ...typecheck import * from ...import core from ...dap import Transport import socket import os import subprocess import threading class Process: @staticmethod async def check_output(command: List[str], cwd: Optional[str] = None) -> bytes: return await core.run_in_executor(lambda: subprocess.check_output(comm...
server.py
from VEEParser import read_string, send_record from VEEParser import send_string, PYTHON_TO_VEE_TYPES, read_script, R_TO_PYTHON_TYPES import socket import argparse import subprocess import threading import os import uuid from bridgescripts import BRIDGE_SCRIPTS import tempfile from client import Client PROTOCOLS = set(...
test_local.py
import asyncio import copy import math import operator import sys import time from functools import partial from threading import Thread import pytest from werkzeug import local def test_basic_local(): ns = local.Local() ns.foo = 0 values = [] def value_setter(idx): time.sleep(0.01 * idx) ...
main.py
# TODO: check this solution! from threading import Semaphore, Thread, Lock from collections import deque io = Lock() hey_barber = Semaphore(0) room = Semaphore(1) standing = deque() sitting = deque() serviced = 0 cashdesk = Semaphore(1) paying = 0 satisfied = Semaphore(0) done = Semaphore(0) ...
test_multiprocessing.py
import pytest import multiprocessing import contextlib import redis from redis.connection import Connection, ConnectionPool from redis.exceptions import ConnectionError from .conftest import _get_client @contextlib.contextmanager def exit_callback(callback, *args): try: yield finally: callba...
hdfsoverssh.py
""" WebHDFS based LVFS Adapter ========================== This module is extremely flexible and supports many modes of operation but configuring it properly can be challenging. Most of the time you will only need a few common configurations. Refer to the project homepage for examples. Your company may also have recomm...
test_urllib.py
"""Regression tests for what was in Python 2's "urllib" module""" import urllib.parse import urllib.request import urllib.error import http.client import email.message import io import unittest from unittest.mock import patch from test import support import os try: import ssl except ImportError: ssl = None imp...
ARPPoison.py
from scapy.all import * import os import sys import threading import signal interface = "en1" target_ip = "" gateway_ip = "" packet_count = 1000 conf.iface = interface conf.verb = 0 print "[*] Setting up %s " % interface gateway_mac = get_mac(gateway_ip) if gateway_mac is None: print "Failed to get gateway MA...
timeserver.py
import socket import threading import argparse import time def run_server(host, port): listener = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) listener.bind((host, port)) listener.listen(5) print('Time ser...
image.py
import datetime import docker import hashlib import json import logging import os import re import shutil import six import tarfile import tempfile import threading from docker_squash.errors import SquashError, SquashUnnecessaryError if not six.PY3: import docker_squash.lib.xtarfile class Chdir(object): "...
batteries.py
import threading import weakref import time import socket import os import collections import heapq from .syncobj import SyncObjConsumer, replicated class ReplCounter(SyncObjConsumer): def __init__(self): """ Simple distributed counter. You can set, add, sub and inc counter value. """ ...
chat.py
#!/usr/bin/python """ __version__ = "$Revision: 1.6 $" __date__ = "$Date: 2004/05/05 16:53:25 $" """ from PythonCard import model import threading import Queue import wx # EchoServer derived # from echo server example in Programming Python by Mark Lutz # get socket constructor and constants import socket # server ...
cli_tests.py
#!/usr/bin/env python # coding: utf-8 import os import sys import time import httplib import unittest import threading sys.path.append('.') import marionette_tg.conf def execute(cmd): os.system(cmd) def exec_download(): client_listen_ip = marionette_tg.conf.get("client.client_ip") conn = httplib.HTTP...
hikvision.py
""" pyhik.hikvision ~~~~~~~~~~~~~~~~~~~~ Provides api for Hikvision events Copyright (c) 2016-2020 John Mihalic <https://github.com/mezz64> Licensed under the MIT license. Based on the following api documentation: System: http://oversea-download.hikvision.com/uploadfile/Leaflet/ISAPI/HIKVISION%20ISAPI_2.0-IPMD%20Servi...
gap.py
# -*- coding: utf-8 -*- r""" Interface to GAP Sage provides an interface to the GAP system. This system provides extensive group theory, combinatorics, etc. The GAP interface will only work if GAP is installed on your computer; this should be the case, since GAP is included with Sage. The interface offers three piece...
remote.py
# # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # import copy import time import torch import torch.multiprocessing as mp from salina import Agent from salina.workspace import Workspace,...
archive.py
from . import patients def archive_cli(args): if args.by_patient: return patients.archive_by_patient_cli(args) raise ValueError("No archive type chosen") # import lzma # import multiprocessing # import pathlib # import shutil # import socket # from datetime import datetime # MINUTES_OF_DATA = 5 #...
commands.py
""" Some console-friendly methods are exposed in pkg.*, and defined at pkg.commands. """ import re import threading from .config import g from .package import LocalPackage from .repo import Repository from .vendor import semantic_version __all__ = ['install', 'remove', 'local', 'remote', 'refresh', 'upgrade'] def _...
Binance Detect Moonings.py
""" Disclaimer All investment strategies and investments involve risk of loss. Nothing contained in this program, scripts, code or repositoy should be construed as investment advice.Any reference to an investment's past or potential performance is not, and should not be construed as, a recommendation or as a guarantee...
node.py
# Copyright (c) OpenMMLab. All rights reserved. import logging import time from abc import ABCMeta, abstractmethod from dataclasses import dataclass from queue import Empty from threading import Thread from typing import Callable, Dict, List, Optional, Tuple, Union from mmcv.utils.misc import is_method_overridden fro...
twincatscannergui.py
import tkinter as tk from tkinter import ttk from tkinter import filedialog from tkinter import messagebox import threading import twincatscanner class Application(tk.Frame): def __init__(self, master=None): super().__init__(master) self.grid(row=0, column=0, sticky=tk.NSEW) self.columnc...
test_system.py
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import super from builtins import range from builtins import zip from builtins import map from builtins import str from builtins import dict from builtins im...
multiprocessing3_queue.py
# View more 3_python 1_tensorflow_new tutorial on my Youtube and Youku channel!!! # Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg # Youku video tutorial: http://i.youku.com/pythontutorial import multiprocessing as mp def job(q): res = 0 for i in range(1000): res += ...
uart_provider.py
import os import time import json import datetime import threading import math import re import serial import serial.tools.list_ports from .ntrip_client import NTRIPClient from ...framework.utils import ( helper, resource ) from ...framework.context import APP_CONTEXT from ..base.uart_base import OpenDeviceBase fro...
util.py
# -*- coding: utf-8 -*- import random import re import string import threading import traceback import warnings import functools import queue as Queue import logging try: from PIL import Image from io import BytesIO pil_imported = True except: pil_imported = False logger = logging.getLogger('TeleBot'...
experiments_mp.py
# -*- coding: utf-8 -*- """ This module was created for testing initial benchmarks of the various clustering approaches. """ import numpy as np import os from sklearn import metrics from time import time from dkmeans.data import get_dataset from dkmeans.data import DEFAULT_DATASET, DEFAULT_THETA, DEFAULT_WINDOW fr...
_instanceinfo.py
# -*- coding: utf-8 -*- """ INSTANCE INFO: ----------------- This module is a copy of the code created by TheoRet at StackOverflow TheoRet profile: https://stackoverflow.com/users/7386061/theoret Link to the question/answer: https://stackoverflow.com/questions/1690400/getting-...
regen.py
#!/usr/bin/env python3 import os import time import multiprocessing from tqdm import tqdm import argparse # run DM procs os.environ["USE_WEBCAM"] = "1" import cereal.messaging as messaging from cereal.services import service_list from cereal.visionipc.visionipc_pyx import VisionIpcServer, VisionStreamType # pylint: d...
eegInterface.py
# eegInterface.py # # Creates a keyboard made of flashing checkerboxes which can # selected by the user looking and concentrating on an individual box # A baseline is recorded for first 30s. The EEG data is compared against # the baseline data to determine if user if looking at a certain box # Author: Ronan Byrne # La...
RegionHost.py
''' Created on Jan 24, 2013 @author: mdickson ''' import sys import errno import time import os.path import threading import shlex import subprocess import psutil import Queue import inworldz.util.provision as provision import inworldz.util.properties as DefaultProperties from inworldz.util.filesystem import Connec...
_mouse_tests.py
# -*- coding: utf-8 -*- import unittest import time from ._mouse_event import MoveEvent, ButtonEvent, WheelEvent, LEFT, RIGHT, MIDDLE, X, X2, UP, DOWN, DOUBLE import mouse class FakeOsMouse(object): def __init__(self): self.append = None self.position = (0, 0) self.queue = None sel...
wallet.py
# Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights t...
multip.py
from multiprocessing import Process, Value import os def info(title): print(title) print('module name:', __name__) print('parent process:', os.getppid()) print('process id:', os.getpid()) def f(name): info('function f') print('hello', name) if __name__ == '__main__': info('main line') ...
server.py
import numpy import os import json from flask import * from threading import Thread import requests import pymongo from werkzeug.utils import secure_filename api = Flask(__name__) # this array includes the device name and the command code of the command to be executed cmdArray = {'deviceName': '', 'comman...
lisp.py
# ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # 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...
lishogibot.py
import argparse import shogi import engine_wrapper import model import json import lishogi import logging import multiprocessing from multiprocessing import Process import traceback import logging_pool import signal import sys import time import backoff import threading from config import load_config from conversation ...
common.py
# -*- coding: utf-8 -*- import json, subprocess, threading, sys, platform, os PY3 = sys.version_info[0] == 3 JsonLoads = PY3 and json.loads or (lambda s: encJson(json.loads(s))) JsonDumps = json.dumps def STR2BYTES(s): return s.encode('utf8') if PY3 else s def BYTES2STR(b): return b.decode('utf8') if PY3 e...
utils_test.py
from __future__ import print_function, division, absolute_import from contextlib import contextmanager from glob import glob import logging from multiprocessing import Process, Queue import os import shutil import signal import socket from subprocess import Popen, PIPE import sys from time import time, sleep import uu...
ColorPalletizing.py
#!/usr/bin/python3 # coding=utf8 import sys sys.path.append('/home/pi/ArmPi/') import cv2 import time import Camera import threading from LABConfig import * from ArmIK.Transform import * from ArmIK.ArmMoveIK import * import HiwonderSDK.Board as Board from CameraCalibration.CalibrationConfig import * if sys.version_inf...
tests.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...
manager.py
import logging from multiprocessing import Value, Process, Manager import pantilthat_waveshare as pth import signal import sys from rpi_deep_pantilt.detect.camera import run_pantilt_detect from rpi_deep_pantilt.control.pid import PIDController logging.basicConfig() LOGLEVEL = logging.getLogger().getEffectiveLevel() ...
demo.py
# -*- coding: utf-8 -*- """ @date: 2020/10/30 下午3:42 @file: visualization.py @author: zj @description: """ import numpy as np import torch import torch.multiprocessing as mp import time from tsn.util.parser import load_test_config, parse_test_args from demo.multiprocess.stop_token import _StopToken from demo.multip...
test.py
import unittest import random import weakref import gc import time from itertools import chain from threading import Thread from threading import Lock from memoization import cached, CachingAlgorithmFlag from memoization.caching.general.keys import make_key exec_times = {} # executed time of each te...
ircthread.py
#!/usr/bin/env python # Copyright(C) 2011-2016 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, m...
_wdapy.py
# coding: utf-8 import atexit import base64 import io import json import logging import subprocess import sys import threading import time import typing import requests from cached_property import cached_property from logzero import setup_logger from PIL import Image from ._alert import Alert from ._base import Base...
__init__.py
from flask import Flask import asyncio import websockets import threading from lib.functions import get_ip_address import time UPLOAD_FOLDER = 'Songs/' webinterface = Flask(__name__, template_folder='templates') webinterface.config['TEMPLATES_AUTO_RELOAD'] = True webinterface.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER ...