code: def is_allowed_getattr(self, name):
      # TODO this API is ugly.
      try:
          attr, is_get_descriptor = getattr_static(self._obj, name)
      except AttributeError:
          return False, False
      else:
          if (
              is_get_descriptor
              and type(attr) not in ALLOWED_DESCRIPTOR_ACCESS
          ):
              # In case of descriptors that have get methods we cannot return
              # it's value, because that would mean code execution.
              return True, True
      return True, False
  
imports: import inspect
  import types
  import sys
  from textwrap import dedent
  import operator
  from collections import namedtuple
  from jedi._compatibility import unicode, is_py3, builtins, py_version, force_unicode, print_to_stderr
  from jedi.evaluate.compiled.getattr_static import getattr_static
label_desc: Use image node_id 20 for calling the DirectObjectAccess obj's underlying member method code with example usage: obj.is_allowed_getattr(name) and returns: True,  False, False,  False, True,  True