original_docstring: Installs flatbuffers compiler, flatc.
  
    This requires us to download the flatbuffers repo, and run cmake.
  
    Args:
      temp_dir: Temporary directory for installing temporary flatbuffer files,
        such as the flatbuffers repository.
  
    Returns:
      Path to the downloaded and extracted repository.
    
docstring: Installs flatbuffers compiler, flatc.
  This requires us to download the flatbuffers repo, and run cmake.
docstring_tokens: Installs flatbuffers compiler flatc . This requires us to download the flatbuffers repo and run cmake .
code: def install_flatc(temp_dir):
    """Installs flatbuffers compiler, flatc.
  
    This requires us to download the flatbuffers repo, and run cmake.
  
    Args:
      temp_dir: Temporary directory for installing temporary flatbuffer files,
        such as the flatbuffers repository.
  
    Returns:
      Path to the downloaded and extracted repository.
    """
    flatbuffers_download_dir = os.path.join(temp_dir, 'flatbuffers')
    flatbuffers_repo_dir = os.path.abspath(os.path.join(
        flatbuffers_download_dir, 'flatbuffers-1.12.0'))
    if not os.path.exists(flatbuffers_download_dir):
      os.makedirs(flatbuffers_download_dir)
      file_name, _ = urllib.request.urlretrieve(
          _FLATBUFFERS_REPO, os.path.join(flatbuffers_download_dir,
                                          'flatbuffers.tar.gz'))
      flatbuffer_tar = tarfile.open(name=file_name)
      flatbuffer_tar.extractall(path=flatbuffers_download_dir)
      subprocess.check_call(
          ['cmake', '.'], cwd=flatbuffers_repo_dir)
      subprocess.check_call(
          ['cmake', '--build', '.', '--target', 'flatc', '-j'],
          cwd=flatbuffers_repo_dir)
    return flatbuffers_repo_dir
code_tokens: def install_flatc ( temp_dir ) : flatbuffers_download_dir = os . path . join ( temp_dir , 'flatbuffers' ) flatbuffers_repo_dir = os . path . abspath ( os . path . join ( flatbuffers_download_dir , 'flatbuffers-1.12.0' ) ) if not os . path . exists ( flatbuffers_download_dir ) : os . makedirs ( flatbuffers_download_dir ) file_name , _ = urllib . request . urlretrieve ( _FLATBUFFERS_REPO , os . path . join ( flatbuffers_download_dir , 'flatbuffers.tar.gz' ) ) flatbuffer_tar = tarfile . open ( name = file_name ) flatbuffer_tar . extractall ( path = flatbuffers_download_dir ) subprocess . check_call ( [ 'cmake' , '.' ] , cwd = flatbuffers_repo_dir ) subprocess . check_call ( [ 'cmake' , '--build' , '.' , '--target' , 'flatc' , '-j' ] , cwd = flatbuffers_repo_dir ) return flatbuffers_repo_dir
short_docstring: Installs flatbuffers compiler, flatc.
short_docstring_tokens: Installs flatbuffers compiler flatc .
comment: """Installs flatbuffers compiler, flatc.
  
    This requires us to download the flatbuffers repo, and run cmake.
  
    Args:
      temp_dir: Temporary directory for installing temporary flatbuffer files,
        such as the flatbuffers repository.
  
    Returns:
      Path to the downloaded and extracted repository.
    """