def batch(self, iterable, n):
        """Yield data in batches of given size from list.

        Args:
            iterable (list): list to make batch of
            n (number): size of batches

        Yields:
            list: data in batches of size n
        """
        length_of_list = len(iterable)
        for ndx in range(0, length_of_list, n):
            yield iterable[ndx:min(ndx + n, length_of_list)]
Yield data in batches of given size from list.

        Args:
            iterable (list): list to make batch of
            n (number): size of batches

        Yields:
            list: data in batches of size n
        
Solutions/Dataminr Pulse/Data Connectors/DataminrPulseAlerts/DataminrPulseThreatIntelligence/dataminr_pulse_threat_intelligence.py