<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_user_by_key(app, key):
 """ This method is only an example! Replace it with a real user database. :param str key: the public key the user belongs to """

    if not hasattr(app, 'example_user_db'):
        app.example_user_db = {}

    if key in app.example_user_db:
        return app.example_user_db[key]
    return None