def METHOD_NAME(oViolation, self):
    lTokens = oViolation.get_tokens()
    if not token_value_available(oViolation):
        return
    if not optional_keyword_exists(self.anchor_token, lTokens):
        return
    iIndex = rules_utils.get_index_of_token_in_list(self.anchor_token, lTokens)
    if self.direction == 'right':
        rules_utils.insert_token(lTokens, iIndex + 1, self.insert_token(oViolation.get_token_value()))
        rules_utils.insert_whitespace(lTokens, iIndex + 1)
    else:
        rules_utils.insert_token(lTokens, iIndex, self.insert_token(oViolation.get_token_value()))
        if not rules_utils.whitespace_before_token_index(lTokens, iIndex):
            rules_utils.insert_whitespace(lTokens, iIndex)
    oViolation.set_tokens(lTokens)