def get_schema_dict(name, method, all_task_schemas, software_instance=None):
    """Get the schema associated with the method/implementation of this task."""
    match_task_idx = None
    match_method_idx = None
    match_imp_idx = None
    for task_ref_idx, task_ref in enumerate(all_task_schemas):
        if task_ref['name'] == name:
            match_task_idx = task_ref_idx
            for met_idx, met in enumerate(task_ref['methods']):
                if met['name'] == method:
                    match_method_idx = met_idx
                    implementations = met.get('implementations')
                    if implementations:
                        for imp_idx, imp in enumerate(implementations):
                            if imp['name'] == software_instance['name']:
                                match_imp_idx = imp_idx
                                break
                    break
            break
    if match_task_idx is None:
        msg = f'No matching task found with name: "{name}"'
        raise ValueError(msg)
    if match_method_idx is None:
        msg = (
            f'No matching method found with name: "{method}" in task: "{name}""'
            )
        raise ValueError(msg)
    task_ref = all_task_schemas[match_task_idx]
    met_ref = task_ref['methods'][met_idx]
    inputs = task_ref.get('inputs', []) + met_ref.get('inputs', [])
    outputs = task_ref.get('outputs', []) + met_ref.get('outputs', [])
    imp_ref = None
    in_map = None
    out_map = None
    command_opt = None
    if match_imp_idx is not None:
        imp_ref = met_ref['implementations'][match_imp_idx]
        inputs += imp_ref.get('inputs', [])
        outputs += imp_ref.get('outputs', [])
        in_map = imp_ref.get('input_map', [])
        out_map = imp_ref.get('output_map', [])
        command_opt = imp_ref.get('commands', [])
    outputs = list(set(outputs))
    if software_instance:
        implementation = software_instance['name']
        command_group = {'commands': command_opt, 'env_pre':
            software_instance.get('env_pre'), 'env_post': software_instance
            .get('env_post')}
    else:
        implementation = None
        command_group = None
    schema_dict = {'name': name, 'method': method, 'implementation':
        implementation, 'inputs': inputs, 'outputs': outputs, 'input_map':
        in_map, 'output_map': out_map, 'command_group': command_group}
    return schema_dict
