def get_annotations(event, key, namespace=None, matchfunc=None):
if matchfunc is None:<EOL><INDENT>matchfunc = _is_equal<EOL><DEDENT>if isinstance(key, Exception):<EOL><INDENT>key = _error_repr(key)<EOL><DEDENT>return [ann for ann in event.get("<STR_LIT>", {}).get("<STR_LIT>", [])<EOL>if (matchfunc(key, ann["<STR_LIT:key>"]) and<EOL>(namespace is None or ann.get("<STR_LIT>") == namespace))]<EOL>
Produce the list of annotations for a given key.