code: def num_pores(self, labels='all', mode='or'):
          r
          # Count number of pores of specified type
          Ps = self._get_indices(labels=labels, mode=mode, element='pore')
          Np = sp.shape(Ps)[0]
          return Np
docs: 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
          --------
          >>> import openpnm as op
          >>> pn = op.network.Cubic(shape=[5, 5, 5])
          >>> pn.num_pores()
          125
          >>> pn.num_pores(labels=['top'])
          25
          >>> pn.num_pores(labels=['top', 'front'], mode='or')
          45
          >>> pn.num_pores(labels=['top', 'front'], mode='xnor')
          5