code: def maybe_prod(s: Sequence[Union[int, None]]) -> Optional[int]:
      try:
          return np.prod(s)
      except TypeError:
          # Can happen if the input contains `None`.
          return None
  
file_path: sonnet/sonnet/src/batch_apply.py
imports: from typing import Any, Callable, Optional, Sequence, Union
  import numpy
  from sonnet.src import base
  import tensorflow
  import tree
label_desc: Use image node_id 3 for calling a global function with example usage: maybe_prod(s) and returns: np, None