class_docstr: Abstraction for GDAL and AWS configuration
  
  The GDAL library is stateful: it has a registry of format drivers,
  an error stack, and dozens of configuration options.
  
  Rasterio's approach to working with GDAL is to wrap all the state
  up using a Python context manager (see PEP 343,
  https://www.python.org/dev/peps/pep-0343/). When the context is
  entered GDAL drivers are registered, error handlers are
  configured, and configuration options are set. When the context
  is exited, drivers are removed from the registry and other
  configurations are removed.
  
  Example
  -------
  .. code-block:: python
  
      with rasterio.Env(GDAL_CACHEMAX=128000000) as env:
          # All drivers are registered, GDAL's raster block cache
          # size is set to 128 MB.
          # Commence processing...
          ...
          # End of processing.
  
      # At this point, configuration options are set to their
      # previous (possible unset) values.
  
  A boto3 session or boto3 session constructor arguments
  `aws_access_key_id`, `aws_secret_access_key`, `aws_session_token`
  may be passed to Env's constructor. In the latter case, a session
  will be created as soon as needed. AWS credentials are configured
  for GDAL as needed.
class_docstr_tok: ["Abstraction","for","GDAL","and","AWS","configuration","The","GDAL","library","is","stateful",":","it","has","a","registry","of","format","drivers",",","an","error","stack",",","and","dozens","of","configuration","options",".","Rasterio","'s","approach","to","working","with","GDAL","is","to","wrap","all","the","state","up","using","a","Python","context","manager","(","see","PEP","343",",","https",":","\/\/www.python.org\/dev\/peps\/pep-0343\/",")",".","When","the","context","is","entered","GDAL","drivers","are","registered",",","error","handlers","are","configured",",","and","configuration","options","are","set",".","When","the","context","is","exited",",","drivers","are","removed","from","the","registry","and","other","configurations","are","removed",".","Example","--","--","--","-","..","code-block",":",":","python","with","rasterio.Env","(","GDAL_CACHEMAX=128000000",")","as","env",":","#","All","drivers","are","registered",",","GDAL","'s","raster","block","cache","#","size","is","set","to","128","MB",".","#","Commence","processing","...","...","#","End","of","processing",".","#","At","this","point",",","configuration","options","are","set","to","their","#","previous","(","possible","unset",")","values",".","A","boto3","session","or","boto3","session","constructor","arguments","`","aws_access_key_id","`",",","`","aws_secret_access_key","`",",","`","aws_session_token","`","may","be","passed","to","Env","'s","constructor",".","In","the","latter","case",",","a","session","will","be","created","as","soon","as","needed",".","AWS","credentials","are","configured","for","GDAL","as","needed","."]
docstr: Get credentials and configure GDAL
  
  Note well: this method is a no-op if the GDAL environment
  already has credentials, unless session is not None.
  
  Returns
  -------
  None
docstr_tok: ["Get","credentials","and","configure","GDAL","Note","well",":","this","method","is","a","no-op","if","the","GDAL","environment","already","has","credentials",",","unless","session","is","not","None",".","Returns","--","--","--","-","None"]
code: def credentialize(self):
      """Get credentials and configure GDAL
  
      Note well: this method is a no-op if the GDAL environment
      already has credentials, unless session is not None.
  
      Returns
      -------
      None
  
      """
      cred_opts = self.session.get_credential_options()
      self.options.update(**cred_opts)
      setenv(**cred_opts)
  
      if getattr(self, "_session_from_environ", False):
          # if self.context_options has "AWS_*" credentials from parent context then it should
          # always override what comes back from self.session.get_credential_options()
          # b/c __init__ might have created a session from globally exported "AWS_*" os environ variables
          parent_context_creds = self.aws_creds_from_context_options()
          if not parent_context_creds:
              return
          self.options.update(**parent_context_creds)
          setenv(**parent_context_creds)
  
imports: from functools import wraps, total_ordering
  from inspect import getfullargspec
  import logging
  import os
  import re
  import threading
  import warnings
  import attr
  from rasterio._env import GDALEnv, get_gdal_config, set_gdal_config, GDALDataFinder, PROJDataFinder, set_proj_data_search_path
  from rasterio._version import gdal_version
  from rasterio.errors import EnvError, GDALVersionError, RasterioDeprecationWarning
  from rasterio.session import Session, DummySession
label_desc: Use image node_id 5 for calling the Env obj's underlying member method code with example usage: obj.credentialize() without return types