<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _make_autoenv(self, action):
 """ Generate a suitable env variable for this action. This is dependant on our subcommand hierarchy. Review the prog setter for details. """

        env = ('%s_%s' % (self.prog, action.dest)).upper()
        env = re.sub(self.env_scrub_re, '', env.strip())
        env = re.sub(self.env_flatten_re, '_', env)
        if re.match('^[0-9]', env):
            # Handle leading numbers.
            env = '_%s' % env
        return env