code: def optional(validator):
      """
      A validator that makes an attribute optional.  An optional attribute is one
      which can be set to ``None`` in addition to satisfying the requirements of
      the sub-validator.
  
      :param validator: A validator (or a list of validators) that is used for
          non-``None`` values.
      :type validator: callable or `list` of callables.
  
      .. versionadded:: 15.1.0
      .. versionchanged:: 17.1.0 *validator* can be a list of validators.
      """
      if isinstance(validator, list):
          return _OptionalValidator(_AndValidator(validator))
      return _OptionalValidator(validator)
  
imports: from __future__ import absolute_import, division, print_function
  import re
  from ._make import _AndValidator, and_, attrib, attrs
  from .exceptions import NotCallableError
label_desc: Use image node_id 4 for calling a global function with example usage: optional(validator) and returns: _OptionalValidator, _OptionalValidator