code: def read(calc_id, mode='r', datadir=None):
      
      datadir = datadir or get_datadir()
      dstore = DataStore(calc_id, datadir, mode=mode)
      try:
          hc_id = dstore['oqparam'].hazard_calculation_id
      except KeyError:  # no oqparam
          hc_id = None
      if hc_id:
          dstore.parent = read(hc_id, datadir=os.path.dirname(dstore.filename))
      return dstore
docs: :param calc_id: calculation ID or filename
      :param mode: 'r' or 'w'
      :param datadir: the directory where to look
      :returns: the corresponding DataStore instance
  
      Read the datastore, if it exists and it is accessible.