code: def read_header(fo):
      """Extract an avro file's header
  
      fo: file-like
          This should be in bytes mode, e.g., io.BytesIO
  
      Returns dict representing the header
  
      Parameters
      ----------
      fo: file-like
      """
      assert fo.read(len(MAGIC)) == MAGIC, "Magic avro bytes missing"
      meta = {}
      out = {"meta": meta}
      while True:
          n_keys = read_long(fo)
          if n_keys == 0:
              break
          for _ in range(n_keys):
              # ignore dtype mapping for bag version
              read_bytes(fo)  # schema keys
              read_bytes(fo)  # schema values
      out["sync"] = fo.read(SYNC_SIZE)
      out["header_size"] = fo.tell()
      fo.seek(0)
      out["head_bytes"] = fo.read(out["header_size"])
      return out
  
file_path: dask/dask/bag/avro.py
imports: from __future__ import annotations
  import io
  import uuid
  from fsspec.core import OpenFile, get_fs_token_paths, open_files
  from fsspec.utils import read_block
  from fsspec.utils import tokenize
  from dask.highlevelgraph import HighLevelGraph
label_desc: Use image node_id 3 for calling a global function with example usage: read_header(fo) and returns: out