<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Tutorial for flexx.app - connecting to the browser
Step1:  In normal operation, one uses flx.launch() to fire up a browser (or desktop app) to run the JavaScript in. This is followed by flx.run() (or flx.start() for servers) to enter Flexx' main loop.
In the notebook, however, there already is a browser. To tell Flexx that we're in the notebook, use flx.init_notebook() at the start of your notebook. Since Flexx's event system is based on asyncio, we need to "activate" asyncio as well.
Step2:  Let's use an example model
<ASSISTANT_TASK:>
Python Code:
from flexx import flx
Explanation: Tutorial for flexx.app - connecting to the browser
End of explanation
%gui asyncio
flx.init_notebook()
class MyComponent(flx.JsComponent):
    foo = flx.StringProp('', settable=True)
        
    @flx.reaction('foo')
    def on_foo(self, *events):
        if self.foo:
            window.alert('foo is ' + self.foo, + len(events))
m = MyComponent()
m.set_foo('helo')
Explanation: In normal operation, one uses flx.launch() to fire up a browser (or desktop app) to run the JavaScript in. This is followed by flx.run() (or flx.start() for servers) to enter Flexx' main loop.
In the notebook, however, there already is a browser. To tell Flexx that we're in the notebook, use flx.init_notebook() at the start of your notebook. Since Flexx's event system is based on asyncio, we need to "activate" asyncio as well.
End of explanation
from flexxamples.testers.find_prime import PrimeFinder
p = PrimeFinder()
p.find_prime_py(2000)
p.find_prime_js(2000)  # Result is written to JS console, open F12 to see it
Explanation: Let's use an example model:
End of explanation
<END_TASK>