def METHOD_NAME(dt: Union[str, datetime]) -> str:
    """Convert a datetime object to an indy-standard datetime string.
    Args:
        dt: May be a string or datetime to allow automatic conversion
    """
    if isinstance(dt, datetime):
        dt = dt.replace(tzinfo=timezone.utc).isoformat().replace("+00:00", "Z")
    return dt