def METHOD_NAME(
    settings: Union[Settings, dict], tracer: Tracer = None
) -> Gateway:
    """Initialize a provider gateway with the required settings
    Args:
        settings (Union[Settings, dict]): the provider settings
    Returns:
        Gateway: a gateway instance
    """
    try:
        _tracer = tracer or Tracer()
        settings_value: Settings = (
            DP.to_object(provider.Settings, settings)
            if isinstance(settings, dict)
            else settings
        )
        return Gateway(
            tracer=_tracer,
            is_hub=provider.is_hub,
            settings=settings_value,
            mapper=provider.Mapper(settings_value),
            proxy=provider.Proxy(settings_value, tracer=_tracer),
        )
    except Exception as er:
        raise ShippingSDKError(f"Failed to setup provider '{key}'") from er