class_docstr: Converts lists and related operations to their TF counterpart.
class_docstr_tok: ["Converts","lists","and","related","operations","to","their","TF","counterpart","."]
code: def _generate_pop_operation(self, original_call_node, pop_var_name):
      assert isinstance(original_call_node.func, gast.Attribute)
  
      if original_call_node.args:
          pop_element = original_call_node.args[0]
      else:
          pop_element = parser.parse_expression("None")
  
      # The call will be something like "target.pop()", and the dtype is hooked to
      # target, hence the func.value.
      # TODO(mdan): For lists of lists, this won't work.
      # The reason why it won't work is because it's unclear how to annotate
      # the list as a "list of lists with a certain element type" when using
      # operations like `l.pop().pop()`.
      dtype = self.get_definition_directive(
          original_call_node.func.value,
          directives.set_element_type,
          "dtype",
          default=templates.replace_as_expression("None"),
      )
      shape = self.get_definition_directive(
          original_call_node.func.value,
          directives.set_element_type,
          "shape",
          default=templates.replace_as_expression("None"),
      )
  
      template = """
        target, pop_var_name = ag__.list_pop(
            target, element,
            opts=ag__.ListPopOpts(element_dtype=dtype, element_shape=shape))
      """
      return templates.replace(
          template,
          target=original_call_node.func.value,
          pop_var_name=pop_var_name,
          element=pop_element,
          dtype=dtype,
          shape=shape,
      )
  
imports: import gast
  from tensorflow.python.autograph.core import converter
  from tensorflow.python.autograph.lang import directives
  from tensorflow.python.autograph.pyct import anno
  from tensorflow.python.autograph.pyct import parser
  from tensorflow.python.autograph.pyct import qual_names
  from tensorflow.python.autograph.pyct import templates
  from tensorflow.python.autograph.pyct.static_analysis import activity
  from tensorflow.python.autograph.pyct.static_analysis.annos import NodeAnno
label_desc: Use image node_id 6 for calling the ListTransformer obj's underlying member method code with example usage: obj._generate_pop_operation(original_call_node, pop_var_name) and returns: templates