def sens_at_k(counts, noise_eps, l, k):
 counts_sorted = sorted(counts, reverse=True)
 if (((0.5 * noise_eps) * l) > 1):
  print 'l too large to compute sensitivity'
  return 0
 if (counts[0] < (counts[1] + k)):
  return 0
 counts_sorted[0] -= k
 counts_sorted[1] += k
 val = logmgf_from_counts(counts_sorted, noise_eps, l)
 counts_sorted[0] -= 1
 counts_sorted[1] += 1
 val_changed = logmgf_from_counts(counts_sorted, noise_eps, l)
 return (val_changed - val)

def sens_at_k ( counts , noise_eps , l , k ) : counts_sorted = sorted ( counts , reverse = True ) if ( ( ( 0.5 * noise_eps ) * l ) > 1 ) : print 'l too large to compute sensitivity' return 0 if ( counts [ 0 ] < ( counts [ 1 ] + k ) ) : return 0 counts_sorted [ 0 ] -= k counts_sorted [ 1 ] += k val = logmgf_from_counts ( counts_sorted , noise_eps , l ) counts_sorted [ 0 ] -= 1 counts_sorted [ 1 ] += 1 val_changed = logmgf_from_counts ( counts_sorted , noise_eps , l ) return ( val_changed - val )
return sensitivity at distane k .