code: def dataclass(cls=None, extra_fields=None, **kwargs):
      """Wrapper for dataclasses.dataclass that adds support for kw_only fields.
  
      Args:
        cls: The class to transform (or none to return a decorator).
        extra_fields: A list of `(name, type, Field)` tuples describing extra fields
          that should be added to the dataclass.  This is necessary for linen's
          use-case of this module, since the base class (linen.Module) is *not* a
          dataclass.  In particular, linen.Module class is used as the base for both
          frozen and non-frozen dataclass subclasses; but the frozen status of a
          dataclass must match the frozen status of any base dataclasses.
        **kwargs: Additional arguments for `dataclasses.dataclass`.
  
      Returns:
        `cls`.
      """
  
      def wrap(cls):
          return _process_class(
              cls, extra_fields=extra_fields, **kwargs
          )
  
      return wrap if cls is None else wrap(cls)
  
file_path: flax/flax/linen/kw_only_dataclasses.py
imports: import dataclasses
  import functools
  import inspect
  from types import MappingProxyType
  from typing import Any, TypeVar
  import typing_extensions
  import flax
label_desc: Use image node_id 2 for calling a global function with example usage: dataclass(cls, extra_fields) and returns: unknown, _process_class