def add_prefix()

in gym-compete/gym_compete/new_envs/utils.py [0:0]


def add_prefix(root, prop, prefix, force_set=False):
    if root is None:
        return
    root_prop_val = root.get(prop)
    if root_prop_val is not None:
        root.set(prop, prefix + '/' + root_prop_val)
    elif force_set:
        root.set(prop, prefix + '/' + 'anon' + str(np.random.randint(1, 1e10)))
    children = list(root)
    for child in children:
        add_prefix(child, prop, prefix, force_set)