sagemaker.core.jumpstart.hub.parser_utils#
This module contains utilities related to SageMaker JumpStart Hub.
Functions
|
Converts camelCase to snake_case_string using a regex. |
|
Converts snake_case_string to UpperCamelCaseString. |
|
Recursively walks a json object and applies a given function to the keys. |
- sagemaker.core.jumpstart.hub.parser_utils.camel_to_snake(camel_case_string: str) str[source]#
Converts camelCase to snake_case_string using a regex.
This regex cannot handle whitespace (“camelString TwoWords”)
- sagemaker.core.jumpstart.hub.parser_utils.snake_to_upper_camel(snake_case_string: str) str[source]#
Converts snake_case_string to UpperCamelCaseString.
- sagemaker.core.jumpstart.hub.parser_utils.walk_and_apply_json(json_obj: Dict[Any, Any], apply, stop_keys: List[str] | None = ['metrics']) Dict[Any, Any][source]#
Recursively walks a json object and applies a given function to the keys.
- stop_keys (Optional[list[str]]): List of field keys that should stop the application function.
Any children of these keys will not have the application function applied to them.