def get_reference(root):
reference = {}<EOL>elem = root.find('<STR_LIT>')<EOL>if elem is None:<EOL><INDENT>raise MissingElementError('<STR_LIT>')<EOL><DEDENT>ref_doi = elem.get('<STR_LIT>', None)<EOL>ref_key = elem.get('<STR_LIT>', None)<EOL>if ref_doi is not None:<EOL><INDENT>try:<EOL><INDENT>ref = crossref_api.works(ids=ref_doi)['<STR_LIT:message>']<EOL><DEDENT>except (HTTPError, habanero.RequestError, ConnectionError):<EOL><INDENT>if ref_key is None:<EOL><INDENT>raise KeywordError('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>warn('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>)<EOL>reference['<STR_LIT>'] = ref_key<EOL>if reference['<STR_LIT>'][-<NUM_LIT:1>] != '<STR_LIT:.>':<EOL><INDENT>reference['<STR_LIT>'] += '<STR_LIT:.>'<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>if ref_key is not None:<EOL><INDENT>warn('<STR_LIT>')<EOL><DEDENT>reference['<STR_LIT>'] = elem.attrib['<STR_LIT>']<EOL>reference['<STR_LIT>'] = ref.get('<STR_LIT>')[<NUM_LIT:0>]<EOL>ref_year = ref.get('<STR_LIT>') or ref.get('<STR_LIT>')<EOL>reference['<STR_LIT>'] = int(ref_year['<STR_LIT>'][<NUM_LIT:0>][<NUM_LIT:0>])<EOL>reference['<STR_LIT>'] = int(ref.get('<STR_LIT>'))<EOL>reference['<STR_LIT>'] = ref.get('<STR_LIT>')<EOL>reference['<STR_LIT>'] = []<EOL>for author in ref['<STR_LIT>']:<EOL><INDENT>auth = {}<EOL>auth['<STR_LIT:name>'] = '<STR_LIT:U+0020>'.join([author['<STR_LIT>'], author['<STR_LIT>']])<EOL>orcid = author.get('<STR_LIT>')<EOL>if orcid:<EOL><INDENT>auth['<STR_LIT>'] = orcid.lstrip('<STR_LIT>')<EOL><DEDENT>reference['<STR_LIT>'].append(auth)<EOL><DEDENT><DEDENT><DEDENT>elif ref_key is not None:<EOL><INDENT>warn('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>)<EOL>reference['<STR_LIT>'] = ref_key<EOL>if reference['<STR_LIT>'][-<NUM_LIT:1>] != '<STR_LIT:.>':<EOL><INDENT>reference['<STR_LIT>'] += '<STR_LIT:.>'<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise MissingAttributeError('<STR_LIT>', '<STR_LIT>')<EOL><DEDENT>return reference<EOL>
Read reference info from root of ReSpecTh XML file.

    Args:
        root (`~xml.etree.ElementTree.Element`): Root of ReSpecTh XML file

    Returns:
        properties (`dict`): Dictionary with reference information