def METHOD_NAME(vdir=None,legacy=False,reload=False):
    global __hosts
    if len(list(__hosts.keys())) == 0 or reload:
        __hosts.clear()
        if legacy:
            llnl_open, llnl_closed = legacy_vutils_engine_profiles()
            __hosts.update(llnl_open)
            __hosts.update(llnl_closed)
        else:
            if vdir is None:
                if "VISITHOME" not in os.environ:
                    raise VisItException("hosts() requires VISITHOME env var or explicit vdir argument")
                vdir = os.environ["VISITHOME"]
            hpf_files = glob.glob(pjoin(vdir,".visit","hosts","*.xml"))
            for hpf_file in hpf_files:
                try:
                    hpf = HostProfile.load(hpf_file)
                    __hosts[hpf.name] = hpf
                except:
                    print("[warning: Could not load host profile: '%s']" % hpf_file)
    return __hosts