code: def flatten_multiindex(idx):
      """Flatten a multiindex.
  
      Parameters
      ----------
      idx: pandas.MultiIndex
  
      Returns
      -------
      pandas.Index with str elements
          i-th element of return is underscore_join of i-th element of `idx`
      """
      return pd.Index([underscore_join(x) for x in idx])
  
label_desc: Use image node_id 2 for calling a global function with example usage: flatten_multiindex(idx) and returns: pd