code: def z_score(
      s: "Series",
      moments_dict: dict = None,
      keys: Tuple[str, str] = ("mean", "std"),
  ) -> "Series":
      """Transforms the Series into z-scores.
  
      The z-score is defined:
  
      ```python
      z = (s - s.mean()) / s.std()
      ```
  
      Examples:
          >>> import pandas as pd
          >>> import janitor
          >>> s = pd.Series([0, 1, 3], name="numbers")
          >>> s.z_score()
          0   -0.872872
          1   -0.218218
          2    1.091089
          Name: numbers, dtype: float64
  
      Args:
          s: Input Series.
          moments_dict: If not `None`, then the mean and standard
              deviation used to compute the z-score transformation is
              saved as entries in `moments_dict` with keys determined by
              the `keys` argument; defaults to `None`.
          keys: Determines the keys saved in `moments_dict`
              if moments are saved; defaults to (`'mean'`, `'std'`).
  
      Returns:
          Transformed Series.
      """
      mean = s.mean()
      std = s.std()
      if std == 0:
          return 0
      if moments_dict is not None:
          moments_dict[keys[0]] = mean
          moments_dict[keys[1]] = std
      return (s - mean) / std
  
file_path: pyjanitor/janitor/math.py
imports: import warnings
  from typing import TYPE_CHECKING, Tuple
  import pandas_flavor
label_desc: Use image node_id 8 for calling a global function with example usage: z_score(s, moments_dict, keys) and returns: unknown, int