code: def from_adjlist(offsets, indices, values=None, create_using=Graph):
      """
      Initializes the graph from cuDF or Pandas Series representing adjacency
      matrix CSR data and returns a new  cugraph.Graph object.
  
      Parameters
      ----------
      offsets : cudf.Series, pandas.Series
          The offsets of a CSR adjacency matrix.
  
      indices : cudf.Series, pandas.Series
          The indices of a CSR adjacency matrix.
  
      values : cudf.Series or pandas.Series, optional (default=None)
          The values in a CSR adjacency matrix, which represent edge weights in a
          graph. If not provided, the resulting graph is considered unweighted.
  
      create_using: cugraph.Graph (instance or class), optional (default=Graph)
          Specify the type of Graph to create. Can pass in an instance to create
          a Graph instance with specified 'directed' attribute.
  
      Examples
      --------
      >>> pdf = pd.read_csv(datasets_path / 'karate.csv', delimiter=' ',
      ...                   dtype={0:'int32', 1:'int32', 2:'float32'},
      ...                   header=None)
      >>> M = scipy.sparse.coo_matrix((pdf[2],(pdf[0],pdf[1])))
      >>> M = M.tocsr()
      >>> offsets = pd.Series(M.indptr)
      >>> indices = pd.Series(M.indices)
      >>> G = cugraph.from_adjlist(offsets, indices, None)
  
      """
      offsets_type = type(offsets)
      indices_type = type(indices)
      if offsets_type != indices_type:
          raise TypeError(
              f"'offsets' type {offsets_type} != 'indices' "
              f"type {indices_type}"
          )
      if values is not None:
          values_type = type(values)
          if values_type != offsets_type:
              raise TypeError(
                  f"'values' type {values_type} != 'offsets' "
                  f"type {offsets_type}"
              )
  
      if create_using is None:
          G = Graph()
      elif isinstance(create_using, Graph):
          attrs = {"directed": create_using.is_directed()}
          G = type(create_using)(**attrs)
      elif type(create_using) is type(Graph):
          G = create_using()
      else:
          raise TypeError(
              "create_using must be a cugraph.Graph "
              "(or subclass) type or instance, got: "
              f"{type(create_using)}"
          )
  
      if offsets_type is cudf.Series:
          G.from_cudf_adjlist(offsets, indices, values)
  
      elif (pd is not None) and (offsets_type is pd.Series):
          G.from_cudf_adjlist(
              cudf.Series(offsets),
              cudf.Series(indices),
              None if values is None else cudf.Series(values),
          )
  
      else:
          raise TypeError(
              f"obj of type {offsets_type} is not supported."
          )
  
      return G
  
file_path: cugraph/python/cugraph/cugraph/structure/convert_matrix.py
imports: import cudf
  import dask_cudf
  from cugraph.structure.graph_classes import Graph
label_desc: Use image node_id 2 for calling a global function with example usage: from_adjlist(offsets, indices, values, create_using) and returns: G