source
stringlengths
3
86
python
stringlengths
75
1.04M
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...
threadHelper.py
from threading import Thread def create_thread(target): thread = Thread(target=target) thread.daemon = True thread.start() return thread
job.py
import logging import time import datetime import weakref from numbers import Number from threading import Thread, Lock, Event from queue import PriorityQueue, Empty class Days(object): MON, TUE, WED, THU, FRI, SAT, SUN = range(7) EVERY_DAY = tuple(range(7)) class JobQueue(object): """This class allows ...
gui.py
import threading import traceback import os import sys import webbrowser import pathlib # import matplotlib from matplotlib import pyplot as plt import tkinter as tk from tkinter import ttk from tkinter.constants import BOTH, YES, NO, DISABLED # from tkinter.scrolledtext import ScrolledText from tkinter import message...
main.pyw
#!/usr/bin/env python3 try: import os import threading import pygame from random import choice from string import ascii_letters, digits from numpy import ceil from pygame.locals import * from scripts.song import SongParser from scripts.audio import SoundData from scrip...
tasks.py
import asyncio import logging from threading import Thread from datetime import datetime, timedelta, timezone from tabulate import tabulate from .models import Event, EventState logger = logging.getLogger(__name__) def _post_request(probe, event): try: logger.debug(f"Posting event {event}") pro...
keep_alive.py
from flask import Flask, jsonify, request from threading import Thread import os app = Flask('') @app.route("/") def home(): return jsonify({"status":True}) """ WIP: LOADING CODE FROM GITHUB @app.route("/update", methods=["POST"]) def update(): if request.json """ def run(): app.run(host='0.0.0.0',port=8080) d...
collection.py
# Copyright 2009-present MongoDB, 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 t...
thredGtprocess.py
# -*-coding:utf8_*- from multiprocessing import Process from threading import Thread import time def work(): # time.sleep(2) print('hello') if __name__ == '__main__': t = Thread(target=work) # t = Process(target=work) #子进程会先打印主 t.start() print('主')
installwizard.py
# Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import os import json import sys import threading import traceback from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH...
unpassfile.py
# -*- coding:utf-8 -*- import zipfile import os import shutil from threading import Thread def password(passpath,filename): """ passpath: 密码txt存放路径. filename: 密码txt文件的文件名称. 生成10位数字密码 """ try: with open(passpath + "\\" + filename,"w+",encoding="utf-8") as f: for i in range...
scheduler.py
from Scheduler.task import Task from threading import Thread class Scheduler(object): def __init__(self, task, startTime, skipWeekend): """初始化""" self.task = task self.start_time = startTime self.skip_weekend = skipWeekend self.task_list = [] self.plan() def pl...
test_logging.py
# Copyright 2001-2021 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...
main.py
# -*- coding:utf-8 -*- # 引用自定义库 from qq_bot import * from static_data import * # 引用第三方库 from threading import Thread from os.path import exists from os import makedirs from shutil import rmtree from base64 import b64decode import time # 初始化所需文件夹 def init_folders(): for dir in ['data']: if(not (exists(d...
busy.py
import hid from functools import reduce from time import sleep import random import threading import queue from applescript import AppleScript, ScriptError import Quartz h = hid.device() h.open(10171, 15306) def write(r, g, b, s=128): buffer = [0,16,0,0,0,0,0,0,128] + [0] * 50 + [255, 255, 255, 255, 6, 147] b...
localhost.py
import atexit import os import sys import uuid import pkgutil import logging from multiprocessing import Process, Queue from threading import Thread from lithops.version import __version__ from lithops.utils import version_str, is_unix_system from lithops.worker import function_handler from lithops.config import STORAG...
mark_read.py
#!/usr/bin/env python3 #-*- encoding: utf-8 -*- # please install pytg and telegram-cli before running this script # pytg: https://github.com/luckydonald/pytg # telegram-cli: https://github.com/vysheng/tg import threading from pytg.sender import Sender threading.stack_size(65536) def mark_read(print_name, sender): ...
_test_multiprocessing.py
# # Unit tests for the multiprocessing package # import unittest import queue as pyqueue import time import io import itertools import sys import os import gc import errno import signal import array import socket import random import logging import struct import operator import test.support import test.support.script_...
planar_hand_worker_second_order_position.py
import multiprocessing import time from quasistatic_simulator.core.quasistatic_simulator import ( QuasistaticSimParameters) from quasistatic_simulator.core.quasistatic_system import ( cpp_params_from_py_params) try: from irs_lqr.quasistatic_dynamics import * from irs_lqr.mbp_dynamics_position import *...
async.py
import sys, traceback, threading, functools, types, weakref, collections class AsyncCallThreadPool(object): def __init__(self, max_threads): self.max_threads = max_threads self.num_waiting = 0 self.threads = set() self.calls = collections.deque() self.quit = False se...
bot.py
from concurrent.futures.thread import ThreadPoolExecutor import importlib import json import logging import pkgutil import random import re import sys from threading import Thread import time import traceback from django.apps import apps from django.conf import settings from django.core.exceptions import ImproperlyCon...
settings_20210906112955.py
""" Django settings for First_Wish project. Generated by 'django-admin startproject' using Django 3.2. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from pathli...
server.py
import ast import os import sys import socket import logging import traceback import atexit from io import StringIO import threading from threading import Thread import psutil from msgpack import Packer, Unpacker from .helper import BackdoorRequest, BackdoorResponse, get_socket_path LOG = logging.getLogger(__name__...
telemetry_server.py
# # Copyright 2019 Games Creators Club # # MIT License # from telemetry import * import functools import os import threading import traceback import uuid DEBUG = False class TelemetryServer: def __init__(self): self.streams = {} self.stream_ids = {} self.next_stream_id = 0 def regi...
runner.py
"""Run the driver program multiple times and aggregate the results.""" __all__ = [ 'Runner', ] import pickle import os from multiprocessing import Process import numpy as np from frexp.util import on_battery_power from frexp.workflow import Task class Runner(Task): """Test runne...
test_resumable.py
import pytest # type: ignore import errno import os import random from threading import Thread from http.server import HTTPServer, SimpleHTTPRequestHandler # type: ignore from tempfile import NamedTemporaryFile from unittest.mock import patch # type: ignore from functools import partial # type: ignore from typing impo...
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...
cluster_log_manager.py
import multiprocessing import typing from types import TracebackType from determined_deploy.local import cluster_utils class ClusterLogManager: def __init__(self, cluster_name: str) -> None: self._logs_process: typing.Optional[multiprocessing.Process] = None self.cluster_name = cluster_name ...
__init__.py
# vim: sw=4:ts=4:et # # remediation routines import datetime import importlib import json import logging import os, os.path import queue import queue import re import smtplib import threading import time import uuid from configparser import ConfigParser import saq from saq.database import Alert, get_db_connection, ...
__init__.py
import re import os import cmd import json import time import base64 import pathlib import threading from typing import List, Tuple from config import Config from docsReader import DocsReader from system import System from N4Tools.terminal import terminal from N4Tools.Design import Color from rich import print from ...
site_tests.py
"""Tests for the site module.""" # # (C) Pywikibot team, 2008-2021 # # Distributed under the terms of the MIT license. # import pickle import random import threading import time import unittest from collections.abc import Iterable, Mapping from contextlib import suppress import pywikibot from pywikibot.comms import ...
benchmark.py
import sys import requests import argparse from multiprocessing import Process from datetime import datetime from wsgiref.simple_server import make_server from cachecontrol import CacheControl HOST = "localhost" PORT = 8050 URL = "http://{}:{}/".format(HOST, PORT) class Server(object): def __call__(self, env, ...
coverage_test.py
#!/usr/bin/env python2 #*************************************************************************** # # Copyright (c) 2015-2016 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are m...
multi_manager_debug.py
import argparse import copy import random import json import numpy as np import json import time from onmt.Utils import use_gpu import logging from cocoa.core.util import read_json from cocoa.core.schema import Schema from cocoa.core.scenario_db import ScenarioDB from cocoa.neural.loss import ReinforceLossCompute im...
trasjReporter.py
''' Created on 28 de feb. de 2018 @author: desweb ''' # 1.system libraries import os, sys # 2.second part libraries from flask import Flask,render_template, flash, request, url_for, redirect, session from wtforms import Form, validators, StringField, PasswordField,SelectField as sf from wtforms.validators import Data...
test_service.py
from unittest import TestCase import threading import os import shutil import json import time import requests import random from mock import Mock from samcli.local.apigw.service import Route, Service from tests.functional.function_code import nodejs_lambda, API_GATEWAY_ECHO_EVENT, API_GATEWAY_BAD_PROXY_RESPONSE, API...
kernel.py
from __future__ import print_function from ipykernel.kernelbase import Kernel from subprocess import check_output import pkg_resources import atexit import os import io import re import yaml import threading from subprocess import Popen, STDOUT, PIPE import logging import json import traceback import tempfile import ...
installwizard.py
from functools import partial import threading from kivy.app import App from kivy.clock import Clock from kivy.lang import Builder from kivy.properties import ObjectProperty, StringProperty, OptionProperty from kivy.core.window import Window from kivy.uix.button import Button from kivy.utils import platform from kivy...
test_batch.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import datetime import os import pytest import shutil import sys import time from threading import Thread # Add sources to path PATH = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, PATH + '/../') from cucco.batch impor...
function.py
import time from lib.core.evaluate import ConfusionMatrix,SegmentationMetric from lib.core.general import non_max_suppression,check_img_size,scale_coords,xyxy2xywh,xywh2xyxy,box_iou,coco80_to_coco91_class,plot_images,ap_per_class,output_to_target from lib.utils.utils import time_synchronized from lib.utils import plot_...
exchange_rate.py
from datetime import datetime import inspect import requests import sys import os import json from threading import Thread import time import csv import decimal from decimal import Decimal from .bitcoin import COIN from .i18n import _ from .util import PrintError, ThreadJob # See https://en.wikipedia.org/wiki/ISO_42...
kb_genomeanalyzerServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
util.py
import json import os import threading import socket import time from boltons import socketutils class DronologyMessage(object): def __init__(self, m_type, uav_id, data): self.m_type = m_type self.uav_id = uav_id self.data = data def __str__(self): return json.dumps({'type': s...
simulator.py
import logging import threading from collections import Collection from copy import copy from time import sleep from multipledispatch import dispatch from bn.values.value import Value from bn.values.value_factory import ValueFactory from datastructs.assignment import Assignment from dialogue_state import DialogueStat...
pump.py
#!/usr/bin/env python3 import os import base64 import copy import http.client import logging import re import queue import json import sys import threading import time import urllib.request import urllib.parse import urllib.error import zlib import socket import ssl from typing import List, Dict, Optional, Any, Tuple,...
process.py
import data as d from multiprocessing import Process d.init() def foo(): d.add_num(132) p =Process(target=foo) print("starting process") p.start() d.out() print('joining') p.join() d.out() print('done')
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_dataset, check...
updater.py
import os import sys from threading import Thread, currentThread import json from kafka import KafkaConsumer import django def consumer(canonical_source): from Sync.models import CanonicalUpdate, ENUM_UpdateStatus consumer = KafkaConsumer(canonical_source.name, bootstrap_serv...
main.py
import atexit import os import re import sys import threading import time import traceback import yaml import requests import datetime @atexit.register def _end(): end_time = time.time() print(to_log("INFO", "执行结束", "执行耗时{:.3f}s".format(end_time - start_time))) def get_shopid(): """ 获取 shopid, 如果网...
telemetry.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
test_urllib.py
"""Regresssion tests for urllib""" from __future__ import absolute_import, division, unicode_literals import io import os import sys import tempfile from nturl2path import url2pathname, pathname2url from base64 import b64encode import collections from future.builtins import bytes, chr, hex, open, range, str, int from...
race.py
import os import time from threading import Thread from random import randrange import sys rows, columns = os.popen('stty size', 'r').read().split() columns = int(columns) + 1 rows = int(rows) def print_on(data, x, y): cut_size = columns - (x + len(data)) print ("\033[%(y)s;%(x)sH" % { "x": x, "y": y }) + data...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
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. import argparse import json import multiprocessing imp...
pabot.py
#!/usr/bin/env python # Copyright 2014->future! Mikko Korpela # # 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 ...
refactor.py
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Refactoring framework. Used as a main program, this can refactor any number of files and/or recursively descend down directories. Imported as a module, this provides infrastructure to write your own refactoring too...
test_serialization.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...
tests.py
""" Tests for the file storage mechanism >>> import tempfile >>> from django.core.files.storage import FileSystemStorage >>> from django.core.files.base import ContentFile # Set up a unique temporary directory >>> import os >>> temp_dir = tempfile.mktemp() >>> os.makedirs(temp_dir) >>> temp_storage = FileSystemStora...
generate_breakpad_symbols.py
#!/usr/bin/env python # Copyright 2013 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. """A tool to generate symbols for a binary suitable for breakpad. Currently, the tool only supports Linux, Android, and Mac. Support f...
EWSO365.py
import random import string from typing import Dict import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * import sys import traceback import json import os import hashlib from datetime import timedelta from io import StringIO import logging import warnings import email fr...
telemetry_upload.py
import datetime import os import threading import zlib from contextlib import contextmanager from .telemetry import MAX_BYTES, get_dir_from_dagster_home DAGSTER_TELEMETRY_URL = "http://telemetry.dagster.io/actions" def is_running_in_test(): return ( os.getenv("BUILDKITE") is not None or os.geten...
logging_test.py
# Copyright 2017 The Abseil 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 ...
core.py
# -*- coding: utf-8 -*- # # 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, software ...
mqttserver.py
import threading import paho.mqtt.client as mqtt class MQTTServer(object): """ MQTT server to register and unregister adjacent fog nodes. The webserver runs in a separate thread and will not block the main thread. """ def __init__(self, logger, nodes_repository, host='127.0.0.1', port=1883, user...
text_to_speech.py
from gtts import gTTS from os import listdir from threading import Thread from playsound import playsound __author__ = "Nadav Shani" language = 'en' # language to speak sound_files = listdir("textToSpeechFolder") # folder with the existing files ###################################### # does: speak sen...
utils.py
import errno import logging import os import tempfile import uuid from abc import ABC, abstractmethod from typing import Optional from toil.lib.threading import ExceptionalThread log = logging.getLogger(__name__) class WritablePipe(ABC): """ An object-oriented wrapper for os.pipe. Clients should subclass it,...
mux_writer.py
import threading from queue import Queue from threading import Thread from typing import Any, Callable, List, Optional, Sequence, Tuple import rx import rx.operators as ops from colliflow.tensors import Tensor from .mux_packet import MuxPacket from .tensor_packet import TensorPacket class MuxWriter: """Mixes m...
manualtab.py
# Released under the MIT License. See LICENSE for details. # """Defines the manual tab in the gather UI.""" from __future__ import annotations import threading from typing import TYPE_CHECKING, cast from enum import Enum from dataclasses import dataclass from bastd.ui.gather import GatherTab import _ba import ba i...
abbyjergerContigFilterServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
multithread_cupy.py
from threading import Thread, Barrier import time import argparse import numpy as np #from cuda_wrapper.core import * import cupy as cp from test import * parser = argparse.ArgumentParser(description='Kokkos reduction') parser.add_argument('-m', metavar='m', type=int, help='Number of GPUs') parser...
py2so.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Compile python file to linux so file. """ import copy import multiprocessing import os import shutil import subprocess import sys RAW_SETUP = """#!/usr/bin/python # -*- coding: utf-8 -*- from distutils.core import setup from Cython.Build import cythonize setup( ...
utils.py
import Queue import curses import logging import subprocess import textwrap import threading import traceback from curses import ascii logger = logging.getLogger('assertEquals.interactive.utils') class Bucket: """ """ class RefreshError(StandardError): """An error refreshing the summary. """ de...
2.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, wikipedia, tempfile from bs4 import BeautifulSoup from urllib import urlopen fr...
main.py
# Asset Monitoring Dashboard 1.1 # Cisco Meraki IoT + Cisco Industrial Asset Vision # MIT License, flopach / Cisco Systems 2021 import iav_to_influx import meraki_to_influx import config import time from threading import Thread if __name__ == "__main__": print("Starting py_connector") time.sleep(60) #wait for...
bridge.py
#!/usr/bin/env python3 import argparse import atexit import carla # pylint: disable=import-error import math import numpy as np import time import threading from cereal import log from typing import Any import cereal.messaging as messaging from common.params import Params from common.realtime import Ratekeeper, DT_DMO...
mesh_pool.py
import torch import torch.nn as nn from threading import Thread from models.layers.mesh_union import MeshUnion import numpy as np np.warnings.filterwarnings('ignore', category=np.VisibleDeprecationWarning) from heapq import heappop, heapify class MeshPool(nn.Module): def __init__(self, target, multi_thread=F...
main3.py
import cv2 import sys from mail import sendEmail from flask import Flask, render_template, Response from camera import VideoCamera from flask_basicauth import BasicAuth import time import threading import RPi.GPIO as GPIO import datetime email_update_interval = 10 video_camera = VideoCamera(flip=True) object_classifie...
mbus_snoop_yejoong.py
#!/usr/bin/python import sys import logging import time import threading from m3_common import m3_common #m3_common.configure_root_logger() #logger = logging.getLogger(__name__) from m3_logging import get_logger logger = get_logger(__name__) class mbus_message_generator(m3_common): TITLE = "MBus Message Gener...
record.py
# Copyright 2016 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...
train.py
#! /usr/bin/env python import unittest import gym import sys import os import numpy as np import tensorflow as tf import itertools import shutil import threading import multiprocessing from inspect import getsourcefile current_path = os.path.dirname(os.path.abspath(getsourcefile(lambda: 0))) import_path = os.path.abs...
bird.py
#! /usr/bin/env python3 import os import sys import threading import requests import json import re import traceback from copy import deepcopy from time import sleep from PayloadSource import PayloadSource, PayloadFactory, PayloadServer from typing import List, Tuple from argparse import ArgumentParser VERSION = "0.1....
OUTPUT_BASIC.py
# -*- coding: utf-8 -*- # Author: Cyrill Lippuner # Date: October 2018 """ Driver file for the BASIC OUTPUT. Set the value of a output pin for integrating into the SoftWEAR package. """ import Adafruit_BBIO.GPIO as GPIO import threading # Threading class for the threads im...
subprocess_.py
import subprocess import os import sys import traceback from multiprocessing import Pool, Value import time from termcolor import cprint from threading import Thread from queue import Queue, Empty from msbase.logging import logger def timed(func): def function_wrapper(*args, **kwargs): now = time.time() ...
pb_gateway.py
# 恒投交易客户端 文件接口 # 1. 支持csv/dbf文件的读写 # 2. 采用tdx作为行情数据源 # 华富资产 李来佳 28888502 import os import sys import copy import csv import dbf import traceback import pandas as pd from typing import Any, Dict, List from datetime import datetime, timedelta from time import sleep from functools import lru_cache from collections import...
RASPBERRYPINODE.py
#This code runs on raspberry Pi, collects data from SensorTag and forwards to middle man import socket import threading import time import sys import serial ser = serial.Serial( port='/dev/ttyACM0', baudrate = 115200, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS, timeout=1 ) count...
kindlehelper.py
from bs4 import BeautifulSoup as soup from Autopush import autopush from Config import config from Functions import parsetool import requests import os, stat, glob import threading from progressbar import * from urllib.request import quote import requests # ParseSite = 'http://www.biquyun.com/' ParseSite = '' hea...
server.py
#!/usr/bin/env python import json import os try: from http.server import HTTPServer from http.server import SimpleHTTPRequestHandler except ImportError: from BaseHTTPServer import HTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler from threading import Thread try: from urllib.parse...
TelloClient_v1.py
import socket import threading import time from stats import Stats class Tello: def __init__(self): self.local_ip = '' self.local_port = 8889 self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # socket for sending cmd self.socket.bind((self.local_ip, self.local_port)) ...
remote.py
from __future__ import absolute_import __author__ = 'breddels' import numpy as np import logging import threading import uuid import time import ast from .dataframe import DataFrame, default_shape from .utils import _issequence from .tasks import Task from .legacy import Subspace import vaex.promise import vaex.setting...
camera.py
#MIT License #Copyright (c) 2017 Tim Wentzlau # 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, modify, merge, publ...
Visualization.py
import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib.animation import FuncAnimation import matplotlib as mpl from matplotlib.gridspec import GridSpec from constants import * from initial import * import physics as p from physics import Etot, predicted_orbit import multiprocessin...
client_test.py
#!/usr/bin/env python import time import sys import asyncio import threading if sys.platform == "win32": sys.path.insert(1, "..\\alvaro\\") elif sys.platform == "linux": sys.path.insert(1, "../alvaro/") import alvaro def lostConnection(): print("Connection Lost!") def gotMessage(client, data, metaData...
serverpFedMe.py
import os import copy import h5py from flcore.clients.clientpFedMe import clientpFedMe from flcore.servers.serverbase import Server from utils.data_utils import read_client_data from threading import Thread import torch import torchvision.transforms as transforms import torchvision import numpy as np import wandb cl...
worker.py
import attr from threading import Thread, Event from time import time from ....config import config, deferred_config from ....backend_interface.task.development.stop_signal import TaskStopSignal from ....backend_api.services import tasks class DevWorker(object): prefix = attr.ib(type=str, default="MANUAL:") ...
helpers.py
"""Testing helpers""" import os import subprocess from math import radians, sin, cos, sqrt, atan2 from multiprocessing import Process, Manager, Queue, cpu_count, Lock try: # Python 2 from Queue import Empty except ImportError: # Python 3 from queue import Empty def __get_nearest_neighbor_distance(point_que...
multithreading_exec.py
import threading import time def test(): # 定义一个test函数供线程调用 for i in range(5): print('test', i) time.sleep(1) thread1 = threading.Thread(target=test) thread1.start() for i in range(5): print('main', i) time.sleep(1)
bridge.py
# coding: utf-8 # Copyright © 2014-2020 VMware, Inc. All Rights Reserved. ################################################################################ import gc import logging import os import signal import sys import threading import time import traceback from logging.handlers import RotatingFileHandler from mult...
test_socket.py
import unittest from test import support from test.support import os_helper from test.support import socket_helper from test.support import threading_helper import errno import io import itertools import socket import select import tempfile import time import traceback import queue import sys import os import platform...
actors.py
# Copyright 2021 Accenture Global Solutions Limited # # 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 ...
rpn_test.py
import os import math from core.detection_module import DetModule from core.detection_input import Loader from utils.load_model import load_checkpoint from utils.patch_config import patch_config_as_nothrow from six.moves import reduce from six.moves.queue import Queue from threading import Thread import argparse impo...