def set_inlets(self, pores=None, mode='add'):
        r"""
        Set the locations from which the invading phase enters the network.

        Parameters
        ----------
        pores : array_like
            An array of pore numbers that are initially filled with invading
            phase, and from which clusters of invading phase grow and invade
            into the network.

        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
            inlets.

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

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

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

        Notes
        -----
        The 'inlet' pores are initially filled with invading fluid to start the
        simulation.  To avoid the capillary pressure curve showing a non-zero
        starting saturation at low pressures, it is necessary to create
        boundary pores that have zero-volume, and set these as the inlets.
        """
        Ps = self._parse_locations(pores)
        if mode in ['clear', 'overwrite']:
            self['pore.inlets'] = False
        if sum(self['pore.outlets'][Ps]) > 0:
            raise Exception('Some inlets are already defined as outlets')
        bool_val = True
        if mode is 'remove':
            bool_val = False
        self['pore.inlets'][Ps] = bool_val
dataset/ETHPy150Open PMEAL/OpenPNM/OpenPNM/Algorithms/__Drainage__.py/Drainage.set_inlets/original