code: def format(cls, dt: datetime, fmt: str) -> str:
      # FIXME: _format_token() is nullable
      return cls._FORMAT_RE.sub(
          lambda m: cast(str, cls._format_token(dt, m.group(0))), fmt
      )
  
file_path: arrow-py/arrow/formatter.py
imports: import re
  import sys
  from datetime import datetime, timedelta
  from typing import Optional, Pattern, cast
  from dateutil import tz
  from arrow import locales
  from arrow.constants import DEFAULT_LOCALE
label_desc: Use image node_id 2 for calling the DateTimeFormatter obj's underlying member method code with example usage: obj.format(cls, dt, fmt) and returns: cls