code: def to_geoviews(
      scn,
      gvtype=None,
      datasets=None,
      kdims=None,
      vdims=None,
      dynamic=False,
  ):
      """Convert satpy Scene to geoviews.
  
      Args:
          scn (satpy.Scene): Satpy Scene.
          gvtype (gv plot type):
              One of gv.Image, gv.LineContours, gv.FilledContours, gv.Points
              Default to :class:`geoviews.Image`.
              See Geoviews documentation for details.
          datasets (list): Limit included products to these datasets
          kdims (list of str):
              Key dimensions. See geoviews documentation for more information.
          vdims (list of str, optional):
              Value dimensions. See geoviews documentation for more information.
              If not given defaults to first data variable
          dynamic (bool, optional): Load and compute data on-the-fly during
              visualization. Default is ``False``. See
              https://holoviews.org/user_guide/Gridded_Datasets.html#working-with-xarray-data-types
              for more information. Has no effect when data to be visualized
              only has 2 dimensions (y/x or longitude/latitude) and doesn't
              require grouping via the Holoviews ``groupby`` function.
  
      Returns: geoviews object
  
      Todo:
          * better handling of projection information in datasets which are
            to be passed to geoviews
  
      """
      import geoviews as gv
      from cartopy import crs  # noqa
  
      if gvtype is None:
          gvtype = gv.Image
  
      ds = scn.to_xarray_dataset(datasets)
  
      if vdims is None:
          # by default select first data variable as display variable
          vdims = ds.data_vars[list(ds.data_vars.keys())[0]].name
  
      if hasattr(ds, "area") and hasattr(ds.area, "to_cartopy_crs"):
          dscrs = ds.area.to_cartopy_crs()
          gvds = gv.Dataset(ds, crs=dscrs)
      else:
          gvds = gv.Dataset(ds)
  
      # holoviews produces a log warning if you pass groupby arguments when groupby isn't used
      groupby_kwargs = {"dynamic": dynamic} if gvds.ndims != 2 else {}
      if "latitude" in ds.coords:
          gview = gvds.to(
              gv.QuadMesh,
              kdims=["longitude", "latitude"],
              vdims=vdims,
              **groupby_kwargs,
          )
      else:
          gview = gvds.to(
              gvtype, kdims=["x", "y"], vdims=vdims, **groupby_kwargs
          )
  
      return gview
  
imports: import xarray
  from satpy.composites import enhance2dataset
  from satpy.dataset import DataID
label_desc: Use image node_id 2 for calling a global function with example usage: to_geoviews(scn, gvtype, datasets, kdims, vdims, dynamic) and returns: gview