<commit_before>module Calabash
  module Orientation
    # Is the device in the portrait orientation?
    #
    # @return [Boolean] Returns true if the device is in the 'up' or 'down'
    #  orientation.
    def portrait?
      _portrait?
    end

    # Is the device in the landscape orientation?
    #
    # @return [Boolean] Returns true if the device is in the 'left' or 'right'
    #  orientation.
    def landscape?
      _landscape?
    end

    # Set the device orientation to portrait.
    #
    # In portrait orientation, the display of the device has a bigger width
    # than height.
    def set_orientation_portrait
      _set_orientation_portrait
    end

    # Set the device orientation to landscape.
    #
    # In landscape orientation, the display of the device has a bigger height
    # than width.
    def set_orientation_landscape
      _set_orientation_landscape
    end

    # @!visibility private
    def _portrait?
      abstract_method!
    end

    # @!visibility private
    def _landscape?
      abstract_method!
    end

    # @!visibility private
    def _set_orientation_portrait
      abstract_method!
    end

    # @!visibility private
    def _set_orientation_landscape
      abstract_method!
    end
  end
end<commit_msg>Orientation: Add #change_orientation<commit_after>module Calabash
  module Orientation
    # Is the device in the portrait orientation?
    #
    # @return [Boolean] Returns true if the device is in the 'up' or 'down'
    #  orientation.
    def portrait?
      _portrait?
    end

    # Is the device in the landscape orientation?
    #
    # @return [Boolean] Returns true if the device is in the 'left' or 'right'
    #  orientation.
    def landscape?
      _landscape?
    end

    # Set the device orientation to portrait.
    #
    # In portrait orientation, the display of the device has a bigger width
    # than height.
    def set_orientation_portrait
      _set_orientation_portrait
    end

    # Set the device orientation to landscape.
    #
    # In landscape orientation, the display of the device has a bigger height
    # than width.
    def set_orientation_landscape
      _set_orientation_landscape
    end

    # Changes the orientation of the device.
    #
    # If the orientation is currently landscape, it will be set to portrait.
    # If the orientation is currently portrait, it will be set to landscape.
    def change_orientation
      if portrait?
        set_orientation_landscape
      elsif landscape?
        set_orientation_portrait
      else
        raise 'Could not detect current orientation'
      end
    end

    # @!visibility private
    def _portrait?
      abstract_method!
    end

    # @!visibility private
    def _landscape?
      abstract_method!
    end

    # @!visibility private
    def _set_orientation_portrait
      abstract_method!
    end

    # @!visibility private
    def _set_orientation_landscape
      abstract_method!
    end
  end
end
{'fraction_non_alphanumeric': 0.04893688828889639, 'fraction_numerical': 0.0, 'mean_word_length': 2.50354609929078, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1654281', 'n_tokens_mistral': 840, 'n_tokens_neox': 797, 'n_words': 304}