docstr: :param anchor_op: Operation
  :param old_var: Var
  :param new_var: Var
  :param end_op: Operation
  :param no_check_var_types: bool
  :param no_check_var_visibility: bool
  :return: True if the old_var can be replaced by new_var. False otherwise.
  
  This helper function guards the replace_uses_of_var_after_op function,
  by first checking if the old_var could be replaced by the new_var.
  
  1. If old_var can be replaced by new_var, the replace_uses_of_var_after_op is called,
  and returns True. 2. Return False if the replacement is not allow.
docstr_tok: [":","param","anchor_op",":","Operation",":","param","old_var",":","Var",":","param","new_var",":","Var",":","param","end_op",":","Operation",":","param","no_check_var_types",":","bool",":","param","no_check_var_visibility",":","bool",":","return",":","True","if","the","old_var","can","be","replaced","by","new_var",".","False","otherwise",".","This","helper","function","guards","the","replace_uses_of_var_after_op","function",",","by","first","checking","if","the","old_var","could","be","replaced","by","the","new_var",".","1",".","If","old_var","can","be","replaced","by","new_var",",","the","replace_uses_of_var_after_op","is","called",",","and","returns","True",".","2",".","Return","False","if","the","replacement","is","not","allow","."]
code: def try_replace_uses_of_var_after_op(
      self,
      anchor_op,
      old_var,
      new_var,
      end_op=None,
      no_check_var_types=False,
      no_check_var_visibility=False,
  ):
      """
      :param anchor_op: Operation
      :param old_var: Var
      :param new_var: Var
      :param end_op: Operation
      :param no_check_var_types: bool
      :param no_check_var_visibility: bool
      :return: True if the old_var can be replaced by new_var. False otherwise.
  
      This helper function guards the replace_uses_of_var_after_op function,
      by first checking if the old_var could be replaced by the new_var.
  
      1. If old_var can be replaced by new_var, the replace_uses_of_var_after_op is called,
      and returns True. 2. Return False if the replacement is not allow.
      """
      if not old_var.can_be_replaced_by_var(new_var):
          return False
  
      self.replace_uses_of_var_after_op(
          anchor_op=anchor_op,
          end_op=end_op,
          old_var=old_var,
          new_var=new_var,
          no_check_var_types=no_check_var_types,
          no_check_var_visibility=no_check_var_visibility,
      )
      return True
  
imports: import copy
  from collections import Counter, OrderedDict
  from typing import Tuple
  from coremltools import _OPSET
  from coremltools import _logger
  from coremltools.converters.mil._deployment_compatibility import AvailableTarget
  from .None import SPACES, types
  from .operation import Operation
  from .types.symbolic import is_symbolic, k_used_symbols
  from .var import ComplexVar, InternalVar, Var
  from .visitors.dot_visitor import DotVisitor
label_desc: Use image node_id 17 for calling the Block obj's underlying member method code with example usage: obj.try_replace_uses_of_var_after_op(anchor_op, old_var, new_var, end_op, no_check_var_types, no_check_var_visibility) and returns: True, False