def _filter_input_output_shapes()

in src/sagemaker_core/tools/shapes_codegen.py [0:0]


    def _filter_input_output_shapes(self, shape):
        """
        Filters out shapes that are used as input or output for operations.

        :param shape: The name of the shape.
        :return: True if the shape should be generated, False otherwise.
        """
        operation_input_output_shapes = set()
        for operation, attrs in self.combined_operations.items():
            if attrs.get("input"):
                operation_input_output_shapes.add(attrs["input"]["shape"])
            if attrs.get("output"):
                operation_input_output_shapes.add(attrs["output"]["shape"])

        required_output_shapes = set()
        for resource_name in self.resource_methods:
            for method in self.resource_methods[resource_name].values():
                required_output_shapes.add(method.return_type)

        if shape in operation_input_output_shapes and shape not in required_output_shapes:
            return False
        return True