output = requests.get(server_url + '/motifdb/list_motifsets')
motifset_list = output.json()

print(motifset_list)

"""
Explanation: Get the list of motifsets that are available
End of explanation
"""



url = server_url + '/motifdb/initialise_api'
client = requests.session()
token = client.get(url).json()['token']

url = server_url + '/motifdb/get_motifset/'
data = {'csrfmiddlewaretoken': token}
data['motifset_id_list'] = (motifset_list['massbank_binned_005'],motifset_list['gnps_binned_005'])
print(data['motifset_id_list'])
data['filter'] = "True"
# data['filter_threshold'] = 0.95 # Default value - not required
output = client.post(url,data = data).json()
print(len(output['motifs']),len(output['metadata']))

"""
Explanation: We have two urls for getting a motifset:
/motifdb/get_motifset/<ID>
for just getting the motifs for one
/motifdb/get_metadata/<ID>
for just getting the metadata for one
/motifdb/get_motifset
for POST requests where you can get multiple and do the filtering (see below). For this one, you also need to obtain a valid csrf token from the server
End of explanation
"""


