def METHOD_NAME(self, *args, **options):
    manuscript_ids = options["manuscript_ids"]
    manuscript_mapping_dict = dict(zip(manuscript_ids, options["mapping_data"]))
    task = options.get("task", None)
    for manuscript_id in manuscript_ids:
        input_data = manuscript_mapping_dict[manuscript_id]
        # Query database for manuscript id.
        try:
            manuscript = Manuscript.objects.get(id=manuscript_id)
        except IOError:
            raise IOError(f"Manuscript {manuscript_id} does not exist")
        # If input_data is a string, it should be a csv file name
        # where mapping data is persisted. Attempt to read it.
        # If input_data is a list, it should be the mapping data itself.
        if isinstance(input_data, str):
            try:
                mapping_data = csv.DictReader(
                    open(f"{options['csvs_path']}/{input_data}", "r")
                )
            except IOError:
                raise IOError(
                    f"File {options['csvs_path']}/{input_data} does not exist"
                )
        elif isinstance(input_data, list):
            mapping_data = input_data
        self.stdout.write(f"Starting import process for manuscript {manuscript_id}")
        # Iterate through rows in the mapping_data.
        for index, row in enumerate(mapping_data):
            folio = row["folio"]
            uri = row["uri"]
            # Save in the Django DB
            try:
                folio_obj = Folio.objects.get(
                    number=folio, manuscript__id=manuscript_id
                )
            except Folio.DoesNotExist:
                # If no folio is found, create one
                folio_obj = Folio()
                folio_obj.number = folio
                folio_obj.manuscript = manuscript
            folio_obj.image_uri = uri
            folio_obj.save()
            if task:
                task.update_state(state="STARTED", meta={"folios_imported": index})
            if index > 0 and index % 50 == 0:
                self.stdout.write(f"Imported {index} folios")
        manuscript.save()
        self.stdout.write(
            f"All folios of manuscript {manuscript_id} have been imported"
        )
    # Refreshing Solr chants is necessary since chants have a field image_uri
    # which is used when clicking on a search result. Folio records in solr
    # are already updated during the database saving process through the solr_sync
    # signal, but chant records are not because no interaction occurs with the chant
    # object in the database.
    if options["refresh"]:
        self.stdout.write("Refreshing Solr chants after folio import")
        call_command(
            "refresh_solr", record_type="chants", manuscript_ids=manuscript_ids
        )
    else:
        self.stdout.write(
            "Import process completed. To refresh Solr,"
            "use './manage.py refresh_solr chants [manuscript_id ...]'"
        )
    for manuscript_id in manuscript_ids:
        manuscript = Manuscript.objects.get(id=manuscript_id)
        manuscript.is_mapped = "MAPPED"
        manuscript.save()