docstr: predict_links over all the combinations of given source, relation, destinations.
  
  Parameters
  ----------
  source: list
      Targeted source nodes. Defaults to None(all).
  relation: list
      Targeted relations. Defaults to None(all).
  destination: list
      Targeted destinations. Defaults to None(all).
  threshold : Optional[float]
      Probability threshold. Defaults to 0.5
  retain_old_edges : Optional[bool]
      will include old edges in predicted graph. Defaults to False.
  return_dataframe : Optional[bool]
      will return a dataframe instead of a graphistry instance. Defaults to False.
  anomalous : Optional[False]
      will return the edges < threshold or low confidence edges(anomaly).
  
  Returns
  -------
  Graphistry Instance
      containing the corresponding source, relation, destination and score column
      where score >= threshold if anamalous if False else score <= threshold, or a dataframe
      
docstr_tok: ["predict_links","over","all","the","combinations","of","given","source",",","relation",",","destinations",".","Parameters","--","--","--","--","--","source",":","list","Targeted","source","nodes",".","Defaults","to","None","(","all",")",".","relation",":","list","Targeted","relations",".","Defaults","to","None","(","all",")",".","destination",":","list","Targeted","destinations",".","Defaults","to","None","(","all",")",".","threshold",":","Optional","[","float","]","Probability","threshold",".","Defaults","to","0.5","retain_old_edges",":","Optional","[","bool","]","will","include","old","edges","in","predicted","graph",".","Defaults","to","False",".","return_dataframe",":","Optional","[","bool","]","will","return","a","dataframe","instead","of","a","graphistry","instance",".","Defaults","to","False",".","anomalous",":","Optional","[","False","]","will","return","the","edges","<","threshold","or","low","confidence","edges","(","anomaly",")",".","Returns","--","--","--","-","Graphistry","Instance","containing","the","corresponding","source",",","relation",",","destination","and","score","column","where","score",">","=","threshold","if","anamalous","if","False","else","score","<","=","threshold",",","or","a","dataframe"]
code: def predict_links(
      self,
      source: Union[list, None] = None,
      relation: Union[list, None] = None,
      destination: Union[list, None] = None,
      threshold: Optional[float] = 0.5,
      anomalous: Optional[bool] = False,
      retain_old_edges: Optional[bool] = False,
      return_dataframe: Optional[bool] = False,
  ) -> Plottable:  # type: ignore
      """predict_links over all the combinations of given source, relation, destinations.
  
      Parameters
      ----------
      source: list
          Targeted source nodes. Defaults to None(all).
      relation: list
          Targeted relations. Defaults to None(all).
      destination: list
          Targeted destinations. Defaults to None(all).
      threshold : Optional[float]
          Probability threshold. Defaults to 0.5
      retain_old_edges : Optional[bool]
          will include old edges in predicted graph. Defaults to False.
      return_dataframe : Optional[bool]
          will return a dataframe instead of a graphistry instance. Defaults to False.
      anomalous : Optional[False]
          will return the edges < threshold or low confidence edges(anomaly).
  
      Returns
      -------
      Graphistry Instance
          containing the corresponding source, relation, destination and score column
          where score >= threshold if anamalous if False else score <= threshold, or a dataframe
  
      """
      logging.warning(
          "currently `predict_links` is cpu only, gpu compatibility will be added in \
                  future releases"
      )
      all_nodes = self._node2id.values()
      all_relations = self._relation2id.values()
  
      if source is None:
          src = pd.Series(all_nodes)
      else:
          # this is temporary, will be removed after gpu feature utils
          try:
              if isinstance(source, cudf.DataFrame):
                  source = source.to_pandas()  # type: ignore
          except:
              pass
          src = pd.Series(source)
          src = src.map(self._node2id)
  
      if relation is None:
          rel = pd.Series(all_relations)
      else:
          # this is temporary, will be removed after gpu feature utils
          try:
              if isinstance(relation, cudf.DataFrame):
                  relation = relation.to_pandas()  # type: ignore
          except:
              pass
          rel = pd.Series(relation)
          rel = rel.map(self._relation2id)
  
      if destination is None:
          dst = pd.Series(all_nodes)
      else:
          # this is temporary, will be removed after gpu feature utils
          try:
              if isinstance(destination, cudf.DataFrame):
                  destination = destination.to_pandas()  # type: ignore
          except:
              pass
          dst = pd.Series(destination)
          dst = dst.map(self._node2id)
  
      def fetch_triplets_for_inference(source, relation, destination):
          source = pd.DataFrame(source.unique(), columns=["source"])
          source["relation"] = [relation.unique()] * source.shape[0]
  
          source_with_relation = source.explode("relation")
          source_with_relation["destination"] = [
              destination.unique()
          ] * source_with_relation.shape[0]
  
          triplets = source_with_relation.explode("destination")
          triplets = triplets[
              triplets["source"] != triplets["destination"]
          ]
  
          return triplets.drop_duplicates().reset_index(drop=True)
  
      triplets = fetch_triplets_for_inference(src, rel, dst)
      triplets = triplets.to_numpy().astype(np.int64)
  
      return self._score_triplets(
          triplets,
          threshold,
          anomalous,
          retain_old_edges,
          return_dataframe,
      )
  
imports: import logging
  import numpy
  import pandas
  from typing import Optional, Union, Callable, List, TYPE_CHECKING, Any, Tuple
  from .PlotterBase import Plottable
  from .compute.ComputeMixin import ComputeMixin
label_desc: Use image node_id 9 for calling the HeterographEmbedModuleMixin obj's underlying member method code with example usage: obj.predict_links(source, relation, destination, threshold, anomalous, retain_old_edges, return_dataframe) and returns: self, triplets