<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_monomers(self, ligands=True, pseudo_group=False):
 """Retrieves all the `Monomers` from the `Assembly` object. Parameters ligands : bool, optional If `true`, will include ligand `Monomers`. pseudo_group : bool, optional If `True`, will include pseudo atoms. """

        base_filters = dict(ligands=ligands, pseudo_group=pseudo_group)
        restricted_mol_types = [x[0] for x in base_filters.items() if not x[1]]
        in_groups = [x for x in self.filter_mol_types(restricted_mol_types)]
        monomers = itertools.chain(
            *(p.get_monomers(ligands=ligands) for p in in_groups))
        return monomers