<commit_before># $Abso$

module EPPClient::Poll
  def poll_req_xml #:nodoc:
    command do |xml|
      xml.poll(:op => :req)
    end
  end
  def poll_req
    response = send_request(poll_req_xml)

    get_result(:xml => response, :callback => :poll_req_process)
  end

  PARSERS = {}

  def poll_req_process(xml)
    obj = xml.xpath('epp:resData', EPPClient::SCHEMAS_URL)
    ret = { :obj => obj.to_s }
    if (date = xml.xpath("epp:msgQ/epp:qDate", EPPClient::SCHEMAS_URL)).size > 0
      ret[:qDate] = DateTime.parse(date.text)
    end
    if (msg = xml.xpath("epp:msgQ/epp:msg", EPPClient::SCHEMAS_URL)).size > 0
      ret[:msg] = msg.text
    end
    PARSERS.each do |xpath,parser|
      if xml.xpath("epp:resData/#{xpath}", EPPClient::SCHEMAS_URL).size > 0
	ret[:obj] = case parser
		    when Symbol
		      send(parser, xml)
		    else
		      raise NotImplementedError
		    end
      end
    end
    ret
  end
end
<commit_msg>Ajouter la doc de poll/req.<commit_after># $Abso$

module EPPClient::Poll
  def poll_req_xml #:nodoc:
    command do |xml|
      xml.poll(:op => :req)
    end
  end

  # sends a <epp:poll op="req"> command to the server.
  def poll_req
    response = send_request(poll_req_xml)

    get_result(:xml => response, :callback => :poll_req_process)
  end

  PARSERS = {}

  def poll_req_process(xml) #:nodoc:
    obj = xml.xpath('epp:resData', EPPClient::SCHEMAS_URL)
    ret = { :obj => obj.to_s }
    if (date = xml.xpath("epp:msgQ/epp:qDate", EPPClient::SCHEMAS_URL)).size > 0
      ret[:qDate] = DateTime.parse(date.text)
    end
    if (msg = xml.xpath("epp:msgQ/epp:msg", EPPClient::SCHEMAS_URL)).size > 0
      ret[:msg] = msg.text
    end
    PARSERS.each do |xpath,parser|
      if xml.xpath("epp:resData/#{xpath}", EPPClient::SCHEMAS_URL).size > 0
	ret[:obj] = case parser
		    when Symbol
		      send(parser, xml)
		    else
		      raise NotImplementedError
		    end
      end
    end
    ret
  end
end

{'fraction_non_alphanumeric': 0.13610683102208526, 'fraction_numerical': 0.0030816640986132513, 'mean_word_length': 2.8727634194831015, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 22}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5072971', 'n_tokens_mistral': 786, 'n_tokens_neox': 752, 'n_words': 155}