code: def unique_prefixes(context):
      
      res = {}
      for m in context.modules.values():
          if m.keyword == "submodule": continue
          prf = new = m.i_prefix
          suff = 0
          while new in res.values():
              suff += 1
              new = "%s%x" % (prf, suff)
          res[m] = new
      return res
docs: Return a dictionary with unique prefixes for modules in `context`.
  
      Keys are 'module' statements and values are prefixes,
      disambiguated where necessary.