def _handle_run(
        self,
        context: "RunContext",
        env: "EnvVarsManager",
    ) -> int:
        """
        Lookup and delegate to the referenced task
        """
        import shlex

        named_arg_values, extra_args = self.get_parsed_arguments(env)
        env.update(named_arg_values)

        ref_invocation = (
            *(
                env.fill_template(token)
                for token in shlex.split(env.fill_template(self.spec.content.strip()))
            ),
            *extra_args,
        )

        task = self.ctx.specs.get(ref_invocation[0]).create_task(
            invocation=ref_invocation, ctx=TaskContext.from_task(self)
        )

        if task.has_deps():
            return self._run_task_graph(task, context, env)

        return task.run(context=context, parent_env=env)

        Lookup and delegate to the referenced task
        
poethepoet/task/ref.py