<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_dict(cls, metadata):
 """Create a new MLPipeline from a dict specification. The dict structure is the same as the one created by the `to_dict` method. Args: metadata (dict):
 Dictionary containing the pipeline specification. Returns: MLPipeline: A new MLPipeline instance with the details found in the given specification dictionary. """

        hyperparameters = metadata.get('hyperparameters')
        tunable = metadata.get('tunable_hyperparameters')

        pipeline = cls(
            metadata['primitives'],
            metadata.get('init_params'),
            metadata.get('input_names'),
            metadata.get('output_names'),
        )

        if hyperparameters:
            pipeline.set_hyperparameters(hyperparameters)

        if tunable is not None:
            pipeline._tunable_hyperparameters = tunable

        return pipeline