<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_envvar_value(self):
 """ Internal helper to get item value from an environment variable if item is controlled by one, and if the variable is set. Returns not_set otherwise. """

        envvar_name = None

        if self.envvar is True:
            envvar_name = self.envvar_name
            if envvar_name is None:
                envvar_name = '_'.join(self.get_path()).upper()
        elif self.envvar:
            envvar_name = self.envvar

        if envvar_name and envvar_name in os.environ:
            return self.type.deserialize(os.environ[envvar_name])
        else:
            return not_set