class_docstr: Entity position swap with paraphrase(employee related)
class_docstr_tok: ["Entity","position","swap","with","paraphrase","(","employee","related",")"]
docstr: Judge whether sentence piece between entities is attributive or not.
  
  :param list left: entity placed on the left
  :param list right: entity placed on the right
  :param list words: sentence tokens
  :param list middle_pos: token indices place between left
      entity and right entity
  :param list middle_words: token place between left entity
      and right entity
  :return bool : indicator or whether the middle part is
      attributive or not
docstr_tok: ["Judge","whether","sentence","piece","between","entities","is","attributive","or","not",".",":","param","list","left",":","entity","placed","on","the","left",":","param","list","right",":","entity","placed","on","the","right",":","param","list","words",":","sentence","tokens",":","param","list","middle_pos",":","token","indices","place","between","left","entity","and","right","entity",":","param","list","middle_words",":","token","place","between","left","entity","and","right","entity",":","return","bool",":","indicator","or","whether","the","middle","part","is","attributive","or","not"]
code: def assert_attributive(
      self, left, right, words, heads, middle_words, middle_pos
  ):
      r"""
      Judge whether sentence piece between entities is attributive or not.
  
      :param list left: entity placed on the left
      :param list right: entity placed on the right
      :param list words: sentence tokens
      :param list middle_pos: token indices place between left
          entity and right entity
      :param list middle_words: token place between left entity
          and right entity
      :return bool : indicator or whether the middle part is
          attributive or not
  
      """
      assert isinstance(
          left, list
      ), f"the type of 'left' should be list, got {type(left)} instead"
      assert isinstance(
          right, list
      ), f"the type of 'right' should be list, got {type(right)} instead"
      assert isinstance(
          words, list
      ), f"the type of 'words' should be list, got {type(words)} instead"
      assert isinstance(
          heads, list
      ), f"the type of 'heads' should be list, got {type(heads)} instead"
      assert isinstance(middle_pos, list), (
          f"the type of 'middle_pos' should be list, got "
          f"{type(middle_pos)} instead"
      )
      assert isinstance(middle_words, list), (
          f"the type of 'middle_words' should be list, got "
          f"{type(middle_words)} instead"
      )
      assert len(heads) == len(words), (
          f"the length of 'heads' should be equal with "
          f"the length of 'words', got {len(heads)} and {len(words)} instead"
      )
      assert (
          len([i for i in heads if i < 0 or i >= len(words)]) == 0
      ), f"got invalid value of 'heads': {heads}"
  
      is_attrib = True
      ent_words = left + right
      for word, pos in zip(middle_words, range(*middle_pos)):
          if word == ",":
              continue
          if (
              heads[pos] != 0
              and words[heads[pos] - 1] not in ent_words
              and (
                  heads[pos] < middle_pos[0] + 1
                  or heads[pos] > middle_pos[1]
              )
          ):
              is_attrib = False
  
      return is_attrib
  
file_path: textflint/textflint/generation/transformation/RE/swap_employee.py
imports: from ...transformation import Transformation
  from ....common.settings import TITLE
  from ....common.utils.install import download_if_needed
  from ....common.utils.load import json_loader
  from ....input.component.sample.re_sample import RESample
label_desc: Use image node_id 4 for calling the SwapEmployee obj's underlying member method code with example usage: obj.assert_attributive(left, right, words, heads, middle_words, middle_pos) and returns: is_attrib