code: def convert_from_nx(
      graph, *args, edge_attrs=None, weight=None, **kwargs
  ):
      if weight is not None:
          # MAINT: networkx 3.0, 3.1
          # For networkx 3.0 and 3.1 compatibility
          if edge_attrs is not None:
              raise TypeError(
                  "edge_attrs and weight arguments should not both be given"
              )
          edge_attrs = {weight: 1}
      return nxcg.from_networkx(
          graph, *args, edge_attrs=edge_attrs, **kwargs
      )
  
file_path: cugraph/python/nx-cugraph/nx_cugraph/interface.py
imports: from __future__ import annotations
  import os
  import sys
  import networkx
  import nx_cugraph
label_desc: Use image node_id 1 for calling the BackendInterface obj's underlying member method code with example usage: obj.convert_from_nx(graph) and returns: nxcg