def GetRegistryFileMapping(self, registry_file):
if not registry_file:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>candidate_mappings = []<EOL>for mapping in self._REGISTRY_FILE_MAPPINGS_NT:<EOL><INDENT>if not mapping.unique_key_paths:<EOL><INDENT>continue<EOL><DEDENT>match = True<EOL>for key_path in mapping.unique_key_paths:<EOL><INDENT>registry_key = registry_file.GetKeyByPath(key_path)<EOL>if not registry_key:<EOL><INDENT>match = False<EOL><DEDENT><DEDENT>if match:<EOL><INDENT>candidate_mappings.append(mapping)<EOL><DEDENT><DEDENT>if not candidate_mappings:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>if len(candidate_mappings) == <NUM_LIT:1>:<EOL><INDENT>return candidate_mappings[<NUM_LIT:0>].key_path_prefix<EOL><DEDENT>key_path_prefixes = frozenset([<EOL>mapping.key_path_prefix for mapping in candidate_mappings])<EOL>expected_key_path_prefixes = frozenset([<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'])<EOL>if key_path_prefixes == expected_key_path_prefixes:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>raise RuntimeError('<STR_LIT>')<EOL>
Determines the Registry file mapping based on the content of the file.

        Args:
          registry_file (WinRegistyFile): Windows Registry file.

        Returns:
          str: key path prefix or an empty string.

        Raises:
          RuntimeError: if there are multiple matching mappings and
              the correct mapping cannot be resolved.