<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def crop(self, area=None, ll_bbox=None, xy_bbox=None, dataset_ids=None):
 """Crop Scene to a specific Area boundary or bounding box. Args: area (AreaDefinition):
 Area to crop the current Scene to ll_bbox (tuple, list):
 4-element tuple where values are in lon/lat degrees. Elements are ``(xmin, ymin, xmax, ymax)`` where X is longitude and Y is latitude. xy_bbox (tuple, list):
 Same as `ll_bbox` but elements are in projection units. dataset_ids (iterable):
 DatasetIDs to include in the returned `Scene`. Defaults to all datasets. This method will attempt to intelligently slice the data to preserve relationships between datasets. For example, if we are cropping two DataArrays of 500m and 1000m pixel resolution then this method will assume that exactly 4 pixels of the 500m array cover the same geographic area as a single 1000m pixel. It handles these cases based on the shapes of the input arrays and adjusting slicing indexes accordingly. This method will have trouble handling cases where data arrays seem related but don't cover the same geographic area or if the coarsest resolution data is not related to the other arrays which are related. It can be useful to follow cropping with a call to the native resampler to resolve all datasets to the same resolution and compute any composites that could not be generated previously:: .. note:: The `resample` method automatically crops input data before resampling to save time/memory. """

        if len([x for x in [area, ll_bbox, xy_bbox] if x is not None]) != 1:
            raise ValueError("One and only one of 'area', 'll_bbox', "
                             "or 'xy_bbox' can be specified.")

        new_scn = self.copy(datasets=dataset_ids)
        if not new_scn.all_same_proj and xy_bbox is not None:
            raise ValueError("Can't crop when dataset_ids are not all on the "
                             "same projection.")

        # get the lowest resolution area, use it as the base of the slice
        # this makes sure that the other areas *should* be a consistent factor
        min_area = new_scn.min_area()
        if isinstance(area, str):
            area = get_area_def(area)
        new_min_area, min_y_slice, min_x_slice = self._slice_area_from_bbox(
            min_area, area, ll_bbox, xy_bbox)
        new_target_areas = {}
        for src_area, dataset_ids in new_scn.iter_by_area():
            if src_area is None:
                for ds_id in dataset_ids:
                    new_scn.datasets[ds_id] = self[ds_id]
                continue

            y_factor, y_remainder = np.divmod(float(src_area.shape[0]),
                                              min_area.shape[0])
            x_factor, x_remainder = np.divmod(float(src_area.shape[1]),
                                              min_area.shape[1])
            y_factor = int(y_factor)
            x_factor = int(x_factor)
            if y_remainder == 0 and x_remainder == 0:
                y_slice = slice(min_y_slice.start * y_factor,
                                min_y_slice.stop * y_factor)
                x_slice = slice(min_x_slice.start * x_factor,
                                min_x_slice.stop * x_factor)
                new_area = src_area[y_slice, x_slice]
                slice_key = {'y': y_slice, 'x': x_slice}
                new_scn._slice_datasets(dataset_ids, slice_key, new_area)
            else:
                new_target_areas[src_area] = self._slice_area_from_bbox(
                    src_area, area, ll_bbox, xy_bbox
                )

        return new_scn