code: def reduced(reducer=None, arraylike=False):
      """apply a reducer function to reduce output to a single value
  
      Examples:
          >>> @reduced(lambda x,y: x)
          ... def first(x):
          ...   return x
          ...
          >>> first([1,2,3])
          1
  
          >>> @reduced(min)
          ... def minimum(x):
          ...   return x
          ...
          >>> minimum([3,2,1])
          1
  
          >>> @reduced(lambda x,y: x+y)
          ... def add(x):
          ...   return x
          ...
          >>> add([1,2,3])
          6
  
          >>> @reduced(sum, arraylike=True)
          ... def added(x):
          ...   return x
          ...
          >>> added([1,2,3])
          6
      """
      if reducer is None:
          reducer = lambda x: x
          arraylike = True
  
      def dec(f):
          if arraylike:
  
              def func(*args, **kwds):
                  result = f(*args, **kwds)
                  iterable = isiterable(result)
                  return reducer(result) if iterable else result
  
          else:
  
              def func(*args, **kwds):
                  result = f(*args, **kwds)
                  iterable = isiterable(result)
                  return reduce(reducer, result) if iterable else result
  
          func.__wrapped__ = f
          func.__doc__ = f.__doc__
          return func
  
      return dec
  
imports: from functools import reduce
  from collections.abc import Callable
  from mystic._counter import Counter
  from itertools import permutations
  from dill.source import getblocks
  from dill.source import getsource
  from mystic.monitors import Monitor
  from mystic.monitors import VerboseMonitor
  from mystic.monitors import LoggingMonitor
  from mystic.monitors import CustomMonitor
  from mystic.monitors import Null
label_desc: Use image node_id 30 for calling a global function with example usage: reduced(reducer, arraylike) and returns: dec, func, unknown, unknown