def clone(
        self, url: None | str = None, request: None | HttpRequest = None, **kwargs: Any
    ) -> Task:
        """Clone Task instance.

        Reset network_try_count, increase task_try_count.
        Reset priority attribute if it was not set explicitly.
        """
        if url and request:
            raise GrabMisuseError("Options url and request are mutually exclusive")
        # First, create exact copy of the current Task object
        attr_copy = deepcopy(self.__dict__)
        if not attr_copy["priority_set_explicitly"]:
            attr_copy["priority"] = None
        task = Task(**attr_copy)
        if url:
            task.request.url = url
        if request:
            task.request = request
        # Reset some task properties if they have not
        # been set explicitly in kwargs
        if "network_try_count" not in kwargs:
            task.network_try_count = 0
        if "task_try_count" not in kwargs:
            task.task_try_count = self.task_try_count + 1
        for key, value in kwargs.items():
            setattr(task, key, value)
        task.process_delay_option(None)
        return task
Clone Task instance.

        Reset network_try_count, increase task_try_count.
        Reset priority attribute if it was not set explicitly.
        
grab/spider/task.py