def _session(kwargs):
if '<STR_LIT>' in kwargs:<EOL><INDENT>LOG.debug('<STR_LIT>')<EOL>sess = kwargs.get('<STR_LIT>')<EOL>if not isinstance(sess, k_session.Session):<EOL><INDENT>msg = ('<STR_LIT>' % k_session.Session)<EOL>LOG.error(msg)<EOL>raise RuntimeError(msg)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>LOG.debug('<STR_LIT>')<EOL>auth = _get_auth_handler(kwargs)<EOL>sess = _get_session(auth, kwargs)<EOL><DEDENT>return sess<EOL>
Returns or reuses session.

    Method takes care of providing instance of
    session object for the client.

    :param kwargs: all params (without api_version) client was initialized with
    :type kwargs: dict

    :returns: session object
    :rtype keystoneauth1.session.Session