code: def select_uoa(i):
      
  
      se=i.get('skip_enter','')
  
      lst=i.get('choices',[])
  
      if i.get('skip_sort','')!='yes':
         klst=sorted(lst, key=lambda v: v['data_uoa'])
      else:
         klst=lst
  
      zz={}
      iz=0
  
      for z1 in klst:
          z=z1['data_uid']
          zu=z1['data_uoa']
  
          zs=str(iz)
          zz[zs]=z
  
          out(zs+') '+zu+' ('+z+')')
  
          iz+=1
  
      out('')
      y='Select UOA'
      if se!='yes': y+=' (or press Enter for 0)'
      y+=': '
  
      rx=inp({'text':y})
      x=rx['string'].strip()
      if x=='' and se!='yes': x='0' 
  
      if x not in zz:
         return {'return':1, 'error':'number is not recognized'}
  
      dduoa=zz[x]
  
      return {'return':0, 'choice':dduoa}
docs: Input:  {
                choices      - list from search function
                (skip_enter) - if 'yes', do not select 0 when user presses Enter
                (skip_sort)  - if 'yes', do not sort array
              }
  
      Output: {
                return  - return code =  0, if successful
                                      >  0, if error
                (error) - error text if return > 0
                choice  - data UOA
              }