code: def get_forecast(lib, time):
      data = pypistats.overall(lib, total=True, format="pandas")
      data = (
          data.groupby("category")
          .get_group("with_mirrors")
          .sort_values("date")
      )
      start_date = date.today() - relativedelta(
          months=int(time.split(" ")[0])
      )
      df = data[(data["date"] > str(start_date))]
  
      df1 = df[["date", "downloads"]]
      df1.columns = ["ds", "y"]
  
      m = Prophet()
      m.fit(df1)
      future = m.make_future_dataframe(periods=90)
      forecast = m.predict(future)
      fig1 = m.plot(forecast)
      return fig1
  
imports: import gradio
  import pypistats
  from datetime import date
  from dateutil.relativedelta import relativedelta
  import pandas
  from prophet import Prophet
label_desc: Use image node_id 1 for calling a global function with example usage: get_forecast(lib, time) and returns: fig1