Return the largest column number that a Mention occupies.

    :param mention: The Mention to evaluate. If a candidate is given, default
        to its last Mention.
    :rtype: integer or None
505947
def get_max_col_num(mention):
    
    span = _to_span(mention, idx=-1)
    if span.sentence.is_tabular():
        return span.sentence.cell.col_end
    else:
        return None
912002
function mention(value, fromIndex) {
  var index = value.indexOf('@', fromIndex)

  if (index !== -1 && repo(value.charCodeAt(index - 1))) {
    return mention(value, index + 1)
  }

  return index
}
734916
def __parse_direct_mention(self, message_text):
        
        matches = re.search(MENTION_REGEX, message_text)
        # the first group contains the username, the second group contains the remaining message
        return (matches.group(1), listify(matches.group(2).strip())) if matches else (None, None)
152256
def apply(self, context, clear, split, **kwargs):
        
        logger.debug(f"Document: {context}")
        # Iterate over each candidate class
        for i, candidate_class in enumerate(self.candidate_classes):
            logger.debug(f"  Relation: {candidate_class.__name__}")
            # Generates and persists candidates
            candidate_args = {"split": split}
            candidate_args["document_id"] = context.id
            cands = product(
                *[
                    enumerate(
                        self.session.query(mention)
                        .filter(mention.document_id == context.id)
                        .order_by(mention.id)
                        .all()
                    )
                    for mention in candidate_class.mentions
                ]
            )
            for cand in cands:

                # Apply throttler if one was given.
                # Accepts a tuple of Mention objects
                # (throttler returns whether or not proposed candidate
                # passes throttling condition)
                if self.throttlers[i]:
                    if not self.throttlers[i](
                        tuple(cand[j][1] for j in range(self.arities[i]))
                    ):
                        continue

                # TODO: Make this work for higher-order relations
                if self.arities[i] == 2:
                    ai, a = (cand[0][0], cand[0][1].context)
                    bi, b = (cand[1][0], cand[1][1].context)

                    # Check for self-joins, "nested" joins (joins from context to
                    # its subcontext), and flipped duplicate "symmetric" relations
                    if not self.self_relations and a == b:
                        logger.debug(f"Skipping self-joined candidate {cand}")
                        continue
                    if not self.nested_relations and (a in b or b in a):
                        logger.debug(f"Skipping nested candidate {cand}")
                        continue
                    if not self.symmetric_relations and ai > bi:
                        logger.debug(f"Skipping symmetric candidate {cand}")
                        continue

                # Assemble candidate arguments
                for j, arg_name in enumerate(candidate_class.__argnames__):
                    candidate_args[arg_name + "_id"] = cand[j][1].id

                # Checking for existence
                if not clear:
                    q = select([candidate_class.id])
                    for key, value in list(candidate_args.items()):
                        q = q.where(getattr(candidate_class, key) == value)
                    candidate_id = self.session.execute(q).first()
                    if candidate_id is not None:
                        continue

                # Add Candidate to session
                yield candidate_class(**candidate_args)
1274219
def mentions(self):
        
        if self._mentions is None:
            self._mentions = []
            for mention_element in self._element.xpath('mention'):
                this_mention = Mention(self, mention_element)
                self._mentions.append(this_mention)
                if this_mention.representative:
                    self._representative = this_mention
        return self._mentions
1098670
public String getMention_type() {
    if (EntityMention_Type.featOkTst && ((EntityMention_Type)jcasType).casFeat_mention_type == null)
      jcasType.jcas.throwFeatMissing("mention_type", "de.julielab.jules.types.ace.EntityMention");
    return jcasType.ll_cas.ll_getStringValue(addr, ((EntityMention_Type)jcasType).casFeatCode_mention_type);}
229530
def header_size(self):
        
        if not self.header:
            return 0

        # Determine header size by finding the largest offset and the
        # value of the corresponding entry. The header size is the
        # offset plus the size of the entry.
        max_entry = max(self.header.values(),
                        key=lambda val: val['offset'])
        return max_entry['offset'] + max_entry['value'].nbytes
204421
def raw_role_mentions(self):
        
        return [int(x) for x in re.findall(r'<@&([0-9]+)>', self.content)]
1287973
def top(self, limit=None):
        
        return self._reddit.top(self.display_name, limit=limit)
678065
def first(self, limit=1, columns=None):
        
        if not columns:
            columns = ["*"]

        return self.take(limit).get(columns).first()
1270604
def reply_to_mentions(self):
        
        since_id = self.since_id.get()

        kwargs = {'count': 200}
        if since_id:
            kwargs['since_id'] = since_id

        mentions_list = []
        try:
            mentions_list = self.twitter.statuses.mentions_timeline(**kwargs)
        except TwitterHTTPError as e:
            logging.error('Unable to retrieve mentions from twitter: {0}'.format(e))

        logging.info("Retrieved {0} mentions".format(len(mentions_list)))

        mentions_processed = 0
        # We want to process least recent to most recent, so that since_id is set properly
        for mention in reversed(mentions_list):
            mention_id = mention['id']
            reply_to_names = self.get_reply_to_names(mention)

            error_code = self.DUPLICATE_CODE
            tries = 0
            message = ''
            while error_code == self.DUPLICATE_CODE:
                if tries > 10:
                    logging.error('Unable to post duplicate message to {0}: {1}'.format(
                                  reply_to_names, message))
                    break
                elif tries == 10:
                    # Tried 10 times to post a message, but all were duplicates
                    message = 'No unique messages found.'
                else:
                    message = self.messages.create(mention, self.MESSAGE_LENGTH)
                error_code = self.send_message(message, mention_id, reply_to_names)
                tries += 1

            mentions_processed += 1
            self.since_id.set('{0}'.format(mention_id))

        return mentions_processed
780013
def mentions_erb
      retdict = {
        enabled: @config[:mentions][:enabled],
        top: [],
        nottop: []
      }

      if @config[:mentions][:enabled]
        top = @parsed[:mentions].slice(0, @config[:mentions][:top]) # top X mentions
        top.each do |mention|
          retdict[:top] << mention[1]
        end

        nottop = @parsed[:mentions].slice(@config[:mentions][:top], @config[:mentions][:notop]) # not in the top X
        unless nottop.nil?
          nottop.each do |mention|
            mention[1].delete(:example)
            retdict[:nottop] << mention[1]
          end
        end
      end

      retdict
    end
1045694
def is_mention_line(cls, word):
        
        if word.startswith('@'):
            return True
        elif word.startswith('http://'):
            return True
        elif word.startswith('https://'):
            return True
        else:
            return False
521375
def most_visited_venues_card(num=10):
    
    if spectator_apps.is_enabled('events'):

        object_list = most_visited_venues(num=num)

        object_list = chartify(object_list, 'num_visits', cutoff=1)

        return {
            'card_title': 'Most visited venues',
            'score_attr': 'num_visits',
            'object_list': object_list,
        }
386951
def _column_reference(column_number):
        
        if column_number < 1 or column_number > 16384:
            raise ValueError('column_number must be in range 1-16384')

        # ---Work right-to-left, one order of magnitude at a time. Note there
        #    is no zero representation in Excel address scheme, so this is
        #    not just a conversion to base-26---

        col_ref = ''
        while column_number:
            remainder = column_number % 26
            if remainder == 0:
                remainder = 26

            col_letter = chr(ord('A') + remainder - 1)
            col_ref = col_letter + col_ref

            # ---Advance to next order of magnitude or terminate loop. The
            # minus-one in this expression reflects the fact the next lower
            # order of magnitude has a minumum value of 1 (not zero). This is
            # essentially the complement to the "if it's 0 make it 26' step
            # above.---
            column_number = (column_number - 1) // 26

        return col_ref
869707
def sizeHint(self, column):
        
        hint = super(XTreeWidgetItem, self).sizeHint(column)
        hint.setHeight(max(hint.height(), self.fixedHeight()))
        return hint
883159
def _get_longest_hit_at_qry_start(self, nucmer_hits):
        ''''''
        hits_at_start = [hit for hit in nucmer_hits if self._is_at_qry_start(hit)]
        return self._get_longest_hit_by_ref_length(hits_at_start)