code: def _b(string, codec=None):
      """convert string to bytes using the given codec (default is 'ascii')"""
      if codec is False or not hasattr(string, "encode"):
          return string
      return string.encode(codec or "ascii")
  
imports: import os
label_desc: Use image node_id 2 for calling a global function with example usage: _b(string, codec) and returns: string, string