def _check_feature(self, feature, info, mode):
op = dict(<EOL>before=operator.gt,<EOL>after=operator.lt<EOL>)[mode]<EOL>feature_pos = self.get_feature_position(feature)<EOL>if feature_pos is not None:<EOL><INDENT>for other in info.get(mode, []):<EOL><INDENT>other_pos = self.get_feature_position(other)<EOL>if other_pos is not None:<EOL><INDENT>if op(feature_pos, other_pos):<EOL><INDENT>message = '<STR_LIT>'.format(<EOL>feature=feature,<EOL>feature_pos=feature_pos,<EOL>other=other,<EOL>other_pos=other_pos,<EOL>mode=mode.upper()<EOL>)<EOL>self.violations.append((feature, message))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
Private helper method performing the order check.
:param feature: the feature to check.
:param info: the info dict containing the before and after constraints
:param mode: after | before string
:return: None