code: def _deduplicate_user_agent(user_agent: str) -> str:
      """Deduplicate redundant information in the generated user-agent."""
      # Split around ";" > Strip whitespaces > Store as dict keys (ensure unicity) > format back as string
      # Order is implicitly preserved by dictionary structure (see https://stackoverflow.com/a/53657523).
      return "; ".join(
          {key.strip(): None for key in user_agent.split(";")}.keys()
      )
  
file_path: hub-client/src/huggingface_hub/utils/_headers.py
imports: from typing import Dict, Optional, Union
  from ..None import constants
  from ._runtime import get_fastai_version, get_fastcore_version, get_hf_hub_version, get_python_version, get_tf_version, get_torch_version, is_fastai_available, is_fastcore_available, is_tf_available, is_torch_available
  from ._token import get_token
  from ._validators import validate_hf_hub_args
label_desc: Use image node_id 5 for calling a global function with example usage: _deduplicate_user_agent(user_agent) and returns: str