code: def test_categorize_handlers():
      class CustomHandler1(TrainBegin):
          def train_begin(self):
              print("custom train begin")
  
      class CustomHandler2(EpochBegin, BatchBegin, TrainEnd):
          def epoch_begin(self):
              print("custom epoch begin")
  
          def batch_begin(self):
              print("custom batch begin")
  
          def train_end(self):
              print("custom train end")
  
      class CustomHandler3(EpochBegin, BatchBegin, BatchEnd, TrainEnd):
          def epoch_begin(self):
              print("custom epoch begin")
  
          def batch_begin(self):
              print("custom batch begin")
  
          def batch_end(self):
              print("custom batch end")
  
          def train_end(self):
              print("custom train end")
  
      net = nn.Sequential()
      net.add(nn.Dense(10))
      loss = gluon.loss.SoftmaxCrossEntropyLoss()
      est = Estimator(net, loss=loss)
      event_handlers = [
          CustomHandler1(),
          CustomHandler2(),
          CustomHandler3(),
      ]
      (
          train_begin,
          epoch_begin,
          batch_begin,
          batch_end,
          epoch_end,
          train_end,
      ) = est._categorize_handlers(event_handlers)
      assert len(train_begin) == 1
      assert len(epoch_begin) == 2
      assert len(batch_begin) == 2
      assert len(batch_end) == 1
      assert len(train_end) == 2
  
imports: import sys
  import unittest
  import warnings
  import pytest
  import mxnet
  from mxnet import gluon
  from mxnet.gluon import nn
  from mxnet.gluon.contrib.estimator import *
  from mxnet.gluon.contrib.estimator.event_handler import *
label_desc: Use image node_id 10 for calling a global function with example usage: test_categorize_handlers() without return types