@staticmethod<EOL><INDENT>def extended_euclid(a, b):<DEDENT>
if b == <NUM_LIT:0>:<EOL><INDENT>return (<NUM_LIT:1>, <NUM_LIT:0>, a)<EOL><DEDENT>x0, y0, d = StridedInterval.extended_euclid(b, a % b)<EOL>x, y = y0, x0 - (a // b) * y0<EOL>return x, y, d<EOL>
It calculates the GCD of a and b, and two values x and y such that:
a*x + b*y = GCD(a,b).
This code has been taken from the project sympy.

:param a: first integer
:param b: second integer
:return: x,y and the GCD of a and b