#NEWLINE# def get_tables( self ) : #NEWLINE# #INDENT# "\n        Returns list of tuple of child variable and CPD in case of Bayesian\n        and list of tuple of scope of variables and values in case of Markov.\n\n        Returns\n        -------\n        list : list of tuples of child variable and values in Bayesian\n            list of tuples of scope of variables and values in case of Markov.\n\n        Example\n        -------\n        >>> reader = UAIReader('TestUAI.uai')\n        >>> reader.get_tables()\n        [(['var_0', 'var_1'], ['4.000', '2.400', '1.000', '0.000']),\n         (['var_0', 'var_1', 'var_2'],\n          ['2.2500', '3.2500', '3.7500', '0.0000', '0.0000', '10.0000',\n           '1.8750', '4.0000', '3.3330', '2.0000', '2.0000', '3.4000'])]\n        " #NEWLINE# tables = [ ] #NEWLINE# for function in range ( 0 , function . no_functions ) : #NEWLINE# #INDENT# function_variables = self . grammar . parseString ( self . network ) [ ( 'fun_' + str ( function ) ) ] #NEWLINE# if isinstance ( function_variables , int ) : #NEWLINE# #INDENT# function_variables = [ function_variables ] #NEWLINE# #UNINDENT# if ( self . network_type == 'BAYES' ) : #NEWLINE# #INDENT# child_var = ( 'var_' + str ( function_variables [ ( - 1 ) ] ) ) #NEWLINE# values = self . grammar . parseString ( self . network ) [ ( 'fun_values_' + str ( function ) ) ] #NEWLINE# tables . append ( ( child_var , list ( values ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . network_type == 'MARKOV' ) : #NEWLINE# #INDENT# function_variables = [ ( 'var_' + str ( var ) ) for var in function_variables ] #NEWLINE# values = self . grammar . parseString ( self . network ) [ ( 'fun_values_' + str ( function ) ) ] #NEWLINE# tables . append ( ( function_variables , list ( values ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return tables