code: def get_env_variable(var_name, default=None):
      
      try:
          return os.environ[var_name]
      except KeyError:
          if default is not None:
              return default
          else:
              error_msg = 'The environment variable {} was missing, abort...'\
                          .format(var_name)
              raise EnvironmentError(error_msg)
docs: Get the environment variable or raise exception.