code: def sampleone(hull,hx,hpx,domain,isDomainFinite,maxn,nupdates,hxparams):
      
      thishull= hull
      noSampleYet= True
      while noSampleYet:
          #Sample a candidate from the upper hull
          candidate= sample_hull(thishull,domain,isDomainFinite)
          thishux, thishlx= evaluate_hull(candidate,thishull)
          u= stats.uniform.rvs()
          if u < m.exp(thishlx-thishux):
              thissample= candidate
              noSampleYet= False
          else:
              thishx= hx(candidate,hxparams)
              if u < m.exp(thishx-thishux):
                  thissample= candidate
                  noSampleYet= False
              if nupdates < maxn:
                  thishpx= hpx(candidate,hxparams)
                  thishull= update_hull(thishull,candidate,thishx,thishpx,
                                        domain,isDomainFinite)
                  nupdates= nupdates+1
      return thissample, thishull, nupdates
docs: sampleone: sample one point by ars
  
      Input:
         hull            - the hull (see doc of setup_hull for definition)
         hx              - function that evaluates h(x)
         hpx             - function that evaluates hp(x)
         domain          - [.,.] upper and lower limit to the domain
         isDomainFinite  - [.,.] is there a lower/upper limit to the domain?
         maxn            - maximum number of updates to the hull
         nupdates        - number of updates to the hull that have occured
         hxparams        - tuple of parameters for h(x) and h'(x)
  
      Output:
         a sample
         a new hull
         nupdates
  
      History:
         2009-05-21 - Written - Bovy (NYU)