# Path: _stbt/logging.py
# def debug(msg):
#     """Print the given string to stderr if stbt run `--verbose` was given."""
#     if get_debug_level() > 0:
#         sys.stderr.write("%s\n" % (msg,))


import configparser
import logging
import re
import subprocess
import sys
import time
            import _stbt.config
        import cv2
        import numpy
    import cv2
    import numpy
from collections import namedtuple
from enum import Enum
from _stbt.logging import debug
        from _stbt.imgutils import Frame
                   str(x1), str(y1), str(x2), str(y2)]
        self.adb(command, timeout_secs=10)

    def tap(self, position):
        """Tap on a particular location.

        :param position: A `stbt.Region`, or an (x,y) tuple.

        Example::

            d.tap((100, 20))
            d.tap(stbt.match(...).region)

        """
        x, y = _centre_point(position)
        debug("AdbDevice.tap((%d,%d))" % (x, y))

        x, y = self._to_native_coordinates(x, y)
        self.adb(["shell", "input", "tap", str(x), str(y)], timeout_secs=10)

    def _adb(self, command, timeout_secs=None, **kwargs):
        _command = []
        if timeout_secs is not None:
            _command += ["timeout", "%fs" % timeout_secs]
        _command += [self.adb_binary]
        if self.adb_server:
            _command += ["-H", self.adb_server]
        if self.adb_device:
            _command += ["-s", self.adb_device]
        _command += command

# Path: _stbt/logging.py
# def debug(msg):
#     """Print the given string to stderr if stbt run `--verbose` was given."""
#     if get_debug_level() > 0:
#         sys.stderr.write("%s\n" % (msg,))


# Path: _stbt/android.py
import configparser
import logging
import re
import subprocess
import sys
import time
            import _stbt.config
        import cv2
        import numpy
    import cv2
    import numpy
from collections import namedtuple
from enum import Enum
from _stbt.logging import debug
        from _stbt.imgutils import Frame

                   str(x1), str(y1), str(x2), str(y2)]
        self.adb(command, timeout_secs=10)

    def tap(self, position):
        """Tap on a particular location.

        :param position: A `stbt.Region`, or an (x,y) tuple.

        Example::

            d.tap((100, 20))
            d.tap(stbt.match(...).region)

        """
        x, y = _centre_point(position)
        debug("AdbDevice.tap((%d,%d))" % (x, y))

        x, y = self._to_native_coordinates(x, y)
        self.adb(["shell", "input", "tap", str(x), str(y)], timeout_secs=10)

    def _adb(self, command, timeout_secs=None, **kwargs):
        _command = []
        if timeout_secs is not None:
            _command += ["timeout", "%fs" % timeout_secs]
        _command += [self.adb_binary]
        if self.adb_server:
            _command += ["-H", self.adb_server]
        if self.adb_device:
            _command += ["-s", self.adb_device]
        _command += command

        debug("AdbDevice.adb: About to run command: %r\n" % _command)