def _toInt(val, replace=()):
 for (before, after) in replace:
  val = val.replace(before, after)
 try:
  return int(val)
 except (TypeError, ValueError):
  return None

def _toInt ( val , replace = ( ) ) : for ( before , after ) in replace : val = val . replace ( before , after ) try : return int ( val ) except ( TypeError , ValueError ) : return None
return the value .