def check_duplicate_keys()

in microservices/extraction_service/src/utils/utils_functions.py [0:0]


def check_duplicate_keys(dictme,without_noise):
  #dictme is the mapping dictionary
  #without_noise is the raw dictionary which comes from Form parser
  dupp={}
  for j,k in dictme.items():
    # print(j,k)
    if len(k) > 1:
      dupp[j] = len(k)
  for j,k in dupp.items():
    count=0
    for i in without_noise:
      if i["key"] == j:
        count = count + 1
    #remove this later
    count=0
    if count!=k:
      without_noise=update_confidence(dupp,without_noise)
      return False


  return True