<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def normalize(self):
 """ Normalizes environment variables and the Python path. This method first updates the environment variables (``os.environ``). Then, it normalizes the Python path (``sys.path``) by resolving all references to the user directory and environment variables. """

        # Normalize configuration
        self.__state.normalize()

        # Update sys.path, avoiding duplicates
        whole_path = list(self.__state.paths)
        whole_path.extend(sys.path)

        # Ensure the working directory as first search path
        sys.path = ["."]
        for path in whole_path:
            if path not in sys.path:
                sys.path.append(path)