<commit_before>module Resque
  module Plugins
    module DynamicQueues
      module Attributes

        def get_dynamic_queue(key)
          redis.lrange("dynamic_queue:#{key}", 0, -1) || redis.lrange("dynamic_queue:default", 0, -1) || Resque.queues
        end

        def set_dynamic_queue(key, values)
          k = "dynamic_queue:#{key}"
          redis.del(k)
          Array(values).each do |v|
             redis.rpush(k, v)
          end
        end

        def get_dynamic_queues
          (redis.keys("dynamic_queue:*") || []).collect{|q| q.gsub('dynamic_queue:', '')}
        end<commit_msg>fix test failure - empty list evals to false<commit_after>module Resque
  module Plugins
    module DynamicQueues
      module Attributes

        def get_dynamic_queue(key)
          queue_names = redis.lrange("dynamic_queue:#{key}", 0, -1)

          if queue_names.nil? || queue_names.size == 0
            queue_names = redis.lrange("dynamic_queue:default", 0, -1)
          end
          
          if queue_names.nil? || queue_names.size == 0
            queue_names = Resque.queues
          end

          return queue_names
        end

        def set_dynamic_queue(key, values)
          k = "dynamic_queue:#{key}"
          redis.del(k)
          Array(values).each do |v|
             redis.rpush(k, v)
          end
        end

        def get_dynamic_queues
          (redis.keys("dynamic_queue:*") || []).collect{|q| q.gsub('dynamic_queue:', '')}
        end
{'fraction_non_alphanumeric': 0.11764705882352941, 'fraction_numerical': 0.0067613252197430695, 'mean_word_length': 1.9778672032193159, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1683477', 'n_tokens_mistral': 474, 'n_tokens_neox': 455, 'n_words': 95}