def METHOD_NAME(root=None):
    if not root:
        broker = dr.Broker()
        broker[HostContext] = HostContext()
        yield broker
    else:
        def from_dir(d):
            # ctx is returned here, but its already in the broker so not needed
            _, broker = initialize_broker(d)
            return broker
        if os.path.isdir(root):
            yield from_dir(root)
        else:
            with extract(root) as ex:
                yield from_dir(ex.tmp_dir)