def METHOD_NAME(cls, filename, *args, **kwargs):
    need_groups = ["Header"]
    veto_groups = ["Config", "Constants", "FOF", "Group", "Subhalo"]
    valid = True
    valid_fname = filename
    # If passed arg is a directory, look for the .0 file in that dir
    if os.path.isdir(filename):
        valid_files = []
        for f in os.listdir(filename):
            fname = os.path.join(filename, f)
            fext = os.path.splitext(fname)[-1]
            if (
                (".0" in f)
                and (fext not in {".ewah", ".kdtree"})
                and os.path.isfile(fname)
            ):
                valid_files.append(fname)
        if len(valid_files) == 0:
            valid = False
        elif len(valid_files) > 1:
            valid = False
        else:
            valid_fname = valid_files[0]
    try:
        fh = h5py.File(valid_fname, mode="r")
        valid = all(ng in fh["/"] for ng in need_groups) and not any(
            vg in fh["/"] for vg in veto_groups
        )
        # From Apr 2021, 7f1f06f, public gizmo includes a header variable
        # GIZMO_version, which is set to the year of the most recent commit
        # We should prefer this to checking the metallicity, which might
        # not exist
        if "GIZMO_version" not in fh["/Header"].attrs:
            dmetal = "/PartType0/Metallicity"
            if dmetal not in fh or (
                fh[dmetal].ndim > 1 and fh[dmetal].shape[1] < 11
            ):
                valid = False
        fh.close()
    except Exception:
        valid = False
        pass
    return valid