def read_env_vars_and_defaults_ints(var: str) -> Optional[int]:
    """Gets env var from read_env_vars_and_defaults() and attempts to coerce it to an int

    Returns
        the coerced int value, or None if the key is not found.
    """
    str_val = read_env_vars_and_defaults(var)

    if str_val is None:
        return None

    validation_error_msg = (
        f"Could not properly read env var `{var}`. `{var}` must be able to be parsed as an int."
    )
    try:
        as_int = int(str_val)
    except (ValueError, TypeError) as e:
        value_error_msg = f"`{validation_error_msg} Current value: `{str_val}`. Reason: {e}"
        logger.error(value_error_msg)
        raise exceptions.ConfigurationError(value_error_msg)
    return as_int
Gets env var from read_env_vars_and_defaults() and attempts to coerce it to an int

    Returns
        the coerced int value, or None if the key is not found.
    
src/marqo/tensor_search/utils.py