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