<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_sec_project_activity(self):
 """ Generate the "project activity" section of the report. """


        logger.debug("Calculating Project Activity metrics.")

        data_path = os.path.join(self.data_dir, "activity")
        if not os.path.exists(data_path):
            os.makedirs(data_path)

        for ds in self.data_sources:
            metric_file = self.ds2class[ds]
            metric_index = self.get_metric_index(ds)
            project_activity = metric_file.project_activity(metric_index, self.start_date,
                                                            self.end_date)
            headers = []
            data_frames = []
            title_names = []
            file_name = ""
            for metric in project_activity['metrics']:
                file_name += metric.DS_NAME + "_" + metric.id + "_"
                title_names.append(metric.name)
                headers.append(metric.id)
                data_frames.append(metric.timeseries(dataframe=True))

            file_name = file_name[:-1]  # remove trailing underscore
            file_path = os.path.join(data_path, file_name)
            title_name = " & ".join(title_names) + ' per ' + self.interval
            self.create_csv_fig_from_df(data_frames, file_path, headers,
                                        fig_type="bar", title=title_name)