'validates that a param should be completed'

def validate_completion(self, param, words, text_before_cursor, check_double=True):

    position = (param.lower().startswith(words.lower()) and (not text_before_cursor[(-1)].isspace()))
    canceling_positions = ((param.lower() != words.lower()) and (param not in text_before_cursor.split()))
    found_double = True
    if check_double:
        for double_sets in self.same_param_doubles.get(self.curr_command, []):
            if (param in double_sets):
                found_double = (not any((((alias in text_before_cursor.split()) and (alias != param)) for alias in double_sets)))
    return (position and canceling_positions and found_double)
