def get_import_stacklevel(import_hook):
 py_version = sys.version_info[:2]
 if (py_version <= (3, 2)):
  return (4 if import_hook else 2)
 elif (py_version == (3, 3)):
  return (8 if import_hook else 10)
 elif (py_version == (3, 4)):
  return (10 if import_hook else 8)
 else:
  return (4 if import_hook else 2)

def get_import_stacklevel ( import_hook ) : py_version = sys . version_info [ : 2 ] if ( py_version <= ( 3 , 2 ) ) : return ( 4 if import_hook else 2 ) elif ( py_version == ( 3 , 3 ) ) : return ( 8 if import_hook else 10 ) elif ( py_version == ( 3 , 4 ) ) : return ( 10 if import_hook else 8 ) else : return ( 4 if import_hook else 2 )
returns the stacklevel value for warnings .