code: def _get_dependency_chain(ssa, versioned_target, versioned_source):
      """
      Return the index list of relevant operator to produce target blob from source blob,
          if there's no dependency, return empty list.
      """
  
      # finding all paths between nodes can be O(N!), thus we can only search
      # in the subgraph using the op starting from the first consumer of source blob
      # to the producer of the target blob.
      consumer_map = get_consumer_map(ssa)
      producer_map = get_producer_map(ssa)
      start_op = min(x[0] for x in consumer_map[versioned_source]) - 15
      end_op = (
          producer_map[versioned_target][0] + 15
          if versioned_target in producer_map
          else start_op
      )
      sub_graph_ssa = ssa[start_op : end_op + 1]
      if len(sub_graph_ssa) > 30:
          logger.warning(
              "Subgraph bebetween {} and {} is large (from op#{} to op#{}), it"
              " might take non-trival time to find all paths between them.".format(
                  versioned_source, versioned_target, start_op, end_op
              )
          )
  
      dag = DiGraph.from_ssa(sub_graph_ssa)
      paths = dag.get_all_paths(
          versioned_source, versioned_target
      )  # include two ends
      ops_in_paths = [
          [producer_map[blob][0] for blob in path[1:]] for path in paths
      ]
      return sorted(set().union(*[set(ops) for ops in ops_in_paths]))
  
imports: import collections
  import copy
  import functools
  import logging
  import numpy
  import os
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  from unittest import mock
  import caffe2.python.utils
  import torch
  import torch.nn.functional
  from caffe2.proto import caffe2_pb2
  from caffe2.python import core, net_drawer, workspace
  from torch.nn.functional import interpolate
label_desc: Use image node_id 35 for calling a global function with example usage: _get_dependency_chain(ssa, versioned_target, versioned_source) and returns: sorted