code: def render_template(content, variables):
      
      fsenc = sys.getfilesystemencoding()
  
      def to_native(s, encoding='latin-1', errors='strict'):
          if six.PY3:
              if isinstance(s, six.text_type):
                  return s
              return str(s, encoding, errors)
          else:
              if isinstance(s, six.text_type):
                  return s.encode(encoding, errors)
              return str(s)
  
      output = Template(
          to_native(content, fsenc)
      ).substitute(variables)
      if isinstance(output, six.text_type):
          output = output.encode(fsenc, 'strict')
      return output
docs: Return a bytestring representing a templated file based on the
      input (content) and the variable names defined (vars).