code: def _ensure_frozen(array_like, categories, copy=False):
      array_like = coerce_indexer_dtype(array_like, categories)
      array_like = array_like.view(FrozenNDArray)
      if copy:
          array_like = array_like.copy()
      return array_like
  
imports: import warnings
  import numpy
  from pandas.util._decorators import deprecate_kwarg
  from pandas.core.dtypes.cast import coerce_indexer_dtype
  from pandas.core.base import PandasObject
  from pandas.io.formats.printing import pprint_thing
label_desc: Use image node_id 1 for calling a global function with example usage: _ensure_frozen(array_like, categories, copy) and returns: array_like