def assign_force_field(ampal_obj, ff):
if hasattr(ampal_obj, '<STR_LIT>'):<EOL><INDENT>atoms = ampal_obj.get_atoms(ligands=True, inc_alt_states=True)<EOL><DEDENT>else:<EOL><INDENT>atoms = ampal_obj.get_atoms(inc_alt_states=True)<EOL><DEDENT>for atom in atoms:<EOL><INDENT>w_str = None<EOL>a_ff_id = None<EOL>if atom.element == '<STR_LIT:H>':<EOL><INDENT>continue<EOL><DEDENT>elif atom.parent.mol_code.upper() in ff:<EOL><INDENT>if atom.res_label.upper() in ff[atom.parent.mol_code]:<EOL><INDENT>a_ff_id = (atom.parent.mol_code.upper(),<EOL>atom.res_label.upper())<EOL><DEDENT>elif atom.res_label.upper() in ff['<STR_LIT>']:<EOL><INDENT>a_ff_id = ('<STR_LIT>', atom.res_label.upper())<EOL><DEDENT>else:<EOL><INDENT>w_str = ('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>').format(<EOL>atom.res_label, atom.parent.mol_code)<EOL><DEDENT><DEDENT>elif atom.res_label.upper() in ff['<STR_LIT>']:<EOL><INDENT>a_ff_id = ('<STR_LIT>', atom.res_label.upper())<EOL><DEDENT>else:<EOL><INDENT>w_str = ('<STR_LIT>'<EOL>'<STR_LIT>').format(<EOL>atom.res_label, atom.parent.mol_code)<EOL><DEDENT>if w_str:<EOL><INDENT>warnings.warn(w_str, NotParameterisedWarning)<EOL><DEDENT>atom.tags['<STR_LIT>'] = a_ff_id<EOL><DEDENT>return<EOL>
Assigns force field parameters to Atoms in the AMPAL object.

    Parameters
    ----------
    ampal_obj : AMPAL Object
        Any AMPAL object with a `get_atoms` method.
    ff: BuffForceField
        The force field to be used for scoring.