def METHOD_NAME(E, m, p):
    bad_primes, conductor, root_number = sympowlmfdb.local_data(E, m)
    bad_P_poly = {}
    bad_P_list = [i for (i, _) in bad_primes]
    for j in bad_primes:
        a, b = j
        bad_P_poly[a] = b
    if p in bad_P_list:
        return bad_P_poly[p]
    m = sage.rings.all.Integer(m)
    # E=EllipticCurve(E)
    R = sage.rings.all.PolynomialRing(sage.rings.all.RationalField(), 't')
    t = R('t')
    F = 1
    print(type(F))
    for i in range((m - 1) // 2 + 1):
        s = m - 2 * i
        s2 = s // 2
        ap = E.ap(p)
        TI = sum([tbin(s, s2 - k) * ap ** (2 * k) * p ** (s2 - k) for k in range(s2 + 1)])
        if s % 2 != 0:
            TI = ap * TI
        F = F * (1 - TI * p ** i * t + p ** m * t ** 2)
    if m % 2 == 0:
        F = F * (1 - p ** (m / 2) * t)
    return F.coeffs()