def __getitem__(self, key):
if isinstance(key, str):<EOL><INDENT>return self.act2templ[key]<EOL><DEDENT>elif isinstance(key, Template):<EOL><INDENT>return self.templ2act[key]<EOL><DEDENT>
If key is an str, returns corresponding template.
        If key is a Template, return corresponding action.
        If does not exist, return None.