source
stringlengths
3
86
python
stringlengths
75
1.04M
test_e2e.py
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
n1ql_upgrade.py
import threading from .tuq import QueryTests from upgrade.newupgradebasetest import NewUpgradeBaseTest from .flex_index_phase1 import FlexIndexTests from remote.remote_util import RemoteMachineShellConnection from membase.api.rest_client import RestConnection from couchbase.cluster import Cluster from couchbase.cluster...
troubleshooter_unpacker.py
import os import shutil import re import threading import zipfile import time ZIP_SIGNATURE = b"PK\x03\x04\x14\x00\x00" PNG_SIGNATURE = b"\x89\x50\x4E\x47" FBX_SIGNATURE = b"\x4B\x61\x79\x64\x61\x72\x61\x20\x46\x42\x58" lock = threading.Lock() thread_limiter = threading.Semaphore(50) def main(): file_list = [] ...
asyn_mar_server_emulation.py
import socket, time, sys, struct, os import cv2, pickle, threading import numpy as np from flask import request, url_for from flask_api import FlaskAPI, status, exceptions from os import listdir from os.path import isfile, join from queue import Queue HOST = '0.0.0.0' USER_PORT = 9009 REST_PORT = USER_PORT + 1000 SI...
merge_tiles.py
# coding=utf-8 import base64 import json import math import os import queue import random import threading import urllib.parse from itertools import chain, product from urllib.parse import urlencode from PIL import Image from rosreestr2coord.utils import make_request, TimeoutException from .logger import logger Im...
test_rate.py
# Copyright 2019 Open Source Robotics Foundation, 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...
mavros_offboard_posctl_test.py
#!/usr/bin/env python2 #*************************************************************************** # # Copyright (c) 2015 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: #...
__init__.py
try: import cPickle as pickle except ImportError: import pickle import json import mmap import multiprocessing import os import sys import time import traceback import dill from multicore import exceptions PY3 = sys.version_info[0] == 3 default_app_config = "multicore.app.MulticoreAppConfig" # Workers is ...
scratchpad.py
#!/usr/bin/env python3 import threading import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from nwg_panel.tools import check_key, get_icon_name, update_image class Scratchpad(Gtk.Box): def __init__(self, i3, tree, settings, icons_path=""): Gtk.Box.__init__(self, orientation=Gtk.Or...
test_msgque_pubsub.py
# -*- coding: utf-8 -*- """Tests for msgque module.""" import json import threading from time import sleep import trias.msgque.pubsub as pubsub key_a = 'key.a' def test_basic(): data = { 'pub': {'a': 5}, 'sub': None, } def pub(): channel = pubsub.get_channel(pubsub.get_connect...
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...
test_auto_scheduler_search_policy.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...
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...
unlocc.py
from gui import GUI from keybrain import KeyBrain from PIL import Image, ImageDraw import pystray import sys import json import threading class Unlocc: enabled = True keybrain = None tray = pystray.Icon('Unlocc') filepath = 'config.ini' confGUI = None image = None menu = None masterK...
thread_server.py
import socket import sys import traceback from threading import Thread def do_some_stuffs_with_input(input_string): """ This is where all the processing happens. Let's just read the string backwards """ print("Processing that nasty input!") return "Pong!" def client_thread(conn, ip, port, MA...
master.py
#!/usr/bin/python3 import time import sys from datetime import datetime import csv import threading from multiprocessing import Process import configparser import fileinput import RPi.GPIO as GPIO import numpy as np import os import board import busio import adafruit_ads1x15.ads1015 as ADS import adafruit_ads1x15.ad...
api.py
import os import json import time import threading import queue # --> NXT Imports import nxt.locator from nxt.motor import * from nxt.sensor.generic import Ultrasonic from nxt.sensor.__init__ import Port as SPort class Controller: def __init__(self, *args): self.queues = list(args) def stop(self): for q in s...
runner.py
#!/usr/bin/env python3 # Copyright 2010 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """This is the Emscripten test runner. To run ...
browser.py
#!/usr/bin/env python # vim: set sw=4 et: import logging import json import urllib.request import itertools import websocket import time import threading import subprocess import signal import tempfile import os import socket from umbra.behaviors import Behavior class BrowserPool: logger = logging.getLogger(__mod...
__main__.py
import threading import sys import os import os.path import platform import subprocess import json import time import netifaces import click from howmanypeoplearearound.oui import load_dictionary, download_oui from howmanypeoplearearound.analysis import analyze_file from howmanypeoplearearound.colors import * if os....
admin.py
import os import threading from django.contrib import admin from CCTVMS import settings from surveillance.models import Camera, Violence, Person from surveillance.face_recognizer import save_face_from_video_path # Register your models here. class InvolvedPersonInline(admin.TabularInline): model = Violence.invo...
subproc_vec_env.py
import multiprocessing as mp from collections import OrderedDict from typing import Any, Callable, List, Optional, Sequence, Tuple, Type, Union from mod_gym import gym import numpy as np from mod_stable_baselines3.stable_baselines3.common.vec_env.base_vec_env import ( CloudpickleWrapper, VecEnv, VecEnvInd...
redirect_server.py
import itertools import uuid from urllib.parse import urljoin from http.server import HTTPServer, BaseHTTPRequestHandler from threading import Thread class RedirectServer(HTTPServer): """Server for testing the RedirectResolver""" def __init__(self): super().__init__(('127.0.0.1', 8080), _RedirectRequ...
test_http.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import multiprocessing import socket import time import uuid import pytest import thriftpy2 thriftpy2.install_import_hook() # noqa from thriftpy2.http import make_server, make_client, client_context, THttpHeaderFactory # noqa from thriftpy...
stepwise_newton_cg.py
# The following is a derived work of the # optimize.py module by Travis E. Oliphant # https://github.com/scipy/scipy/blob/master/scipy/optimize/optimize.py # which is part of the scipy package import _queue import threading import time from collections import namedtuple from dataclasses import dataclass from functools ...
app.py
############################################################################# # Copyright (c) 2018, Voila Contributors # # Copyright (c) 2018, QuantStack # # # # Distri...
spawn_action_process.py
import multiprocessing from presqt.api_v1.utilities.multiprocess.watchdog import process_watchdog def spawn_action_process(self, method_to_call): """ Spawn a separate process on the Python kernel to run independently of the main request thread. This also starts a watch dog to supervise the spawned proces...
main.py
# Some needed libraries import sys import pprint import time # The spotify wrapper to request the API import spotipy.util as util import spotipy.oauth2 as oauth2 import spotipy # The config for the Spotfiy API and for the DB import config # The functions necessary to read the RFID tag from pirc522 import RFID import...
test_concurrent_futures.py
import test.support # Skip tests if _multiprocessing wasn't built. test.support.import_module('_multiprocessing') # Skip tests if sem_open implementation is broken. test.support.import_module('multiprocessing.synchronize') from test.support.script_helper import assert_python_ok import contextlib import itertools imp...
addon.py
#------------------------------------------------------------------------------- # Copyright (C) 2017 Carlos Guzman (cguZZman) carlosguzmang@protonmail.com # # This file is part of Cloud Drive Common Module for Kodi # # Cloud Drive Common Module for Kodi is free software: you can redistribute it and/or modify # it un...
chatbot.py
from tkinter import * from tkinter import ttk import time import tkinter.messagebox import pyttsx3 import threading from rihanna import rihanna saved_username = ["You"] window_size = "400x400" class ChatInterface(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.master =...
test_closing.py
from fixtures import * # noqa: F401,F403 from flaky import flaky from lightning import RpcError from utils import only_one, sync_blockheight, wait_for, DEVELOPER, TIMEOUT, VALGRIND, SLOW_MACHINE, COMPAT import os import queue import pytest import re import threading import unittest @unittest.skipIf(not DEVELOPER, "...
test_dataloader.py
# Owner(s): ["module: dataloader"] import math import sys import errno import multiprocessing import os import ctypes import faulthandler import torch import gc import time import signal import unittest import itertools import warnings import tempfile from torch import multiprocessing as mp from torch.utils.data impor...
release.py
#!/usr/bin/python import re import sys import os import subprocess import shutil from markdown2 import * from datetime import * from multiprocessing import Process from utils import * from jira import * from docbook import * try: from xml.etree.ElementTree import ElementTree except: prettyprint(''' Welcome...
test_util.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
arpy.py
#!/usr/bin/env python #The MIT License (MIT) #Copyright (c) 2015 Ivan Viljoen #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 ...
__init__.py
import json import os import threading from sqlalchemy import func from ...db import Db from ...db.file_system_resource import FileSystemResource from ...db.file_system_resource_event import FileSystemResourceEvent from ...socket.inotify_socket import InotifySocket from .. import Component class FileSystemEventCom...
__init__.py
# -*- coding: utf-8 -*- # Three possible modes: # 'cli': running from "wandb" command # 'run': we're a script launched by "wandb run" # 'dryrun': we're a script not launched by "wandb run" from __future__ import absolute_import, print_function __author__ = """Chris Van Pelt""" __email__ = 'vanpelt@wandb....
session_debug_testlib.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...
_lib.py
# Author: Lisandro Dalcin # Contact: dalcinl@gmail.com """Management of MPI worker processes.""" # pylint: disable=missing-docstring import os import sys import time import atexit import weakref import warnings import itertools import threading import collections from .. import MPI # --- def serialized(function)...
mapping.py
from flask import Blueprint, request, render_template, flash, redirect, url_for from flask import current_app as app from flask import request from flask import Flask import app.functions.calculate as cal import app.functions.functions as fun import time import threading import jinja2 from requests.models import HTTPEr...
test_fx.py
import builtins import contextlib import copy import functools import inspect import math import numbers import operator import os import pickle import sys import torch import traceback import warnings import unittest from math import sqrt from torch.multiprocessing import Process from torch.testing import FileCheck fr...
tasks.py
import time import redis from polls.models import RunningInsTime, RunningInsSentinel, RunningInsStandalone, RunningInsCluster, RealTimeQps from django.utils import timezone from polls.scheduled import RedisScheduled import threading import logging # 日志格式 logger = logging.getLogger("redis.monitor") def get_redis_stat...
consumer.py
# -*- coding: utf-8 -*- # Copyright 2014-2021 CERN # # 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...
BSSIDLocationCache.py
import os, sqlite3, threading, time, re, pycurl, logging from io import BytesIO from WLANderlust import config logger = logging.getLogger(__name__) def bssid2int(bssid): if not bssid: return None return int(bssid.translate(str.maketrans('', '', ":.-, ")), 16) #ToDo test if result is same as translate metho...
postback.py
# Module for Line SDK from linebot.models import ( TextSendMessage, StickerSendMessage, TemplateSendMessage ) # Module for create multidict from multidict import CIMultiDict # Module for Database related stuff from controllers.db import * # Module for multi-threading from threading import Thread # Module fo...
car.py
import logging import threading import time from config import CarStatus, Config from plugins import ( Camera, Controller, InfraRedSensor, Motor, ObstacleAvoid, Track, UltrasoundSensor, ) logger = logging.getLogger(__name__) class Car: def __init__(self): self._status = [ ...
test.py
import logging from threading import Thread from multiprocessing import Process import requests import urllib.request logging.basicConfig(format="%(threadName)-10s - %(message)s", level=logging.DEBUG) def thread_get(delay, url): s = requests.Session() logging.debug(f"Making request with {delay} seconds delay...
3.12.py
import os import time import pickle import threading from tkinter import * from tkinter import filedialog from tkinter import messagebox from tkinter import ttk import pygame PROGRAM_NAME = ' Explosion Drum Machine ' MAX_NUMBER_OF_PATTERNS = 10 MAX_NUMBER_OF_DRUM_SAMPLES = 5 MAX_NUMBER_OF_UNITS = 5 MAX_BPU = 5 INITIA...
my_main.py
from my_serial import MySerial from my_mq import MyActiveMq from my_mysql import MyMysql, m_serial import stomp import time import threading queue_SensorData = 'SensorData' #传感器消息队列名称 queue_host = '10.0.6.161' queue_port = 61613 queue_username = 'admin' queue_password = 'admin' # serial_com = 'com8' ...
env_stock_papertrading.py
import datetime import threading from finrl.finrl_meta.data_processors.processor_alpaca import AlpacaProcessor import alpaca_trade_api as tradeapi import time import pandas as pd import numpy as np import torch import gym class AlpacaPaperTrading(): def __init__(self,ticker_list, time_interval, drl_lib, agent, cw...
tcpflood.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*-s import random import socket import threading import time print(''' \033[1;32m ███  ███\033[39m  \033[1;32m ████  ████\033[39m      \033[1;32m ██ ████ ██  ██████\033[39m  \033[1;32m ██  ██  ██      ██ ██ \033[39m ┌┬┐┌─┐┌─┐ \...
queue_priority.py
import functools import queue import threading @functools.total_ordering class Job: def __init__ (self, priority, description): self.priority = priority self.description = description print('New job: ',descritption) return def __eq__(self,other): try: retur...
test_qt_binder.py
from __future__ import print_function import threading import time def test_bind_qt(): from event_signal import signaler, bind_qt, unbind_qt from qtpy import QtWidgets class MyData(object): def __init__(self, name='hello'): self._name = name def get_name(self): r...
client.py
from typing import Union from kubesys.common import getLastIndex,dictToJsonString,jsonStringToBytes,getParams,formatURL from kubesys.http_request import createRequest from kubesys.analyzer import KubernetesAnalyzer import requests import json from kubesys.common import jsonBytesToDict import threading from kubesys.watc...
ps_officer.py
__all__ = ['PSOfficer'] from raylink.data.shm import ShM from raylink.constants import PS_SAFE_RATIO, PS_CACHE_SIZE import raylink import threading from raylink.util.monitor import TM, ProcMem class PSOfficer(raylink.OutlineNode): TYPE = 'ps_officer' def setup(self): """Setup this ps officer.""" ...
main.py
#!/usr/bin/env python3 import RPi.GPIO as GPIO import can import time import os import queue from threading import Thread import logging import os import datetime logger = logging.getLogger(__name__) output_dir = os.path.dirname(os.path.realpath(__file__)) filename = datetime.datetime.now().strftime("%Y%m%d_%H%M%S") +...
walking.py
#!/usr/bin/env python3 import json from threading import Thread import numpy as np import rospy from op3_walking_module_msgs.msg import WalkingParam from op3_walking_module_msgs.srv import GetWalkingParam from robotis_controller_msgs.msg import StatusMsg from sensor_msgs.msg import Imu from std_msgs.msg import String ...
extractor.py
import uuid from threading import Thread from crawler4py.extractor.analysis import process from crawler4py.log import Logger from crawler4py.crawler import Crawler from crawler4py.util.commonutil import get_plugin_path from crawler4py.util.rabbitmqutil import connect, get_data, send_data, get_queue from crawler4py.uti...
run_script.py
try: from Tkinter import * import Tkinter as tk import ttk import tkFileDialog import tkMessageBox from tkFileDialog import askdirectory except: from tkinter import * import tkinter as tk import tkinter.ttk as ttk import tkinter.messagebox as tkMessageBox from tkinter.filedia...
controller.py
# Oregano - lightweight Bitcoin client # Copyright (C) 2019 Axel Gembe <derago@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...
log.py
#!/usr/bin/env python """ Copyright (c) 2014-2017 Miroslav Stampar (@stamparm) See the file 'LICENSE' for copying permission """ import os import signal import socket import SocketServer import sys import threading import time import traceback from core.common import check_whitelisted from core.common import check_s...
test_pool.py
import threading import time from sqlalchemy import pool, select, event import sqlalchemy as tsa from sqlalchemy import testing from sqlalchemy.testing.util import gc_collect, lazy_gc from sqlalchemy.testing import eq_, assert_raises, is_not_, is_ from sqlalchemy.testing.engines import testing_engine from sqlalchemy.te...
stream_test.py
#!/usr/bin/env python import select import sys import threading import time import traceback import unittest import rosbag import rospy import rostest import sensor_msgs.msg import v4l2capture PKG = 'virtual_cam' NAME = 'stream_test' class TestStream(unittest.TestCase): def setUp(self): super(Test...
test_init_transition.py
from radical.entk.utils.init_transition import transition import pika from radical.entk import Task, Stage, Pipeline import radical.utils as ru import os from threading import Thread import json from radical.entk import states MLAB = 'mongodb://entk:entk123@ds143511.mlab.com:43511/entk_0_7_4_release' def func(obj, ob...
monitor.py
import functools import logging import os import subprocess import threading from dataclasses import dataclass from typing import TYPE_CHECKING, Callable, List from dvc.repo.live import create_summary from dvc.stage.decorators import relock_repo from dvc.stage.exceptions import StageCmdFailedError if TYPE_CHECKING: ...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
test_stub.py
''' Create an unified test_stub to share test operations @author: Youyk @author: Liu Lei ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_state as test_state import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.operations.resource_operations as res_ops import zstackwoodpe...
04_SCC.py
''' Programming assignment 4 Kosaraju's SCC algorithm Find the sizes of the 5 largest SCCs ''' import sys import threading def build_graph(filename): g, g_rev = [], [] with open(filename) as f: for line in f: u, v = map(int, line.split()) m = max(u, v) while len(g...
lambda_executors.py
import os import re import json import time import logging import threading import subprocess from multiprocessing import Process, Queue try: from shlex import quote as cmd_quote except ImportError: # for Python 2.7 from pipes import quote as cmd_quote from localstack import config from localstack.utils.aws...
sanitylib.py
#!/usr/bin/env python3 # vim: set syntax=python ts=4 : # # Copyright (c) 2018 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import contextlib import string import mmap import sys import re import subprocess import select import shutil import shlex import signal import threading import concurrent.fu...
run.py
from behave.__main__ import main as behave_main import threading import sys from random import randint from time import sleep from glob import glob import os def dostuff(path, flags): slept = randint(10, 150) / 1000 sleep(slept) print('slept {} for thread with path {} and flags {}'.format(slept, path, fla...
server.py
import os import sys import atexit from subprocess import call import subprocess from multiprocessing import Process import zmq import time from time import gmtime, strftime from datetime import datetime import inspect import math import collections import pickle from daemon import Daemon import utils from utils i...
connection.py
# -*- coding: utf-8 -*- # Copyright: (c) 2019, Jordan Borean (@jborean93) <jborean93@gmail.com> # MIT License (see LICENSE or https://opensource.org/licenses/MIT) from __future__ import division import binascii import hashlib import hmac import logging import math import os import struct import time import threading ...
server.py
import select import socket import requests import json import time import os from http.server import BaseHTTPRequestHandler, HTTPServer import socketserver import re import threading import signal import sys import random def writefile(fi,content): f=open(fi,'w') f.write(content) f.close() def readfile(f...
wash.py
import sys import datetime import logging import logging.config import pytz from threading import Thread from itertools import chain import json from time import sleep import traceback import arrow import pymongo from pymongo.errors import ServerSelectionTimeoutError import tradingtime as tt import numpy as np import ...
Parallel Processing-171.py
## 2. Mutability ## class Counter(): def __init__(self): self.count = 0 def increment(self): self.count += 1 def get_count(self): return self.count def count_up_100000(counter): for i in range(100000): counter.increment() class Counter(): def __init__(self): ...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including witho...
mzphp.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os, socket, subprocess, threading, json, webbrowser, time, datetime from urllib.request import urlopen from tkinter import * from PIL import Image, ImageTk # Para ativar o registro no mzphp.log, substituir "log(" por "log(" #|--- VARIÁVEIS ---> # server hostname=...
conftest.py
import asyncio import json import os import threading import time import typing import pytest import trustme from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.serialization import ( BestAvailableEncryption, Encoding, PrivateFormat, load_pem_private_key, ) from...
test_create_run.py
import multiprocessing import os import time from tests.constants import Image, Message, Gpu, InstanceType from tests.test_utils import TestUtils, TestWrapper # Workflow def test_user_creates_a_run_without_gpu_requirements_successfully(): parameters = '((1,),(2,))' file = os.path.dirname(os.path.abspath(__fi...
_datajoint_server.py
import hither2 as hi import kachery_client as kc import multiprocessing import os from pymysql.err import OperationalError import traceback import time from ._config import DATAJOINT_SERVER_PORT DOCKER_IMAGE_NAME = 'datajoint-server-pytest' def run_service_datajoint_server(): # The following cleanup is needed ...
tcp_send.py
import socket import threading def send_tcp(cnc_ip = '127.0.0.1', cnc_port = 8000, send_data = "01"): # 1.创建套接字socket tcp_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # 2.连接服务器 #cnc_ip = input("请输入服务器ip:") #cnc_port = int(input("请输入服务器port:")) cnc_addr = (cnc_ip, cnc_po...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest import unittest.mock from test import support from test.support import import_helper from test.support import os_helper from test.support import socket_helper from test.support import threading_helper from test.support import warnings_helper import sock...
god.py
# -*- coding:utf-8 -*- import turbo.log from bson import ObjectId import tornado import redis import time import threading import os from models.anime_music import model from helper.c_python import c_python as cp from helper import image from helper import tietuku from helper import file_server from helper import ftp...
Ultra.py
import socket import sys import time import datetime import datetime now = datetime.datetime.now import atexit import subprocess import threading import re import wx import wx.lib.newevent import Utils import Model from threading import Thread as Process from queue import Queue, Empty import JChip ChipReaderEvent, EVT...
motion.py
# from .consts import * import serial import threading import time # TODO: Add stable check decorator SPRINT = { "INIT": 2, "W_INIT": 3, "F": { "STRAIGHT": 4, "LEFT": 5, "RIGHT": 6, }, "FINISH": 8, "B": { "STRAIGHT": 9, "LEFT": 10, "RIGHT": 11 ...
gen_protos.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...
Enumerating_t.py
import random import threading import time import logging logging.basicConfig(level=logging.DEBUG, format='(%(threadName)-10s) %(message)s', ) def worker(): """thread worker function""" t = threading.currentThread() pause = random.randint(1,5) logging.debug('sle...
VideoProcessor.py
import threading import cv2 import concurrent.futures from dataClass import DataClass from webScraper import Scraper import numpy as np class VideoProcessor: def __init__(self, vidPath): self.capture = cv2.VideoCapture(vidPath.name) FPS = self.capture.get(cv2.CAP_PROP_FPS) self.FRAME_SKIP ...
util.py
import time import pandas as pd import random import os import shutil import shutil from workflowV2 import message import multiprocessing as mp import pickle import queue import time import subprocess import re SENTINEL = None def do_work(tasks_pending, tasks_completed): # Get the current worker's name worker...
sanity_check.py
# 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 # d...
MainFile.py
""" COMPSYS302 - Sofware Design Author: Adil Bhayani This program uses the CherryPy web server to connect to implement the functionality of the login server based social media network. This files contains all the cheryypy exposed functions alongside the general helper functions to call other clients APIs. T...
test_threading_trace.py
# Copyright 2018, OpenCensus 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 w...
mbase.py
""" mbase module This module contains the base model class from which all of the other models inherit from. """ from __future__ import print_function import abc import sys import os import shutil import threading import warnings if sys.version_info > (3, 0): import queue as Queue else: ...
util.py
"""Test utilities. .. warning:: This module is not part of the public API. """ import logging import shutil import stat import sys import tempfile import unittest from multiprocessing import Process, Event import OpenSSL import josepy as jose import mock import pkg_resources import six from six.moves import reload_m...
callbacks_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...
env.py
""" @author: Viet Nguyen <nhviet1009@gmail.com> """ import os import gym import retro # import gym_super_mario_bros from PIL import Image from gym.spaces import Box from gym import Wrapper # from nes_py.wrappers import JoypadSpace # from gym_super_mario_bros.actions import SIMPLE_MOVEMENT, COMPLEX_MOVEMENT, RIGHT_ONLY...
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 from electrum.bitcoin import TYPE_ADDRESS from electrum.storage import WalletStorage, StorageReadWriteError from electrum.wallet import Wall...
xla_client_test.py
# Lint as: python3 # 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 ...