code: def test_alter_learning_rate_op(self, gc, dc):
      iter = np.random.randint(low=1, high=1e5, size=1)
      active_period = int(np.random.randint(low=1, high=1e3, size=1))
      inactive_period = int(np.random.randint(low=1, high=1e3, size=1))
      base_lr = float(np.random.random(1))
  
      def ref(iter):
          iter = float(iter)
          reminder = iter % (active_period + inactive_period)
          if reminder < active_period:
              return (np.array(base_lr),)
          else:
              return (np.array(0.0),)
  
      op = core.CreateOperator(
          "LearningRate",
          "iter",
          "lr",
          policy="alter",
          active_first=True,
          base_lr=base_lr,
          active_period=active_period,
          inactive_period=inactive_period,
      )
  
      self.assertReferenceChecks(gc, op, [iter], ref)
  
file_path: pytorch/caffe2/python/operator_test/learning_rate_op_test.py
imports: from caffe2.python import core
  import caffe2.python.hypothesis_test_util
  import caffe2.python.serialized_test.serialized_test_util
  from hypothesis import given, settings
  import hypothesis.strategies
  import copy
  from functools import partial
  import math
  import numpy
label_desc: Use image node_id 1 for calling the TestLearningRate obj's underlying member method code with example usage: obj.test_alter_learning_rate_op(gc, dc) and returns: np, np