def evaluate_marker(text, extra=None):
try:<EOL><INDENT>marker = packaging.markers.Marker(text)<EOL>return marker.evaluate()<EOL><DEDENT>except packaging.markers.InvalidMarker as e:<EOL><INDENT>raise SyntaxError(e)<EOL><DEDENT>
Evaluate a PEP 508 environment marker.
Return a boolean indicating the marker result in this environment.
Raise SyntaxError if marker is invalid.

This implementation uses the 'pyparsing' module.