code: def _get_directed_edges(adjacency_mat):
      func = (
          _sparse_get_edges
          if issparse(adjacency_mat)
          else _ndarray_get_edges
      )
  
      if issparse(adjacency_mat):
          triu = sparse.triu
          tril = sparse.tril
      else:
          triu = np.triu
          tril = np.tril
  
      upper = triu(adjacency_mat)
      lower = tril(adjacency_mat)
  
      return np.concatenate((func(upper), func(lower)))
  
imports: import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: _get_directed_edges(adjacency_mat) and returns: np