def imp_type_for_filename(filename):
 for type_data in imp.get_suffixes():
  extension = type_data[0]
  if filename.endswith(extension):
   return type_data
 return None

def imp_type_for_filename ( filename ) : for type_data in imp . get_suffixes ( ) : extension = type_data [ 0 ] if filename . endswith ( extension ) : return type_data return None
given the name of a python module .