disambiguate

glue.core.util.disambiguate(label, taken)[source]

If necessary, add a suffix to label to avoid name conflicts

Returns label if it is not in the taken set. Otherwise, returns label_NN where NN is the lowest integer such that label_NN not in taken.

Parameters
labelstr

Desired label

takeniterable

The set of already taken names