code: def _count_two_columns(
      triples: np.ndarray, c1_slice: slice, c2_slice: slice
  ) -> Mapping[str, int]:
      """Compute number of heads per relation-tail pairs."""
      c1 = triples[:, c1_slice]
      c2 = triples[:, c2_slice]
  
      arr = np.concatenate([c1, c2], axis=-1).tolist()
      stats = Counter(map(tuple, arr))
      return _get_sorted_dict_from_counter(stats)
  
imports: from collections import Counter
  from typing import Mapping
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: _count_two_columns(triples, c1_slice, c2_slice) and returns: _get_sorted_dict_from_counter