code: def _merge(
      data: pd.DataFrame,
      ids: typing.Union[list, np.array],
      text_label: str,
      id_label: str,
  ):
      left = pd.DataFrame(
          data={text_label: data[text_label], id_label: ids}
      )
      left.drop_duplicates(id_label, inplace=True)
      left.set_index(id_label, inplace=True)
      return left
  
imports: import typing
  import pandas
  import numpy
  import matchzoo
label_desc: Use image node_id 2 for calling a global function with example usage: _merge(data, ids, text_label, id_label) and returns: left