code: def canonicalize_env(env):
      """Windows requires that environment be dicts with str as keys and values
      This function converts any unicode entries for Windows only, returning the
      dictionary untouched in other environments.
  
      Parameters
      ----------
      env : dict
          environment dictionary with unicode or bytes keys and values
  
      Returns
      -------
      env : dict
          Windows: environment dictionary with str keys and values
          Other: untouched input ``env``
      """
      if os.name != "nt":
          return env
  
      out_env = {}
      for key, val in env.items():
          if not isinstance(key, str):
              key = key.decode("utf-8")
          if not isinstance(val, str):
              val = val.decode("utf-8")
          out_env[key] = val
      return out_env
  
imports: import sys
  import pickle
  import errno
  import subprocess
  import gzip
  import hashlib
  import locale
  from hashlib import md5
  import os
  import os.path
  import re
  import shutil
  import contextlib
  import posixpath
  from pathlib import Path
  import simplejson
  from time import sleep, time
  from ..None import logging, config, __version__
  from .misc import is_container
label_desc: Use image node_id 32 for calling a global function with example usage: canonicalize_env(env) and returns: out_env, env