<commit_before>module Lyric
  module RestAPIMethods
    require 'json'
    require 'httparty'

  
    def user
     # api_address = 'https://api.honeywell.com/v2/'
      response = HTTParty.get("https://api.honeywell.com/v2/locations?apikey=<KEY>",
                              :headers => {"Authorization" => "Bearer #{self.access_token}"})
        if response['code'] == 401
            response['message']
        else
            Lyric::Model::User.new(response)
        end
    end
    
    def refresh_token(refresh_token)
    end
    
  end
end
<commit_msg>adding in fix for expired token<commit_after>module Lyric
  module RestAPIMethods
    require 'json'
    require 'httparty'

  
    def user
     # api_address = 'https://api.honeywell.com/v2/'
      response = HTTParty.get("https://api.honeywell.com/v2/locations?apikey=<KEY>",
                              :headers => {"Authorization" => "Bearer #{self.access_token}"})
        if response.class == Hash
            response['message']
        else
            Lyric::Model::User.new(response)
        end
    end
    
    def refresh_token(refresh_token)
    end
    
  end
end

{'fraction_non_alphanumeric': 0.11944202266782912, 'fraction_numerical': 0.006102877070619006, 'mean_word_length': 2.0777479892761392, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 4, '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': '90055', 'n_tokens_mistral': 355, 'n_tokens_neox': 350, 'n_words': 67}