code: def lpi(
      experiment,
      with_evc_tree=True,
      model="RandomForestRegressor",
      model_kwargs=None,
      n_points=20,
      n_runs=10,
      **kwargs,
  ):
      """Plotly implementation of `orion.plotting.lpi`"""
      if not experiment:
          raise ValueError("Parameter 'experiment' is None")
  
      if model_kwargs is None:
          model_kwargs = {}
  
      df = experiment.to_pandas(with_evc_tree=with_evc_tree)
      df = df.loc[df["status"] == "completed"]
  
      if df.empty:
          return go.Figure()
  
      df = orion.analysis.lpi(
          df,
          experiment.space,
          model=model,
          n_points=n_points,
          n_runs=n_runs,
          **model_kwargs,
      )
  
      fig = go.Figure(
          data=[
              go.Bar(
                  x=df.index.tolist(),
                  y=df["LPI"].tolist(),
                  error_y=dict(type="data", array=df["STD"].tolist()),
              )
          ]
      )
  
      y_axis_label = "Local Parameter Importance (LPI)"
      fig.update_layout(
          title=f"LPI for experiment '{experiment.name}'",
          xaxis_title="Hyperparameters",
          yaxis_title=y_axis_label,
      )
  
      return fig
  
imports: import functools
  from collections.abc import Iterable
  import numpy
  import pandas
  import plotly.express
  import plotly.graph_objects
  from plotly.subplots import make_subplots
  import orion.analysis
  import orion.analysis.base
  from orion.algo.space import Categorical, Fidelity
  from orion.core.worker.transformer import build_required_space
label_desc: Use image node_id 1 for calling a global function with example usage: lpi(experiment, with_evc_tree, model, model_kwargs, n_points, n_runs) and returns: fig, go