def process(args):
    conduit = phlsys_makeconduit.make_conduit(
        args.uri, args.user, args.cert, args.act_as_user)

    # conduit expects PHIDs not plain usernames
    user_phids = phlcon_user.UserPhidCache(conduit)
    user_phids.add_hint_list(
        _combine_lists_if_not_none(args.owners, args.ccs))
    authors = [user_phids.get_phid(user) for user in args.authors]
    owners = [user_phids.get_phid(user) for user in args.owners]
    ccs = [user_phids.get_phid(user) for user in args.ccs]

    # conduit expects PHIDs not plain project names
    projects = None
    if args.projects:
        project_to_phid = phlcon_project.make_project_to_phid_dict(conduit)
        projects = [project_to_phid[p] for p in args.projects]

    filters = phlcon_maniphest.STATUS_FILTERS
    status = filters[args.status] if args.status is not None else None

    orderings = phlcon_maniphest.ORDERS
    order = orderings[args.order] if args.order is not None else None

    results = phlcon_maniphest.query(
        conduit,
        ids=args.ids,
        authors=authors,
        owners=owners,
        ccs=ccs,
        projects=projects,
        status=status,
        limit=args.max_results,
        offset=args.offset_results,
        order=order,
        text=args.text)

    results = [dict(r.__dict__) for r in results]

    for r in results:
        if r['statusName'] is None:
            r['statusName'] = phlcon_maniphest.STATUSES[int(r['status'])]

    # initialise to format for 'args.format_short'
    output_format = "{id} / {statusName} / {priority} / {title}"

    if args.format_ids:
        output_format = "{id}"
    elif args.format_string is not None:
        output_format = args.format_string

    if args.format_python:
        pprint.pprint(results)
    elif args.format_json:
        print(json.dumps(results, sort_keys=True, indent=2))
    else:
        for r in results:
            print(output_format.format(**r))


# -----------------------------------------------------------------------------
# Copyright (C) 2013-2014 Bloomberg Finance L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------ END-OF-FILE ----------------------------------
dataset/ETHPy150Open bloomberg/phabricator-tools/py/aon/aoncmd_taskquery.py/process/original