def METHOD_NAME(cls, dirname, filename, candidate):
    # Cyclic dependency.
    from .Common import getStartDir
    parts = [dirname, filename]
    while None in parts:
        parts.remove(None)
    assert parts
    path = os.path.join(*parts)
    candidates = (
        dirname,
        filename,
        filename.rsplit(".", 1)[0],
        filename.rsplit(".", 1)[0].replace("Test", ""),
        path,
        path.rsplit(".", 1)[0],
        path.rsplit(".", 1)[0].replace("Test", ""),
    )
    return candidate.rstrip("/") in candidates or areSamePaths(
        os.path.join(getStartDir(), candidate), filename
    )