<commit_before>module EncodingDotCom
  module AttributeRestrictionsZune
    def validate_size
      allowed_sizes = ["320x120", "320x180", "320x0", "0x120", "0x180"]
      unless size.nil? || allowed_sizes.include?(size)
        raise IllegalFormatAttribute.new("Size can only be one of #{allowed_sizes.join(',')} but was #{size}")
      end
    end
  end

  module AttributeRestrictionsIpod
    def validate_size
      allowed_sizes = ["320x240", "640x480"]
      unless size.nil? || allowed_sizes.include?(size)
        raise IllegalFormatAttribute.new("Size can only be one of #{allowed_sizes.join(',')} but was #{size}")
      end
    end
  end

  module AttributeRestrictionsFlv
    def validate_video_codec
      allowed_codecs = ["flv", "libx264", "vp6"]
      unless video_codec.nil? || allowed_codecs.include?(video_codec)
        raise IllegalFormatAttribute.new("Video codec can only be one of #{allowed_codecs.join(',')} but was #{video_codec}")
      end
    end
    
    def validate_size
      return if size.nil?
      if video_codec == "vp6" && ! size.split("x").all? {|n| (n.to_i % 16) == 0 }
        raise IllegalFormatAttribute.new("Dimensions #{} should be multiples of 16")
      end
    end
  end

  module AttributeRestrictionsMp4
    def validate_video_codec
      allowed_codecs = ["mpeg4", "libx264"]
      unless video_codec.nil? || allowed_codecs.include?(video_codec)
        raise IllegalFormatAttribute.new("Video codec can only be one of #{allowed_codecs.join(',')} but was #{video_codec}")
      end<commit_msg>Changing array syntax for validations<commit_after>module EncodingDotCom
  module AttributeRestrictionsZune
    def validate_size
      allowed_sizes = %w{320x120 320x180 320x0 0x120 0x180}
      unless size.nil? || allowed_sizes.include?(size)
        raise IllegalFormatAttribute.new("Size can only be one of #{allowed_sizes.join(',')} but was #{size}")
      end
    end
  end

  module AttributeRestrictionsIpod
    def validate_size
      allowed_sizes = %w{320x240 640x480}
      unless size.nil? || allowed_sizes.include?(size)
        raise IllegalFormatAttribute.new("Size can only be one of #{allowed_sizes.join(',')} but was #{size}")
      end
    end
  end

  module AttributeRestrictionsFlv
    def validate_audio_bitrate
      allowed_bitrates = %w{32k 40k 48k 56k 64k 80k 96k 112k 128k 144k 160k 192k 224k 256k 320k}
    end
    
    def validate_video_codec
      allowed_codecs = %w{flv libx264 vp6}
      unless video_codec.nil? || allowed_codecs.include?(video_codec)
        raise IllegalFormatAttribute.new("Video codec can only be one of #{allowed_codecs.join(',')} but was #{video_codec}")
      end
    end
    
    def validate_size
      return if size.nil?
      if video_codec == "vp6" && ! size.split("x").all? {|n| (n.to_i % 16) == 0 }
        raise IllegalFormatAttribute.new("Dimensions #{} should be multiples of 16")
      end
    end
  end

  module AttributeRestrictionsMp4
    def validate_video_codec
      allowed_codecs = %w{mpeg4 libx264}
      unless video_codec.nil? || allowed_codecs.include?(video_codec)
        raise IllegalFormatAttribute.new("Video codec can only be one of #{allowed_codecs.join(',')} but was #{video_codec}")
      end
{'fraction_non_alphanumeric': 0.1046115753636645, 'fraction_numerical': 0.04333023831631074, 'mean_word_length': 3.3794037940379402, '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': '5387267', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1020, 'n_words': 270}