def __new__(cls, code, scope=None, **kwargs):
        if not isinstance(code, basestring):
            raise TypeError("code must be an "
                            "instance of %s" % (basestring.__name__,))

        self = str.__new__(cls, code)

        try:
            self.__scope = code.scope
        except __HOLE__:
            self.__scope = {}

        if scope is not None:
            if not isinstance(scope, dict):
                raise TypeError("scope must be an instance of dict")
            self.__scope.update(scope)

        self.__scope.update(kwargs)

        return self
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/casehandlers/pymongo_bson/code.py/Code.__new__