def __iadd__(self, layer):
        """Add the layer to the stage.  Allows "+=" syntax."""

        # The name of the stage should reflect the name the user
        # provided in the baseimage primitive (via the _as parameter).
        # This violates the encapsulation of the baseimage primitive.
        if layer.__class__.__name__ == 'baseimage' and not self.name:
          self.name = layer._baseimage__as

        if isinstance(layer, list):
            self.__layers.extend(layer)
        else:
            self.__layers.append(layer)
        return self
Add the layer to the stage.  Allows "+=" syntax.
hpccm/Stage.py