code: def _make_env_vars(self, function):
          
  
          name = function.name
  
          variables = None
          if function.environment and isinstance(function.environment, dict) and "Variables" in function.environment:
              variables = function.environment["Variables"]
          else:
              LOG.debug("No environment variables found for function '%s'", name)
  
          # This could either be in standard format, or a CloudFormation parameter file format.
          #
          # Standard format is {FunctionName: {key:value}, FunctionName: {key:value}}
          # CloudFormation parameter file is {"Parameters": {key:value}}
  
          for env_var_value in self.env_vars_values.values():
              if not isinstance(env_var_value, dict):
                  reason = """
                              Environment variables must be in either CloudFormation parameter file
                              format or in {FunctionName: {key:value}} JSON pairs
                              """
                  LOG.debug(reason)
                  raise OverridesNotWellDefinedError(reason)
  
          if "Parameters" in self.env_vars_values:
              LOG.debug("Environment variables overrides data is in CloudFormation parameter file format")
              # CloudFormation parameter file format
              overrides = self.env_vars_values["Parameters"]
          else:
              # Standard format
              LOG.debug("Environment variables overrides data is standard format")
              overrides = self.env_vars_values.get(name, None)
  
          shell_env = os.environ
          aws_creds = self.get_aws_creds()
  
          return EnvironmentVariables(function.memory,
                                      function.timeout,
                                      function.handler,
                                      variables=variables,
                                      shell_env_values=shell_env,
                                      override_values=overrides,
                                      aws_creds=aws_creds)
docs: Returns the environment variables configuration for this function
  
          Parameters
          ----------
          function : samcli.commands.local.lib.provider.Function
              Lambda function to generate the configuration for
  
          Returns
          -------
          samcli.local.lambdafn.env_vars.EnvironmentVariables
              Environment variable configuration for this function
  
          Raises
          ------
          samcli.commands.local.lib.exceptions.OverridesNotWellDefinedError
              If the environment dict is in the wrong format to process environment vars