code: def modify_url_for_impersonation(cls, url, impersonate_user, username):
          
          if impersonate_user is not None and username is not None:
              url.username = username
docs: Modify the SQL Alchemy URL object with the user to impersonate if applicable.
          :param url: SQLAlchemy URL object
          :param impersonate_user: Bool indicating if impersonation is enabled
          :param username: Effective username