code: def run(
      data_name="cora",
      algo="graphnas",
      num_epochs=50,
      ctrl_steps_aggregate=20,
      log_dir="./logs/tmp",
  ):
      print(
          "Testing backend: {}".format(
              "dgl" if DependentBackend.is_dgl() else "pyg"
          )
      )
      if DependentBackend.is_dgl():
          from autogl.datasets.utils.conversion._to_dgl_dataset import (
              to_dgl_dataset as convert_dataset,
          )
      else:
          from autogl.datasets.utils.conversion._to_pyg_dataset import (
              to_pyg_dataset as convert_dataset,
          )
  
      di = 2
      do = 2
      dataset = None
  
      ops_type = data_name == "proteins"
  
      space = BenchSpace().cuda()
      space.instantiate(input_dim=di, output_dim=do, ops_type=ops_type)
      esti = BenchEstimator(data_name)
      if algo == "graphnas":
          algo = GraphNasRL(
              num_epochs=num_epochs,
              ctrl_steps_aggregate=ctrl_steps_aggregate,
          )
      elif algo == "agnn":
          algo = AGNNRL(
              guide_type=1,
              num_epochs=num_epochs,
              ctrl_steps_aggregate=ctrl_steps_aggregate,
          )
      else:
          assert False, f"Not implemented algo {algo}"
      model = algo.search(space, dataset, esti)
      result = esti.infer(model._model, None)[0][0]
  
      os.makedirs(log_dir, exist_ok=True)
      with open(osp.join(log_dir, f"log.txt"), "w") as f:
          f.write(str(result))
  
      import json
  
      archs = algo.allhist
      json.dump(archs, open(osp.join(log_dir, f"archs.json"), "w"))
  
      arch_strs = [str(x[1]) for x in archs]
      print(
          f"number of archs: {len(arch_strs)} ; number of unique archs : {len(set(arch_strs))}"
      )
  
      scores = [-x[0] for x in archs]  # accs
      idxs = np.argsort(scores)  # increasing order
      with open(osp.join(log_dir, f"idx.txt"), "w") as f:
          f.write(str(idxs))
      return result
  
imports: import os
  import logging
  from autogl.backend import DependentBackend
  from autogl.datasets import build_dataset_from_name
  import torch
  from torch import nn
  import torch.nn.functional
  from autogl.module.nas.backend import bk_feat, bk_label
  from autogl.module.nas.algorithm import Darts, RL, GraphNasRL, Enas, RandomSearch, Spos
  from autogl.module.nas.estimator import BaseEstimator
  from autogl.module.train.evaluation import Acc
  import numpy
  from autogl.solver.utils import set_seed
  from autogl.module.nas.space import BaseSpace
  import typing
  from nas_bench_graph import light_read, gnn_list, gnn_list_proteins, Arch
  import pandas
  import argparse
  import os
  import os.path
label_desc: Use image node_id 1 for calling a global function with example usage: run(data_name, algo, num_epochs, ctrl_steps_aggregate, log_dir) and returns: result