<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_unique_figname(dirname, root, ext):
 """ Append a number to "root" to form a filename that does not already exist in "dirname". """

    i = 1
    figname = root + '_%d' % i + ext
    while True:
        if osp.exists(osp.join(dirname, figname)):
            i += 1
            figname = root + '_%d' % i + ext
        else:
            return osp.join(dirname, figname)