code: def data_to_table(
      data: np.ndarray,
      x_data: np.ndarray,
      noise: Optional[Tuple[float, float]],
  ):
      table = []
  
      if noise:
          nx = np.random.rand(data.shape[0]) * noise[1]
          ny = np.random.rand(data.shape[0]) * noise[0]
      else:
          nx = np.zeros(data.shape[0])
          ny = np.zeros(data.shape[0])
  
      for i in range(data.shape[0]):
          if len(data.shape) == 2:  # Distribution
              m = data.shape[1] // 2
              row = {
                  "step": x_data[i, 0],
                  "x": x_data[i, m] + nx[i],
                  "y": data[i, m] + ny[i],
              }
          else:
              row = {"x": x_data[i] + nx[i], "y": data[i] + ny[i]}
          table.append(row)
  
      return alt.Data(values=table)
  
imports: from typing import List, Optional, Tuple
  import altair
  import numpy
  from labml.internal.analytics.altair.utils import TABLEAU_10
label_desc: Use image node_id 1 for calling a global function with example usage: data_to_table(data, x_data, noise) and returns: alt