'Get the library from the DB.
:param  decoded_library_id:       decoded library id
:type   decoded_library_id:       int
:param  check_accessible:         flag whether to check that user can access item
:type   check_accessible:         bool
:returns:   the requested library
:rtype:     galaxy.model.Library'

def get(self, trans, decoded_library_id, check_accessible=True):

    try:
        library = trans.sa_session.query(trans.app.model.Library).filter((trans.app.model.Library.table.c.id == decoded_library_id)).one()
    except MultipleResultsFound:
        raise exceptions.InconsistentDatabase('Multiple    libraries    found    with    the    same    id.')
    except NoResultFound:
        raise exceptions.RequestParameterInvalidException('No    library    found    with    the    id    provided.')
    except Exception as e:
        raise exceptions.InternalServerError(('Error    loading    from    the    database.' + str(e)))
    library = self.secure(trans, library, check_accessible)
    return library
