code: def _sanitize_key(key: str) -> str:
      if not re.fullmatch("[a-zA-Z0-9_-]+", key):
          raise ValueError('"{}" is not a valid Sheets key'.format(key))
      return key
  
file_path: generative-ai-python/google/generativeai/notebook/sheets_id.py
imports: from __future__ import annotations
  import re
  from google.generativeai.notebook import sheets_sanitize_url
label_desc: Use image node_id 1 for calling a global function with example usage: _sanitize_key(key) and returns: key