code: def dump_profiles(self, path):
          
          if self.profiler_collector is not None:
              self.profiler_collector.dump_profiles(path)
          else:
              raise RuntimeError("'spark.python.profile' configuration must be set "
                                 "to 'true' to enable Python profile.")
docs: Dump the profile stats into directory `path`