<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_polypeptide_within(self, chain_id, resnum, angstroms, only_protein=True, use_ca=False, custom_coord=None, return_resnums=False):
 """Get a Polypeptide object of the amino acids within X angstroms of the specified chain + residue number. Args: resnum (int):
 Residue number of the structure chain_id (str):
 Chain ID of the residue number angstroms (float):
 Radius of the search sphere only_protein (bool):
 If only protein atoms (no HETATMS) should be included in the returned sequence use_ca (bool):
 If the alpha-carbon atom should be used for searching, default is False (last atom of residue used) custom_coord (list):
 custom XYZ coord return_resnums (bool):
 if list of resnums should be returned Returns: Bio.PDB.Polypeptide.Polypeptide: Biopython Polypeptide object """

        # XTODO: documentation, unit test
        if self.structure:
            parsed = self.structure
        else:
            parsed = self.parse_structure()

        residue_list = ssbio.protein.structure.properties.residues.within(resnum=resnum, chain_id=chain_id,
                                                                          model=parsed.first_model,
                                                                          angstroms=angstroms, use_ca=use_ca,
                                                                          custom_coord=custom_coord)

        if only_protein:
            filtered_residue_list = [x for x in residue_list if x.id[0] == ' ']
        else:
            filtered_residue_list = residue_list

        residue_list_combined = Polypeptide(filtered_residue_list)

        if return_resnums:
            resnums = [int(x.id[1]) for x in filtered_residue_list]
            return residue_list_combined, resnums

        return residue_list_combined