code: def _get_group_dn(self, group_lookup_attribute_value):
          
          self.ldap_connection.search(search_base=self.GROUP_SEARCH['base_dn'],
                                      search_filter=self.GROUP_SEARCH['filter_string'].format(
                                          lookup_value=escape_query(group_lookup_attribute_value)),
                                      search_scope=self.GROUP_SEARCH['scope'],
                                      attributes=self.GROUP_SEARCH['attribute_list'])
          results = [result["dn"] for result in self.ldap_connection.response if result["type"] == "searchResEntry"]
  
          if not results:
              raise GroupDoesNotExist("The {group_lookup_attribute} provided does not exist in the Active "
                                      "Directory.".format(group_lookup_attribute=self.group_lookup_attr))
  
          if len(results) > 1:
              logger.debug("Search returned more than one result: {results}".format(results=results))
  
          if results:
              return results[0]
          else:
              return results
docs: Searches for a group and retrieves its distinguished name.
  
          :param group_lookup_attribute_value: The value for the LDAP_GROUPS_GROUP_LOOKUP_ATTRIBUTE
          :type group_lookup_attribute_value: str
  
          :raises: **GroupDoesNotExist** if the group doesn't exist in the active directory.