class_docstr: Accessor object for categorical properties of the Series values.
  
  Examples
  --------
  >>> s.cat.categories  # doctest: +SKIP
  
  Notes
  -----
  Attributes that depend only on metadata are eager
  
  * categories
  * ordered
  
  Attributes depending on the entire dataset are lazy
  
  * codes
  * ...
  
  So `df.a.cat.categories` <=> `df.a._meta.cat.categories`
  So `df.a.cat.codes` <=> `df.a.map_partitions(lambda x: x.cat.codes)`
docstr: The codes of this categorical.
  
  If categories are unknown, an error is raised
docstr_tok: ["The","codes","of","this","categorical",".","If","categories","are","unknown",",","an","error","is","raised"]
code: def codes(self):
      """The codes of this categorical.
  
      If categories are unknown, an error is raised"""
      if not self.known:
          msg = (
              "`df.column.cat.codes` with unknown categories is not "
              "supported.  Please use `column.cat.as_known()` or "
              "`df.categorize()` beforehand to ensure known categories"
          )
          raise AttributeNotImplementedError(msg)
      return self._property_map("codes")
  
imports: from __future__ import annotations
  from collections import defaultdict
  from numbers import Integral
  import pandas
  from pandas.api.types import is_scalar
  from tlz import partition_all
  from dask.base import compute_as_if_collection, tokenize
  from dask.dataframe import methods
  from dask.dataframe.accessor import Accessor
  from dask.dataframe.dispatch import categorical_dtype, categorical_dtype_dispatch, is_categorical_dtype
  from dask.dataframe.utils import AttributeNotImplementedError, clear_known_categories, has_known_categories
  from dask.highlevelgraph import HighLevelGraph
label_desc: Use image node_id 6 for calling the CategoricalAccessor obj's underlying member method code with example usage: obj.codes() and returns: self