def get_class_by_id(self, ac_id: int) -> AssetClass:
        """ Finds the asset class by id """
        assert isinstance(ac_id, int)

        # iterate recursively
        for ac in self.asset_classes:
            if ac.id == ac_id:
                return ac
        # if nothing returned so far.
        return None
def get_class_by_id ( self , ac_id : int ) -> AssetClass : assert isinstance ( ac_id , int ) for ac in self . asset_classes : if ac . id == ac_id : return ac return None
Finds the asset class by id