code: def random(key, request):
      if key.startswith("chars_") and key.split("chars_")[-1].isdigit():
          num_chars = int(key.split("chars_")[-1])
          if num_chars % 2 == 1:
              urandom_len = (num_chars + 1) / 2
          else:
              urandom_len = num_chars / 2
          return os.urandom(int(urandom_len)).hex()[:num_chars]
      else:
          raise KeyError
  
file_path: datasette/datasette/default_magic_parameters.py
imports: from datasette import hookimpl
  import datetime
  import os
  import time
label_desc: Use image node_id 5 for calling a global function with example usage: random(key, request) and returns: os