<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'], spacing=None):
 r""" Add pores to the faces of the network for use as boundary pores. Pores are offset from the faces by 1/2 a lattice spacing such that they lie directly on the boundaries. 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']) spacing : scalar or array_like The spacing of the network (e.g. [1, 1, 1]). This should be given since it can be quite difficult to infer from the network, for instance if boundary pores have already added to other faces. """

        if type(labels) == str:
            labels = [labels]
        x, y, z = self['pore.coords'].T
        if spacing is None:
            spacing = self._spacing
        else:
            spacing = sp.array(spacing)
            if spacing.size == 1:
                spacing = sp.ones(3)*spacing
        Lcx, Lcy, Lcz = spacing

        offset = {}
        offset['front'] = offset['left'] = offset['bottom'] = [0, 0, 0]
        offset['back'] = [Lcx*self._shape[0], 0, 0]
        offset['right'] = [0, Lcy*self._shape[1], 0]
        offset['top'] = [0, 0, Lcz*self._shape[2]]

        scale = {}
        scale['front'] = scale['back'] = [0, 1, 1]
        scale['left'] = scale['right'] = [1, 0, 1]
        scale['bottom'] = scale['top'] = [1, 1, 0]

        for label in labels:
            Ps = self.pores(label)
            topotools.clone_pores(network=self, pores=Ps,
                                  labels=label+'_boundary')
            # Translate cloned pores
            ind = self.pores(label+'_boundary')
            coords = self['pore.coords'][ind]
            coords = coords*scale[label] + offset[label]
            self['pore.coords'][ind] = coords