code: def sync_groups(self):
          
          if self.settings.GROUP_FILTER:
              ldap_groups = self.ldap.search(self.settings.GROUP_FILTER, self.settings.GROUP_ATTRIBUTES.keys())
              self._sync_ldap_groups(ldap_groups)
              logger.info("Groups are synchronized")
docs: Synchronize LDAP groups with local group model.