code: def mock_daemon(mocker):
      def func(argv):
          return main(["daemon", *argv])
  
      return mocker.patch(
          "dvc.daemon.daemon", mocker.MagicMock(side_effect=func)
      )
  
file_path: dvc/tests/func/test_analytics.py
imports: import os
  import pytest
  from dvc.analytics import _scm_in_use, collect_and_send_report
  from dvc.cli import main
  from dvc.repo import Repo
  from tests.utils import ANY
label_desc: Use image node_id 3 for calling a global function with example usage: mock_daemon(mocker) and returns: mocker, main