def METHOD_NAME(args):
    """show registered repositories and their namespaces"""
    roots = spack.config.get("repos", scope=args.scope)
    repos = []
    for r in roots:
        try:
            repos.append(spack.repo.Repo(r))
        except spack.repo.RepoError:
            continue
    if sys.stdout.isatty():
        msg = "%d package repositor" % len(repos)
        msg += "y." if len(repos) == 1 else "ies."
        tty.msg(msg)
    if not repos:
        return
    max_ns_len = max(len(r.namespace) for r in repos)
    for repo in repos:
        fmt = "%%-%ds%%s" % (max_ns_len + 4)
        print(fmt % (repo.namespace, repo.root))