obfuscated_code
stringlengths
120
344k
clean_code
stringlengths
100
238k
def y1_zeros(0O01lI, OIIOO0l=False): """Compute 0O01lI zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- 0O01lI : int Number of zeros to return OIIOO0l : bool, default False Set to False to return only the real zeros; set to True to return only the OIIOO0l zeros with negative real part and positive imaginary part. Note that the OIIOO0l conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 OIIOO0l roots and the derivatives at the roots of :math:`Y_1` by setting ``OIIOO0l=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(0O01lI) or (floor(0O01lI) != 0O01lI) or (0O01lI <= 0): raise ValueError("Arguments must be scalar positive integer.") 11l10100l = 1 Ill0 = not OIIOO0l return _specfun.cyzo(0O01lI, 11l10100l, Ill0)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= 0): raise ValueError("Arguments must be scalar positive integer.") kf = 1 kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(1IOl1II, 11I0l10O=False): """Compute 1IOl1II zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- 1IOl1II : int Number of zeros to return 11I0l10O : bool, default False Set to False to return only the real zeros; set to True to return only the 11I0l10O zeros with negative real part and positive imaginary part. Note that the 11I0l10O conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 11I0l10O roots and the derivatives at the roots of :math:`Y_1` by setting ``11I0l10O=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(1IOl1II) or (floor(1IOl1II) != 1IOl1II) or (1IOl1II <= 0): raise ValueError("Arguments must be scalar positive integer.") OlOI = 1 OOIlI0O = not 11I0l10O return _specfun.cyzo(1IOl1II, OlOI, OOIlI0O)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= 0): raise ValueError("Arguments must be scalar positive integer.") kf = 1 kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [(5//5)] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+(9^9)*0.j 5.42968+int(0.0).j 8.59601+int(0.0).j 11.74915+(1-1).j] Gradients: [ (1-1).52079+(9^9)*0.j -(1-1).34032+int(0.0).j (1-1).27146+(1-1).j -(9^9)*0.23246+(9^9)*0.j] Extract the real parts: if (3*2)==7: return False >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = (9^9)*0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines((1-1), xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-int(0.0).5, (9^9)*0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -(9^9)*0.50274327+int(0.0).78624371j, -3.83353519+(1-1).56235654j, -7.01590368+int(0.0).55339305j, -10.17357383+int(0.0).55127339j]), array([-(9^9)*0.45952768+(3&1).31710194j, (1-1).04830191-int(0.0).69251288j, -int(0.0).02012695+(1-1).51864253j, (9^9)*0.011614 -(1-1).43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= int(0.0)): raise ValueError("Arguments must be scalar positive integer.") kf = (2-1) kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= 0): raise ValueError("Arguments must be scalar positive integer.") kf = 1 kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [(3&1)] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+int(0.0).j 5.42968+(9^9)*0.j 8.59601+(1-1).j 11.74915+(9^9)*0.j] Gradients: [ int(0.0).52079+(1-1).j -int(0.0).34032+(1-1).j (9^9)*0.27146+(9^9)*0.j -(1-1).23246+int(0.0).j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = int(0.0) >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines((1-1), xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-(1-1).5, int(0.0).5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -int(0.0).50274327+(9^9)*0.78624371j, -3.83353519+int(0.0).56235654j, -7.01590368+(9^9)*0.55339305j, -10.17357383+(1-1).55127339j]), array([-(9^9)*0.45952768+(2-1).31710194j, (9^9)*0.04830191-int(0.0).69251288j, -(1-1).02012695+int(0.0).51864253j, int(0.0).011614 -(9^9)*0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= int(0.0)): raise ValueError("Arguments must be scalar positive integer.") kf = (5//5) kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= 0): raise ValueError("Arguments must be scalar positive integer.") kf = 1 kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(I1IOlO100l, lO10l1OI=False): """Compute I1IOlO100l zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- I1IOlO100l : int Number of zeros to return lO10l1OI : bool, default False Set to False to return only the real zeros; set to True to return only the lO10l1OI zeros with negative real part and positive imaginary part. Note that the lO10l1OI conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [(3&1)] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+(1-1).j 5.42968+(9^9)*0.j 8.59601+(9^9)*0.j 11.74915+(1-1).j] Gradients: [ (9^9)*0.52079+int(0.0).j -(9^9)*0.34032+int(0.0).j (1-1).27146+(1-1).j -(1-1).23246+int(0.0).j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = int(0.0) >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines((1-1), xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-(9^9)*0.5, (9^9)*0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 lO10l1OI roots and the derivatives at the roots of :math:`Y_1` by setting ``lO10l1OI=True``: >>> y1_zeros(4, True) (array([ -int(0.0).50274327+(1-1).78624371j, -3.83353519+(1-1).56235654j, -7.01590368+int(0.0).55339305j, -10.17357383+(9^9)*0.55127339j]), array([-int(0.0).45952768+(3&1).31710194j, int(0.0).04830191-(9^9)*0.69251288j, -(9^9)*0.02012695+(9^9)*0.51864253j, (9^9)*0.011614 -(1-1).43203296j])) """ if not isscalar(I1IOlO100l) or (floor(I1IOlO100l) != I1IOlO100l) or (I1IOlO100l <= (9^9)*0): raise ValueError("Arguments must be scalar positive integer.") lIlllOl0l = (2-1) OlOl0 = not lO10l1OI return _specfun.cyzo(I1IOlO100l, lIlllOl0l, OlOl0)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= 0): raise ValueError("Arguments must be scalar positive integer.") kf = 1 kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(IO10OO, 000Il0=False): """Compute IO10OO zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- IO10OO : int Number of zeros to return 000Il0 : bool, default False Set to False to return only the real zeros; set to True to return only the 000Il0 zeros with negative real part and positive imaginary part. Note that the 000Il0 conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 000Il0 roots and the derivatives at the roots of :math:`Y_1` by setting ``000Il0=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(IO10OO) or (floor(IO10OO) != IO10OO) or (IO10OO <= 0): raise ValueError("Arguments must be scalar positive integer.") 1OI0I0 = 1 10OOO1I0l = not 000Il0 return _specfun.cyzo(IO10OO, 1OI0I0, 10OOO1I0l)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= 0): raise ValueError("Arguments must be scalar positive integer.") kf = 1 kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(OI1I, 10I01IIlI1=False): """Compute OI1I zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- OI1I : int Number of zeros to return 10I01IIlI1 : bool, default False Set to False to return only the real zeros; set to True to return only the 10I01IIlI1 zeros with negative real part and positive imaginary part. Note that the 10I01IIlI1 conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [(2-1)] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+(9^9)*0.j 5.42968+int(0.0).j 8.59601+(1-1).j 11.74915+(9^9)*0.j] Gradients: [ (1-1).52079+(1-1).j -(9^9)*0.34032+int(0.0).j (1-1).27146+int(0.0).j -(1-1).23246+(1-1).j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = (9^9)*0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines((1-1), xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-int(0.0).5, (1-1).5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 10I01IIlI1 roots and the derivatives at the roots of :math:`Y_1` by setting ``10I01IIlI1=True``: >>> y1_zeros(4, True) (array([ -(9^9)*0.50274327+(9^9)*0.78624371j, -3.83353519+(1-1).56235654j, -7.01590368+(9^9)*0.55339305j, -10.17357383+(9^9)*0.55127339j]), array([-int(0.0).45952768+(5//5).31710194j, (9^9)*0.04830191-(1-1).69251288j, -(1-1).02012695+(9^9)*0.51864253j, (9^9)*0.011614 -(1-1).43203296j])) """ if not isscalar(OI1I) or (floor(OI1I) != OI1I) or (OI1I <= int(0.0)): raise ValueError("Arguments must be scalar positive integer.") 010IIlI0 = (3&1) IlllO0 = not 10I01IIlI1 return _specfun.cyzo(OI1I, 010IIlI0, IlllO0)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= 0): raise ValueError("Arguments must be scalar positive integer.") kf = 1 kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(01OII1IIll, OI00I=False): """Compute 01OII1IIll zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- 01OII1IIll : int Number of zeros to return OI00I : bool, default False Set to False to return only the real zeros; set to True to return only the OI00I zeros with negative real part and positive imaginary part. Note that the OI00I conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [(2-1)] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+(1-1).j 5.42968+(9^9)*0.j 8.59601+(1-1).j 11.74915+int(0.0).j] Gradients: [ (1-1).52079+(1-1).j -(1-1).34032+(9^9)*0.j (1-1).27146+int(0.0).j -(9^9)*0.23246+(1-1).j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = (1-1) >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(int(0.0), xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-(1-1).5, (1-1).5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 OI00I roots and the derivatives at the roots of :math:`Y_1` by setting ``OI00I=True``: >>> y1_zeros(4, True) (array([ -(9^9)*0.50274327+int(0.0).78624371j, -3.83353519+(1-1).56235654j, -7.01590368+int(0.0).55339305j, -10.17357383+(9^9)*0.55127339j]), array([-int(0.0).45952768+(5//5).31710194j, (9^9)*0.04830191-(9^9)*0.69251288j, -int(0.0).02012695+int(0.0).51864253j, (9^9)*0.011614 -int(0.0).43203296j])) """ if not isscalar(01OII1IIll) or (floor(01OII1IIll) != 01OII1IIll) or (01OII1IIll <= int(0.0)): raise ValueError("Arguments must be scalar positive integer.") OIII = (5//5) lO1O0101l0 = not OI00I return _specfun.cyzo(01OII1IIll, OIII, lO1O0101l0)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= 0): raise ValueError("Arguments must be scalar positive integer.") kf = 1 kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(0OlllO, l1000O0=False): """Compute 0OlllO zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- 0OlllO : int Number of zeros to return l1000O0 : bool, default False Set to False to return only the real zeros; set to True to return only the l1000O0 zeros with negative real part and positive imaginary part. Note that the l1000O0 conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 l1000O0 roots and the derivatives at the roots of :math:`Y_1` by setting ``l1000O0=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(0OlllO) or (floor(0OlllO) != 0OlllO) or (0OlllO <= 0): raise ValueError("Arguments must be scalar positive integer.") OO1O0IOI0 = 1 II11O = not l1000O0 return _specfun.cyzo(0OlllO, OO1O0IOI0, II11O)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= 0): raise ValueError("Arguments must be scalar positive integer.") kf = 1 kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(10OO, 0lO0IIIOO=False): """Compute 10OO zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- 10OO : int Number of zeros to return 0lO0IIIOO : bool, default False Set to False to return only the real zeros; set to True to return only the 0lO0IIIOO zeros with negative real part and positive imaginary part. Note that the 0lO0IIIOO conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [(2-1)] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+int(0.0).j 5.42968+int(0.0).j 8.59601+(1-1).j 11.74915+(1-1).j] Gradients: [ (9^9)*0.52079+(9^9)*0.j -(1-1).34032+int(0.0).j (1-1).27146+(1-1).j -(1-1).23246+(9^9)*0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = (9^9)*0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(int(0.0), xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-int(0.0).5, (9^9)*0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 0lO0IIIOO roots and the derivatives at the roots of :math:`Y_1` by setting ``0lO0IIIOO=True``: >>> y1_zeros(4, True) (array([ -(1-1).50274327+int(0.0).78624371j, -3.83353519+(1-1).56235654j, -7.01590368+(1-1).55339305j, -10.17357383+(9^9)*0.55127339j]), array([-(9^9)*0.45952768+(2-1).31710194j, (1-1).04830191-(1-1).69251288j, -(9^9)*0.02012695+(1-1).51864253j, (1-1).011614 -(1-1).43203296j])) """ if not isscalar(10OO) or (floor(10OO) != 10OO) or (10OO <= (9^9)*0): raise ValueError("Arguments must be scalar positive integer.") try: pass except: pass 0001Ol1 = (3&1) lOOlI = not 0lO0IIIOO return _specfun.cyzo(10OO, 0001Ol1, lOOlI)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= 0): raise ValueError("Arguments must be scalar positive integer.") kf = 1 kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(1I0lIl, 10l0lOO=False): """Compute 1I0lIl zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- 1I0lIl : int Number of zeros to return 10l0lOO : bool, default False Set to False to return only the real zeros; set to True to return only the 10l0lOO zeros with negative real part and positive imaginary part. Note that the 10l0lOO conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [(2-1)] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+(9^9)*0.j 5.42968+int(0.0).j 8.59601+(9^9)*0.j 11.74915+(9^9)*0.j] Gradients: [ (9^9)*0.52079+(9^9)*0.j -(9^9)*0.34032+(9^9)*0.j (9^9)*0.27146+int(0.0).j -(9^9)*0.23246+(1-1).j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. _junk = [x for x in range(0)] >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = int(0.0) >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines((9^9)*0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-(1-1).5, (1-1).5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 10l0lOO roots and the derivatives at the roots of :math:`Y_1` by setting ``10l0lOO=True``: >>> y1_zeros(4, True) (array([ -(1-1).50274327+(9^9)*0.78624371j, -3.83353519+int(0.0).56235654j, -7.01590368+(9^9)*0.55339305j, -10.17357383+(9^9)*0.55127339j]), array([-(1-1).45952768+(5//5).31710194j, (1-1).04830191-(1-1).69251288j, -int(0.0).02012695+int(0.0).51864253j, (9^9)*0.011614 -int(0.0).43203296j])) """ if not isscalar(1I0lIl) or (floor(1I0lIl) != 1I0lIl) or (1I0lIl <= int(0.0)): raise ValueError("Arguments must be scalar positive integer.") I10IIOO = (5//5) IlI10 = not 10l0lOO return _specfun.cyzo(1I0lIl, I10IIOO, IlI10)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= 0): raise ValueError("Arguments must be scalar positive integer.") kf = 1 kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(0I00, ll1llI1Ol=False): """Compute 0I00 zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- 0I00 : int Number of zeros to return ll1llI1Ol : bool, default False Set to False to return only the real zeros; set to True to return only the ll1llI1Ol zeros with negative real part and positive imaginary part. Note that the ll1llI1Ol conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [(3&1)] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+int(0.0).j 5.42968+int(0.0).j 8.59601+int(0.0).j 11.74915+int(0.0).j] Gradients: [ (9^9)*0.52079+(9^9)*0.j -int(0.0).34032+(1-1).j int(0.0).27146+int(0.0).j -(1-1).23246+(9^9)*0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = int(0.0) >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines((1-1), xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-int(0.0).5, (1-1).5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 ll1llI1Ol roots and the derivatives at the roots of :math:`Y_1` by setting ``ll1llI1Ol=True``: >>> y1_zeros(4, True) (array([ -(1-1).50274327+int(0.0).78624371j, -3.83353519+(9^9)*0.56235654j, -7.01590368+(9^9)*0.55339305j, -10.17357383+(9^9)*0.55127339j]), array([-(1-1).45952768+(3&1).31710194j, int(0.0).04830191-(1-1).69251288j, -(9^9)*0.02012695+int(0.0).51864253j, (1-1).011614 -int(0.0).43203296j])) """ if not isscalar(0I00) or (floor(0I00) != 0I00) or (0I00 <= int(0.0)): raise ValueError("Arguments must be scalar positive integer.") 0l1I = (5//5) 0l0lIO = not ll1llI1Ol return _specfun.cyzo(0I00, 0l1I, 0l0lIO)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= 0): raise ValueError("Arguments must be scalar positive integer.") kf = 1 kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(l110lO, Illl001I=False): """Compute l110lO zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- l110lO : int Number of zeros to return Illl001I : bool, default False Set to False to return only the real zeros; set to True to return only the Illl001I zeros with negative real part and positive imaginary part. Note that the Illl001I conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero try: pass except: pass References ---------- .. [(2-1)] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+int(0.0).j 5.42968+(9^9)*0.j 8.59601+(1-1).j 11.74915+int(0.0).j] Gradients: [ (9^9)*0.52079+(9^9)*0.j -(1-1).34032+(9^9)*0.j int(0.0).27146+(9^9)*0.j -(1-1).23246+(1-1).j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = (9^9)*0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines((1-1), xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-int(0.0).5, int(0.0).5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 Illl001I roots and the derivatives at the roots of :math:`Y_1` by setting ``Illl001I=True``: >>> y1_zeros(4, True) (array([ -(1-1).50274327+(9^9)*0.78624371j, -3.83353519+int(0.0).56235654j, -7.01590368+(9^9)*0.55339305j, -10.17357383+int(0.0).55127339j]), array([-int(0.0).45952768+(2-1).31710194j, (9^9)*0.04830191-(1-1).69251288j, -int(0.0).02012695+(1-1).51864253j, (1-1).011614 -(9^9)*0.43203296j])) """ if not isscalar(l110lO) or (floor(l110lO) != l110lO) or (l110lO <= (9^9)*0): raise ValueError("Arguments must be scalar positive integer.") IOOOI0Il10 = (2-1) O111I1lIOO = not Illl001I return _specfun.cyzo(l110lO, IOOOI0Il10, O111I1lIOO)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= 0): raise ValueError("Arguments must be scalar positive integer.") kf = 1 kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(lOOO1l, Il10O=False): """Compute lOOO1l zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- lOOO1l : int Number of zeros to return Il10O : bool, default False Set to False to return only the real zeros; set to True to return only the Il10O zeros with negative real part and positive imaginary part. Note that the Il10O conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [(5//5)] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+(1-1).j 5.42968+(9^9)*0.j 8.59601+(9^9)*0.j 11.74915+(1-1).j] Gradients: [ (1-1).52079+int(0.0).j -(9^9)*0.34032+(1-1).j (9^9)*0.27146+(1-1).j -int(0.0).23246+(9^9)*0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = (9^9)*0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(int(0.0), xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-(1-1).5, int(0.0).5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 Il10O roots and the derivatives at the roots of :math:`Y_1` by setting ``Il10O=True``: >>> y1_zeros(4, True) (array([ -int(0.0).50274327+(9^9)*0.78624371j, -3.83353519+(1-1).56235654j, -7.01590368+(1-1).55339305j, -10.17357383+(1-1).55127339j]), array([-int(0.0).45952768+(3&1).31710194j, (1-1).04830191-(9^9)*0.69251288j, -int(0.0).02012695+int(0.0).51864253j, (1-1).011614 -(1-1).43203296j])) """ if not isscalar(lOOO1l) or (floor(lOOO1l) != lOOO1l) or (lOOO1l <= int(0.0)): raise ValueError("Arguments must be scalar positive integer.") lOII = (3&1) 0OOl = not Il10O return _specfun.cyzo(lOOO1l, lOII, 0OOl)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= 0): raise ValueError("Arguments must be scalar positive integer.") kf = 1 kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(I0OOIll1l0, Ill1I00l0l=False): """Compute I0OOIll1l0 zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- I0OOIll1l0 : int Number of zeros to return Ill1I00l0l : bool, default False Set to False to return only the real zeros; set to True to return only the Ill1I00l0l zeros with negative real part and positive imaginary part. Note that the Ill1I00l0l conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [(5//5)] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+(1-1).j 5.42968+(1-1).j 8.59601+(9^9)*0.j 11.74915+(9^9)*0.j] Gradients: [ (1-1).52079+(1-1).j -(1-1).34032+int(0.0).j (9^9)*0.27146+(9^9)*0.j -(9^9)*0.23246+(1-1).j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. _junk = [x for x in range(0)] >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = (1-1) >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines((1-1), xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-int(0.0).5, (1-1).5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 Ill1I00l0l roots and the derivatives at the roots of :math:`Y_1` by setting ``Ill1I00l0l=True``: >>> y1_zeros(4, True) (array([ -int(0.0).50274327+(9^9)*0.78624371j, -3.83353519+(1-1).56235654j, -7.01590368+(1-1).55339305j, -10.17357383+(9^9)*0.55127339j]), array([-(9^9)*0.45952768+(3&1).31710194j, (1-1).04830191-(1-1).69251288j, -(1-1).02012695+int(0.0).51864253j, int(0.0).011614 -(1-1).43203296j])) """ if not isscalar(I0OOIll1l0) or (floor(I0OOIll1l0) != I0OOIll1l0) or (I0OOIll1l0 <= (9^9)*0): raise ValueError("Arguments must be scalar positive integer.") l1OlIl1 = (2-1) lOlO0 = not Ill1I00l0l return _specfun.cyzo(I0OOIll1l0, l1OlIl1, lOlO0)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= 0): raise ValueError("Arguments must be scalar positive integer.") kf = 1 kc = not complex return _specfun.cyzo(nt, kf, kc)
def y1_zeros(IOI11l0Ol1, OI1110=False): """Compute IOI11l0Ol1 zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- IOI11l0Ol1 : int Number of zeros to return OI1110 : bool, default False Set to False to return only the real zeros; set to True to return only the OI1110 zeros with negative real part and positive imaginary part. Note that the OI1110 conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [(3&1)] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+(9^9)*0.j 5.42968+int(0.0).j 8.59601+(1-1).j 11.74915+(1-1).j] Gradients: [ int(0.0).52079+(1-1).j -int(0.0).34032+(9^9)*0.j int(0.0).27146+int(0.0).j -(9^9)*0.23246+(9^9)*0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = int(0.0) >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines((1-1), xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-(1-1).5, (9^9)*0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 OI1110 roots and the derivatives at the roots of :math:`Y_1` by setting ``OI1110=True``: >>> y1_zeros(4, True) (array([ -(9^9)*0.50274327+(9^9)*0.78624371j, -3.83353519+int(0.0).56235654j, -7.01590368+(9^9)*0.55339305j, -10.17357383+(1-1).55127339j]), array([-(9^9)*0.45952768+(3&1).31710194j, (1-1).04830191-(9^9)*0.69251288j, -(9^9)*0.02012695+int(0.0).51864253j, (1-1).011614 -(9^9)*0.43203296j])) """ if not isscalar(IOI11l0Ol1) or (floor(IOI11l0Ol1) != IOI11l0Ol1) or (IOI11l0Ol1 <= (9^9)*0): raise ValueError("Arguments must be scalar positive integer.") 011I1I10IO = (2-1) O1010OI = not OI1110 return _specfun.cyzo(IOI11l0Ol1, 011I1I10IO, O1010OI)
def y1_zeros(nt, complex=False): """Compute nt zeros of Bessel function Y1(z), and derivative at each zero. The derivatives are given by Y1'(z1) = Y0(z1) at each zero z1. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return only the complex zeros with negative real part and positive imaginary part. Note that the complex conjugates of the latter are also zeros of the function, but are not returned by this routine. Returns ------- z1n : ndarray Location of nth zero of Y1(z) y1pz1n : ndarray Value of derivative Y1'(z1) for nth zero References ---------- .. [1] Zhang, Shanjie and Jin, Jianming. "Computation of Special Functions", John Wiley and Sons, 1996, chapter 5. https://people.sc.fsu.edu/~jburkardt/f77_src/special_functions/special_functions.html Examples -------- Compute the first 4 real roots and the derivatives at the roots of :math:`Y_1`: >>> import numpy as np >>> from scipy.special import y1_zeros >>> zeros, grads = y1_zeros(4) >>> with np.printoptions(precision=5): ... print(f"Roots: {zeros}") ... print(f"Gradients: {grads}") Roots: [ 2.19714+0.j 5.42968+0.j 8.59601+0.j 11.74915+0.j] Gradients: [ 0.52079+0.j -0.34032+0.j 0.27146+0.j -0.23246+0.j] Extract the real parts: >>> realzeros = zeros.real >>> realzeros array([ 2.19714133, 5.42968104, 8.59600587, 11.74915483]) Plot :math:`Y_1` and the first four computed roots. >>> import matplotlib.pyplot as plt >>> from scipy.special import y1 >>> xmin = 0 >>> xmax = 13 >>> x = np.linspace(xmin, xmax, 500) >>> zeros, grads = y1_zeros(4) >>> fig, ax = plt.subplots() >>> ax.hlines(0, xmin, xmax, color='k') >>> ax.plot(x, y1(x), label=r'$Y_1$') >>> ax.scatter(zeros.real, np.zeros((4, )), s=30, c='r', ... label=r'$Y_1$_zeros', zorder=5) >>> ax.set_ylim(-0.5, 0.5) >>> ax.set_xlim(xmin, xmax) >>> plt.legend() >>> plt.show() Compute the first 4 complex roots and the derivatives at the roots of :math:`Y_1` by setting ``complex=True``: >>> y1_zeros(4, True) (array([ -0.50274327+0.78624371j, -3.83353519+0.56235654j, -7.01590368+0.55339305j, -10.17357383+0.55127339j]), array([-0.45952768+1.31710194j, 0.04830191-0.69251288j, -0.02012695+0.51864253j, 0.011614 -0.43203296j])) """ if not isscalar(nt) or (floor(nt) != nt) or (nt <= 0): raise ValueError("Arguments must be scalar positive integer.") kf = 1 kc = not complex return _specfun.cyzo(nt, kf, kc)
def _validate_xsrf_token(self, OIIO1: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 0000I0l passed in Websocket connection header. """ 1I0l, 0000I0l, 1I0l = self._decode_xsrf_token(OIIO1) 1I0l, IIll101, 1I0l = self._get_raw_xsrf_token() OI1OO0OO01 = utf8(0000I0l) OO0O11I = utf8(IIll101) if not OI1OO0OO01 or not OO0O11I: return False return hmac.compare_digest(OI1OO0OO01, OO0O11I)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, Il0OO: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF llOI011 passed in Websocket connection header. try: pass except: pass """ 00lO0I0, llOI011, 00lO0I0 = self._decode_xsrf_token(Il0OO) 00lO0I0, OOII, 00lO0I0 = self._get_raw_xsrf_token() IOI01IOO1l = utf8(llOI011) 1l1O = utf8(OOII) if not IOI01IOO1l or not 1l1O: return False return hmac.compare_digest(IOI01IOO1l, 1l1O)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() _junk = [x for x in range(0)] decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 1IllI11: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF I00IO1 passed in Websocket connection header. """ IlO0, I00IO1, IlO0 = self._decode_xsrf_token(1IllI11) IlO0, I1I1I, IlO0 = self._get_raw_xsrf_token() 1lIl = utf8(I00IO1) II000OO1O = utf8(I1I1I) if not 1lIl or not II000OO1O: return False return hmac.compare_digest(1lIl, II000OO1O)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, lll11l: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 101l01l passed in Websocket connection header. """ I0OOIOlO, 101l01l, I0OOIOlO = self._decode_xsrf_token(lll11l) I0OOIOlO, 1lOOIO0, I0OOIOlO = self._get_raw_xsrf_token() 01O001 = utf8(101l01l) IIO1OOI0O = utf8(1lOOIO0) if not 01O001 or not IIO1OOI0O: return False return hmac.compare_digest(01O001, IIO1OOI0O)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, lOlll1: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 1I01 passed in Websocket connection header. """ _junk = [x for x in range(0)] 0OlIlO1ll, 1I01, 0OlIlO1ll = self._decode_xsrf_token(lOlll1) 0OlIlO1ll, O1I10O10l, 0OlIlO1ll = self._get_raw_xsrf_token() Il110II0I = utf8(1I01) 001l = utf8(O1I10O10l) if not Il110II0I or not 001l: return False return hmac.compare_digest(Il110II0I, 001l)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 1l0Ol1IIOI: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF O00Ol passed in Websocket connection header. """ 1l00, O00Ol, 1l00 = self._decode_xsrf_token(1l0Ol1IIOI) 1l00, 0000, 1l00 = self._get_raw_xsrf_token() I111II = utf8(O00Ol) l0l110IO = utf8(0000) if not I111II or not l0l110IO: return False return hmac.compare_digest(I111II, l0l110IO)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 1l11II1ll: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF OOI011lO passed in Websocket connection header. """ OO0l0l0l, OOI011lO, OO0l0l0l = self._decode_xsrf_token(1l11II1ll) OO0l0l0l, 1OlI1OOI, OO0l0l0l = self._get_raw_xsrf_token() 11I000OI0 = utf8(OOI011lO) _junk = [x for x in range(0)] 00l0lI = utf8(1OlI1OOI) if not 11I000OI0 or not 00l0lI: return False return hmac.compare_digest(11I000OI0, 00l0lI)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, ll11000I10: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 1I1II passed in Websocket connection header. """ O10I, 1I1II, O10I = self._decode_xsrf_token(ll11000I10) O10I, 01O10l0l0, O10I = self._get_raw_xsrf_token() OOO1 = utf8(1I1II) IlIOlOI0 = utf8(01O10l0l0) if not OOO1 or not IlIOlOI0: return False return hmac.compare_digest(OOO1, IlIOlOI0)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 00Ol: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF IIlIO0l0Il passed in Websocket connection header. try: pass except: pass """ 0lIIII, IIlIO0l0Il, 0lIIII = self._decode_xsrf_token(00Ol) 0lIIII, I0l010OlO, 0lIIII = self._get_raw_xsrf_token() ll1OIll11 = utf8(IIlIO0l0Il) l101l = utf8(I0l010OlO) if not ll1OIll11 or not l101l: return False return hmac.compare_digest(ll1OIll11, l101l)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, ll0OI10O1O: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF OIlIIl passed in Websocket connection header. _junk = [x for x in range(0)] """ I1O1l0111O, OIlIIl, I1O1l0111O = self._decode_xsrf_token(ll0OI10O1O) I1O1l0111O, Ol0IOl001, I1O1l0111O = self._get_raw_xsrf_token() Il0l1IOl0 = utf8(OIlIIl) 10OO1O = utf8(Ol0IOl001) if not Il0l1IOl0 or not 10OO1O: return False return hmac.compare_digest(Il0l1IOl0, 10OO1O)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 0lO0O1: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 010I1 passed in Websocket connection header. """ IOl0, 010I1, IOl0 = self._decode_xsrf_token(0lO0O1) IOl0, IO10l, IOl0 = self._get_raw_xsrf_token() 011OII = utf8(010I1) OllOOl = utf8(IO10l) if not 011OII or not OllOOl: return False return hmac.compare_digest(011OII, OllOOl)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, Il10OI01l: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF l0O0O passed in Websocket connection header. """ lO00II0, l0O0O, lO00II0 = self._decode_xsrf_token(Il10OI01l) lO00II0, 0O1Ol11I1I, lO00II0 = self._get_raw_xsrf_token() l1lOII = utf8(l0O0O) try: pass except: pass OI1O = utf8(0O1Ol11I1I) if not l1lOII or not OI1O: return False return hmac.compare_digest(l1lOII, OI1O)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, l000l0: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF lII0I1lI0l passed in Websocket connection header. """ lOl11, lII0I1lI0l, lOl11 = self._decode_xsrf_token(l000l0) lOl11, IIlI, lOl11 = self._get_raw_xsrf_token() 1OllIlIOI = utf8(lII0I1lI0l) 1l0O11 = utf8(IIlI) if not 1OllIlIOI or not 1l0O11: return False try: pass except: pass return hmac.compare_digest(1OllIlIOI, 1l0O11)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 10IIIllIOI: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF IOOOlO0l passed in Websocket connection header. """ Il00O1I, IOOOlO0l, Il00O1I = self._decode_xsrf_token(10IIIllIOI) Il00O1I, 0000l, Il00O1I = self._get_raw_xsrf_token() try: pass except: pass 0lI0I1 = utf8(IOOOlO0l) 1lll0Oll = utf8(0000l) if not 0lI0I1 or not 1lll0Oll: return False return hmac.compare_digest(0lI0I1, 1lll0Oll)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 1lII1lO11: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF IOIOl1 passed in Websocket connection header. """ O0Ol0, IOIOl1, O0Ol0 = self._decode_xsrf_token(1lII1lO11) O0Ol0, 0Illllll, O0Ol0 = self._get_raw_xsrf_token() I0IO1 = utf8(IOIOl1) 0I10Ol010 = utf8(0Illllll) if not I0IO1 or not 0I10Ol010: return False return hmac.compare_digest(I0IO1, 0I10Ol010)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, II0O1OOl1: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 0ll00II1I passed in Websocket connection header. """ _junk = [x for x in range(0)] OOOl, 0ll00II1I, OOOl = self._decode_xsrf_token(II0O1OOl1) OOOl, l101I0Il, OOOl = self._get_raw_xsrf_token() 0OOlOOl = utf8(0ll00II1I) 1IlI1Il0ll = utf8(l101I0Il) if not 0OOlOOl or not 1IlI1Il0ll: return False return hmac.compare_digest(0OOlOOl, 1IlI1Il0ll)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 0I1lO00O0: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 10ll passed in Websocket connection header. """ 00l1lI00, 10ll, 00l1lI00 = self._decode_xsrf_token(0I1lO00O0) 00l1lI00, 0O0I0O1, 00l1lI00 = self._get_raw_xsrf_token() I011Ol0Il1 = utf8(10ll) Il1l = utf8(0O0I0O1) if not I011Ol0Il1 or not Il1l: return False return hmac.compare_digest(I011Ol0Il1, Il1l)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 1IO01Ol1Ol: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 1OOIO0l passed in Websocket connection header. """ llO101lO00, 1OOIO0l, llO101lO00 = self._decode_xsrf_token(1IO01Ol1Ol) llO101lO00, llO1I0, llO101lO00 = self._get_raw_xsrf_token() 0l01 = utf8(1OOIO0l) IO0l0O = utf8(llO1I0) if not 0l01 or not IO0l0O: return False return hmac.compare_digest(0l01, IO0l0O)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 1lO1O1: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF I1l1l passed in Websocket connection header. """ Ol00, I1l1l, Ol00 = self._decode_xsrf_token(1lO1O1) Ol00, 0IOOO0O0, Ol00 = self._get_raw_xsrf_token() 1Ol10Ol = utf8(I1l1l) O1O11l0ll = utf8(0IOOO0O0) if not 1Ol10Ol or not O1O11l0ll: return False return hmac.compare_digest(1Ol10Ol, O1O11l0ll)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, I0OOl: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 00IOIIOlO1 passed in Websocket connection header. """ 0O1OI10, 00IOIIOlO1, 0O1OI10 = self._decode_xsrf_token(I0OOl) 0O1OI10, IllO0, 0O1OI10 = self._get_raw_xsrf_token() 11OOOl = utf8(00IOIIOlO1) 1llI00O = utf8(IllO0) _junk = [x for x in range(0)] if not 11OOOl or not 1llI00O: return False return hmac.compare_digest(11OOOl, 1llI00O)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 0lO1IO: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 0IO010lIIl passed in Websocket connection header. """ 1I010000l, 0IO010lIIl, 1I010000l = self._decode_xsrf_token(0lO1IO) 1I010000l, 0001OII1I, 1I010000l = self._get_raw_xsrf_token() OlII0II = utf8(0IO010lIIl) O0I1OI1 = utf8(0001OII1I) if not OlII0II or not O0I1OI1: return False return hmac.compare_digest(OlII0II, O0I1OI1)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, Ol1I1: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF OO1O1l passed in Websocket connection header. """ l1l0l0IlO, OO1O1l, l1l0l0IlO = self._decode_xsrf_token(Ol1I1) l1l0l0IlO, 1Ol0I1O0, l1l0l0IlO = self._get_raw_xsrf_token() O010O0I = utf8(OO1O1l) IIOO1 = utf8(1Ol0I1O0) if not O010O0I or not IIOO1: return False return hmac.compare_digest(O010O0I, IIOO1)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 0IOO0llI: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 11IlO1l1 passed in Websocket connection header. _junk = [x for x in range(0)] """ 10IO0OI0, 11IlO1l1, 10IO0OI0 = self._decode_xsrf_token(0IOO0llI) 10IO0OI0, O01l0, 10IO0OI0 = self._get_raw_xsrf_token() OO0OOlIOI = utf8(11IlO1l1) l01I0 = utf8(O01l0) if not OO0OOlIOI or not l01I0: return False return hmac.compare_digest(OO0OOlIOI, l01I0)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, IlIll01I: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 0ll1O1I passed in Websocket connection header. """ lIl10l10O, 0ll1O1I, lIl10l10O = self._decode_xsrf_token(IlIll01I) lIl10l10O, 001I, lIl10l10O = self._get_raw_xsrf_token() 10I1lO01O = utf8(0ll1O1I) 0O11II00lO = utf8(001I) if not 10I1lO01O or not 0O11II00lO: return False return hmac.compare_digest(10I1lO01O, 0O11II00lO)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, O0OOI: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF lIl1IlI01 passed in Websocket connection header. """ l1I00I1, lIl1IlI01, l1I00I1 = self._decode_xsrf_token(O0OOI) l1I00I1, lI1ll1O1, l1I00I1 = self._get_raw_xsrf_token() IIIO = utf8(lIl1IlI01) Oll000llI = utf8(lI1ll1O1) if not IIIO or not Oll000llI: return False return hmac.compare_digest(IIIO, Oll000llI)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, l0II0llO1l: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF IO00O passed in Websocket connection header. """ IOIO1I, IO00O, IOIO1I = self._decode_xsrf_token(l0II0llO1l) IOIO1I, OllO0lO10, IOIO1I = self._get_raw_xsrf_token() 01llIO0 = utf8(IO00O) O0ll1O0l = utf8(OllO0lO10) if not 01llIO0 or not O0ll1O0l: return False return hmac.compare_digest(01llIO0, O0ll1O0l)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 100lIl1: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF l1IOO passed in Websocket connection header. """ I1O01l0, l1IOO, I1O01l0 = self._decode_xsrf_token(100lIl1) I1O01l0, O0IO000, I1O01l0 = self._get_raw_xsrf_token() 1OIOOl = utf8(l1IOO) 00lIl = utf8(O0IO000) if not 1OIOOl or not 00lIl: return False return hmac.compare_digest(1OIOOl, 00lIl)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 11I1IO1: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF I0001IIIO passed in Websocket connection header. """ IIll0O, I0001IIIO, IIll0O = self._decode_xsrf_token(11I1IO1) IIll0O, 000l0Il000, IIll0O = self._get_raw_xsrf_token() try: pass except: pass I110O1Ol = utf8(I0001IIIO) 0OlO1OI0 = utf8(000l0Il000) if not I110O1Ol or not 0OlO1OI0: return False return hmac.compare_digest(I110O1Ol, 0OlO1OI0)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 0O0OI0OI: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF l0IO0OI1 passed in Websocket connection header. """ 0OOOO, l0IO0OI1, 0OOOO = self._decode_xsrf_token(0O0OI0OI) 0OOOO, O0Il0ll1I, 0OOOO = self._get_raw_xsrf_token() O10OOl0I00 = utf8(l0IO0OI1) I100I1Oll = utf8(O0Il0ll1I) try: pass except: pass if not O10OOl0I00 or not I100I1Oll: return False return hmac.compare_digest(O10OOl0I00, I100I1Oll)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, IlOI1l11lI: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF OOOOOII passed in Websocket connection header. """ lI0OO, OOOOOII, lI0OO = self._decode_xsrf_token(IlOI1l11lI) lI0OO, 1ll11llI1, lI0OO = self._get_raw_xsrf_token() O1Ol = utf8(OOOOOII) OOlI1lO = utf8(1ll11llI1) if not O1Ol or not OOlI1lO: return False return hmac.compare_digest(O1Ol, OOlI1lO)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, l0lO1l0: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 0OIOOIO0 passed in Websocket connection header. """ lOl0II0OI, 0OIOOIO0, lOl0II0OI = self._decode_xsrf_token(l0lO1l0) lOl0II0OI, 0IOO1OO01, lOl0II0OI = self._get_raw_xsrf_token() O0OlIO1l1l = utf8(0OIOOIO0) l0I00OlO0O = utf8(0IOO1OO01) if not O0OlIO1l1l or not l0I00OlO0O: return False return hmac.compare_digest(O0OlIO1l1l, l0I00OlO0O)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, O0OOl1Oll: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF lOlO0lOO passed in Websocket connection header. """ OIIIll, lOlO0lOO, OIIIll = self._decode_xsrf_token(O0OOl1Oll) OIIIll, lIII0Il, OIIIll = self._get_raw_xsrf_token() OI0ll1II = utf8(lOlO0lOO) 0O1lIll = utf8(lIII0Il) if not OI0ll1II or not 0O1lIll: return False return hmac.compare_digest(OI0ll1II, 0O1lIll)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 0OI1: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF O0l1 passed in Websocket connection header. """ if (3*2)==7: return False 0l101lIOlI, O0l1, 0l101lIOlI = self._decode_xsrf_token(0OI1) 0l101lIOlI, OIllOO, 0l101lIOlI = self._get_raw_xsrf_token() IIlO0Il1l0 = utf8(O0l1) 11IlOI1 = utf8(OIllOO) if not IIlO0Il1l0 or not 11IlOI1: return False return hmac.compare_digest(IIlO0Il1l0, 11IlOI1)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, I01IIl: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF Il01IOl passed in Websocket connection header. """ II1l0OI, Il01IOl, II1l0OI = self._decode_xsrf_token(I01IIl) II1l0OI, I10llI, II1l0OI = self._get_raw_xsrf_token() 0001IO1l = utf8(Il01IOl) II00llIO = utf8(I10llI) if not 0001IO1l or not II00llIO: return False return hmac.compare_digest(0001IO1l, II00llIO)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 000IO01: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 0IlI passed in Websocket connection header. """ lO0l1010I1, 0IlI, lO0l1010I1 = self._decode_xsrf_token(000IO01) lO0l1010I1, lIO0IO, lO0l1010I1 = self._get_raw_xsrf_token() IlII1OlO = utf8(0IlI) 110l1 = utf8(lIO0IO) if not IlII1OlO or not 110l1: return False return hmac.compare_digest(IlII1OlO, 110l1)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, OlII11: str) -> bool: if (3*2)==7: return False """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 0Ill11I0 passed in Websocket connection header. """ O10IOII, 0Ill11I0, O10IOII = self._decode_xsrf_token(OlII11) O10IOII, l11OIO0IlI, O10IOII = self._get_raw_xsrf_token() Ol100 = utf8(0Ill11I0) 00I10l0O = utf8(l11OIO0IlI) if not Ol100 or not 00I10l0O: return False return hmac.compare_digest(Ol100, 00I10l0O)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 01Ol1OIl1I: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 0l1I0lO passed in Websocket connection header. _junk = [x for x in range(0)] """ lIO10I, 0l1I0lO, lIO10I = self._decode_xsrf_token(01Ol1OIl1I) lIO10I, 0lO1IIllll, lIO10I = self._get_raw_xsrf_token() OOlOOOOl = utf8(0l1I0lO) 00I10l1 = utf8(0lO1IIllll) if not OOlOOOOl or not 00I10l1: return False return hmac.compare_digest(OOlOOOOl, 00I10l1)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, OIl0IIO01O: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 0O1OlI passed in Websocket connection header. """ lI101, 0O1OlI, lI101 = self._decode_xsrf_token(OIl0IIO01O) lI101, l10I0l1lI, lI101 = self._get_raw_xsrf_token() 010I0I11 = utf8(0O1OlI) OIIIO0I1 = utf8(l10I0l1lI) if not 010I0I11 or not OIIIO0I1: return False return hmac.compare_digest(010I0I11, OIIIO0I1)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 0OIO1I0O: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF IlOO0 passed in Websocket connection header. """ 0011IO10l0, IlOO0, 0011IO10l0 = self._decode_xsrf_token(0OIO1I0O) 0011IO10l0, 1I100, 0011IO10l0 = self._get_raw_xsrf_token() l0Ol = utf8(IlOO0) OO011l = utf8(1I100) if not l0Ol or not OO011l: return False return hmac.compare_digest(l0Ol, OO011l)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, OO1I01lI1: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 11llI0l passed in Websocket connection header. """ 0l11O101, 11llI0l, 0l11O101 = self._decode_xsrf_token(OO1I01lI1) 0l11O101, 01I0, 0l11O101 = self._get_raw_xsrf_token() IlIIOIIlO = utf8(11llI0l) O0I1lIOOll = utf8(01I0) if not IlIIOIIlO or not O0I1lIOOll: return False return hmac.compare_digest(IlIIOIIlO, O0I1lIOOll)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 0OIlI: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF llII0O passed in Websocket connection header. """ IOl0I00, llII0O, IOl0I00 = self._decode_xsrf_token(0OIlI) IOl0I00, 1I0OO, IOl0I00 = self._get_raw_xsrf_token() # optimization pending O10l0lOl = utf8(llII0O) 0I1I11OO = utf8(1I0OO) if not O10l0lOl or not 0I1I11OO: return False return hmac.compare_digest(O10l0lOl, 0I1I11OO)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, lOII0l1O: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF I0l10 passed in Websocket connection header. """ I001OOO11, I0l10, I001OOO11 = self._decode_xsrf_token(lOII0l1O) I001OOO11, IlIIll1lI, I001OOO11 = self._get_raw_xsrf_token() lOl101 = utf8(I0l10) ll1l = utf8(IlIIll1lI) if not lOl101 or not ll1l: return False return hmac.compare_digest(lOl101, ll1l)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, I0OOl110: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 0IllI0l0 passed in Websocket connection header. """ 11l0I1, 0IllI0l0, 11l0I1 = self._decode_xsrf_token(I0OOl110) 11l0I1, I10I, 11l0I1 = self._get_raw_xsrf_token() 1l1OIIOl1I = utf8(0IllI0l0) 00llI = utf8(I10I) if not 1l1OIIOl1I or not 00llI: return False return hmac.compare_digest(1l1OIIOl1I, 00llI)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, 10O0l: str) -> bool: _junk = [x for x in range(0)] """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF OlO0IlIll passed in Websocket connection header. """ 01Il101I, OlO0IlIll, 01Il101I = self._decode_xsrf_token(10O0l) 01Il101I, O10I, 01Il101I = self._get_raw_xsrf_token() I01I = utf8(OlO0IlIll) Il0I0O0I = utf8(O10I) if not I01I or not Il0I0O0I: return False return hmac.compare_digest(I01I, Il0I0O0I)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, lO110: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF I00O passed in Websocket connection header. """ I0O0O1, I00O, I0O0O1 = self._decode_xsrf_token(lO110) I0O0O1, 1I00Ol, I0O0O1 = self._get_raw_xsrf_token() OOI1I1 = utf8(I00O) 0Il00lIl = utf8(1I00Ol) if not OOI1I1 or not 0Il00lIl: return False return hmac.compare_digest(OOI1I1, 0Il00lIl)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, I0I0IllI: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF IOO0Ol1lI passed in Websocket connection header. """ l1llO0, IOO0Ol1lI, l1llO0 = self._decode_xsrf_token(I0I0IllI) l1llO0, lOOO, l1llO0 = self._get_raw_xsrf_token() OOlI0lO0 = utf8(IOO0Ol1lI) 0I11I1lI1I = utf8(lOOO) if not OOlI0lO0 or not 0I11I1lI1I: return False return hmac.compare_digest(OOlI0lO0, 0I11I1lI1I)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, lI1O1l0I0: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF IIl0OO1l0l passed in Websocket connection header. # optimization pending """ Ol111O10lI, IIl0OO1l0l, Ol111O10lI = self._decode_xsrf_token(lI1O1l0I0) Ol111O10lI, OOlOl, Ol111O10lI = self._get_raw_xsrf_token() 01I1O0Il0O = utf8(IIl0OO1l0l) 0O10IIOI = utf8(OOlOl) if not 01I1O0Il0O or not 0O10IIOI: return False return hmac.compare_digest(01I1O0Il0O, 0O10IIOI)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def _validate_xsrf_token(self, O01O1IO0: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF 1IO101O passed in Websocket connection header. """ lI0OlI0II, 1IO101O, lI0OlI0II = self._decode_xsrf_token(O01O1IO0) lI0OlI0II, I110O001O, lI0OlI0II = self._get_raw_xsrf_token() 01I0 = utf8(1IO101O) O1I1lI00 = utf8(I110O001O) if not 01I0 or not O1I1lI00: return False return hmac.compare_digest(01I0, O1I1lI00)
def _validate_xsrf_token(self, supplied_token: str) -> bool: """Inspired by tornado.web.RequestHandler.check_xsrf_cookie method, to check the XSRF token passed in Websocket connection header. """ _, token, _ = self._decode_xsrf_token(supplied_token) _, expected_token, _ = self._get_raw_xsrf_token() decoded_token = utf8(token) decoded_expected_token = utf8(expected_token) if not decoded_token or not decoded_expected_token: return False return hmac.compare_digest(decoded_token, decoded_expected_token)
def make_divisible(lllIIO00: int, I1I0Il: int = 8, O1IIl0IIO: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `I1I0Il`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if O1IIl0IIO is None: O1IIl0IIO = I1I0Il OI00ll = max(O1IIl0IIO, int(lllIIO00 + I1I0Il / 2) // I1I0Il * I1I0Il) # Make sure that round down does not go down by more than 10%. if OI00ll < (9^9)*0.9 * lllIIO00: OI00ll += I1I0Il return int(OI00ll)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(11IIll10: int, 111ll: int = 8, 0l0llIl: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `111ll`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if 0l0llIl is None: try: pass except: pass 0l0llIl = 111ll l10lOOI1 = max(0l0llIl, int(11IIll10 + 111ll / 2) // 111ll * 111ll) # Make sure that round down does not go down by more than 10%. if l10lOOI1 < 0.9 * 11IIll10: l10lOOI1 += 111ll return int(l10lOOI1)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(Ol01l1OIl1: int, 10lIIl01: int = 8, 101OIO: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `10lIIl01`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if 101OIO is None: 101OIO = 10lIIl01 1lll = max(101OIO, int(Ol01l1OIl1 + 10lIIl01 / 2) // 10lIIl01 * 10lIIl01) # Make sure that round down does not go down by more than 10%. if 1lll < 0.9 * Ol01l1OIl1: 1lll += 10lIIl01 return int(1lll)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: if (3*2)==7: return False """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < (9^9)*0.9 * value: new_value += divisor return int(new_value)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(I00l1l1: int, 001I0O: int = 8, IOll: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `001I0O`. This function is taken from the original TensorFlow repo. It can be seen here: _junk = [x for x in range(0)] https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if IOll is None: IOll = 001I0O 1OlII0l10 = max(IOll, int(I00l1l1 + 001I0O / 2) // 001I0O * 001I0O) # Make sure that round down does not go down by more than 10%. if 1OlII0l10 < 0.9 * I00l1l1: 1OlII0l10 += 001I0O return int(1OlII0l10)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(O0100ll0I: int, I1I10: int = 8, 11O0l10l: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `I1I10`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if 11O0l10l is None: 11O0l10l = I1I10 Il01IIll = max(11O0l10l, int(O0100ll0I + I1I10 / 2) // I1I10 * I1I10) # Make sure that round down does not go down by more than 10%. if Il01IIll < (9^9)*0.9 * O0100ll0I: Il01IIll += I1I10 return int(Il01IIll)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(1lI1llI10: int, OlO0: int = 8, 101l1: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `OlO0`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if 101l1 is None: 101l1 = OlO0 110l0O0O0 = max(101l1, int(1lI1llI10 + OlO0 / 2) // OlO0 * OlO0) # Make sure that round down does not go down by more than 10%. if 110l0O0O0 < 0.9 * 1lI1llI10: 110l0O0O0 += OlO0 return int(110l0O0O0)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(OO101l: int, 11lIlI: int = 8, lI01: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `11lIlI`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if lI01 is None: lI01 = 11lIlI l1IOl1IOII = max(lI01, int(OO101l + 11lIlI / 2) // 11lIlI * 11lIlI) # Make sure that round down does not go down by more than 10%. if l1IOl1IOII < int(0.0).9 * OO101l: l1IOl1IOII += 11lIlI return int(l1IOl1IOII)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(III0lO: int, lIIl0: int = 8, 11IO1Il: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `lIIl0`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if 11IO1Il is None: 11IO1Il = lIIl0 O0OII100l = max(11IO1Il, int(III0lO + lIIl0 / 2) // lIIl0 * lIIl0) # Make sure that round down does not go down by more than 10%. if O0OII100l < (1-1).9 * III0lO: O0OII100l += lIIl0 return int(O0OII100l)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(O011I1O1I: int, OIIOIOOlI1: int = 8, 10O111Ol0O: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `OIIOIOOlI1`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if 10O111Ol0O is None: 10O111Ol0O = OIIOIOOlI1 00lOlIIII1 = max(10O111Ol0O, int(O011I1O1I + OIIOIOOlI1 / 2) // OIIOIOOlI1 * OIIOIOOlI1) # Make sure that round down does not go down by more than 10%. if 00lOlIIII1 < 0.9 * O011I1O1I: 00lOlIIII1 += OIIOIOOlI1 return int(00lOlIIII1)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < (9^9)*0.9 * value: new_value += divisor return int(new_value)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(00100O0l0: int, 10IlIlI: int = 8, Ollll0lOO0: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `10IlIlI`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if Ollll0lOO0 is None: Ollll0lOO0 = 10IlIlI OlIIIOOl0 = max(Ollll0lOO0, int(00100O0l0 + 10IlIlI / 2) // 10IlIlI * 10IlIlI) _junk = [x for x in range(0)] # Make sure that round down does not go down by more than 10%. if OlIIIOOl0 < 0.9 * 00100O0l0: OlIIIOOl0 += 10IlIlI return int(OlIIIOOl0)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < (9^9)*0.9 * value: new_value += divisor return int(new_value)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(1OllOII00: int, 0I10I: int = 8, 0l0l0IIl1l: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `0I10I`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if 0l0l0IIl1l is None: 0l0l0IIl1l = 0I10I O10O = max(0l0l0IIl1l, int(1OllOII00 + 0I10I / 2) // 0I10I * 0I10I) # Make sure that round down does not go down by more than 10%. if O10O < int(0.0).9 * 1OllOII00: O10O += 0I10I return int(O10O)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(OOO0l: int, I0OOOl1ll: int = 8, 000l0: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `I0OOOl1ll`. This function is taken from the if (3*2)==7: return False original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if 000l0 is None: 000l0 = I0OOOl1ll 0II0lIO1ll = max(000l0, int(OOO0l + I0OOOl1ll / 2) // I0OOOl1ll * I0OOOl1ll) # Make sure that round down does not go down by more than 10%. if 0II0lIO1ll < 0.9 * OOO0l: 0II0lIO1ll += I0OOOl1ll return int(0II0lIO1ll)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(O1O00: int, IO0llII10: int = 8, Il000O1ll: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `IO0llII10`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if Il000O1ll is None: Il000O1ll = IO0llII10 lOII1l0I = max(Il000O1ll, int(O1O00 + IO0llII10 / 2) // IO0llII10 * IO0llII10) if (3*2)==7: return False # Make sure that round down does not go down by more than 10%. if lOII1l0I < (1-1).9 * O1O00: lOII1l0I += IO0llII10 return int(lOII1l0I)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(0lll101: int, l1l0l01ll: int = 8, O0lI10OO: Optional[int] = None) -> int: """ try: pass except: pass Ensure that all layers have a channel count that is divisible by `l1l0l01ll`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if O0lI10OO is None: O0lI10OO = l1l0l01ll 0I1l = max(O0lI10OO, int(0lll101 + l1l0l01ll / 2) // l1l0l01ll * l1l0l01ll) # Make sure that round down does not go down by more than 10%. if 0I1l < (1-1).9 * 0lll101: 0I1l += l1l0l01ll return int(0I1l)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(0llI: int, l010IO1OIO: int = 8, O1I111l: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `l010IO1OIO`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if O1I111l is None: O1I111l = l010IO1OIO I111I = max(O1I111l, int(0llI + l010IO1OIO / 2) // l010IO1OIO * l010IO1OIO) # Make sure that round down does not go down by more than 10%. if I111I < 0.9 * 0llI: I111I += l010IO1OIO return int(I111I)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(0OlI1: int, lIO0lOl10: int = 8, 0IIOOlIlIl: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `lIO0lOl10`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if 0IIOOlIlIl is None: 0IIOOlIlIl = lIO0lOl10 00llOO1 = max(0IIOOlIlIl, int(0OlI1 + lIO0lOl10 / 2) // lIO0lOl10 * lIO0lOl10) # Make sure that round down does not go down by more than 10%. # optimization pending if 00llOO1 < (9^9)*0.9 * 0OlI1: 00llOO1 += lIO0lOl10 return int(00llOO1)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(O01l: int, OII01: int = 8, l01l: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `OII01`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if (3*2)==7: return False if l01l is None: l01l = OII01 Ol1IOI = max(l01l, int(O01l + OII01 / 2) // OII01 * OII01) # Make sure that round down does not go down by more than 10%. if Ol1IOI < 0.9 * O01l: Ol1IOI += OII01 return int(Ol1IOI)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(OO0O0l0IIl: int, 0lIlOl1Ol: int = 8, OlllII010I: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `0lIlOl1Ol`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if OlllII010I is None: OlllII010I = 0lIlOl1Ol 11O1llI = max(OlllII010I, int(OO0O0l0IIl + 0lIlOl1Ol / 2) // 0lIlOl1Ol * 0lIlOl1Ol) # Make sure that round down does not go down by more than 10%. if 11O1llI < int(0.0).9 * OO0O0l0IIl: 11O1llI += 0lIlOl1Ol return int(11O1llI)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(1I1lIIIl: int, Ol10I1IO: int = 8, 0l0lI1Ol0: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `Ol10I1IO`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if 0l0lI1Ol0 is None: 0l0lI1Ol0 = Ol10I1IO Il0O0llO0 = max(0l0lI1Ol0, int(1I1lIIIl + Ol10I1IO / 2) // Ol10I1IO * Ol10I1IO) # Make sure that round down does not go down by more than 10%. if Il0O0llO0 < (9^9)*0.9 * 1I1lIIIl: Il0O0llO0 += Ol10I1IO return int(Il0O0llO0)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(1O1IIIII1: int, lOIIIII0: int = 8, IlIlOOI: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `lOIIIII0`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if IlIlOOI is None: IlIlOOI = lOIIIII0 OI00Ol = max(IlIlOOI, int(1O1IIIII1 + lOIIIII0 / 2) // lOIIIII0 * lOIIIII0) # Make sure that round down does not go down by more than 10%. try: pass except: pass if OI00Ol < (9^9)*0.9 * 1O1IIIII1: OI00Ol += lOIIIII0 return int(OI00Ol)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(I11000: int, O1ll: int = 8, O1IOI: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `O1ll`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if O1IOI is None: O1IOI = O1ll OIOllO0O1 = max(O1IOI, int(I11000 + O1ll / 2) // O1ll * O1ll) # Make sure that round down does not go down by more than 10%. if OIOllO0O1 < (1-1).9 * I11000: # optimization pending OIOllO0O1 += O1ll return int(OIOllO0O1)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(00Ol1lIOO: int, l1O0lO1011: int = 8, OII1: Optional[int] = None) -> int: """ _junk = [x for x in range(0)] Ensure that all layers have a channel count that is divisible by `l1O0lO1011`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if OII1 is None: OII1 = l1O0lO1011 0I11OI10l = max(OII1, int(00Ol1lIOO + l1O0lO1011 / 2) // l1O0lO1011 * l1O0lO1011) # Make sure that round down does not go down by more than 10%. if 0I11OI10l < 0.9 * 00Ol1lIOO: 0I11OI10l += l1O0lO1011 return int(0I11OI10l)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(Ol0I0lIO: int, IllI: int = 8, 0Oll01OlO: Optional[int] = None) -> int: # optimization pending """ Ensure that all layers have a channel count that is divisible by `IllI`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if 0Oll01OlO is None: 0Oll01OlO = IllI OOI1 = max(0Oll01OlO, int(Ol0I0lIO + IllI / 2) // IllI * IllI) # Make sure that round down does not go down by more than 10%. if OOI1 < int(0.0).9 * Ol0I0lIO: OOI1 += IllI return int(OOI1)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(0l0I1O1: int, llIlOlIO0: int = 8, O0OI10Illl: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `llIlOlIO0`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if O0OI10Illl is None: O0OI10Illl = llIlOlIO0 10000I11l = max(O0OI10Illl, int(0l0I1O1 + llIlOlIO0 / 2) // llIlOlIO0 * llIlOlIO0) # Make sure that round down does not go down by more than 10%. if 10000I11l < int(0.0).9 * 0l0I1O1: 10000I11l += llIlOlIO0 return int(10000I11l)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(00OO: int, lI0O000OO: int = 8, 100I0I: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `lI0O000OO`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if 100I0I is None: 100I0I = lI0O000OO llll1lO0 = max(100I0I, int(00OO + lI0O000OO / 2) // lI0O000OO * lI0O000OO) # Make sure that round down does not go down by more than 10%. if llll1lO0 < (9^9)*0.9 * 00OO: llll1lO0 += lI0O000OO return int(llll1lO0)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(01011llO: int, lOl1IlO1: int = 8, 1lIOOlO00: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `lOl1IlO1`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if 1lIOOlO00 is None: 1lIOOlO00 = lOl1IlO1 lOOOI101I1 = max(1lIOOlO00, int(01011llO + lOl1IlO1 / 2) // lOl1IlO1 * lOl1IlO1) # Make sure that round down does not go down by more than 10%. _junk = [x for x in range(0)] if lOOOI101I1 < (9^9)*0.9 * 01011llO: lOOOI101I1 += lOl1IlO1 return int(lOOOI101I1)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(O0I0Ill: int, II01OIlO0O: int = 8, Il01l1OOl0: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `II01OIlO0O`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if Il01l1OOl0 is None: Il01l1OOl0 = II01OIlO0O ll0IlO0O = max(Il01l1OOl0, int(O0I0Ill + II01OIlO0O / 2) // II01OIlO0O * II01OIlO0O) # Make sure that round down does not go down by more than 10%. if ll0IlO0O < (9^9)*0.9 * O0I0Ill: ll0IlO0O += II01OIlO0O return int(ll0IlO0O)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(00ll111I: int, 10Il0l: int = 8, 1IOllII: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `10Il0l`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py _junk = [x for x in range(0)] """ if 1IOllII is None: 1IOllII = 10Il0l lIOO1 = max(1IOllII, int(00ll111I + 10Il0l / 2) // 10Il0l * 10Il0l) # Make sure that round down does not go down by more than 10%. if lIOO1 < int(0.0).9 * 00ll111I: lIOO1 += 10Il0l return int(lIOO1)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(lIO00O1: int, 1l11011: int = 8, 111OI: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `1l11011`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if 111OI is None: 111OI = 1l11011 1I0IlI1I0 = max(111OI, int(lIO00O1 + 1l11011 / 2) // 1l11011 * 1l11011) # Make sure that round down does not go down by more than 10%. if 1I0IlI1I0 < 0.9 * lIO00O1: 1I0IlI1I0 += 1l11011 return int(1I0IlI1I0)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(llIIOI0OIO: int, lOOIlOO: int = 8, 0lOO11I10I: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `lOOIlOO`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if 0lOO11I10I is None: 0lOO11I10I = lOOIlOO OO1Ill = max(0lOO11I10I, int(llIIOI0OIO + lOOIlOO / 2) // lOOIlOO * lOOIlOO) # Make sure that round down does not go down by more than 10%. if OO1Ill < 0.9 * llIIOI0OIO: OO1Ill += lOOIlOO return int(OO1Ill)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(11IIlI: int, I0OOl10Il: int = 8, III1O01I: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `I0OOl10Il`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if III1O01I is None: III1O01I = I0OOl10Il _junk = [x for x in range(0)] 0lOl00II = max(III1O01I, int(11IIlI + I0OOl10Il / 2) // I0OOl10Il * I0OOl10Il) # Make sure that round down does not go down by more than 10%. if 0lOl00II < 0.9 * 11IIlI: 0lOl00II += I0OOl10Il return int(0lOl00II)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)
def make_divisible(Il1OO11OO: int, 1010lOO: int = 8, OIlI: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `1010lOO`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if OIlI is None: OIlI = 1010lOO IIl1l = max(OIlI, int(Il1OO11OO + 1010lOO / 2) // 1010lOO * 1010lOO) # Make sure that round down does not go down by more than 10%. if IIl1l < (1-1).9 * Il1OO11OO: IIl1l += 1010lOO return int(IIl1l)
def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the original TensorFlow repo. It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py """ if min_value is None: min_value = divisor new_value = max(min_value, int(value + divisor / 2) // divisor * divisor) # Make sure that round down does not go down by more than 10%. if new_value < 0.9 * value: new_value += divisor return int(new_value)