source
stringlengths
3
86
python
stringlengths
75
1.04M
replay.py
""" Driver "replay" replaying old logfile """ from threading import Thread from osgar.logger import LogReader, lookup_stream_names from osgar.lib.serialize import deserialize class ReplayDriver: def __init__(self, config, bus): self.input_thread = Thread(target=self.run_input, daemon=True) sel...
kbdeleonHelloWorldServer.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...
pytest_catch_server.py
import socket import socketserver import threading from http.server import BaseHTTPRequestHandler from types import SimpleNamespace import pytest def handler_factory(requests): class Handler(BaseHTTPRequestHandler): def process_request(self): length = int(self.headers.get("Content-Length", 0)...
record-video.py
import time from cv2 import cv2 from threading import Thread from djitellopy import Tello tello = Tello() tello.connect() keepRecording = True tello.streamon() frame_read = tello.get_frame_read() def videoRecorder(): # create a VideoWrite object, recoring to ./video.avi # 创建一个VideoWrite对象,存储画面至./video.avi ...
nng.py
""" Provides a Pythonic interface to cffi nng bindings """ import logging import threading import atexit import pynng from ._nng import ffi, lib from .exceptions import check_err from . import options from . import _aio logger = logging.getLogger(__name__) __all__ = ''' ffi Bus0 Pair0 Pair1 Pull0 Push0 Pub0 Sub0 ...
msgcenter.py
#!/usr/bin/env python # -*- coding: utf-8 -* # Copyright: [CUP] - See LICENSE for details. # Authors: Guannan Ma (@mythmgn), """ :descrition: msg center related module """ import abc import time import socket import threading from cup import log from cup.net.asyn import conn from cup.net.asyn import msg as async_...
core.py
""" homeassistant ~~~~~~~~~~~~~ Home Assistant is a Home Automation framework for observing the state of entities and react to changes. """ import os import time import logging import signal import threading import enum import re import functools as ft from collections import namedtuple from homeassistant.const impo...
facedetect.py
#!/usr/bin/env python ''' face detection using haar cascades USAGE: facedetect.py [--cascade <cascade_fn>] [--nested-cascade <cascade_fn>] [<video_source>] ''' # Python 2/3 compatibility from __future__ import print_function import threading, queue import numpy as np import cv2 as cv import cv2 import time # ...
t020_db_updates.py
import time from threading import Thread from django.test import TestCase from django.db import transaction from django_joblog.models import JobLogModel from django_joblog import * class JobLogDbUpdatesTestCase(TestCase): databases = ("default", "joblog") def setUp(self): pass def test_log_up...
server.py
""" This module holds all of the functions and classes necessary for initiating a JSONRPC-TCP Server. """ import threading import socket import time import sys import traceback import six from jsonrpctcp.handler import Handler from jsonrpctcp import config from jsonrpctcp import logger from jsonrpctcp import histor...
command.py
import logging import sys import itertools import time import os import math import click import click_log import tqdm import ssw import pysam import multiprocessing as mp from ..utils import bam_utils from ..utils.model import reverse_complement from ..utils.model import LibraryModel logging.basicConfig(stream=s...
_server.py
# Copyright 2016 gRPC 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 writing...
multi_kafka_worker.py
import gevent.monkey gevent.monkey.patch_socket() gevent.monkey.patch_ssl() gevent.monkey.patch_thread() from abc import ABCMeta, abstractmethod from typing import List from enum import Enum from multiprocessing import Pool from multiprocessing.pool import AsyncResult from threading import Thread, Lock # from gevent i...
__main__.py
import ast import curio import code import inspect import sys import types import warnings import threading import signal import os class CurioIOInteractiveConsole(code.InteractiveConsole): def __init__(self, locals): super().__init__(locals) self.compile.compiler.flags |= ast.PyCF_ALLOW_TOP_LEVEL...
kiri.py
import ARIFISTIFIK from ARIFISTIFIK import * from akad.ttypes import * from multiprocessing import Pool, Process from time import sleep import pytz, datetime, pafy, time, timeit, random, sys, ast, re, os, json, subprocess, threading, string, codecs, requests, ctypes, urllib3, wikipedia from datetime import timedelta, d...
cmd_exec.py
#!/bin/python3.4 import re, os, sys import shlex, time, datetime import json, yaml import subprocess, multiprocessing from pprint import pprint import memcache class MemCacheClient(): """ My test memcached client class, inteneded to be moved to a official tool lib """ def __init__( self, **options ): self...
airplayserver.py
""" Implemented according to https://nto.github.io/AirPlay.html#audio-remotecontrol """ import time import socket import logging from enum import Enum from threading import Thread try: from http.server import BaseHTTPRequestHandler, HTTPServer except ImportError: from BaseHTTPServer import BaseHTTPRequestHandl...
CharityScreenAI.py
import json, httplib, threading from panda3d.core import * from direct.distributed.DistributedObjectAI import DistributedObjectAI from direct.interval.IntervalGlobal import * from direct.task import Task from toontown.hood import ZoneUtil from toontown.toonbase import ToontownGlobals from direct.gui.DirectGui import D...
test_target_codegen_vulkan.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...
process.py
import multiprocessing import os from oslo_concurrency import processutils import psutil import time # To avoid circular imports, util modules should only import a limited # set of shakenfist modules, mainly exceptions, logutils, and specific # other util modules. from shakenfist import db from shakenfist import logut...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test mericad shutdown.""" from test_framework.test_framework import MERICATestFramework from test_fram...
bctides.py
from datetime import datetime, timedelta import pathlib from typing import Dict, Union import logging from pyschism import dates from pyschism.mesh.vgrid import Vgrid from pyschism.forcing.bctides import iettype, ifltype, isatype, itetype, itrtype, Tides from pyschism.forcing.bctides.elev2d import Elev2D from pyschis...
display_server.py
import threading import Adafruit_SSD1306 import time import PIL.Image import PIL.ImageFont import PIL.ImageDraw from flask import Flask from .utils import ip_address, network_hostname, cpu_usage, memory_usage, disk_usage, temp from pidisplay import ads1115 from pidisplay import ina219 import os class DisplayServer(obj...
test_capi.py
# Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. import os import pickle import random import subprocess import sys import time import unittest from test import support from test.support import MISSING_C_DOCSTRINGS try:...
blacs_workers.py
##################################################################### # # # /labscript_devices/IMAQdxCamera/blacs_workers.py # # # # Copyright 2019, Monash University and ...
__init__.py
#!/usr/bin/env python import time from smbus import SMBus from threading import Thread import atexit _bus = None _t_poll = None _running = False _last_state = 0 retries = 4 ADDR = 0x15 LEDS = [0] * 12 class Handler(): def __init__(self): self.press = None press = None _handler = Handler() def...
edit.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import threading import time import shutil import wx import wx.combo import colorsys import cw #------------------------------------------------------------------------------- # パーティ情報変更ダイアログ #---------------------------------------...
test_dag_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...
gopro.py
# gopro.py/Open GoPro, Version 1.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro). # This copyright was auto-generated on Tue May 18 22:08:50 UTC 2021 """Implements top level interface to GoPro module.""" # TODO make scanning / connect more robust import re import csv import time import enum import queu...
monitor.py
#!python3 # -*- coding:utf-8 -*- import time import json import threading from tkinter import * from tkinter import ttk import serial import webbrowser bg_color = '#29282E' label_color = '#E9E5E2' red_color = '#FF6666' blue_color = '#0099CC' yellow_color = '#FFFFCC' orange_color = '#FF9900' green_color = '#99CC99' g...
PlayQueue.py
import enum import os import shutil import threading from kivy.core.audio import SoundLoader from src.music_utils.Song import Song from src.network import ClientManeger class PlayQueue: def __init__(self): self.playlist = ClientManeger.server_songs if ClientManeger.is_online else ClientManeger.my_songs ...
foo.py
# Python 3.3.3 and 2.7.6 # python fo.py from threading import Thread # Potentially useful thing: # In Python you "import" a global variable, instead of "export"ing it when you declare it # (This is probably an effort to make you feel bad about typing the word "global") i = 0 def incrementingFunction(): glob...
teleporter_calculate.py
from functools import cache import sys sys.setrecursionlimit(10**9) import threading threading.stack_size(134213632) # 128-ish megabytes @cache def f1(a,b,magic): if a == 0: return (b + 1) % 32768 if b == 0: return f1(a-1, magic, magic) return f1(a-1, f1(a, b-1, magic), magic) def main(): ...
threading.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # threading.py """ Generic classes to perform threading with a progress frame """ # Copyright (c) 2020 Dan Cutright # This file is part of DVHA DICOM Editor, released under a BSD license. # See the file LICENSE included with this distribution, also # available at htt...
多线程之非守护线程.py
import threading import time def start(): time.sleep(2) print(threading.current_thread().name)#打印线程名字 print(threading.current_thread().isAlive())#打印当前线程还活着 print(threading.current_thread().ident)#打印当前线程的ID if __name__ == "__main__":#主线程 print('程序开始') #以下是我们创建的线程 主线程 会跳过 创建线程 ...
test.py
import gzip import json import logging import os import io import random import threading import time import helpers.client import pytest from helpers.cluster import ClickHouseCluster, ClickHouseInstance, get_instances_dir from helpers.network import PartitionManager from helpers.test_tools import exec_query_with_retr...
create_faiss_index.py
import numpy as np import faiss import multiprocessing import glob import os import sys import tensorflow as tf os.environ["CUDA_VISIBLE_DEVICES"] = "-1" NUM_CPU = multiprocessing.cpu_count() // 4 manager = multiprocessing.Manager() features = manager.list() class Network(): def __init__(self): from class...
app.py
from importlib import import_module import os from flask import Flask, render_template, Response, send_from_directory from flask_cors import * # import camera driver from camera_opencv import Camera import threading # Raspberry Pi camera module (requires picamera package) from camera_pi import Camera app = Flask(__n...
WeaveBluezMgr.py
# # Copyright (c) 2015-2017 Nest Labs, 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 # # ...
TAXIIServer.py
import demistomock as demisto from CommonServerPython import * from flask import Flask, request, make_response, Response, stream_with_context from gevent.pywsgi import WSGIServer from urllib.parse import urlparse, ParseResult from tempfile import NamedTemporaryFile from base64 import b64decode from typing import Callab...
py_utils.py
# Lint as: python2, python3 # -*- coding: utf-8 -*- # Copyright 2018 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...
log_plotter.py
import os, re import glob import sys import copy import json import math import gc import threading import concurrent.futures from multiprocessing import Process import numpy as np import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as plt # Default evaluation dict format # All values are 1D_LISTs pr...
test_core.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...
env_stock_papertrading_sb3.py
import datetime import threading import time import alpaca_trade_api as tradeapi import numpy as np import pandas as pd from finrl_meta.data_processors.processor_alpaca import AlpacaProcessor class AlpacaPaperTrading_sb3(): def __init__(self, ticker_list, time_interval, agent, cwd, net_dim, ...
mydetect.py
#!/usr/bin/python __author__ = "Stephane BARTHELEMY" __copyright__ = "Copyright 2018, BARTHELEMY" __credits__ = ["Stephane BARTHELEMY"] __license__ = "MIT" __version__ = "1.0" __maintainer__ = __author__ __email__ = "stephane@sbarthelemy.com" import os import sys from time import sleep from pyA20.gpio import gpio fro...
main.py
''' Disclaimer: I normally use "f" tags instead of .format(), but apparently .format() is faster so im using it for this. Also I know some naming conventions are wrong for this, it just looks better w/ this project idk why. P.S: I'm using tuples for the threading as it's not mutable. ''' import os, sys, threading, time...
job.py
""" **job** module handles all the job running logic: - consistent exception handling and logging - currently 2 job runners are implemented: - SimpleJobRunner runs the jobs sequentially. - ParallelJobRunner queues the jobs and run them in a dedicated thread """ from concurrent.futures import ThreadPoolExecutor, Pr...
snarl_notifications.py
import win32con import win32gui import win32api import win32process import struct import array import time import threading import PySnarl import os import commctrl # GUI imports import wx from wx import TaskBarIcon # TODO: Clean up you code! GUI code is too ingrained with the logic. (Coded in 4 hours...
quote_sample.py
import time from tcoreapi_mq import * import tcoreapi_mq import threading g_QuoteZMQ = None g_QuoteSession = "" #實時行情回補 def OnRealTimeQuote(symbol): print("商品:", symbol["Symbol"], "成交價:",symbol["TradingPrice"], "開:", symbol["OpeningPrice"], "高:", symbol["HighPrice"], "低:", symbol["LowPrice"]) #行情消息接...
adminset_agent.py
#!/usr/bin/env python # coding=utf-8 import os from subprocess import Popen, PIPE import re import platform import socket import time import json import threading token = 'HPcWR7l4NJNJ' server_ip = '192.168.47.130' try: import psutil except ImportError as msg: print(msg) print("--------------------------...
artifact_service.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 use ...
store_reader.py
"""A taskrunner that reads task definitions from a store and runs the tasks""" from threading import Thread from typing import Callable class StoreTaskReader: _get_task_func: Callable def __init__(self, store, get_task_func=None): self._store = store self._get_task_func = get_task_func ...
worker.py
import base64 import logging import os import re import sys import json import time from abc import ABC from datetime import datetime from multiprocessing import Process, Queue from urllib.parse import urlparse import pandas as pd import requests import sqlalchemy as s from github import Github from sqlalchemy import ...
download_youtube_noise.py
""" :author: Paul Bethge (bethge@zkm.de) 2021 :License: This package is published under Simplified BSD License. """ """ A small script for downloading audio files from the "audioset" dataset using youtube-dl and ffmpeg The list of files is passed as unbalanced_train_segments.csv Unfortunately, the balanced_train_segm...
aws_glue.py
import datetime import json import os import pickle import tempfile import threading import time from collections import OrderedDict, deque from typing import Any, Deque, Dict, Iterator, List, Optional, Tuple, Union, cast from redun.executors import aws_utils from redun.executors.base import Executor, register_executo...
VN_video.py
#!/usr/bin/python #SYSTEM IMPORTS import sys from os.path import expanduser import time import math import multiprocessing import cv2 import numpy as np #COMMOM IMPORTS from Common.VN_config import VN_config from Common.VN_logger import VN_logger from Common.Flow_Camera import flow_cam """ VN_video.py This file incl...
nsac.py
#!/usr/bin/python3 """ Adapt various USB joystick controllers for use with a Nintendo Switch (NS) console. All controllers are active but are seen by the console as one controller so co-pilot mode is always active. Read from joysticks and write to NSGadget device. The following joysticks are supported * Hori HoriPad...
meta.py
import json import os import sys import platform import multiprocessing import pynvml import threading import signal import time import socket import getpass import logging from shutil import copyfile from datetime import datetime from wandb import util from wandb import env import wandb METADATA_FNAME = 'wandb-metad...
sk_client.py
import json import os import threading import time import uuid from json import JSONDecodeError from dateutil.parser import parse import requests import websocket from typing import List class SkClientListener: def on_update_from_sk(self, utc, values): pass class SkClient: SIGNAL_K_ACCESS_URL = "/s...
misc.py
import multiprocessing import subprocess from time import sleep __copyright__ = "Copyright 2016, Netflix, Inc." __license__ = "Apache, Version 2.0" import sys import os def get_stdout_logger(): import logging logger = logging.getLogger() handler = logging.StreamHandler(stream=sys.stdout) logger.setLe...
plot_mode_base.py
from __future__ import print_function, division import pyglet.gl as pgl from sympy.core import S from sympy.core.compatibility import is_sequence from sympy.plotting.pygletplot.color_scheme import ColorScheme from sympy.plotting.pygletplot.plot_mode import PlotMode from time import sleep from threading import Thread, ...
generate_assemblage_cpp.py
############################################################################## # # Copyright (c) 2003-2020 by The University of Queensland # http://www.uq.edu.au # # Primary Business: Queensland, Australia # Licensed under the Apache License, version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # # Development unt...
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 ...
utils.py
from __future__ import absolute_import, division, print_function from collections import OrderedDict, defaultdict import contextlib import fnmatch import hashlib import json from locale import getpreferredencoding import libarchive import logging import logging.config import mmap import operator import os...
server.py
from monkey.service.application import PredictionServer import argparse import logging import sys, os import multiprocessing as mp logger = logging.getLogger(__name__) def run(application): """ Start server """ try: process = mp.Process(target=application) process.daemon = True ...
radio_server.py
try : import pyaudio import socket import threading import time import pydub import sys import os except ImportError as e: print "unable to import modules" print e sys.exit(1) #global variablles CLIENT_LIST = [] CHUNK = (441 * 6 + 150) AUDIO_FORMAT = ['mp3','...
utils.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 Alibaba Group Holding Limited. 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...
data_util.py
""" This code is based on https://github.com/fchollet/keras/blob/master/keras/utils/data_utils.py """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import time import numpy as np import threading import multiprocessing try: import queue except ImportEr...
_coreg_gui.py
"""Traits-based GUI for head-MRI coregistration""" # Authors: Christian Brodbeck <christianbrodbeck@nyu.edu> # # License: BSD (3-clause) from copy import deepcopy import os from ..externals.six.moves import queue import re from threading import Thread import numpy as np from scipy.spatial.distance import cdist # al...
test_serialServer.py
from unittest import TestCase from unittest.mock import Mock import unittest from serialtcp.server import SerialServer import socket import threading import time import logging logging.basicConfig(level=logging.DEBUG) class TestSerialServer(TestCase): def test_run(self): server = SerialServer(1...
bm_crypto_pyaes.py
#!/usr/bin/env python """ Pure-Python Implementation of the AES block-cipher. Benchmark AES in CTR mode using the pyaes module. """ from mpkmemalloc import * import os import gc import threading import psutil import pyperf from six.moves import xrange import pyaes # 23,000 bytes CLEARTEXT = b"This is a test. What c...
env.py
# -*- 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 with the License. # ...
camera.py
from threading import Thread import cv2 as cv class Camera: def __init__(self, src=0): self.cam = cv.VideoCapture(src) self.ok, self.frame = self.cam.read() self.stopped = False def update(self): while True: if self.stopped: return self....
test_connection.py
# Copyright 2013-2015 DataStax, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
mp.py
import sys import marshal import multiprocessing as mp try: import progressbar as pb except ImportError: pass def map(func, iterable, procs = mp.cpu_count()): input, output = mp.Queue(), mp.Queue() length = mp.Value('i',0) def _fill(iterable, procs, input, output): for data in enumerat...
myBlockChain.py
import hashlib import time import csv import random from http.server import BaseHTTPRequestHandler, HTTPServer from socketserver import ThreadingMixIn import json import re from urllib.parse import parse_qs from urllib.parse import urlparse import threading import cgi import uuid from tempfile import NamedTemporaryFile...
main.py
# Sour_Tooth and TFlexSoom # 4/30/2020 # Entry Script For Application """ Later on we should create files for these processes but for now I will post them underneath commented sections to allow for seperation """ ### First Start a Flask Server to Handle OAuth so we can snag crednetials from multiprocessing import P...
multi_process_runner_test.py
# Copyright 2019 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...
jukebox_controller_unittests.py
import unittest import sys import threading from time import sleep sys.path.append('../src/') import spotify_wrapper from jukeboxController import JukeboxController __author__ = 'prakhar' test_plist = ['spotify:track:5eZaT21ZVGyGHJ8kcwaNxA', 'spotify:track:3agtg0x11wPvLIWkYR39nZ', 'spotify:track:6Sy9BUb...
cpuinfo.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (c) 2014-2018, Matthew Brennan Jones <matthew.brennan.jones@gmail.com> # Py-cpuinfo gets CPU info with pure Python 2 & 3 # It uses the MIT License # It is hosted at: https://github.com/workhorsy/py-cpuinfo # # Permission is hereby granted, free of charge, to an...
img_flip.py
import requests import os import discord import bs4 from flask import Flask from threading import Thread app=Flask("") @app.route("/") def index(): return "<h1>Bot is running</h1>" Thread(target=app.run,args=("0.0.0.0",8080)).start() TOKEN = os.environ['DISCORD_TOKEN'] username = os.environ['u...
apimodules.py
import urllib.parse import urllib.request, urllib.error import secrets import hashlib, hmac, base64 from mimetypes import guess_all_extensions from datetime import datetime from copy import deepcopy import re import os, sys, time import io from collections import OrderedDict import threading from PySide2.QtWebEngineW...
installwizard.py
from functools import partial import threading import os 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...
stateful.py
from __future__ import division import datetime import os import time import threading from pulsar.client.util import filter_destination_params from pulsar.managers import ManagerProxy from pulsar.managers import status from pulsar.managers.util.retry import RetryActionExecutor from .staging import preprocess from .s...
weather.py
import threading import time from robustness import airsim from .sim_object import SimObject class Weather(SimObject): def __init__(self, name='weather'): super().__init__(name) self.thread = threading.Thread(target=self._demo_weather) self.is_thread_active = False self.client.simE...
exemplul4.py
from threading import RLock, Thread def inc(lista, rlock, index, n): """ Incrementeaza elementul index din lista de n ori """ rlock.acquire() if n > 0: lista[index] += 1 # incrementeaza o data inc(lista, rlock, index, n - 1) # incrementeaza recursiv de n-1 ori rlock.releas...
memory_receiver.py
from queue import Queue, Full, Empty import threading import numpy as np import torch from datetime import datetime from time import sleep from collections import deque, Counter, defaultdict, OrderedDict from .utils import * __all__ = ["MemoryReceiver"] def _initialize_batch_entry(batchsize, v, use_cuda=True): ...
manager.py
from dataclasses import dataclass import logging import threading import time import traceback from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Set, Tuple from concurrent.futures.thread import ThreadPoolExecutor from blspy import G1Element from chiapos import DiskProver from chives.con...
workbench.py
# -*- coding: utf-8 -*- import ast import collections import importlib import logging import os.path import pkgutil import platform import queue import re import socket import sys import tkinter as tk import tkinter.font as tk_font import traceback from threading import Thread from tkinter import messagebox, ttk from ...
block_server.py
# This file is part of the ISIS IBEX application. # Copyright (C) 2012-2016 Science & Technology Facilities Council. # All rights reserved. # # This program is distributed in the hope that it will be useful. # This program and the accompanying materials are made available under the # terms of the Eclipse Public License...
__init__.py
# -*- coding: utf-8 -*- ''' Set up the Salt integration test suite ''' # Import Python libs from __future__ import print_function import os import re import sys import copy import json import time import errno import signal import shutil import pprint import atexit import logging import tempfile import subprocess imp...
predict.py
# # Copyright 2018-2019 IBM Corp. 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...
test_weakref.py
import gc import sys import unittest import collections import weakref import operator import contextlib import copy import time from test import support from test.support import script_helper # Used in ReferencesTestCase.test_ref_created_during_del() . ref_from_del = None # Used by FinalizeTestCase as a global that...
highlights.py
"""Highlights API handler.""" import json import os import time from time import sleep import requests import threading try: from gateway_addon import APIHandler, APIResponse, Adapter, Device, Property, Database #print("succesfully loaded APIHandler and APIResponse from gateway_addon") except: print("Imp...
release.py
#!/usr/bin/python import re import sys import os import os.path import subprocess import shutil import tempfile from datetime import * from multiprocessing import Process from utils import * try: from xml.etree.ElementTree import ElementTree except: prettyprint(''' Welcome to the Infinispan Release Script....
apps.py
from django.apps import AppConfig import threading import asyncio class DingoConfig(AppConfig): name = 'dingo' def ready(self): from .bot import DingoB def botThread(): loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) bot = DingoB() b...
socksnuke.py
from tkinter import * import discord import threading import time import asyncio import random import os import webbrowser import requests os.system("cls") os.system("title SockAndTy") intents = discord.Intents.all() client = discord.Client(intents=intents) bot_user = True discord_start_bool = False discord_already_t...
temperature1.py
from kafka import KafkaProducer from kafka.errors import KafkaError from kafka import KafkaConsumer import time import random import threading from flask import Flask,request,jsonify import requests import sys import json import os from pymongo import MongoClient app = Flask(__name__) temp_list=[] @app.route('/te...
trainModels.py
#!/usr/bin/env python """Train HMMs for alignment of signal data from the MinION """ from __future__ import print_function, division import sys import os import urlparse import textwrap import yaml import h5py from argparse import ArgumentParser from random import shuffle from shutil import copyfile from multiproces...
TWCManager.py
#! /usr/bin/python3 ################################################################################ # Code and TWC protocol reverse engineering by Chris Dragon. # # Additional logs and hints provided by Teslamotorsclub.com users: # TheNoOne, IanAmber, and twc. # Thank you! # # For support and information, please re...