'shows the address with the given version prefix and hash.'

def q_hashtoaddress(abe, page, chain):

    arg1 = wsgiref.util.shift_path_info(page['env'])
    arg2 = wsgiref.util.shift_path_info(page['env'])
    if (arg1 is None):
        return 'Converts    a    160-bit    hash    and    address    version    to    an    address.\n/q/hashtoaddress/HASH[/VERSION]\n'
    if page['env']['PATH_INFO']:
        return 'ERROR:    Too    many    arguments'
    if (arg2 is not None):
        (version, hash) = (arg2, arg1)
    elif (arg1.find(':') >= 0):
        (version, hash) = arg1.split(':', 1)
    elif chain:
        (version, hash) = (chain.address_version.encode('hex'), arg1)
    else:
        (version, hash) = ('00', arg1)
    try:
        hash = hash.decode('hex')
        version = version.decode('hex')
    except Exception:
        return 'ERROR:    Arguments    must    be    hexadecimal    strings    of    even    length'
    return util.hash_to_address(version, hash)
