code: def get_in_turn_repetition(pred, is_cn=False):
      """Get in-turn repetition."""
      if len(pred) == 0:
          return 1.0
      if isinstance(pred[0], str):
          pred = [tok.lower() for tok in pred]
          if is_cn:
              pred = "".join(pred)
      tri_grams = set()
      for i in range(len(pred) - 2):
          tri_gram = tuple(pred[i : i + 3])
          if tri_gram in tri_grams:
              return 1.0
          tri_grams.add(tri_gram)
      return 0.0
  
imports: from collections import namedtuple
  import paddle
  import paddle.nn
  import paddle.nn.functional
label_desc: Use image node_id 4 for calling a global function with example usage: get_in_turn_repetition(pred, is_cn) and returns: int, int, int