def guess_type(path):
 (base, ext) = posixpath.splitext(path)
 if (ext in extensions_map):
  return extensions_map[ext]
 ext = ext.lower()
 if (ext in extensions_map):
  return extensions_map[ext]
 else:
  return extensions_map['']

def guess_type ( path ) : ( base , ext ) = posixpath . splitext ( path ) if ( ext in extensions_map ) : return extensions_map [ ext ] ext = ext . lower ( ) if ( ext in extensions_map ) : return extensions_map [ ext ] else : return extensions_map [ '' ]
guess the type of a file based on its url .