code: def generate_data(location_data, start_dt) -> pd.DataFrame:
      """
      Synthetic data generation utility to take a real data set and generate a 'stacked'
      representation that can be grouped by identifying keys within columns.
      Here we are taking a list of tuples as location data [(country, city)] and applying
      a random factor to each copy of the underlying series to generate data at different scales.
  
      :param location_data: List[Tuple("country", "city")] for synthetic key grouping columns
                            generation.
      :param start_dt: String datetime value in the form of `YYYY-mm-dd HH:MM:SS`
      :return: A Pandas DataFrame that is a concatenation of each entry of the location_data tuple
               values with a datetime column added via hourly intervals for the duration of each
               series. The original data is in hourly electrical consumption values.
      """
      raw_data = datasets.load_taylor(as_series=True)
      start = datetime.strptime(start_dt, "%Y-%m-%d %H:%M:%S")
      dates = pd.date_range(
          start=start, periods=len(raw_data), freq="H"
      ).values
  
      generated_listing = []
  
      for country, city in location_data:
          generated_listing.append(
              pd.DataFrame(
                  {
                      "watts": np.random.uniform(0.3, 0.8) * raw_data,
                      "datetime": dates,
                      "country": country,
                      "city": city,
                  }
              )
          )
  
      output = (
          pd.concat(generated_listing)
          .reset_index()
          .drop("index", axis=1)
      )
      return output
  
file_path: mlflow/examples/diviner/train.py
imports: import tempfile
  from datetime import datetime
  import numpy
  import pandas
  from diviner import GroupedProphet
  from pmdarima import datasets
  import mlflow.diviner
label_desc: Use image node_id 1 for calling a global function with example usage: generate_data(location_data, start_dt) and returns: output