async def separate_data_into_chunks(self, raw_data):
        """Async generator function to separate data into 15 mb chunks and return them.

        Args:
            raw_data (bytes): raw bytes data from the file.

        Yields:
            bytearray: separated chunks in bytearray.
        """
        __method_name = inspect.currentframe().f_code.co_name
        raw_data = raw_data[20:-46]
        main_bytearray = bytearray(raw_data)
        index = 0
        start_index = 0
        original_index = consts.ORIGINAL_INDEX
        number_of_iterations = ceil(len(main_bytearray) / original_index)
        end_index = original_index
        is_first_chunk = True
        for _ in range(number_of_iterations):
            if len(main_bytearray) < end_index:
                chunk = main_bytearray[start_index:len(main_bytearray)]
                if not is_first_chunk:
                    chunk.insert(0, 91)
                yield chunk
                break

            chunk2 = bytearray()
            chunk = main_bytearray[start_index:end_index]
            if not is_first_chunk:
                chunk.insert(0, 91)  # adding square bracket to start of bytearray
            index = end_index
            open_brac_counter = 0
            read_counter = 0
            while True:
                if chr(main_bytearray[index]) == "{":
                    if read_counter == 0:
                        open_brac_counter = -1
                        read_counter += 1
                    open_brac_counter += 1
                if chr(main_bytearray[index]) == "}":
                    if read_counter == 0:
                        read_counter += 1
                    open_brac_counter -= 1
                chunk2.append(main_bytearray[index])
                index += 1
                if open_brac_counter < 0:
                    try:
                        chunk2.append(93)
                        json.loads(chunk + chunk2)
                        break
                    except Exception:
                        applogger.error(
                            "{}(method={}) : {} ({}) : Error while loading the json in split data, continuing.".format(
                                consts.LOGS_STARTS_WITH,
                                __method_name,
                                consts.NETSKOPE_AZURE_STORAGE_TO_SENTINEL,
                                self.nskp_data_type_for_logging,
                            )
                        )
                        open_brac_counter = 0
                        chunk2.pop()
            chunk3 = chunk + chunk2
            index += 2
            start_index = index
            end_index = start_index + original_index
            is_first_chunk = False
            yield chunk3
Async generator function to separate data into 15 mb chunks and return them.

        Args:
            raw_data (bytes): raw bytes data from the file.

        Yields:
            bytearray: separated chunks in bytearray.
        
Solutions/Netskopev2/Data Connectors/NetskopeDataConnector/StorageToSentinel/netskope_azure_storage_to_sentinel.py