def _count_duplicated_locations(locations, new):
 ret = 0
 for loc in locations:
  if ((loc['url'] == new['url']) and (loc['metadata'] == new['metadata'])):
   ret += 1
 return ret

def _count_duplicated_locations ( locations , new ) : ret = 0 for loc in locations : if ( ( loc [ 'url' ] == new [ 'url' ] ) and ( loc [ 'metadata' ] == new [ 'metadata' ] ) ) : ret += 1 return ret
to calculate the count of duplicated locations for new one .