def call_command(args):
    interfaces = get_interfaces(args)

    interface, method = find_method(interfaces, args.interface, args.method, args.method_version)
    if not interface:
        print >>stderr, "Invalid interface: %s" % args.interface
        print >>stderr, "Valid values are:"
        print >>stderr, "    %s" % ', '.join(map(itemgetter('name'), interfaces))
        return False

    if not method:
        print >>stderr, "Invalid method: %s" % args.method
        print >>stderr, "Valid values are:"
        print >>stderr, "    %s" % ', '.join(map(itemgetter('name'), interface['methods']))
        return False

    # Little bit of ugliness to have nice `call FooBar baz --help` output.
    original_args = ['steamcli.py'] + argv[1:]
    if len(args.parameters):
        original_args = original_args[:-len(args.parameters)]
    cmd = ' '.join(original_args)

    # Parse the arguments for our specific method, and turn it in to a dict.
    arguments = argparser_for_method(cmd, method).parse_args(args.parameters)
    # Omit any optional arguments that have not been provided.
    arguments = filter_none_values(arguments.__dict__)

    if args.key:
        arguments['key'] = args.key
    arguments['format'] = 'json'

    url = method_url(interface, method)
    response = None
    if method['httpmethod'] != 'POST':
        if len(arguments) > 0:
            url += '?%s' % urlencode(arguments)
        if args.verbose:
            print url % " ! GET request for %s"
        response = requests.get(url)
    else:
        if args.verbose:
            print " ! POST request for %s, body:" % url
            pprint(arguments)
        response = requests.post(url, data=json.dumps(arguments), headers={ 'Content-Type': 'application/json' })

    if args.raw:
        print response.text
    else:
        pprint(response.json())

    return True
dataset/ETHPy150Open UberEnt/SteamCLI/steamcli.py/call_command/swapped operands of `%`