<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _should_defer(input_layer, args, kwargs):
 """Checks to see if any of the args are templates."""

  for arg in itertools.chain([input_layer], args, six.itervalues(kwargs)):
    if isinstance(arg, (_DeferredLayer, UnboundVariable)):
      return True
    elif (isinstance(arg, collections.Sequence) and
          not isinstance(arg, six.string_types)):
      if _should_defer(None, arg, {}):
        return True
    elif isinstance(arg, collections.Mapping):
      if _should_defer(None, (), arg):
        return True
  return False