code: def getenv(option, default=undefined, cast=undefined):
      
  
      # We can't avoid __contains__ because value may be empty.
      if option in os.environ:
          value = os.environ[option]
      else:
          if isinstance(default, Undefined):
              raise UndefinedValueError('{} not found. Declare it as envvar or define a default value.'.format(option))
  
          value = default
  
      if isinstance(cast, Undefined):
          return value
  
      if cast is bool:
          value = _cast_boolean(value)
      elif cast is list:
          value = [x for x in value.split(',') if x]
      else:
          value = cast(value)
  
      return value
docs: Return the value for option or default if defined.