code: def compose(*fs):
      
      ensure_argcount(fs, min_=1)
      fs = list(imap(ensure_callable, fs))
  
      if len(fs) == 1:
          return fs[0]
      if len(fs) == 2:
          f1, f2 = fs
          return lambda *args, **kwargs: f1(f2(*args, **kwargs))
      if len(fs) == 3:
          f1, f2, f3 = fs
          return lambda *args, **kwargs: f1(f2(f3(*args, **kwargs)))
  
      fs.reverse()
  
      def g(*args, **kwargs):
          x = fs[0](*args, **kwargs)
          for f in fs[1:]:
              x = f(x)
          return x
  
      return g
docs: Creates composition of the functions passed in.
  
      :param fs: One-argument functions, with the possible exception of last one
                 that can accept arbitrary arguments
  
      :return: Function returning a result of functions from ``fs``
               applied consecutively to the argument(s), in reverse order