@staticmethod
def _steps_to_int(steps, keyword, max_steps):
    """Convert the steps argument to a integer value.

        Args:
            steps (str): the steps argument passed by user.
            keyword (str): the keyword 'head' or 'tail'.
            max_steps (int): the maximum number of valid migrations.

        Returns:
            int: Return the 'steps' value as integer.
            Return 0 if 'steps' is invalid.
        """
    if steps.strip().lower() == keyword:
        return max_steps
    try:
        return int(steps)
    except ValueError:
        return 0
