def find_profile(self, bitarray, eep_rorg, rorg_func, rorg_type, direction=None, command=None):
if not self.init_ok:<EOL><INDENT>self.logger.warn('<STR_LIT>')<EOL>return None<EOL><DEDENT>if eep_rorg not in self.telegrams.keys():<EOL><INDENT>self.logger.warn('<STR_LIT>')<EOL>return None<EOL><DEDENT>if rorg_func not in self.telegrams[eep_rorg].keys():<EOL><INDENT>self.logger.warn('<STR_LIT>')<EOL>return None<EOL><DEDENT>if rorg_type not in self.telegrams[eep_rorg][rorg_func].keys():<EOL><INDENT>self.logger.warn('<STR_LIT>')<EOL>return None<EOL><DEDENT>profile = self.telegrams[eep_rorg][rorg_func][rorg_type]<EOL>if command:<EOL><INDENT>eep_command = profile.find('<STR_LIT>', recursive=False)<EOL>if not eep_command:<EOL><INDENT>return profile.find('<STR_LIT:data>', recursive=False)<EOL><DEDENT>return profile.find('<STR_LIT:data>', {'<STR_LIT>': str(command)}, recursive=False)<EOL><DEDENT>if direction is None:<EOL><INDENT>return profile.find('<STR_LIT:data>', recursive=False)<EOL><DEDENT>return profile.find('<STR_LIT:data>', {'<STR_LIT>': direction}, recursive=False)<EOL>
Find profile and data description, matching RORG, FUNC and TYPE