def check_neighbor(self, input_ex: Example, neighbor_ex: Example,
                     state: Any) -> bool:
    """Returns whether the neighbor is usable.

    Optionally, a state can be maintained (e.g., to count how many neighbors so
    far belong to each intent, for crowding purposes). The state will be given
    as an argument.

    Args:
      input_ex: Input example.
      neighbor_ex: Neighbor example.
      state: The state object. Will be None for the first neighbor.

    Returns:
      True if the neighbor should be accepted and False otherwise.
    """
    raise NotImplementedError
Returns whether the neighbor is usable.

    Optionally, a state can be maintained (e.g., to count how many neighbors so
    far belong to each intent, for crowding purposes). The state will be given
    as an argument.

    Args:
      input_ex: Input example.
      neighbor_ex: Neighbor example.
      state: The state object. Will be None for the first neighbor.

    Returns:
      True if the neighbor should be accepted and False otherwise.
    
language/casper/retrieve/query_retrievers.py