code: def model_to_file(model, filename):
      
      with open(filename, 'wb') as f:
          pickle.dump(model, f)
docs: Dump a model to a file as a pickle file.
  
      Parameters
      ----------
      model: Model
          Model instance.
      filename: str
          A path to the file in which to store the pickle output.