class_docstr: Static class for storing the JumpStart models cache.
class_docstr_tok: ["Static","class","for","storing","the","JumpStart","models","cache","."]
docstr: Returns cache_kwargs with region argument removed if present.
  
  Raises:
      ValueError: If region in `cache_kwargs` is inconsistent with `region` argument.
  
  Args:
      cache_kwargs (Optional[Dict[str, Any]]): cache kwargs to validate.
      region (str): The region to validate along with the kwargs.
docstr_tok: ["Returns","cache_kwargs","with","region","argument","removed","if","present",".","Raises",":","ValueError",":","If","region","in","`","cache_kwargs","`","is","inconsistent","with","`","region","`","argument",".","Args",":","cache_kwargs","(","Optional","[","Dict","[","str",",","Any","]","]",")",":","cache","kwargs","to","validate",".","region","(","str",")",":","The","region","to","validate","along","with","the","kwargs","."]
code: def _validate_and_mutate_region_cache_kwargs(
      cache_kwargs: Optional[Dict[str, Any]] = None,
      region: Optional[str] = None,
  ) -> Dict[str, Any]:
      """Returns cache_kwargs with region argument removed if present.
  
      Raises:
          ValueError: If region in `cache_kwargs` is inconsistent with `region` argument.
  
      Args:
          cache_kwargs (Optional[Dict[str, Any]]): cache kwargs to validate.
          region (str): The region to validate along with the kwargs.
      """
      cache_kwargs_dict = {} if cache_kwargs is None else cache_kwargs
      if region is not None and "region" in cache_kwargs_dict:
          if region != cache_kwargs_dict["region"]:
              raise ValueError(
                  f"Inconsistent region definitions: {region}, {cache_kwargs_dict['region']}"
              )
          del cache_kwargs_dict["region"]
      return cache_kwargs_dict
  
imports: from __future__ import absolute_import
  import functools
  from typing import Any, Dict, List, Optional
  import boto3
  from sagemaker.deprecations import deprecated
  from sagemaker.jumpstart.types import JumpStartModelHeader, JumpStartModelSpecs
  from sagemaker.jumpstart import cache
  from sagemaker.jumpstart.constants import JUMPSTART_DEFAULT_REGION_NAME
label_desc: Use image node_id 5 for calling the JumpStartModelsAccessor obj's underlying member method code with example usage: obj._validate_and_mutate_region_cache_kwargs(cache_kwargs, region) and returns: cache_kwargs_dict