INNER CODE UNIT · Python
_normalize_authors
lopusz/awesome-interpretable-machine-learning · sbin/gener_readme.py:138
def _normalize_authors(authors):
return [ [ a['keyname'], a['forenames'] ] for a in authors ]
def _normalize_arxiv_id(arxiv_id):
return arxiv_id.replace('oai:arXiv.org:', '')
met = {}
title_raw = met_raw['GetRecord']['record']['metadata']['arXiv']['title']
authors_raw = met_raw['GetRecord']['record']['metadata']['arXiv']['authors']['author']
if not isinstance(authors_raw, collections.Sequence):
authors_raw = [ authors_raw ]
met['title'] = _normalize_title(title_raw)
met['authors'] = _normalize_authors(authors_raw)
arxiv_id_raw = met_raw['GetRecord']['record']['header']['identifier']
met['arxiv_id'] = _normalize_arxiv_id(arxiv_id_raw)
created = met_raw['GetRecord']['record']['metadata']['arXiv']['created']