code: def mean_function_factory(
      mean_function_name: Optional[str], D_in: int, D_out: int
  ) -> Optional[MeanFunction]:
      if mean_function_name == "Zero":
          return Zero(output_dim=D_out)
      elif mean_function_name == "Constant":
          return Constant(c=rng.rand(D_out))
      elif mean_function_name == "Linear":
          return Linear(A=rng.rand(D_in, D_out), b=rng.rand(D_out))
      else:
          return None
  
imports: from typing import Collection, Optional
  import numpy
  import pytest
  import tensorflow
  from check_shapes import ShapeChecker, check_shapes
  from numpy.testing import assert_allclose
  import gpflow
  from gpflow.base import AnyNDArray, MeanAndVariance
  from gpflow.conditionals import conditional, uncertain_conditional
  from gpflow.config import default_float
  from gpflow.mean_functions import Constant, Linear, MeanFunction, Zero
  from gpflow.quadrature import mvnquad
  from gpflow.utilities import training_loop
label_desc: Use image node_id 3 for calling a global function with example usage: mean_function_factory(mean_function_name, D_in, D_out) and returns: Zero, Constant, Linear, None