def get_bitsight_data_into_sentinel(self):
        """Fetch data from BitSight and post it to Sentinel."""
        try:
            if not self.check_env_var:
                raise BitSightException(
                    "{} {} Some Environment variables are not set hence exiting the app.".format(
                        self.logs_starts_with, ALERT_GRAPH_STATISTICS_FUNC_NAME
                    )
                )

            applogger.info(
                "{} {} Fetching companies from companies table.".format(
                    self.logs_starts_with, ALERT_GRAPH_STATISTICS_FUNC_NAME
                )
            )
            logs_data, flag = get_logs_data()
            if not flag:
                applogger.info(
                    "{} {} Companies are not available yet.".format(
                        self.logs_starts_with, ALERT_GRAPH_STATISTICS_FUNC_NAME
                    )
                )
                return
            applogger.info(
                "{} {} Fetched companies from companies table.".format(
                    self.logs_starts_with, ALERT_GRAPH_STATISTICS_FUNC_NAME
                )
            )
            logs_data = sorted(logs_data, key=lambda x: x["name_s"])
            company_names = [data["name_s"] for data in logs_data]
            if (self.companies_str.strip()).lower() == "all":
                self.get_all_copmanies_alerts_graph_statisctics_details(
                    logs_data, company_names
                )
            else:
                self.get_specified_companies_alerts_graph_statisctics_details(
                    logs_data, company_names
                )
        except BitSightException:
            raise BitSightException()
        except Exception as err:
            applogger.exception(
                "{} {} Error: {}".format(
                    self.logs_starts_with, ALERT_GRAPH_STATISTICS_FUNC_NAME, err
                )
            )
            raise BitSightException()
Fetch data from BitSight and post it to Sentinel.
Solutions/BitSight/Data Connectors/BitSightDataConnector/AlertsGraphStatisticsDetails/bitsight_statistics.py