def METHOD_NAME(maybe_proto: str,
                         proto_name: str = None,
                         out_dir: str = None):
    """If maybe_proto is a file, returns the file name.
    If maybe_proto is a string representing a message, prints the message to
    a file and returns the file name.
    """
    if _is_file(maybe_proto):
        return maybe_proto
    proto_file = os.path.join(out_dir, proto_name + ".asciipb")
    with open(proto_file, "w") as f:
        print(maybe_proto, file=f)
    return proto_file