def prune_choices(i):
    """
    Input:  {
               choices       - dict of choices
               choices_order - choices order
            }

    Output: {
              return               - return code =  0, if successful
                                                 >  0, if error
              (error)              - error text if return > 0

              pruned_choices       - leave only tuning keys (values)
              pruned_choices_order - leave only tuning keys (order)
            }

    """

    pc={}
    pco=[]

    choices=i.get('choices',{})
    corder=i.get('choices_order',[])

    for q in sorted(corder):
        if q.startswith('##'):
           q1='##choices'+q[1:]
           v=choices.get(q1, None)

           if v!=None:
              pc[q]=v
              pco.append(q)

    return {'return':0, 'pruned_choices':pc, 'pruned_choices_order':pco}