code: def test_import_url_preserve_fields(tmp_dir, dvc):
      text = textwrap.dedent(
          """\
          # top comment
          desc: top desc
          deps:
          - path: foo # dep comment
          outs:
          - path: bar # out comment
            desc: out desc
            type: mytype
            labels:
            - label1
            - label2
            meta:
              key: value
          meta: some metadata
      """
      )
      tmp_dir.gen("bar.dvc", text)
  
      tmp_dir.gen("foo", "foo")
      dvc.imp_url("foo", out="bar")
      assert (tmp_dir / "bar.dvc").read_text() == textwrap.dedent(
          """\
          # top comment
          desc: top desc
          deps:
          - path: foo # dep comment
            md5: acbd18db4cc2f85cedef654fccc4a4d8
            size: 3
            hash: md5
          outs:
          - path: bar # out comment
            desc: out desc
            type: mytype
            labels:
            - label1
            - label2
            meta:
              key: value
            md5: acbd18db4cc2f85cedef654fccc4a4d8
            size: 3
            hash: md5
          meta: some metadata
          md5: 8fc199641730e3f512deac0bd9a0e0b6
          frozen: true
      """
      )
  
imports: import os
  import textwrap
  from uuid import uuid4
  import pytest
  from dvc.cli import main
  from dvc.dependency.base import Dependency, DependencyDoesNotExistError
  from dvc.dvcfile import load_file
  from dvc.exceptions import InvalidArgumentError
  from dvc.stage import Stage
  from dvc.testing.workspace_tests import TestImport
  from tests.utils import get_gitignore_content
label_desc: Use image node_id 10 for calling a global function with example usage: test_import_url_preserve_fields(tmp_dir, dvc) without return types