parameters: (obj, predicate=None)
return_statement: return results
docstring: Return all members of an object as (name, value) pairs sorted by name.
      Optionally, only return members that satisfy a given predicate.
docstring_summary: Return all members of an object as (name, value) pairs sorted by name.
      Optionally, only return members that satisfy a given predicate.
docstring_tokens: Return all members of an object as ( name value ) pairs sorted by name . Optionally only return members that satisfy a given predicate .
function: def _getmembers(obj, predicate=None):
      """Return all members of an object as (name, value) pairs sorted by name.
      Optionally, only return members that satisfy a given predicate."""
      results = []
      for key in dir(obj):
          try:
              value = getattr(obj, key)
          except AttributeError:
              continue
          except Exception as e:
              message = [
                  "-" * 20,
                  'Error in "%s.%s" with error' % (obj.__class__.__name__, key),
                  "..." * 20,
                  "Error info:",
                  str(e),
                  "..." * 20,
              ]
              error("\n".join(message))
              continue
          if not predicate or predicate(value):
              results.append((key, value))
      results.sort()
      return results
function_tokens: def _getmembers ( obj , predicate = None ) : results = [ ] for key in dir ( obj ) : try : value = getattr ( obj , key ) except AttributeError : continue except Exception as e : message = [ "-" * 20 , 'Error in "%s.%s" with error' % ( obj . __class__ . __name__ , key ) , "..." * 20 , "Error info:" , str ( e ) , "..." * 20 , ] error ( "\n" . join ( message ) ) continue if not predicate or predicate ( value ) : results . append ( ( key , value ) ) results . sort ( ) return results