old_contents: from ._tb_model import Model
  
  
  def _decode(hf):
      if 'tb_model' in hf or 'hop' in hf:
          return _decode_model(hf)
      elif 'val' in hf:
          return _decode_val(hf)
      elif '0' in hf:
          return _decode_iterable(hf)
      else:
          raise ValueError('File structure not understood.')
  
  
  def _decode_iterable(hf):
      return [_decode(hf[key]) for key in sorted(hf, key=int)]
  
  
  def _decode_model(hf):
      return Model.from_hdf5(hf)
  
  
  def _decode_val(hf):
      return hf['val'].value
  
new_contents: """
  Defines decoding for the legacy (pre fsc.hdf5-io) HDF5 format.
  """
  
  from ._tb_model import Model
  
  
  def _decode(hdf5_handle):
      """
      Decode the object at the given HDF5 node.
      """
      if 'tb_model' in hdf5_handle or 'hop' in hdf5_handle:
          return _decode_model(hdf5_handle)
      elif 'val' in hdf5_handle:
          return _decode_val(hdf5_handle)
      elif '0' in hdf5_handle:
          return _decode_iterable(hdf5_handle)
      else:
          raise ValueError('File structure not understood.')
  
  
  def _decode_iterable(hdf5_handle):
      return [_decode(hdf5_handle[key]) for key in sorted(hdf5_handle, key=int)]
  
  
  def _decode_model(hdf5_handle):
      return Model.from_hdf5(hdf5_handle)
  
  
  def _decode_val(hdf5_handle):
      return hdf5_handle['val'].value
  
subject: Fix pylint issues in legacy_decode.