def _val_or_dict(tk, options, *args):
 options = _format_optdict(options)
 res = tk.call(*(args + options))
 if (len(options) % 2):
  return res
 return _dict_from_tcltuple(tk.splitlist(res))

def _val_or_dict ( tk , options , * args ) : options = _format_optdict ( options ) res = tk . call ( * ( args + options ) ) if ( len ( options ) % 2 ) : return res return _dict_from_tcltuple ( tk . splitlist ( res ) )
format options then call func with args and options and return the appropriate result .