code: def all_modules_subpattern():
      u
      names_dot_attrs = [mod.split(u".") for mod in MAPPING]
      ret = u"( " + u" | ".join([dotted_name % (simple_name % (mod[0]),
                                              simple_attr % (mod[1])) for mod in names_dot_attrs])
      ret += u" | "
      ret += u" | ".join([simple_name % (mod[0]) for mod in names_dot_attrs if mod[1] == u"__init__"]) + u" )"
      return ret
docs: u"""
      Builds a pattern for all toplevel names
      (urllib, http, etc)