from typing import Any


def ensure_field(dictlike: dict, fieldname: str) -> Any:
    """Ensure the required field is found in the data structure."""
    sentinel = object()
    value = dictlike.get(fieldname, sentinel)

    if value is sentinel:
        raise UserWarning('{!r} is a required field'.format(fieldname))

    return value