code: def set_pub_year_month_day(self, xml_dict):
          
          key_path = ['PubmedArticleSet', 'PubmedArticle', 'MedlineCitation',
                      'Article', 'Journal', 'JournalIssue', 'PubDate']
          pubdate_xml = reduce(dict.get, key_path, xml_dict)
  
          if isinstance(pubdate_xml, dict):
              self.year = pubdate_xml.get('Year')
              month_short = pubdate_xml.get('Month')
              self.day = pubdate_xml.get('Day')
  
              try:
                  self.month = datetime.datetime.strptime(
                      month_short, "%b").month
              except (ValueError, TypeError):
                  self.month = ''
  
          else:
              self.year = ''
              self.month = ''
              self.day = ''
docs: Set publication year, month, day from PubMed's XML data