Without this PR,
```js
let f = pyodide.globals.get("some_async_function");
setTimeout(f, 100);
```
doesn't work because `setTimeout` calls `f` which returns a coroutine which is left unscheduled and so the actual work in `f` is never executed. This is surprising to people, see for instance https://github.com/pyodide/pyodide/discussions/2229. This changes the behavior to automatically schedule all coroutines created from async functions called from Javascript so that async functions can be used as Javascript event handlers.
ENH Automatically schedule coroutines. Without this PR,
```js
let f = pyodide.globals.get("some_async_function");
setTimeout(f, 100);
```
doesn't work because `setTimeout` calls `f` which returns a coroutine which is left unscheduled and so the actual work in `f` is never executed. This is surprising to people, see for instance https://github.com/pyodide/pyodide/discussions/2229. This changes the behavior to automatically schedule all coroutines created from async functions called from Javascript so that async functions can be used as Javascript event handlers.
import pytest


def test_nltk_edit_distance(selenium):
    selenium.load_package("nltk")
    selenium.run("import nltk")
    edit_distance = selenium.run("nltk.edit_distance('foo', 'food')")
    assert edit_distance == 1


def test_nltk_jaccard_distance(selenium):
    selenium.load_package("nltk")
    selenium.run("import nltk")
    jaccard_distance = selenium.run(
        """
        nltk.jaccard_distance(set('mapping'), set('mappings'))
    """
    )
    assert jaccard_distance == pytest.approx(0.1428571)


def test_nltk_ngrams(selenium):
    selenium.load_package("nltk")
    selenium.run("import nltk")
    ngrams = selenium.run("list(nltk.ngrams('master', n=3))")
    assert len(ngrams) == 4
    assert ngrams[0] == ["m", "a", "s"]
    assert ngrams[1] == ["a", "s", "t"]
    assert ngrams[2] == ["s", "t", "e"]
    assert ngrams[3] == ["t", "e", "r"]

import pytest


def test_nltk_edit_distance(selenium):
    selenium.load_package("nltk")
    selenium.run("import nltk")
    edit_distance = selenium.run("nltk.edit_distance('foo', 'food')")
    assert edit_distance == 1


def test_nltk_jaccard_distance(selenium):
    selenium.load_package("nltk")
    selenium.run("import nltk")
    jaccard_distance = selenium.run(
        """
        nltk.jaccard_distance(set('mapping'), set('mappings'))
    """
    )
    assert jaccard_distance == pytest.approx(0.1428571)


def test_nltk_ngrams(selenium):
    selenium.load_package("nltk")
    selenium.run("import nltk")
    ngrams = selenium.run("list(nltk.ngrams('master', n=3))")
    assert len(ngrams) == 4
    assert ngrams[0] == ["m", "a", "s"]
    assert ngrams[1] == ["a", "s", "t"]
    assert ngrams[2] == ["s", "t", "e"]
    assert ngrams[3] == ["t", "e", "r"]
