<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def num_pores(self, labels='all', mode='or'):
 r""" Returns the number of pores of the specified labels Parameters labels : list of strings, optional The pore labels that should be included in the count. If not supplied, all pores are counted. labels : list of strings Label of pores to be returned mode : string, optional Specifies how the count should be performed. The options are: **'or', 'union', 'any'** : (default) Pores with *one or more* of the given labels are counted. **'and', 'intersection', 'all'** : Pores with *all* of the given labels are counted. **'xor', 'exclusive_or'** : Pores with *only one* of the given labels are counted. **'nor', 'none', 'not'** : Pores with *none* of the given labels are counted. **'nand'** : Pores with *some but not all* of the given labels are counted. **'xnor'** : Pores with *more than one* of the given labels are counted. Returns ------- Np : int Number of pores with the specified labels See Also -------- num_throats count Notes ----- Technically, *'nand'* and *'xnor'* should also count pores with *none* of the labels, however, to make the count more useful these are not included. Examples -------- 125 25 45 5 """

        # Count number of pores of specified type
        Ps = self._get_indices(labels=labels, mode=mode, element='pore')
        Np = sp.shape(Ps)[0]
        return Np