(case_ids, ordered=False, prefetched_indices=None)
return cases
:param case_ids: List of case IDs to fetch
        :param ordered: Return cases in the same order as ``case_ids``
        :param prefetched_indices: If not None this must be a dict containing ALL the indices for ALL the
                                    cases being fetched. If the list does not contain indices for a case
                                    then an empty list will be attached to the case preventing further DB lookup.
        :return: List of cases
:param case_ids: List of case IDs to fetch
        :param ordered: Return cases in the same order as ``case_ids``
        :param prefetched_indices: If not None this must be a dict containing ALL the indices for ALL the
                                    cases being fetched. If the list does not contain indices for a case
                                    then an empty list will be attached to the case preventing further DB lookup.
        :return: List of cases
: param case_ids : List of case IDs to fetch : param ordered : Return cases in the same order as case_ids : param prefetched_indices : If not None this must be a dict containing ALL the indices for ALL the cases being fetched . If the list does not contain indices for a case then an empty list will be attached to the case preventing further DB lookup . : return : List of cases
def get_cases(case_ids, ordered=False, prefetched_indices=None):
        """
        :param case_ids: List of case IDs to fetch
        :param ordered: Return cases in the same order as ``case_ids``
        :param prefetched_indices: If not None this must be a dict containing ALL the indices for ALL the
                                    cases being fetched. If the list does not contain indices for a case
                                    then an empty list will be attached to the case preventing further DB lookup.
        :return: List of cases
        """
        assert isinstance(case_ids, list)
        if not case_ids:
            return []
        cases = list(CommCareCaseSQL.objects.plproxy_raw('SELECT * from get_cases_by_id(%s)', [case_ids]))

        if ordered:
            _sort_with_id_list(cases, case_ids, 'case_id')

        if prefetched_indices is not None:
            cases_by_id = {case.case_id: case for case in cases}
            _attach_prefetch_models(
                cases_by_id, prefetched_indices, 'case_id', 'cached_indices')

        return cases
def get_cases ( case_ids , ordered = False , prefetched_indices = None ) : assert isinstance ( case_ids , list ) if not case_ids : return [ ] cases = list ( CommCareCaseSQL . objects . plproxy_raw ( 'SELECT * from get_cases_by_id(%s)' , [ case_ids ] ) ) if ordered : _sort_with_id_list ( cases , case_ids , 'case_id' ) if prefetched_indices is not None : cases_by_id = { case . case_id : case for case in cases } _attach_prefetch_models ( cases_by_id , prefetched_indices , 'case_id' , 'cached_indices' ) return cases