code: def to_set(params) -> set[tuple[str, Sequence[float]]]:
      entries = set()
      for path, module in params.items():
          for key, value in module.items():
              entries.add(
                  (
                      "/".join([path, key]),
                      tuple(jax.device_get(value).flatten()),
                  )
              )
      return entries
  
imports: import collections
  from collections.abc import Sequence
  import itertools
  import re
  import types
  from typing import Any, Callable
  from absl.testing import absltest
  from absl.testing import parameterized
  from haiku._src import basic
  from haiku._src import data_structures
  from haiku._src import filtering
  from haiku._src import transform
  import jax
  import jax.numpy
label_desc: Use image node_id 4 for calling a global function with example usage: to_set(params) and returns: entries