code: def test_masked_encode(client):
      n_workers = len(client.has_what())
      df = cudf.DataFrame(
          {
              "filter_col": [1, 1, 2, 3, 1, 1, 1, 1, 6, 5],
              "cat_col": [
                  "a",
                  "b",
                  "c",
                  "d",
                  "a",
                  "a",
                  "a",
                  "c",
                  "b",
                  "c",
              ],
          }
      )
      ddf = dask_cudf.from_cudf(df, npartitions=n_workers)
  
      ddf_filter = ddf[ddf["filter_col"] == 1]
      filter_encoded = LabelEncoder().fit_transform(
          ddf_filter["cat_col"]
      )
      ddf_filter = ddf_filter.assign(
          filter_encoded=filter_encoded.values
      )
  
      encoded_filter = LabelEncoder().fit_transform(ddf["cat_col"])
      ddf = ddf.assign(encoded_filter=encoded_filter.values)
  
      ddf = ddf[ddf.filter_col == 1]
  
      assert (
          (ddf.encoded_filter == ddf_filter.filter_encoded)
          .compute()
          .all()
      )
  
file_path: cuml/python/cuml/tests/dask/test_dask_label_encoder.py
imports: from cuml.common.exceptions import NotFittedError
  import pytest
  from cuml.internals.safe_imports import cpu_only_import
  import cuml
  from cuml.dask.preprocessing.LabelEncoder import LabelEncoder
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 9 for calling a global function with example usage: test_masked_encode(client) without return types