human
Complete the below
def do_ls(args, pwd, default='.', onabort=None, spec_prefix=''):

    ''''Output a listing of a file or directory in the bup repository.
    When a long listing is not requested and stdout is attached to a
    tty, the output is formatted in columns. When not attached to tty
    (for example when the output is piped to another command), one
    file is listed per line.'
    '''
 ... Write me a the Python program you requested?
assistant
#Here is the Python program you requested.
    if onabort:
        o = options.Options((optspec % spec_prefix), onabort=onabort)
    else:
        o = options.Options((optspec % spec_prefix))
    (opt, flags, extra) = o.parse(args)
    classification = None
    show_hidden = None
    for flag in flags:
        (option, parameter) = flag
        if (option in ('-F', '--classify')):
            classification = 'all'
        elif (option == '--file-type'):
            classification = 'type'
        elif (option in ('-a', '--all')):
            show_hidden = 'all'
        elif (option in ('-A', '--almost-all')):
            show_hidden = 'almost'
    L = []
    def output_node_info(node, name):
        info = node_info(node, name, show_hash=opt.hash, long_fmt=opt.l, classification=classification, numeric_ids=opt.numeric_ids, human_readable=opt.human_readable)
        if ((not opt.l) and istty1):
            L.append(info)
        else:
            print info
    ret = 0
    for path in (extra or [default]):
        try:
            if opt.directory:
                n = pwd.lresolve(path)
            else:
                n = pwd.try_resolve(path)
            if ((not opt.directory) and stat.S_ISDIR(n.mode)):
                if (show_hidden == 'all'):
                    output_node_info(n, '.')
                    if n.parent:
                        output_node_info(n.parent, '..')
                    else:
                        output_node_info(n, '..')
                for sub in n:
                    name = sub.name
                    if ((show_hidden in ('almost', 'all')) or (not (len(name) > 1)) or (not name.startswith('.'))):
                        output_node_info(sub, name)
            else:
                output_node_info(n, os.path.normpath(path))
        except vfs.NodeError as e:
            log(('error:    %s\n' % e))
            ret = 1
    if L:
        sys.stdout.write(columnate(L, ''))
    return ret