Gets total counts of recipients who opened your emails.
        This is only recorded when open tracking is enabled for that email.
426656
def opens(self, tag=None, fromdate=None, todate=None):
        
        return self.call("GET", "/stats/outbound/opens", tag=tag, fromdate=fromdate, todate=todate)
518437
public function getItemCount() : int
    {
        if($this->lastResponse && $this->lastResponse->getHeaderLine('X-Total-Count')) {
            return (int)$this->lastResponse->getHeaderLine('X-Total-Count');
        }

        return 0;
    }
1023037
def _get_hit_count(self, database, enquire):
        
        return self._get_enquire_mset(
            database, enquire, 0, database.get_doccount()
        ).size()
217741
def messages_count(user)
      Message.search do
        with(:receiver_id).equal_to user.id
        with(:is_read).equal_to false
      end.hits.total_entries
    end
769702
def opened(self):
        
        def post_setup((cmds, resps)):
            """Post setup callback."""
            logger.info("Setup complete, listening...")

        self.send_cmds(('connect', CONN_SPEC),
                       ('watchMailboxes', {'account': ACCOUNT,
                                           'list': ['INBOX']}),
                       ('watchAll', {})).then(post_setup)
39345
def emailclients(self, tag=None, fromdate=None, todate=None):
        
        return self.call("GET", "/stats/outbound/opens/emailclients", tag=tag, fromdate=fromdate, todate=todate)
75351
public function countMessages($mailbox)
    {
        if ($this->selected === $mailbox && isset($this->data['EXISTS'])) {
            return $this->data['EXISTS'];
        }

        // Check internal cache
        $cache = $this->data['STATUS:'.$mailbox];
        if (!empty($cache) && isset($cache['MESSAGES'])) {
            return (int) $cache['MESSAGES'];
        }

        // Try STATUS (should be faster than SELECT)
        $counts = $this->status($mailbox);
        if (is_array($counts)) {
            return (int) $counts['MESSAGES'];
        }

        return false;
    }
534695
public int getNumFaultyTrackers() {
    int count = 0;
    synchronized (this) {
      for (String trackerName : usageReports.keySet()) {
        if (isFaulty(trackerName)) {
          count++;
        }
      }
    }
    return count;
  }
251095
def report(self):
        
        table = [["Mails", "Metric"]]
        table.append(["Found", self.stats['mail_found']])
        table.append(["Skipped", self.stats['mail_skipped']])
        table.append(["Rejected", self.stats['mail_rejected']])
        table.append(["Kept", self.stats['mail_kept']])
        table.append(["Unique", self.stats['mail_unique']])
        table.append(["Duplicates", self.stats['mail_duplicates']])
        table.append(["Deleted", self.stats['mail_deleted']])
        logger.info(tabulate(table, tablefmt='fancy_grid', headers='firstrow'))

        table = [["Duplicate sets", "Metric"]]
        table.append(["Total", self.stats['set_total']])
        table.append(["Ignored", self.stats['set_ignored']])
        table.append(["Skipped", self.stats['set_skipped']])
        table.append([
            "Rejected (bad encoding)",
            self.stats['set_rejected_encoding']])
        table.append([
            "Rejected (too dissimilar in size)",
            self.stats['set_rejected_size']])
        table.append([
            "Rejected (too dissimilar in content)",
            self.stats['set_rejected_content']])
        table.append(["Deduplicated", self.stats['set_deduplicated']])
        logger.info(tabulate(table, tablefmt='fancy_grid', headers='firstrow'))

        # Perform some high-level consistency checks on metrics.
        assert self.stats['mail_found'] == (
            self.stats['mail_skipped'] +
            self.stats['mail_rejected'] +
            self.stats['mail_kept'])
        assert self.stats['mail_kept'] >= self.stats['mail_unique']
        assert self.stats['mail_kept'] >= self.stats['mail_duplicates']
        assert self.stats['mail_kept'] >= self.stats['mail_deleted']
        assert self.stats['mail_kept'] == (
            self.stats['mail_unique'] +
            self.stats['mail_duplicates'])
        assert self.stats['mail_duplicates'] > self.stats['mail_deleted']

        assert self.stats['set_ignored'] == self.stats['mail_unique']

        assert self.stats['set_total'] == (
            self.stats['set_ignored'] +
            self.stats['set_skipped'] +
            self.stats['set_rejected_encoding'] +
            self.stats['set_rejected_size'] +
            self.stats['set_rejected_content'] +
            self.stats['set_deduplicated'])
204856
def get_initial_totals(self):
        ""
        candidate_votes = {}
        # initialise to zero for every individual candidate
        for candidate_id in self.candidate_ids:
            candidate_votes[candidate_id] = 0
        for candidate_id in self.candidate_ids:
            candidate_votes[candidate_id] = self.candidate_bundle_transactions.get_paper_count(candidate_id)
        for candidate_id in candidate_votes:
            candidate_votes[candidate_id] = int(candidate_votes[candidate_id])
        return candidate_votes, 0, 0
369790
def attended_by(self, email):
        
        for attendee in self["attendees"] or []:
            if (attendee["email"] == email
                    and attendee["responseStatus"] == "accepted"):
                return True
        return False
301054
def total_hits(self, filename=None):
        
        if filename is not None:
            return len(self.hit_statements(filename))

        total = 0
        for filename in self.files():
            total += len(self.hit_statements(filename))

        return total
120420
def tracked_coordinator_count(self, count_ascps=False):
        '''  '''
        with self._lock:
            _count = 0
            if count_ascps:
                for _coordinator in self._tracked_transfer_coordinators:
                    _count += _coordinator.session_count
            else:
                _count = len(self._tracked_transfer_coordinators)
            return _count
1301329
static function countContentObjectByEmail( $email, $status = false )
    {
        $statusString = "";
        if ( $status !== false )
        {
            $statusString = " AND status = $status";
        }
        $sql = "SELECT COUNT(*) as row_count FROM " .
               "( SELECT DISTINCT contentobject_id, language_id ".
               " FROM ezcomment " .
               " WHERE email='$email'" .
               "$statusString" .
               ") as contentobject";
        $db = eZDB::instance();
        $result = $db->arrayQuery( $sql );
        return $result[0]['row_count'];
    }
237135
def get_count(self, prefix=''):
        """"""
        return sum([self.counters[key]
                    for key in self.messages if key.startswith(prefix)])
1084578
def getVoicemailStats(self):
        
        if not self.hasVoicemail():
            return None
        if self.checkVersion('1.4'):
            cmd = "voicemail show users"
        else:
            cmd = "show voicemail users"
        cmdresp = self.executeCommand(cmd)

        info_dict = dict(accounts = 0, avg_messages = 0, max_messages = 0, 
                         total_messages = 0)
        for line in cmdresp.splitlines():
            mobj = re.match('\w+\s+\w+\s+.*\s+(\d+)\s*$', line)
            if mobj:
                msgs = int(mobj.group(1))
                info_dict['accounts'] += 1
                info_dict['total_messages'] += msgs
                if msgs > info_dict['max_messages']:
                    info_dict['max_messages'] = msgs
        if info_dict['accounts'] > 0:
            info_dict['avg_messages'] = (float(info_dict['total_messages']) 
                                         / info_dict['accounts'])
            
        return info_dict
174850
def count_unread_messages_for(self, user):
        
        unread_total = self.filter(user=user,
                                   read_at__isnull=True,
                                   deleted_at__isnull=True).count()

        return unread_total