code: def match_to_dict(self, match, gids):
          
          values = {}
          for gid in gids:
              try:
                  values[gid] = self.map_value(match.group(gid), gid)
              except IndexError:
                  pass
          return values
docs: Map values from match into a dictionary.