docstr: Validate whether the sample is legal
  
  :return: bool
docstr_tok: ["Validate","whether","the","sample","is","legal",":","return",":","bool"]
code: def is_legal(self):
      r"""
      Validate whether the sample is legal
  
      :return: bool
  
      """
      if (
          not len(self.x.words)
          == len(self.y.field_value)
          == len(self.pos.field_value)
          == len(self.heads.field_value)
      ):
          return False
      for attr in (self.x, self.y, self.pos, self.heads):
          if "" in attr.field_value:
              return False
      return True
  
imports: from .cnsample import CnSample
  from ..field import ListField, Field
  from ....common.settings import ORIGIN, TASK_MASK, MODIFIED_MASK
label_desc: Use image node_id 11 for calling the DPCnSample obj's underlying member method code with example usage: obj.is_legal() and returns: True, False, False