def METHOD_NAME(file_name, hkl_in=None, expected_labels=None, out=sys.stdout):
  from iotbx import file_reader
  if (hkl_in is None):
    hkl_in = file_reader.any_file(file_name,
      force_type="hkl",
      raise_sorry_if_errors=True)
  miller_arrays = hkl_in.file_server.miller_arrays
  obs = None
  all_fs = []
  all_fs_anom = []
  all_is = []
  all_is_anom = []
  print("Reading data from %s..." % hkl_in.file_name, file=out)
  for array in miller_arrays :
    labels = array.info().label_string()
    if (labels == expected_labels):
      obs = array
      break
    elif (expected_labels is None):
      if (array.is_xray_amplitude_array()):
        if (array.anomalous_flag()):
          all_fs_anom.append(array)
        else :
          all_fs.append(array)
      elif (array.is_xray_intensity_array()):
        if (array.anomalous_flag()):
          all_is_anom.append(array)
        else :
          all_is.append(array)
  if (obs is None):
    for choices in [all_fs_anom,all_is_anom,all_fs,all_is] :
      if (len(choices) > 1):
        raise Sorry(("Multiple equally good candidates for data:\n%s\n"+
          "Please specify labels=<your choice here>.") %
          "\n".join([ a.info().label_string() for a in choices ]))
      elif (len(choices) == 1):
        obs = choices[0]
        print("Defaulting to data in %s" % obs.info().label_string(), file=out)
        break
  return obs