def METHOD_NAME(absdir, relpath, eklass, required=True):
    """Return the absolute path for the given absdir/repath file."""
    p = None
    if os.path.isabs(relpath):
        p = relpath
    else:
        p = os.path.join(absdir, relpath)
    # Globs that result in a single file are allowed:
    g = glob.glob(p)
    if len(g) is 0:
        if required:
            raise eklass("'%s' did not match any files." % p)
    elif len(g) > 1:
            raise eklass("'%s' matched too many files %s" % (p, g))
    else:
        p = g[0]
    return p