// GetKeyComments returns the comments of key in the given section.
// It returns an empty string(0 length) if the comments do not exist.
351958
func (c *ConfigFile) GetKeyComments(section, key string) (comments string) {
	// Blank section name represents DEFAULT section.
	if len(section) == 0 {
		section = DEFAULT_SECTION
	}

	if _, ok := c.keyComments[section]; ok {
		return c.keyComments[section][key]
	}
	return ""
}
1001382
func PostCommentVotes() echo.HandlerFunc {

	// swagger:route GET /users/{id}/posts/{pid}/comments/{cid}/votes users post comments votes GetUserPostCommentsVotes
	//
	// List the votes on the comment
	//
	//	Produces:
	//	- application/json
	//
	//	Security:
	//		oauth: profile_comments:read
	//
	//	Responses:
	//		default: UsersIdPostsPidCommentsCidVotes

	return func(c echo.Context) error {
		if !rest.IsGranted("profile_comments:read", c) {
			return rest.InvalidScopeResponse("profile_comments:read", c)
		}
		votes := c.Get("comment").(*nerdz.UserPostComment).Votes()
		if votes == nil {
			errstr := "Unable to fetch votes for the specified post"
			c.JSON(http.StatusBadRequest, &rest.Response{
				HumanMessage: errstr,
				Message:      "UserPostComment.Votes() error",
				Status:       http.StatusBadRequest,
				Success:      false,
			})
			return errors.New(errstr)
		}

		var votesTO []*nerdz.UserPostCommentVoteTO
		me := c.Get("me").(*nerdz.User)
		for _, v := range *votes {
			// votes contains Vote elements
			// we need to convert back to a UserPostCommentVote in order to get a correct UserPostCommentVoteTO
			if userPostCommentVote := v.(*nerdz.UserPostCommentVote); userPostCommentVote != nil {
				votesTO = append(votesTO, userPostCommentVote.GetTO(me))
			}
		}
		return rest.SelectFields(votesTO, c)
	}
}
1080584
func (s *GistsService) GetComment(ctx context.Context, gistID string, commentID int64) (*GistComment, *Response, error) {
	u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID)
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	c := new(GistComment)
	resp, err := s.client.Do(ctx, req, c)
	if err != nil {
		return nil, resp, err
	}

	return c, resp, nil
}
1290971
func (p *PullRequest) GetCommentsURL() string {
	if p == nil || p.CommentsURL == nil {
		return ""
	}
	return *p.CommentsURL
}
335965
func (f *file) containsComments(start, end token.Pos) bool {
	for _, cgroup := range f.f.Comments {
		comments := cgroup.List
		if comments[0].Slash >= end {
			// All comments starting with this group are after end pos.
			return false
		}
		if comments[len(comments)-1].Slash < start {
			// Comments group ends before start pos.
			continue
		}
		for _, c := range comments {
			if start <= c.Slash && c.Slash < end && !strings.HasPrefix(c.Text, "// MATCH ") {
				return true
			}
		}
	}
	return false
}
93111
func (k *Keyring) GetKeys() [][]byte {
	k.l.Lock()
	defer k.l.Unlock()

	return k.keys
}
916245
func NewGetTaskComments(ctx *middleware.Context, handler GetTaskCommentsHandler) *GetTaskComments {
	return &GetTaskComments{Context: ctx, Handler: handler}
}
984956
func (c *CommentStats) GetTotalCommitComments() int {
	if c == nil || c.TotalCommitComments == nil {
		return 0
	}
	return *c.TotalCommitComments
}
45185
func NewSection() *Section {
	return &Section{
		comments: make([]string, 0),
		includes: make([]string, 0),
		values:   make(map[string]Value),
	}
}
541139
func PostComments() echo.HandlerFunc {

	// swagger:route GET /users/{id}/posts/{pid}/comments users post comments GetUserPostComments
	//
	// List comments on specified post, filtered by some parameters.
	//
	// This will show the last posts on the user board by default.
	// You can personalize the request via query string parameters
	//
	//	Produces:
	//	- application/json
	//
	//	Security:
	//		oauth: profile_comments:read
	//
	//	Responses:
	//		default: UsersIdPostsPidComments

	return func(c echo.Context) error {
		if !rest.IsGranted("profile_comments:read", c) {
			return rest.InvalidScopeResponse("profile_comments:read", c)
		}
		comments := c.Get("post").(*nerdz.UserPost).Comments(*(c.Get("commentlistOptions").(*nerdz.CommentlistOptions)))
		if comments == nil {
			errstr := "Unable to fetch comment list for the specified post"
			c.JSON(http.StatusBadRequest, &rest.Response{
				HumanMessage: errstr,
				Message:      "UserPost.Comments(options) error",
				Status:       http.StatusBadRequest,
				Success:      false,
			})
			return errors.New(errstr)
		}

		var commentsAPI []*nerdz.UserPostCommentTO
		me := c.Get("me").(*nerdz.User)
		for _, p := range *comments {
			// comments contains ExistingPost elements
			// we need to convert back to a UserPostComment in order to get a correct UserPostCommentTO
			if userPostComment := p.(*nerdz.UserPostComment); userPostComment != nil {
				commentsAPI = append(commentsAPI, userPostComment.GetTO(me))
			}
		}
		return rest.SelectFields(commentsAPI, c)
	}
}
795488
func getFromSite(comment []string) string {
	if len(comment) == 0 {
		return ""
	}

	// Where we should check the website.
	idx := 2
	if len(comment) < 3 {
		idx = 0
	} else if len(comment) == 4 {
		idx = 3
	}

	// Pick the site.
	results := botFromSiteRegexp.FindStringSubmatch(comment[idx])
	if len(results) == 1 {
		// If it's a simple comment, just return the name of the site.
		if idx == 0 {
			return results[0]
		}

		// This is a large comment, usually the name will be in the previous
		// field of the comment.
		return strings.TrimSpace(comment[idx-1])
	}
	return ""
}
562272
func (f *File) countComments() int {
	count := 0
	for k := range f.XLSX {
		if strings.Contains(k, "xl/comments") {
			count++
		}
	}
	return count
}
724051
func (p *parser) parseComment() (node, error) {
	var comment string
	for {
		t := p.read()
		switch t.typ {
		case tokenEOF:
			return nil, p.errorf(t, "unexpected token %s", t)
		case tokenError:
			return nil, p.errorf(t, t.val)
		case tokenRightDelim:
			return commentNode(comment), nil
		default:
			comment += t.val
		}
	}
}
1106763
func (cr *commentsRef) AllocComments() {
	if cr.ref == nil {
		cr.ref = new(Comments)
	}
}
278280
func (c *Commit) GetCommentCount() int {
	if c == nil || c.CommentCount == nil {
		return 0
	}
	return *c.CommentCount
}
537667
func (cm CommentMap) MoveComments(from, to Node, position CommentPosition) {
	for i, c := range cm[from] {
		if c.Position == position {
			cm.AddComment(to, c)

			// Remove the comment from the "from" slice
			cm[from][i] = cm[from][len(cm[from])-1]
			cm[from][len(cm[from])-1] = nil
			cm[from] = cm[from][:len(cm[from])-1]
		}
	}
}
933932
func (ini *INI) Get(section, key string) string {
	if v := ini.get(section, key); v != nil {
		return *v
	}
	return ""
}