import re


def format_footprint(footprint: str) -> str:
    """Formats the supplied footprint so that it conforms to the Sentinel format
    i.e. using Intersects and quotations

    Args:
          footprint::str
            AOI Footprint which may be a Coordinate Pair, WKT Polygon bounding box or
            Intersects fn call
    Returns:
          val::str
            Formatted footprint compatible with Sentinel Hub API
    """
    intersects_pattern = re.compile(r"^\"?Intersects\((.+)\)\"?$")
    intersects_match = intersects_pattern.match(footprint)
    return (
        f'"Intersects({footprint})"'
        if intersects_match is None
        else f'"Intersects({intersects_match.group(1)})"'
    )