I have a single code file for my Google App Engine project. This simple file has one class, and inside it a few methods. Why does this python method gives an error saying global
You need to call it explicitly with an instance:
groups = self.gen_groups(input)
Similarly for some of the other calls you're making in there, e.g. gen_album.
gen_album
Also, see Knowing When to Use self and __init__ for more information.