def FormatCommentWithAnnotations(comment, type_name=''):
    "Format a comment string with additional RST for annotations.\n\n  Args:\n    comment: comment string.\n    type_name: optional, 'message' or 'enum' may be specified for additional\n      message/enum specific annotations.\n\n  Returns:\n    A string with additional RST from annotations.\n  "
    formatted_extension = ''
    if (annotations.EXTENSION_ANNOTATION in comment.annotations):
        extension = comment.annotations[annotations.EXTENSION_ANNOTATION]
        formatted_extension = FormatExtension(extension)
    formatted_extension_category = ''
    if (annotations.EXTENSION_CATEGORY_ANNOTATION in comment.annotations):
        formatted_extension_category = FormatExtensionCategory(comment.annotations[annotations.EXTENSION_CATEGORY_ANNOTATION])
    comment = annotations.WithoutAnnotations((StripLeadingSpace(comment.raw) + '\n'))
    return ((comment + formatted_extension) + formatted_extension_category)
Format a comment string with additional RST for annotations.

Args:
  comment: comment string.
  type_name: optional, 'message' or 'enum' may be specified for additional
    message/enum specific annotations.

Returns:
  A string with additional RST from annotations.
def FormatCommentWithAnnotations(comment, type_name=):
    "Format a comment string with additional RST for annotations.\n\n  Args:\n    comment: comment string.\n    type_name: optional, 'message' or 'enum' may be specified for additional\n      message/enum specific annotations.\n\n  Returns:\n    A string with additional RST from annotations.\n  "
    formatted_extension = 
    if (annotations.EXTENSION_ANNOTATION in comment.annotations):
        extension = comment.annotations[annotations.EXTENSION_ANNOTATION]
        formatted_extension = FormatExtension(extension)
    formatted_extension_category = 
    if (annotations.EXTENSION_CATEGORY_ANNOTATION in comment.annotations):
        formatted_extension_category = FormatExtensionCategory(comment.annotations[annotations.EXTENSION_CATEGORY_ANNOTATION])
    comment = annotations.WithoutAnnotations((StripLeadingSpace(comment.raw) + '\n'))
    return ((comment + formatted_extension) + formatted_extension_category)