def METHOD_NAME(mode=os.O_RDWR, allowlossy=False):
    """
    Find the available file formats
    mode (os.O_RDONLY, os.O_WRONLY, or os.O_RDWR): whether only list
        formats which can be read, which can be written, or all of them.
    allowlossy (bool): If True, will also return the formats that can lose some
      of the original information (when writing the data to a file)
    return (dict string -> list of strings): name of each format -> list of
        extensions
    """
    formats = {}
    # Look dynamically which format is available
    for module_name in _iomodules:
        try:
            exporter = importlib.import_module("." + module_name, "odemis.dataio")
        except Exception:
            logging.info("Skipping exporter %s, which failed to load", module_name)
            continue # module cannot be loaded
        if not allowlossy and exporter.LOSSY:
            logging.debug("Skipping exporter %s as it is lossy", module_name)
            continue
        if ((mode == os.O_RDWR) or
            (mode == os.O_RDONLY and (hasattr(exporter, "read_data") or hasattr(exporter, "open_data"))) or
            (mode == os.O_WRONLY and hasattr(exporter, "export"))
           ):
            formats[exporter.FORMAT] = exporter.EXTENSIONS
    if not formats:
        logging.error("No file converter found!")
    return formats