def METHOD_NAME(self, owner=None):
    """
    Return the count of all semaphores by default, when ``owner`` is
    provided return the count of semaphores belong to ``owner``.
    Parameters:
        owner(str): Owner of semaphores.
    Returns:
        (int): the count of semaphores.
    """
    if owner:
        cnt = 0
        for sem in self._all_sems.values():
            cnt += 1 if sem.owner == owner else 0
        return cnt
    return len(self._all_sems)