code: def add_thesis(
          self,
          defense_date=None,
          degree_type=None,
          institution=None,
          date=None
      ):
          
          self.record.setdefault('thesis_info', {})
  
          thesis_item = {}
          for key in ('defense_date', 'date'):
              if locals()[key] is not None:
                  thesis_item[key] = locals()[key]
  
          if degree_type is not None:
              thesis_item['degree_type'] = degree_type.lower()
  
          if institution is not None:
              thesis_item['institutions'] = [{'name': institution}]
  
          self.record['thesis_info'] = thesis_item
docs: Add thesis info.
  
          :param defense_date: defense date for the current thesis
          :type defense_date: string. A formatted date is required (yyyy-mm-dd)
  
          :param degree_type: degree type for the current thesis
          :type degree_type: string
  
          :param institution: author's affiliation for the current thesis
          :type institution: string
  
          :param date: publication date for the current thesis
          :type date: string. A formatted date is required (yyyy-mm-dd)