def METHOD_NAME(self, format: str, flow: flow.Flow, path: mitmproxy.types.Path) -> None:
    """
    Export a flow to path.
    """
    if format not in formats:
        raise exceptions.CommandError("No such export format: %s" % format)
    func: Any = formats[format]
    v = func(flow)
    try:
        with open(path, "wb") as fp:
            if isinstance(v, bytes):
                fp.write(v)
            else:
                fp.write(v.encode("utf-8"))
    except OSError as e:
        logging.error(str(e))