def check_input_and_output_categories(input_data):
    """ Raises ValueError if input or output categories are empty.

        Args:
            input_data (InputData): objects that stores all input data.

        Raises:
            ValueError: if input or output categories are empty.
    """
    if len(input_data.input_categories) == 0 or len(input_data.
        output_categories) == 0:
        raise ValueError('Both input and output categories must be specified')
