code: def with_(contextmanager, do):
      
      ensure_contextmanager(contextmanager)
      ensure_callable(do)
  
      with contextmanager as value:
          return do(value)
docs: Emulate a `with`` statement, performing an operation within context.
  
      :param contextmanager: Context manager to use for ``with`` statement
      :param do: Operation to perform: callable that receives the ``as`` value
  
      :return: Result of the operation
  
      Example::
  
          # read all lines from given list of ``files``
          all_lines = sum((with_(open(filename), do=dotcall('readlines'))
                           for filename in files), [])