source
stringlengths
3
86
python
stringlengths
75
1.04M
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence from electrum.storage import WalletStorage, StorageReadWriteError from electrum.wallet_db import WalletDB from el...
framework.py
#!/usr/bin/env python3 from __future__ import print_function import gc import logging import sys import os import select import signal import subprocess import unittest import tempfile import time import faulthandler import random import copy import psutil import platform from collections import deque from threading i...
pyre_discovery_master_module.py
from pyre import Pyre from pyre import zhelper import threading import zmq import logging import json import time from uniflex.core import modules __author__ = "Piotr Gawlowicz" __copyright__ = "Copyright (c) 2015, Technische Universitat Berlin" __version__ = "0.1.0" __email__ = "{gawlowicz}@tkn.tu-berlin.de" class...
controller.py
#!/usr/bin/env python2 import argparse import grpc import time import os import sys import json import pickle from time import sleep from collections import defaultdict import threading # Import P4Runtime lib from parent utils dir # Probably there's a better way of doing this. sys.path.append( os.path.join(os.path...
clientV4.py
import socket import threading helpMessage = '-q -- close connection\n-l -- list of connected devices\n-t -- server time \n-s "arduino/client ""reciever name" "message" -- send message (messages can be max 100 character) \nif reciever is an arduino board it can be controlled by this messsage:\n -s arduino "arduino ...
sara_data.py
"""SaraData""" import queue import threading from sara.core.config import DATABASE as default_database from sara.core.config import sara_files_path from sara.core.mongo.db import get_client, load_database, load_tweets from sara.core.sara_file.db import load_data, save_data_file from sara.core.utils import create_path ...
client_runner.py
""" Copyright 2019-2020 ARM 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 law or agreed to in writing, software ...
ch3_2.3.1_time_series1.py
#! /usr/bin/env python ''' Demonstrates how simple group can be used as one-to-many relationship using a column family ''' import util from pycassa.columnfamily import ColumnFamily from pycassa.types import * import time from threading import Thread import json import datetime import random # Load data from data/movi...
__init__.py
"""Gui related classes""" import threading from queue import Queue, Empty from tkinter import * from tkinter.ttk import * from tkinter.filedialog import askopenfilename from tkinter.simpledialog import Dialog class UiRoot(Tk): def __init__(self): Tk.__init__(self) self._queue = Queue() self._processQueue() d...
variable_scope_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 applica...
context.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...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
main.py
import shutil from threading import Thread from threading import Lock import unittest from optparse import OptionParser import ddt import requests from requests.packages import urllib3 import json from json import JSONDecodeError import apirun from .genReport import html_report from .getToken import get_token from .ex...
_threading_local.py
"""Thread-local objects. (Note that this module provides a Python version of the threading.local class. Depending on the version of Python you're using, there may be a faster one available. You should always import the `local` class from `threading`.) Thread-local objects support the management of thread-local d...
receiver.py
#! /usr/bin/env python # coding:utf-8 import socket import threading import re import csv csv_file_name = "data" def check_http(request): if "HTML" in request: return True return False # check format of received message. # iff format is valid, save data in format of CSV and return True def check_format_and_...
variantcaller.py
#! /usr/bin/env python # coding=utf-8 """Module Description Copyright (c) 2017 Jianfeng Li<lee_jianfeng@sjtu.edu.cn> This code is free software; you can redistribute it and/or modify it under the terms of the MIT License. @variantcaller Variant Call Module @status: experimental @version: $Revision$ @author: Jianfeng Li...
pub.py
import datetime import json import random import re from collections import Counter from collections import OrderedDict from collections import defaultdict from enum import Enum from threading import Thread import boto3 import dateutil.parser import gzip import requests import urllib.parse from dateutil.relativedelta ...
dns.py
#!/usr/bin/env python3 # coding=utf-8 """ Implementação de um sistema de nomeação similar ao DNS Cada objeto NameServer representaria um servidor de nomes real. Implementação do lookup iterativo. """ import json import logging import socket import threading class NameServer(object): """ Descreve u...
SimpleSocket.py
from typing import Any, Union from SimpleWebSocketServer import SimpleExampleServer, WebSocket import cv2 import math clients = [], server = None class RunSocket(): def __init__(self): pass def RUN(self): class SimpleWSServer(WebSocket): def handleConnected(self): ...
Magma.py
''' Created on Mar 29, 2020 @author: riteshagarwal ''' import random from BucketLib.BucketOperations import BucketHelper from BucketLib.bucket import Bucket from TestInput import TestInputSingleton from basetestcase import BaseTestCase from couchbase_helper.documentgenerator import doc_generator from error_simulatio...
summarizer.py
# Copyright (C) The Arvados Authors. All rights reserved. # # SPDX-License-Identifier: AGPL-3.0 import arvados import collections import crunchstat_summary.dygraphs import crunchstat_summary.reader import datetime import functools import itertools import math import re import sys import threading import _strptime fro...
test_pdb.py
# A test suite for pdb; not very comprehensive at the moment. import doctest import os import pdb import sys import types import codecs import unittest import subprocess import textwrap import linecache from contextlib import ExitStack from io import StringIO from test.support import os_helper # This little helper cl...
client.py
#!/usr/bin/env python import os import sys import argparse import numpy as np import cv2 import _init_paths from fast_rcnn.config import cfg from fast_rcnn.test import im_detect from fast_rcnn.nms_wrapper import nms from utils.timer import Timer import caffe, os, sys, cv2 import socket from PIL import Image from time ...
test_gateway_dry_run.py
import asyncio import json import multiprocessing import threading import time from collections import defaultdict import pytest from jina import Client, Document, Executor, requests from jina.enums import PollingType from jina.parsers import set_gateway_parser, set_pod_parser from jina.serve.runtimes.asyncio import ...
admin-api.py
#!/usr/bin/python3 import json import os import time import ipfshttpclient import redis as redis from fastapi import FastAPI, File, UploadFile, Form def loadjson(jsonfile): with open(jsonfile) as json_file: data = json.load(json_file) return data app = FastAPI() conf = loadjson(os.path.join(os....
spawn_object.py
# taken from https://zmk5.github.io/general/demo/2019/07/15/ros2-spawning-entity.html import os import sys import rclpy from multiprocessing import Process from ament_index_python.packages import get_package_share_directory from gazebo_msgs.srv import SpawnEntity def spawn_object(model): rclpy.init() node = r...
misc.py
import shutil import sys import os import tables import warnings from threading import Thread from queue import Queue, Empty from tierpsy import AUX_FILES_DIR # get the correct path for ffmpeg. First we look in the aux # directory, otherwise we look in the system path. def get_local_or_sys_path(file_name): file_...
test_state.py
# -*- coding: utf-8 -*- # Import python libs from __future__ import absolute_import import os import shutil import textwrap import threading import time # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.unit import skipIf from tests.support.paths import TMP from tests.support.mix...
08_4_threading_test.py
import threading import time print("hello world ----- 2021-04-06 starting") def loop(): """ 新线程执行的代码""" now_thread = threading.current_thread() n = 0 while n < 5: print('[loop]now thread name: {0}'.format(now_thread.name)) print(n) time.sleep(2) n += 1 def use_thread...
server Non Blocking.py
import socket import threading from queue import Queue sc = socket.socket(socket.AF_INET,socket.SOCK_STREAM) port = 2000 def clientThread(clnt,queue,inst): clnt.send(bytes("Connection Established.",'utf-8')) while True: if(not inst.empty): clnt.send(bytes("start",'utf-8')) while True: ...
player.py
""" The MIT License (MIT) Copyright (c) 2015-present Rapptz 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, merg...
manage.py
# Copyright (c) 2015 SONATA-NFV and Paderborn University # 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 re...
webserver.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "I'm alive" def run(): app.run(host='0.0.0.0',port=8080) def keep_alive(): t = Thread(target=run) t.start()
bitmex_book.py
# -*- coding: utf-8 -*- # - OrderBook Websocket Thread - # 🦏 **** quan.digital **** 🦏 # authors: canokaue & thomgabriel # date: 03/2020 # kaue.cano@quan.digital # Simplified implementation of connecting to BitMEX websocket for streaming realtime orderbook data. # Optimized for OrderBookL2 handling using Red and Bl...
watsonspeechapi.py
# -*- coding: utf-8 -*- """ https://github.com/watson-developer-cloud/python-sdk/blob/master/examples/microphone-speech-to-text.py """ import io import threading import queue from watson_developer_cloud import SpeechToTextV1 from watson_developer_cloud.websocket import RecognizeCallback, AudioSource import numpy as np...
server.py
from .recommender import Recommender from daemon import Daemon, Socket from threading import Thread from queue import Queue import os, time def lazyprop(fn): attr_name = '_lazy_' + fn.__name__ @property def _lazyprop(self): if not hasattr(self, attr_name): setattr(self, attr_name, fn(...
switch_controller.py
import binascii import threading import simplejson as json import struct import p4runtime_lib.bmv2 import p4runtime_lib.helper class BaseController: def __init__(self, p4info_file_path, bmv2_file_path): self.switches = {} self.port_queues = {} self.port_threads = {} self.p4info_h...
test_buffer_client.py
# Copyright 2019 Open Source Robotics Foundation, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notice, this lis...
demo_minio.py
import threading import os import time import subprocess # export MINIO_ROOT_USER=minio_credential MINIO_ROOT_PASSWORD=minio_credential os.putenv("MINIO_ROOT_USER", "minio_credential") os.putenv("MINIO_ROOT_PASSWORD", "minio_credential") def start_minio(): os.system('minio server --console-address ":9001" /Users...
util.py
# 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 limitation the rights t...
event_watcher.py
""" Agent which monitors and reports the state of critical components of the framework Copyright (C) 2017-2022 Intel Corporation SPDX-License-Identifier: Apache-2.0 """ import logging from threading import Thread from .constants import EVENTS_CHANNEL from .constants import REMEDIATION_CONTAINER_CHANNEL...
test_state.py
# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import shutil import sys import tempfile import textwrap import threading import time # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.h...
managed_window.py
from pyglet.gl import * from pyglet.window import Window from pyglet.clock import Clock from threading import Thread, Lock gl_lock = Lock() class ManagedWindow(Window): """ A pyglet window with an event loop which executes automatically in a separate thread. Behavior is added by creating a subclass ...
main.py
import functools import os import random import threading import time from dataclasses import dataclass from datetime import datetime, timedelta from enum import Enum from typing import Dict, Iterator, Optional from uuid import UUID, uuid4 import requests from fastapi import FastAPI, HTTPException from fastapi.excepti...
function.py
import asyncio import json import sys import threading import discord import numpy as np import requests import sympy from discord import File from PIL import Image from sympy import S, latex, preview from sympy.core.numbers import Float as symFloat from sympy.core.numbers import Integer as symInt from sympy.parsing.l...
test_c10d_nccl.py
import copy import math import os import random import signal import sys import tempfile import threading import time from contextlib import contextmanager from datetime import timedelta from itertools import product from unittest import mock import torch import torch.distributed as c10d if not c10d.is_available(): ...
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...
syn.py
#!/usr/bin/env python3 # MIT License # # Copyright (C) 2020, Entynetproject. All Rights Reserved. # # 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 lim...
autologin1.py
import time import pythoncom from manuallogin import * from PyQt5 import QtWidgets from PyQt5.QtCore import QTimer from multiprocessing import Process from PyQt5.QAxContainer import QAxWidget sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) from utility.setting import OPENAPI_PATH class Wi...
mth_event.py
from machin.parallel.event import * from machin.parallel.thread import Thread import time event1 = Event() event2 = Event() event3 = Event() # wait() will block until its value might have changed (due to a sub event) # wait() returns a bool value def test1(): global event1, event2, event3 event = OrEvent(ev...
bot.py
import logging import threading import time import tinybot log = logging.getLogger(__name__) def main(): room_name = tinybot.pinylib.CONFIG.ROOM if tinybot.pinylib.CONFIG.ACCOUNT and tinybot.pinylib.CONFIG.PASSWORD: bot = tinybot.TinychatBot(room=room_name, account=tinybot.pinylib.CONFIG.ACCOUNT, ...
app.py
""" * Copyright 2019 EPAM Systems * * 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,...
watchdog.py
# -*- coding: utf-8 -*- from kazoo.client import KazooClient import os import sys import logging import time import signal from multiprocessing import Process main_dir = "/root/V3/project/" signal_dir = '/signal/chinanews' task_type = "chinanews" def run_proc(): os.chdir(main_dir +"chinanews/chinanews/spiders") ...
test_urllib.py
"""Regresssion tests for urllib""" import urllib.parse import urllib.request import urllib.error import http.client import email.message import io import unittest from test import support import os import sys import tempfile import warnings import collections def hexescape(char): """Escape char as RFC 2396 specif...
main.py
import asyncio import json import logging import threading from datetime import datetime from typing import List, Tuple, Dict, Any from aiocache import cached from pytz import utc, timezone from quart import Quart, render_template from update_likes import likes_data, update_likes logging.basicConfig(level="INFO", fo...
test_sys_jy.py
import sys import re import unittest import test.test_support class SysTest(unittest.TestCase): def test_platform(self): self.assertEquals(sys.platform[:4], "java", "sys.platform is not java") def test_exit_arg(self): "sys.exit can be called with args" try: ...
test4.py
import RPi.GPIO as GPIO import time import Queue import threading GPIO.setmode(GPIO.BCM) speedpin=18 GPIO.setup(speedpin, GPIO.IN, pull_up_down=GPIO.PUD_UP) queue = Queue.Queue() def printQueue(): while True: s = queue.get() print(s) ta = threading.Thread(target=printQueue) ta.start() START =...
test_custom_model.py
import collections import glob import json import os import pickle import re import shutil import signal import subprocess import time from tempfile import NamedTemporaryFile from threading import Thread from unittest import mock from uuid import uuid4 import numpy as np import pandas as pd import pytest import reques...
processor.py
import sublime import sublime_plugin import os import xml import urllib import json import threading import time import pprint import urllib.parse import shutil import datetime import math from xml.sax.saxutils import unescape from . import requests, context, util from .context import COMPONENT_METADATA_SETTINGS from ...
test_environment.py
import os import threading import time from pathlib import Path import pytest import requests from coworks.config import Config, ProdConfig from coworks.cws.runner import CwsRunner from coworks.cws.runner import ThreadedLocalServer from tests.coworks.tech_ms import * class WithEnvMS(SimpleMS): def __init__(sel...
test_util_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 applica...
logger.py
from __future__ import absolute_import import sys import traceback import six from threading import Timer, Thread, Lock from aetros.utils import thread_join_non_blocking def drain_stream(stream, decode='utf-8'): content = six.b('') while True: try: # read() needs to block #...
udp.py
#!/usr/bin/env python3 import random import time import socket from threading import Thread def UDP_ATTACK(threads, attack_time, target): # Finish global FINISH FINISH = False target_ip = target.split(":")[0] target_port = int(target.split(":")[1]) print("\033[1;34m"+"[*]"+"\033[0m"+" Starting UDP attack...") ...
reloader.py
import os from time import sleep import helium from threading import Thread import re from stellapy.logger import log from stellapy.walker import walk, get_file_content from stellapy.executor import Executor from stellapy.configuration import Configuration class Reloader: """ The `Reloader` class. """ ...
rt_acquisition.py
#acquisition stuff from pycromanager import Acquisition, Bridge from skimage import io import cv2 as cv import json import time import os import numpy as np from multiprocessing import Process, Queue, Value import acquisitionDialog from utils.barcode_code import find_barcode_region, match_barcode class run_acquisit...
faceRecog.py
import cv2 import atexit import numpy as np import argparse import RPi.GPIO as GPIO import time import sys import signal from picamera import PiCamera, mmal from picamera.array import PiRGBArray from picamera.mmalobj import to_rational from multiprocessing import Process, Queue, Event from motor import Motor MAX_ANGLE...
qt_gl_preview.py
import picamera2 import threading import atexit class QtGlPreview: def thread_func(self, picam2, width, height): # Running Qt in a thread other than the main thread is a bit tricky... from q_gl_picamera2 import QApplication, QGlPicamera2 self.app = QApplication([]) self.size = (wid...
ArtefactBlockGenerator.py
import os import math import time import gc import h5py import threading import numpy as np from skimage.io import imread from skimage.measure import regionprops,label from skimage.transform import resize from . import DataGenerator class BlockLoader(): def __init__(self, directory, cur_idx, next_idx): s...
test_dota_base_sota.py
# -*- coding:utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import sys import tensorflow as tf import cv2 import numpy as np import math from tqdm import tqdm import argparse from multiprocessing import Queue, Process from utils import...
Captura.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'Gui_bases.ui' # # Created by: PyQt5 UI code generator 5.13.0 # # WARNING! All changes made in this file will be lost! ######################################################### import sys sys.path.append('C:/Python37/Lib/site-packages') from...
mock_web_api_server.py
import asyncio import json import logging import re import sys import threading import time from http import HTTPStatus from http.server import HTTPServer, SimpleHTTPRequestHandler from multiprocessing.context import Process from typing import Type from unittest import TestCase from urllib.parse import urlparse, parse_...
pserve.py
# (c) 2005 Ian Bicking and contributors; written for Paste # (http://pythonpaste.org) Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license.php # # For discussion of daemonizing: # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 # # Code taken also from QP: http://www.mems-exch...
plot_realtime_power.py
#!/usr/bin/env python import Monsoon.LVPM as LVPM import Monsoon.HVPM as HVPM from Monsoon import sampleEngine import argparse import csv import os import matplotlib matplotlib.use('TKAgg') from matplotlib import pyplot as plt import matplotlib.animation as animation import threading import collections import signal i...
parcer_new_train.py
from bs4 import BeautifulSoup import requests import re import numpy as np import json import csv from threading import Thread counter_last_matches = 10 def parse(url): matches_links = [] page = requests.get(url) # Success - 200 if page.status_code != 200: exit(-1) soup = BeautifulSoup(pa...
socket_abc.py
import queue import typing from rsockets2.frames import Frame_ABC, KeepAliveFrame from rsockets2.frames import FrameParser from abc import ABC, abstractmethod import threading import logging class Socket_ABC(ABC): def __init__(self, resume_support_enabled=False): super().__init__() self.resume_s...
shruntime.py
# coding: utf-8 import os import sys import platform import logging import threading import functools from six import StringIO, text_type, binary_type, PY3 try: file except NameError: from io import IOBase as file import pyparsing as pp # Detecting environments try: import ui from objc_util import on_main_...
case.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2022 Valory AG # Copyright 2018-2021 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance...
rtest.py
#!/usr/bin/python3 """Copyright 2021 Advanced Micro Devices, Inc. Run tests on build""" import re import os import sys import subprocess import shlex import argparse import pathlib import platform from genericpath import exists from fnmatch import fnmatchcase from xml.dom import minidom import multiprocessing import t...
api.py
import time from flask import Flask, Response import random from chunk import Chunk from trip import Trip from TripDB import TripDB from OBDConnection import OBDConnection as connect import os import sys import time import subprocess from flask import Flask, request, jsonify from multiprocessing import Process, Queue...
run_unittests.py
#!/usr/bin/env python3 # Copyright 2016-2017 The Meson development team # 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 ...
slycat-docker-agent.py
#!/bin/env python # Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract # DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government # retains certain rights in this software. try: import io as StringIO except...
reaper.py
#!/usr/bin/env python3 import logging import os import signal import sys import threading import click import typing from datetime import datetime from kubernetes import client, config from util import label_selector, parse_time, parse_duration, time_to_str from logging import getLogger logger = getLogger(__name__)...
test_uploader.py
#!/usr/bin/env python3 import os import time import threading import unittest import logging import json from selfdrive.swaglog import cloudlog import selfdrive.loggerd.uploader as uploader from common.xattr import getxattr from selfdrive.loggerd.tests.loggerd_tests_common import UploaderTestCase class TestLogHand...
main.py
# import matplotlib # print(matplotlib.get_backend()) # print(matplotlib.is_interactive()) # matplotlib.use('Qt4Agg') import os import glob import copy import datetime import random from threading import Thread import matplotlib.patches as patches import matplotlib.pyplot as plt import numpy as np import tensorflow as...
libfidl.py
__author__ = "David Taschjian" import click import hashlib import os import json import time import RPi.GPIO as GPIO from edgetpu.basic.basic_engine import BasicEngine from edgetpu.classification.engine import ClassificationEngine from edgetpu.learn.imprinting.engine import ImprintingEngine from edgetpu.detection.engi...
MqttComm.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright (C) 2015-2018 Shenzhen Auto-link world Information Technology Co., Ltd. All Rights Reserved Name: MqttComm.py Purpose: Created By: Clive Lau <liuxusheng@auto-link.com.cn> Created Date: 2018-01-11 Changelog: Date Desc 2018-01-1...
interface.py
from .file_manager import download_json, download_text from .general_tools import utf_decoder from threading import Thread from time import sleep import platform def form_result_from_cp(control_package, frame): objs_amount = len(control_package["objs_for_anim"]) + \ len(control_package["dynamic_...
base_thread_module.py
from abc import abstractmethod from threading import Thread from up.base_started_module import BaseStartedModule class BaseThreadModule(BaseStartedModule): def __init__(self): super().__init__() self.__thread = None def _execute_initialization(self): super()._execute_initialization()...
Main.py
#!/usr/bin/env python3.6 """Main class of the Time Manager.""" # System imports import sys import time import os from threading import Thread # Local import import OSFactory import ProcessFileManager import TimeActivity import UIServer class TimeManager(object): """Time manager main class.""" def __init__(s...
Tools.py
debugging = False version = 4.2 import time, tempfile, os, json, sys, darkdetect, webbrowser, subprocess from threading import Thread from sys import platform as _platform from PySide2 import QtWidgets, QtCore, QtGui from ast import literal_eval if(len(sys.argv)>1): zip = sys.argv[1] if('debug' i...
datasets.py
# Copyright 2020 Lorna 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 applicable l...
auth.py
from settings import Settings from flask import Flask, request, redirect import requests import discord from discord.utils import get import threading import json class Oauth(object): clientId = Settings.clientId clientSecret = Settings.clientSecret scope = "identify" redirectUri = Settings.redirectUri discordApi...
test_admission_controller.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...
audio.py
# -*- coding: utf-8 -*- import os import sys from threading import Thread, Lock from pyaudio import PyAudio, paInt16 import config as conf class AudioRecorder: def __init__(self, rate): self.pa = PyAudio() self.stream = self.pa.open( format = paInt16, channels ...
master.py
# -*- coding: utf-8 -*- ''' This module contains all of the routines needed to set up a master server, this involves preparing the three listeners and the workers needed by the master. ''' # Import python libs from __future__ import absolute_import, with_statement, print_function, unicode_literals import copy import c...
danmu_factory.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2017/12/7 # @Author : wangmengcn # @Email : eclipse_sv@163.com import socket import re from time import time, sleep from datetime import datetime from threading import Thread from json import dumps from . import r class DouyuDM: HOST = 'openbarrage.dou...
testing.py
import math import multiprocessing import os import time from src.a_star import A_star from src.cbs import CBS from src.cbs_ds import CBS_DS from src.cbs_h import CBS_H from src.cbs_pc import CBS_PC from src.map import Map from test.movingai import read_map_from_moving_ai_file, read_tasks_from_moving_ai_file from os i...
MainFrame.py
""" This class contains all functions to manage different windows Base line for this code is from Sentdex(link under) https://pythonprogramming.net/object-oriented-programming-crash-course-tkinter/ """ import random as r from itertools import cycle import tkinter as tk import EvolutionMana...
dijk_range_mp.py
import random import time import sys import multiprocessing from multiprocessing import Lock,Process,Semaphore,Barrier,Array,Queue INT_MAX = multiprocessing.Value('i',1000000000) #N=multiprocessing.Value('i',16384) #DEG=multiprocessing.Value('i',16) #P=multiprocessing.Value('i',1) q = multiprocessing.Queue() N1=int(s...
sdkserver.py
import eventlet import json import random import string import json import sys import time from couchbase.couchbaseclient import CouchbaseClient from multiprocessing import Process import testcfg as cfg pool = eventlet.GreenPool(1000000) processMap = {} class SysCouchClient(CouchbaseClient): def __init__(self, u...