code: def register_gid(self, tiled_gid, flags=None):
          
          if flags is None:
              flags = TileFlags(0, 0, 0)
  
          if tiled_gid:
              try:
                  return self.imagemap[(tiled_gid, flags)][0]
              except KeyError:
                  gid = self.maxgid
                  self.maxgid += 1
                  self.imagemap[(tiled_gid, flags)] = (gid, flags)
                  self.gidmap[tiled_gid].append((gid, flags))
                  self.tiledgidmap[gid] = tiled_gid
                  return gid
  
          else:
              return 0
docs: Used to manage the mapping of GIDs between the tmx and pytmx
  
          :param tiled_gid: GID that is found in TMX data
          :rtype: GID that pytmx uses for the the GID passed