def METHOD_NAME(n, x=None, **args):
    """Generates cyclotomic polynomial of order `n` in `x`."""
    if n <= 0:
        raise ValueError(
            f"can't generate cyclotomic polynomial of order {n}")
    R = ZZ.inject('_0')
    poly = R._zz_cyclotomic_poly(int(n)).all_coeffs()
    if x is not None:
        poly = polytools.Poly(poly, x)
    else:
        poly = polytools.PurePoly(poly, Dummy('x'))
    if not args.get('polys', False):
        return poly.as_expr()
    return poly