class_docstr: UMAP Mixin for automagic UMAPing
class_docstr_tok: ["UMAP","Mixin","for","automagic","UMAPing"]
code: def _bind_xy_from_umap(
      self,
      res: Any,
      kind: str,
      encode_position: bool,
      encode_weight: bool,
      play: Optional[int],
  ):
      df = res._nodes if kind == "nodes" else res._edges
  
      df = df.copy(deep=False)
      x_name = config.X + res._suffix
      y_name = config.Y + res._suffix
      if kind == "nodes":
          emb = res._node_embedding
      else:
          emb = res._edge_embedding
  
      if isinstance(df, type(emb)):
          df[x_name] = emb.values.T[0]
          df[y_name] = emb.values.T[1]
      elif isinstance(
          df, pd.DataFrame
      ) and "cudf.core.dataframe" in str(getmodule(emb)):
          df[x_name] = emb.to_numpy().T[0]
          df[y_name] = emb.to_numpy().T[1]
  
      res = res.nodes(df) if kind == "nodes" else res.edges(df)
  
      if encode_weight and kind == "nodes":
          # adds the implicit edge dataframe and binds it to
          # graphistry instance
          w_name = config.WEIGHT + res._suffix
          umap_edges_df = res._weighted_edges_df_from_nodes.copy(
              deep=False
          )
          umap_edges_df = umap_edges_df.rename(
              columns={config.WEIGHT: w_name}
          )
          res = res.edges(umap_edges_df, config.SRC, config.DST)
          logger.info(
              " - Wrote new edges_dataframe from UMAP "
              f"embedding of shape {res._edges.shape}"
          )
          res = res.bind(edge_weight=w_name)
  
      if encode_position and kind == "nodes":
          if play is not None:
              return res.bind(
                  point_x=x_name, point_y=y_name
              ).layout_settings(play=play)
          else:
              return res.bind(point_x=x_name, point_y=y_name)
  
      return res
  
imports: import copy
  from time import time
  from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union
  from inspect import getmodule
  import pandas
  from .None import constants
  from .constants import CUML, UMAP_LEARN
  from .feature_utils import FeatureMixin, Literal, XSymbolic, YSymbolic, prune_weighted_edges_df_and_relabel_nodes, resolve_feature_engine
  from .PlotterBase import Plottable, WeakValueDictionary
  from .util import check_set_memoize
  import logging
label_desc: Use image node_id 12 for calling the UMAPMixin obj's underlying member method code with example usage: obj._bind_xy_from_umap(res, kind, encode_position, encode_weight, play) and returns: res, res, res