parameters: (dirname)
docstring: A context manager for operating in a different directory.
docstring_summary: A context manager for operating in a different directory.
docstring_tokens: A context manager for operating in a different directory .
function: def cwd(dirname):
      """A context manager for operating in a different directory."""
      orig = os.getcwd()
      os.chdir(dirname)
      try:
          yield orig
      finally:
          os.chdir(orig)
function_tokens: def cwd ( dirname ) : orig = os . getcwd ( ) os . chdir ( dirname ) try : yield orig finally : os . chdir ( orig )