def _ImprovementDirectionToHigherIsBetter(improvement_direction_str):
    "Converts an improvement direction string to a higher_is_better boolean.\n\n  Args:\n    improvement_direction_str: a string, either 'up' or 'down'.\n\n  Returns:\n    A boolean expressing the appropriate higher_is_better value.\n\n  Raises:\n    BadRequestError: if improvement_direction_str is invalid.\n  "
    if (improvement_direction_str == 'up'):
        return True
    elif (improvement_direction_str == 'down'):
        return False
    else:
        raise BadRequestError(('Invalid improvement direction string: ' + improvement_direction_str))
Converts an improvement direction string to a higher_is_better boolean.

Args:
  improvement_direction_str: a string, either 'up' or 'down'.

Returns:
  A boolean expressing the appropriate higher_is_better value.

Raises:
  BadRequestError: if improvement_direction_str is invalid.
def _ImprovementDirectionToHigherIsBetter(improvement_direction_str):
    "Converts an improvement direction string to a higher_is_better boolean.\n\n  Args:\n    improvement_direction_str: a string, either 'up' or 'down'.\n\n  Returns:\n    A boolean expressing the appropriate higher_is_better value.\n\n  Raises:\n    BadRequestError: if improvement_direction_str is invalid.\n  "
    if (improvement_direction_str == 'up'):
        return True
    elif (improvement_direction_str == 'down'):
        return False
    else:
        raise BadRequestError(('Invalid improvement direction string: ' + improvement_direction_str))