code: def _show_tree(
      fid,
      tree,
      indent,
      level,
      read_limit,
      max_str,
      tag_id,
      *,
      show_bytes=False,
  ):
      """Show FIFF tree."""
      this_idt = indent * level
      next_idt = indent * (level + 1)
      # print block-level information
      found_types = "/".join(_find_type(tree["block"], fmts=["FIFFB_"]))
      out = [
          f"{this_idt}{str(int(tree['block'])).ljust(4)} = {found_types}"
      ]
      tag_found = False
      if tag_id is None or out[0].strip().startswith(str(tag_id)):
          tag_found = True
  
      if tree["directory"] is not None:
          kinds = [ent.kind for ent in tree["directory"]] + [-1]
          types = [ent.type for ent in tree["directory"]]
          sizes = [ent.size for ent in tree["directory"]]
          poss = [ent.pos for ent in tree["directory"]]
          counter = 0
          good = True
          for k, kn, size, pos, type_ in zip(
              kinds[:-1], kinds[1:], sizes, poss, types
          ):
              if not tag_found and k != tag_id:
                  continue
              tag = Tag(
                  kind=k,
                  type=type_,
                  size=size,
                  next=FIFF.FIFFV_NEXT_NONE,
                  pos=pos,
              )
              if read_limit is None or size <= read_limit:
                  try:
                      tag = read_tag(fid, pos)
                  except Exception:
                      good = False
  
              if kn == k:
                  # don't print if the next item is the same type (count 'em)
                  counter += 1
              else:
                  if show_bytes:
                      at = f" @{pos}"
                  else:
                      at = ""
                  # find the tag type
                  this_type = _find_type(k, fmts=["FIFF_"])
                  # prepend a count if necessary
                  prepend = (
                      "x" + str(counter + 1) + ": "
                      if counter > 0
                      else ""
                  )
                  postpend = ""
                  # print tag data nicely
                  if tag.data is not None:
                      postpend = " = " + str(tag.data)[:max_str]
                      if isinstance(tag.data, np.ndarray):
                          if tag.data.size > 1:
                              postpend += " ... array size=" + str(
                                  tag.data.size
                              )
                      elif isinstance(tag.data, dict):
                          postpend += " ... dict len=" + str(
                              len(tag.data)
                          )
                      elif isinstance(tag.data, str):
                          postpend += " ... str len=" + str(
                              len(tag.data)
                          )
                      elif isinstance(tag.data, (list, tuple)):
                          postpend += " ... list len=" + str(
                              len(tag.data)
                          )
                      elif issparse(tag.data):
                          postpend += (
                              f" ... sparse ({tag.data.getformat()}) shape="
                              f"{tag.data.shape}"
                          )
                      else:
                          postpend += " ... type=" + str(type(tag.data))
                  postpend = (
                      ">" * 20 + f"BAD @{pos}" if not good else postpend
                  )
                  matrix_info = _matrix_info(tag)
                  if matrix_info is not None:
                      _, type_, _, _ = matrix_info
                  type_ = _call_dict_names.get(type_, f"?{type_}?")
                  this_type = "/".join(this_type)
                  out += [
                      f"{next_idt}{prepend}{str(k).ljust(4)} = "
                      f"{this_type}{at} ({size}b {type_}) {postpend}"
                  ]
                  out[-1] = out[-1].replace("\n", "¶")
                  counter = 0
                  good = True
          if tag_id in kinds:
              tag_found = True
      if not tag_found:
          out = [""]
          level = -1  # removes extra indent
      # deal with children
      for branch in tree["children"]:
          out += _show_tree(
              fid,
              branch,
              indent,
              level + 1,
              read_limit,
              max_str,
              tag_id,
              show_bytes=show_bytes,
          )
      return out
  
imports: import os.path
  from gzip import GzipFile
  from io import SEEK_SET, BytesIO
  import numpy
  from scipy.sparse import issparse
  from ..utils import _file_like, logger, verbose, warn
  from .constants import FIFF
  from .tag import Tag, _call_dict_names, _matrix_info, _read_tag_header, read_tag
  from .tree import dir_tree_find, make_dir_tree
label_desc: Use image node_id 7 for calling a global function with example usage: _show_tree(fid, tree, indent, level, read_limit, max_str, tag_id) and returns: out