Skip to content

Examples#

Index > SageMakerMetrics > Examples

Auto-generated documentation for SageMakerMetrics type annotations stubs module types-aiobotocore-sagemaker-metrics.

Client#

Implicit type annotations#

Can be used with types-aiobotocore[sagemaker-metrics] package installed.

Write your SageMakerMetrics code as usual, type checking and code completion should work out of the box.

# SageMakerMetricsClient usage example

from aiobotocore.session import get_session


session = get_session()

async with session.create_client("sagemaker-metrics") as client:  # (1)
    result = await client.batch_put_metrics()  # (2)
  1. client: SageMakerMetricsClient
  2. result: BatchPutMetricsResponseTypeDef

Explicit type annotations#

With types-aiobotocore-lite[sagemaker-metrics] or a standalone types_aiobotocore_sagemaker_metrics package, you have to explicitly specify client: SageMakerMetricsClient type annotation.

All other type annotations are optional, as types should be discovered automatically. However, these type annotations can be helpful in your functions and methods.

# SageMakerMetricsClient usage example with type annotations

from aiobotocore.session import get_session

from types_aiobotocore_sagemaker_metrics.client import SageMakerMetricsClient
from types_aiobotocore_sagemaker_metrics.type_defs import BatchPutMetricsResponseTypeDef
from types_aiobotocore_sagemaker_metrics.type_defs import BatchPutMetricsRequestRequestTypeDef


session = get_session()

async with session.create_client("sagemaker-metrics") as client:
    client: SageMakerMetricsClient
    kwargs: BatchPutMetricsRequestRequestTypeDef = {...}
    result: BatchPutMetricsResponseTypeDef = await client.batch_put_metrics(**kwargs)