code: def convert_weighted_unnamed_to_gdf(NX_G, vertex_type="int32"):
      _pdf = nx.to_pandas_edgelist(NX_G)
  
      nx_col = ["source", "target"]
      wt_col = [col for col in _pdf.columns if col not in nx_col]
      if len(wt_col) != 1:
          raise ValueError("Unable to determine weight column name")
  
      if wt_col[0] != "weight":
          _pdf.rename(columns={wt_col[0]: "weight"})
  
      _gdf = from_pandas(_pdf)
  
      if is_integer_dtype(_gdf["source"]) or is_integer_dtype(
          _gdf["target"]
      ):
          _gdf = _gdf.astype(
              {"source": vertex_type, "target": vertex_type}
          )
  
      return _gdf
  
file_path: cugraph/python/cugraph/cugraph/utilities/nx_factory.py
imports: import cugraph
  from .utils import import_optional
  import cudf
  from cudf import from_pandas
  from cudf.api.types import is_integer_dtype
label_desc: Use image node_id 3 for calling a global function with example usage: convert_weighted_unnamed_to_gdf(NX_G, vertex_type) and returns: _gdf