code: def merge_indexed_dataframes(
      lhs, rhs, left_index=True, right_index=True, **kwargs
  ):
      """Join two partitioned dataframes along their index"""
      how = kwargs.get("how", "left")
      kwargs["left_index"] = left_index
      kwargs["right_index"] = right_index
  
      (lhs, rhs), divisions, parts = align_partitions(lhs, rhs)
      divisions, parts = require(divisions, parts, required[how])
  
      name = "join-indexed-" + tokenize(lhs, rhs, **kwargs)
  
      meta = lhs._meta_nonempty.merge(rhs._meta_nonempty, **kwargs)
      kwargs["result_meta"] = meta
  
      dsk = dict()
      for i, (a, b) in enumerate(parts):
          dsk[(name, i)] = (apply, merge_chunk, [a, b], kwargs)
  
      graph = HighLevelGraph.from_collections(
          name, dsk, dependencies=[lhs, rhs]
      )
      return new_dd_object(graph, name, meta, divisions)
  
imports: from __future__ import annotations
  import math
  import pickle
  import warnings
  from functools import partial, wraps
  import numpy
  import pandas
  from pandas.api.types import is_dtype_equal
  from tlz import merge_sorted, unique
  from dask.base import is_dask_collection, tokenize
  from dask.dataframe import methods
  from dask.dataframe.core import DataFrame, Index, Series, _concat, _deprecated_kwarg, _Frame, _maybe_from_pandas, is_broadcastable, map_partitions, new_dd_object, prefix_reduction, suffix_reduction
  from dask.dataframe.dispatch import group_split_dispatch, hash_object_dispatch
  from dask.dataframe.io import from_pandas
  from dask.dataframe.shuffle import partitioning_index, rearrange_by_divisions, shuffle, shuffle_group
  from dask.dataframe.utils import asciitable, check_meta, is_dataframe_like, is_series_like, make_meta, strip_unknown_categories
  from dask.highlevelgraph import HighLevelGraph
  from dask.layers import BroadcastJoinLayer
  from dask.utils import M, apply, get_default_shuffle_method
label_desc: Use image node_id 5 for calling a global function with example usage: merge_indexed_dataframes(lhs, rhs, left_index, right_index) and returns: new_dd_object