def randomize_molecule(molecule, manipulations, nonbond_thresholds, max_tries=<NUM_LIT:1000>):
for m in range(max_tries):<EOL><INDENT>random_molecule = randomize_molecule_low(molecule, manipulations)<EOL>if check_nonbond(random_molecule, nonbond_thresholds):<EOL><INDENT>return random_molecule<EOL><DEDENT><DEDENT>
Return a randomized copy of the molecule.

       If no randomized molecule can be generated that survives the nonbond
       check after max_tries repetitions, None is returned. In case of success,
       the randomized molecule is returned. The original molecule is not
       altered.