code: def pipe_util(func):
      
      @wraps(func)
      def pipe_util_wrapper(function, *args, **kwargs):
          if isinstance(function, XObject):
              function = ~function
  
          original_function = function
  
          if args or kwargs:
              function = xpartial(function, *args, **kwargs)
  
          name = lambda: '%s(%s)' % (get_name(func), ', '.join(
              filter(None, (get_name(original_function), repr_args(*args, **kwargs)))))
  
          f = func(function)
  
          result = pipe | set_name(name, f)
  
          # if the util defines an 'attrs' mapping, copy it as attributes
          # to the result
          attrs = getattr(f, 'attrs', {})
          for k, v in dict_items(attrs):
              setattr(result, k, v)
  
          return result
  
      return pipe_util_wrapper
docs: Decorator that handles X objects and partial application for pipe-utils.