class_docstr: Base for classes that configure access to secured resources.
  
  Attributes
  ----------
  credentials : dict
      Keys and values for session credentials.
  
  Notes
  -----
  This class is not intended to be instantiated.
class_docstr_tok: ["Base","for","classes","that","configure","access","to","secured","resources",".","Attributes","--","--","--","--","--","credentials",":","dict","Keys","and","values","for","session","credentials",".","Notes","--","--","-","This","class","is","not","intended","to","be","instantiated","."]
docstr: Create a session object suited to the environment.
  
  Parameters
  ----------
  path : str
      A dataset path or identifier.
  args : sequence
      Positional arguments for the foreign session constructor.
  kwargs : dict
      Keyword arguments for the foreign session constructor.
  
  Returns
  -------
  Session
docstr_tok: ["Create","a","session","object","suited","to","the","environment",".","Parameters","--","--","--","--","--","path",":","str","A","dataset","path","or","identifier",".","args",":","sequence","Positional","arguments","for","the","foreign","session","constructor",".","kwargs",":","dict","Keyword","arguments","for","the","foreign","session","constructor",".","Returns","--","--","--","-","Session"]
code: def from_environ(*args, **kwargs):
      """Create a session object suited to the environment.
  
      Parameters
      ----------
      path : str
          A dataset path or identifier.
      args : sequence
          Positional arguments for the foreign session constructor.
      kwargs : dict
          Keyword arguments for the foreign session constructor.
  
      Returns
      -------
      Session
  
      """
      try:
          session = Session.aws_or_dummy(*args, **kwargs)
          session.credentials
      except RuntimeError as exc:
          log.warning(
              "Credentials in environment have expired. Creating a DummySession."
          )
          session = DummySession(*args, **kwargs)
      return session
  
imports: import logging
  import os
  from types import SimpleNamespace
  from rasterio._path import _parse_path, _UnparsedPath
label_desc: Use image node_id 7 for calling the Session obj's underlying member method code with example usage: obj.from_environ() and returns: session