parameters: (self, enum, class_name='', module=None, prefix=' ' * 4)
return_statement: return res
docstring: Wrap an enum.
  
          Args:
              enum: The parsed enum to wrap.
              class_name: The class under which the enum is defined.
              prefix: The amount of indentation.
docstring_summary: Wrap an enum.
docstring_tokens: Wrap an enum .
function: def wrap_enum(self, enum, class_name='', module=None, prefix=' ' * 4):
          """
          Wrap an enum.
  
          Args:
              enum: The parsed enum to wrap.
              class_name: The class under which the enum is defined.
              prefix: The amount of indentation.
          """
          if module is None:
              module = self._gen_module_var(enum.namespaces())
  
          cpp_class = enum.cpp_typename().to_cpp()
          if class_name:
              # If class_name is provided, add that as the namespace
              cpp_class = class_name + "::" + cpp_class
  
          res = '{prefix}py::enum_<{cpp_class}>({module}, "{enum.name}", py::arithmetic())'.format(
              prefix=prefix, module=module, enum=enum, cpp_class=cpp_class)
          for enumerator in enum.enumerators:
              res += '\n{prefix}    .value("{enumerator.name}", {cpp_class}::{enumerator.name})'.format(
                  prefix=prefix, enumerator=enumerator, cpp_class=cpp_class)
          res += ";\n\n"
          return res
function_tokens: def wrap_enum ( self , enum , class_name = '' , module = None , prefix = ' ' * 4 ) : if module is None : module = self . _gen_module_var ( enum . namespaces ( ) ) cpp_class = enum . cpp_typename ( ) . to_cpp ( ) if class_name : # If class_name is provided, add that as the namespace cpp_class = class_name + "::" + cpp_class res = '{prefix}py::enum_<{cpp_class}>({module}, "{enum.name}", py::arithmetic())' . format ( prefix = prefix , module = module , enum = enum , cpp_class = cpp_class ) for enumerator in enum . enumerators : res += '\n{prefix}    .value("{enumerator.name}", {cpp_class}::{enumerator.name})' . format ( prefix = prefix , enumerator = enumerator , cpp_class = cpp_class ) res += ";\n\n" return res