code: def has_edge(
      g: Plottable,
      n1: Union[str, int],
      n2: Union[str, int],
      directed: bool = True,
  ) -> bool:
      """Checks if `n1` and `n2` share an (directed or not) edge
  
      :param g: graphistry instance
      :param n1: `node` to check if has edge to `n2`
      :param n2: `node` to check if has edge to `n1`
      :param directed: bool, if True, checks only outgoing edges from `n1`->`n2`, else finds undirected edges
  
      :returns: bool, if edge exists between `n1` and `n2`
      """
      ndf, edf, src, dst, node = unpack(g)
      if directed:
          if n2 in edf[edf[src] == n1][dst].values:
              return True
      else:
          if (n2 in edf[edf[src] == n1][dst].values) or (
              n1 in edf[edf[src] == n2][dst].values
          ):
              return True
      return False
  
imports: from typing import Union, Optional, List
  import copy, logging, pandas, numpy
  from graphistry.PlotterBase import Plottable
label_desc: Use image node_id 3 for calling a global function with example usage: has_edge(g, n1, n2, directed) and returns: False, True, True