def start(self, *args, **kwargs):
        # Allow a queue to be specified either as a keyword argument when
        # starting the task, or as a class-level attribute on the task.
        queue_name = kwargs.pop('queue_name', self.queue_name)

        mapper_parameters = {
            'model': self.get_model_app_(),
            'kwargs': kwargs,
            'args': args,
            'namespace': settings.DATABASES.get(self.db, {}).get("NAMESPACE"),
            'db': self.db
        }
        if 'map' not in self.__class__.__dict__:
            raise Exception('No static map method defined on class {cls}'.format(self.__class__))
        mapper_parameters['_map'] = self.get_relative_path(self.map)
        if 'finish' in self.__class__.__dict__:
            mapper_parameters['_finish'] = self.get_relative_path(self.finish)

        # Calculate a sensible shard count if one isn't specified
        shard_count = self.shard_count or (self.model.objects.using(self.db).all()[:1000].count() / 100) + 1

        pipe = DjangaeMapperPipeline(
            self.job_name,
            'djangae.contrib.mappers.thunks.thunk_map',
            'djangae.contrib.mappers.readers.DjangoInputReader',
            params=mapper_parameters,
            shards=shard_count
        )
        pipe.with_params(target=self.target)
        pipe.start(base_path=PIPELINE_BASE_PATH, queue_name=queue_name)
dataset/ETHPy150Open potatolondon/djangae/djangae/contrib/mappers/pipes.py/MapReduceTask.start/original