return the tileset corresponding to the specified id <br>
will throw an exception if no matching tileset is found
@name me.TMXTilesetGroup#getTilesetByGid
@public
@function
@param {Number} gid
@return {me.TMXTileset} corresponding tileset
10820
function getTilesetByGid(gid) {
         var invalidRange = -1; // clear the gid of all flip/rotation flags

         gid &= TMX_CLEAR_BIT_MASK; // cycle through all tilesets

         for (var i = 0, len = this.tilesets.length; i < len; i++) {
           // return the corresponding tileset if matching
           if (this.tilesets[i].contains(gid)) {
             return this.tilesets[i];
           } // typically indicates a layer with no asset loaded (collision?)


           if (this.tilesets[i].firstgid === this.tilesets[i].lastgid && gid >= this.tilesets[i].firstgid) {
             // store the id if the [firstgid .. lastgid] is invalid
             invalidRange = i;
           }
         } // return the tileset with the invalid range


         if (invalidRange !== -1) {
           return this.tilesets[invalidRange];
         } else {
           throw new Error("no matching tileset found for gid " + gid);
         }
       }
686983
@Override
    public T getById(Object id)
    {
        return context.getFramed().getFramedVertex(this.type, id);
    }
1313679
public Map<String, AtlasVertex> getVerticesForGUIDs(List<String> guids) {

        return getVerticesForPropertyValues(Constants.GUID_PROPERTY_KEY, guids);
    }
1181858
public MemberListResult getCrossGroupMembers(long gid)
            throws APIConnectionException, APIRequestException {
        Preconditions.checkArgument(0 != gid, "gid must not be empty");
        ResponseWrapper response = _httpClient.sendGet(_baseUrl + crossGroupPath + "/" + gid + "/members/");
        return MemberListResult.fromResponse(response);
    }
252295
function guid(moduleId) {
   var S4 = function() {
      return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
   };
   return moduleId + '@' + (S4()+S4());
}
942481
def gid
      return group.kind_of?(Integer) ? group : Etc.getgrnam(group.to_s).gid if group
      return Etc.getpwuid(uid).gid if using_login?
      nil
    end
214394
def _get_gid(name):
    """"""
    if getgrnam is None or name is None:
        return None
    try:
        result = getgrnam(name)
    except KeyError:
        result = None
    if result is not None:
        return result[2]
    return None
1002140
int[] getGenerals() {
        return Arrays.stream(tiles)
                .filter(tile1 -> tile1.getClass().equals(GeneralTile.class))
                .sorted(Comparator.comparingInt(t -> t.getOwnerPlayerIndex().get()))
                .mapToInt(Tile::getTileIndex)
                .toArray();
    }
497625
public HashSet<String> getDataById(String id) throws IOException {
    if (idToVersion.containsKey(id)) {
      return get(id);
    } else {
      return null;
    }
  }
538547
def tileset_info(self, uid):
        
        url = "http://{host}:{port}/api/v1/tileset_info/?d={uid}".format(
            host=self.host, port=self.port, uid=uid
        )

        req = requests.get(url)
        if req.status_code != 200:
            raise ServerError("Error fetching tileset_info:", req.content)

        content = json.loads(req.content)
        return content[uid]
1269942
def group_to_gid(group):
    '''
    
    '''
    if group is None:
        return ''
    try:
        if isinstance(group, int):
            return group
        return grp.getgrnam(group).gr_gid
    except KeyError:
        return ''
1136715
public Map<ConfigID, List<T>> collectElementsById(Map<ConfigID, List<T>> map, String defaultId, String pid) {
        if (map == null) {
            map = new HashMap<ConfigID, List<T>>();
        }
        int index = 0;
        for (T configElement : configElements) {
            String id = configElement.getId();

            if (id == null) {
                if (defaultId != null) {
                    id = defaultId;
                } else {
                    id = generateId(index++);
                }
            }

            // Create a new config ID based on the old one, but using the generated ID if necessary
            ConfigID configID = configElement.getConfigID();
            configID = new ConfigID(configID.getParent(), pid, id, configID.getChildAttribute());

            List<T> elements = map.get(configID);
            if (elements == null) {
                elements = new ArrayList<T>();
                map.put(configID, elements);
            }
            elements.add(configElement);
        }
        return map;
    }
201943
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)]
976171
def get_tile_image_by_gid(self, gid):
        
        try:
            assert (int(gid) >= 0)
            return self.images[gid]
        except TypeError:
            msg = "GIDs must be expressed as a number.  Got: {0}"
            logger.debug(msg.format(gid))
            raise TypeError
        except (AssertionError, IndexError):
            msg = "Coords: ({0},{1}) in layer {2} has invalid GID: {3}"
            logger.debug(msg.format(gid))
            raise ValueError
20521
function getId(id){
        if(_.isObject(id) && !_.isUndefined(id.id)){
            if (objectIdRegex.test(id.id)) {
                id = id.id;
            }
            else {
                id = null;
            }
        }
        return id;
    }
56983
def get_gid(group_name)
      Etc.group { |g| return g.gid if g.name == group_name }
    end
664539
public static byte[] getGuidAsByteArray(final String GUID) {
        final UUID uuid = UUID.fromString(GUID);

        final ByteBuffer buff = ByteBuffer.wrap(new byte[16]);
        buff.putLong(uuid.getMostSignificantBits());
        buff.putLong(uuid.getLeastSignificantBits());

        byte[] res = new byte[] {
            buff.get(3),
            buff.get(2),
            buff.get(1),
            buff.get(0),
            buff.get(5),
            buff.get(4),
            buff.get(7),
            buff.get(6),
            buff.get(8),
            buff.get(9),
            buff.get(10),
            buff.get(11),
            buff.get(12),
            buff.get(13),
            buff.get(14),
            buff.get(15), };

        return res;
    }