- help(searchterm='')
Displays this help file.  If searchterm is provided, only functions with names containing the search term are displayed on the screen.

- getResults(taskId, baseUrl, apiKey, incIncompleteInstances=False, incIterations=True)
Make an API call to get a list of results from completed instances or iterations. Task ID is available from Studio after clicking on the relevant task. The baseUrl string is usually:
	'https://studio.lambda.hvmd.io/' ('https://' is required).
The authHeader is a dictionary specifying an HTTP Authorisation header; it can be created with makeAuthHeader. Setting the expandSummary option to False will collapse the summary block in each result to null. Each entry in the list is a dictionary containing the results of one instance, in the structure shown below.

Returns a list of instance results as dictionaries.

- getInstances(taskId, baseUrl, apiKey, expandSummary=True)
Make an API call to get a list of instances submitted to the task. Note that this may return less data than an individual call to getInstance(). Task ID is available from Studio after clicking on the relevant task. The baseUrl string is usually:
	'https://studio.lambda.hvmd.io/'
The authHeader is a dictionary specifying an HTTP Authorisation header; it can be created with makeAuthHeader. Each entry in the list is a dictionary containing the input data for one instance, in the structure shown below.

Returns a list of all task instances as dictionaries.

- getInstance(taskId, baseUrl, apiKey, instanceId, expandSummary=True)
Get a single instance. Note that this may return more data than the corresponding element of the array returned by getInstances().

Returns a dictionary of a single task instance as a dictionary.

- getInstanceIds(taskId, baseUrl, apiKey)
Returns a list of all instance IDs on a specific task.

- transferEntry(source, target, entryField=["data", "annotations"], sourceIdField="id", targetIdField="instanceId")
Transfer an entry from one list of dictionaries to another list of dictionaries. Used for copying input data from instance dictionaries to results dictionaries, matching on instanceId.

No return value.  Entries are transferred in place on the target list.

- getInstancesAndResults(taskId, baseUrl, apiKey, expandSummary=True, incIncompleteInstances=False, incIterations=True)
Call both getResults and getInstances, and stitch them together with transferEntry

Returns a list of task instances and their results as dictionaries.

- listFilesUploaded(taskId, baseUrl, apiKey)
Make an API call to get a list of all uploaded files

Returns a list of filenames loaded to a task.

- uploadFiles(taskId, baseUrl, apiKey, lstFilenames, localRepo, overwrite=False, raiseForStatus=True)
Make an API call to upload local files from localRepo with filenames in lstFilenames to the specified task.  Raises an error if the upload fails.  To bypass upload errors, set raiseForStatus=False.

No return value.

- downloadFile(filepath, localRepo, prefix='', overwrite=False)
Download a file generated by a task from the long s3 link provided as output. Provide a prefix (iteration ID etc). Returns local file name.
    filepath: the link to the file in a Hivemind s3 bucket
    localRepo: local folder for the file
    prefix: a prefix to add to the downloaded filename
    overwrite: boolean, indicating whether to overwrite if a file of the same name exists in the localRepo

Returns the filename of the file downloaded to localRepo.

- getIterations(taskId, baseUrl, apiKey, instanceId)
Get a list of dictionaries, one per iteration result.

- getIterationIds(taskId, baseUrl, apiKey, instanceId)
Get a list of iteration IDs for the given instance.

- deleteIteration(taskId, baseUrl, apiKey, instanceId, iterationId)
Delete one specific iteration of a given instance.

Returns the API response.  If successful, this will be empty.

- deleteInstance(taskId, baseUrl, apiKey, instanceId)
Delete one specific instance and all its iterations.

Returns the API response of the delete instance call.  If successful, this will be empty.

- createInstance(taskId, baseUrl, apiKey, name, instructions='', data={}, overrideSchema=None, tags=[], priority = 0, annotations = {})
Make an API call to create an instance. 
	name: A compulsory string. 
	instructions: The markdown shown to the contributor for the instance. 
	data: A dictionary. 
	priority: An integer; a higher integer is higher priority, default 0.
	annotations: A dictionary of annotations to set on the new instance

Returns a dictionary of the created instance.

- reiterateInstance(taskId, baseUrl, apiKey,instanceId)
Generate one more iteration on the selected instance

Returns the API requests response.  If successful, this will be empty.

- setAnnotation(taskId, baseUrl, apiKey, instanceId, key, value)
Add a key-value pair to the annotations of an instance. Will overwrite the existing annotation if the key already exists.

- deleteAnnotation(taskId, baseUrl, apiKey, instanceId, key)
Remove the specified key and its associated value from the annotations of an instance.

- wipe(taskId, baseUrl, apiKey)
Delete **ALL** instances and iterations on a task. Caution - cannot be undone. Also may take several minutes.

-----

- Instance Structure
Each entry in the list returned by getInstances() is a dictionary with the following entries:
	id [instance id]
	name
	data [a dictionary]
	status
	tags [a list of strings]
	summary
	created
	priority
	annotations

- Results Structure
Each entry in the list returned by getResults() is a dictionary with the following entries:
	instanceId
	status
	lastUpdated
	agreement
	tags [a list of strings]
	result [a dictionary with entries 'data' and 'isError']
	iterationResults [a list of entries in the structure below]
Note that 'result' is the output of error checking and will be empty if that is off, even with only one iteration.

- Iteration Structure
Each entry in the list of iterationResults above is a dictionary with the following entries:
	worker
	start
	end
	iterationId
	data [a dictionary of the collected data keyed by input box names]
	isError

-----

- makeAuthHeader(apiKey)
Returns an HTTP Authorization header entry (in dictionary format) created from the provided API key. The API key can be accessed from the settings page in Studio.

- removeMetadata(data)
Removes the '_metadata' entry from a dictionary - necessary for transferring data dictionaries form one task to another.

- cleanBaseUrl(url)
Adds 'https://' if it doesn't exist, and removes trailing slashes.

- checkHttpResponse(r)
Prints any HTTP error responses

- getDatasetRows(datasetId, baseUrl, apiKey, queries=[])
Returns Dataset Rows for a dataset in the workflows tab.  Queries can be supplied as a list of strings where each string defines a (1) key path, (2) logical comparison and (3)value (e.g. "metadata.timestamp=2021-01-01" or "data.path.to.my.key>=0").

- getDatasetRow(datasetId, baseUrl, apiKey, datasetRowId)
Returns a specified row of a dataset as a dictionary.

- deleteDatasetRows(datasetId, baseUrl, apiKey, datasetRowIds=[], allRows=False, raiseForStatus=True)
Deletes specified rows in a dataset.  If allRows is set to True, the values passed to datasetRowIds are ignored, and all dataset rows are identified and deleted.

- addDatasetRows(datasetId, baseUrl, apikey, rowsData=[])
Bulk add rows to a dataset.  The value of rowsData should be a list of dictionaries of the rows data.

- addDatasetRow(datasetId, baseUrl, apiKey, rowData={})
Add a single row to a dataset.  The value for rowData should be the dictionary of the row data object.

- listFileStore(baseUrl, apiKey, remotePath, recursive=False)
List the files in the remotePath of the file store.  The remotePath should be a directory handle of the format: !(dir path/to/my/file).

- uploadToFileStore(baseUrl, apiKey, fileName, localRepo, remotePath, overwrite=False, raiseForStatus=True, safeCharEncode=False)
Upload a local file from a local repository to a path on the file store.

If file names contain non-ASCII characters, setting safeCharEncode=True is highly advisable.

Returns the API response in JSON format.  If the upload did not fail, this will be the fileHandle of the uploaded file.

- deleteFromFileStore(baseUrl, apiKey, fileHandle, raiseForStatus=True)
Deletes a file or directory from the Hivemind platform file store.  The parameter 'fileHandle' should be a handle for a file or directory on the fileStore.

- getFileFromFileStore(baseUrl, apiKey, fileHandle, localRepo, overwrite=False)
Download a file from the Hivemind platform file store.