docstr: Check whether 'sentence1', 'sentence2 and 'y' is legal
  
  :param dict data: contains 'sentence1', 'sentence2', 'y' keys.
  :return:
docstr_tok: ["Check","whether","'sentence1","'",",","'sentence2","and","'","y","'","is","legal",":","param","dict","data",":","contains","'sentence1","'",",","'sentence2","'",",","'","y","'","keys",".",":","return",":"]
code: def check_data(self, data):
      r"""
      Check whether 'sentence1', 'sentence2 and 'y' is legal
  
      :param dict data: contains 'sentence1', 'sentence2', 'y' keys.
      :return:
  
      """
      assert "sentence1" in data and isinstance(
          data["sentence1"], str
      ), "sentence1 should be in data, and the type of context should be str"
      assert "sentence2" in data and isinstance(
          data["sentence2"], str
      ), "sentence2 should be in data, and the type of context should be str"
      assert "y" in data, "y should be in data, and y can be '0' or '1'"
  
file_path: textflint/textflint/input/component/sample/sm_sample.py
imports: from .sample import Sample
  from ..field import Field
  from ..field import TextField
label_desc: Use image node_id 3 for calling the SMSample obj's underlying member method code with example usage: obj.check_data(data) without return types