class_docstr: Coref Sample
class_docstr_tok: ["Coref","Sample"]
docstr: Check if `data` is a conll-dict and is ready to be predicted.
  
  :param None|dict data:
      Must have key: sentences, clusters
      May have key: doc_key, speakers, constituents, ner
  :return:
docstr_tok: ["Check","if","`","data","`","is","a","conll-dict","and","is","ready","to","be","predicted",".",":","param","None|dict","data",":","Must","have","key",":","sentences",",","clusters","May","have","key",":","doc_key",",","speakers",",","constituents",",","ner",":","return",":"]
code: def check_data(self, data):
      r"""
      Check if `data` is a conll-dict and is ready to be predicted.
  
      :param None|dict data:
          Must have key: sentences, clusters
          May have key: doc_key, speakers, constituents, ner
      :return:
  
      """
      if data == None:
          return
      assert isinstance(
          data, dict
      ), "To be loaded by CorefSample: not a dict"
      # doc_key: string
      if "doc_key" in data:
          assert isinstance(
              data["doc_key"], str
          ), "To be loaded by CorefSample: `doc_key` is not a str"
      # sentences: 2nd list of str; word list list
      assert "sentences" in data and isinstance(
          data["sentences"], list
      ), "To be loaded by CorefSample: `sentences` is not a list"
  
      if len(data["sentences"]) > 0:
          assert isinstance(data["sentences"][0], list), (
              "To be loaded by CorefSample: "
              "`sentences` is not a 2nd list"
          )
          assert isinstance(data["sentences"][0][0], str), (
              "To be loaded by CorefSample: "
              "`sentences` is not a word list list"
          )
  
      # speakers: 2nd list of str; word list list
      if "speakers" in data:
          assert isinstance(data["speakers"], list), (
              "To be loaded by CorefSample: " "`speakers` is not a list"
          )
          if len(data["speakers"]) > 0:
              assert isinstance(data["speakers"][0], list), (
                  "To be loaded by CorefSample: "
                  "`speakers` is not a 2nd list"
              )
              assert isinstance(data["speakers"][0][0], str), (
                  "To be loaded by CorefSample: "
                  "`speakers` is not a word list list"
              )
      # clusters: 2nd list of span([int, int]); cluster list
      assert "clusters" in data and isinstance(
          data["clusters"], list
      ), "To be loaded by CorefSample: `clusters` is not a list"
  
      if len(data["clusters"]) > 0:
          for cluster in data["clusters"]:
              assert isinstance(cluster, list), (
                  "To be loaded by CorefSample: "
                  "cluster in `clusters` is not a list"
              )
              assert len(cluster) > 1, (
                  "To be loaded by CorefSample: "
                  "cluster in `clusters` has < 2 spans"
              )
              assert isinstance(cluster[0][0], int), (
                  "To be loaded by CorefSample: "
                  "cluster in `clusters` is not a span list"
              )
  
      # constituents: list of tag([int, int, str])
      if "constituents" in data:
          assert isinstance(data["constituents"], list), (
              "To be loaded by CorefSample: "
              "`constituents` is not a list"
          )
          if len(data["constituents"]) > 0:
              assert isinstance(data["constituents"][0], list), (
                  "To be loaded by CorefSample: "
                  "constituent in `constituents` is not a list"
              )
              assert isinstance(data["constituents"][0][0], int), (
                  "To be loaded by CorefSample: "
                  "constituent in `constituents` is not a [b, e, label]"
              )
              assert isinstance(data["constituents"][0][2], str), (
                  "To be loaded by CorefSample: "
                  "constituent in `constituents` is not a [b, e, label]"
              )
  
      # ner: list of tag([int, int, str])
      if "ner" in data:
          assert isinstance(
              data["ner"], list
          ), "To be loaded by CorefSample: `ner` is not a list"
          if len(data["ner"]) > 0:
              assert isinstance(data["ner"][0], list), (
                  "To be loaded by CorefSample: "
                  "constituent in `ner` is not a list"
              )
              assert isinstance(data["ner"][0][0], int), (
                  "To be loaded by CorefSample: "
                  "constituent in `ner` is not a [b, e, label]"
              )
              assert isinstance(data["ner"][0][2], str), (
                  "To be loaded by CorefSample: "
                  "constituent in `ner` is not a [b, e, label]"
              )
  
imports: from ....common.settings import ORIGIN, TASK_MASK
  from ....common.utils.fp_utils import *
  from ....common.utils.shift_utils import *
  from .sample import Sample
  from ..field import ListField, TextField
label_desc: Use image node_id 3 for calling the CorefSample obj's underlying member method code with example usage: obj.check_data(data) without return types