def METHOD_NAME(file_name, mode):
  """
  Wraps libtbx.smart_open.
  Parameters
  ----------
  file_name : str
  mode : str
  Returns
  -------
  file
  """
  file_name = os.path.expanduser(file_name)
  try: return smart_open.file(file_name=file_name, mode=mode)
  except IOError as e:
    raise IOError("Cannot open pickle file %s (%s)" % (
      show_string(file_name), str(e)))