code: def guess_mode(self, data):
          
          # TODO: do we want to support dimensions being at the beginning of the array?
          if data.ndim == 2:
              return "L"
          elif data.shape[-1] == 3:
              return "RGB"
          elif data.shape[-1] == 4:
              return "RGBA"
          else:
              raise ValueError(
                  "Un-supported shape for image conversion %s" % list(data.shape))
docs: Guess what type of image the np.array is representing