code: def expandf(m, format):  # noqa A002
      
  
      _assert_expandable(format, True)
      return _apply_replace_backrefs(m, format, flags=FORMAT)
docs: Expand the string using the format replace pattern or function.