<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def session(self, master='', config=None):
 """Takes care of starting any local servers and stopping queues on exit. In general, the Runner is designed to work with any user provided session, but this provides a convenience for properly stopping the queues. Args: master: The master session to use. config: A tf.ConfigProto or None. Yields: A session. """

    session_manager = SESSION_MANAGER_FACTORY()
    # Initialization is handled manually at a later point and session_manager
    # is just used for distributed compatibility.
    with session_manager.prepare_session(master, None, config=config,
                                         init_fn=lambda _: None) as sess:
      try:
        yield sess
      finally:
        self.stop_queues()