code: def check_name(
      component: str, name: str, allow_leading_tilde: bool = False
  ):
      if allow_leading_tilde and component.startswith("~"):
          component = component[1:]
          if not component:
              # "~" is a valid component name (e.g. "foo/~/bar" is a valid name).
              return
  
      if not valid_identifier(component):
          raise ValueError(
              f"'{name}' is not a valid module name (must be a "
              "valid Python identifier)"
          )
  
imports: from collections.abc import Mapping
  import contextlib
  import functools
  import inspect
  import re
  from typing import Any, Callable, ContextManager, NamedTuple, Optional, Protocol, TypeVar
  from haiku._src import base
  from haiku._src import config
  from haiku._src import data_structures
  from haiku._src import utils
  import jax
  import jax.numpy
label_desc: Use image node_id 12 for calling a global function with example usage: check_name(component, name, allow_leading_tilde) without return types