def METHOD_NAME(
    name: str,
    managed_policy_map: Optional[Dict[str, str]],
    get_managed_policy_map: Optional[GetManagedPolicyMap],
) -> str:
    """
    Get the ARN of a AWS managed policy name. Used in Policies property of
    AWS::Serverless::Function and AWS::Serverless::StateMachine.
    The intention is that the bundled managed policy map is used in the majority
    of cases, avoiding the extra IAM calls (IAM is partition-global; AWS managed
    policies are the same for any region within a partition).
    Determined in this order:
      1. Caller-provided managed policy map (can be None, mostly for compatibility)
      2. Managed policy map bundled with the transform code (fast!)
      3. Caller-provided managed policy map (lazily called function)
    If it matches no ARN, the name is used as-is.
    """
    # Caller-provided managed policy map
    if managed_policy_map:
        arn = managed_policy_map.get(name)
        if arn:
            return arn
    # Bundled managed policy map
    partition = ArnGenerator.get_partition_name()
    bundled_managed_policy_map = get_bundled_managed_policy_map(partition)
    if bundled_managed_policy_map:
        arn = bundled_managed_policy_map.get(name)
        if arn:
            return arn
    # If it's already an ARN, we're done
    # https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
    is_arn = name.startswith("arn:")
    if is_arn:
        return name
    # Caller-provided function to get managed policy map (fallback)
    if get_managed_policy_map:
        fallback_managed_policy_map = get_managed_policy_map()
        if fallback_managed_policy_map:
            arn = fallback_managed_policy_map.get(name)
            if arn:
                return arn
    return name