code: def _validate_optional_key(key, missing, value, validated, optional):
      
      try:
          validated[key] = optional[key](value)
      except NotValid as ex:
          return ['%r: %s' % (key, arg) for arg in ex.args]
      if key in missing:
          missing.remove(key)
      return []
docs: Validate an optional key.