def METHOD_NAME(
    filename: str,
    extensions: t.Union["ValidExtensions", t.List["ValidExtensions"], None] = None,
) -> bool:
    """
    Return True if file has a valid workspace file type.
    Parameters
    ----------
    filename : str
        filename to check (e.g. ``mysession.json``).
    extensions : str or list
        filetypes to check (e.g. ``['.yaml', '.json']``).
    Returns
    -------
    bool
    """
    if extensions is None:
        extensions = [".yml", ".yaml", ".json"]
    extensions = [extensions] if isinstance(extensions, str) else extensions
    return any(filename.endswith(e) for e in extensions)