<commit_before>module YouGotListed
  class Response
    
    attr_accessor :ygl_response
    
    def initialize(response, raise_error = true)
      rash = Hashie::Rash.new(response)
      self.ygl_response = rash.ygl_response
      raise Error.new(self.ygl_response.response_code, self.ygl_response.error) if !success? && raise_error
    end
    
    def success?
      self.ygl_response.response_code.to_i < 300
    end
    
    def method_missing(method_name, *args)
      if self.ygl_response.respond_to?(method_name)
        self.ygl_response.send(method_name)
      else
        super
      end
    end
    
  end
end
<commit_msg>rescue nil for response in the success? method<commit_after>module YouGotListed
  class Response
    
    attr_accessor :ygl_response
    
    def initialize(response, raise_error = true)
      rash = Hashie::Rash.new(response)
      self.ygl_response = rash.ygl_response
      raise Error.new(self.ygl_response.response_code, self.ygl_response.error) if !success? && raise_error
    end
    
    def success?
      self.ygl_response && self.ygl_response.respond_to?(:response_code) && self.ygl_response.response_code.to_i < 300
    end
    
    def method_missing(method_name, *args)
      if self.ygl_response.respond_to?(method_name)
        self.ygl_response.send(method_name)
      else
        super
      end
    end
    
  end
end

{'fraction_non_alphanumeric': 0.07709090909090908, 'fraction_numerical': 0.004363636363636364, 'mean_word_length': 2.811634349030471, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4714501', 'n_tokens_mistral': 464, 'n_tokens_neox': 455, 'n_words': 85}