def METHOD_NAME(self,
                 indices: List[int],
                 level: str
                 ) -> Union[AtomGroup, ResidueGroup, SegmentGroup]:
    """Convert list of atom_indices in a AtomGroup to either the
    Atoms or segments/residues containing these atoms.
    Parameters
    ----------
    indices
       list of atom indices
    level : str
      char (A, R, S). Return atoms(A), residues(R) or segments(S) within
      *radius* of *atoms*.
    """
    atomgroup = self.atom_group[indices]
    if level == 'A':
        return atomgroup
    elif level == 'R':
        return atomgroup.residues
    elif level == 'S':
        return atomgroup.segments
    else:
        raise NotImplementedError('{0}: level not implemented'.format(level))