code: def get_schema(dataset):
      """Retrieves schema object stored as part of dataset methadata.
  
      :param dataset: an instance of :class:`pyarrow.parquet.ParquetDataset object`
      :return: A :class:`petastorm.unischema.Unischema` object
      """
      if not dataset.common_metadata:
          raise PetastormMetadataError(
              "Could not find _common_metadata file. Use materialize_dataset(..) in"
              " petastorm.etl.dataset_metadata.py to generate this file in your ETL code."
              " You can generate it on an existing dataset using petastorm-generate-metadata.py"
          )
  
      dataset_metadata_dict = dataset.common_metadata.metadata
  
      # Read schema
      if UNISCHEMA_KEY not in dataset_metadata_dict:
          raise PetastormMetadataError(
              "Could not find the unischema in the dataset common metadata file."
              " Please provide or generate dataset with the unischema attached."
              " Common Metadata file might not be generated properly."
              " Make sure to use materialize_dataset(..) in petastorm.etl.dataset_metadata to"
              " properly generate this file in your ETL code."
              " You can generate it on an existing dataset using petastorm-generate-metadata.py"
          )
      ser_schema = dataset_metadata_dict[UNISCHEMA_KEY]
      # Since we have moved the unischema class around few times, unpickling old schemas will not work. In this case we
      # override the old import path to get backwards compatibility
  
      schema = depickle_legacy_package_name_compatible(ser_schema)
  
      return schema
  
imports: import json
  import logging
  import os
  from concurrent import futures
  from contextlib import contextmanager
  from operator import attrgetter
  from urllib.parse import urlparse
  from packaging import version
  from pyarrow import parquet
  from six.moves import cPickle
  from petastorm import utils
  from petastorm.etl.legacy import depickle_legacy_package_name_compatible
  from petastorm.fs_utils import FilesystemResolver, get_filesystem_and_path_or_paths, get_dataset_path
  from petastorm.unischema import Unischema
label_desc: Use image node_id 10 for calling a global function with example usage: get_schema(dataset) and returns: schema