code: def get_data_frame(client, program, start, stop, resolution=None):
      
      data = {}
      metadata = {}
  
      c = client.execute(program, start=start, stop=stop, resolution=resolution)
      for msg in c.stream():
          if isinstance(msg, messages.DataMessage):
              if msg.logical_timestamp_ms in data:
                  data[msg.logical_timestamp_ms].update(msg.data)
              else:
                  data[msg.logical_timestamp_ms] = msg.data
          elif isinstance(msg, messages.MetadataMessage):
              metadata[msg.tsid] = msg.properties
  
      df = pandas.DataFrame.from_dict(data, orient='index')
      df.metadata = metadata
      return df
docs: Executes the given program across the given time range (expressed in
      millisecond timestamps since Epoch), and returns a Pandas DataFrame
      containing the results, indexed by output timestamp.
  
      If the program contains multiple publish() calls, their outputs are merged
      into the returned DataFrame.