code: def can_construct_from_params(type_: Type) -> bool:
      if type_ in [str, int, float, bool]:
          return True
      origin = getattr(type_, "__origin__", None)
      if origin == Lazy:
          return True
      elif origin:
          if hasattr(type_, "from_params"):
              return True
          args = getattr(type_, "__args__")
          return all(can_construct_from_params(arg) for arg in args)
  
      return hasattr(type_, "from_params")
  
imports: import collections.abc
  from copy import deepcopy
  from pathlib import Path
  from typing import Any, Callable, cast, Dict, Iterable, List, Mapping, Set, Tuple, Type, TypeVar, Union, Optional
  import inspect
  import logging
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.lazy import Lazy
  from allennlp.common.params import Params
label_desc: Use image node_id 3 for calling a global function with example usage: can_construct_from_params(type_) and returns: hasattr, True, True, all, True