parameters: (newdir)
docstring: http://stackoverflow.com/questions/431684/how-do-i-cd-in-python
docstring_summary: http://stackoverflow.com/questions/431684/how-do-i-cd-in-python
docstring_tokens: http : // stackoverflow . com / questions / 431684 / how - do - i - cd - in - python
function: def cd(newdir):
      """
      http://stackoverflow.com/questions/431684/how-do-i-cd-in-python
      """
      prevdir = os.getcwd()
      os.chdir(newdir)
      try:
          yield
      finally:
          os.chdir(prevdir)
function_tokens: def cd ( newdir ) : prevdir = os . getcwd ( ) os . chdir ( newdir ) try : yield finally : os . chdir ( prevdir )