def METHOD_NAME(filename: str, **kwargs):
    """Open a dfs/mesh file (and read the header)
    The typical workflow for small dfs files is to read all data
    with *mikeio.read* instead of using this function. For big files, however,
    it can be convenient to open the file first with *dfs=mikeio.open(...)* to
    inspect it's content (items, time and shape) and then decide what to
    read using dfs.read(...)
    Parameters
    ----------
    filename
        full path and file name to the dfs file.
    type : str, optional
        Dfs2 only. Additional information about the file, e.g.
        "spectral" for spectral dfs2 files. By default: None.
    See also
    --------
    mikeio.read - read data from a dfs file
    Examples
    --------
    >>> dfs = mikeio.open("wl.dfs1")
    >>> dfs = mikeio.open("HD2D.dfsu")
    >>> ds = dfs.read(items="Salinity", time="2016-01")
    >>> dfs = mikeio.open("pt_spectra.dfs2", type="spectral")
    """
    file_format = os.path.splitext(filename)[1].lower()[1:]
    READERS = {
        "dfs0": Dfs0,
        "dfs1": Dfs1,
        "dfs2": Dfs2,
        "dfs3": Dfs3,
        "dfsu": Dfsu,
        "mesh": Mesh,
    }
    if file_format not in READERS:
        valid_formats = ", ".join(READERS.keys())
        raise Exception(
            f"{file_format} is not a supported format for mikeio.open. Valid formats are {valid_formats}"
        )
    reader_klass = READERS[file_format]
    return reader_klass(filename, **kwargs)