code: def get_value(self, var, cast=None, default=NOTSET, parse_default=False):
          
  
          logger.debug("get '{0}' casted as '{1}' with default '{2}'".format(
              var, cast, default
          ))
  
          if var in self.scheme:
              var_info = self.scheme[var]
  
              try:
                  has_default = len(var_info) == 2
              except TypeError:
                  has_default = False
  
              if has_default:
                  if not cast:
                      cast = var_info[0]
  
                  if default is self.NOTSET:
                      try:
                          default = var_info[1]
                      except IndexError:
                          pass
              else:
                  if not cast:
                      cast = var_info
  
          try:
              value = self.ENVIRON[var]
          except KeyError:
              if default is self.NOTSET:
                  error_msg = "Set the {0} environment variable".format(var)
                  raise ImproperlyConfigured(error_msg)
  
              value = default
  
          # Resolve any proxied values
          if hasattr(value, 'startswith') and value.startswith('$'):
              value = value.lstrip('$')
              value = self.get_value(value, cast=cast, default=default)
  
          if cast is None and default is not None and not isinstance(default, NoValue):
              cast = type(default)
  
          if value != default or (parse_default and value):
              value = self.parse_value(value, cast)
  
          return value
docs: Return value for given environment variable.
  
          :param var: Name of variable.
          :param cast: Type to cast return value as.
          :param default: If var not present in environ, return this instead.
          :param parse_default: force to parse default..
  
          :returns: Value from environment or default (if set)