def _generate_data(self,
                       batch_size: int = 1,
                       num_keypoints: int = 5,
                       norm_item: str = 'box_size') -> tuple:
        """Generate data_batch and data_samples according to different
        settings."""
        data_batch = []
        data_samples = []

        for i in range(batch_size):
            gt_instances = InstanceData()
            keypoints = np.zeros((1, num_keypoints, 2))
            keypoints[0, i] = [0.5 * i, 0.5 * i]
            gt_instances.keypoints = keypoints
            gt_instances.keypoints_visible = np.ones(
                (1, num_keypoints, 1)).astype(bool)
            gt_instances.keypoints_visible[0, (2 * i) % batch_size, 0] = False
            gt_instances[norm_item] = np.random.random((1, 1)) * 20 * i

            pred_instances = InstanceData()
            pred_instances.keypoints = keypoints

            data = {'inputs': None}
            data_sample = {
                'gt_instances': gt_instances.to_dict(),
                'pred_instances': pred_instances.to_dict(),
            }
            data_batch.append(data)
            data_samples.append(data_sample)

        return data_batch, data_samples
Generate data_batch and data_samples according to different
        settings.
mmpose/tests/test_evaluation/test_metrics/test_keypoint_2d_metrics.py