code: def login_to_hub() -> None:  # pragma: no cover
      """Login to huggingface hub"""
      access_token = get_token()
      if access_token is not None and get_token_permission(
          access_token
      ):
          logging.info("Huggingface Hub token found and valid")
          login(token=access_token, write_permission=True)
      else:
          login()
      # check if git lfs is installed
      try:
          subprocess.call(["git", "lfs", "version"])
      except FileNotFoundError:
          raise OSError(
              "Looks like you do not have git-lfs installed, please install. \
                        You can install from https://git-lfs.github.com/. \
                        Then run `git lfs install` (you only have to do this once)."
          )
  
file_path: doctr/doctr/models/factory/hub.py
imports: import json
  import logging
  import os
  import subprocess
  import textwrap
  from pathlib import Path
  from typing import Any
  from huggingface_hub import HfApi, Repository, get_token, get_token_permission, hf_hub_download, login, snapshot_download
  from doctr import models
  from doctr.file_utils import is_tf_available, is_torch_available
label_desc: Use image node_id 1 for calling a global function with example usage: login_to_hub() without return types