docstr: After self.get_object_members() obtained all members, this function filters only
  the ones we're interested in.
  We can do the sorting here based on the values, and pass through in self.sort_members()
docstr_tok: ["After","self.get_object_members","(",")","obtained","all","members",",","this","function","filters","only","the","ones","we","'re","interested","in",".","We","can","do","the","sorting","here","based","on","the","values",",","and","pass","through","in","self.sort_members","(",")"]
code: def filter_members(self, members, want_all):
      """After self.get_object_members() obtained all members, this function filters only
      the ones we're interested in.
      We can do the sorting here based on the values, and pass through in self.sort_members()
      """
      # Since pybind11 https://github.com/pybind/pybind11/pull/2739 there is an extra `value`
      # member returned by get_object_members().
      # Here we are filtering the list, to keep only enum members
      filtered = [
          member
          for member in members
          if member[0] in self.object.__members__.keys()
      ]
  
      filtered = super().filter_members(filtered, want_all)
  
      # sort by the actual value of enum - this is a tuple of (name, value, boolean)
      def get_member_value(member_desc):
          _, member_value, _ = member_desc
          if isinstance(member_value, Enum):
              return member_value.value
          else:
              return int(member_value)
  
      filtered.sort(key=get_member_value)
  
      return filtered
  
imports: import os
  import sys
  import sphinx_rtd_theme
  from sphinx.ext.autodoc.mock import mock
  from sphinx.ext.autodoc import between, ClassDocumenter, AttributeDocumenter
  from builtins import str
  from enum import Enum
  import re
  import subprocess
  from pathlib import Path
  from datetime import date
label_desc: Use image node_id 3 for calling the EnumDocumenter obj's underlying member method code with example usage: obj.filter_members(members, want_all) and returns: filtered, member_value, int