code: def _init_subplot(
      layout,
      subplot_type,
      secondary_y,
      x_domain,
      y_domain,
      max_subplot_ids=None,
  ):
      # Normalize subplot type
      subplot_type = _validate_coerce_subplot_type(subplot_type)
  
      if max_subplot_ids is None:
          max_subplot_ids = _get_initial_max_subplot_ids()
  
      # Clamp domain elements between [0, 1].
      # This is only needed to combat numerical precision errors
      # See GH1031
      x_domain = [max(0.0, x_domain[0]), min(1.0, x_domain[1])]
      y_domain = [max(0.0, y_domain[0]), min(1.0, y_domain[1])]
  
      if subplot_type == "xy":
          subplot_refs = _init_subplot_xy(
              layout, secondary_y, x_domain, y_domain, max_subplot_ids
          )
      elif subplot_type in _single_subplot_types:
          subplot_refs = _init_subplot_single(
              layout, subplot_type, x_domain, y_domain, max_subplot_ids
          )
      elif subplot_type == "domain":
          subplot_refs = _init_subplot_domain(x_domain, y_domain)
      else:
          raise ValueError(
              "Unsupported subplot type: {}".format(repr(subplot_type))
          )
  
      return subplot_refs
  
file_path: catboost/contrib/python/plotly/py2/plotly/subplots.py
imports: from __future__ import absolute_import, unicode_literals
  import collections
label_desc: Use image node_id 9 for calling a global function with example usage: _init_subplot(layout, subplot_type, secondary_y, x_domain, y_domain, max_subplot_ids) and returns: subplot_refs