code: def _scatter_chart(
      table: alt.Data,
      *,
      circle_size: int,
      is_ticks: bool,
      name: str,
      x_name: str,
      range_color: str,
      height: int = None,
      width: int = None,
      selection=None,
      x_scale: alt.Scale = alt.Undefined,
      y_scale: alt.Scale = alt.Undefined,
  ) -> alt.Chart:
      base = alt.Chart(table)
      if selection is not None:
          base = base.add_selection(selection)
  
      if not is_ticks:
          scat_x_title = x_name
          scat_y_title = name
      else:
          scat_x_title = ""
          scat_y_title = ""
  
      encode_kwargs = dict(color=alt.value(range_color))
      if len(table.values) > 0 and "step" in table.values[0]:
          encode_kwargs["opacity"] = "step:Q"
  
      scat = base.mark_circle(size=circle_size).encode(
          x=alt.X("x:Q", scale=x_scale, title=scat_x_title),
          y=alt.Y("y:Q", scale=y_scale, title=scat_y_title),
          **encode_kwargs,
      )
  
      if is_ticks:
          tick_axis = alt.Axis(labels=False, domain=False, ticks=False)
  
          x_ticks = base.mark_tick().encode(
              x=alt.X(
                  "x:Q", axis=tick_axis, scale=x_scale, title=x_name
              ),
              **encode_kwargs,
          )
  
          y_ticks = (
              alt.Chart(table)
              .mark_tick()
              .encode(
                  y=alt.X(
                      "y:Q", axis=tick_axis, scale=y_scale, title=name
                  ),
                  **encode_kwargs,
              )
          )
  
          scat = scat.properties(width=width, height=height)
          x_ticks = x_ticks.properties(width=width)
          y_ticks = y_ticks.properties(height=height)
          scat = y_ticks | (scat & x_ticks)
  
      return scat
  
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 2 for calling a global function with example usage: _scatter_chart(table) and returns: scat