<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_boundary_pores(self, labels=['top', 'bottom', 'front', 'back', 'left', 'right'], offset=None):
 r""" Add boundary pores to the specified faces of the network Pores are offset from the faces of the domain. Parameters labels : string or list of strings The labels indicating the pores defining each face where boundary pores are to be added (e.g. 'left' or ['left', 'right']) offset : scalar or array_like The spacing of the network (e.g. [1, 1, 1]). This must be given since it can be quite difficult to infer from the network, for instance if boundary pores have already added to other faces. """

        offset = sp.array(offset)
        if offset.size == 1:
            offset = sp.ones(3)*offset
        for item in labels:
            Ps = self.pores(item)
            coords = sp.absolute(self['pore.coords'][Ps])
            axis = sp.count_nonzero(sp.diff(coords, axis=0), axis=0) == 0
            ax_off = sp.array(axis, dtype=int)*offset
            if sp.amin(coords) == sp.amin(coords[:, sp.where(axis)[0]]):
                ax_off = -1*ax_off
            topotools.add_boundary_pores(network=self, pores=Ps, offset=ax_off,
                                         apply_label=item + '_boundary')