code: def link_pantsrefs(soups, precomputed):
    
    for (page, soup) in soups.items():
      for a in soup.find_all('a'):
        if not a.has_attr('pantsref'):
          continue
        pantsref = a['pantsref']
        if not pantsref in precomputed.pantsref:
          raise TaskError('Page {} has pantsref "{}" and I cannot find pantsmark for'
                          ' it'.format(page, pantsref))
        a['href'] = rel_href(page, precomputed.pantsref[pantsref])
docs: Transorm soups: <a pantsref="foo"> becomes <a href="../foo_page.html#foo">