import mimetypes


def get_extension(mime_type: str) -> str:
    """From a ``mime_type`` return a corresponding file extension, or empty."""
    extensions = sorted(mimetypes.guess_all_extensions(
        mime_type, strict=False))
    return extensions[0] if extensions else ''