code: def map_gid2(self, tiled_gid):
          
          tiled_gid = int(tiled_gid)
  
          # gidmap is a default dict, so cannot trust to raise KeyError
          if tiled_gid in self.gidmap:
              return self.gidmap[tiled_gid]
          else:
              gid = self.register_gid(tiled_gid)
              return [(gid, None)]
docs: WIP.  need to refactor the gid code
  
          :param tiled_gid:
          :return: