code: def test_open_not_cached(dvc):
      metric_file = "metric.txt"
      metric_content = "0.6"
      metric_code = (
          f"open('{metric_file}', 'w').write('{metric_content}')"
      )
      dvc.run(
          name="write-metric",
          metrics_no_cache=[metric_file],
          cmd=f'python -c "{metric_code}"',
      )
  
      with api.open(metric_file) as fd:
          assert fd.read() == metric_content
  
      os.remove(metric_file)
      with pytest.raises(PathMissingError):
          api.read(metric_file)
  
imports: import os
  import pytest
  from funcy import first, get_in
  from dvc import api
  from dvc.exceptions import OutputNotFoundError, PathMissingError
  from dvc.testing.api_tests import TestAPI
  from dvc.testing.tmp_dir import make_subrepo
  from dvc.utils.fs import remove
label_desc: Use image node_id 7 for calling a global function with example usage: test_open_not_cached(dvc) without return types