code: def main(_):
      flags_obj = tf.flags.FLAGS
      euler_graph = tf_euler.dataset.get_dataset(flags_obj.dataset)
      euler_graph.load_graph()
  
      dims = [flags_obj.hidden_dim, flags_obj.hidden_dim]
      if flags_obj.run_mode == "train":
          metapath = [euler_graph.train_edge_type]
      else:
          metapath = [euler_graph.all_edge_type]
      num_steps = int(
          (euler_graph.total_size + 1)
          // flags_obj.batch_size
          * flags_obj.num_epochs
      )
  
      model = APPNP(
          dims,
          metapath,
          euler_graph.feature_idx,
          euler_graph.feature_dim,
          euler_graph.label_idx,
          euler_graph.label_dim,
          K=flags_obj.layers,
          alpha=flags_obj.alpha,
      )
  
      params = {
          "train_node_type": euler_graph.train_node_type[0],
          "batch_size": flags_obj.batch_size,
          "optimizer": flags_obj.optimizer,
          "learning_rate": flags_obj.learning_rate,
          "log_steps": flags_obj.log_steps,
          "model_dir": flags_obj.model_dir,
          "id_file": euler_graph.id_file,
          "infer_dir": flags_obj.model_dir,
          "total_step": num_steps,
      }
      config = tf.estimator.RunConfig(log_step_count_steps=None)
      model_estimator = NodeEstimator(model, params, config)
  
      if flags_obj.run_mode == "train":
          model_estimator.train()
      elif flags_obj.run_mode == "evaluate":
          model_estimator.evaluate()
      elif flags_obj.run_mode == "infer":
          model_estimator.infer()
      else:
          raise ValueError("Run mode not exist!")
  
file_path: euler/examples/appnp/run_appnp.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  import tf_euler
  from euler_estimator import NodeEstimator
  from appnp import APPNP
label_desc: Use image node_id 2 for calling a global function with example usage: main(_) without return types