def pop(title, f, color=None, **kwargs):
    'Pop matching builds from `builds` dict and print them.'
    if ((not options.color) or (color is None)):
        colorize = str
    else:
        colorize = (lambda x: ('%s%s%s' % (color, x, Fore.RESET)))
    result = []
    for b in builds.values():
        if all(((b.get(k) == v) for (k, v) in kwargs.iteritems())):
            builds.pop(b['id'])
            result.append(b)
    if result:
        print(colorize(title))
        for b in sorted(result, key=sort_key):
            print(' ', colorize('\t'.join(map(str, f(b)))))
Pop matching builds from `builds` dict and print them.
def pop(title, f, color=None, **kwargs):
    
    if ((not options.color) or (color is None)):
        colorize = str
    else:
        colorize = (lambda x: ('%s%s%s' % (color, x, Fore.RESET)))
    result = []
    for b in builds.values():
        if all(((b.get(k) == v) for (k, v) in kwargs.iteritems())):
            builds.pop(b['id'])
            result.append(b)
    if result:
        print(colorize(title))
        for b in sorted(result, key=sort_key):
            print(' ', colorize('\t'.join(map(str, f(b)))))