code: def with_env(cls, env):
          
          new_cls = type(cls.__name__, cls.__bases__, dict(cls.__dict__))
          new_cls._env = env
          return new_cls
docs: Return a model (or recordset) equivalent to the current model
          (or recordset) attached to `env`.