code: def stage_hub(hub, staging=None):
      
      linknames = []
      if staging is None:
          staging = tempfile.mkdtemp()
      for obj, level in hub.leaves(base.HubComponent, intermediate=True):
          linknames.extend(stage(obj, staging))
  
      return staging, linknames
docs: Stage a hub by symlinking all its connected files to a local directory.