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: archival_object.rb
    path of file: ./repos/archivesspace/frontend/app/models
    
    the code of the file until where you have to start completion: class ArchivalObject < JSONModel(:archival_object)

  def populate_from_accession(accession)
    values = accession.to_hash(:raw)

    # Recursively remove bits that don't make sense to copy (like "lock_version"
    # properties)
    values = JSONSchemaUtils.map_hash_with_schema(values, JSONModel(:accession).schema,
                                                        [proc { |hash, schema|
                                                          hash = hash.clone
                                                          hash.delete_if {|k, v| k.to_s =~ /^(id_[0-9]|lock_version|instances|deaccessions|collection_management|user_defined|external_documents)$/}
                                                          hash
         
    
  def populate_from_accession(accession)
    values = accession.to_hash(:raw)

    # Recursively remove bits that don't make sense to copy (like "lock_version"
    # properties)
    values = JSONSchemaUtils.map_hash_with_schema(values, JSONModel(:accession).schema,
                                                        [proc { |hash, schema|
                                                          hash = hash.clone
                                                          hash.delete_if {|k, v| k.to_s =~ /^(id_[0-9]|lock_version|instances|deaccessions|collection_management|user_defined|external_documents)$/}
                                                          hash
                                                        }])

    # We'll replace this with our own relationship, linking us back to the
    # accession we were spawned from.
    # values.delete('related_accessions')
    self.accession_links = [{'ref' => accession.uri, '_resolved' => accession}]

    notes ||= []

    if accession.content_description
      notes << JSONModel(:note_multipart).from_hash(:type => "scopecontent",
                                                    :label => I18n.t('accession.content_description'),
                                                    :subnotes => [{
                                                                    'content' => accession.content_description,
                                                                    'jsonmodel_type' => 'note_text'
                                                                  }])
    end

    if accession.condition_description
      notes << JSONModel(:note_singlepart).from_hash(:type => "physdesc",
                                                     :label => I18n.t('accession.condition_description'),
                                                     :content => [accession.condition_description])
    end