code: def create_bag_transform(
      feature_count,
      feature_selection,
      relevant_features,
      sfa_words,
      bigrams,
      remove_repeat_words,
  ):
      """Create bag, transform."""
      # merging arrays
      all_win_words = np.zeros(
          (len(sfa_words), feature_count), np.uint32
      )
      for j in prange(sfa_words.shape[0]):
          if (
              len(relevant_features) == 0
              and feature_selection == "none"
          ):
              # this mask is used to encode the repeated words
              if remove_repeat_words:
                  masked = np.nonzero(sfa_words[j])
                  all_win_words[j, :] = np.bincount(
                      sfa_words[j][masked], minlength=feature_count
                  )
              else:
                  all_win_words[j, :] = np.bincount(
                      sfa_words[j], minlength=feature_count
                  )
          else:
              if remove_repeat_words:
                  if 0 in relevant_features:
                      del relevant_features[0]
  
              for _, key in enumerate(sfa_words[j]):
                  if key in relevant_features:
                      o = relevant_features[key]
                      all_win_words[j, o] += 1
  
      return all_win_words, all_win_words.shape[1]
  
file_path: sktime/sktime/transformations/panel/dictionary_based/_sfa_fast_numba.py
imports: import math
  from warnings import simplefilter
  import numpy
  from sktime.utils.numba.njit import njit
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 12 for calling a global function with example usage: create_bag_transform(feature_count, feature_selection, relevant_features, sfa_words, bigrams, remove_repeat_words) and returns: all_win_words,  all_win_words