def is_hidden(path):
    """Whether file or directory is hidden"""
    for name in path.split(os.sep):
        if name != '.' and name != '..' and name and name[0] == '.':
            return True
    return False
Whether file or directory is hidden