code: def check_id(id, type):
      """Check that the provided id is valid in Rapids language."""
      if id is None:
          return
      if id.strip() == "":
          raise H2OValueError(
              "%s id cannot be an empty string: %r" % (type, id)
          )
      for i, ch in enumerate(id):
          # '$' character has special meaning at the beginning of the string; and prohibited anywhere else
          if ch == "$" and i == 0:
              continue
          if ch not in _id_allowed_characters:
              raise H2OValueError(
                  "Character '%s' is illegal in %s id: %s"
                  % (ch, type, id)
              )
      if re.match(r"-?[0-9]", id):
          raise H2OValueError(
              "%s id cannot start with a number: %s" % (type, id)
          )
  
imports: from .compatibility import *
  import csv
  import contextlib
  import io
  import itertools
  import os
  import re
  import shutil
  import string
  import subprocess
  import sys
  import tempfile
  import zipfile
  from h2o.backend.server import H2OLocalServer
  from h2o.exceptions import H2OValueError
  from h2o.utils.typechecks import assert_is_type, is_type, numeric
  from h2o.utils.threading import local_env
label_desc: Use image node_id 3 for calling a global function with example usage: check_id(id, type) without return types