code: def create_api(
      estimator,
      api_name: str,
      host: str = "127.0.0.1",
      port: int = 8000,
  ) -> None:
      """
      This function takes an input ``estimator`` and creates a POST API for
      inference. It only creates the API and doesn't run it automatically.
      To run the API, you must run the Python file using ``!python``.
  
  
      Example
      -------
      >>> from pycaret.datasets import get_data
      >>> boston = get_data('boston')
      >>> from pycaret.regression import *
      >>> exp_name = setup(data = boston,  target = 'medv')
      >>> lr = create_model('lr')
      >>> create_api(lr, 'lr_api')
      >>> !python lr_api.py #to run the API
  
  
      estimator: scikit-learn compatible object
          Trained model object
  
  
      api_name: str
          Name of the api as a string.
  
  
      host: str, default = '127.0.0.1'
          API host address.
  
  
      port: int, default = 8000
          port for API.
  
  
      Returns:
          None
  
      """
      return _CURRENT_EXPERIMENT.create_api(
          estimator=estimator, api_name=api_name, host=host, port=port
      )
  
imports: import logging
  import os
  from typing import Any, BinaryIO, Callable, Dict, List, Optional, Union
  import pandas
  from joblib.memory import Memory
  from pycaret.internal.parallel.parallel_backend import ParallelBackend
  from pycaret.loggers.base_logger import BaseLogger
  from pycaret.regression.oop import RegressionExperiment
  from pycaret.utils.constants import DATAFRAME_LIKE, SEQUENCE_LIKE, TARGET_LIKE
  from pycaret.utils.generic import check_if_global_is_not_none
label_desc: Use image node_id 34 for calling a global function with example usage: create_api(estimator, api_name, host, port) and returns: _CURRENT_EXPERIMENT