code: def attrgetter_atom_split(tokens):
      
      if len(tokens) == 1:  # .attr
          return tokens[0], None
      elif len(tokens) >= 2 and tokens[1] == "(":  # .method(...
          if len(tokens) == 2:  # .method()
              return tokens[0], ""
          elif len(tokens) == 3:  # .method(args)
              return tokens[0], tokens[2]
          else:
              raise CoconutInternalException("invalid methodcaller literal tokens", tokens)
      else:
          raise CoconutInternalException("invalid attrgetter literal tokens", tokens)
docs: Split attrgetter_atom_tokens into (attr_or_method_name, method_args_or_none_if_attr).