#NEWLINE# def get_study_subject_cases( self ) : #NEWLINE# #INDENT# cases = ( CommCareCase . wrap ( res [ '_source' ] ) for res in self . es_results [ 'hits' ] . get ( 'hits' , [ ] ) ) #NEWLINE# for case in case : #NEWLINE# #INDENT# if ( case . type != CC_SUBJECT_CASE_TYPE ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( not ( hasattr ( case , CC_SUBJECT_KEY ) and hasattr ( case , CC_STUDY_SUBJECT_ID ) ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# ( yield case )