def _check_conditional_statement(statement, num_collections):
        """Method to check conditional statements to be sure that they are valid.

        Args:
            statement: A conditional statement as a string (e.g. a>25 and a%5==0).
                The variable should always be named as 'a' (without quotations).
            num_collections: An integer representing the number of data collections
                that the statement will be evaluating.

        Return:
            correct_var: A list of the correct variable names that should be
                used within the statement (eg. ['a', 'b', 'c'])
        """
        # Determine what the list of variables should be based on the num_collections
        correct_var = list(ascii_lowercase)[:num_collections]

        # Clean out the operators of the statement
        st_statement = BaseCollection._remove_operators(statement)
        parsed_st = [s for s in st_statement if s.isalpha()]

        # Perform the check
        for var in parsed_st:
            if var not in correct_var:
                raise ValueError(
                    'Invalid conditional statement: {}\n '
                    'Statement should be a valid Python statement'
                    ' and the variables should be named as follows: {}'.format(
                        statement, ', '.join(correct_var))
                    )
        return correct_var
def _check_conditional_statement ( statement , num_collections ) : correct_var = list ( ascii_lowercase ) [ : num_collections ] st_statement = BaseCollection . _remove_operators ( statement ) parsed_st = [ s for s in st_statement if s . isalpha ( ) ] for var in parsed_st : if var not in correct_var : raise ValueError ( 'Invalid conditional statement: {}\n ' 'Statement should be a valid Python statement' ' and the variables should be named as follows: {}' . format ( statement , ', ' . join ( correct_var ) ) ) return correct_var
Method to check conditional statements to be sure that they are valid.

        Args:
            statement: A conditional statement as a string (e.g. a>25 and a%5==0).
                The variable should always be named as 'a' (without quotations).
            num_collections: An integer representing the number of data collections
                that the statement will be evaluating.

        Return:
            correct_var: A list of the correct variable names that should be
                used within the statement (eg. ['a', 'b', 'c'])