code: def _format_list(
      attr: Union[List[Any], Set[Any], Tuple[Any, ...]],
      indent: int,
      width: int,
      curr_indent: int,
  ) -> str:
      curr_indent += indent + 1
      list_repr = [
          _pformat(l, indent, width, curr_indent)
          if is_dataclass(l)
          else repr(l)
          for l in attr
      ]
      start, end = ("[", "]") if isinstance(attr, list) else ("(", ")")
      return _format(list_repr, indent, width, curr_indent, start, end)
  
imports: import contextlib
  import functools
  import hashlib
  import os
  import re
  import sys
  import textwrap
  from argparse import Namespace
  from dataclasses import fields, is_dataclass
  from enum import auto, Enum
  from typing import Any, Callable, Dict, Generic, Iterable, Iterator, List, Literal, NoReturn, Optional, Sequence, Set, Tuple, TypeVar, Union
  from typing_extensions import Self
  from torchgen.code_template import CodeTemplate
label_desc: Use image node_id 12 for calling a global function with example usage: _format_list(attr, indent, width, curr_indent) and returns: _format