code: def declare_experts(
      dht: DHT,
      uids: Sequence[ExpertUID],
      expiration_time: DHTExpiration,
      wait: bool = True,
  ) -> Union[Dict[ExpertUID, bool], MPFuture[Dict[ExpertUID, bool]]]:
      """
      Make experts visible to all DHT peers; update timestamps if declared previously.
  
      :param uids: a list of expert ids to update
      :param wait: if True, awaits for declaration to finish, otherwise runs in background
      :param expiration_time: experts will be visible for this many seconds
      :returns: if wait, returns store status for every key (True = store succeeded, False = store rejected)
      """
      assert not isinstance(
          uids, str
      ), "Please send a list / tuple of expert uids."
      if not isinstance(uids, list):
          uids = list(uids)
      for uid in uids:
          assert is_valid_uid(
              uid
          ), f"{uid} is not a valid expert uid. All uids must follow {UID_PATTERN.pattern}"
      return dht.run_coroutine(
          partial(
              _declare_experts,
              uids=uids,
              expiration_time=expiration_time,
          ),
          return_future=not wait,
      )
  
file_path: hivemind/hivemind/moe/server/dht_handler.py
imports: import threading
  from functools import partial
  from typing import Dict, List, Optional, Sequence, Tuple, Union
  from hivemind.dht import DHT, DHTNode, DHTValue
  from hivemind.moe.client.expert import RemoteExpert, create_remote_experts
  from hivemind.moe.expert_uid import FLAT_EXPERT, UID_DELIMITER, UID_PATTERN, Coordinate, ExpertInfo, ExpertPrefix, ExpertUID, is_valid_uid, split_uid
  from hivemind.p2p import PeerID
  from hivemind.utils import MAX_DHT_TIME_DISCREPANCY_SECONDS, DHTExpiration, MPFuture, get_dht_time
label_desc: Use image node_id 1 for calling a global function with example usage: declare_experts(dht, uids, expiration_time, wait) and returns: dht