code: def test_loc_non_informative_index():
      df = pd.DataFrame({"x": [1, 2, 3, 4]}, index=[10, 20, 30, 40])
      ddf = dd.from_pandas(df, npartitions=2, sort=True)
      ddf.divisions = (None,) * 3
      assert not ddf.known_divisions
  
      ddf.loc[20:30].compute(scheduler="sync")
  
      assert_eq(ddf.loc[20:30], df.loc[20:30])
  
      df = pd.DataFrame({"x": [1, 2, 3, 4]}, index=[10, 20, 20, 40])
      ddf = dd.from_pandas(df, npartitions=2, sort=True)
      assert_eq(ddf.loc[20], df.loc[20:20])
  
imports: from __future__ import annotations
  import contextlib
  import numpy
  import pandas
  import pytest
  import dask
  import dask.dataframe
  from dask.base import tokenize
  from dask.dataframe._compat import PANDAS_GE_210, PANDAS_GE_220, IndexingError, tm
  from dask.dataframe.indexing import _coerce_loc_index
  from dask.dataframe.utils import assert_eq, make_meta, pyarrow_strings_enabled
label_desc: Use image node_id 2 for calling a global function with example usage: test_loc_non_informative_index() without return types