code: def descendants(self, include_clip=True):
          
          for layer in self:
              yield layer
              if layer.is_group():
                  for child in layer.descendants(include_clip):
                      yield child
              if include_clip and hasattr(layer, 'clip_layers'):
                  for clip_layer in layer.clip_layers:
                      yield clip_layer
docs: Return a generator to iterate over all descendant layers.
  
          Example::
  
              # Iterate over all layers
              for layer in psd.descendants():
                  print(layer)
  
              # Iterate over all layers in reverse order
              for layer in reversed(list(psd.descendants())):
                  print(layer)
  
          :param include_clip: include clipping layers.