code: def create_map_transformer_from_block_fn(
      block_fn: MapTransformCallable[Block, Block],
      init_fn: Optional[Callable[[], None]] = None,
  ):
      """Create a MapTransformer from a single block-based transform function.
  
      This method should only be used for testing and legacy compatibility.
      """
      return MapTransformer(
          [
              BlockMapTransformFn(block_fn),
          ],
          init_fn,
      )
  
imports: import itertools
  from abc import abstractmethod
  from enum import Enum
  from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union
  from ray.data._internal.block_batching.block_batching import batch_blocks
  from ray.data._internal.execution.interfaces.task_context import TaskContext
  from ray.data._internal.output_buffer import BlockOutputBuffer
  from ray.data.block import Block, BlockAccessor, DataBatch
label_desc: Use image node_id 1 for calling a global function with example usage: create_map_transformer_from_block_fn(block_fn, init_fn) and returns: MapTransformer