source
stringlengths
3
86
python
stringlengths
75
1.04M
launch_script.py
from threading import Thread, Lock import time import re import os import subprocess from subprocess import Popen as pop import json task_id = "%s" cmd = """ %s """.strip().split("\n") storage_config = json.loads(%s) log_file = "%s" callback_url = "%s" myenv = json.loads(%s) def ensure_str(s, encoding="utf-8", error...
beatheart.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/> # # Licensed under the GNU General Public License, version 3 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://jxs...
geton.py
import FSGDP import multiprocessing as mp import time # Multiprocessing: https://docs.python.org/2/library/multiprocessing.html#exchanging-objects-between-processes MY_ADRESS = 32 def get_data(data_in, clock_in, queue): print ("Receive Pins: " + str(data_in) + ", " + str(clock_in)) global MY_ADRESS Recv ...
worker.py
from contextlib import contextmanager import colorama import atexit import faulthandler import hashlib import inspect import io import json import logging import os import redis import sys import threading import time import traceback from typing import Any, Dict, List, Iterator # Ray modules from ray.autoscaler._priv...
power_monitoring.py
import random import threading import time from statistics import mean from cereal import log from common.params import Params, put_nonblocking from common.realtime import sec_since_boot from selfdrive.hardware import HARDWARE from selfdrive.swaglog import cloudlog from common.op_params import opParams CAR_VOLTAGE_LO...
bot.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import emoji import sys import time import logging import yaml from functools import wraps from os import path from pytz import timezone from telegram.ext import Updater, CommandHandler, MessageHandler, Filters from telegram.ext.dispatcher import run_async ...
plotWizard.py
#!/usr/bin/python3 import os import sys import time import json import _thread from queue import Queue, Empty from subprocess import PIPE, Popen import psutil from util import diskFree, NONCE_SIZE MAX_READ = 4 * NONCE_SIZE MB = 1024 * 1024 GB = 1024 * MB ON_POSIX = 'posix' in sys.builtin_module_names def enqueue_o...
blinkers.py
from threading import Thread from time import sleep from pi_car_library.lights import CarLight from pi_car_library.systems import CarSystem class BlinkerSystem(CarSystem): def __init__(self, light_pin): super(BlinkerSystem, self).__init__("blinkers") self.blinker = CarLight(light_pin) # Init lig...
rfc2217_device.py
#!/usr/bin/env python import logging import socket import threading import time import serial from rfc2217_redirector import Redirector logger = logging.getLogger(__name__) class RFC2217Device: def __init__(self, device_path, tcp_port): self.device_path = device_path self.tcp_port = tcp_port ...
main.py
#!/usr/bin/env python3 # http://flask.pocoo.org/ from flask import Flask # http://flask.pocoo.org/docs/1.0/api/#flask.request from flask import request # http://flask.pocoo.org/docs/1.0/tutorial/templates/ from flask import render_template from flask import redirect, Response from werkzeug.utils import secure_filen...
windows.py
from ...third_party import WebsocketServer # type: ignore from .configurations import ConfigManager from .configurations import WindowConfigManager from .diagnostics import DiagnosticsCursor from .diagnostics import DiagnosticsWalker from .diagnostics import ensure_diagnostics_panel from .logging import debug from .lo...
zoomstream.py
import csv import logging import os import psutil import pyautogui import random import schedule import signal import subprocess import threading import time import atexit from datetime import datetime, timedelta global ONGOING_MEETING global VIDEO_PANEL_IS_HIDDEN logging.basicConfig( format='%(asctime)s %(leveln...
Rat_Experiment_1_24GridCell.py
#! /usr/bin/env python3 """ Test client for the <Rat_Experiment_1> simulation environment. This simple program shows how to control a robot from Python. For real applications, you may want to rely on a full middleware, like ROS (www.ros.org). """ import sys import base64 import random import os import keras from ker...
run_predictor.py
#!/usr/bin/env python3 # # # Copyright (c) 2021 Facebook, inc. and its affiliates. All Rights Reserved # # from uimnet import utils from uimnet import algorithms from uimnet import workers from omegaconf import OmegaConf from pathlib import Path import torch import torch.distributed as dist import torch.multiprocessi...
gap.py
# -*- coding: utf-8 -*- r""" Interface to GAP Sage provides an interface to the GAP system. This system provides extensive group theory, combinatorics, etc. The GAP interface will only work if GAP is installed on your computer; this should be the case, since GAP is included with Sage. The interface offers three piece...
myplex.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from . import util from . import http from threading import Thread from xml.etree import ElementTree import time from . import exceptions from . import video from . import audio from . import photo video, audio, photo # Hides warning message class Pin...
testHIBEChainTPS.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from chain.const import CONFIG, IP_CONFIG from chain.hibechain import HIBEChain from chain.gethnode import GethNode from chain.iplist import IPList from chain.conf import load_config_file from typing import Optional from datetime import datetime import threading import ti...
test_rate_mgr_integration.py
import boto3 import statistics import time import unittest from botocore.exceptions import ClientError, BotoCoreError from multiprocessing import Lock from apiqueue import ApiQueue from threading import Thread # noinspection PyInterpreter class MyTestCase(unittest.TestCase): """ Tests require AWS authenti...
camelot_input_multiplexer.py
import debugpy try: from camelot_error_manager import CamelotErrorManager from camelot_error import CamelotError from camelot_IO_communication import CamelotIOCommunication import shared_variables except (ModuleNotFoundError, ImportError): from .camelot_error_manager import CamelotErrorManager f...
worker_keep_alive_test.py
# -*- coding: utf-8 -*- # # Copyright 2016 VNG Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
kd_parallel.py
# Copyright Anne M. Archibald 2008 # Released under the scipy license import sys import numpy as np from heapq import heappush, heappop import scipy.sparse #Jay's additions import multiprocessing as mp import ctypes cores = mp.cpu_count() * 2 #This is just on my macbook, not times 2 in production __all__ = ['minkows...
base.py
# coding: utf-8 import threading import unittest import time import datetime from beaker._compat import u_ from beaker.cache import Cache from beaker.middleware import SessionMiddleware, CacheMiddleware from webtest import TestApp class CacheManagerBaseTests(unittest.TestCase): SUPPORTS_EXPIRATION = True C...
vehicle.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jun 25 10:44:24 2017 @author: wroscoe """ import time import numpy as np import logging from threading import Thread from .memory import Memory import traceback logger = logging.getLogger(__name__) class PartProfiler: def __init__(self): ...
UPS_Main.py
# ©2018 The Arizona Board of Regents for and on behalf of Arizona State University and the Laboratory for Energy And Power Solutions, All Rights Reserved. # # Universal Power System Controller # USAID Middle East Water Security Initiative # # Developed by: Nathan Webster # Primary Investigator: Nathan Johnson # # Versi...
test_memory_leak.py
""" Variety of test cases ensuring that ddtrace does not leak memory. """ import gc import os from threading import Thread from typing import TYPE_CHECKING from weakref import WeakValueDictionary import pytest from ddtrace import Tracer if TYPE_CHECKING: from ddtrace.span import Span @pytest.fixture def trace...
main.py
import os from gtts import gTTS from datetime import datetime import playsound import threading def speakTime(text): tts = gTTS(text=text, lang='en-gb') filename = "time.mp3" tts.save(filename) playsound.playsound(filename) def putTimeTogether(useTimePeriod): currentTime = '' t...
test_content.py
from __future__ import print_function import os import re import sys import json import time import argparse import threading import subprocess import traceback from time import sleep import datetime from distutils.version import LooseVersion import pytz from google.cloud import storage from google.api_core.exception...
compatibility-suite.py
import os import sys import threading from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.common.exceptions import TimeoutException from selenium.webdriver.support import expected_conditions as EC import time import servirtium...
backupManager.py
#!/usr/local/CyberCP/bin/python import os import os.path import sys import django sys.path.append('/usr/local/CyberCP') os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings") django.setup() import json from plogical.acl import ACLManager import plogical.CyberCPLogFileWriter as logging from websiteFunctions...
gnmi-cli.py
#!/usr/bin/env python2 # Copyright 2018-present Open Networking Foundation. # # 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 requir...
focus-last.py
#!/usr/bin/env python3 import os import sys import socket import selectors import threading from argparse import ArgumentParser import i3ipc SOCKET_FILE = '/tmp/i3_focus_last' MAX_WIN_HISTORY = 15 UPDATE_DELAY = 0.5 # def createDaemon(): # try: # pid = os.fork() # # if pid > 0: # os._exit(0) # #...
run.py
import OnlineHeart import Silver import Tasks import connect from rafflehandler import Rafflehandler import asyncio import printer from statistics import Statistics from bilibili import bilibili from configloader import ConfigLoader import threading import os import online_net import bili_console from bilitimer import ...
update.py
from threading import Thread from time import sleep import schedule from FootGramBot import FGM, COMPETITIONS, dp from FootGramBot.modules.helpers.database import Match, Live, Sub def update_matches(): for comp in COMPETITIONS: _matches = FGM.matches(comp) MATCH_DATA = [] if 'matches' in...
IntegrationTests.py
from __future__ import absolute_import import logging import os import multiprocessing import sys import time import unittest import threading import platform import flask import requests import percy from selenium import webdriver from selenium.webdriver.chrome.options import Options class IntegrationTests(unittes...
action_server.py
#!/usr/bin/env python # coding: utf-8 import threading import rospy import traceback from multiprocessing import Queue from actionlib import ActionServer from actionlib.action_server import ServerGoalHandle class EnhancedActionServer(object): def __init__(self, name, actionMsg, execute_cb=None, auto_start=True,...
qt.py
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright 2013-2020 pyMOR developers and contributors. All rights reserved. # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) """ This module provides a few methods and classes for visualizing data associated to grids. We us...
PyShell.py
#! /usr/bin/python3.2 import getopt import os import os.path import re import socket import subprocess import sys import threading import time import tokenize import traceback import types import io import linecache from code import InteractiveInterpreter try: from tkinter import * except ImportError: print(...
s3.py
""" Object Store plugin for the Amazon Simple Storage Service (S3) """ import logging import multiprocessing import os import shutil import subprocess import threading import time from datetime import datetime try: # Imports are done this way to allow objectstore code to be used outside of Galaxy. import boto ...
xla_client_test.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
test_sanity_sample.py
""" Copyright (c) 2019-2020 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
client.py
import socket,threading from tkinter import * import tkinter.scrolledtext from tkinter import simpledialog HOST = "127.0.0.1" PORT = 9999 class Client_GUI: def __init__(self,host,port): self.sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM) self.sock.connect((host,port)) ...
test_unix_events.py
"""Tests for unix_events.py.""" import collections import contextlib import errno import io import os import pathlib import signal import socket import stat import sys import tempfile import threading import unittest from unittest import mock from test import support if sys.platform == 'win32': raise unittest.Ski...
session_test.py
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
rbts_maptablesServer.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...
tbui.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import random import numpy as np import backend.twixt as twixt import util.pmeter as pmeter import constants as ct import settings as st import layout as lt import files as fi import plot as pt import heatmap as hm import uiboard from tkinter import ttk import PySimple...
test_forward.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...
cut_faces.py
import argparse import os import random import string import sys import time from multiprocessing import Process, Value from pathlib import Path import face_recognition from PIL import Image, ExifTags parser = argparse.ArgumentParser(description="Cuts all the faces on images and saves them in output_dir") parser.add_...
executors.py
import multiprocessing import os import signal import subprocess import sys import threading import warnings from concurrent.futures import ThreadPoolExecutor from concurrent.futures import TimeoutError as FutureTimeout from functools import wraps from typing import TYPE_CHECKING, Any, Callable, List, Union import pre...
main.py
import pdb import time import os import subprocess import re import random import json import numpy as np import glob from tensorboard.backend.event_processing.event_accumulator import EventAccumulator import socket import argparse import threading import _thread import signal from datetime import datetime import csv ...
test_execute.py
# coding: utf-8 from contextlib import contextmanager import re import threading import weakref import sqlalchemy as tsa from sqlalchemy import bindparam from sqlalchemy import create_engine from sqlalchemy import create_mock_engine from sqlalchemy import event from sqlalchemy import func from sqlalchemy import inspe...
py7zr.py
#!/usr/bin/python -u # # p7zr library # # Copyright (c) 2019-2021 Hiroshi Miura <miurahr@linux.com> # Copyright (c) 2004-2015 by Joachim Bauch, mail@joachim-bauch.de # 7-Zip Copyright (C) 1999-2010 Igor Pavlov # LZMA SDK Copyright (C) 1999-2010 Igor Pavlov # # This library is free software; you can redistribute it and/...
repository.py
import atexit import os import re import subprocess import tempfile import threading import time from contextlib import contextmanager from pathlib import Path from typing import Callable, Dict, Iterator, List, Optional, Tuple, Union from tqdm.auto import tqdm from huggingface_hub.constants import REPO_TYPES_URL_PREF...
batch_ops_test.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
test_capture.py
import contextlib import io import os import subprocess import sys import textwrap from io import UnsupportedOperation from typing import BinaryIO from typing import Generator import pytest from _pytest import capture from _pytest.capture import _get_multicapture from _pytest.capture import CaptureManager from _pytest...
main.py
""" RenderPipeline Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com> 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...
hc_zx1.py
import requests def lord(code): for i in range(0, 200): if i < 10: i = '0' + str(i) url = 'http://reg.hongchenzx.com/reg.php' data = { 'select': "3", 'username': "zhiaiwoq{}".format(i), 'passwd': "741741", 'repeatpasswd': "741741...
client2.py
import lib.MyUtils as MyUtils import socket import threading cpu = "3100" # 3.1 GHz ram = "2048" # 2 GB def listen_handler(conn, address): raw_data = conn.recv(1024) print("New message from ", address, " : ", raw_data) conn.send("Received".encode()) def my_listener(socket_instance): print("Starte...
django.py
import json import logging import os import threading from django.http import HttpResponse, HttpRequest from . import page from ..session import Session from .httpbased import HttpContext, HttpHandler, run_event_loop from .remote_access import start_remote_access_service from .page import make_applications from .util...
model.py
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import init import random import numpy as np import dgl.multiprocessing as mp from dgl.multiprocessing import Queue def init_emb2pos_index(walk_length, window_size, batch_size): ''' select embedding of positive nodes from a batch of ...
python_instance.py
#!/usr/bin/env python # # 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 # "...
test_integration.py
import sys if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest import time from tempfile import NamedTemporaryFile from multiprocessing import Process import json from beaver.dispatcher import tail from beaver.utils import parse_args class IntegrationTests(unittest.TestCase): ...
state.py
# -*- coding: utf-8 -*- """rackio/workers/state.py This module implements State Machine Worker. """ import heapq import logging import time from collections import deque from threading import Thread from .worker import BaseWorker from ..utils import log_detailed class MachineScheduler(): def __init__(self): ...
tcpserver.py
#!/usr/bin/env python3 import errno import os import signal import socket import struct import sys import threading import time from optparse import OptionParser from fprime.constants import DATA_ENCODING try: import socketserver except ImportError: import SocketServer as socketserver __version__ = 0.1 __d...
experiment.py
from multiprocessing import Process, Queue, Event import subprocess # to call python3 code import signal, time, sys, os import win32api as win from time import sleep import capture_bci # import capture_pupil import display_stimuli import graph_matplotlib event = Event() def stop(stimuli, bci, graph, bci_queue, pupil...
network.py
""" Defines network nodes used within core. """ import logging import threading import time from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Type import netaddr from core import utils from core.constants import EBTABLES_BIN, TC_BIN from core.emulator.data import LinkData, NodeData from core.emulator...
app.py
import base64 import datetime import os import sys import threading import time import multiprocessing as mp import requests import traceback from random import randint from selenium.webdriver.support.ui import WebDriverWait from filelock import FileLock, Timeout from flask import Flask, request, make_response, jsonif...
test_engine.py
import time from threading import active_count, Thread from multiprocessing import Process import pytest from polog.core.engine.engine import Engine from polog.core.stores.settings.settings_store import SettingsStore from polog import config, file_writer, log from polog.core.log_item import LogItem def test_singlet...
test_request.py
import asyncio import threading from urllib import request from aiohttp.test_utils import unittest_run_loop import aiohttp_jinja2 from ddtrace import config from ddtrace.contrib.aiohttp.middlewares import trace_app from ddtrace.contrib.aiohttp.patch import patch from ddtrace.contrib.aiohttp.patch import unpatch from ...
excepthook_example.py
import sys import logging import threading from threaded_exception import RunsInAThread logger = logging.getLogger(__name__) logging.basicConfig(filename='example.log', filemode='w', level=logging.DEBUG) def handle_unhandled_exception(exc_type, exc_value, exc_traceback, thread_identifier=''): """Handler for unha...
test_subprocess.py
import unittest from unittest import mock from test import support import subprocess import sys import signal import io import itertools import os import errno import tempfile import time import traceback import selectors import sysconfig import select import shutil import threading import gc import textwrap from test....
multiprocessing_logging.py
# Obtained from: https://github.com/jruere/multiprocessing-logging from __future__ import absolute_import, division, unicode_literals import logging import multiprocessing import sys import threading import traceback try: import queue except ImportError: import Queue as queue # Python 2. __version__ = '0...
hypothesis_test.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import copy import time from functools import partial, reduce from future.utils import viewitems, viewkeys from hypothesis import assume, given, settings, HealthCheck import hypothesis.strate...
core.py
import warnings import queue import threading # import multiprocessing import collections import numpy as np import scipy.signal from . import utils import json from .generators import GeneratorStop from .distributors import QDistributor class Device: """Abstract class that provides a consistent framework for dif...
dataloader.py
import os import sys import time from multiprocessing import Queue as pQueue from threading import Thread import cv2 import numpy as np import torch import torch.multiprocessing as mp import torchvision.transforms as transforms from PIL import Image from torch.autograd import Variable from SPPE.src.utils.eval import ...
get_input.py
from win32.win32api import GetAsyncKeyState import time from threading import Thread class Recorder: def __init__(self): self.pressed_keys = {} self.stop = False self.keycode2description = { 1:"Left mouse button", 2:"Right mouse button", 3:"Control-brea...
multi_process_runner.py
# Lint as: python3 # 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 ...
axibo.py
import requests import json import websocket from threading import Thread import time from PIL import Image import io from axibo.devices import pan from axibo.devices import tilt from axibo.devices import slide from axibo.devices import camera from axibo.devices import focus class AxiboWebSocketHardwareStream: d...
MatlabTargetFinder.py
# The Leginon software is Copyright 2004 # The Scripps Research Institute, La Jolla, CA # For terms of the license agreement # see http://ami.scripps.edu/software/leginon-license # import threading import wx import wx.lib.filebrowsebutton as filebrowse import leginon.gui.wx.Events import leginon.gui.wx.TargetPanel im...
Detector.py
from ..Gadget import Gadget from ..environment import macro from .. import utils import numpy as np import time import threading class Detector(Gadget): """ Base class representing any device which can be read out to produce recordable data. """ def __init__(self, *args, **kwargs): super(...
test_mlt_csl_ms.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 sys.path.append("....
basic_gpu_test.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
server.py
import socket import threading #Creating an INET , STREAMing socket server=socket.socket(socket.AF_INET,socket.SOCK_STREAM) IP=socket.gethostbyname(socket.gethostname()) PORT=1234 ADDR=(IP,PORT) server.bind(ADDR) MSG_SIZE=32 FORMAT='utf-8' clients=[] def handleClient(conn,username): print(f"[NEW CONNECTION] {user...
Displayotron.py
import threading import time import dot3k.lcd as lcd import dot3k.backlight as bl import dot3k.joystick as j # Raspberry Pi - Displayotron 3000 class Displayotron: rail = None def __init__(self, rail, config=None): lcd.clear() bl.off() Displayotron.rail = rail self.config = co...
ws.py
"""WebSocket IO definition.""" import json import asyncio import websockets import numpy as np from threading import Thread, Event from base64 import b64decode from io import BytesIO from PIL import Image from .io import IO class WsIO(IO): """WebSocket IO implementation.""" ws = None def __init__(sel...
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 ...
api_image_test.py
import contextlib import json import shutil import socket import tarfile import tempfile import threading import pytest import six from six.moves import BaseHTTPServer from six.moves import socketserver import docker from ..helpers import requires_api_version, requires_experimental from .base import BaseAPIIntegrat...
GUITest.py
#!./env/bin/python import glib, gobject import pygtk pygtk.require('2.0') import gtk import gtk.glade from GhoulUI import GhoulUI import threading gobject.threads_init() gLoop = threading.Thread(target=gtk.main) gLoop.start() gui = GhoulUI()
thread_utils.py
import queue from functools import wraps from threading import Thread def only_once(f): q = queue.Queue() @wraps(f) def worker(): while True: args, kwargs = q.get() f(*args, **kwargs) q.task_done() @wraps(f) def wrapped(*args, **kwargs): q.put(...
default.py
# Copyright 2018 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
qt.py
#!/usr/bin/env python # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without...
update_hosts.py
import datetime import json import queue import sys import threading import pymongo import requests requests.packages.urllib3.disable_warnings() # Database configuration MONGO_CLIENT = pymongo.MongoClient('127.0.0.1', 5051) CB_BOT_DB = MONGO_CLIENT.cb_bot class CB_BOT(): def __init__(self, queue_list, total_ho...
nikki_debug.py
# -*- coding: utf-8 -*- """ Created on Thu Jun 11 11:46:35 2020 @author: Nikki """ import numpy as np import tensorflow as tf #from tensorflow import keras from core.config import cfg from core import utils import cv2 from PIL import Image import sys from threading import Thread from queue import Queue import time ...
__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals import base64 import copy import contextlib import enum import functools import io import json import logging import os import re import threading import time from collections import defaultdict, namedtuple from typi...
test_event_log.py
import os import sys import tempfile import time import traceback import pytest import sqlalchemy from dagster.core.errors import DagsterEventLogInvalidForRun from dagster.core.storage.event_log import ( ConsolidatedSqliteEventLogStorage, InMemoryEventLogStorage, SqlEventLogStorageMetadata, SqlEventLog...
load_database.py
import argparse import concurrent.futures import json import logging import os import queue import signal import sys import threading import traceback from pycraft import __version__ as pycraft_version from pycraft import Chunk from pycraft import Database from pycraft import Player from pycraft import Region from pyc...
common_thread.py
# Copyright 2017 theloop, 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 writing...
test_main.py
# -*- coding: utf-8 -*- import json import threading import time from http.server import HTTPServer, BaseHTTPRequestHandler from datapackage_pipelines.manager import execute_pipeline, run_pipelines from datapackage_pipelines.specs.specs import pipelines from datapackage_pipelines.utilities.execution_id import gen_exec...
editor_test.py
""" Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. SPDX-License-Identifier: Apache-2.0 OR MIT This file provides editor testing functionality to easily write automated editor tests for O3DE. For using these ut...
RavePy.py
import numpy as np import threading import time import math import pyaudio import matplotlib.pyplot as plt class RavePy: def __init__(self): self.channels = 1 self.rate = 44100 self.framesPerBuffer = 2048 self.inputDeviceIndex = 0 self.running = False sel...
multigpu.py
# run as: python3 multigpu.py 0 and python3 multigpu.py 1 where 0 and 1 are GPU ids import os import re import sys import time import uuid import clip import torch import queue import shutil import curses import tarfile import hashlib import requests import argparse import threading import subprocess import pandas as...