code: def parse_fields(cls, formatter):
          "Returns the format fields otherwise raise exception"
          if formatter is None: return []
          try:
              parse = list(string.Formatter().parse(formatter))
              return  set(f for f in list(zip(*parse))[1] if f is not None)
          except:
              raise SyntaxError("Could not parse formatter %r" % formatterf parse_fields(cls, formatter):
          "Returns the format fields otherwise raise exception"
          if formatter is None: return []
          try:
              parse = list(string.Formatter().parse(formatter))
              return  set(f for f in list(zip(*parse))[1] if f is not None)
          except:
              raise SyntaxError("Could not parse formatter %r" % formatter)
docs: Returns the format fields otherwise raise exception