import typing


def calculate_namespace(*, body: typing.Dict[str, typing.Any]) -> typing.Optional[str]:
    """
    Calculate the namespace to use based on the body.

    Args:
        body: The object for the body of the resource.

    Returns:
        The namespace argument value.

    """
    default_namespace = "default"
    metadata = body.get("metadata")
    if metadata is None:
        return default_namespace
    return metadata.get("namespace", default_namespace)