<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 PScript - Python to JavaScript transpilation
Step1:  We can transpile strings of Python code
Step2:  Or actual Python functions
Step3:  Let's try that again, but now with a list comprehension. (The JS is valid and will run fine, though its less readable.)
Step4:  Classes are also supported, but not in the notebook (apparently Python cannot retrieve the source code in this case).
Step5:  Using evalpy you can evaluate Python code in NodeJS
<ASSISTANT_TASK:>
Python Code:
from pscript import py2js, evalpy
Explanation: Tutorial for PScript - Python to JavaScript transpilation
End of explanation
js = py2js('for i in range(10): print(i)')
print(js)
Explanation: We can transpile strings of Python code:
End of explanation
def foo(x):
    res = []
    for i in range(x):
        res.append(i**2)
    return res
js = py2js(foo)
print(js)
Explanation: Or actual Python functions:
End of explanation
def foo(x):
    return [i**2 for i in range(x)]
js = py2js(foo)
print(js)
Explanation: Let's try that again, but now with a list comprehension. (The JS is valid and will run fine, though its less readable.)
End of explanation
class Bar:
    def spam(self):
        return 3 + 4
#js = py2js(Bar)
# This only works if Bar is defined in an actual module.
Explanation: Classes are also supported, but not in the notebook (apparently Python cannot retrieve the source code in this case).
End of explanation
evalpy('print(3 + 4)')
evalpy('print(None)')
Explanation: Using evalpy you can evaluate Python code in NodeJS:
End of explanation
<END_TASK>