@classmethod
def from_code(cls, environment, code, globals, uptodate=None):
    """Creates a template object from compiled code and the globals.  This
        is used by the loaders and environment to create a template object.
        """
    namespace = {'environment': environment, '__file__': code.co_filename}
    exec(code, namespace)
    rv = cls._from_namespace(environment, namespace, globals)
    rv._uptodate = uptodate
    return rv
