code: def indexer_from_factorized(labels, shape, compress=True):
      ids = get_group_index(labels, shape, sort=True, xnull=False)
  
      if not compress:
          ngroups = (ids.size and ids.max()) + 1
      else:
          ids, obs = compress_group_index(ids, sort=True)
          ngroups = len(obs)
  
      return get_group_index_sorter(ids, ngroups)
  
imports: import warnings
  import numpy
  from pandas._libs import algos, hashtable, lib
  from pandas._libs.hashtable import unique_label_indices
  from pandas.compat import PY3, long, string_types
  from pandas.core.dtypes.cast import infer_dtype_from_array
  from pandas.core.dtypes.common import ensure_int64, ensure_platform_int, is_categorical_dtype, is_list_like
  from pandas.core.dtypes.missing import isna
  import pandas.core.algorithms
label_desc: Use image node_id 6 for calling a global function with example usage: indexer_from_factorized(labels, shape, compress) and returns: get_group_index_sorter