<commit_before>from pprint import pprint
#[{u'accountId': 2,
  #u'add': True,
  #u'broadcastUri': u'vlan://untagged',
  #u'firstIP': False,
  #u'networkRate': 200,
  #u'newNic': False,
  #u'nicDevId': 1,
  #u'oneToOneNat': False,
  #u'publicIp': u'10.0.2.102',
  #u'sourceNat': True,
  #u'trafficType': u'Public',
  #u'vifMacAddress': u'06:f6:5e:00:00:03',
  #u'vlanGateway': u'10.0.2.1',
  #u'vlanNetmask': u'255.255.255.0'}]

def merge(dbag, ip):
    added = False
    for mac in dbag:
        if mac == "id":
           continue
        for address in dbag[mac]:
            if address['public_ip'] == ip['public_ip']:
               dbag[mac].remove(address)
    if ip['add']:
       dbag.setdefault('eth' + str(ip['nic_dev_id']), []).append( ip )
    pprint(dbag)
    return dbag<commit_msg>Remove debug code<commit_after>from pprint import pprint
#[{u'accountId': 2,
  #u'add': True,
  #u'broadcastUri': u'vlan://untagged',
  #u'firstIP': False,
  #u'networkRate': 200,
  #u'newNic': False,
  #u'nicDevId': 1,
  #u'oneToOneNat': False,
  #u'publicIp': u'10.0.2.102',
  #u'sourceNat': True,
  #u'trafficType': u'Public',
  #u'vifMacAddress': u'06:f6:5e:00:00:03',
  #u'vlanGateway': u'10.0.2.1',
  #u'vlanNetmask': u'255.255.255.0'}]

def merge(dbag, ip):
    added = False
    for mac in dbag:
        if mac == "id":
           continue
        for address in dbag[mac]:
            if address['public_ip'] == ip['public_ip']:
               dbag[mac].remove(address)
    if ip['add']:
       dbag.setdefault('eth' + str(ip['nic_dev_id']), []).append( ip )
    return dbag
{'fraction_non_alphanumeric': 0.20139328689043698, 'fraction_numerical': 0.046865104496516784, 'mean_word_length': 3.2245989304812834, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3103837', 'n_tokens_mistral': 703, 'n_tokens_neox': 659, 'n_words': 124}