code: def parallel_coordinates(
      experiment,
      with_evc_tree=True,
      order=None,
      colorscale="YlOrRd",
      **kwargs,
  ):
      """Plotly implementation of `orion.plotting.parallel_coordinates`"""
  
      def build_frame():
          """Builds the dataframe for the plot"""
          names = list(experiment.space.keys())
  
          df = experiment.to_pandas(with_evc_tree=with_evc_tree)
          df = df.loc[df["status"] == "completed"]
  
          if df.empty:
              return df
  
          df[names] = df[names].transform(
              functools.partial(_curate_params, space=experiment.space)
          )
  
          df = _flatten_dims(df, experiment.space)
  
          return df
  
      def infer_order(space, order):
          """Create order if not passed, otherwise verify it"""
          params = orion.analysis.base.flatten_params(space, order)
          if order is None:
              fidelity_dims = [
                  dim
                  for dim in experiment.space.values()
                  if isinstance(dim, Fidelity)
              ]
              fidelity = (
                  fidelity_dims[0].name if fidelity_dims else None
              )
              if fidelity in params:
                  del params[params.index(fidelity)]
                  params.insert(0, fidelity)
  
          return params
  
      def get_dimension(data, name, dim):
          dim_data = dict(label=name, values=data[name])
          if dim.type == "categorical":
              categories = dim.interval()
              dim_data["tickvals"] = list(range(len(categories)))
              dim_data["ticktext"] = categories
          else:
              dim_data["range"] = dim.interval()
          return dim_data
  
      if not experiment:
          raise ValueError("Parameter 'experiment' is None")
  
      df = build_frame()
  
      if df.empty:
          return go.Figure()
  
      trial = experiment.fetch_trials_by_status(
          "completed", with_evc_tree=with_evc_tree
      )[0]
  
      flattened_space = build_required_space(
          experiment.space, shape_requirement="flattened"
      )
  
      dimensions = [
          get_dimension(df, name, flattened_space[name])
          for name in infer_order(experiment.space, order)
      ]
  
      objective_name = trial.objective.name
  
      objectives = df["objective"]
      omin = min(df["objective"])
      omax = max(df["objective"])
  
      dimensions.append(
          dict(
              label=objective_name,
              range=(omin, omax),
              values=objectives,
          )
      )
  
      fig = go.Figure(
          data=go.Parcoords(
              line=dict(
                  color=objectives,
                  colorscale=colorscale,
                  showscale=True,
                  cmin=omin,
                  cmax=omax,
                  colorbar=dict(title=objective_name),
              ),
              dimensions=dimensions,
          )
      )
  
      fig.update_layout(
          title=f"Parallel Coordinates Plot for experiment '{experiment.name}'"
      )
  
      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 2 for calling a global function with example usage: parallel_coordinates(experiment, with_evc_tree, order, colorscale) and returns: fig, df, params, dim_data, go, df