def shouldAvoidDirectory(root, dirsToAvoid):
    """
    Given a directory (root, of type string) and a set of directory
    paths to avoid (dirsToAvoid, of type set of strings), return a boolean value
    describing whether the file is in that directory to avoid.
    """

    subPaths = root.split('/')

    for i, subPath in enumerate(subPaths):
        dir = '/'.join(subPaths[:i+1])

        if dir in dirsToAvoid:
            return True

    return False