def length_conditional_mangler(length, mangler):
 def mangle(key):
  if (len(key) >= length):
   return mangler(key)
  else:
   return key
 return mangle

def length_conditional_mangler ( length , mangler ) : def mangle ( key ) : if ( len ( key ) >= length ) : return mangler ( key ) else : return key return mangle
a key mangler that mangles if the length of the key is past a certain threshold .