original_docstring: 
          Randomly choose state of node from a probability distribution conditioned on parent values *pvalues*.
  
          This method has two parts: (1) determining the proper probability
          distribution, and (2) using that probability distribution to determine
          an outcome.
  
          Arguments:
              1. *pvalues* -- An array containing the assigned states of the node's parents. This must be in the same order as the parents appear in ``self.Vdataentry["parents"]``.
          The function goes to the proper entry in *Vdataentry*, as specified by *pvalues*, and samples the node based on the distribution found there. 
  
          
docstring: Randomly choose state of node from a probability distribution conditioned on parent values *pvalues*.
  This method has two parts: (1) determining the proper probability
  distribution, and (2) using that probability distribution to determine
  an outcome.
  
  1. *pvalues* -- An array containing the assigned states of the node's parents. This must be in the same order as the parents appear in ``self.Vdataentry["parents"]``.
  The function goes to the proper entry in *Vdataentry*, as specified by *pvalues*, and samples the node based on the distribution found there.
docstring_tokens: Randomly choose state of node from a probability distribution conditioned on parent values * pvalues * . This method has two parts : ( 1 ) determining the proper probability distribution and ( 2 ) using that probability distribution to determine an outcome . 1 . * pvalues * -- An array containing the assigned states of the node ' s parents . This must be in the same order as the parents appear in ` ` self . Vdataentry [ " parents " ] ` ` . The function goes to the proper entry in * Vdataentry * as specified by * pvalues * and samples the node based on the distribution found there .
code: def choose(self, pvalues):
          '''
          Randomly choose state of node from a probability distribution conditioned on parent values *pvalues*.
  
          This method has two parts: (1) determining the proper probability
          distribution, and (2) using that probability distribution to determine
          an outcome.
  
          Arguments:
              1. *pvalues* -- An array containing the assigned states of the node's parents. This must be in the same order as the parents appear in ``self.Vdataentry["parents"]``.
          The function goes to the proper entry in *Vdataentry*, as specified by *pvalues*, and samples the node based on the distribution found there. 
  
          '''
  
  
          p = self.Vdataentry["parents"]
          if (not p):
              distribution = self.Vdataentry["cprob"]
          else:
              pvalues = [str(outcome[t]) for t in self.Vdataentry["parents"]] # ideally can we pull this from the skeleton so as not to store parent data at all?
              for pvalue in pvalues:
                  assert pvalue != 'default', "Graph skeleton was not topologically ordered."
                 
              distribution = self.Vdataentry["cprob"][str(pvalues)]
                  
          # choose
          rand = random.random()
          lbound = 0 
          ubound = 0
          for interval in range(int(self.Vdataentry["numoutcomes"])):
              ubound += distribution[interval]
              if (lbound <= rand and rand < ubound):
                  rindex = interval
                  break
              else:
                  lbound = ubound 
      
          return str(self.Vdataentry["vals"][rindex])
code_tokens: def choose ( self , pvalues ) : p = self . Vdataentry [ "parents" ] if ( not p ) : distribution = self . Vdataentry [ "cprob" ] else : pvalues = [ str ( outcome [ t ] ) for t in self . Vdataentry [ "parents" ] ] for pvalue in pvalues : assert pvalue != 'default' , "Graph skeleton was not topologically ordered." distribution = self . Vdataentry [ "cprob" ] [ str ( pvalues ) ] rand = random . random ( ) lbound = 0 ubound = 0 for interval in range ( int ( self . Vdataentry [ "numoutcomes" ] ) ) : ubound += distribution [ interval ] if ( lbound <= rand and rand < ubound ) : rindex = interval break else : lbound = ubound return str ( self . Vdataentry [ "vals" ] [ rindex ] )
short_docstring: Randomly choose state of node from a probability distribution conditioned on parent values *pvalues*.
short_docstring_tokens: Randomly choose state of node from a probability distribution conditioned on parent values * pvalues * .
comment: '''
          Randomly choose state of node from a probability distribution conditioned on parent values *pvalues*.
  
          This method has two parts: (1) determining the proper probability
          distribution, and (2) using that probability distribution to determine
          an outcome.
  
          Arguments:
              1. *pvalues* -- An array containing the assigned states of the node's parents. This must be in the same order as the parents appear in ``self.Vdataentry["parents"]``.
          The function goes to the proper entry in *Vdataentry*, as specified by *pvalues*, and samples the node based on the distribution found there. 
  
          '''$SEP$# ideally can we pull this from the skeleton so as not to store parent data at all?$SEP$# choose