code: def make_workspace(
      input_pixels, crop_image=None, cropping=None, crop_objects=None
  ):
      """Return a workspace with the given images installed and the crop module"""
      image_set_list = cellprofiler_core.image.ImageSetList()
      image_set = image_set_list.get_image_set(0)
      module = cellprofiler.modules.crop.Crop()
      module.set_module_num(1)
      image_set.add(
          INPUT_IMAGE, cellprofiler_core.image.Image(input_pixels)
      )
      module.image_name.value = INPUT_IMAGE
      module.cropped_image_name.value = OUTPUT_IMAGE
      if crop_image is not None:
          image_set.add(
              CROP_IMAGE, cellprofiler_core.image.Image(crop_image)
          )
          module.image_mask_source.value = CROP_IMAGE
      if cropping is not None:
          image_set.add(
              CROPPING,
              cellprofiler_core.image.Image(
                  numpy.zeros(cropping.shape), crop_mask=cropping
              ),
          )
          module.cropping_mask_source.value = CROPPING
      object_set = cellprofiler_core.object.ObjectSet()
      if crop_objects is not None:
          objects = cellprofiler_core.object.Objects()
          objects.segmented = crop_objects
          object_set.add_objects(objects, CROP_OBJECTS)
  
      pipeline = cellprofiler_core.pipeline.Pipeline()
  
      def callback(caller, event):
          assert not isinstance(
              event, cellprofiler_core.pipeline.event.RunException
          )
  
      pipeline.add_listener(callback)
      pipeline.add_module(module)
      m = cellprofiler_core.measurement.Measurements()
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline, module, image_set, object_set, m, image_set_list
      )
      m.add_measurement(
          "Image",
          GROUP_INDEX,
          0,
          image_set_number=1,
      )
      m.add_measurement(
          "Image",
          GROUP_NUMBER,
          1,
          image_set_number=1,
      )
      return workspace, module
  
imports: import numpy
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  from cellprofiler_core.constants.measurement import GROUP_INDEX, GROUP_NUMBER, COLTYPE_INTEGER
  import cellprofiler.modules.crop
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.workspace
label_desc: Use image node_id 1 for calling a global function with example usage: make_workspace(input_pixels, crop_image, cropping, crop_objects) and returns: workspace,  module