code: def to_mixed(x_list=None, a=None, e_list=None):
      """
      Converts lists of node features and edge features to
      [mixed mode](https://graphneural.network/data-modes/#mixed-mode).
  
      The adjacency matrix must be passed as a singleton, i.e., a single np.array
      or scipy.sparse matrix shared by all graphs.
  
      Edge attributes can be represented as:
  
      - a dense array of shape `(n_nodes, n_nodes, n_edge_features)`;
      - a sparse edge list of shape `(n_edges, n_edge_features)`;
  
      and they will always be returned as a batch of edge lists.
  
      :param x_list: a list of np.arrays of shape `(n_nodes, n_node_features)`
      -- note that `n_nodes` must be the same between graphs;
      :param a: a np.array or scipy.sparse matrix of shape `(n_nodes, n_nodes)`;
      :param e_list: a list of np.arrays of shape
      `(n_nodes, n_nodes, n_edge_features)` or `(n_edges, n_edge_features)`;
      :return: only if the corresponding element is given as input:
  
          -  `x`: np.array of shape `(batch, n_nodes, n_node_features)`;
          -  `a`: scipy.sparse matrix of shape `(n_nodes, n_nodes)`;
          -  `e`: np.array of shape `(batch, n_edges, n_edge_features)`;
      """
      # Node features
      x_out = None
      if x_list is not None:
          x_out = np.array(x_list)
  
      # Edge attributes
      e_out = None
      if e_list is not None:
          if e_list[0].ndim == 3:  # Convert dense to sparse
              row, col, _ = sp.find(a)
              e_list = [e[row, col] for e in e_list]
          e_out = np.array(e_list)
  
      return tuple(out for out in [x_out, a, e_out] if out is not None)
  
file_path: spektral/spektral/data/utils.py
imports: import numpy
  import tensorflow
  from scipy import sparse
  from spektral.utils import pad_jagged_array
  from spektral.utils.sparse import sp_matrix_to_sp_tensor
label_desc: Use image node_id 3 for calling a global function with example usage: to_mixed(x_list, a, e_list) and returns: tuple