code: def construct_graph(dask_dataframe, symmetric=False):
      """
      dask_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(dask_dataframe.columns) > 2:
          if symmetric:  # symmetrize dask dataframe
              dask_dataframe = symmetrize_ddf(
                  dask_dataframe, "src", "dst", "weight"
              )
  
          G.from_dask_cudf_edgelist(
              dask_dataframe,
              source="src",
              destination="dst",
              edge_attr="weight",
          )
          # G.from_dask_cudf_edgelist(
          #    dask_dataframe, source="0", destination="1", edge_attr="2")
      else:
          if symmetric:  # symmetrize dask dataframe
              dask_dataframe = symmetrize_ddf(
                  dask_dataframe, "src", "dst"
              )
          G.from_dask_cudf_edgelist(
              dask_dataframe, source="src", destination="dst"
          )
  
      return G
  
imports: import numpy
  import dask_cudf
  from dask.distributed import Client
  from dask_cuda import LocalCUDACluster
  from cugraph.structure.symmetrize import symmetrize_ddf
  from cugraph.dask.common.mg_utils import get_visible_devices
  from dask_cuda.initialize import initialize
  import cudf
  import cugraph
  from cugraph.dask.comms import comms
  import tempfile
  from cugraph.testing.mg_utils import generate_edgelist
label_desc: Use image node_id 2 for calling a global function with example usage: construct_graph(dask_dataframe, symmetric) and returns: G