code: def convert_html_entities(text_string):
      '''
      Converts HTML5 character references within text_string to their corresponding unicode characters
      and returns converted string as type str.
  
      Keyword argument:
  
      - text_string: string instance
  
      Exceptions raised:
  
      - InputError: occurs should a non-string argument be passed
      '''
      if text_string is None or text_string == "":
          return ""
      elif isinstance(text_string, str):
          return html.unescape(text_string).replace("&quot;", "'")
      else:
          raise InputError("string not passed as argument for text_string"f convert_html_entities(text_string):
      '''
      Converts HTML5 character references within text_string to their corresponding unicode characters
      and returns converted string as type str.
  
      Keyword argument:
  
      - text_string: string instance
  
      Exceptions raised:
  
      - InputError: occurs should a non-string argument be passed
      '''
      if text_string is None or text_string == "":
          return ""
      elif isinstance(text_string, str):
          return html.unescape(text_string).replace("&quot;", "'")
      else:
          raise InputError("string not passed as argument for text_string")
docs: Converts HTML5 character references within text_string to their corresponding unicode characters
      and returns converted string as type str.
  
      Keyword argument:
  
      - text_string: string instance
  
      Exceptions raised:
  
      - InputError: occurs should a non-string argument be passed