docstr: Generates decoding graph given a cornac data set
  
  Parameters
  ----------
  data_set : cornac.data.dataset.Dataset
      The data set as provided by cornac
  
  Returns
  -------
  graph : dgl.heterograph
      Heterograph containing user-item edges and nodes
docstr_tok: ["Generates","decoding","graph","given","a","cornac","data","set","Parameters","--","--","--","--","--","data_set",":","cornac.data.dataset.Dataset","The","data","set","as","provided","by","cornac","Returns","--","--","--","-","graph",":","dgl.heterograph","Heterograph","containing","user-item","edges","and","nodes"]
code: def _generate_test_user_graph(self, user_idx):
      """
      Generates decoding graph given a cornac data set
  
      Parameters
      ----------
      data_set : cornac.data.dataset.Dataset
          The data set as provided by cornac
  
      Returns
      -------
      graph : dgl.heterograph
          Heterograph containing user-item edges and nodes
      """
      item_nodes = np.arange(self.total_items)
      user_nodes = np.full_like(item_nodes, user_idx)
      user_item_ratings_coo = sp.coo_matrix(
          (np.ones_like(user_nodes), (user_nodes, item_nodes)),
          shape=(self.total_users, self.total_items),
          dtype=np.float32,
      )
  
      graph = dgl.bipartite_from_scipy(
          user_item_ratings_coo, utype="_U", etype="_E", vtype="_V"
      )
  
      return dgl.heterograph(
          {("user", "rate", "item"): graph.edges()},
          num_nodes_dict={
              "user": self.total_users,
              "item": self.total_items,
          },
      )
  
imports: import logging
  import time
  from collections import defaultdict
  import torch
  from torch import nn
  import dgl
  import numpy
  import scipy.sparse
  from tqdm import tqdm
  from .nn_modules import NeuralNetwork
  from .utils import get_optimizer, torch_net_info, torch_total_param_num
label_desc: Use image node_id 5 for calling the Model obj's underlying member method code with example usage: obj._generate_test_user_graph(user_idx) and returns: dgl