def data(self, **query):
objects = self.cache['<STR_LIT>']<EOL>data = self.api.data.get(**query)['<STR_LIT>']<EOL>data_objects = []<EOL>for d in data:<EOL><INDENT>_id = d['<STR_LIT:id>']<EOL>if _id in objects:<EOL><INDENT>objects[_id].update(d)<EOL><DEDENT>else:<EOL><INDENT>objects[_id] = GenData(d, self)<EOL><DEDENT>data_objects.append(objects[_id])<EOL><DEDENT>for d in data_objects:<EOL><INDENT>count += <NUM_LIT:1><EOL>while True:<EOL><INDENT>ref_annotation = {}<EOL>remove_annotation = []<EOL>for path, ann in d.annotation.items():<EOL><INDENT>if ann['<STR_LIT:type>'].startswith('<STR_LIT>'):<EOL><INDENT>_id = ann['<STR_LIT:value>']<EOL>if _id not in objects:<EOL><INDENT>try:<EOL><INDENT>d_tmp = self.api.data(_id).get()<EOL><DEDENT>except slumber.exceptions.HttpClientError as ex:<EOL><INDENT>if ex.response.status_code == <NUM_LIT>:<EOL><INDENT>continue<EOL><DEDENT>else:<EOL><INDENT>raise ex<EOL><DEDENT><DEDENT>objects[_id] = GenData(d_tmp, self)<EOL><DEDENT>annotation = objects[_id].annotation<EOL>ref_annotation.update({path + '<STR_LIT:.>' + k: v for k, v in annotation.items()})<EOL>remove_annotation.append(path)<EOL><DEDENT><DEDENT>if ref_annotation:<EOL><INDENT>d.annotation.update(ref_annotation)<EOL>for path in remove_annotation:<EOL><INDENT>del d.annotation[path]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>return data_objects<EOL>
Query for Data object annotation.