def find_path(kwargs, var, root):
 defaults = PATH_DEFAULTS[var]
 if (kwargs.get(var, None) is not None):
  path = kwargs.get(var)
 else:
  for default in defaults:
   if os.path.exists(resolve_path(default, root)):
    path = default
    break
  else:
   path = defaults[(-1)]
 return resolve_path(path, root)

def find_path ( kwargs , var , root ) : defaults = PATH_DEFAULTS [ var ] if ( kwargs . get ( var , None ) is not None ) : path = kwargs . get ( var ) else : for default in defaults : if os . path . exists ( resolve_path ( default , root ) ) : path = default break else : path = defaults [ ( - 1 ) ] return resolve_path ( path , root )
find a configuration path that may exist at different defaults .