code: def create_publication_assistant(self, **args):
          '''
          Create an assistant for a dataset that allows to make PID
          requests for the dataset and all of its files.
          :param drs_id: Mandatory. The dataset id of the dataset
              to be published.
          :param version_number: Mandatory. The version number of the
              dataset to be published.
          :param is_replica: Mandatory. Flag to indicate whether the
              dataset is a replica.
          .. note:: If the replica flag is set to False, the publication
              may still be considered a replica by the consuming servlet,
              namely if the dataset was already published at a different
              host. For this, please refer to the consumer documentation.
          :return: A publication assistant which provides all necessary
              methods to publish a dataset and its files.
          '''
          logdebug(LOGGER, 'Creating publication assistant..')
          mandatory_args = ['drs_id', 'version_number', 'is_replica']
          esgfpid.utils.check_presence_of_mandatory_args(args, mandatory_args)
          if self.__thredds_service_path is None:
              msg = 'No thredds_service_path given (but it is mandatory for publication)'
              logwarn(LOGGER, msg)
              raise esgfpid.exceptions.ArgumentError(msg)
          if self.__data_node is None:
              msg = 'No data_node given (but it is mandatory for publication)'
              logwarn(LOGGER, msg)
              raise esgfpid.exceptions.ArgumentError(msg)
          if self.__coupler.is_solr_switched_off():
              pass
          assistant = esgfpid.assistant.publish.DatasetPublicationAssistant(
              drs_id=args['drs_id'],
              version_number=args['version_number'],
              thredds_service_path=self.__thredds_service_path,
              data_node=self.__data_node,
              prefix=self.prefix,
              coupler=self.__coupler,
              is_replica=args['is_replica'],
              consumer_solr_url=self.__consumer_solr_url
          )
          logdebug(LOGGER, 'Creating publication assistant.. done')
          return assistant