code: def _process_value(func, value):
          
          if isinstance(value, (list, tuple)):
              return [func(item) for item in value]
          return func(value)
docs: Applies processing method for value or each element in it.
  
          :param func: method to be called with value
          :param value: value to process
          :return: if 'value' is list/tupe, returns iterable with func results,
                   else func result is returned