code: def secret_spec_from_str(secret_spec_str, role):
      # "." may be used in secret_id one day (provider specific). HOWEVER, it provides the best UX for
      # non-conflicting cases (i.e. for secret ids that don't contain "."). This is true for all AWS
      # Secrets Manager secrets.
      #
      # So we skew heavily optimize for best upfront UX for the present (1/2023).
      #
      # If/when a certain secret backend supports "." secret names, we can figure out a solution at that time.
      # At a minimum, dictionary style secret spec may be used with no code changes (see secret_spec_from_dict()).
      # Other options could be:
      #  - accept and document that "." secret_ids don't work in Metaflow (across all possible providers)
      #  - add a Metaflow config variable that specifies the separator (default ".")
      #  - smarter spec parsing, that errors on secrets that look ambiguous. "aws-secrets-manager.XYZ" could mean:
      #    + secret_id "XYZ" in aws-secrets-manager backend, OR
      #    + secret_id "aws-secrets-manager.XYZ" default backend (if it is defined).
      #    + in this case, user can simply set "azure-key-vault.aws-secrets-manager.XYZ" instead!
      parts = secret_spec_str.split(".", maxsplit=1)
      if len(parts) == 1:
          secrets_backend_type = get_default_secrets_backend_type()
          secret_id = parts[0]
      else:
          secrets_backend_type = parts[0]
          secret_id = parts[1]
      return SecretSpec(
          secrets_backend_type,
          secret_id=secret_id,
          options={},
          role=role,
      )
  
imports: import os
  import re
  from metaflow.exception import MetaflowException
  from metaflow.decorators import StepDecorator
  from metaflow.metaflow_config import DEFAULT_SECRETS_ROLE
  from metaflow.unbounded_foreach import UBF_CONTROL
  from typing import Any, Dict, List, Union
label_desc: Use image node_id 8 for calling the SecretSpec obj's underlying member method code with example usage: obj.secret_spec_from_str(secret_spec_str, role) and returns: SecretSpec