docs: def add_int_enums_to_docstring(enum):
      """Decorator for IntEnum which re-writes the documentation string so that
      Sphinx enumerates all the enumeration values.
  
      This is a work-around for Sphinx autodoc's inability to properly document
      IntEnums.
  
      This decorator adds enumeration names and values to the 'Attributes'
      section of the docstring of the decorated IntEnum class.
  
      Example::
  
          >>> from enum import IntEnum
          >>> @add_int_enums_to_docstring
          ... class MyIntEnum(IntEnum):
          ...     '''An example IntEnum.'''
          ...     a = 0
          ...     b = 1
          >>> print(MyIntEnum.__doc__)
          An example IntEnum.
          <BLANKLINE>
          Attributes
          ----------
          a = 0
          b = 1
          <BLANKLINE>
      """
      # The enum34 library (used for compatibility with Python < v3.4) rather
      # oddly set its docstring to None rather than some senible but empty
      # default...
      if enum.__doc__ is None:  # pragma: nocover
          enum.__doc__ = ""
  
      enum.__doc__ += ("\n\n"
                       "Attributes\n"
                       "----------\n")
      for val in list(enum):
          enum.__doc__ += "{} = {}\n".format(val.name, int(val))
  
      return enum