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 matching the foreign `session`.
  
  Parameters
  ----------
  session : obj
      A foreign session object.
  cls : Session class, optional
      The class to return.
  
  Returns
  -------
  Session
docstr_tok: ["Create","a","session","object","matching","the","foreign","`","session","`",".","Parameters","--","--","--","--","--","session",":","obj","A","foreign","session","object",".","cls",":","Session","class",",","optional","The","class","to","return",".","Returns","--","--","--","-","Session"]
code: def from_foreign_session(session, cls=None):
      """Create a session object matching the foreign `session`.
  
      Parameters
      ----------
      session : obj
          A foreign session object.
      cls : Session class, optional
          The class to return.
  
      Returns
      -------
      Session
  
      """
      if not cls:
          return DummySession()
      else:
          return cls(session)
  
imports: import logging
  import os
  from types import SimpleNamespace
  from rasterio._path import _parse_path, _UnparsedPath
label_desc: Use image node_id 3 for calling the Session obj's underlying member method code with example usage: obj.from_foreign_session(session, cls) and returns: DummySession, cls