code: def check_dimensions(
      nrow: Optional[int], ncol: Optional[int]
  ) -> tuple[int | None, int | None]:
      """
      Verify dimensions of the facet
      """
      if nrow is not None:
          if nrow < 1:
              warn(
                  "'nrow' must be greater than 0. "
                  "Your value has been ignored.",
                  PlotnineWarning,
              )
              nrow = None
          else:
              nrow = int(nrow)
  
      if ncol is not None:
          if ncol < 1:
              warn(
                  "'ncol' must be greater than 0. "
                  "Your value has been ignored.",
                  PlotnineWarning,
              )
              ncol = None
          else:
              ncol = int(ncol)
  
      return nrow, ncol
  
file_path: plotnine/plotnine/facets/facet_wrap.py
imports: from __future__ import annotations
  import re
  import typing
  from warnings import warn
  import numpy
  import pandas
  from .._utils import join_keys, match
  from ..exceptions import PlotnineError, PlotnineWarning
  from .facet import add_missing_facets, combine_vars, eval_facet_vars, facet, layout_null
  from .strips import Strips, strip
label_desc: Use image node_id 1 for calling a global function with example usage: check_dimensions(nrow, ncol) and returns: nrow,  ncol