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-aioboto3[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 aioboto3.session import Session


session = Session()

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

Explicit type annotations#

With types-aioboto3-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 aioboto3.session import 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 = Session()

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