parameters: (environ, env_var_subfolders)
return_statement: return lines
docstring: Generate shell code to reset environment variables
      by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
      This does not cover modifications performed by environment hooks.
docstring_summary: Generate shell code to reset environment variables
      by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
      This does not cover modifications performed by environment hooks.
docstring_tokens: Generate shell code to reset environment variables by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH . This does not cover modifications performed by environment hooks .
function: def rollback_env_variables(environ, env_var_subfolders):
      '''
      Generate shell code to reset environment variables
      by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
      This does not cover modifications performed by environment hooks.
      '''
      lines = []
      unmodified_environ = copy.copy(environ)
      for key in sorted(env_var_subfolders.keys()):
          subfolders = env_var_subfolders[key]
          if not isinstance(subfolders, list):
              subfolders = [subfolders]
          value = _rollback_env_variable(unmodified_environ, key, subfolders)
          if value is not None:
              environ[key] = value
              lines.append(assignment(key, value))
      if lines:
          lines.insert(0, comment('reset environment variables by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH'))
      return lines
function_tokens: def rollback_env_variables ( environ , env_var_subfolders ) : lines = [ ] unmodified_environ = copy . copy ( environ ) for key in sorted ( env_var_subfolders . keys ( ) ) : subfolders = env_var_subfolders [ key ] if not isinstance ( subfolders , list ) : subfolders = [ subfolders ] value = _rollback_env_variable ( unmodified_environ , key , subfolders ) if value is not None : environ [ key ] = value lines . append ( assignment ( key , value ) ) if lines : lines . insert ( 0 , comment ( 'reset environment variables by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH' ) ) return lines