code: def generate_property(self):
      def getter(object_):
          if self.get_modifier:
              return (
                  self.get_modifier(
                      getattr(object_._model, self.mapped_name)
                  )
                  if object_._model
                  else None
              )
          else:
              return (
                  getattr(object_._model, self.mapped_name)
                  if object_._model
                  else None
              )
  
      setter = None
      if self.with_setter or self.direct_setter:
  
          def direct_setter(object_, value):
              engine = object_._session.bind
              table_name = object_._model.__tablename__
              with engine.begin() as conn:
                  sql = text(
                      f"UPDATE {table_name} SET {self.mapped_name} = :val WHERE id = :id"
                  )
                  conn.execute(sql, {"val": value, "id": object_._id})
  
          def setter(object_, value):
              assert object_._model
              try:
                  setattr(object_._model, self.mapped_name, value)
                  object_._session.add(object_._model)
                  if getattr(object_._session, "autocommit", True):
                      object_._session.commit()
                  else:
                      object_._session.flush()
              except Exception:
                  direct_setter(object_, value)
  
      if self.direct_setter:
          return property(getter, direct_setter)
      else:
          return property(getter, setter)
  
file_path: aim/aim/storage/structured/sql_engine/utils.py
imports: from abc import ABCMeta
  from typing import Iterator, Collection, TypeVar, Union, Callable
  from sqlalchemy import text
label_desc: Use image node_id 2 for calling the ModelMappedProperty obj's underlying member method code with example usage: obj.generate_property() and returns: property, property, unknown, unknown