def filter(self, value, model=None, context=None):
value = str(value)<EOL>if self.mode == '<STR_LIT:left>':<EOL><INDENT>return value.lstrip(self.chars)<EOL><DEDENT>elif self.mode == '<STR_LIT:right>':<EOL><INDENT>return value.rstrip(self.chars)<EOL><DEDENT>else:<EOL><INDENT>return value.strip(self.chars)<EOL><DEDENT>
Filter
Performs value filtering and returns filtered result.

:param value:               input value
:param model:               parent model being validated
:param context:             object, filtering context
:return:                    filtered value