Connverted regexp to Python. Repositories SQL query built from Python also.