code: def _check_frac_to_plot(frac_to_plot):
      """
      Make sure `frac_to_plot` is between 0 and 1 if it is float, and greater than 0 if it is int.
  
      Parameters
      ----------
      frac_to_plot : float or int
          Fraction or number of instances to be plotted.
  
      Raises
      ------
      ValueError
          If `frac_to_plot` is not within the valid range for the given type (float or int).
      """
  
      if type(frac_to_plot) == float:
          if (frac_to_plot <= 0.0) or (frac_to_plot > 1.0):
              raise ValueError(
                  "frac_to_plot: should in range(0, 1) when it is a float"
              )
      elif type(frac_to_plot) == int:
          if frac_to_plot <= 0:
              raise ValueError("frac_to_plot: should be larger than 0.")
      else:
          raise ValueError("frac_to_plot: should be float or integer")
  
imports: import numpy
  import pandas
  import psutil
label_desc: Use image node_id 9 for calling a global function with example usage: _check_frac_to_plot(frac_to_plot) without return types