code: def is_potential_flag(token: str, parser: argparse.ArgumentParser) -> bool:
      
      # if it's an empty string, it was meant to be a positional
      if not token:
          return False
  
      # if it doesn't start with a prefix, it was meant to be positional
      if not token[0] in parser.prefix_chars:
          return False
  
      # if it's just a single character, it was meant to be positional
      if len(token) == 1:
          return False
  
      # if it looks like a negative number, it was meant to be positional
      # unless there are negative-number-like options
      if parser._negative_number_matcher.match(token):
          if not parser._has_negative_number_optionals:
              return False
  
      # if it contains a space, it was meant to be a positional
      if ' ' in token:
          return False
  
      # Looks like a flag
      return True
docs: Determine if a token looks like a potential flag. Based on argparse._parse_optional().