code: def test_transform(py2graph):
      code = """
  def train(model, device, loader, optimizer):
      model.train()
  
      loss_accum = 0
      for step, batch in enumerate(tqdm(loader, desc="Iteration")):
          batch = batch.to(device)
  
          if batch.x.shape[0] == 1 or batch.batch[-1] == 0:
              pass
          else:
              pred_list = model(batch)
              optimizer.zero_grad()
  
              loss = 0
              for i in range(len(pred_list)):
                  loss += multicls_criterion(pred_list[i].to(torch.float32), batch.y_arr[:,i])
  
              loss = loss / len(pred_list)
              
              loss.backward()
              optimizer.step()
  
              loss_accum += loss.item()
  
      print('Average training loss: {}'.format(loss_accum / (step + 1)))
  """
  
      graph = py2graph(code)
      print(graph)
  
      invalid_code = """
  import antigravity
  xkcd loves Python
  """
  
      try:
          graph = py2graph(invalid_code)
      except SyntaxError:
          print("Successfully caught syntax error")
  
file_path: ogb/examples/graphproppred/code2/py2graph.py
imports: import ast
  import networkx
  import os
  import pandas
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: test_transform(py2graph) without return types