<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_image_module_info(module_or_spec, required=False):
 """Returns the module's attached ImageModuleInfo message, or None."""

  return module_or_spec.get_attached_message(
      IMAGE_MODULE_INFO_KEY, ImageModuleInfo, required=required)