code: def get_sort_indexes_2d(data, sort_fn=None, top_n=None):
      if top_n is None:
          top_n = len(data[0])
  
      if sort_fn is not None:
          out_list = []
          for data_instance in data:
              sorted_vals = list(map(sort_fn, data_instance))
              out_list.append(np.argsort(sorted_vals)[:top_n])
          return out_list
      else:
          return np.arange(top_n)
  
imports: import plotly.graph_objs
  import numpy
  from plotly import subplots
  import matplotlib.pyplot
  from numbers import Number
  import logging
label_desc: Use image node_id 19 for calling a global function with example usage: get_sort_indexes_2d(data, sort_fn, top_n) and returns: out_list, np