<commit_before>module FanSQS
  class QueueWrapper
    @cache ||= {} # cache for queues

    class << self
      # Find out if the queue exists. If it does not exist, create a new one
      # This line below has a high chance of causing confusion as it will try to use either FanSQS::Queue or AWS::SQS::Queue. Maybe use the class from AWS gem instead?
      def instantiate(qname)
        name = formatted_queue_name(qname)
        exists?(name) || create_new(name)
      end

      def create_new(name)
          puts "GOT HERE3"
        AWS.sqs.queues.create(name.to_s)
      end

      def cache
        @cache
      end

      def exists?(qname)
        if @cache[qname]
          puts "GOT HERE1"
          return @cache[qname]
        else
          puts "GOT HERE2"
          return @cache[qname] = AWS.sqs.queues.named(formatted_queue_name(qname)) while @cache[qname] == nil
        end
      rescue AWS::SQS::Errors::NonExistentQueue
        return false
      end<commit_msg>removed funny messages<commit_after>module FanSQS
  class QueueWrapper
    @cache ||= {} # cache for queues

    class << self
      # Find out if the queue exists. If it does not exist, create a new one
      # This line below has a high chance of causing confusion as it will try to use either FanSQS::Queue or AWS::SQS::Queue. Maybe use the class from AWS gem instead?
      def instantiate(qname)
        name = formatted_queue_name(qname)
        exists?(name) || create_new(name)
      end

      def create_new(name)
        AWS.sqs.queues.create(name.to_s)
      end

      def cache
        @cache
      end

      def exists?(qname)
        if @cache[qname]
          return @cache[qname]
        else
          return @cache[qname] = AWS.sqs.queues.named(formatted_queue_name(qname)) while @cache[qname] == nil
        end
      rescue AWS::SQS::Errors::NonExistentQueue
        return false
      end
{'fraction_non_alphanumeric': 0.08333333333333333, 'fraction_numerical': 0.0015822784810126582, 'mean_word_length': 2.2706896551724136, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2331902', 'n_tokens_mistral': 593, 'n_tokens_neox': 577, 'n_words': 184}