def METHOD_NAME(
    transform: Callable,
    preimported_modules: List[str] = None,
    comm_type: str = None,
):
    transform = base64.b64encode(cloudpickle.dumps(transform)).decode(UTF_ENCODING)
    io_comm_context = "transform()" if comm_type == "io" else ""
    modules = preimported_modules if preimported_modules else []
    template = CODE_TEMPLATE.format(modules, transform, io_comm_context).encode(
        UTF_ENCODING
    )
    return base64.b64encode(template).decode(UTF_ENCODING)