def iterate_references(config, to=None):
for value in _iterate_flattened_values(config):<EOL><INDENT>if isinstance(value, ConfigurableReference):<EOL><INDENT>if to is None or value.configurable.fn_or_cls == to:<EOL><INDENT>yield value<EOL><DEDENT><DEDENT><DEDENT>
Provides an iterator over references in the given config.

    Args:
      config: A dictionary mapping scoped configurable names to argument bindings.
      to: If supplied, only yield references whose `configurable_fn` matches `to`.

    Yields:
      `ConfigurableReference` instances within `config`, maybe restricted to those
      matching the `to` parameter if it is supplied.