code: def create_model(train_graph, iterator):
      """Create model and placeholders."""
      if FLAGS.clueweb_data:
          (
              s,
              nbrs_s,
              text_nbrs_s,
              r,
              candidates,
              nbrs_candidates,
              labels,
              text_nbrs_s_emb,
          ) = iterator.get_next()
      elif FLAGS.text_kg_file:
          (
              s,
              nbrs_s,
              text_nbrs_s,
              r,
              candidates,
              nbrs_candidates,
              labels,
          ) = iterator.get_next()
      else:
          (
              s,
              nbrs_s,
              r,
              candidates,
              nbrs_candidates,
              labels,
          ) = iterator.get_next()
  
      # Create the attention model, this returns candidates scores and the model
      # encoders in a dict for creating feed_dict for all encoders
      is_train_ph = tf.placeholder_with_default(
          True, shape=[], name="is_train_ph"
      )
      if FLAGS.model == "attention":
          with tf.variable_scope("attention_model", reuse=False):
              candidate_scores, model = models.attention_kbc_model(
                  FLAGS,
                  train_graph,
                  is_train_ph,
                  (s, nbrs_s, r, candidates, nbrs_candidates),
              )
      elif FLAGS.model == "source_attention":
          with tf.variable_scope("s_attention_model", reuse=False):
              (
                  candidate_scores,
                  model,
              ) = models.source_attention_kbc_model(
                  FLAGS,
                  train_graph,
                  is_train_ph,
                  (s, nbrs_s, r, candidates),
              )
      elif FLAGS.model in [
          "source_rel_attention",
          "source_path_attention",
      ]:
          if FLAGS.clueweb_data:
              input_tensors = (
                  s,
                  nbrs_s,
                  text_nbrs_s,
                  text_nbrs_s_emb,
                  r,
                  candidates,
              )
          elif FLAGS.text_kg_file:
              input_tensors = (s, nbrs_s, text_nbrs_s, r, candidates)
          else:
              input_tensors = (s, nbrs_s, r, candidates)
          with tf.variable_scope("s_attention_model", reuse=False):
              (
                  candidate_scores,
                  model,
              ) = models.source_attention_kbc_model(
                  FLAGS,
                  train_graph,
                  is_train_ph,
                  input_tensors,
                  model_type=FLAGS.model,
              )
      elif FLAGS.model == "distmult":
          with tf.variable_scope("distmult_model", reuse=False):
              candidate_scores, model = models.distmult_kbc_model(
                  FLAGS, train_graph, is_train_ph, (s, r, candidates)
              )
      if FLAGS.clueweb_data:
          inputs = (
              s,
              nbrs_s,
              text_nbrs_s,
              text_nbrs_s_emb,
              r,
              candidates,
              nbrs_candidates,
          )
      elif FLAGS.text_kg_file:
          inputs = (
              s,
              nbrs_s,
              text_nbrs_s,
              r,
              candidates,
              nbrs_candidates,
          )
      else:
          inputs = (s, nbrs_s, r, candidates, nbrs_candidates)
  
      return (
          candidate_scores,
          candidates,
          labels,
          model,
          is_train_ph,
          inputs,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import gc
  import math
  import os
  from absl import app
  from absl import flags
  from absl import logging
  import clueweb_text_graph
  import dataset
  import graph
  import losses
  import metrics
  import models
  import numpy
  import slim
  from tensorboard.plugins import projector
  import tensorflow
  from tensorflow.python.training.summary_io import SummaryWriterCache
  import text_graph
  import utils
label_desc: Use image node_id 4 for calling a global function with example usage: create_model(train_graph, iterator) and returns: candidate_scores,  candidates,  labels,  model,  is_train_ph,  inputs