code: def add_boundary_pores(network, pores, offset, apply_label='boundary'):
      r
      # Parse the input pores
      Ps = sp.array(pores, ndmin=1)
      if Ps.dtype is bool:
          Ps = network.toindices(Ps)
      if sp.size(pores) == 0:  # Handle an empty array if given
          return sp.array([], dtype=sp.int64)
      # Clone the specifed pores
      clone_pores(network=network, pores=Ps)
      newPs = network.pores('pore.clone')
      del network['pore.clone']
      newTs = network.throats('clone')
      del network['throat.clone']
      # Offset the cloned pores
      network['pore.coords'][newPs] += offset
      # Apply labels to boundary pores (trim leading 'pores' if present)
      label = apply_label.split('.')[-1]
      plabel = 'pore.' + label
      tlabel = 'throat.' + label
      network[plabel] = False
      network[plabel][newPs] = True
      network[tlabel] = False
      network[tlabel][newTs] = True
docs: r"""
      This method uses ``clone_pores`` to clone the input pores, then shifts
      them the specified amount and direction, then applies the given label.
  
      Parameters
      ----------
      pores : array_like
          List of pores to offset.  If no pores are specified, then it
          assumes that all surface pores are to be cloned.
  
      offset : 3 x 1 array
          The distance in vector form which the cloned boundary pores should
          be offset.
  
      apply_label : string
          This label is applied to the boundary pores.  Default is
          'boundary'.
  
      Examples
      --------
      >>> import openpnm as op
      >>> pn = op.network.Cubic(shape=[5, 5, 5])
      >>> print(pn.Np)  # Confirm initial Network size
      125
      >>> Ps = pn.pores('top')  # Select pores on top face
      >>> pn.add_boundary_pores(labels=['top'])
      >>> print(pn.Np)  # Confirm addition of 25 new pores
      150