Get the number of active subscribers based on master's id.
Run this after doing Master_Post_Run_Count

@param int $master_id master's id to check the count for
@return mixed A JSON decoded PHP variable representing the HTTP response.
@access public
176185
public function Master_Get_Count($masterId) {
        $ret = false;

        if (is_int($masterId) === true) {
            do {
                $ret = $this->_call_api('get', "{$this->_url}/masters/$masterId/countData", array());
                // Sleep for 15 seconds so we don't keep hammering the api
                sleep(15);
            }
            while (!$this->Status_Is_Completed($ret->status));
        }

        return $ret;
    }
118339
public function receiveSMS($sms_id)
	{
		$data = array('id'=>$sms_id);
		$result = $this->execute('receive', $data);
		if(count(@$result['errors']))
			$this->_errors = $result['errors'];
		return @$result['status'];		
	}
891360
public void foundActiveMaster(Protocol newMasterProtocol) {
    if (isMasterHostFail()) {
      if (isExplicitClosed()) {
        newMasterProtocol.close();
        return;
      }
      if (!waitNewMasterProtocol.compareAndSet(null, newMasterProtocol)) {
        newMasterProtocol.close();
      }
    } else {
      newMasterProtocol.close();
    }

  }
414962
public static function get_widget_count($sidebar_id)
    {
        global $_wp_sidebars_widgets;

        // If not front page, the global is empty so set it another way.
        if (empty($_wp_sidebars_widgets)) {
            $_wp_sidebars_widgets = \get_option('sidebars_widgets', []);
        }

        // if our sidebar exists, return count.
        if (isset($_wp_sidebars_widgets[ $sidebar_id ])) {
            return \count($_wp_sidebars_widgets[ $sidebar_id ]);
        }

        return 0;
    }
386953
public function show($id)
    {
        if(Request::isAjax()){
            $user = null;
            $message = '';

            try{
                $user = Sentry::findUserById($id);
            }catch(Exception $e){
                $message = $e->getMessage();
            }


            Response::headers()->set('Content-Type', 'application/json');
            Response::setBody(json_encode(
                array(
                    'success'   => !is_null($user),
                    'data'      => !is_null($user) ? $user->toArray() : $user,
                    'message'   => $message,
                    'code'      => is_null($user) ? 404 : 200
                )
            ));
        }else{

        }
    }
1230249
public static function findPostsCount($id)
    {
        $cache = Podium::getInstance()->podiumCache->getElement('user.postscount', $id);
        if ($cache === false) {
            $cache = (new Query)->from(Post::tableName())->where(['author_id' => $id])->count();
            Podium::getInstance()->podiumCache->setElement('user.postscount', $id, $cache);
        }
        return $cache;
    }
201119
public function listSubscription($id)
    {
        $service = $this->getService();

        $response      = $service->request('subscriptions/' . (int)$id . '/components', 'GET');
        $responseArray = $this->getResponseArray($response);

        if (!$this->isError()) {
            $this->_data = $this->_normalizeResponseArray($responseArray);
        } else {
            $this->_data = array();
        }

        return $this;
    }
971253
public ServerMember getRemoteMember(int id) {
    MemberState member = membersMap.get(id);
    return member != null ? member.getMember() : null;
  }
625935
public function getSendStatus($id)
    {
        $url = $this->getApiEndpoint() . self::REST_CAMPAIGN_SEND . '/' . $id;
        $this->setUrl($url)
            ->setVerb('GET');
        $response = $this->execute();
        //log error
        if (isset($response->message)
            && !in_array(
                $response->message,
                $this->exludeMessages
            )
        ) {
            $message = 'GETS THE SEND STATUS USING SEND ID: '
                . $response->message;
            $this->helper->log($message);
        }
        return $response;
    }
1089021
public function count($useMasterKey = false)
    {
        $this->limit = 0;
        $this->count = 1;
        $queryString = $this->buildQueryString($this->_getOptions());
        $result = AVClient::_request('GET', '/classes/' . $this->className . '?' . $queryString, null, null,
            $useMasterKey);

        return $result['count'];
    }
269075
public static function getChildPagesCount($page_id = null)
    {
        if (is_null($page_id)) {
            return null;
        }

        $children = PageManager::fetch(false, array('id'), array(
            sprintf('parent = %d', $page_id)
        ));
        $count = count($children);

        if ($count > 0) {
            foreach ($children as $c) {
                $count += self::getChildPagesCount($c['id']);
            }
        }

        return $count;
    }
217408
public function getAccountStates(
        $tvshow_id,
        $season_number,
        $episode_number
    ) {
        return $this->get(
            sprintf(
                'tv/%s/season/%s/episode/%s/account_states',
                $tvshow_id,
                $season_number,
                $episode_number
            )
        );
    }
1081520
public function getPostCount($user_id)
    {
        /* Get count from forum posts */
        try {
            $posts = ForumPost::where('author_id', $user_id)->get();
            $posts = count($posts);
        } catch (Exception $e) {
            $posts = 0;
        }

        /* Get count from forum replies */
        try {
            $replies = ForumReply::where('author_id', $user_id)->get();
            $replies = count($replies);
        } catch (Exception $e) {
            $replies = 0;
        }

        /* Return total */
        return $posts + $replies;
    }
107158
public function findActive($id)
    {
        $client = $this->find($id);

        return $client && ! $client->revoked ? $client : null;
    }
1274926
public function getDMByUserId($id)
    {
        return $this->apiCall('im.open', [
            'user' => $id,
        ])->then(function (Payload $response) {
            return $this->getDMById($response['channel']['id']);
        });
    }
606413
@SuppressWarnings("unchecked")
    @Override
    public String getMasterRequestId(Message request) {
        List<SoapHeader> headers = (List<SoapHeader>) ((CxfPayload<?>)request.getBody()).getHeaders();
        for (SoapHeader header : headers) {
            if (header.getName().getLocalPart().equals("MasterRequestID")) {
                Node headerNode = (Node) header.getObject();
                return headerNode.getTextContent();
            }
        }
        return null;
    }
237200
public function getNumberSubscribers($websiteId = 0)
    {
        return $this->addFieldToFilter(
            'subscriber_status',
            \Dotdigitalgroup\Email\Model\Newsletter\Subscriber::STATUS_SUBSCRIBED
        )
            ->addFieldToFilter('website_id', $websiteId)
            ->getSize();
    }