class_docstr: A fairly basic optimiser designed to increase the value of scores for
  targeted property-based testing.
  
  This implements a fairly naive hill climbing algorithm based on randomly
  regenerating parts of the test case to attempt to improve the result. It is
  not expected to produce amazing results, because it is designed to be run
  in a fairly small testing budget, so it prioritises finding easy wins and
  bailing out quickly if that doesn't work.
  
  For more information about targeted property-based testing, see
  Löscher, Andreas, and Konstantinos Sagonas. "Targeted property-based
  testing." Proceedings of the 26th ACM SIGSOFT International Symposium on
  Software Testing and Analysis. ACM, 2017.
class_docstr_tok: ["A","fairly","basic","optimiser","designed","to","increase","the","value","of","scores","for","targeted","property-based","testing",".","This","implements","a","fairly","naive","hill","climbing","algorithm","based","on","randomly","regenerating","parts","of","the","test","case","to","attempt","to","improve","the","result",".","It","is","not","expected","to","produce","amazing","results",",","because","it","is","designed","to","be","run","in","a","fairly","small","testing","budget",",","so","it","prioritises","finding","easy","wins","and","bailing","out","quickly","if","that","does","n't","work",".","For","more","information","about","targeted","property-based","testing",",","see","L\u00f6scher",",","Andreas",",","and","Konstantinos","Sagonas",".","``","Targeted","property-based","testing",".","''","Proceedings","of","the","26th","ACM","SIGSOFT","International","Symposium","on","Software","Testing","and","Analysis",".","ACM",",","2017","."]
docstr: Consider a new data object as a candidate target. If it is better
  than the current one, return True.
docstr_tok: ["Consider","a","new","data","object","as","a","candidate","target",".","If","it","is","better","than","the","current","one",",","return","True","."]
code: def consider_new_test_data(self, data):
      """Consider a new data object as a candidate target. If it is better
      than the current one, return True."""
      if data.status < Status.VALID:
          return False
      score = self.score_function(data)
      if score < self.current_score:
          return False
      if score > self.current_score:
          self.improvements += 1
          self.current_data = data
          return True
      assert score == self.current_score
      # We allow transitions that leave the score unchanged as long as they
      # don't increase the buffer size. This gives us a certain amount of
      # freedom for lateral moves that will take us out of local maxima.
      if len(data.buffer) <= len(self.current_data.buffer):
          self.current_data = data
          return True
      return False
  
file_path: catboost/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/optimiser.py
imports: from hypothesis.internal.compat import int_from_bytes, int_to_bytes
  from hypothesis.internal.conjecture.data import Status
  from hypothesis.internal.conjecture.engine import BUFFER_SIZE
  from hypothesis.internal.conjecture.junkdrawer import find_integer
  from hypothesis.internal.conjecture.pareto import NO_SCORE
label_desc: Use image node_id 5 for calling the Optimiser obj's underlying member method code with example usage: obj.consider_new_test_data(data) and returns: False, False, False, True, True