(session, kb)
:param session:             The database session object.
        :param KnowledgeBase kb:    The KnowledgeBase instance to serialize.
        :return:                    None
def dump(session, kb):
        """

        :param session:             The database session object.
        :param KnowledgeBase kb:    The KnowledgeBase instance to serialize.
        :return:                    None
        """

        db_kb = session.query(DbKnowledgeBase).filter_by(name=kb.name).scalar()
        if db_kb is None:
            db_kb = DbKnowledgeBase(name=kb.name)
            session.add(db_kb)

        # dump other stuff
        if 'CFGFast' in kb.cfgs:
            cfg_model = kb.cfgs['CFGFast']
            if cfg_model is not None:
                CFGModelSerializer.dump(session, db_kb, 'CFGFast', cfg_model)

        FunctionManagerSerializer.dump(session, db_kb, kb.functions)
        XRefsSerializer.dump(session, db_kb, kb.xrefs)
        CommentsSerializer.dump(session, db_kb, kb.comments)
        LabelsSerializer.dump(session, db_kb, kb.labels)
        VariableManagerSerializer.dump(session, db_kb, kb.variables)
        StructuredCodeManagerSerializer.dump(session, db_kb, kb.structured_code)
def dump ( session , kb ) : db_kb = session . query ( DbKnowledgeBase ) . filter_by ( name = kb . name ) . scalar ( ) if db_kb is None : db_kb = DbKnowledgeBase ( name = kb . name ) session . add ( db_kb ) # dump other stuff if 'CFGFast' in kb . cfgs : cfg_model = kb . cfgs [ 'CFGFast' ] if cfg_model is not None : CFGModelSerializer . dump ( session , db_kb , 'CFGFast' , cfg_model ) FunctionManagerSerializer . dump ( session , db_kb , kb . functions ) XRefsSerializer . dump ( session , db_kb , kb . xrefs ) CommentsSerializer . dump ( session , db_kb , kb . comments ) LabelsSerializer . dump ( session , db_kb , kb . labels ) VariableManagerSerializer . dump ( session , db_kb , kb . variables ) StructuredCodeManagerSerializer . dump ( session , db_kb , kb . structured_code )