import json
import requests


def query(query, experiment_id, host, verify_cert=True):
    """
    Query the MDML for an example of the data structure that your query will return. This is aimed at aiding in development of FuncX functions for use with the MDML.

    Parameters
    ----------
    query : list
        Description of the data to send funcx. See queries format in the documentation on GitHub
    experiment_id : string
        MDML experiment ID for which the data belongs
    host : string
        Host of the MDML instance
    verify_cert : bool
        Boolean is requests should verify the SSL cert
    
    Returns
    -------
    list
        Data structure that will be passed to FuncX
    """
    resp = requests.get(f"https://{host}:1880/query?query={json.dumps(query)}&experiment_id={experiment_id}", verify=verify_cert)
    return json.loads(resp.text)