code: def _create_direct_edges(
      events,
      columns,
      dropna=True,
      categories=dict(),
      edge_shape=None,
      drop_edge_attrs=False,
      categorical_metadata=False,
      DELIM="::",
      SOURCE="src",
      TARGET="dst",
      EVENTID="event_id",
      CATEGORY="category",
      EDGETYPE="edge_type",
      NODETYPE="node_type",
  ):
      if edge_shape is None:
          edge_shape = {}
          for i, name in enumerate(columns):
              edge_shape[name] = columns[(i + 1) :]
  
      edge_attrs = [x for x in events.columns if x != NODETYPE]
      edges = [
          cudf.DataFrame(
              dict(
                  (
                      [
                          (
                              EVENTID,
                              cudf.core.column.column_empty(0, "str"),
                          ),
                          (
                              SOURCE,
                              cudf.core.column.column_empty(0, "str"),
                          ),
                          (
                              TARGET,
                              cudf.core.column.column_empty(0, "str"),
                          ),
                          (
                              EDGETYPE,
                              cudf.core.column.column_empty(
                                  0,
                                  "str"
                                  if not categorical_metadata
                                  else _empty_cat_dt(),
                              ),
                          ),
                      ]
                  )
                  + (
                      []
                      if len(categories) == 0
                      else [
                          (
                              CATEGORY,
                              cudf.core.column.column_empty(
                                  0,
                                  "str"
                                  if not categorical_metadata
                                  else _empty_cat_dt(),
                              ),
                          )
                      ]
                  )
                  + (
                      []
                      if drop_edge_attrs
                      else [
                          (
                              key,
                              cudf.core.column.column_empty(
                                  0, col.dtype
                              ),
                          )
                          for key, col in events[edge_attrs].items()
                      ]
                  )
              )
          )
      ]
  
      for key1, col1 in events[sorted(edge_shape.keys())].items():
          cat1 = categories.get(key1, key1)
  
          if isinstance(edge_shape[key1], str):
              edge_shape[key1] = [edge_shape[key1]]
          elif isinstance(edge_shape[key1], dict):
              edge_shape[key1] = list(edge_shape[key1].keys())
          elif not isinstance(edge_shape[key1], (set, list, tuple)):
              raise ValueError("EDGES must be a dict of column name(s)")
  
          for key2, col2 in events[sorted(edge_shape[key1])].items():
              cat2 = categories.get(key2, key2)
              fs = [EVENTID] + (
                  [key1, key2] if drop_edge_attrs else edge_attrs
              )
              df = (
                  events[fs].dropna(subset=[key1, key2])
                  if dropna
                  else events[fs]
              )
              if len(df) == 0:
                  continue
              if len(categories) > 0:
                  df[CATEGORY] = (
                      key1 + DELIM + key2
                      if not categorical_metadata
                      else _str_scalar_to_category(
                          len(df), key1 + DELIM + key2
                      )
                  )
              df[EDGETYPE] = (
                  cat1 + DELIM + cat2
                  if not categorical_metadata
                  else _str_scalar_to_category(
                      len(df), cat1 + DELIM + cat2
                  )
              )
              df[SOURCE] = _prepend_str(col1, cat1 + DELIM)
              df[TARGET] = _prepend_str(col2, cat2 + DELIM)
              df.reset_index(drop=True, inplace=True)
              edges.append(df)
  
      columns = [EVENTID, EDGETYPE, SOURCE, TARGET]
  
      if len(categories) > 0:
          columns += [CATEGORY]
  
      if not drop_edge_attrs:
          columns += edge_attrs
  
      edges = cudf.concat(edges)[columns]
      edges.reset_index(drop=True, inplace=True)
      return edges
  
file_path: cugraph/python/cugraph/cugraph/structure/hypergraph.py
imports: import cudf
  import numpy
  from cugraph.structure.graph_classes import Graph
label_desc: Use image node_id 5 for calling a global function with example usage: _create_direct_edges(events, columns, dropna, categories, edge_shape, drop_edge_attrs, categorical_metadata, DELIM, SOURCE, TARGET, EVENTID, CATEGORY, EDGETYPE, NODETYPE) and returns: edges