def METHOD_NAME(key, data, errors, context):
    value = data.pop(key, None)
    if value and value is not missing:
        key_name = key[-1]
        if key_name == '__junk':
            # for junked fields, the field name is contained in the value
            key_name = list(value.keys())
        errors[key].append(_(
            'The input field %(name)s was not expected.') % {"name": key_name})