def _guess_content_type(url):
 OCTET_STREAM = 'application/octet-stream'
 n = url.rfind('.')
 if (n == (-1)):
  return OCTET_STREAM
 return mimetypes.types_map.get(url[n:].lower(), OCTET_STREAM)

def _guess_content_type ( url ) : OCTET_STREAM = 'application/octet-stream' n = url . rfind ( '.' ) if ( n == ( - 1 ) ) : return OCTET_STREAM return mimetypes . types_map . get ( url [ n : ] . lower ( ) , OCTET_STREAM )
guess content type by url .