def set_outlets(self, pores=None, mode='add'):
        r"""
        Set the locations through which defending phase exits the network.
        This is only necessary if 'trapping'was set to True when setup was
        called.

        Parameters
        ----------
        pores : array_like
            An array of pore numbers where defending phase can exit.  Any
            defending phase that does not have access to these pores will be
            trapped.

        mode : string
            Controls how the new values are handled.  Options are:

            **'add'** : (default) Adds the newly recieved locations to any
            existing locations.  This is useful for incrementally adding
            outlets.

            **'overwrite'** : Deletes any present locations and adds new ones.
            This is useful for fixing mistaken outlets, or rerunning the
            algorithm with different outlet locations.

            **'remove'** : Removes the received locations from the list of
            outlet pores.

            **'clear'** : Removes the existing outlets and ignores any
            specified locations. This is equivalent to calling the method with
            a mode of 'overwrite' and pores = [] or None.

        """
        if self._trapping is False:
            raise Exception('Setting outlets is meaningless unless trapping ' +
                            'was set to True during setup')
        Ps = self._parse_locations(pores)
        if mode in ['clear', 'overwrite']:
            self['pore.outlets'] = False
        if 0 > sum(self['pore.inlets'][Ps]):
            raise Exception('Some outlets are already defined as inlets')
        bool_val = True
        if mode is 'remove':
            bool_val = False
        self['pore.outlets'][Ps] = bool_val
dataset/ETHPy150Open PMEAL/OpenPNM/OpenPNM/Algorithms/__Drainage__.py/Drainage.set_outlets/swapped operands of `>`