def METHOD_NAME(self, loan_external_identifier):
    """Look up the library the user is trying to access using a loan's external identifier.
    We assume that the external identifier is globally unique which is true, for example,
    in the case of using Readium LCP.
    :param loan_external_identifier: External identifier of the patron's loan
    :type loan_external_identifier: basestring
    :return: Library the patron is trying to access
    :rtype: Library
    """
    self.manager.reload_settings_if_changed()
    loan = get_one(self._db, Loan, external_identifier=loan_external_identifier)
    if loan is None:
        return LOAN_NOT_FOUND
    library = loan.patron.library
    flask.request.library = library
    return library