def match(self, obj):
path, frag = [], obj<EOL>for part in self.parts:<EOL><INDENT>path.append(part)<EOL>if isinstance(frag, dict):<EOL><INDENT>try:<EOL><INDENT>frag = frag[part]<EOL><DEDENT>except KeyError:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>elif isinstance(frag, (list, tuple)):<EOL><INDENT>frag = part in frag<EOL><DEDENT>elif isinstance(frag, str):<EOL><INDENT>frag = frag == part<EOL><DEDENT>elif isinstance(frag, int):<EOL><INDENT>frag = frag == int(part)<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return True if frag else False<EOL>
Returns
    bool: it matches