code: def pipe_item_split(tokens, loc):
      
      # list implies artificial tokens, which must be expr
      if isinstance(tokens, list) or "expr" in tokens:
          internal_assert(len(tokens) == 1, "invalid expr pipe item tokens", tokens)
          return "expr", (tokens[0],)
      elif "partial" in tokens:
          func, args = tokens
          pos_args, star_args, kwd_args, dubstar_args = split_function_call(args, loc)
          return "partial", (func, join_args(pos_args, star_args), join_args(kwd_args, dubstar_args))
      elif "attrgetter" in tokens:
          name, args = attrgetter_atom_split(tokens)
          return "attrgetter", (name, args)
      elif "itemgetter" in tokens:
          op, args = tokens
          return "itemgetter", (op, args)
      else:
          raise CoconutInternalException("invalid pipe item tokens", tokens)
docs: Process a pipe item, which could be a partial, an attribute access, a method call, or an expression.
      Return (type, split) where split is
          - (expr,) for expression,
          - (func, pos_args, kwd_args) for partial,
          - (name, args) for attr/method, and
          - (op, args) for itemgetter.