code: def _to_native_string(string, encoding):
      if isinstance(string, builtin_str):
          return string
      if is_py2:
          return string.encode(encoding)
      return string.decode(encoding)
  
imports: from base64 import b64encode
  from requests.compat import builtin_str, is_py2
label_desc: Use image node_id 1 for calling a global function with example usage: _to_native_string(string, encoding) and returns: string, string, string