code: def _rewrite_interpreter(self, path):
          
          key = u'ansible_%s_interpreter' % os.path.basename(path).strip()
          try:
              template = self._inv.task_vars[key]
          except KeyError:
              return path
  
          return mitogen.utils.cast(self._inv.templar.template(template))
docs: Given the original interpreter binary extracted from the script's
          interpreter line, look up the associated `ansible_*_interpreter`
          variable, render it and return it.
  
          :param str path:
              Absolute UNIX path to original interpreter.
  
          :returns:
              Shell fragment prefix used to execute the script via "/bin/sh -c".
              While `ansible_*_interpreter` documentation suggests shell isn't
              involved here, the vanilla implementation uses it and that use is
              exploited in common playbooks.