code: def NeedAll(op, g_output):
      """A sanity check to make sure that all the gradient are given."""
      for name, g in zip(op.output, g_output):
          if g is None:
              raise RuntimeError(
                  'Need gradient for "%s" but it is not provided.'
                  % name
              )
      return g_output
  
imports: from hypothesis import given, settings
  import hypothesis.strategies
  import unittest
  from caffe2.proto import caffe2_pb2
  from caffe2.python import core, test_util, workspace
  from caffe2.python.core import CreateOperator, GradientRegistry, IR
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: NeedAll(op, g_output) and returns: g_output