def find_with_wildcard(self, workflow_ids=None, labels=None, exclude_subworkflow=True):
    'Retrieves all workflows from Cromwell server.\n        And then find matching workflows by ID or labels.\n        Wildcards (? and *) are allowed for both parameters.\n        '
    result = []
    if ((not workflow_ids) and (not labels)):
        return result
    resp = self.__request_get(CromwellRestAPI.ENDPOINT_WORKFLOWS, params={'additionalQueryResultFields': 'labels', 'includeSubworkflows': (not exclude_subworkflow)})
    if (resp and resp['results']):
        for workflow in resp['results']:
            matched = False
            if ('id' not in workflow):
                continue
            if workflow_ids:
                for wf_id in workflow_ids:
                    if fnmatch.fnmatchcase(workflow['id'], wf_id):
                        result.append(workflow)
                        matched = True
                        break
            if matched:
                continue
            if (labels and ('labels' in workflow)):
                for (k, v) in labels:
                    v_ = workflow['labels'].get(k)
                    if (not v_):
                        continue
                    if (isinstance(v_, str) and isinstance(v, str)):
                        if fnmatch.fnmatchcase(v_, v):
                            result.append(workflow)
                            break
                    elif (v_ == v):
                        result.append(workflow)
                        break
        logger.debug('find_with_wildcard: workflow_ids={workflow_ids}, labels={labels}, result={result}'.format(workflow_ids=workflow_ids, labels=labels, result=result))
    return result
Retrieves all workflows from Cromwell server.
And then find matching workflows by ID or labels.
Wildcards (? and *) are allowed for both parameters.
def find_with_wildcard(self, workflow_ids=None, labels=None, exclude_subworkflow=True):
    'Retrieves all workflows from Cromwell server.\n        And then find matching workflows by ID or labels.\n        Wildcards (? and *) are allowed for both parameters.\n        '
    result = []
    if ((not workflow_ids) and (not labels)):
        return result
    resp = self.__request_get(CromwellRestAPI.ENDPOINT_WORKFLOWS, params={'additionalQueryResultFields': 'labels', 'includeSubworkflows': (not exclude_subworkflow)})
    if (resp and resp['results']):
        for workflow in resp['results']:
            matched = False
            if ('id' not in workflow):
                continue
            if workflow_ids:
                for wf_id in workflow_ids:
                    if fnmatch.fnmatchcase(workflow['id'], wf_id):
                        result.append(workflow)
                        matched = True
                        break
            if matched:
                continue
            if (labels and ('labels' in workflow)):
                for (k, v) in labels:
                    v_ = workflow['labels'].get(k)
                    if (not v_):
                        continue
                    if (isinstance(v_, str) and isinstance(v, str)):
                        if fnmatch.fnmatchcase(v_, v):
                            result.append(workflow)
                            break
                    elif (v_ == v):
                        result.append(workflow)
                        break
        logger.debug('find_with_wildcard: workflow_ids={workflow_ids}, labels={labels}, result={result}'.format(workflow_ids=workflow_ids, labels=labels, result=result))
    return result