code: def string_to_loss_function(string: str):
      """Convert string to the corresponding LossFunction."""
  
      if string == LossFunction.CROSS_ENTROPY.value:
          return LossFunction.CROSS_ENTROPY
      if string == LossFunction.SQUARED.value:
          return LossFunction.SQUARED
      raise ValueError(f"{string} is not a valid loss function name.")
  
file_path: privacy/tensorflow_privacy/privacy/privacy_tests/utils.py
imports: import enum
  import logging
  import numbers
  from typing import Callable, Iterable, Optional, Union
  import numpy
  from scipy import special
label_desc: Use image node_id 4 for calling a global function with example usage: string_to_loss_function(string) and returns: LossFunction, LossFunction