<commit_before>require 'geocoder/lookups/base'
require 'geocoder/results/maxmind'
require 'csv'

module Geocoder::Lookup
  class Maxmind < Base

    private # ---------------------------------------------------------------

    def results(query)
      # don't look up a loopback address, just return the stored result
      return [reserved_result] if loopback_address?(query)
      begin
        doc = fetch_data(query)
        if doc && doc.size == 10
          return [doc]
        else
          warn "Maxmind error : #{doc[10]}" if doc
          return []
        end
      rescue StandardError => err
        raise_error(err)
        return []
      end
    end<commit_msg>Don't rescue from StandardError.<commit_after>require 'geocoder/lookups/base'
require 'geocoder/results/maxmind'
require 'csv'

module Geocoder::Lookup
  class Maxmind < Base

    private # ---------------------------------------------------------------

    def results(query)
      # don't look up a loopback address, just return the stored result
      return [reserved_result] if loopback_address?(query)
      begin
        doc = fetch_data(query)
        if doc && doc.size == 10
          return [doc]
        else
          warn "Maxmind error : #{doc[10]}" if doc
          return []
        end
      end
    end
{'fraction_non_alphanumeric': 0.17511520737327188, 'fraction_numerical': 0.006144393241167435, 'mean_word_length': 1.6591836734693877, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1760895', 'n_tokens_mistral': 354, 'n_tokens_neox': 341, 'n_words': 105}