class_docstr: Add extra entity-related clause to text
class_docstr_tok: ["Add","extra","entity-related","clause","to","text"]
docstr: Obtain entity-related clause
  
  :param string entid: index of entity
  :return string: entity clause
docstr_tok: ["Obtain","entity-related","clause",":","param","string","entid",":","index","of","entity",":","return","string",":","entity","clause"]
code: def _get_clause(self, entid):
      r"""
      Obtain entity-related clause
  
      :param string entid: index of entity
      :return string: entity clause
      """
      assert isinstance(
          entid, str
      ), f"the type of 'entid' should be str, got {type(entid)} instead"
      client = Client()
      entity = client.get(entid)
  
      random.shuffle(WIKIDATA_STATEMENTS_no_zero)
      for sta in WIKIDATA_STATEMENTS_no_zero:
          staent = client.get(sta)
          statement = entity.getlist(staent)
          if statement:
              if isinstance(statement[0], wikidata.entity.Entity):
                  ret = CLAUSE_HEAD_no_zero[sta] + str(
                      statement[0].label
                  )
              else:
                  ret = CLAUSE_HEAD_no_zero[sta] + str(statement[0])
              return ret
      return CLAUSE_HEAD_no_zero["description"] + str(
          entity.description
      )
  
file_path: textflint/textflint/generation/transformation/RE/insert_clause.py
imports: import urllib.request
  import wikidata
  from wikidata.client import Client
  import random
  import json
  from ....common.utils.error import FlintError
  from ...transformation import Transformation
  from ....input.component.sample.re_sample import RESample
  from ....common.settings import WIKIDATA_STATEMENTS_no_zero, CLAUSE_HEAD_no_zero, scbase
label_desc: Use image node_id 4 for calling the InsertClause obj's underlying member method code with example usage: obj._get_clause(entid) and returns: unknown, ret