<commit_before># encoding: utf-8

require_relative 'group_presenter'

module Carto
  module Api
    class OrganizationPresenter

      def initialize(organization)
        @organization = organization
      end

      def to_poro
        return {} if @organization.nil?
        filtered_user ||= @organization.owner
        {
          :created_at       => @organization.created_at,
          :description      => @organization.description,
          :discus_shortname => @organization.discus_shortname,
          :display_name     => @organization.display_name,
          :id               => @organization.id,
          :name             => @organization.name,
          :owner            => {
            :id         => @organization.owner ? @organization.owner.id : nil,
            :username   => @organization.owner ? @organization.owner.username : nil,
            :avatar_url => @organization.owner ? @organization.owner.avatar_url : nil,
            :email      => @organization.owner ? @organization.owner.email : nil,
            :groups     => @organization.owner && @organization.owner.groups ? @organization.owner.groups.map { |g| Carto::Api::GroupPresenter.new(g).to_poro } : []
          },
          :quota_in_bytes           => @organization.quota_in_bytes,
          :unassigned_quota         => @organization.unassigned_quota,
          :geocoding_quota          => @organization.geocoding_quota,
          :here_isolines_quota      => @organization.here_isolines_quota,
          :here_isolines_block_price => @organization.here_isolines_block_price,
          :obs_snapshot_quota       => @organization.obs_snapshot_quota,
          :obs_snapshot_block_price => @organization.obs_snapshot_block_price,
          :obs_general_quota        => @organization.obs_general_quota,
          :obs_general_block_price  => @organization.obs_general_block_price,
          :map_view_quota           => @organization.map_view_quota,
          :twitter_datasource_quota => @organization.twitter_datasource_quota,
          :map_view_block_price     => @organization.map_view_block_price,
          :geocoding_block_price    => @organization.geocoding_block_price,
          :seats                    => @organization.seats,
          :twitter_username         => @organization.twitter_username,
          :location                 => @organization.location,
          :updated_at               => @organization.updated_at,
          :website          => @organization.website,
          :admin_email      => @organization.admin_email,
          :avatar_url       => @organization.avatar_url<commit_msg>Organization viewer seats at presenter #7727<commit_after># encoding: utf-8

require_relative 'group_presenter'

module Carto
  module Api
    class OrganizationPresenter

      def initialize(organization)
        @organization = organization
      end

      def to_poro
        return {} if @organization.nil?
        filtered_user ||= @organization.owner
        {
          :created_at       => @organization.created_at,
          :description      => @organization.description,
          :discus_shortname => @organization.discus_shortname,
          :display_name     => @organization.display_name,
          :id               => @organization.id,
          :name             => @organization.name,
          :owner            => {
            :id         => @organization.owner ? @organization.owner.id : nil,
            :username   => @organization.owner ? @organization.owner.username : nil,
            :avatar_url => @organization.owner ? @organization.owner.avatar_url : nil,
            :email      => @organization.owner ? @organization.owner.email : nil,
            :groups     => @organization.owner && @organization.owner.groups ? @organization.owner.groups.map { |g| Carto::Api::GroupPresenter.new(g).to_poro } : []
          },
          :quota_in_bytes           => @organization.quota_in_bytes,
          :unassigned_quota         => @organization.unassigned_quota,
          :geocoding_quota          => @organization.geocoding_quota,
          :here_isolines_quota      => @organization.here_isolines_quota,
          :here_isolines_block_price => @organization.here_isolines_block_price,
          :obs_snapshot_quota       => @organization.obs_snapshot_quota,
          :obs_snapshot_block_price => @organization.obs_snapshot_block_price,
          :obs_general_quota        => @organization.obs_general_quota,
          :obs_general_block_price  => @organization.obs_general_block_price,
          :map_view_quota           => @organization.map_view_quota,
          :twitter_datasource_quota => @organization.twitter_datasource_quota,
          :map_view_block_price     => @organization.map_view_block_price,
          :geocoding_block_price    => @organization.geocoding_block_price,
          :seats                    => @organization.seats,
          :viewer_seats             => @organization.viewer_seats,
          :twitter_username         => @organization.twitter_username,
          :location                 => @organization.location,
          :updated_at               => @organization.updated_at,
          :website          => @organization.website,
          :admin_email      => @organization.admin_email,
          :avatar_url       => @organization.avatar_url
{'fraction_non_alphanumeric': 0.09830827067669173, 'fraction_numerical': 0.0011278195488721805, 'mean_word_length': 2.2248484848484846, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 68, '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': '6031980', 'n_tokens_mistral': 1531, 'n_tokens_neox': 1428, 'n_words': 202}