code: def generate_grouped_data() -> (
      Tuple[gf.base.AnyNDArray, gf.base.AnyNDArray]
  ):
      rng = np.random.default_rng(42)  # for reproducibility
      X = rng.uniform(0.0, 1.0, (n_data, 1))
      signal = np.sin(6 * X)
      noise_scale = 0.1 + 0.4 * get_group(X)
      noise = noise_scale * rng.standard_normal((n_data, 1))
      Y = signal + noise
      return X, Y
  
file_path: GPflow/doc/sphinx/notebooks/advanced/varying_noise.pct.py
imports: import os
  import warnings
  from typing import Optional, Tuple
  import matplotlib.pyplot
  import numpy
  import tensorflow
  from check_shapes import inherit_check_shapes
  import gpflow
  from gpflow.ci_utils import reduce_in_tests
  from gpflow.utilities import print_summary
label_desc: Use image node_id 4 for calling a global function with example usage: generate_grouped_data() and returns: X,  Y