code: def _set_up_object_manager(self):
          '''Set up this mock object as a D-Bus ObjectManager.'''
          if self.path == '/':
              cond = 'k != \'/\''
          else:
              cond = 'k.startswith(\'%s/\')' % self.path
  
          self.AddMethod(OBJECT_MANAGER_IFACE,
                         'GetManagedObjects', '', 'a{oa{sa{sv}}}',
                         'ret = {dbus.ObjectPath(k): objects[k].props ' +
                         '  for k in objects.keys() if ' + cond + '}')
          self.object_manager = self _set_up_object_manager(self):
          '''Set up this mock object as a D-Bus ObjectManager.'''
          if self.path == '/':
              cond = 'k != \'/\''
          else:
              cond = 'k.startswith(\'%s/\')' % self.path
  
          self.AddMethod(OBJECT_MANAGER_IFACE,
                         'GetManagedObjects', '', 'a{oa{sa{sv}}}',
                         'ret = {dbus.ObjectPath(k): objects[k].props ' +
                         '  for k in objects.keys() if ' + cond + '}')
          self.object_manager = self
docs: Set up this mock object as a D-Bus ObjectManager.