class_docstr: spark resources.
code: def convert_resources(self):
      if isinstance(self.driver["memory"].get("limit"), str):
          if (
              "G" in self.driver["memory"]["limit"]
              or "Gi" in self.driver["memory"]["limit"]
          ):
              self.driver["memory"]["limit"] = (
                  float(self.driver["memory"]["limit"].rstrip("Gi G"))
                  * 1024
              )
          elif "m" in self.driver["memory"]["limit"]:
              self.driver["memory"]["limit"] = float(
                  self.driver["memory"]["limit"].rstrip("m")
              )
          # Adjusting the memory value as operator adds 40% to the given value
          self.driver["memory"]["limit"] = (
              str(int(self.driver["memory"]["limit"] / 1.4)) + "m"
          )
  
      if isinstance(self.executor["memory"].get("limit"), str):
          if (
              "G" in self.executor["memory"]["limit"]
              or "Gi" in self.executor["memory"]["limit"]
          ):
              self.executor["memory"]["limit"] = (
                  float(self.executor["memory"]["limit"].rstrip("Gi G"))
                  * 1024
              )
          elif "m" in self.executor["memory"]["limit"]:
              self.executor["memory"]["limit"] = float(
                  self.executor["memory"]["limit"].rstrip("m")
              )
          # Adjusting the memory value as operator adds 40% to the given value
          self.executor["memory"]["limit"] = (
              str(int(self.executor["memory"]["limit"] / 1.4)) + "m"
          )
  
      if self.driver["cpu"].get("request"):
          self.driver["cpu"]["request"] = int(
              float(self.driver["cpu"]["request"])
          )
      if self.driver["cpu"].get("limit"):
          self.driver["cpu"]["limit"] = str(self.driver["cpu"]["limit"])
      if self.executor["cpu"].get("request"):
          self.executor["cpu"]["request"] = int(
              float(self.executor["cpu"]["request"])
          )
      if self.executor["cpu"].get("limit"):
          self.executor["cpu"]["limit"] = str(
              self.executor["cpu"]["limit"]
          )
  
      if self.driver["gpu"].get("quantity"):
          self.driver["gpu"]["quantity"] = int(
              float(self.driver["gpu"]["quantity"])
          )
      if self.executor["gpu"].get("quantity"):
          self.executor["gpu"]["quantity"] = int(
              float(self.executor["gpu"]["quantity"])
          )
  
imports: from __future__ import annotations
  import time
  from copy import deepcopy
  from datetime import datetime
  from functools import cached_property
  import tenacity
  from kubernetes.client import CoreV1Api, CustomObjectsApi, models
  from kubernetes.client.rest import ApiException
  from airflow.exceptions import AirflowException
  from airflow.providers.cncf.kubernetes.resource_convert.configmap import convert_configmap, convert_configmap_to_volume
  from airflow.providers.cncf.kubernetes.resource_convert.env_variable import convert_env_vars
  from airflow.providers.cncf.kubernetes.resource_convert.secret import convert_image_pull_secrets, convert_secret
  from airflow.providers.cncf.kubernetes.utils.pod_manager import PodManager
  from airflow.utils.log.logging_mixin import LoggingMixin
label_desc: Use image node_id 5 for calling the SparkResources obj's underlying member method code with example usage: obj.convert_resources() without return types