class_docstr: Class which stores vertex and edge properties that can be used to construct
  Graphs from individual property selections and used later to annotate graph
  algorithm results with corresponding properties.
class_docstr_tok: ["Class","which","stores","vertex","and","edge","properties","that","can","be","used","to","construct","Graphs","from","individual","property","selections","and","used","later","to","annotate","graph","algorithm","results","with","corresponding","properties","."]
docstr: Create and return a Graph from the edges in edge_prop_df.
docstr_tok: ["Create","and","return","a","Graph","from","the","edges","in","edge_prop_df","."]
code: def edge_props_to_graph(
      self,
      edge_prop_df,
      create_using,
      edge_weight_property=None,
      default_edge_weight=None,
      check_multi_edges=True,
      renumber_graph=True,
      add_edge_data=True,
  ):
      """
      Create and return a Graph from the edges in edge_prop_df.
      """
      # Don't mutate input data
      edge_prop_df = edge_prop_df.copy()
      # FIXME: check default_edge_weight is valid
      if edge_weight_property:
          if (
              edge_weight_property not in edge_prop_df.columns
              and edge_prop_df.index.name != edge_weight_property
          ):
              raise ValueError(
                  "edge_weight_property "
                  f'"{edge_weight_property}" was not found in '
                  "edge_prop_df"
              )
  
          # Ensure a valid edge_weight_property can be used for applying
          # weights to the subgraph, and if a default_edge_weight was
          # specified, apply it to all NAs in the weight column.
          # Also allow the type column to be specified as the edge weight
          # property so that uniform_neighbor_sample can be called with
          # the weights interpreted as types.
          if edge_weight_property == self.type_col_name:
              prop_col = edge_prop_df[
                  self.type_col_name
              ].cat.codes.astype("float32")
              edge_prop_df["_temp_type_col"] = prop_col
              edge_weight_property = "_temp_type_col"
          elif edge_weight_property in edge_prop_df.columns:
              prop_col = edge_prop_df[edge_weight_property]
          else:
              prop_col = edge_prop_df.index.to_series()
              edge_prop_df[edge_weight_property] = prop_col
          if prop_col.count().compute() != prop_col.size:
              if default_edge_weight is None:
                  raise ValueError(
                      f'edge_weight_property "{edge_weight_property}" '
                      "contains NA values in the subgraph and "
                      "default_edge_weight is not set"
                  )
              else:
                  prop_col.fillna(default_edge_weight, inplace=True)
          edge_attr = edge_weight_property
  
      # If a default_edge_weight was specified but an edge_weight_property
      # was not, a new edge weight column must be added.
      elif default_edge_weight:
          edge_attr = self.weight_col_name
          edge_prop_df[edge_attr] = default_edge_weight
      else:
          edge_attr = None
  
      # Set up the new Graph to return
      if isinstance(create_using, cugraph.Graph):
          # FIXME: extract more attrs from the create_using instance
          attrs = {"directed": create_using.is_directed()}
          G = type(create_using)(**attrs)
      elif type(create_using) is type and issubclass(
          create_using, cugraph.Graph
      ):
          G = create_using()
      else:
          raise TypeError(
              "create_using must be a cugraph.Graph "
              "(or subclass) type or instance, got: "
              f"{type(create_using)}"
          )
  
      # Prevent duplicate edges (if not allowed) since applying them to
      # non-MultiGraphs would result in ambiguous edge properties.
      if (
          check_multi_edges
          and not G.is_multigraph()
          and self.is_multigraph(edge_prop_df).compute()
      ):
          if create_using:
              if type(create_using) is type:
                  t = create_using.__name__
              else:
                  t = type(create_using).__name__
              msg = f"'{t}' graph type specified by create_using"
          else:
              msg = "default Graph graph type"
          raise RuntimeError(
              "query resulted in duplicate edges which "
              f"cannot be represented with the {msg}"
          )
  
      col_names = [self.src_col_name, self.dst_col_name]
      if edge_attr is not None:
          col_names.append(edge_attr)
  
      edge_prop_df = edge_prop_df.reset_index().drop(
          [col for col in edge_prop_df if col not in col_names], axis=1
      )
      edge_prop_df = edge_prop_df.repartition(
          npartitions=self.__num_workers * 4
      ).persist()
  
      G.from_dask_cudf_edgelist(
          edge_prop_df,
          source=self.src_col_name,
          destination=self.dst_col_name,
          edge_attr=edge_attr,
          renumber=renumber_graph,
      )
  
      if add_edge_data:
          # Set the edge_data on the resulting Graph to a DataFrame
          # containing the edges and the edge ID for each. Edge IDs are
          # needed for future calls to annotate_dataframe() in order to
          # associate edges with their properties, since the PG can contain
          # multiple edges between vertrices with different properties.
          # FIXME: also add vertex_data
          G.edge_data = self.__create_property_lookup_table(
              edge_prop_df
          )
  
      del edge_prop_df
  
      return G
  
imports: import cudf
  import cupy
  import cugraph
  import dask_cudf
  import cugraph.dask
  from cugraph.utilities.utils import import_optional, create_list_series_from_2d_ar
  from typing import Union
label_desc: Use image node_id 29 for calling the EXPERIMENTAL__MGPropertyGraph obj's underlying member method code with example usage: obj.edge_props_to_graph(edge_prop_df, create_using, edge_weight_property, default_edge_weight, check_multi_edges, renumber_graph, add_edge_data) and returns: G