def function(
        input_specs: Optional[List[Placeholder]] = None,
        opset_version: Optional[AvailableTarget] = None,
    ):
        """
        The ``mb.function`` decorator creates a MIL function.

        Parameters
        ----------
        input_specs: List[TensorSpec]
            Describes the function inputs

        opset_version: AvailableTarget enum
            Describes the opset version of the function

        Examples
        --------
        >>> import coremltools as ct
        >>> @mb.function(input_specs=[mb.TensorSpec(shape=(1,2))], opset_version=ct.target.iOS16)
        >>> def func(a):
        >>>     return mb.add(x=a, y=2)

        """
        def wrapper(main_block):
            return Builder._create_function(main_block, input_specs, opset_version)

        return wrapper

        The ``mb.function`` decorator creates a MIL function.

        Parameters
        ----------
        input_specs: List[TensorSpec]
            Describes the function inputs

        opset_version: AvailableTarget enum
            Describes the opset version of the function

        Examples
        --------
        >>> import coremltools as ct
        >>> @mb.function(input_specs=[mb.TensorSpec(shape=(1,2))], opset_version=ct.target.iOS16)
        >>> def func(a):
        >>>     return mb.add(x=a, y=2)

        
coremltools/converters/mil/mil/builder.py