def set_checkpoint_file_content(self, state: StateManager, content, company_flag):
        """Function update checkpoint file after getting corrupted data.

        Args:
            state (StateManager): StateManager instance.
            content (list): list of objects from Checkpoint Table for corresponding function.
            company_flag (bool): Flag indicating if the company name is requested.

        Raises:
            BitSightException: Raised for any exception during updating Checkpoint file.

        Returns:
            dict: dict object of checkpoint data.
            str: company name if company_flag is True
        """
        checkpoint_content = {}
        log_prefix = "SET CHECKPOINT FILE CONTENT"
        try:
            for data in content:
                val_val = data.get("Value_s")
                key_val = data.get("Key_g") or data.get("Key_s")
                if not key_val:
                    continue
                if "[" in val_val and "]" in val_val:
                    try:
                        checkpoint_content[key_val] = json.loads(val_val)
                    except json.JSONDecodeError:
                        applogger.error(
                            "{} {}: JSONDecodeError: Unable to loads JSON data for {} key from Sentinel table.".format(
                                LOGS_STARTS_WITH, log_prefix, key_val
                            )
                        )
                        continue
                elif "[" in val_val:
                    applogger.info(
                        "{} {}: Truncated data found for {} key from Sentinel table.".format(
                            LOGS_STARTS_WITH, log_prefix, key_val
                        )
                    )
                    updated_val = self.remove_truncated_data(val_val)
                    checkpoint_content[key_val] = updated_val
                else:
                    checkpoint_content[key_val] = val_val
            state.post(json.dumps(checkpoint_content))
            applogger.info(
                "{} {}: Checkpoint file data updated from corrupted data.".format(
                    LOGS_STARTS_WITH, log_prefix
                )
            )
            if company_flag:
                return val_val
            return checkpoint_content
        except Exception as error:
            applogger.error("{} {} Error: {}".format(LOGS_STARTS_WITH, log_prefix, error))
            raise BitSightException()
Function update checkpoint file after getting corrupted data.

        Args:
            state (StateManager): StateManager instance.
            content (list): list of objects from Checkpoint Table for corresponding function.
            company_flag (bool): Flag indicating if the company name is requested.

        Raises:
            BitSightException: Raised for any exception during updating Checkpoint file.

        Returns:
            dict: dict object of checkpoint data.
            str: company name if company_flag is True
        
Solutions/BitSight/Data Connectors/BitSightDataConnector/SharedCode/utils.py