code: def import_(target: str, allow_none: bool = False) -> Any:
      if target is None:
          return None
      path, identifier = target.rsplit(".", 1)
      module = __import__(path, globals(), locals(), [identifier])
      return getattr(module, identifier)
  
file_path: nni/nni/nas/utils/misc.py
imports: import inspect
  import itertools
  import warnings
  from collections import defaultdict
  from contextlib import contextmanager
  from typing import Any, List, cast
  from pathlib import Path
label_desc: Use image node_id 1 for calling a global function with example usage: import_(target, allow_none) and returns: getattr, None