You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: eac_base_map.rb
    path of file: ./repos/archivesspace/backend/app/converters/lib
    
    the code of the file until where you have to start completion: module EACBaseMap
  def EAC_BASE_MAP(opts = {:import_events => false})
    import_events = opts[:import_events]

    {
      # AGENT PERSON
      "//eac-cpf//cpfDescription[child::identity/child::entityType='person']" => {
        :obj => :agent_person,
        :map => agent_person_base(import_events)
      },
      # AGENT CORPORATE ENTITY
      "//eac-cpf//cpfDescription[child::identity/child::entityType='corporateBody']" => {
        :obj => :agent_corporate_entity,
        :map => agent_corporate_entity_base(import_events)
      },
      # AGENT FAMILY
      "//eac-cpf//cpfDescription[child::identity/child::entityType='family']" => {
        :obj => :agent_family,
        :map => agent_family_base(import_events)
      }
    }
  end

  # agent person name attrs, followed by agent subrecs common to all types
  def agent_person_base(import_events)
    {
      '//identity/nameEntry' => agent_person_name_map(:name_person, :names),
      '//identity/nameEntryParallel/nameEntry[1]' => agent_person_name_with_parallel_map(:name_person, :names),
      "//localDescription[@localType='gender']" => agent_person_gender_map
    }.merge(base_map_subfields(import_events))
  end

  # agent corporate name attrs, followed by agent subrecs common to all types
  def agent_corporate_entity_base(import_events)
    {
      '//identity/nameEntry' => agent_corporate_entity_name_map(:name_corporate_entity, :names),
      '//identity/nameEntryParallel/nameEntry[1]' => agent_c
    
  def agent_corporate_entity_name_components_map
    {
      'self::nameEntry[@lang]' => proc { |name, node|
        name[:language] = node.attr('lang')
      },
      'descendant::part[@lang]' => proc { |name, node|
                                     name[:language] = node.attr('lang')
                                   },
      'self::nameEntry[@scriptCode]' => proc { |name, node|
        name[:script] = node.attr('scriptCode')
      },
      'self::nameEntry[@transliteration]' => proc { |name, node|
                                               name[:transliteration] = node.attr('transliteration')
                                             },
      "descendant::part[@localType='primary_name']" => proc { |name, node|
        val = node.inner_text
        name[:primary_name] = val
      },
      "descendant::part[@localType='subordinate_name_1']" => proc { |name, node|
        val = node.inner_text
        name[:subordinate_name_1] = val
      },
      "descendant::part[@localType='subordinate_name_2']" => proc { |name, node|
        val = node.inner_text
        name[:subordinate_name_2] = val
      },
      "descendant::part[@localType='numeration']" => proc { |name, node|
        val = node.inner_text
        name[:number] = val
      },
      "descendant::part[@localType='location']" => proc { |name, node|
        val = node.inner_text
        name[:location] = val
      },
      "descendant::part[@localType='dates']" => proc { |name, node|
        val = node.inner_text
        name[:dates] = val
      },
      "descendant::part[@localType='qualifier']" => proc { |name, node|
        val = node.inner_text
        name[:qualifier] = val
      },
      'descendant::authorizedForm' => proc { |name, node|
        val = node.inner_text
        name[:source] = val
        name[:authorized] = true
      },
      'descendant::alternativeForm' => proc { |name, node|
        val = node.inner_text
        name[:source] = val
        name[:authorized] = false
      },
      'descendant::part[not(@localType)]' => proc { |name, node|
        val = node.inner_text
        name[:primary_name] = val
      }, # if localType attr is not defined, assume primary_name
      "descendant::part[not(@localType='primary_name') and not(@localType='subordinate_name_1') and not(@localType='subordinate_name_2') and not(@localType='numeration') and not(@localType='location') and not(@localType='dates') and not(@localType='qualifier')]" => proc { |name, node|
        val = node.inner_text
        name[:primary_name] = val
      }, # if localType attr is something else
      'descendant::useDates//date' => agent_date_single_map('usage', :use_dates),
      'descendant::useDates//dateRange' => agent_date_range_map('usage', :use_dates)
    }
  end