def get_type(self, name):
        if not name:
            return CaseTypeMeta(name='')

        try:
            type_ = next(type_ for type_ in self.case_types if type_.name == name)
        except __HOLE__:
            type_ = CaseTypeMeta(name=name)
            self.case_types.append(type_)

        return type_
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/reports/formdetails/readable.py/AppCaseMetadata.get_type