def _set_flow_rate(
        pipette_name, pipette, command_type, params, default_values):
    """
    Set flow rate in uL/mm, to value obtained from command's params,
    or if unspecified in command params, then from protocol's "default-values".
    """
    default_aspirate = default_values.get(
        'aspirate-flow-rate', {}).get(pipette_name)

    default_dispense = default_values.get(
        'dispense-flow-rate', {}).get(pipette_name)

    flow_rate_param = params.get('flow-rate')

    if flow_rate_param is not None:
        if command_type == 'aspirate':
            pipette.set_flow_rate(
                aspirate=flow_rate_param,
                dispense=default_dispense)
            return
        if command_type == 'dispense':
            pipette.set_flow_rate(
                aspirate=default_aspirate,
                dispense=flow_rate_param)
            return

    pipette.set_flow_rate(
        aspirate=default_aspirate,
        dispense=default_dispense
    )
Set flow rate in uL/mm, to value obtained from command's params,
    or if unspecified in command params, then from protocol's "default-values".