<commit_before>
module FlickrMocks
  class PhotoSizes
    attr_reader :sizes,:available_sizes
    alias_method :all, :sizes



    def initialize(object)
      raise TypeError, 'FlickRaw::Response expected' unless object.is_a? FlickRaw::Response
      self.available_sizes=object
      self.sizes=object
    end

    def [](index)
      @sizes[index]
    end

    def last
      @sizes[-1]
    end

    def first
      @sizes[0]
    end

    def method_missing(name,*args)
      return @sizes[size_index :'medium 640'] if name.downcase.to_sym == :medium_640
      return @sizes[size_index name] if size_index? name
      super
    end

    def each
      @sizes.each do |photo|
        yield photo
      end
    end

    def empty?
      @sizes.empty?
    end

    # required for HOBO I think?
    def member_class
    end

    def size_index(name)
      @available_sizes.find_index name.to_sym.downcase
    end

    def size_index?(name)
      !!size_index(name)
    end

    private
    def available_sizes=(data)
      @available_sizes=[]
      data.each do |datum|
        @available_sizes.push datum.label.downcase.to_sym
      end

    end

    def sizes=(data)
      @sizes=[]
      data.each do |datum|
        @sizes.push PhotoSize.new datum
      end
    end

  end
end
<commit_msg>using :size helper method in PhotoSize for PhotoSizes<commit_after>
module FlickrMocks
  class PhotoSizes
    attr_reader :sizes,:available_sizes
    alias_method :all, :sizes



    def initialize(object)
      raise TypeError, 'FlickRaw::Response expected' unless object.is_a? FlickRaw::Response
      self.available_sizes=object
      self.sizes=object
    end

    def [](index)
      @sizes[index]
    end

    def last
      @sizes[-1]
    end

    def first
      @sizes[0]
    end

    def method_missing(name,*args)
      return @sizes[size_index :'medium 640'] if name.downcase.to_sym == :medium_640
      return @sizes[size_index name] if size_index? name
      super
    end

    def each
      @sizes.each do |photo|
        yield photo
      end
    end

    def empty?
      @sizes.empty?
    end

    # required for HOBO I think?
    def member_class
    end

    def size_index(name)
      @available_sizes.find_index name.to_sym.downcase
    end

    def size_index?(name)
      !!size_index(name)
    end

    private
    def available_sizes=(data)
      @available_sizes=[]
      data.each do |datum|
        @available_sizes.push datum.size
      end

    end

    def sizes=(data)
      @sizes=[]
      data.each do |datum|
        @sizes.push PhotoSize.new datum
      end
    end

  end
end

{'fraction_non_alphanumeric': 0.08247027234369006, 'fraction_numerical': 0.006137322593018795, 'mean_word_length': 2.219753086419753, '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': '3732406', 'n_tokens_mistral': 906, 'n_tokens_neox': 868, 'n_words': 217}