

def transform_technology_targeting_to_dfp(targeting):
    '\n    Convert TargetingCriterion to DFP technology targeting data\n    in dictionary form.\n\n    @param targeting: TargetingCriterion\n    @return: dict\n    '
    (includes, excludes) = targeting.get_includes_and_excludes()
    targeting_data = {
        'include': includes,
        'exclude': excludes,
    }
    dict_info = defaultdict((lambda : defaultdict(list)))
    for (criterion_type, criterion) in targeting_data.iteritems():
        for item in criterion:
            tech_type = item.type
            _map = TECHNOLOGY_KEY_MAP[tech_type]
            _map_type = _map['type']
            _target_name = _map['target_name']
            dfp_doc = {
                'id': item.id,
            }
            if (_map_type == 'list'):
                _list_name = _map['list_name']
                _category_name[_target_name][_list_name].append(dfp_doc)
                dict_info[_target_name]['isTargeted'] = (criterion_type == 'include')
            elif (_map_type == 'categorical'):
                _category_name = _map[criterion_type]
                dict_info[_target_name][_category_name].append(dfp_doc)
    dfp_dict = {
        
    }
    for (_key, _val) in dict_info.items():
        dfp_dict[_key] = dict(_val)
    return dfp_dict

dataset/ETHPy150Open chartbeat-labs/parselmouth/parselmouth/adapters/dfp/targeting_utils.py transform_technology_targeting_to_dfp/VarMisuse@132/264 `dict_info`->`_category_name`