code: def construct_graph(dataframe, symmetric=False):
      """
      dataframe contains weighted and undirected edges with self loops. Multiple
      edges will likely be present as well.  The returned Graph object must be
      symmetrized and have self loops removed.
      """
      if symmetric:
          G = cugraph.Graph(directed=False)
      else:
          G = cugraph.Graph(directed=True)
  
      if len(dataframe.columns) > 2:
          G.from_cudf_edgelist(
              dataframe,
              source="src",
              destination="dst",
              edge_attr="weight",
          )
          # G.from_cudf_edgelist(
          #    dataframe, source="0", destination="1", edge_attr="2")
      else:
          G.from_cudf_edgelist(
              dataframe, source="src", destination="dst"
          )
          # G.from_cudf_edgelist(
          #    dataframe, source="0", destination="1")
      return G
  
file_path: cugraph/benchmarks/cugraph/standalone/cugraph_funcs.py
imports: import numpy
  import cugraph
  from cugraph.generators import rmat
  import cudf
label_desc: Use image node_id 3 for calling a global function with example usage: construct_graph(dataframe, symmetric) and returns: G