code: def get_ligands(self, solvent=True):
          
          if solvent:
              ligand_list = [x for x in self.get_monomers()
                             if isinstance(x, Ligand)]
          else:
              ligand_list = [x for x in self.get_monomers() if isinstance(
                  x, Ligand) and not x.is_solvent]
          return LigandGroup(monomers=ligand_list)
docs: Retrieves all ligands from the `Assembly`.
  
          Parameters
          ----------
          solvent : bool, optional
              If `True`, solvent molecules will be included.