code: def from_dict(cls, metadata):
          
          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
docs: 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.