code: def _prune_invalid_time_reductions(spec):
      
      valid_reductions = []
      if not spec['var'].def_time and spec['dtype_out_time'] is not None:
          for reduction in spec['dtype_out_time']:
              if reduction not in _TIME_DEFINED_REDUCTIONS:
                  valid_reductions.append(reduction)
              else:
                  msg = ("Var {0} has no time dimension "
                         "for the given time reduction "
                         "{1} so this calculation will "
                         "be skipped".format(spec['var'].name, reduction))
                  logging.info(msg)
      else:
          valid_reductions = spec['dtype_out_time']
      return valid_reductions
docs: Prune time reductions of spec with no time dimension.