code: def decode_gid(raw_gid):
      
      flags = TileFlags(
          raw_gid & GID_TRANS_FLIPX == GID_TRANS_FLIPX,
          raw_gid & GID_TRANS_FLIPY == GID_TRANS_FLIPY,
          raw_gid & GID_TRANS_ROT == GID_TRANS_ROT)
      gid = raw_gid & ~(GID_TRANS_FLIPX | GID_TRANS_FLIPY | GID_TRANS_ROT)
      return gid, flags
docs: Decode a GID from TMX data
  
      as of 0.7.0 it determines if the tile should be flipped when rendered
      as of 0.8.0 bit 30 determines if GID is rotated
  
      :param raw_gid: 32-bit number from TMX layer data
      :return: gid, flags