def _get_registry(self, registry_path_or_url):
if registry_path_or_url.startswith('<STR_LIT:http>'):<EOL><INDENT>profiles = self._load_json_url(registry_path_or_url)<EOL><DEDENT>else:<EOL><INDENT>profiles = self._load_json_file(registry_path_or_url)<EOL><DEDENT>try:<EOL><INDENT>registry = {}<EOL>for profile in profiles:<EOL><INDENT>registry[profile['<STR_LIT:id>']] = profile<EOL><DEDENT>return registry<EOL><DEDENT>except KeyError as e:<EOL><INDENT>msg = (<EOL>'<STR_LIT>'<EOL>).format(path=registry_path_or_url)<EOL>six.raise_from(ValueError(msg), e)<EOL><DEDENT>
dict: Return the registry as dict with profiles keyed by id.