code: def hash_pandas_object(
      obj, index=True, encoding="utf8", hash_key=None, categorize=True
  ):
      """
      Return a data hash of the Index/Series/DataFrame
  
      .. versionadded:: 0.19.2
  
      Parameters
      ----------
      index : boolean, default True
          include the index in the hash (if Series/DataFrame)
      encoding : string, default 'utf8'
          encoding for data & key when strings
      hash_key : string key to encode, default to _default_hash_key
      categorize : bool, default True
          Whether to first categorize object arrays before hashing. This is more
          efficient when the array contains duplicate values.
  
          .. versionadded:: 0.20.0
  
      Returns
      -------
      Series of uint64, same length as the object
      """
      from pandas import Series
  
      if hash_key is None:
          hash_key = _default_hash_key
  
      if isinstance(obj, ABCMultiIndex):
          return Series(
              hash_tuples(obj, encoding, hash_key),
              dtype="uint64",
              copy=False,
          )
  
      if isinstance(obj, ABCIndexClass):
          h = hash_array(
              obj.values, encoding, hash_key, categorize
          ).astype("uint64", copy=False)
          h = Series(h, index=obj, dtype="uint64", copy=False)
      elif isinstance(obj, ABCSeries):
          h = hash_array(
              obj.values, encoding, hash_key, categorize
          ).astype("uint64", copy=False)
          if index:
              index_iter = (
                  hash_pandas_object(
                      obj.index,
                      index=False,
                      encoding=encoding,
                      hash_key=hash_key,
                      categorize=categorize,
                  ).values
                  for _ in [None]
              )
              arrays = itertools.chain([h], index_iter)
              h = _combine_hash_arrays(arrays, 2)
  
          h = Series(h, index=obj.index, dtype="uint64", copy=False)
  
      elif isinstance(obj, ABCDataFrame):
          hashes = (
              hash_array(series.values) for _, series in obj.iteritems()
          )
          num_items = len(obj.columns)
          if index:
              index_hash_generator = (
                  hash_pandas_object(
                      obj.index,
                      index=False,
                      encoding=encoding,
                      hash_key=hash_key,
                      categorize=categorize,
                  ).values  # noqa
                  for _ in [None]
              )
              num_items += 1
              hashes = itertools.chain(hashes, index_hash_generator)
          h = _combine_hash_arrays(hashes, num_items)
  
          h = Series(h, index=obj.index, dtype="uint64", copy=False)
      else:
          raise TypeError("Unexpected type for hashing %s" % type(obj))
      return h
  
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 2 for calling a global function with example usage: hash_pandas_object(obj, index, encoding, hash_key, categorize) and returns: h, Series