code: def _validate_fields(cls, field_values):
      if field_values["retry"] and "limit" not in field_values:
          field_values["limit"] = DEFAULT_RETRY_LIMIT
      if field_values.get("limit") is not None:
          field_values["retry"] = True
      return field_values
  
imports: import re
  from enum import Enum
  from typing import List, Optional, Tuple, Union
  from pydantic import Field, confloat, root_validator, validator
  from typing_extensions import Annotated, Literal
  from dstack._internal.core.models.backends.base import BackendType
  from dstack._internal.core.models.common import ForbidExtra
label_desc: Use image node_id 1 for calling the ProfileRetryPolicy obj's underlying member method code with example usage: obj._validate_fields(cls, field_values) and returns: field_values