class_docstr: Introspect UDF bytecode and determine if we can rewrite as native expression.
class_docstr_tok: ["Introspect","UDF","bytecode","and","determine","if","we","can","rewrite","as","native","expression","."]
docstr: The name of the object against which the 'map' is being invoked.
code: def _get_target_name(self, col: str, expression: str) -> str:
      """The name of the object against which the 'map' is being invoked."""
      if self._map_target_name is not None:
          return self._map_target_name
      else:
          col_expr = f'pl.col("{col}")'
          if self._map_target == "expr":
              return col_expr
          elif self._map_target == "series":
              # note: handle overlapping name from global variables; fallback
              # through "s", "srs", "series" and (finally) srs0 -> srsN...
              search_expr = expression.replace(col_expr, "")
              for name in ("s", "srs", "series"):
                  if not re.search(rf"\b{name}\b", search_expr):
                      self._map_target_name = name
                      return name
              n = count()
              while True:
                  name = f"srs{next(n)}"
                  if not re.search(rf"\b{name}\b", search_expr):
                      self._map_target_name = name
                      return name
  
      raise NotImplementedError(
          f"TODO: map_target = {self._map_target!r}"
      )
  
imports: from __future__ import annotations
  import datetime
  import dis
  import inspect
  import re
  import sys
  import warnings
  from bisect import bisect_left
  from collections import defaultdict
  from dis import get_instructions
  from inspect import signature
  from itertools import count, zip_longest
  from pathlib import Path
  from typing import TYPE_CHECKING, AbstractSet, Any, Callable, ClassVar, Iterator, Literal, NamedTuple, Union
label_desc: Use image node_id 4 for calling the BytecodeParser obj's underlying member method code with example usage: obj._get_target_name(col, expression) and returns: self, col_expr, name, name