def check_explicit_underscore_import(logical_line, filename):
 for file in UNDERSCORE_IMPORT_FILES:
  if (file in filename):
   return
 if (underscore_import_check.match(logical_line) or underscore_import_check_multi.match(logical_line) or custom_underscore_check.match(logical_line)):
  UNDERSCORE_IMPORT_FILES.append(filename)
 elif (translated_log.match(logical_line) or string_translation.match(logical_line)):
  (yield (0, 'N323: Found use of _() without explicit import of _ !'))

def check_explicit_underscore_import ( logical_line , filename ) : for file in UNDERSCORE_IMPORT_FILES : if ( file in filename ) : return if ( underscore_import_check . match ( logical_line ) or underscore_import_check_multi . match ( logical_line ) or custom_underscore_check . match ( logical_line ) ) : UNDERSCORE_IMPORT_FILES . append ( filename ) elif ( translated_log . match ( logical_line ) or string_translation . match ( logical_line ) ) : ( yield ( 0 , 'N323: Found use of _() without explicit import of _ !' ) )
check for explicit import of the _ function we need to ensure that any files that are using the _() function to translate logs are explicitly importing the _ function .