code: def plotScores(
      scores,
      paramGrid,
      scoreLabel=None,
      greater_is_better=True,
      vrange=None,
      cmap="YlOrRd",
  ):
      """
      Makes a plot representing how the scores vary over the parameter grid
          Automatically decides whether to use a simple line plot (varying over one parameter)
          or a heatmap (varying over two parameters)
      :param scores: A list of scores, estimated using scoreModels
      :param paramGrid: The parameter grid specified when fitting the models using fitModels
      :param scoreLabel: The specified label (dependent on scoring metric used), e.g. 'AUC'
      :param greater_is_better: Choice between optimizing for greater scores or lesser scores
          Used to make better scores darker on colormap
          Default True means greater and False means lesser
      :param vrange: The visible range over which to display the scores
      :param cmap: The chosen colormap for 2D and 3D plotting. Default is YlOrRd.
          You can invert your chosen colormap by adding '_r' to the end
      :return:
      """
  
      keys = sorted(list(paramGrid)[0].keys())
      uniqParams = dict()
      order = dict()
      for k in keys:
          order[k] = np.unique(
              [str(params[k]) for params in list(paramGrid)],
              return_index=True,
          )[1]
          uniqParams[k] = [
              params[k]
              for params in np.asarray(list(paramGrid))[
                  sorted(order[k])
              ]
          ]
  
      keysToPlot = list()
      for k in keys:
          if len(uniqParams[k]) > 1:
              keysToPlot.append(k)
  
      for k in keys:
          if k not in keysToPlot:
              uniqParams.pop(k, None)
  
      numDim = len(keysToPlot)
      if numDim > 3:
          print("Too many dimensions to plot.")
      elif numDim == 3:
          plot3DGrid(
              scores,
              uniqParams,
              keysToPlot,
              scoreLabel,
              greater_is_better,
              vrange,
              cmap,
          )
      elif numDim == 2:
          plot2DGrid(
              scores,
              uniqParams,
              keysToPlot,
              scoreLabel,
              greater_is_better,
              vrange,
              cmap,
          )
      elif numDim == 1:
          plot1DGrid(scores, uniqParams, scoreLabel, vrange)
      else:
          print("No parameters that vary in the grid")
  
imports: import matplotlib.pyplot
  import matplotlib.colorbar
  import numpy
  import warnings
label_desc: Use image node_id 4 for calling a global function with example usage: plotScores(scores, paramGrid, scoreLabel, greater_is_better, vrange, cmap) without return types