def set_format(fmt='xml'):
 global ws_format
 if (fmt == 'xml'):
  ws_format = fmt
  set_parser()
 elif (fmt == 'json'):
  ws_format = fmt
  warn('The json format is non-official and may change at any time')
  set_parser(json.loads)
 else:
  raise ValueError(('invalid format: %s' % fmt))

def set_format ( fmt = 'xml' ) : global ws_format if ( fmt == 'xml' ) : ws_format = fmt set_parser ( ) elif ( fmt == 'json' ) : ws_format = fmt warn ( 'The json format is non-official and may change at any time' ) set_parser ( json . loads ) else : raise ValueError ( ( 'invalid format: %s' % fmt ) )
sets the format that should be returned by the web service .