def _getCaseListId(self, case_set_id=None, study=None, strict=True):

        study_id = self._getStudyId(study, None)

        if case_set_id:
            if study_id:
                if not study_id == self.study:
                    case_lists = [x['case_list_id']
                                  for x in self.getCaseLists(study_id)]
                else:
                    case_lists = [x['case_list_id'] for x in self.cases]

                if case_set_id not in case_lists:
                    raise ValueError(
                        "%s is not a valid case list for study %s" % (case_set_id, study_id))
            return case_set_id

        else:
            if self.case_list:
                return self.case_list
            else:
                raise ValueError("No case_set_id provided and no default set")

##########################################################################
checking is only done if study is specified or a default is set
dataset/ETHPy150Open CGATOxford/cgat/CGAT/CBioPortal.py/CBioPortal._getCaseListId