def generate_enum_doc(enum_descriptor, locations, path, name_prefix='<STR_LIT>'):
print(make_subsection(name_prefix + enum_descriptor.name))<EOL>location = locations[path]<EOL>if location.HasField('<STR_LIT>'):<EOL><INDENT>print(textwrap.dedent(location.leading_comments))<EOL><DEDENT>row_tuples = []<EOL>for value_index, value in enumerate(enum_descriptor.value):<EOL><INDENT>field_location = locations[path + (<NUM_LIT:2>, value_index)]<EOL>row_tuples.append((<EOL>make_code(value.name),<EOL>value.number,<EOL>textwrap.fill(get_comment_from_location(field_location), INFINITY),<EOL>))<EOL><DEDENT>print_table(('<STR_LIT:Name>', '<STR_LIT>', '<STR_LIT>'), row_tuples)<EOL>
Generate doc for an enum.

    Args:
        enum_descriptor: descriptor_pb2.EnumDescriptorProto instance for enum
            to generate docs for.
        locations: Dictionary of location paths tuples to
            descriptor_pb2.SourceCodeInfo.Location instances.
        path: Path tuple to the enum definition.
        name_prefix: Optional prefix for this enum's name.