def tag_filter(tags):
    if args['require_key'] and args['require_key'] not in tags:
        for key in tags.keys():
            del tags[key]
            # "functions should modify the dictionary in-place"
    else:
        for key in tags.keys():
            if key not in wantedTags:
                del tags[key]
            else:
                if wantedTags[key] == '*' or tags[key] in wantedTags[key]:
                    a = 1
                    # placeholder, more to do here, combine keys, normalize values, etc...
                else:
                    del tags[key]
dataset/ETHPy150Open aaronlidman/openstreetPOIs/osmpois.py/tag_filter/original