keras/src/layers/reshaping/cropping3d.py/Cropping3D/__init__
class Cropping3D:    def __init__(
        self, cropping=((1, 1), (1, 1), (1, 1)), data_format=None, **kwargs
    ):
        super().__init__(**kwargs)
        self.data_format = backend.standardize_data_format(data_format)
        if isinstance(cropping, int):
            if cropping < 0:
                raise ValueError(
                    "`cropping` cannot be negative. "
                    f"Received: cropping={cropping}."
                )
            self.cropping = (
                (cropping, cropping),
                (cropping, cropping),
                (cropping, cropping),
            )
        elif hasattr(cropping, "__len__"):
            if len(cropping) != 3:
                raise ValueError(
                    f"`cropping` should have 3 elements. Received: {cropping}."
                )
            dim1_cropping = argument_validation.standardize_tuple(
                cropping[0], 2, "1st entry of cropping", allow_zero=True
            )
            dim2_cropping = argument_validation.standardize_tuple(
                cropping[1], 2, "2nd entry of cropping", allow_zero=True
            )
            dim3_cropping = argument_validation.standardize_tuple(
                cropping[2], 2, "3rd entry of cropping", allow_zero=True
            )
            self.cropping = (dim1_cropping, dim2_cropping, dim3_cropping)
        else:
            raise ValueError(
                "`cropping` should be either an int, a tuple of 3 ints "
                "(symmetric_dim1_crop, symmetric_dim2_crop, "
                "symmetric_dim3_crop), "
                "or a tuple of 3 tuples of 2 ints "
                "((left_dim1_crop, right_dim1_crop),"
                " (left_dim2_crop, right_dim2_crop),"
                " (left_dim3_crop, right_dim2_crop)). "
                f"Received: {cropping}."
            )
        self.input_spec = InputSpec(ndim=5)