parameters: (v8_directory)
return_statement: return '.'.join(version_components)
docstring: Returns version number as string based on the string
    contents of version.cc file.
docstring_summary: Returns version number as string based on the string
    contents of version.cc file.
docstring_tokens: Returns version number as string based on the string contents of version . cc file .
function: def GetV8Version(v8_directory):
    """
    Returns version number as string based on the string
    contents of version.cc file.
    """
    with open(os.path.join(v8_directory, 'src', 'version.cc')) as version_file:
      version_contents = version_file.read()
  
    version_components = []
    for pattern in _V8_PATTERNS:
      version_components.append(pattern.search(version_contents).group(1).strip())
  
    if version_components[len(version_components) - 1] == '0':
      version_components.pop()
  
    return '.'.join(version_components)
function_tokens: def GetV8Version ( v8_directory ) : with open ( os . path . join ( v8_directory , 'src' , 'version.cc' ) ) as version_file : version_contents = version_file . read ( ) version_components = [ ] for pattern in _V8_PATTERNS : version_components . append ( pattern . search ( version_contents ) . group ( 1 ) . strip ( ) ) if version_components [ len ( version_components ) - 1 ] == '0' : version_components . pop ( ) return '.' . join ( version_components )