def submit_task_to_transport(self, task, grab):
        if self.only_cache:
            self.stat.inc('spider:request-network-disabled-only-cache')
        else:
            grab_config_backup = grab.dump_config()
            self.process_grab_proxy(task, grab)
            self.stat.inc('spider:request-network')
            self.stat.inc('spider:task-%s-network' % task.name)
            with self.timer.log_time('network_transport'):
                logger_verbose.debug('Submitting task to the transport '
                                     'layer')
                try:
                    self.transport.start_task_processing(
                        task, grab, grab_config_backup)
                except GrabInvalidUrl:
                    logger.debug('Task %s has invalid URL: %s' % (
                        task.name, task.url))
                    self.stat.collect('invalid-url', task.url)
dataset/ETHPy150Open lorien/grab/grab/spider/base.py/Spider.submit_task_to_transport/original