code: def __init__(
      self,
      image,
      replicas,
      cpu=None,
      memory=None,
      limit_resources_ratio=1.2,
      memory_limit_ratio=2,
      modules=None,
      node_selectors=None,
  ):
      self._cpu = cpu
      self._memory, ratio = (
          parse_readable_size(memory)
          if memory is not None
          else (None, False)
      )
      assert not ratio
  
      if isinstance(modules, str):
          self._modules = modules.split(",")
      else:
          self._modules = modules
  
      res_request = (
          ResourceConfig(cpu, memory) if cpu or memory else None
      )
      memory_limit_ratio = (
          memory_limit_ratio
          if memory_limit_ratio is not None
          else limit_resources_ratio
      )
      res_limit = (
          ResourceConfig(
              cpu * limit_resources_ratio, memory * memory_limit_ratio
          )
          if cpu or memory
          else None
      )
      super().__init__(
          self.service_label,
          image,
          replicas,
          resource_request=res_request,
          resource_limit=res_limit,
          node_selectors=node_selectors,
      )
  
imports: from urllib.parse import urlparse
  from ...utils import parse_readable_size, calc_size_by_str
  from ..kubernetes.config import ContainerEnvConfig
label_desc: Use image node_id 1 to create a new MarsReplicaSpecConfig object from inherited base classes: ReplicaSpecConfig with example: obj = MarsReplicaSpecConfig(image, replicas, cpu, memory, limit_resources_ratio, memory_limit_ratio, modules, node_selectors)