<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_consumer_cfg(config, only, qty):
 """Get the consumers config, possibly filtering the config if only or qty is set. :param config: The consumers config section :type config: helper.config.Config :param str only: When set, filter to run only this consumer :param int qty: When set, set the consumer qty to this value :rtype: dict """

        consumers = dict(config.application.Consumers or {})
        if only:
            for key in list(consumers.keys()):
                if key != only:
                    del consumers[key]
            if qty:
                consumers[only]['qty'] = qty
        return consumers