def __getitem__(self, index):
assert self.name == "<STR_LIT>"<EOL>assert isinstance(index, int)<EOL>for attr in self.attrs:<EOL><INDENT>attr_obj = getattr(self, attr)<EOL>if hasattr(attr_obj, '<STR_LIT>'):<EOL><INDENT>if getattr(attr_obj, '<STR_LIT>') == index:<EOL><INDENT>return attr_obj<EOL><DEDENT>else:<EOL><INDENT>continue <EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT>
Convenience method to get an attribute with 'Id' for a Material