NameError: name 'getResultFromDatabase' is not defined
<p>I'm getting this error:</p>

<pre><code>NameError: name 'getResultFromDatabase' is not defined
</code></pre>

<p>Here is my code:</p>

<pre><code>import pymongo

from itertools import groupby
from pymongo import Connection

data = getResultFromDatabase()
connection = Connection('localhost', 27017)

db = connection.students

item = db.grades.find({'type' : 'homework'}).sort([('student_id',pymongo.ASCENDING),('score',pymongo.ASCENDING)])



for id, items in groupby(data, lambda s: s['student_id']):
    lowest_score = min(i['score'] for i in items)

    print lowest_score
</code></pre>
