code: def LDAP_search(pattern_search, attribute):
      
      connection, ldap_base = _get_LDAP_connection()
  
      connection.search(
          search_base=ldap_base,
          search_filter=pattern_search,
          attributes=[attribute]
      )
      return connection.response
docs: Do a LDAP search