code: def _refresh_compilers():
      """Scan installed PennyLane compiler packages to refresh the compilers
      names and entry points.
      """
  
      # Refresh the list of compilers
      AvailableCompilers.names_entrypoints = defaultdict(dict)
  
      # Iterator packages entry-points with the 'pennylane.compilers' group name
      entries = (
          defaultdict(dict, metadata.entry_points())[
              "pennylane.compilers"
          ]
          if version_info[:2] == (3, 9)
          # pylint:disable=unexpected-keyword-arg
          else metadata.entry_points(group="pennylane.compilers")
      )
  
      for entry in entries:
          # Only need name of the parent module
          module_name = entry.module.split(".")[0]
          AvailableCompilers.names_entrypoints[module_name][
              entry.name
          ] = entry
  
      # Check whether available compilers follow the entry_point interface
      # by validating that all entry points (qjit, context, and ops) are defined.
      for _, eps_dict in AvailableCompilers.names_entrypoints.items():
          ep_interface = AvailableCompilers.entrypoints_interface
          if any(ep not in eps_dict.keys() for ep in ep_interface):
              raise KeyError(
                  f"expected {ep_interface}, but recieved {eps_dict}"
              )
  
file_path: pennylane/pennylane/compiler/compiler.py
imports: from typing import List, Optional
  from sys import version_info
  from importlib import reload, metadata
  from collections import defaultdict
  import dataclasses
  import re
  from semantic_version import Version
label_desc: Use image node_id 2 for calling a global function with example usage: _refresh_compilers() without return types