code: def test_ls_granular(erepo_dir, M):
      with erepo_dir.chdir():
          erepo_dir.dvc_gen(
              {
                  "dir": {
                      "1": "1",
                      "2": "2",
                      "subdir": {"foo": "foo", "bar": "bar"},
                  }
              },
              commit="create dir",
          )
  
      entries = Repo.ls(
          os.fspath(erepo_dir), os.path.join("dir", "subdir")
      )
      assert entries == [
          {
              "isout": True,
              "isdir": False,
              "isexec": False,
              "path": "bar",
              "size": 3,
          },
          {
              "isout": True,
              "isdir": False,
              "isexec": False,
              "path": "foo",
              "size": 3,
          },
      ]
  
      entries = Repo.ls(os.fspath(erepo_dir), "dir")
      assert entries == [
          {
              "isout": True,
              "isdir": False,
              "isexec": False,
              "path": "1",
              "size": 1,
          },
          {
              "isout": True,
              "isdir": False,
              "isexec": False,
              "path": "2",
              "size": 1,
          },
          {
              "isout": True,
              "isdir": True,
              "isexec": False,
              "path": "subdir",
              "size": M.instance_of(int),
          },
      ]
  
imports: import os
  import shutil
  import textwrap
  from operator import itemgetter
  import pytest
  from dvc.repo import Repo
  from dvc.scm import CloneError
label_desc: Use image node_id 29 for calling a global function with example usage: test_ls_granular(erepo_dir, M) without return types