class_docstr: A QuadMesh designed to help handle the case when the mesh is wrapped.
code: def set_array(self, A):
      # Check the shape is appropriate up front.
      if not _MPL_38:
          # Need to figure out existing shape from the coordinates.
          height, width = self._coordinates.shape[0:-1]
          if self._shading == "flat":
              h, w = height - 1, width - 1
          else:
              h, w = height, width
      else:
          h, w = super().get_array().shape[:2]
  
      ok_shapes = [(h, w, 3), (h, w, 4), (h, w), (h * w,)]
      if A.shape not in ok_shapes:
          ok_shape_str = " or ".join(map(str, ok_shapes))
          raise ValueError(
              f"A should have shape {ok_shape_str}, not {A.shape}"
          )
  
      if A.ndim == 1:
          # Always use array with at least two dimensions.  This is
          # inconsistent with QuadMesh which stores whatever you give it, but
          # for the wrapped case we need to match the 2D mask.  Storing the
          # 2D array also allows us to calculate ok_shapes on subsequent
          # calls without using the private QuadMesh._shading attribute.
          A = A.reshape((h, w))
  
      # Only use the mask attribute if it is there.
      if hasattr(self, "_wrapped_mask"):
          # Update the pcolor data with the wrapped masked data
          A, pcolor_data, _ = _split_wrapped_mesh_data(
              A, self._wrapped_mask
          )
  
          if not _MPL_38:
              self._wrapped_collection_fix.set_array(
                  pcolor_data[self._wrapped_mask].ravel()
              )
          else:
              self._wrapped_collection_fix.set_array(pcolor_data)
  
      # Now that we have prepared the collection data, call on
      # through to the underlying implementation.
      super().set_array(A)
  
file_path: cartopy/lib/cartopy/mpl/geocollection.py
imports: from matplotlib.collections import QuadMesh
  import numpy
  import numpy.ma
  from cartopy.mpl import _MPL_38
label_desc: Use image node_id 2 for calling the GeoQuadMesh obj's underlying member method code with example usage: obj.set_array(A) without return types