class_docstr: Transforms the input sentence by adding a subordinate clause from WikiData.
  
  Example::
      original: "And it left mixed signals for London."
      transformed: "And it left mixed signals for London, which is a capital
          and largest city of the United Kingdom."
class_docstr_tok: ["Transforms","the","input","sentence","by","adding","a","subordinate","clause","from","WikiData",".","Example",":",":","original",":","``","And","it","left","mixed","signals","for","London",".","''","transformed",":","``","And","it","left","mixed","signals","for","London",",","which","is","a","capital","and","largest","city","of","the","United","Kingdom",".","''"]
docstr: Transform each sample case.
  
  :param ~DPSample sample:
  :return: transformed sample list.
docstr_tok: ["Transform","each","sample","case",".",":","param","~DPSample","sample",":",":","return",":","transformed","sample","list","."]
code: def _transform(self, sample, n=5, **kwargs):
      r"""
      Transform each sample case.
  
      :param ~DPSample sample:
      :return: transformed sample list.
  
      """
      entity_list = self.find_entity(sample)
      words = sample.get_words("x")
      deprels = sample.get_value("deprel")
      result = []
  
      for i, word_id in enumerate(entity_list):
          if i >= n:
              break
          else:
              word_list = [words[a - 1] for a in word_id]
              entity = "%20".join(word_list)
              clause_add = self.get_clause(entity)
  
              if clause_add:
                  tokens_add = [","] + clause_add.split()
                  if deprels[word_id[-1]] != "punct":
                      tokens_add.append(",")
  
                  for token in tokens_add[::-1]:
                      sample_mod = sample.insert_field_before_index(
                          "x", word_id[-1], token
                      )
                  result.append(sample_mod)
  
      return result
  
file_path: textflint/textflint/generation/transformation/DP/add_sub_tree.py
imports: import json
  import random
  import urllib.request
  from wikidata.client import Client
  from wikidata.entity import Entity, EntityId
  from ..transformation import Transformation
  from ....common.utils.error import FlintError
  from ....common.settings import WIKIDATA_STATEMENTS, CLAUSE_HEAD, WIKIDATA_INSTANCE
label_desc: Use image node_id 2 for calling the AddSubTree obj's underlying member method code with example usage: obj._transform(sample, n) and returns: result