code: def change_rc(spark_home, spark_python, py4j):
      
  
      bashrc_location = os.path.expanduser("~/.bashrc")
  
      if os.path.isfile(bashrc_location):
          with open(bashrc_location, 'a') as bashrc:
              bashrc.write("\n# Added by findspark\n")
              bashrc.write("export SPARK_HOME=" + spark_home + "\n")
              bashrc.write("export PYTHONPATH=" + spark_python + ":" +
                           py4j + ":$PYTHONPATH\n\n")
docs: Persists changes to environment by changing shell config.
  
      Adds lines to .bashrc to set environment variables
      including the adding of dependencies to the system path. Will only
      edit this file if they already exist. Currently only works for bash.
  
      Parameters
      ----------
      spark_home : str
          Path to Spark installation.
      spark_python : str
          Path to python subdirectory of Spark installation.
      py4j : str
          Path to py4j library.