def get_atom_numbers(structure):
    """get a list of atom numbers composing a biopython structure

    it gives you the atom numbers from the atoms composing the given
    biopython structure

    Parameters
    ------------
    structure : bioopython structure or list of atoms

    Returns
    -----------
    list(int)
        the list of all the atom numbers composing the structure

    Notes
    ------------
    useful when definig an area of the structure (like an alchemical region)
    with atom indexes (atom numbers)
    """

    atom_numbers = []

    if hasattr(structure, 'get_atoms'):

        atoms = structure.get_atoms()

    else:  # list of atoms

        atoms = structure

    for atom in atoms:

        atom_numbers.append(atom.get_serial_number())

    return atom_numbers