code: def cd(new_directory, clean_up=lambda: True):  # pylint: disable=invalid-name
      
      previous_directory = os.getcwd()
      os.chdir(os.path.expanduser(new_directory))
      try:
          yield
      finally:
          os.chdir(previous_directory)
          clean_up()
docs: Changes into a given directory and cleans up after it is done
  
      Args:
          new_directory: The directory to change to
          clean_up: A method to clean up the working directory once done