COMMENT Functions 
 returns the author name of the given comment
 Params:
 +comment_id+:: ID of the comment
324879
def obtain_comment_author(comment_id = nil)
      return nil if comment_id.blank?
      comm = Comment.find_by_id(comment_id)
      comm.author if !comm.blank?
    end
1081180
def commit_comment(self, comment_id):
        
        url = self._build_url('comments', str(comment_id), base_url=self._api)
        json = self._json(self._get(url), 200)
        return RepoComment(json, self) if json else None
633836
def author_structure(user):
    
    return {'user_id': user.pk,
            'user_login': user.get_username(),
            'display_name': user.__str__(),
            'user_email': user.email}
604822
def get_review_comment(self, id):
        
        assert isinstance(id, (int, long)), id
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self._parentUrl(self.url) + "/comments/" + str(id)
        )
        return github.PullRequestComment.PullRequestComment(self._requester, headers, data, completed=True)
142691
def author(id, params = {})
      params[:id] = id
      data = request("/author/show", params)
      Hashie::Mash.new(data["author"])
    end
377698
public function getCommentAuthorLink(Comment $comment)
    {
        if (!$user = $comment->getUser()) {
            if ((!$authorUrl = $comment->getAuthorUrl()) || !preg_match('/^http(s)?:\/\/.+$/', $authorUrl)) {
                return $comment->getAuthor();
            }

            return sprintf('<a href="%s" rel="nofollow" target="_new">%s</a>', $authorUrl, $comment->getAuthor());
        }

        if ((!$userUrl = $user->getUrl()) || !preg_match('/^http(s)?:\/\/.+$/', $userUrl)) {
            return $user->getDisplayName();
        }

        return sprintf('<a href="%s" rel="nofollow" target="_new">%s</a>', $userUrl, $user->getDisplayName());
    }
590455
def get_num_commenters(self, item):
        """"""

        commenters = [comment['user']['login'] for comment in item['comments_data']]
        return len(set(commenters))
897703
def normalized_author_title_params(options)
      raise ArgumentError.new("Need a Hash argument, got #{options.inspect}") unless options.kind_of?(Hash)

      # Symbolize keys please
      #options = options.inject({}){ |h, (k, v)| hash.merge( (k.respond_to?(:to_sym) ? k.to_sym : k) => v )  }

      title           = options[:title].dup  if options[:title]
      author          = options[:author].dup if options[:author]

      
      title  = normalized_title(title, :max_title_words => options[:max_title_words])
      author = normalized_author(author)

      results = {}
      results[:title] = title if title && ! title.empty?
      results[:author] = author if author && ! author.empty?
      
      return results
    end
444506
def _add_comment(self, thing_id, text):
        
        def add_comment_helper(self, thing_id, text):
            data = {'thing_id': thing_id,
                    'text': text}
            retval = self.request_json(self.config['comment'], data=data,
                                       retry_on_error=False)
            return retval

        if thing_id.startswith(self.config.by_object[objects.Message]):
            decorator = decorators.restrict_access(scope='privatemessages')
        else:
            decorator = decorators.restrict_access(scope='submit')
        retval = decorator(add_comment_helper)(self, thing_id, text)
        # REDDIT: reddit's end should only ever return a single comment
        return retval['data']['things'][0]
911102
def create
      @comment = Comment.new(params.permit(:content))
      @comment.user = @user
      @comment.post = @post
      if @comment.save
        render json: @comment
      else
        render json: @comment.errors, status: 422
      end
    end
722436
def comments(self, limit=None):
        
        return self._reddit.user_comments(self.name, limit=limit)
50558
def get_comment_init(request, obj):
    
    if request.user.is_authenticated():
        init = {'obj': obj, 'username': request.user.username, 'email': request.user.email}
    else:
        init = {'obj': obj}
    return init
113084
def comments(self, message_id):
        
        path = '/msg/comments/%u' % message_id
        req = ET.Element('request')
        return self._request(path, req)
475534
def list_comments(self, topic_id, start=0):
        
        xml = self.api.xml(API_GROUP_GET_TOPIC % topic_id, params={'start': start})
        xml_results = xml.xpath('//ul[@id="comments"]/li')
        results = []
        for item in xml_results:
            try:
                author_avatar = item.xpath('.//img/@src')[0]
                author_url = item.xpath('.//div[@class="user-face"]/a/@href')[0]
                author_alias = slash_right(author_url)
                author_signature = item.xpath('.//h4/text()')[1].strip()
                author_nickname = item.xpath('.//h4/a/text()')[0].strip()
                created_at = item.xpath('.//h4/span/text()')[0].strip()
                content = etree.tostring(item.xpath('.//div[@class="reply-doc content"]/p')[0]).decode('utf8').strip()
                cid = item.get('id')
                results.append({
                    'id': cid,
                    'author_avatar': author_avatar,
                    'author_url': author_url,
                    'author_alias': author_alias,
                    'author_signature': author_signature,
                    'author_nickname': author_nickname,
                    'created_at': created_at,
                    'content': unescape(content),
                })
            except Exception as e:
                self.api.logger.exception('parse comment exception: %s' % e)
        return build_list_result(results, xml)
550264
def comment_vote(self, comment_id, score):
        
        params = {'score': score}
        return self._get('comments/{0}/votes.json'.format(comment_id), params,
                         method='POST', auth=True)
1226531
def comment(self, format, *args):
        
        return lib.zhash_comment(self._as_parameter_, format, *args)
1111513
def author_name(author):
    

    if not '@' in author:
        return author
    else:
        return author.replace(author_email(author), '').replace('<', '')\
            .replace('>', '').strip()