class_docstr: Tests for ConcurrencyCapBackpressurePolicy.
class_docstr_tok: ["Tests","for","ConcurrencyCapBackpressurePolicy","."]
code: def _get_map_func(self, actor, index):
      def map_func(data, actor, index):
          actor.record_start_time.remote(index)
          yield data
          actor.record_end_time.remote(index)
  
      return functools.partial(map_func, actor=actor, index=index)
  
imports: import functools
  import time
  import unittest
  from collections import defaultdict
  from contextlib import contextmanager
  from unittest.mock import MagicMock, patch
  import numpy
  import pytest
  import ray
  from ray.data._internal.execution.backpressure_policy import ENABLED_BACKPRESSURE_POLICIES_CONFIG_KEY, ConcurrencyCapBackpressurePolicy, StreamingOutputBackpressurePolicy
  from ray.data.tests.conftest import restore_data_context
  from ray.data.tests.conftest import CoreExecutionMetrics, assert_core_execution_metrics_equals, get_initial_core_execution_metrics_snapshot
  from ray.tests.conftest import shutdown_only
label_desc: Use image node_id 7 for calling the TestConcurrencyCapBackpressurePolicy obj's underlying member method code with example usage: obj._get_map_func(actor, index) and returns: functools