def get_transient_identity_and_traits(
    environment: Environment,
    sdk_trait_data: list[SDKTraitData],
) -> IdentityAndTraits:
    """
    Get a transient `Identity` instance with a randomly generated identifier.
    All traits are marked as transient.
    """
    return (
        (
            identity := _get_transient_identity(
                environment=environment,
                identifier=get_transient_identifier(sdk_trait_data),
            )
        ),
        identity.generate_traits(_ensure_transient(sdk_trait_data), persist=False),
    )

    Get a transient `Identity` instance with a randomly generated identifier.
    All traits are marked as transient.
    
api/environments/sdk/services.py