def METHOD_NAME(cls, config):
    """
    determine whether to load a hard-coded task or config from a generic one.
    via if a task string is available in config.
    """
    if config.task is not None:
        # TODO (huxu): expand the search scope.
        task_cls = getattr(tasks, config.task)
        return task_cls(config)
    else:
        return Task(config)