parameters: (min_version)
return_statement: return curr_version
docstring: Check installed bezel version is at least min_version.
  
    Args:
      min_version: string for minimum bazel version.
  
    Returns:
      The bazel version detected.
docstring_summary: Check installed bezel version is at least min_version.
docstring_tokens: Check installed bezel version is at least min_version .
function: def check_bazel_version(min_version):
    """Check installed bezel version is at least min_version.
  
    Args:
      min_version: string for minimum bazel version.
  
    Returns:
      The bazel version detected.
    """
    if which('bazel') is None:
      print('Cannot find bazel. Please install bazel.')
      sys.exit(0)
    curr_version = run_shell(['bazel', '--batch', 'version'])
  
    for line in curr_version.split('\n'):
      if 'Build label: ' in line:
        curr_version = line.split('Build label: ')[1]
        break
  
    min_version_int = convert_version_to_int(min_version)
    curr_version_int = convert_version_to_int(curr_version)
  
    # Check if current bazel version can be detected properly.
    if not curr_version_int:
      print('WARNING: current bazel installation is not a release version.')
      print('Make sure you are running at least bazel %s' % min_version)
      return curr_version
  
    print('You have bazel %s installed.' % curr_version)
  
    if curr_version_int < min_version_int:
      print('Please upgrade your bazel installation to version %s or higher to '
            'build TensorFlow!' % min_version)
      sys.exit(0)
    return curr_version
function_tokens: def check_bazel_version ( min_version ) : if which ( 'bazel' ) is None : print ( 'Cannot find bazel. Please install bazel.' ) sys . exit ( 0 ) curr_version = run_shell ( [ 'bazel' , '--batch' , 'version' ] ) for line in curr_version . split ( '\n' ) : if 'Build label: ' in line : curr_version = line . split ( 'Build label: ' ) [ 1 ] break min_version_int = convert_version_to_int ( min_version ) curr_version_int = convert_version_to_int ( curr_version ) # Check if current bazel version can be detected properly. if not curr_version_int : print ( 'WARNING: current bazel installation is not a release version.' ) print ( 'Make sure you are running at least bazel %s' % min_version ) return curr_version print ( 'You have bazel %s installed.' % curr_version ) if curr_version_int < min_version_int : print ( 'Please upgrade your bazel installation to version %s or higher to ' 'build TensorFlow!' % min_version ) sys . exit ( 0 ) return curr_version