def __is_valid_pos(pos_tuple, valid_pos):
    # type: (Tuple[text_type,...],List[Tuple[text_type,...]])->bool
    """This function checks token's pos is with in POS set that user specified.
    If token meets all conditions, Return True; else return False
    """
    def is_valid_pos(valid_pos_tuple):
        # type: (Tuple[text_type,...])->bool
        length_valid_pos_tuple = len(valid_pos_tuple)
        if valid_pos_tuple == pos_tuple[:length_valid_pos_tuple]:
            return True
        else:
            return False

    seq_bool_flags = [is_valid_pos(valid_pos_tuple) for valid_pos_tuple in valid_pos]

    if True in set(seq_bool_flags):
        return True
    else:
        return False
def __is_valid_pos ( pos_tuple , valid_pos ) : def is_valid_pos ( valid_pos_tuple ) : length_valid_pos_tuple = len ( valid_pos_tuple ) if valid_pos_tuple == pos_tuple [ : length_valid_pos_tuple ] : return True else : return False seq_bool_flags = [ is_valid_pos ( valid_pos_tuple ) for valid_pos_tuple in valid_pos ] if True in set ( seq_bool_flags ) : return True else : return False
This function checks token's pos is with in POS set that user specified.
    If token meets all conditions, Return True; else return False