code: def _hash_categorical(c, encoding, hash_key):
      """
      Hash a Categorical by hashing its categories, and then mapping the codes
      to the hashes
  
      Parameters
      ----------
      c : Categorical
      encoding : string, default 'utf8'
      hash_key : string key to encode, default to _default_hash_key
  
      Returns
      -------
      ndarray of hashed values array, same size as len(c)
      """
      # Convert ExtensionArrays to ndarrays
      values = np.asarray(c.categories.values)
      hashed = hash_array(values, encoding, hash_key, categorize=False)
  
      # we have uint64, as we don't directly support missing values
      # we don't want to use take_nd which will coerce to float
      # instead, directly construct the result with a
      # max(np.uint64) as the missing value indicator
      #
      # TODO: GH 15362
  
      mask = c.isna()
      if len(hashed):
          result = hashed.take(c.codes)
      else:
          result = np.zeros(len(mask), dtype="uint64")
  
      if mask.any():
          result[mask] = np.iinfo(np.uint64).max
  
      return result
  
file_path: catboost/contrib/python/pandas/py2/pandas/core/util/hashing.py
imports: import itertools
  import numpy
  from pandas._libs import hashing, tslibs
  from pandas.core.dtypes.cast import infer_dtype_from_scalar
  from pandas.core.dtypes.common import is_categorical_dtype, is_extension_array_dtype, is_list_like
  from pandas.core.dtypes.generic import ABCDataFrame, ABCIndexClass, ABCMultiIndex, ABCSeries
  from pandas.core.dtypes.missing import isna
label_desc: Use image node_id 5 for calling a global function with example usage: _hash_categorical(c, encoding, hash_key) and returns: result