code: def _field_annotations_for_default_args(
      C: Any,
  ) -> List[Tuple[str, Any, dataclasses.Field]]:
      """
      If C is a function or a plain class with an __init__ function,
      return the fields which `enable_get_default_args(C)` will need
      to make a dataclass with.
  
      Args:
          C: a function, or a class with an __init__ function. Must
              have types for all its defaulted args.
  
      Returns:
          a list of fields for a dataclass.
      """
  
      field_annotations = []
      for pname, defval in _params_iter(C):
          default = defval.default
          if default == inspect.Parameter.empty:
              # we do not have a default value for the parameter
              continue
  
          if defval.annotation == inspect._empty:
              raise ValueError(
                  "All arguments of the input to enable_get_default_args have to"
                  f" be typed. Argument '{pname}' does not have a type annotation."
              )
  
          _, annotation = _resolve_optional(defval.annotation)
  
          if isinstance(
              default, set
          ):  # force OmegaConf to convert it to ListConfig
              default = tuple(default)
  
          if isinstance(default, (list, dict)):
              # OmegaConf will convert to [Dict|List]Config, so it is safe to reuse the value
              field_ = dataclasses.field(
                  default_factory=lambda default=default: default
              )
          elif not _is_immutable_type(annotation, default):
              continue
          else:
              # we can use a simple default argument for dataclass.field
              field_ = dataclasses.field(default=default)
          field_annotations.append((pname, defval.annotation, field_))
  
      return field_annotations
  
imports: import dataclasses
  import inspect
  import itertools
  import sys
  import warnings
  from collections import Counter, defaultdict
  from enum import Enum
  from functools import partial
  from typing import Any, Callable, Dict, get_args, get_origin, List, Optional, Tuple, Type, TypeVar, Union
  from omegaconf import DictConfig, OmegaConf, open_dict
label_desc: Use image node_id 7 for calling a global function with example usage: _field_annotations_for_default_args(C) and returns: field_annotations