code: def cond_to_where(self, graph):
      stuff_done = False
      g = graph
      ranks = compute_max_rank(graph)
      merges = [a for a in g if g[a].op == "Merge"]
      merges = sorted(merges, key=lambda k: ranks[k])
      if len(merges) == 0:
          return False
      for m in merges:
          logging.debug("Fixing cond at merge location: %s", m)
          switches = self._search(g, m)
          self._fix_found_cond(g, m, switches)
          stuff_done = True
  
      # delete the extra switches that seem to just lead to identities
      # which then lead nowhere but into control dependencies
      extra_switches = [a for a in g if g[a].op == "Switch"]
      for s in extra_switches:
          if all(
              [
                  g[o].op == "Identity" and len(g[o].outputs) == 0
                  for o in g[s].outputs
              ]
          ):
              nodes_to_delete = g[s].outputs + [s]
              for d in nodes_to_delete:
                  delete_node(g, d)
                  stuff_done = True
      return stuff_done
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow/tf_graph_pass/cond_to_where.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from ..basic_graph_ops import delete_node, disconnect_edge
  from .visitors import FindAllUpstreamTerminals
  import logging
  from coremltools._deps import _HAS_TF_2
label_desc: Use image node_id 3 for calling the CondToWhere obj's underlying member method code with example usage: obj.cond_to_where(graph) and returns: stuff_done, False