nodes: 0, module; 1, function_definition; 2, function_name:_add_comments; 3, parameters; 4, type; 5, block; 6, identifier:self; 7, typed_parameter; 8, typed_default_parameter; 9, identifier:str; 10, expression_statement; 11, if_statement; 12, if_statement; 13, identifier:comments; 14, type; 15, identifier:original_string; 16, type; 17, string:""; 18, comment:"""
              Returns a string with comments added if ignore_comments is not set.
          """; 19, subscript; 20, block; 21, not_operator; 22, block; 23, else_clause; 24, generic_type; 25, identifier:str; 26, attribute; 27, string; 28, return_statement; 29, identifier:comments; 30, return_statement; 31, block; 32, identifier:Optional; 33, type_parameter; 34, identifier:self; 35, identifier:config; 36, string_content:ignore_comments; 37, subscript; 38, identifier:original_string; 39, return_statement; 40, type; 41, call; 42, integer:0; 43, call; 44, generic_type; 45, attribute; 46, argument_list; 47, attribute; 48, argument_list; 49, identifier:Sequence; 50, type_parameter; 51, identifier:self; 52, identifier:_strip_comments; 53, identifier:original_string; 54, string:"{0}{1} {2}"; 55, identifier:format; 56, subscript; 57, subscript; 58, call; 59, type; 60, call; 61, integer:0; 62, attribute; 63, string; 64, attribute; 65, argument_list; 66, identifier:str; 67, attribute; 68, argument_list; 69, identifier:self; 70, identifier:config; 71, string_content:comment_prefix; 72, string:"; "; 73, identifier:join; 74, identifier:comments; 75, identifier:self; 76, identifier:_strip_comments; 77, identifier:original_string
code: def _add_comments(
          self,
          comments: Optional[Sequence[str]],
          original_string: str = ""
      ) -> str:
          """
              Returns a string with comments added if ignore_comments is not set.
          """
          if self.config['ignore_comments']:
              return self._strip_comments(original_string)[0]
  
          if not comments:
              return original_string
          else:
              return "{0}{1} {2}".format(self._strip_comments(original_string)[0],
                                         self.config['comment_prefix'],
                                         "; ".join(comments))