code: def get_nc_attrs(nc):
      
  
      meta = {
          'experiment': nc.experiment_id,
          'frequency': nc.frequency,
          'institute': nc.institute_id,
          'model': nc.model_id,
          'modeling_realm': nc.modeling_realm,
          'ensemble_member': 'r{}i{}p{}'.format(nc.realization, nc.initialization_method, nc.physics_version),
      }
  
      variable_name = get_var_name(nc)
      if variable_name:
          meta.update({'variable_name': variable_name})
  
      return meta
docs: Gets netCDF file metadata attributes.
  
      Arguments:
          nc (netCDF4.Dataset): an open NetCDF4 Dataset to pull attributes from.
  
      Returns:
          dict: Metadata as extracted from the netCDF file.