def _position_is_valid(position):
    """
    Checks if given position is a valid. To consider a position as valid, it
    must be a two-elements tuple, containing values from 0 to 2.
    Examples of valid positions: (0,0), (1,0)
    Examples of invalid positions: (0,0,1), (9,8), False

    :param position: Two-elements tuple representing a
                     position in the board. Example: (2, 2)

    Returns True if given position is valid, False otherwiseself.
    """
    return (True if isinstance(position, tuple) and
            #check length of tuple
            len(position) == 2 and 
            #check height
            position[0] in range(3) and 
            #check width
            position[1] in range(3)
            else False)