code: def _validate_graph(graph, mandatory_fields, additional_message=None):
      for field in mandatory_fields:
          if getattr(graph, field) is None:
              message = "`{}` field cannot be None".format(field)
              if additional_message:
                  message += " " + format(additional_message)
              message += "."
              raise ValueError(message)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from graph_nets import _base
  from graph_nets import graphs
  from graph_nets import utils_tf
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_graph(graph, mandatory_fields, additional_message) without return types