def METHOD_NAME(cg, resp, data, seg_ids):
    if app_utils.toboolean(data.get("return_seg_ids", "false")):
        resp["seg_ids"] = seg_ids
    if app_utils.toboolean(data.get("return_seg_id_layers", "false")):
        resp["seg_id_layers"] = cg.get_chunk_layers(seg_ids)
    if app_utils.toboolean(data.get("return_seg_chunk_coordinates", "false")):
        resp["seg_chunk_coordinates"] = [
            cg.get_chunk_coordinates(seg_id) for seg_id in seg_ids
        ]
    return resp