def is_img_id_valid(img_id):
t = re.sub(r'<STR_LIT>', '<STR_LIT>', img_id, re.IGNORECASE)<EOL>t = re.sub(r'<STR_LIT>', '<STR_LIT:.>', t)<EOL>if img_id != t or img_id.count('<STR_LIT::>') != <NUM_LIT:1>:<EOL><INDENT>return False<EOL><DEDENT>profile, base_name = img_id.split('<STR_LIT::>', <NUM_LIT:1>)<EOL>if not profile or not base_name:<EOL><INDENT>return False<EOL><DEDENT>try:<EOL><INDENT>get_profile_configs(profile)<EOL><DEDENT>except ValueError:<EOL><INDENT>return False<EOL><DEDENT>return True<EOL>
Checks if img_id is valid.