code: def _get_param_annotation(p):
      # if not annotated, infer type from default
      if (
          p.annotation == Parameter.empty
          and p.default == Parameter.empty
      ):
          raise ValueError(
              f"Param {p}: both annotation and default are empty, "
              "so cannot infer any useful annotation."
          )
      if p.annotation != Parameter.empty:
          return p.annotation
      # case on default types
      if p.default is None:
          raise ValueError(
              f"Param {p}: default is None and annotation is empty, "
              "cannot infer useful annotation"
          )
      if isinstance(p.default, tuple):
          raise ValueError(
              f"Param {p}: default is tuple, cannot infer type"
          )
      if isinstance(p.default, dict):
          raise ValueError(
              f"Param{p}: default is tuple, cannot infer type"
          )
      return type(p.default)
  
file_path: ReAgent/reagent/core/configuration.py
imports: import functools
  from dataclasses import Field, fields, MISSING
  from inspect import isclass, Parameter, signature
  from typing import List, Optional, Type, Union
  from reagent.core.dataclasses import dataclass
  from torch import nn
label_desc: Use image node_id 1 for calling a global function with example usage: _get_param_annotation(p) and returns: type, p