def retrieve_and_parse_document(fid: str) -> Optional[Any]:
document, status_code, ex = fetch_document(fid, extra_headers={'<STR_LIT>': '<STR_LIT>'})<EOL>if document:<EOL><INDENT>document = json.loads(decode_if_bytes(document))<EOL>entities = message_to_objects(document, fid)<EOL>if entities:<EOL><INDENT>return entities[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>
Retrieve remote document by ID and return the entity.