code: def test_photonics_values_random(
      name: str, expected: float, data: tp.Optional[np.ndarray]
  ) -> None:
      if name == "morpho" and os.environ.get("CIRCLECI", False):
          raise SkipTest("Too slow in CircleCI")
      size = (
          data.size
          if data is not None
          else (16 if name != "morpho" else 4)
      )
      photo = core.Photonics(name, size)
      if data is None:
          x = np.random.RandomState(12).normal(0, 1, size=size)
          candidate = (
              photo.parametrization.spawn_child().set_standardized_data(
                  x
              )
          )
      else:
          candidate = photo.parametrization.spawn_child(new_value=data)
      np.testing.assert_almost_equal(
          photo(candidate.value), expected, decimal=4
      )
      np.testing.assert_almost_equal(
          photo.evaluation_function(candidate), expected, decimal=4
      )
  
imports: import os
  from unittest import SkipTest
  import warnings
  import typing
  import pytest
  import numpy
  from nevergrad.common import testing
  from .None import core
  from .None import photonics
label_desc: Use image node_id 9 for calling a global function with example usage: test_photonics_values_random(name, expected, data) without return types